From eb2c4511c2ebfdfc899d09cd335888e87c95a72e Mon Sep 17 00:00:00 2001 From: Hrishikesh Vaipurkar Date: Wed, 19 Mar 2025 10:34:54 +0100 Subject: [PATCH] feat: SW-1589 Booking code booking creation --- .../HotelReservation/EnterDetails/Payment/PaymentClient.tsx | 3 +++ apps/scandic-web/server/routers/booking/input.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx index fade0baad..2fc000efe 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentClient.tsx @@ -73,6 +73,7 @@ export default function PaymentClient({ const lang = useLang() const intl = useIntl() const searchParams = useSearchParams() + const bookingCode = searchParams.get("bookingCode") const { booking, canProceedToPayment, rooms, totalPrice } = useEnterDetailsStore((state) => ({ @@ -341,6 +342,7 @@ export default function PaymentClient({ memberPrice: room.roomRate.memberRate?.localPrice.pricePerStay, publicPrice: room.roomRate.publicRate?.localPrice.pricePerStay, }, + bookingCode, roomTypeCode: room.bedType!.roomTypeCode, // A selection has been made in order to get to this step. smsConfirmationRequested: data.smsConfirmation, specialRequest: { @@ -361,6 +363,7 @@ export default function PaymentClient({ rooms, booking, isFlexRate, + bookingCode, ] ) diff --git a/apps/scandic-web/server/routers/booking/input.ts b/apps/scandic-web/server/routers/booking/input.ts index 51f97f7b9..65aaa1d19 100644 --- a/apps/scandic-web/server/routers/booking/input.ts +++ b/apps/scandic-web/server/routers/booking/input.ts @@ -7,6 +7,7 @@ const roomsSchema = z .array( z.object({ adults: z.number().int().nonnegative(), + bookingCode: z.string().nullable(), childrenAges: z .array( z.object({