Merged in fix/SW-1153-correct-breakfast-message (pull request #1060)

fix(SW-1153): fix breakfast message for ScandicGo hotels

Approved-by: Pontus Dreij
This commit is contained in:
Bianca Widstam
2024-12-10 08:13:13 +00:00
parent 9b1d70b3be
commit 9e42cf0f37
6 changed files with 17 additions and 10 deletions

View File

@@ -20,9 +20,11 @@ import styles from "./roomCard.module.css"
import type { RoomCardProps } from "@/types/components/hotelReservation/selectRate/roomCard"
import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter"
import { HotelTypeEnum } from "@/types/enums/hotelType"
export default function RoomCard({
hotelId,
hotelType,
rateDefinitions,
roomConfiguration,
roomCategories,
@@ -59,17 +61,14 @@ export default function RoomCard({
}
const getBreakfastMessage = (rate: RateDefinition | undefined) => {
const breakfastIncluded = getRateDefinitionForRate(rate)?.breakfastIncluded
switch (breakfastIncluded) {
case true:
return intl.formatMessage({ id: "Breakfast is included." })
case false:
return intl.formatMessage({ id: "Breakfast selection in next step." })
default:
return intl.formatMessage({
id: "Breakfast deal can be purchased at the hotel.",
})
if (hotelType === HotelTypeEnum.ScandicGo) {
return intl.formatMessage({
id: "Breakfast deal can be purchased at the hotel.",
})
}
return getRateDefinitionForRate(rate)?.breakfastIncluded
? intl.formatMessage({ id: "Breakfast is included." })
: intl.formatMessage({ id: "Breakfast selection in next step." })
}
const petRoomPackage =