fix: clean up hotel and its typings
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { meetingRoomsSchema } from "@/server/routers/hotels/schemas/meetingRoom"
|
||||
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { getMeetingRoomsSchema } from "@/server/routers/hotels/output"
|
||||
|
||||
export type MeetingRoomData = z.infer<typeof getMeetingRoomsSchema>
|
||||
export type MeetingRoomData = z.output<typeof meetingRoomsSchema>
|
||||
export type MeetingRooms = MeetingRoomData["data"]
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { RoomData } from "@/types/hotel"
|
||||
import type { Room } from "@/types/hotel"
|
||||
|
||||
export interface RoomCardProps {
|
||||
room: RoomData
|
||||
room: Room
|
||||
}
|
||||
|
||||
export type RoomsProps = {
|
||||
rooms: RoomData[]
|
||||
preamble?: string
|
||||
rooms: Room[]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type {
|
||||
Hotel,
|
||||
RestaurantData,
|
||||
Restaurant,
|
||||
RestaurantOpeningHours,
|
||||
} from "@/types/hotel"
|
||||
import type { ParkingAmenityProps } from "./parking"
|
||||
@@ -10,7 +10,7 @@ export type AmenitiesSidePeekProps = {
|
||||
parking: ParkingAmenityProps
|
||||
checkInInformation: Hotel["hotelFacts"]["checkin"]
|
||||
accessibility: Hotel["hotelFacts"]["hotelInformation"]["accessibility"]
|
||||
restaurants: RestaurantData[]
|
||||
restaurants: Restaurant[]
|
||||
}
|
||||
|
||||
export type FilteredAmenitiesProps = {
|
||||
|
||||
@@ -1,27 +1,29 @@
|
||||
import type { Hotel } from "@/types/hotel"
|
||||
import type { Hotel, Parking } from "@/types/hotel"
|
||||
|
||||
export enum Periods {
|
||||
allDay = "AllDay",
|
||||
day = "Day",
|
||||
night = "Night",
|
||||
allDay = "AllDay",
|
||||
}
|
||||
|
||||
export type ParkingAmenityProps = {
|
||||
hasExtraParkingPage: boolean
|
||||
parking: Hotel["parking"]
|
||||
parkingElevatorPitch: string
|
||||
hasExtraParkingPage: boolean
|
||||
}
|
||||
|
||||
export type ParkingListProps = {
|
||||
numberOfChargingSpaces: Hotel["parking"][number]["numberOfChargingSpaces"]
|
||||
canMakeReservation: Hotel["parking"][number]["canMakeReservation"]
|
||||
numberOfParkingSpots: Hotel["parking"][number]["numberOfParkingSpots"]
|
||||
distanceToHotel: Hotel["parking"][number]["distanceToHotel"]
|
||||
address: Hotel["parking"][number]["address"]
|
||||
}
|
||||
export interface ParkingListProps
|
||||
extends Pick<
|
||||
Parking,
|
||||
| "address"
|
||||
| "canMakeReservation"
|
||||
| "distanceToHotel"
|
||||
| "numberOfChargingSpaces"
|
||||
| "numberOfParkingSpots"
|
||||
> { }
|
||||
|
||||
export type ParkingPricesProps = {
|
||||
pricing: Hotel["parking"][number]["pricing"]["localCurrency"]["ordinary"]
|
||||
currency: Hotel["parking"][number]["pricing"]["localCurrency"]["currency"]
|
||||
freeParking: Hotel["parking"][number]["pricing"]["freeParking"]
|
||||
export interface ParkingPricesProps
|
||||
extends Pick<Parking["pricing"], "freeParking">,
|
||||
Pick<NonNullable<Parking["pricing"]["localCurrency"]>, "currency"> {
|
||||
pricing: NonNullable<Parking["pricing"]["localCurrency"]>["ordinary"]
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { RestaurantData } from "@/types/hotel"
|
||||
import type { Restaurant } from "@/types/hotel"
|
||||
|
||||
export interface RestaurantBarSidePeekProps {
|
||||
restaurants: RestaurantData[]
|
||||
restaurants: Restaurant[]
|
||||
}
|
||||
|
||||
export interface RestaurantBarItemProps {
|
||||
restaurant: RestaurantData
|
||||
restaurant: Restaurant
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { RoomData } from "@/types/hotel"
|
||||
import type { Room } from "@/types/hotel"
|
||||
|
||||
export interface RoomSidePeekProps {
|
||||
room: RoomData
|
||||
room: Room
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@ export interface BookingConfirmationProps {
|
||||
confirmationNumber: string
|
||||
}
|
||||
|
||||
export interface ConfirmationProps extends BookingConfirmation {}
|
||||
export interface ConfirmationProps extends BookingConfirmation { }
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
import { type z } from "zod"
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { breakfastFormSchema } from "@/components/HotelReservation/EnterDetails/Breakfast/schema"
|
||||
import type {
|
||||
breakfastPackageSchema,
|
||||
breakfastPackagesSchema,
|
||||
} from "@/server/routers/hotels/output"
|
||||
import type { breakfastPackagesSchema } from "@/server/routers/hotels/output"
|
||||
import type { breakfastPackageSchema } from "@/server/routers/hotels/schemas/packages"
|
||||
|
||||
export interface BreakfastFormSchema
|
||||
extends z.output<typeof breakfastFormSchema> {}
|
||||
extends z.output<typeof breakfastFormSchema> { }
|
||||
|
||||
export interface BreakfastPackages
|
||||
extends z.output<typeof breakfastPackagesSchema> {}
|
||||
extends z.output<typeof breakfastPackagesSchema> { }
|
||||
|
||||
export interface BreakfastPackage
|
||||
extends z.output<typeof breakfastPackageSchema> {}
|
||||
extends z.output<typeof breakfastPackageSchema> { }
|
||||
|
||||
export interface BreakfastProps {
|
||||
packages: BreakfastPackages
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import type { RouterOutput } from "@/lib/trpc/client"
|
||||
|
||||
type HotelDataGet = RouterOutput["hotel"]["hotelData"]["get"]
|
||||
import type { HotelData } from "@/types/hotel"
|
||||
|
||||
export interface HotelHeaderProps {
|
||||
hotelData: NonNullable<HotelDataGet>
|
||||
hotelData: HotelData
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { RoomConfiguration } from "@/server/routers/hotels/output"
|
||||
import type { RoomConfiguration } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
|
||||
export interface SelectedRoomProps {
|
||||
hotelId: string
|
||||
room: RoomConfiguration
|
||||
rateDescription: string
|
||||
room: RoomConfiguration
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Child } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import type { RoomAvailability } from "@/types/trpc/routers/hotel/availability"
|
||||
import type { RoomAvailability } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
|
||||
export interface ClientSummaryProps
|
||||
extends Pick<
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { ProductType } from "@/server/routers/hotels/output"
|
||||
import type { ProductType } from "@/types/trpc/routers/hotel/availability"
|
||||
|
||||
export type HotelPriceListProps = {
|
||||
price: ProductType
|
||||
hotelId: string
|
||||
price: ProductType
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
import type { Hotel } from "@/types/hotel"
|
||||
import type { ProductType } from "@/server/routers/hotels/output"
|
||||
import type { ProductType } from "@/types/trpc/routers/hotel/availability"
|
||||
|
||||
export enum HotelCardListingTypeEnum {
|
||||
MapListing = "mapListing",
|
||||
PageListing = "pageListing",
|
||||
}
|
||||
|
||||
export type HotelCardListingProps = {
|
||||
hotelData: HotelData[]
|
||||
type?: HotelCardListingTypeEnum
|
||||
}
|
||||
|
||||
export type HotelData = {
|
||||
hotelData: Hotel
|
||||
price: ProductType
|
||||
}
|
||||
|
||||
export type HotelCardListingProps = {
|
||||
hotelData: HotelData[]
|
||||
type?: HotelCardListingTypeEnum
|
||||
}
|
||||
|
||||
export interface NullableHotelData extends Omit<HotelData, "hotelData"> {
|
||||
hotelData: HotelData["hotelData"] | null
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ProductTypePrices } from "@/server/routers/hotels/output"
|
||||
import type { ProductTypePrices } from "@/types/trpc/routers/hotel/availability"
|
||||
|
||||
export type PriceCardProps = {
|
||||
productTypePrices: ProductTypePrices
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import type { CheckInData, Hotel, ParkingData } from "@/types/hotel"
|
||||
import type { HotelLocation } from "@/types/trpc/routers/hotel/locations"
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import type {
|
||||
AlternativeHotelsSearchParams,
|
||||
SelectHotelSearchParams,
|
||||
} from "./selectHotelSearchParams"
|
||||
import type { CheckInData, Hotel, Parking } from "@/types/hotel"
|
||||
import type { Lang } from "@/constants/languages"
|
||||
|
||||
export enum AvailabilityEnum {
|
||||
Available = "Available",
|
||||
@@ -23,7 +22,7 @@ export interface ContactProps {
|
||||
}
|
||||
|
||||
export interface ParkingProps {
|
||||
parking: ParkingData[]
|
||||
parking: Parking[]
|
||||
}
|
||||
|
||||
export interface AccessibilityProps {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type {
|
||||
priceSchema,
|
||||
Product,
|
||||
productTypePriceSchema,
|
||||
RoomConfiguration,
|
||||
} from "@/server/routers/hotels/output"
|
||||
} from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type {
|
||||
priceSchema,
|
||||
productTypePriceSchema,
|
||||
} from "@/server/routers/hotels/schemas/productTypePrice"
|
||||
import type { RoomPackage } from "./roomFilter"
|
||||
|
||||
type ProductPrice = z.output<typeof productTypePriceSchema>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import type { Child } from "./selectRate"
|
||||
|
||||
export interface HotelInfoCardProps {
|
||||
adultCount: number
|
||||
childArray?: Child[]
|
||||
fromDate: Date
|
||||
hotelId: number
|
||||
lang: Lang
|
||||
toDate: Date
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { RoomsAvailability } from "@/server/routers/hotels/output"
|
||||
import type { RoomPackageData } from "./roomFilter"
|
||||
import type { RoomsAvailability } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type { RoomPackages } from "./roomFilter"
|
||||
import type { Rate } from "./selectRate"
|
||||
|
||||
export interface RateSummaryProps {
|
||||
isUserLoggedIn: boolean
|
||||
packages: RoomPackageData | undefined
|
||||
packages: RoomPackages | undefined
|
||||
roomsAvailability: RoomsAvailability
|
||||
}
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { RoomData } from "@/types/hotel"
|
||||
import type { Room } from "@/types/hotel"
|
||||
import type {
|
||||
packagePriceSchema,
|
||||
RateDefinition,
|
||||
RoomConfiguration,
|
||||
} from "@/server/routers/hotels/output"
|
||||
} from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type { packagePriceSchema } from "@/server/routers/hotels/schemas/packages"
|
||||
import type { RoomPriceSchema } from "./flexibilityOption"
|
||||
import type { RoomPackageCodes, RoomPackageData } from "./roomFilter"
|
||||
import type { RoomPackageCodes, RoomPackages } from "./roomFilter"
|
||||
import type { RateCode } from "./selectRate"
|
||||
|
||||
export type RoomCardProps = {
|
||||
hotelId: string
|
||||
hotelType: string | undefined
|
||||
roomConfiguration: RoomConfiguration
|
||||
rateDefinitions: RateDefinition[]
|
||||
roomCategories: RoomData[]
|
||||
roomCategories: Room[]
|
||||
selectedPackages: RoomPackageCodes[]
|
||||
packages: RoomPackageData | undefined
|
||||
roomListIndex: number
|
||||
packages: RoomPackages | undefined
|
||||
handleSelectRate: React.Dispatch<React.SetStateAction<RateCode | undefined>>
|
||||
}
|
||||
|
||||
type RoomPackagePriceSchema = z.output<typeof packagePriceSchema>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { packagesSchema } from "@/server/routers/hotels/output"
|
||||
import type { packageSchema } from "@/server/routers/hotels/schemas/packages"
|
||||
|
||||
export enum RoomPackageCodeEnum {
|
||||
PET_ROOM = "PETR",
|
||||
@@ -24,7 +24,6 @@ export interface RoomFilterProps {
|
||||
roomListIndex: number
|
||||
}
|
||||
|
||||
export type RoomPackage = z.output<typeof packagesSchema>
|
||||
export interface RoomPackageData extends Array<RoomPackage> {}
|
||||
|
||||
export type RoomPackage = z.output<typeof packageSchema>
|
||||
export type RoomPackageCodes = RoomPackage["code"]
|
||||
export type RoomPackages = RoomPackage[]
|
||||
|
||||
@@ -1,31 +1,32 @@
|
||||
import type { RoomData } from "@/types/hotel"
|
||||
import type { RoomsAvailability } from "@/server/routers/hotels/output"
|
||||
import type {
|
||||
DefaultFilterOptions,
|
||||
RoomPackage,
|
||||
RoomPackageCodes,
|
||||
RoomPackageData,
|
||||
RoomPackages,
|
||||
} from "./roomFilter"
|
||||
|
||||
import type { Room } from "@/types/hotel"
|
||||
import type { RoomsAvailability } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
|
||||
export interface RoomTypeListProps {
|
||||
roomsAvailability: RoomsAvailability
|
||||
roomCategories: RoomData[]
|
||||
availablePackages: RoomPackageData | undefined
|
||||
roomCategories: Room[]
|
||||
availablePackages: RoomPackage | undefined
|
||||
selectedPackages: RoomPackageCodes[]
|
||||
hotelType: string | undefined
|
||||
roomListIndex: number
|
||||
}
|
||||
|
||||
export interface SelectRateProps {
|
||||
roomsAvailability: RoomsAvailability
|
||||
roomCategories: RoomData[]
|
||||
availablePackages: RoomPackageData
|
||||
availablePackages: RoomPackages
|
||||
hotelType: string | undefined
|
||||
isUserLoggedIn: boolean
|
||||
roomsAvailability: RoomsAvailability
|
||||
roomCategories: Room[]
|
||||
}
|
||||
|
||||
export interface RoomSelectionPanelProps {
|
||||
roomCategories: RoomData[]
|
||||
roomCategories: Room[]
|
||||
availablePackages: RoomPackage[]
|
||||
selectedPackages: RoomPackageCodes[]
|
||||
hotelType: string | undefined
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import type { Child } from "./selectRate"
|
||||
|
||||
export interface RoomsContainerProps {
|
||||
adultCount: number
|
||||
childArray?: Child[]
|
||||
fromDate: Date
|
||||
hotelId: number
|
||||
lang: Lang
|
||||
toDate: Date
|
||||
}
|
||||
@@ -1,4 +1,7 @@
|
||||
import type { Product, RoomConfiguration } from "@/server/routers/hotels/output"
|
||||
import type {
|
||||
Product,
|
||||
RoomConfiguration,
|
||||
} from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type { ChildBedMapEnum } from "../../bookingWidget/enums"
|
||||
import type { RoomPackageCodeEnum } from "./roomFilter"
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Hotel } from "@/types/hotel"
|
||||
import { HotelData } from "@/types/hotel"
|
||||
|
||||
export enum SidePeekEnum {
|
||||
hotelDetails = "hotel-detail-side-peek",
|
||||
roomDetails = "room-detail-side-peek",
|
||||
}
|
||||
|
||||
export type SidePeekProps = {
|
||||
hotel: Hotel
|
||||
export type HotelReservationSidePeekProps = {
|
||||
hotel: HotelData | null
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ import type {
|
||||
Price,
|
||||
RoomPrice,
|
||||
} from "@/types/stores/enter-details"
|
||||
import type { RoomAvailability } from "@/types/trpc/routers/hotel/availability"
|
||||
import type { BedTypeSchema } from "./enterDetails/bedType"
|
||||
import type { BreakfastPackage } from "./enterDetails/breakfast"
|
||||
import type { DetailsSchema } from "./enterDetails/details"
|
||||
import type { Child, SelectRateSearchParams } from "./selectRate/selectRate"
|
||||
import type { RoomAvailability } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
|
||||
export type RoomsData = Pick<DetailsState, "roomPrice"> &
|
||||
Pick<RoomAvailability, "cancellationText" | "rateDetails"> &
|
||||
@@ -21,7 +21,7 @@ export type RoomsData = Pick<DetailsState, "roomPrice"> &
|
||||
|
||||
export interface SummaryProps
|
||||
extends Pick<RoomAvailability, "cancellationText" | "rateDetails">,
|
||||
Pick<RoomAvailability["selectedRoom"], "roomType"> {
|
||||
Pick<RoomAvailability["selectedRoom"], "roomType"> {
|
||||
isMember: boolean
|
||||
breakfastIncluded: boolean
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { poiVariants } from "@/components/Maps/Markers/Poi/variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
import type { PointOfInterestGroupEnum } from "@/types/hotel"
|
||||
import type { PointOfInterestGroupEnum } from "@/types/enums/pointOfInterest"
|
||||
import type { poiVariants } from "@/components/Maps/Markers/Poi/variants"
|
||||
|
||||
export interface PoiMarkerProps extends VariantProps<typeof poiVariants> {
|
||||
group: PointOfInterestGroupEnum
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { SidePeekEnum } from "../hotelReservation/sidePeek"
|
||||
|
||||
import type { RoomData } from "@/types/hotel"
|
||||
import type { Room } from "@/types/hotel"
|
||||
import type { SidePeekEnum } from "../hotelReservation/sidePeek"
|
||||
|
||||
export type RoomSidePeekProps = {
|
||||
room: RoomData
|
||||
room: Room
|
||||
activeSidePeek: SidePeekEnum | null
|
||||
close: () => void
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
export enum PointOfInterestGroupEnum {
|
||||
PUBLIC_TRANSPORT = "Public transport",
|
||||
ATTRACTIONS = "Attractions",
|
||||
BUSINESS = "Business",
|
||||
LOCATION = "Location",
|
||||
PARKING = "Parking",
|
||||
SHOPPING_DINING = "Shopping & Dining",
|
||||
}
|
||||
+50
-50
@@ -1,66 +1,66 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type {
|
||||
checkinSchema,
|
||||
getHotelDataSchema,
|
||||
parkingSchema,
|
||||
pointOfInterestSchema,
|
||||
} from "@/server/routers/hotels/output"
|
||||
import type { hotelSchema } from "@/server/routers/hotels/output"
|
||||
import type { citySchema } from "@/server/routers/hotels/schemas/city"
|
||||
import type { attributesSchema } from "@/server/routers/hotels/schemas/hotel"
|
||||
import type { addressSchema } from "@/server/routers/hotels/schemas/hotel/address"
|
||||
import type { hotelContentSchema } from "@/server/routers/hotels/schemas/hotel/content"
|
||||
import type { detailedFacilitiesSchema } from "@/server/routers/hotels/schemas/hotel/detailedFacility"
|
||||
import type { checkinSchema } from "@/server/routers/hotels/schemas/hotel/facts"
|
||||
import type { nearbyHotelsSchema } from "@/server/routers/hotels/schemas/hotel/include/nearbyHotels"
|
||||
import type { restaurantsSchema } from "@/server/routers/hotels/schemas/hotel/include/restaurants"
|
||||
import type { transformRoomCategories } from "@/server/routers/hotels/schemas/hotel/include/roomCategories"
|
||||
import type { locationSchema } from "@/server/routers/hotels/schemas/hotel/location"
|
||||
import type { parkingSchema } from "@/server/routers/hotels/schemas/hotel/parking"
|
||||
import type { pointOfInterestSchema } from "@/server/routers/hotels/schemas/hotel/poi"
|
||||
import type { ratingsSchema } from "@/server/routers/hotels/schemas/hotel/rating"
|
||||
import type { imageSchema } from "@/server/routers/hotels/schemas/image"
|
||||
import { restaurantOpeningHoursSchema } from "@/server/routers/hotels/schemas/restaurants"
|
||||
import { healthFacilitySchema } from "@/server/routers/hotels/schemas/hotel/healthFacilities"
|
||||
import type {
|
||||
additionalDataSchema,
|
||||
extraPageSchema,
|
||||
facilitySchema,
|
||||
transformAdditionalData,
|
||||
} from "@/server/routers/hotels/schemas/additionalData"
|
||||
import type { imageSchema } from "@/server/routers/hotels/schemas/image"
|
||||
import type {
|
||||
restaurantOpeningHoursSchema,
|
||||
restaurantSchema,
|
||||
} from "@/server/routers/hotels/schemas/restaurants"
|
||||
import type { roomSchema } from "@/server/routers/hotels/schemas/room"
|
||||
|
||||
export type HotelData = z.output<typeof getHotelDataSchema>
|
||||
export type HotelData = z.output<typeof hotelSchema>
|
||||
|
||||
export type Hotel = HotelData["data"]["attributes"]
|
||||
export type HotelAddress = HotelData["data"]["attributes"]["address"]
|
||||
export type HotelLocation = HotelData["data"]["attributes"]["location"]
|
||||
export type Amenities = HotelData["data"]["attributes"]["detailedFacilities"]
|
||||
export type HealthFacilities =
|
||||
HotelData["data"]["attributes"]["healthFacilities"]
|
||||
export type Amenities = z.output<typeof detailedFacilitiesSchema>
|
||||
export type CheckInData = z.output<typeof checkinSchema>
|
||||
type CitySchema = z.output<typeof citySchema>
|
||||
export type City = Pick<CitySchema, "id" | "type"> & CitySchema["attributes"]
|
||||
export type Facility = z.output<typeof facilitySchema> & { id: string }
|
||||
export type GalleryImage = z.output<typeof imageSchema>
|
||||
export type HealthFacility = z.output<typeof healthFacilitySchema>
|
||||
export type HealthFacilities = HealthFacility[]
|
||||
export type Hotel = z.output<typeof attributesSchema>
|
||||
export type HotelAddress = z.output<typeof addressSchema>
|
||||
export type HotelContent = z.output<typeof hotelContentSchema>
|
||||
export type HotelLocation = z.output<typeof locationSchema>
|
||||
export type HotelRatings = z.output<typeof ratingsSchema>
|
||||
type NearbyHotelsSchema = z.output<typeof nearbyHotelsSchema>
|
||||
export type NearbyHotel = Pick<NearbyHotelsSchema, "id" | "type"> &
|
||||
NearbyHotelsSchema["attributes"]
|
||||
export type Parking = z.output<typeof parkingSchema>
|
||||
export type PointOfInterest = z.output<typeof pointOfInterestSchema>
|
||||
type RestaurantSchema = z.output<typeof restaurantsSchema>
|
||||
export type RestaurantOpeningHours = z.output<typeof restaurantOpeningHoursSchema>
|
||||
export type Restaurant = Pick<RestaurantSchema, "id" | "type"> &
|
||||
RestaurantSchema["attributes"]
|
||||
export type Room = ReturnType<typeof transformRoomCategories>
|
||||
|
||||
type HotelRatings = HotelData["data"]["attributes"]["ratings"]
|
||||
export type HotelMapContentProps = {
|
||||
activePoi?: string | null
|
||||
coordinates: { lat: number; lng: number }
|
||||
onActivePoiChange?: (poiName: string | null) => void
|
||||
pointsOfInterest: PointOfInterest[]
|
||||
}
|
||||
export type HotelTripAdvisor =
|
||||
| NonNullable<HotelRatings>["tripAdvisor"]
|
||||
| undefined
|
||||
|
||||
export type RoomData = z.infer<typeof roomSchema>
|
||||
export type RestaurantData = z.output<typeof restaurantSchema>
|
||||
export type RestaurantOpeningHours = z.output<
|
||||
typeof restaurantOpeningHoursSchema
|
||||
>
|
||||
export type GalleryImage = z.infer<typeof imageSchema>
|
||||
export type CheckInData = z.infer<typeof checkinSchema>
|
||||
export type AdditionalData = ReturnType<typeof transformAdditionalData>
|
||||
|
||||
export type AdditionalData = z.infer<typeof additionalDataSchema>
|
||||
export type ExtraPageSchema = z.output<typeof extraPageSchema>
|
||||
|
||||
export type ExtraPageSchema = z.infer<typeof extraPageSchema>
|
||||
|
||||
export type PointOfInterest = z.output<typeof pointOfInterestSchema>
|
||||
|
||||
export enum PointOfInterestGroupEnum {
|
||||
PUBLIC_TRANSPORT = "Public transport",
|
||||
ATTRACTIONS = "Attractions",
|
||||
BUSINESS = "Business",
|
||||
LOCATION = "Location",
|
||||
PARKING = "Parking",
|
||||
SHOPPING_DINING = "Shopping & Dining",
|
||||
}
|
||||
|
||||
export type ParkingData = z.infer<typeof parkingSchema>
|
||||
export type Facility = z.infer<typeof facilitySchema> & { id: string }
|
||||
|
||||
export type HotelMapContentProps = {
|
||||
coordinates: { lat: number; lng: number }
|
||||
pointsOfInterest: PointOfInterest[]
|
||||
onActivePoiChange?: (poiName: string | null) => void
|
||||
activePoi?: string | null
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { BedTypeSelection } from "@/types/components/hotelReservation/enterDetails/bedType"
|
||||
import type { StepEnum } from "@/types/enums/step"
|
||||
import type { RoomAvailability } from "@/types/trpc/routers/hotel/availability"
|
||||
import type { RoomAvailability } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type { SafeUser } from "@/types/user"
|
||||
import type { SelectRateSearchParams } from "../components/hotelReservation/selectRate/selectRate"
|
||||
import type { Packages } from "../requests/packages"
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { z } from "zod"
|
||||
import type { z } from "zod"
|
||||
|
||||
import {
|
||||
getBreakfastPackageInputSchema,
|
||||
getRoomPackagesInputSchema,
|
||||
import type {
|
||||
breakfastPackageInputSchema,
|
||||
roomPackagesInputSchema,
|
||||
} from "@/server/routers/hotels/input"
|
||||
import { getRoomPackagesSchema } from "@/server/routers/hotels/output"
|
||||
import type { packagesSchema } from "@/server/routers/hotels/output"
|
||||
|
||||
export interface BreackfastPackagesInput
|
||||
extends z.input<typeof getBreakfastPackageInputSchema> {}
|
||||
extends z.input<typeof breakfastPackageInputSchema> {}
|
||||
|
||||
export interface PackagesInput
|
||||
extends z.input<typeof getRoomPackagesInputSchema> {}
|
||||
extends z.input<typeof roomPackagesInputSchema> {}
|
||||
|
||||
export interface Packages extends z.output<typeof getRoomPackagesSchema> {}
|
||||
export type Packages = z.output<typeof packagesSchema>
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { Hotel, RoomData } from "@/types/hotel"
|
||||
import type { Hotel, Room } from "@/types/hotel"
|
||||
import type { bookingConfirmationSchema } from "@/server/routers/booking/output"
|
||||
|
||||
export interface BookingConfirmationSchema
|
||||
extends z.output<typeof bookingConfirmationSchema> {}
|
||||
extends z.output<typeof bookingConfirmationSchema> { }
|
||||
|
||||
export interface BookingConfirmation {
|
||||
booking: BookingConfirmationSchema
|
||||
hotel: Hotel & {
|
||||
included?: {
|
||||
rooms: RoomData[] | undefined
|
||||
}
|
||||
}
|
||||
hotel: Hotel
|
||||
room:
|
||||
| (RoomData & {
|
||||
bedType: RoomData["roomTypes"][number]
|
||||
})
|
||||
| null
|
||||
| (Room & {
|
||||
bedType: Room["roomTypes"][number]
|
||||
})
|
||||
| null
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import type { RouterOutput } from "@/lib/trpc/client"
|
||||
import type { z } from "zod"
|
||||
|
||||
export type RoomAvailability = NonNullable<
|
||||
RouterOutput["hotel"]["availability"]["room"]
|
||||
>
|
||||
import type { hotelsAvailabilitySchema } from "@/server/routers/hotels/output"
|
||||
import type { productTypeSchema } from "@/server/routers/hotels/schemas/availability/productType"
|
||||
import type { productTypePriceSchema } from "@/server/routers/hotels/schemas/productTypePrice"
|
||||
|
||||
export type HotelsAvailability = z.output<typeof hotelsAvailabilitySchema>
|
||||
export type ProductType = z.output<typeof productTypeSchema>
|
||||
export type ProductTypePrices = z.output<typeof productTypePriceSchema>
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { hotelFilterSchema } from "@/server/routers/hotels/schemas/hotelFilter"
|
||||
|
||||
export type HotelFilter = z.output<typeof hotelFilterSchema>
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { Room } from "@/types/hotel"
|
||||
import type {
|
||||
cityCoordinatesInputSchema,
|
||||
hotelInputSchema,
|
||||
} from "@/server/routers/hotels/input"
|
||||
|
||||
export type CityCoordinatesInput = z.input<typeof cityCoordinatesInputSchema>
|
||||
export type HotelInput = z.input<typeof hotelInputSchema>
|
||||
|
||||
export type RoomType = Pick<Room, "roomTypes" | "name">
|
||||
@@ -1,8 +1,12 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { apiLocationsSchema } from "@/server/routers/hotels/output"
|
||||
import type {
|
||||
citiesByCountrySchema,
|
||||
countriesSchema,
|
||||
locationsSchema,
|
||||
} from "@/server/routers/hotels/output"
|
||||
|
||||
export interface LocationSchema extends z.output<typeof apiLocationsSchema> {}
|
||||
export interface LocationSchema extends z.output<typeof locationsSchema> { }
|
||||
|
||||
export type Locations = LocationSchema["data"]
|
||||
export type Location = Locations[number]
|
||||
@@ -15,3 +19,8 @@ export function isHotelLocation(
|
||||
): location is HotelLocation {
|
||||
return location?.type === "hotels"
|
||||
}
|
||||
export interface CitiesByCountry
|
||||
extends z.output<typeof citiesByCountrySchema> { }
|
||||
export type CitiesGroupedByCountry = Record<string, CitiesByCountry["data"]>
|
||||
|
||||
export interface Countries extends z.output<typeof countriesSchema> { }
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { rateSchema } from "@/server/routers/hotels/schemas/rate"
|
||||
|
||||
export type Rate = z.output<typeof rateSchema>
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { z } from "zod"
|
||||
|
||||
import type { RouterOutput } from "@/lib/trpc/client"
|
||||
import type { roomsAvailabilitySchema } from "@/server/routers/hotels/output"
|
||||
import type { roomConfigurationSchema } from "@/server/routers/hotels/schemas/roomAvailability/configuration"
|
||||
import type { productSchema } from "@/server/routers/hotels/schemas/roomAvailability/product"
|
||||
import type { rateDefinitionSchema } from "@/server/routers/hotels/schemas/roomAvailability/rateDefinition"
|
||||
|
||||
export type RoomAvailability = NonNullable<
|
||||
RouterOutput["hotel"]["availability"]["room"]
|
||||
>
|
||||
|
||||
export type Product = z.output<typeof productSchema>
|
||||
export type RateDefinition = z.output<typeof rateDefinitionSchema>
|
||||
export type RoomConfiguration = z.output<typeof roomConfigurationSchema>
|
||||
export type RoomsAvailability = z.output<typeof roomsAvailabilitySchema>
|
||||
Reference in New Issue
Block a user