fix: update booking service schemas

This commit is contained in:
Christel Westerberg
2024-11-18 10:54:35 +01:00
committed by Joakim Jäderberg
parent 9c7ac78e14
commit d67affd677
6 changed files with 61 additions and 17 deletions

View File

@@ -15,7 +15,18 @@ export const createBookingSchema = z
cancellationNumber: z.string().nullable(),
reservationStatus: z.string(),
paymentUrl: z.string().nullable(),
metadata: z.any(), // TODO: define metadata schema (not sure what it does)
metadata: z
.object({
errorCode: z.number().optional(),
errorMessage: z.string().optional(),
priceChangedMetadata: z
.object({
roomPrice: z.number().optional(),
totalPrice: z.number().optional(),
})
.optional(),
})
.nullable(),
}),
type: z.string(),
id: z.string(),
@@ -77,7 +88,16 @@ export const bookingConfirmationSchema = z
guest: guestSchema,
hotelId: z.string(),
packages: z.array(packageSchema),
rateCode: z.string(),
rateDefinition: z.object({
rateCode: z.string(),
title: z.string().nullable(),
breakfastIncluded: z.boolean(),
isMemberRate: z.boolean(),
generalTerms: z.array(z.string()).optional(),
cancellationRule: z.string().optional(),
cancellationText: z.string().optional(),
mustBeGuaranteed: z.boolean(),
}),
reservationStatus: z.string(),
roomPrice: z.number().int(),
roomTypeCode: z.string(),