feat: add multiroom tracking to booking flow
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { Hotel } from "@/types/hotel"
|
||||
import type { ProductType } from "@/types/trpc/routers/hotel/availability"
|
||||
import type { HotelResponse } from "@/components/HotelReservation/SelectHotel/helpers"
|
||||
|
||||
export enum HotelCardListingTypeEnum {
|
||||
MapListing = "mapListing",
|
||||
@@ -12,7 +13,7 @@ export type HotelData = {
|
||||
}
|
||||
|
||||
export type HotelCardListingProps = {
|
||||
hotelData: HotelData[]
|
||||
hotelData: HotelResponse[]
|
||||
type?: HotelCardListingTypeEnum
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import {
|
||||
type HotelCardListingTypeEnum,
|
||||
type HotelData,
|
||||
} from "./hotelCardListingProps"
|
||||
import type { HotelResponse } from "@/components/HotelReservation/SelectHotel/helpers"
|
||||
import type { HotelCardListingTypeEnum } from "./hotelCardListingProps"
|
||||
|
||||
export type HotelCardProps = {
|
||||
hotel: HotelData
|
||||
hotelData: HotelResponse
|
||||
isUserLoggedIn: boolean
|
||||
type?: HotelCardListingTypeEnum
|
||||
state?: "default" | "active"
|
||||
|
||||
@@ -2,8 +2,8 @@ import type { z } from "zod"
|
||||
|
||||
import type { Coordinates } from "@/types/components/maps/coordinates"
|
||||
import type { Amenities } from "@/types/hotel"
|
||||
import type { HotelResponse } from "@/components/HotelReservation/SelectHotel/helpers"
|
||||
import type { imageSchema } from "@/server/routers/hotels/schemas/image"
|
||||
import type { HotelData } from "./hotelCardListingProps"
|
||||
import type { CategorizedFilters } from "./hotelFilters"
|
||||
import type {
|
||||
AlternativeHotelsSearchParams,
|
||||
@@ -11,14 +11,14 @@ import type {
|
||||
} from "./selectHotelSearchParams"
|
||||
|
||||
export interface HotelListingProps {
|
||||
hotels: HotelData[]
|
||||
hotels: HotelResponse[]
|
||||
}
|
||||
|
||||
export interface SelectHotelMapProps {
|
||||
apiKey: string
|
||||
hotelPins: HotelPin[]
|
||||
mapId: string
|
||||
hotels: HotelData[]
|
||||
hotels: HotelResponse[]
|
||||
filterList: CategorizedFilters
|
||||
cityCoordinates: Coordinates
|
||||
bookingCode: string | undefined
|
||||
@@ -66,7 +66,7 @@ export interface HotelCardDialogImageProps {
|
||||
}
|
||||
|
||||
export interface HotelCardDialogListingProps {
|
||||
hotels: HotelData[] | null
|
||||
hotels: HotelResponse[]
|
||||
}
|
||||
|
||||
export type SelectHotelMapContainerProps = {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import type { HotelData } from "./hotelCardListingProps"
|
||||
import type { Hotel } from "@/types/hotel"
|
||||
|
||||
export type NoAvailabilityAlertProp = {
|
||||
hotelsLength: number
|
||||
isAllUnavailable: boolean
|
||||
isAlternative?: boolean
|
||||
hotels: HotelData[]
|
||||
operaId: Hotel["operaId"]
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import type { HotelData } from "@/types/hotel"
|
||||
import type { Child, SelectRateSearchParams } from "./selectRate"
|
||||
import type { ChildrenInRoom } from "@/utils/hotelSearchDetails"
|
||||
import type { SelectRateSearchParams } from "./selectRate"
|
||||
|
||||
export interface RoomsContainerProps {
|
||||
adultArray: number[]
|
||||
booking: SelectRateSearchParams
|
||||
bookingCode?: string
|
||||
childArray?: Child[]
|
||||
childArray: ChildrenInRoom
|
||||
fromDate: Date
|
||||
hotelData: HotelData | null
|
||||
hotelId: number
|
||||
|
||||
@@ -47,46 +47,46 @@ export type TrackingSDKUserData = {
|
||||
}
|
||||
|
||||
export type TrackingSDKHotelInfo = {
|
||||
hotelID?: string
|
||||
arrivalDate?: string
|
||||
departureDate?: string
|
||||
noOfAdults?: number
|
||||
noOfChildren?: number
|
||||
ageOfChildren?: string // "10", "2,5,10"
|
||||
//rewardNight?: boolean
|
||||
ancillaries?: Ancillary[]
|
||||
analyticsRateCode?: "flex" | "change" | "save" | string
|
||||
arrivalDate?: string
|
||||
availableResults?: number // Number of hotels to choose from after a city search
|
||||
bedType?: string
|
||||
bedTypePosition?: number // Which position the bed type had in the list of available bed types
|
||||
bnr?: string // Booking number
|
||||
breakfastOption?: string // "no breakfast" or "breakfast buffet"
|
||||
//bonuscheque?: boolean
|
||||
//bookingCode?: string
|
||||
//bookingCodeAvailability?: boolean
|
||||
leadTime?: number // Number of days from booking date until arrivalDate
|
||||
noOfRooms?: number
|
||||
//bonuscheque?: boolean
|
||||
childBedPreference?: string
|
||||
duration?: number // Number of nights to stay
|
||||
availableResults?: number // Number of hotels to choose from after a city search
|
||||
bookingTypeofDay?: "weekend" | "weekday"
|
||||
searchTerm?: string
|
||||
roomPrice?: number
|
||||
childBedPreference?: string
|
||||
country?: string // Country of the hotel
|
||||
departureDate?: string
|
||||
discount?: number
|
||||
duration?: number // Number of nights to stay
|
||||
hotelID?: string
|
||||
leadTime?: number // Number of days from booking date until arrivalDate
|
||||
lowestRoomPrice?: number
|
||||
//modifyValues?: string // <price:<value>,roomtype:value>,bed:<value,<breakfast:value>
|
||||
noOfAdults?: number | string // multiroom support, "2,1,3"
|
||||
noOfChildren?: number | string // multiroom support, "2,1,3"
|
||||
noOfRooms?: number
|
||||
//rewardNight?: boolean
|
||||
rateCode?: string
|
||||
rateCodeCancellationRule?: string
|
||||
rateCodeName?: string // Scandic Friends - full flex inkl. frukost
|
||||
rateCodeType?: string // regular, promotion etc
|
||||
revenueCurrencyCode?: string // SEK, DKK, NOK, EUR
|
||||
roomTypeCode?: string
|
||||
roomTypePosition?: number // Which position the room had in the list of available rooms
|
||||
roomTypeName?: string
|
||||
bedType?: string
|
||||
bedTypePosition?: number // Which position the bed type had in the list of available bed types
|
||||
breakfastOption?: string // "no breakfast" or "breakfast buffet"
|
||||
bnr?: string // Booking number
|
||||
analyticsrateCode?: "flex" | "change" | "save" | string
|
||||
specialRoomType?: string // allergy room, pet-friendly, accesibillity room
|
||||
//modifyValues?: string // <price:<value>,roomtype:value>,bed:<value,<breakfast:value>
|
||||
country?: string // Country of the hotel
|
||||
region?: string // Region of the hotel
|
||||
discount?: number
|
||||
totalPrice?: number
|
||||
lowestRoomPrice?: number
|
||||
revenueCurrencyCode?: string // SEK, DKK, NOK, EUR
|
||||
roomPrice?: number | string
|
||||
roomTypeCode?: string
|
||||
roomTypeName?: string
|
||||
roomTypePosition?: number // Which position the room had in the list of available rooms
|
||||
searchTerm?: string
|
||||
searchType?: "destination" | "hotel"
|
||||
ancillaries?: Ancillary[]
|
||||
specialRoomType?: string // allergy room, pet-friendly, accesibillity room
|
||||
totalPrice?: number | string
|
||||
}
|
||||
|
||||
export type Ancillary = {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import type { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
|
||||
import type { SelectedRate, SelectedRoom } from "@/types/stores/rates"
|
||||
import type {
|
||||
RatesState,
|
||||
SelectedRate,
|
||||
SelectedRoom,
|
||||
} from "@/types/stores/rates"
|
||||
|
||||
export interface RoomContextValue extends SelectedRoom {
|
||||
actions: {
|
||||
@@ -10,6 +14,9 @@ export interface RoomContextValue extends SelectedRoom {
|
||||
}
|
||||
isActiveRoom: boolean
|
||||
isMainRoom: boolean
|
||||
roomAvailability:
|
||||
| NonNullable<RatesState["roomsAvailability"]>[number]
|
||||
| undefined
|
||||
roomNr: number
|
||||
totalRooms: number
|
||||
}
|
||||
|
||||
@@ -10,8 +10,11 @@ export interface Room {
|
||||
mustBeGuaranteed: boolean
|
||||
memberMustBeGuaranteed?: boolean
|
||||
packages: Packages | null
|
||||
rate: "change" | "flex" | "save"
|
||||
rateDefinitionTitle: string
|
||||
rateDetails: string[]
|
||||
rateTitle?: string
|
||||
rateType: string
|
||||
roomRate: RoomRate
|
||||
roomType: string
|
||||
roomTypeCode: string
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { Room } from "@/types/hotel"
|
||||
import type { Packages } from "@/types/requests/packages"
|
||||
import type { RoomsAvailability } from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
import type { SelectRateSearchParams } from "../components/hotelReservation/selectRate/selectRate"
|
||||
import type { AvailabilityError } from "../stores/rates"
|
||||
|
||||
export interface RatesProviderProps extends React.PropsWithChildren {
|
||||
booking: SelectRateSearchParams
|
||||
@@ -9,6 +10,6 @@ export interface RatesProviderProps extends React.PropsWithChildren {
|
||||
isUserLoggedIn: boolean
|
||||
packages: Packages | null
|
||||
roomCategories: Room[]
|
||||
roomsAvailability: RoomsAvailability | null
|
||||
roomsAvailability: (RoomsAvailability | AvailabilityError)[] | undefined
|
||||
vat: number
|
||||
}
|
||||
|
||||
@@ -16,12 +16,16 @@ export interface Room {
|
||||
breakfastIncluded: boolean
|
||||
children?: number
|
||||
childBedPreferences: ChildBedPreference[]
|
||||
childrenAges?: number[]
|
||||
confirmationNumber: string
|
||||
currencyCode: string
|
||||
fromDate: Date
|
||||
name: string
|
||||
packages: BookingConfirmation["booking"]["packages"]
|
||||
rateDefinition: BookingConfirmation["booking"]["rateDefinition"]
|
||||
roomFeatures?: PackageSchema[] | null
|
||||
roomPrice: number
|
||||
roomTypeCode: string | null
|
||||
toDate: Date
|
||||
totalPrice: number
|
||||
totalPriceExVat: number
|
||||
|
||||
@@ -22,20 +22,21 @@ import type {
|
||||
import type { Packages } from "../requests/packages"
|
||||
|
||||
export interface InitialRoomData {
|
||||
isAvailable: boolean
|
||||
bedType?: BedTypeSchema // used when there is only one bedtype to preselect it
|
||||
// used when there is only one bedtype to preselect it
|
||||
bedType?: BedTypeSchema
|
||||
bedTypes: BedTypeSelection[]
|
||||
breakfastIncluded: boolean
|
||||
cancellationText: string
|
||||
cancellationRule?: string
|
||||
isAvailable: boolean
|
||||
isFlexRate: boolean
|
||||
mustBeGuaranteed: boolean
|
||||
rateDetails: string[] | undefined
|
||||
rateTitle?: string
|
||||
roomFeatures: Packages | null
|
||||
roomRate: RoomRate
|
||||
roomType: string
|
||||
roomTypeCode: string
|
||||
mustBeGuaranteed: boolean
|
||||
isFlexRate: boolean
|
||||
}
|
||||
|
||||
export type RoomStep = {
|
||||
@@ -43,17 +44,19 @@ export type RoomStep = {
|
||||
isValid: boolean
|
||||
}
|
||||
|
||||
export interface Room extends InitialRoomData {
|
||||
adults: number
|
||||
bedType: BedTypeSchema | undefined
|
||||
breakfast: BreakfastPackage | false | undefined
|
||||
childrenInRoom: Child[] | undefined
|
||||
guest: DetailsSchema | MultiroomDetailsSchema | SignedInDetailsSchema
|
||||
roomPrice: RoomPrice
|
||||
}
|
||||
|
||||
export interface RoomState {
|
||||
currentStep: StepEnum | null
|
||||
isComplete: boolean
|
||||
room: InitialRoomData & {
|
||||
adults: number
|
||||
bedType: BedTypeSchema | undefined
|
||||
breakfast: BreakfastPackage | false | undefined
|
||||
childrenInRoom: Child[] | undefined
|
||||
guest: DetailsSchema | SignedInDetailsSchema
|
||||
roomPrice: RoomPrice
|
||||
}
|
||||
room: Room
|
||||
steps: {
|
||||
[StepEnum.selectBed]: RoomStep
|
||||
[StepEnum.breakfast]?: RoomStep
|
||||
|
||||
@@ -17,6 +17,11 @@ import type {
|
||||
RoomsAvailability,
|
||||
} from "@/types/trpc/routers/hotel/roomAvailability"
|
||||
|
||||
export interface AvailabilityError {
|
||||
details: string
|
||||
error: string
|
||||
}
|
||||
|
||||
interface Actions {
|
||||
closeSection: (idx: number) => () => void
|
||||
modifyRate: (idx: number) => () => void
|
||||
@@ -41,7 +46,6 @@ export interface SelectedRoom {
|
||||
export interface RatesState {
|
||||
actions: Actions
|
||||
activeRoom: number
|
||||
allRooms: RoomConfiguration[]
|
||||
booking: SelectRateSearchParams
|
||||
filterOptions: DefaultFilterOptions[]
|
||||
hotelType: string | undefined
|
||||
@@ -52,7 +56,8 @@ export interface RatesState {
|
||||
rateSummary: Rate[]
|
||||
rooms: SelectedRoom[]
|
||||
roomCategories: Room[]
|
||||
roomsAvailability: RoomsAvailability | null
|
||||
roomConfigurations: RoomConfiguration[][]
|
||||
roomsAvailability: (RoomsAvailability | AvailabilityError)[] | undefined
|
||||
searchParams: ReadonlyURLSearchParams
|
||||
vat: number
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user