diff --git a/apps/scandic-web/components/HotelReservation/MyStay/PriceDetails/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/PriceDetails/index.tsx index d3fc0e2bc..037d5d73d 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/PriceDetails/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/PriceDetails/index.tsx @@ -1,6 +1,7 @@ "use client" import PriceDetailsModal from "@scandic-hotels/booking-flow/components/PriceDetailsModal" import { dt } from "@scandic-hotels/common/dt" +import { HotelTypeEnum } from "@scandic-hotels/trpc/enums/hotelType" import { useMyStayStore } from "@/stores/my-stay" @@ -9,17 +10,20 @@ import { calculateTotalPrice, mapToPrice } from "./mapToPrice" import styles from "./priceDetails.module.css" export default function PriceDetails() { - const { bookedRoom, rooms } = useMyStayStore((state) => ({ - bookedRoom: state.bookedRoom, - rooms: state.rooms - .filter((room) => !room.isCancelled) - .map((room) => ({ - ...room, - breakfastIncluded: room.rateDefinition.breakfastIncluded, - price: mapToPrice(room), - roomType: room.roomName, - })), - })) + const { bookedRoom, rooms, hotelOffersBreakfast } = useMyStayStore( + (state) => ({ + bookedRoom: state.bookedRoom, + rooms: state.rooms + .filter((room) => !room.isCancelled) + .map((room) => ({ + ...room, + breakfastIncluded: room.rateDefinition.breakfastIncluded, + price: mapToPrice(room), + roomType: room.roomName, + })), + hotelOffersBreakfast: state.hotel.hotelType !== HotelTypeEnum.ScandicGo, + }) + ) const bookingCode = rooms.find((room) => room.bookingCode)?.bookingCode ?? undefined @@ -38,6 +42,7 @@ export default function PriceDetails() { vat={bookedRoom.vatPercentage} defaultCurrency={bookedRoom.currencyCode} isCampaignRate={bookedRoom.isCampaignRate} + hotelOffersBreakfast={hotelOffersBreakfast} /> ) diff --git a/packages/booking-flow/lib/components/BookingConfirmation/PriceDetails/index.tsx b/packages/booking-flow/lib/components/BookingConfirmation/PriceDetails/index.tsx index 5f3e6cd97..631cb1719 100644 --- a/packages/booking-flow/lib/components/BookingConfirmation/PriceDetails/index.tsx +++ b/packages/booking-flow/lib/components/BookingConfirmation/PriceDetails/index.tsx @@ -9,15 +9,23 @@ import { mapToPrice } from "./mapToPrice" import type { Price } from "../../../types/price" export default function PriceDetails() { - const { bookingCode, currency, fromDate, rooms, vat, toDate } = - useBookingConfirmationStore((state) => ({ - bookingCode: state.bookingCode ?? undefined, - currency: state.currencyCode, - fromDate: state.fromDate, - rooms: state.rooms, - toDate: state.toDate, - vat: state.vat, - })) + const { + bookingCode, + currency, + hotelOffersBreakfast, + fromDate, + rooms, + vat, + toDate, + } = useBookingConfirmationStore((state) => ({ + bookingCode: state.bookingCode ?? undefined, + currency: state.currencyCode, + hotelOffersBreakfast: state.hotelOffersBreakfast, + fromDate: state.fromDate, + rooms: state.rooms, + toDate: state.toDate, + vat: state.vat, + })) if (!rooms[0]) { return null @@ -135,6 +143,7 @@ export default function PriceDetails() { vat={vat} defaultCurrency={currency} isCampaignRate={isCampaignRate} + hotelOffersBreakfast={hotelOffersBreakfast} /> ) } diff --git a/packages/booking-flow/lib/components/BookingConfirmation/Receipt/Room/index.tsx b/packages/booking-flow/lib/components/BookingConfirmation/Receipt/Room/index.tsx index 49d1db208..200b969f1 100644 --- a/packages/booking-flow/lib/components/BookingConfirmation/Receipt/Room/index.tsx +++ b/packages/booking-flow/lib/components/BookingConfirmation/Receipt/Room/index.tsx @@ -15,7 +15,7 @@ import { ChildBedTypeEnum } from "@scandic-hotels/trpc/enums/childBedTypeEnum" import { useBookingConfirmationStore } from "../../../../stores/booking-confirmation" import { getRoomFeatureDescription } from "../../../../utils/getRoomFeatureDescription" -import Breakfast from "./Breakfast" +import { SummaryBreakfast } from "../../../SummaryBreakfast" import RoomSkeletonLoader from "./RoomSkeletonLoader" import styles from "./room.module.css" @@ -36,11 +36,12 @@ export function ReceiptRoom({ showBookingCodeChip = false, }: BookingConfirmationReceiptRoomProps) { const intl = useIntl() - const { currencyCode, isVatCurrency, bookingCode } = + const { currencyCode, isVatCurrency, bookingCode, hotelOffersBreakfast } = useBookingConfirmationStore((state) => ({ currencyCode: state.currencyCode, isVatCurrency: state.isVatCurrency, bookingCode: state.bookingCode, + hotelOffersBreakfast: state.hotelOffersBreakfast, })) if (!room) { @@ -80,6 +81,11 @@ export function ReceiptRoom({ const showDiscounted = room.rateDefinition.isMemberRate || room.rateDefinition.isCampaignRate + const breakfastPrice = room.breakfast + ? room.breakfast?.totalPrice + : room.breakfast + const breakfastCurrency = room.breakfast ? room.breakfast?.currency : null + return ( <>
@@ -275,10 +281,12 @@ export function ReceiptRoom({
) : null} - {showBookingCodeChip && ( diff --git a/packages/booking-flow/lib/components/BookingConfirmation/index.tsx b/packages/booking-flow/lib/components/BookingConfirmation/index.tsx index c84103ffa..a28fb0e15 100644 --- a/packages/booking-flow/lib/components/BookingConfirmation/index.tsx +++ b/packages/booking-flow/lib/components/BookingConfirmation/index.tsx @@ -4,6 +4,7 @@ import { AlertTypeEnum } from "@scandic-hotels/common/constants/alert" import { dt } from "@scandic-hotels/common/dt" import { Alert } from "@scandic-hotels/design-system/Alert" import { Divider } from "@scandic-hotels/design-system/Divider" +import { HotelTypeEnum } from "@scandic-hotels/trpc/enums/hotelType" import { BookingConfirmationProvider } from "../../providers/BookingConfirmationProvider" import { getBookingConfirmation } from "../../trpc/memoizedRequests/getBookingConfirmation" @@ -51,6 +52,7 @@ export async function BookingConfirmation({ bookingCode={booking.bookingCode} currencyCode={booking.currencyCode} fromDate={booking.checkInDate} + hotelOffersBreakfast={hotel.hotelType !== HotelTypeEnum.ScandicGo} toDate={booking.checkOutDate} roomCategories={roomCategories} rooms={[ diff --git a/packages/booking-flow/lib/components/EnterDetails/Summary/Desktop.tsx b/packages/booking-flow/lib/components/EnterDetails/Summary/Desktop.tsx index 50b8b13c7..df3982265 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Summary/Desktop.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Summary/Desktop.tsx @@ -1,6 +1,5 @@ "use client" -import { useEnterDetailsStore } from "../../../stores/enter-details" import { SidePanel } from "../../SidePanel" import SummaryUI from "./UI" @@ -9,30 +8,9 @@ type Props = { } export default function DesktopSummary({ isUserLoggedIn }: Props) { - const toggleSummaryOpen = useEnterDetailsStore( - (state) => state.actions.toggleSummaryOpen - ) - - const { booking, rooms, totalPrice, vat, defaultCurrency } = - useEnterDetailsStore((state) => ({ - booking: state.booking, - rooms: state.rooms, - totalPrice: state.totalPrice, - vat: state.vat, - defaultCurrency: state.defaultCurrency, - })) - return ( - + ) } diff --git a/packages/booking-flow/lib/components/EnterDetails/Summary/Mobile/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Summary/Mobile/index.tsx index 06d0f5252..7abe23749 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Summary/Mobile/index.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Summary/Mobile/index.tsx @@ -11,22 +11,14 @@ type Props = { isUserLoggedIn: boolean } export default function MobileSummary({ isUserLoggedIn }: Props) { - const { isSummaryOpen, toggleSummaryOpen } = useEnterDetailsStore( + const { rooms, isSummaryOpen, toggleSummaryOpen } = useEnterDetailsStore( (state) => ({ + rooms: state.rooms, isSummaryOpen: state.isSummaryOpen, toggleSummaryOpen: state.actions.toggleSummaryOpen, }) ) - const { booking, rooms, totalPrice, vat, defaultCurrency } = - useEnterDetailsStore((state) => ({ - booking: state.booking, - rooms: state.rooms, - totalPrice: state.totalPrice, - vat: state.vat, - defaultCurrency: state.defaultCurrency, - })) - const showPromo = !isUserLoggedIn && rooms.length === 1 && @@ -52,15 +44,7 @@ export default function MobileSummary({ isUserLoggedIn }: Props) {
- +
diff --git a/packages/booking-flow/lib/components/EnterDetails/Summary/UI/Room/Breakfast/breakfast.module.css b/packages/booking-flow/lib/components/EnterDetails/Summary/UI/Room/Breakfast/breakfast.module.css deleted file mode 100644 index 4be0ceba3..000000000 --- a/packages/booking-flow/lib/components/EnterDetails/Summary/UI/Room/Breakfast/breakfast.module.css +++ /dev/null @@ -1,13 +0,0 @@ -.entry { - display: flex; - gap: var(--Space-x05); - justify-content: space-between; -} - -.textDefault { - color: var(--Text-Default); -} - -.uiTextMediumContrast { - color: var(--UI-Text-Medium-contrast); -} diff --git a/packages/booking-flow/lib/components/EnterDetails/Summary/UI/Room/Breakfast/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Summary/UI/Room/Breakfast/index.tsx deleted file mode 100644 index 768c56f3e..000000000 --- a/packages/booking-flow/lib/components/EnterDetails/Summary/UI/Room/Breakfast/index.tsx +++ /dev/null @@ -1,79 +0,0 @@ -"use client" -import { useIntl } from "react-intl" - -import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting" -import { Typography } from "@scandic-hotels/design-system/Typography" - -import styles from "./breakfast.module.css" - -import type { BreakfastPackage } from "@scandic-hotels/trpc/routers/hotels/schemas/packages" - -interface BreakfastProps { - adults: number - breakfast: BreakfastPackage | false | undefined - breakfastIncluded: boolean - guests: string - nights: number -} - -export default function Breakfast({ - adults, - breakfast, - breakfastIncluded, - guests, - nights, -}: BreakfastProps) { - const intl = useIntl() - - const breakfastBuffet = intl.formatMessage({ - id: "common.breakfastBuffet", - defaultMessage: "Breakfast buffet", - }) - - if (breakfastIncluded || breakfast) { - const price = breakfast - ? formatPrice( - intl, - breakfast.localPrice.price * adults * nights, - breakfast.localPrice.currency - ) - : intl.formatMessage({ - id: "common.included", - defaultMessage: "Included", - }) - return ( -
-
- -

{breakfastBuffet}

-
- -

{guests}

-
-
- -

{price}

-
-
- ) - } - - if (breakfast === false) { - const noBreakfast = intl.formatMessage({ - id: "common.noBreakfast", - defaultMessage: "No breakfast", - }) - return ( -
- -

{breakfastBuffet}

-
- -

{noBreakfast}

-
-
- ) - } - - return null -} diff --git a/packages/booking-flow/lib/components/EnterDetails/Summary/UI/Room/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Summary/UI/Room/index.tsx index 51529acf6..b55eb65a0 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Summary/UI/Room/index.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Summary/UI/Room/index.tsx @@ -12,7 +12,7 @@ import { Typography } from "@scandic-hotels/design-system/Typography" import { ChildBedMapEnum } from "@scandic-hotels/trpc/enums/childBedMapEnum" import { getRoomFeatureDescription } from "../../../../../utils/getRoomFeatureDescription" -import Breakfast from "./Breakfast" +import { SummaryBreakfast } from "../../../../SummaryBreakfast" import styles from "./room.module.css" @@ -26,6 +26,7 @@ interface RoomProps { nightsCount: number defaultCurrency: CurrencyEnum showBookingCodeChip?: boolean + hotelOffersBreakfast?: boolean } export default function Room({ @@ -36,6 +37,7 @@ export default function Room({ nightsCount, defaultCurrency, showBookingCodeChip = false, + hotelOffersBreakfast = true, }: RoomProps) { const intl = useIntl() const adults = room.adults @@ -132,6 +134,13 @@ export default function Room({ ) } + const breakfastPrice = room.breakfast + ? room.breakfast?.localPrice.price * adults * nightsCount + : room.breakfast + const breakfastCurrency = room.breakfast + ? room.breakfast?.localPrice.currency + : null + return ( <>
@@ -340,12 +349,12 @@ export default function Room({ ) : null} -
{showBookingCodeChip && ( diff --git a/packages/booking-flow/lib/components/EnterDetails/Summary/UI/index.tsx b/packages/booking-flow/lib/components/EnterDetails/Summary/UI/index.tsx index 31934b605..063563cc8 100644 --- a/packages/booking-flow/lib/components/EnterDetails/Summary/UI/index.tsx +++ b/packages/booking-flow/lib/components/EnterDetails/Summary/UI/index.tsx @@ -16,6 +16,7 @@ import Subtitle from "@scandic-hotels/design-system/Subtitle" import { Typography } from "@scandic-hotels/design-system/Typography" import useLang from "../../../../hooks/useLang" +import { useEnterDetailsStore } from "../../../../stores/enter-details" import PriceDetailsModal from "../../../PriceDetailsModal" import { isBookingCodeRate } from "../../../SelectRate/RoomsContainer/RateSummary/utils" import SignupPromoDesktop from "../../../SignupPromo/Desktop" @@ -25,33 +26,33 @@ import { getMemberPrice } from "./utils" import styles from "./ui.module.css" -import type { RoomState } from "../../../../stores/enter-details/types" -import type { Price } from "../../../../types/price" -import type { DetailsBooking } from "../../../../utils/url" - -type EnterDetailsSummaryProps = { - booking: DetailsBooking - isUserLoggedIn: boolean - totalPrice: Price - vat: number - rooms: RoomState[] - toggleSummaryOpen: () => void - defaultCurrency: CurrencyEnum -} - export default function SummaryUI({ - booking, - rooms, - totalPrice, isUserLoggedIn, - vat, - toggleSummaryOpen, - defaultCurrency, -}: EnterDetailsSummaryProps) { +}: { + isUserLoggedIn: boolean +}) { const intl = useIntl() const lang = useLang() const isDesktop = useMediaQuery("(min-width: 1367px)") + const { + booking, + defaultCurrency, + hotelOffersBreakfast, + rooms, + totalPrice, + vat, + toggleSummaryOpen, + } = useEnterDetailsStore((state) => ({ + booking: state.booking, + defaultCurrency: state.defaultCurrency, + hotelOffersBreakfast: state.hotelOffersBreakfast, + rooms: state.rooms, + totalPrice: state.totalPrice, + vat: state.vat, + toggleSummaryOpen: state.actions.toggleSummaryOpen, + })) + const nights = dt(booking.toDate).diff(booking.fromDate, "days") const nightsMsg = intl.formatMessage( @@ -143,6 +144,7 @@ export default function SummaryUI({ (room.roomRate.rateDefinition.isCampaignRate || !!room.roomRate.bookingCode) } + hotelOffersBreakfast={hotelOffersBreakfast} /> ))} @@ -231,6 +233,7 @@ export default function SummaryUI({ totalPrice={totalPrice} vat={vat} isCampaignRate={!!containsCampaignRate} + hotelOffersBreakfast={hotelOffersBreakfast} /> diff --git a/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/Breakfast.tsx b/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/Breakfast.tsx index a75ddf3c7..73f33f678 100644 --- a/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/Breakfast.tsx +++ b/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/Breakfast.tsx @@ -18,6 +18,7 @@ interface BreakfastProps { childrenInRoom: Child[] | undefined currency: string nights: number + hotelOffersBreakfast?: boolean } export default function Breakfast({ @@ -28,6 +29,7 @@ export default function Breakfast({ childrenInRoom = [], currency, nights, + hotelOffersBreakfast = true, }: BreakfastProps) { const intl = useIntl() @@ -194,7 +196,10 @@ export default function Breakfast({ }) return ( - + ) } diff --git a/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/Row/Bold.tsx b/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/Row/Bold.tsx index d8abef8d7..0f7427ee6 100644 --- a/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/Row/Bold.tsx +++ b/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/Row/Bold.tsx @@ -5,7 +5,7 @@ import { Typography } from "@scandic-hotels/design-system/Typography" import styles from "./row.module.css" interface RowProps { - label: string + label?: string value: string regularValue?: string isDiscounted?: boolean @@ -19,11 +19,13 @@ export default function BoldRow({ }: RowProps) { return ( - - - {label} - - + {label ? ( + + + {label} + + + ) : null} {isDiscounted && regularValue ? ( diff --git a/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/index.tsx b/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/index.tsx index a4dc9950e..c91d3b76c 100644 --- a/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/index.tsx +++ b/packages/booking-flow/lib/components/PriceDetailsModal/PriceDetailsTable/index.tsx @@ -66,6 +66,7 @@ export interface PriceDetailsTableProps { totalPrice: Price vat: number defaultCurrency: CurrencyEnum + hotelOffersBreakfast?: boolean } export default function PriceDetailsTable({ @@ -77,6 +78,7 @@ export default function PriceDetailsTable({ totalPrice, vat, defaultCurrency, + hotelOffersBreakfast, }: PriceDetailsTableProps) { const intl = useIntl() const lang = useLang() @@ -217,6 +219,7 @@ export default function PriceDetailsTable({ childrenInRoom={room.childrenInRoom} currency={currency} nights={nights} + hotelOffersBreakfast={hotelOffersBreakfast} /> {rooms.length !== 1 && (room.rateDefinition.isCampaignRate || !!bookingCode) && ( diff --git a/packages/booking-flow/lib/components/BookingConfirmation/Receipt/Room/Breakfast/index.tsx b/packages/booking-flow/lib/components/SummaryBreakfast/index.tsx similarity index 57% rename from packages/booking-flow/lib/components/BookingConfirmation/Receipt/Room/Breakfast/index.tsx rename to packages/booking-flow/lib/components/SummaryBreakfast/index.tsx index f4cab8e1f..0d3aa8a1f 100644 --- a/packages/booking-flow/lib/components/BookingConfirmation/Receipt/Room/Breakfast/index.tsx +++ b/packages/booking-flow/lib/components/SummaryBreakfast/index.tsx @@ -4,20 +4,22 @@ import { useIntl } from "react-intl" import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting" import { Typography } from "@scandic-hotels/design-system/Typography" -import styles from "./breakfast.module.css" - -import type { PackageSchema } from "@scandic-hotels/trpc/types/bookingConfirmation" +import styles from "./summaryBreakfast.module.css" interface BreakfastProps { - breakfast: PackageSchema | false | undefined + breakfastPrice: number | false | undefined + breakfastCurrency?: string | null breakfastIncluded: boolean guests: string + hotelOffersBreakfast: boolean } -export default function Breakfast({ - breakfast, +export function SummaryBreakfast({ + breakfastPrice, + breakfastCurrency, breakfastIncluded, guests, + hotelOffersBreakfast = true, }: BreakfastProps) { const intl = useIntl() @@ -26,13 +28,14 @@ export default function Breakfast({ defaultMessage: "Breakfast buffet", }) - if (breakfastIncluded || breakfast) { - const price = breakfast - ? formatPrice(intl, breakfast.totalPrice, breakfast.currency) - : intl.formatMessage({ - id: "common.included", - defaultMessage: "Included", - }) + if (breakfastIncluded || (breakfastPrice && breakfastCurrency)) { + const price = + breakfastPrice && breakfastCurrency + ? formatPrice(intl, breakfastPrice, breakfastCurrency) + : intl.formatMessage({ + id: "common.included", + defaultMessage: "Included", + }) return (
@@ -50,20 +53,18 @@ export default function Breakfast({ ) } - if (breakfast === false) { + if (breakfastPrice === false) { const noBreakfast = intl.formatMessage({ id: "common.noBreakfast", defaultMessage: "No breakfast", }) return ( -
- -

{breakfastBuffet}

-
- -

{noBreakfast}

-
-
+ +
+ {hotelOffersBreakfast ?

{breakfastBuffet}

: null} +

{noBreakfast}

+
+
) } diff --git a/packages/booking-flow/lib/components/BookingConfirmation/Receipt/Room/Breakfast/breakfast.module.css b/packages/booking-flow/lib/components/SummaryBreakfast/summaryBreakfast.module.css similarity index 86% rename from packages/booking-flow/lib/components/BookingConfirmation/Receipt/Room/Breakfast/breakfast.module.css rename to packages/booking-flow/lib/components/SummaryBreakfast/summaryBreakfast.module.css index 0a5c46a72..b4bb49224 100644 --- a/packages/booking-flow/lib/components/BookingConfirmation/Receipt/Room/Breakfast/breakfast.module.css +++ b/packages/booking-flow/lib/components/SummaryBreakfast/summaryBreakfast.module.css @@ -1,5 +1,6 @@ .entry { display: flex; + gap: var(--Space-x05); justify-content: space-between; } diff --git a/packages/booking-flow/lib/contexts/EnterDetails/EnterDetailsContext.tsx b/packages/booking-flow/lib/contexts/EnterDetails/EnterDetailsContext.tsx index 7319d42ea..ced6af8ec 100644 --- a/packages/booking-flow/lib/contexts/EnterDetails/EnterDetailsContext.tsx +++ b/packages/booking-flow/lib/contexts/EnterDetails/EnterDetailsContext.tsx @@ -36,6 +36,7 @@ export const EnterDetailsContext = createContext(null) type DetailsProviderProps = React.PropsWithChildren & { booking: DetailsBooking breakfastPackages: BreakfastPackages + hotelOffersBreakfast: boolean lang: Lang rooms: Room[] searchParamsStr: string @@ -49,6 +50,7 @@ export default function EnterDetailsProvider({ booking, breakfastPackages, children, + hotelOffersBreakfast, lang, rooms, searchParamsStr, @@ -67,6 +69,7 @@ export default function EnterDetailsProvider({ if (!storeRef.current) { const initialData: InitialState = { booking, + hotelOffersBreakfast, rooms: rooms .filter((r) => r.bedTypes?.length) // TODO: how to handle room without bedtypes? .map((room) => ({ diff --git a/packages/booking-flow/lib/pages/EnterDetailsPage.tsx b/packages/booking-flow/lib/pages/EnterDetailsPage.tsx index d59d9bc3a..b2c658bc1 100644 --- a/packages/booking-flow/lib/pages/EnterDetailsPage.tsx +++ b/packages/booking-flow/lib/pages/EnterDetailsPage.tsx @@ -4,6 +4,7 @@ import { Suspense } from "react" import { FamilyAndFriendsCodes } from "@scandic-hotels/common/constants/familyAndFriends" import { SEARCH_TYPE_REDEMPTION } from "@scandic-hotels/trpc/constants/booking" +import { HotelTypeEnum } from "@scandic-hotels/trpc/enums/hotelType" import { BookingFlowConfig } from "../bookingFlowConfig/bookingFlowConfig" import HotelHeader from "../components/EnterDetails/Header" @@ -137,6 +138,7 @@ export async function EnterDetailsPage({ rooms={rooms} searchParamsStr={selectRoomParams.toString()} user={user} + hotelOffersBreakfast={hotel.hotelType !== HotelTypeEnum.ScandicGo} hotelName={hotel.name} vat={hotel.vat} roomCategories={hotelData.roomCategories} diff --git a/packages/booking-flow/lib/providers/BookingConfirmationProvider.tsx b/packages/booking-flow/lib/providers/BookingConfirmationProvider.tsx index ef6ca364f..9b3310b65 100644 --- a/packages/booking-flow/lib/providers/BookingConfirmationProvider.tsx +++ b/packages/booking-flow/lib/providers/BookingConfirmationProvider.tsx @@ -17,6 +17,7 @@ export function BookingConfirmationProvider({ children, currencyCode, fromDate, + hotelOffersBreakfast, toDate, roomCategories, rooms, @@ -94,6 +95,7 @@ export function BookingConfirmationProvider({ rooms, vat, isVatCurrency, + hotelOffersBreakfast, formattedTotalCost, totalBookingPrice, totalBookingCheques, diff --git a/packages/booking-flow/lib/stores/booking-confirmation/index.ts b/packages/booking-flow/lib/stores/booking-confirmation/index.ts index e5eda0520..db54152bf 100644 --- a/packages/booking-flow/lib/stores/booking-confirmation/index.ts +++ b/packages/booking-flow/lib/stores/booking-confirmation/index.ts @@ -18,6 +18,7 @@ export function createBookingConfirmationStore(initialState: InitialState) { roomCategories: initialState.roomCategories, vat: initialState.vat, formattedTotalCost: initialState.formattedTotalCost, + hotelOffersBreakfast: initialState.hotelOffersBreakfast, isVatCurrency: initialState.isVatCurrency, totalBookingPrice: initialState.totalBookingPrice, totalBookingCheques: initialState.totalBookingCheques, diff --git a/packages/booking-flow/lib/stores/enter-details/index.ts b/packages/booking-flow/lib/stores/enter-details/index.ts index 0f8344da3..00e15282c 100644 --- a/packages/booking-flow/lib/stores/enter-details/index.ts +++ b/packages/booking-flow/lib/stores/enter-details/index.ts @@ -107,6 +107,7 @@ export function createDetailsStore( canProceedToPayment: false, isSubmitting: false, isSummaryOpen: false, + hotelOffersBreakfast: initialState.hotelOffersBreakfast, lastRoom: initialState.booking.rooms.length - 1, rooms: initialRooms.map((room, idx) => { const steps: RoomState["steps"] = { diff --git a/packages/booking-flow/lib/stores/enter-details/types.ts b/packages/booking-flow/lib/stores/enter-details/types.ts index 3a252e674..66114a725 100644 --- a/packages/booking-flow/lib/stores/enter-details/types.ts +++ b/packages/booking-flow/lib/stores/enter-details/types.ts @@ -85,6 +85,7 @@ export interface RoomState { export type InitialState = { booking: DetailsBooking + hotelOffersBreakfast: boolean rooms: InitialRoomData[] vat: number hotelName: string @@ -106,6 +107,7 @@ export interface DetailsState { booking: DetailsBooking breakfastPackages: BreakfastPackages canProceedToPayment: boolean + hotelOffersBreakfast: boolean isSubmitting: boolean isSummaryOpen: boolean lastRoom: number diff --git a/packages/booking-flow/lib/types/providers/booking-confirmation.ts b/packages/booking-flow/lib/types/providers/booking-confirmation.ts index def50797c..85bd905cb 100644 --- a/packages/booking-flow/lib/types/providers/booking-confirmation.ts +++ b/packages/booking-flow/lib/types/providers/booking-confirmation.ts @@ -8,6 +8,7 @@ export interface BookingConfirmationProviderProps bookingCode: string | null currencyCode: CurrencyEnum fromDate: string + hotelOffersBreakfast: boolean roomCategories: RoomCategories rooms: (Room | null)[] toDate: string diff --git a/packages/booking-flow/lib/types/stores/booking-confirmation.ts b/packages/booking-flow/lib/types/stores/booking-confirmation.ts index c0d05b3b9..6eeb2d96c 100644 --- a/packages/booking-flow/lib/types/stores/booking-confirmation.ts +++ b/packages/booking-flow/lib/types/stores/booking-confirmation.ts @@ -50,6 +50,7 @@ export interface InitialState { roomCategories: RoomCategories vat: number isVatCurrency: boolean + hotelOffersBreakfast: boolean formattedTotalCost: string totalBookingPrice: number totalBookingCheques: number