Merged in fix/add-multinight-breakfast (pull request #1705)
The number of breakfasts and total sums weren’t correctly calculated. This fixes that. Also changes display logic of when the ancillaries sections are shown Approved-by: Bianca Widstam
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
nullableStringValidator,
|
||||
} from "@/utils/zod/stringValidator"
|
||||
|
||||
import { BreakfastPackageEnum } from "@/types/enums/breakfast"
|
||||
import { CurrencyEnum } from "@/types/enums/currency"
|
||||
|
||||
const guestSchema = z.object({
|
||||
@@ -250,11 +251,15 @@ export const bookingConfirmationSchema = z
|
||||
packages: data.attributes.packages.filter((p) => p.type !== "Ancillary"),
|
||||
ancillaries: data.attributes.packages.filter((p) => p.type === "Ancillary"),
|
||||
extraBedTypes: data.attributes.childBedPreferences,
|
||||
showAncillaries: !!(
|
||||
data.links.addAncillary ||
|
||||
data.attributes.packages.some((p) => p.type === "Ancillary") ||
|
||||
data.attributes.reservationStatus === BookingStatusEnum.Cancelled
|
||||
),
|
||||
showAncillaries:
|
||||
!!(
|
||||
data.links.addAncillary ||
|
||||
data.attributes.packages.some(
|
||||
(p) =>
|
||||
p.type === "Ancillary" ||
|
||||
p.code === BreakfastPackageEnum.ANCILLARY_REGULAR_BREAKFAST
|
||||
)
|
||||
) && data.attributes.reservationStatus !== BookingStatusEnum.Cancelled,
|
||||
isCancelable: !!data.links.cancel,
|
||||
isModifiable: !!data.links.modify,
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user