diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx index a367d9fd0..3ff47c7c3 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/select-rate/page.tsx @@ -74,7 +74,6 @@ export default async function SelectRatePage({ country: hotelData?.data?.attributes.address.country, hotelID: hotel?.id, region: hotelData?.data?.attributes.address.city, - //availableResults: roomCategories?.length, //lowestRoomPrice: } diff --git a/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx index 27d570042..9a5f41990 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/(standard)/step/page.tsx @@ -183,7 +183,6 @@ export default async function StepPage({ country: hotelAttributes?.address.country, hotelID: hotelAttributes?.operaId, region: hotelAttributes?.address.city, - //lowestRoomPrice: } const summary = { diff --git a/components/HotelReservation/BookingConfirmation/index.tsx b/components/HotelReservation/BookingConfirmation/index.tsx index dbe6586e9..35cd22028 100644 --- a/components/HotelReservation/BookingConfirmation/index.tsx +++ b/components/HotelReservation/BookingConfirmation/index.tsx @@ -6,6 +6,7 @@ import { getBookingConfirmation } from "@/lib/trpc/memoizedRequests" import TrackingSDK from "@/components/TrackingSDK" import { getLang } from "@/i18n/serverContext" +import { invertedBedTypeMap } from "../SelectRate/RoomSelection/utils" import Confirmation from "./Confirmation" import type { BookingConfirmationProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation" @@ -43,7 +44,9 @@ export default async function BookingConfirmation({ noOfAdults: booking.adults, noOfChildren: booking.childrenAges?.length, ageOfChildren: booking.childrenAges?.join(","), - childBedPreference: booking?.extraBedTypes?.map((c) => c.bedType).join("|"), + childBedPreference: booking?.extraBedTypes + ?.flatMap((c) => Array(c.quantity).fill(invertedBedTypeMap[c.bedType])) + .join("|"), noOfRooms: 1, // // TODO: Handle multiple rooms duration: differenceInCalendarDays(departureDate, arrivalDate), leadTime: differenceInCalendarDays(arrivalDate, new Date()), diff --git a/components/HotelReservation/SelectRate/RoomSelection/utils.ts b/components/HotelReservation/SelectRate/RoomSelection/utils.ts index d66fe9b9b..e76b51299 100644 --- a/components/HotelReservation/SelectRate/RoomSelection/utils.ts +++ b/components/HotelReservation/SelectRate/RoomSelection/utils.ts @@ -22,6 +22,14 @@ export const bedTypeMap: Record = { [ChildBedMapEnum.IN_ADULTS_BED]: ChildBedTypeEnum.ParentsBed, [ChildBedMapEnum.IN_CRIB]: ChildBedTypeEnum.Crib, [ChildBedMapEnum.IN_EXTRA_BED]: ChildBedTypeEnum.ExtraBed, + [ChildBedMapEnum.UNKNOWN]: ChildBedTypeEnum.Unknown, +} + +export const invertedBedTypeMap: Record = { + [ChildBedTypeEnum.ParentsBed]: ChildBedMapEnum[ChildBedMapEnum.IN_ADULTS_BED], + [ChildBedTypeEnum.Crib]: ChildBedMapEnum[ChildBedMapEnum.IN_CRIB], + [ChildBedTypeEnum.ExtraBed]: ChildBedMapEnum[ChildBedMapEnum.IN_EXTRA_BED], + [ChildBedTypeEnum.Unknown]: ChildBedMapEnum[ChildBedMapEnum.UNKNOWN], } export function generateChildrenString(children: Child[]): string { diff --git a/types/components/bookingWidget/enums.ts b/types/components/bookingWidget/enums.ts index 381be9b2f..0242e346b 100644 --- a/types/components/bookingWidget/enums.ts +++ b/types/components/bookingWidget/enums.ts @@ -2,4 +2,5 @@ export enum ChildBedMapEnum { IN_ADULTS_BED = 0, IN_CRIB = 1, IN_EXTRA_BED = 2, + UNKNOWN = 3, }