feat: add no breakfast message to price details modal and to conf page receipt
This commit is contained in:
@@ -40,19 +40,21 @@ export function mapRoomDetails({
|
||||
)
|
||||
|
||||
// We don't get `requestedPrice` in packages
|
||||
const breakfast: Omit<BreakfastPackage, "requestedPrice"> | null =
|
||||
breakfastPackageAdults
|
||||
? {
|
||||
code: breakfastPackageAdults.code,
|
||||
description: breakfastPackageAdults.description,
|
||||
localPrice: {
|
||||
currency: breakfastPackageAdults.currency,
|
||||
price: breakfastPackageAdults.unitPrice,
|
||||
totalPrice: breakfastPackageAdults.totalPrice,
|
||||
},
|
||||
packageType: PackageTypeEnum.BreakfastAdult,
|
||||
}
|
||||
: null
|
||||
let breakfast: Omit<BreakfastPackage, "requestedPrice"> | undefined | false
|
||||
if (breakfastPackageAdults) {
|
||||
breakfast = {
|
||||
code: breakfastPackageAdults.code,
|
||||
description: breakfastPackageAdults.description,
|
||||
localPrice: {
|
||||
currency: breakfastPackageAdults.currency,
|
||||
price: breakfastPackageAdults.unitPrice,
|
||||
totalPrice: breakfastPackageAdults.totalPrice,
|
||||
},
|
||||
packageType: PackageTypeEnum.BreakfastAdult,
|
||||
}
|
||||
} else if (!booking.rateDefinition.breakfastIncluded) {
|
||||
breakfast = false
|
||||
}
|
||||
|
||||
const validBreakfastPackagesChildren: string[] = [
|
||||
BreakfastPackageEnum.ANCILLARY_CHILD_PAYING_BREAKFAST,
|
||||
@@ -62,17 +64,17 @@ export function mapRoomDetails({
|
||||
)
|
||||
// We don't get `requestedPrice` in packages
|
||||
const breakfastChildren: Omit<BreakfastPackage, "requestedPrice"> | null =
|
||||
breakfastPackageChildren
|
||||
(breakfastPackageChildren && !booking.rateDefinition.breakfastIncluded)
|
||||
? {
|
||||
code: breakfastPackageChildren.code,
|
||||
description: breakfastPackageChildren.description,
|
||||
localPrice: {
|
||||
currency: breakfastPackageChildren.currency,
|
||||
price: breakfastPackageChildren.unitPrice,
|
||||
totalPrice: breakfastPackageChildren.totalPrice,
|
||||
},
|
||||
packageType: PackageTypeEnum.BreakfastChildren,
|
||||
}
|
||||
code: breakfastPackageChildren.code,
|
||||
description: breakfastPackageChildren.description,
|
||||
localPrice: {
|
||||
currency: breakfastPackageChildren.currency,
|
||||
price: breakfastPackageChildren.unitPrice,
|
||||
totalPrice: breakfastPackageChildren.totalPrice,
|
||||
},
|
||||
packageType: PackageTypeEnum.BreakfastChildren,
|
||||
}
|
||||
: null
|
||||
|
||||
const isCancelled = booking.reservationStatus === BookingStatusEnum.Cancelled
|
||||
|
||||
Reference in New Issue
Block a user