Merged in feat/SW-1282-list-added-ancillaries (pull request #1416)
Feat/SW-1282 list added ancillaries * feat(sw-1282): add icon to accordionItem * feat(sw-1282): list added ancillaries * Change translation key to already existing * Remove duplicate key * Move new files to the new folder structure Approved-by: Pontus Dreij
This commit is contained in:
@@ -81,8 +81,8 @@ const guestSchema = z.object({
|
||||
|
||||
const packageSchema = z
|
||||
.object({
|
||||
type: z.string().nullable(),
|
||||
description: z.string().nullable().default(""),
|
||||
type: z.string().nullable().default(""),
|
||||
code: z.string().nullable().default(""),
|
||||
price: z.object({
|
||||
unit: z.number().int().nullable(),
|
||||
@@ -92,11 +92,13 @@ const packageSchema = z
|
||||
currency: z.string().default(""),
|
||||
points: z.number().int().nullable(),
|
||||
}),
|
||||
comment: z.string().nullable().optional(),
|
||||
})
|
||||
.transform((packageData) => ({
|
||||
description: packageData.description,
|
||||
code: packageData.code,
|
||||
type: packageData.type,
|
||||
description: packageData.description,
|
||||
comment: packageData.comment,
|
||||
code: packageData.code,
|
||||
currency: packageData.price.currency,
|
||||
points: packageData.price.points,
|
||||
totalPrice: packageData.price.totalPrice ?? 0,
|
||||
@@ -219,7 +221,13 @@ export const bookingConfirmationSchema = z
|
||||
})
|
||||
.transform(({ data }) => ({
|
||||
...data.attributes,
|
||||
showAncillaries: !!data.links.addAncillary,
|
||||
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")
|
||||
),
|
||||
isCancelable: !!data.links.cancel,
|
||||
isModifiable: !!data.links.modify,
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user