This implements the actual call to the API to create a booking. That’s the only thing it does, it doesn’t handle the response in any way. This PR is just to get it there and the new booking sub team will handle it further, with payment etc. Approved-by: Michael Zetterberg Approved-by: Fredrik Thorsson Approved-by: Simon.Emanuelsson
39 lines
946 B
TypeScript
39 lines
946 B
TypeScript
import { z } from "zod"
|
|
|
|
// Query
|
|
// Mutation
|
|
export const createBookingInput = z.object({
|
|
hotelId: z.string(),
|
|
checkInDate: z.string(),
|
|
checkOutDate: z.string(),
|
|
rooms: z.array(
|
|
z.object({
|
|
adults: z.number().int().nonnegative(),
|
|
children: z.number().int().nonnegative(),
|
|
rateCode: z.string(),
|
|
roomTypeCode: z.string(),
|
|
guest: z.object({
|
|
title: z.string(),
|
|
firstName: z.string(),
|
|
lastName: z.string(),
|
|
email: z.string().email(),
|
|
phoneCountryCodePrefix: z.string(),
|
|
phoneNumber: z.string(),
|
|
countryCode: z.string(),
|
|
}),
|
|
smsConfirmationRequested: z.boolean(),
|
|
})
|
|
),
|
|
payment: z.object({
|
|
cardHolder: z.object({
|
|
Email: z.string().email(),
|
|
Name: z.string(),
|
|
PhoneCountryCode: z.string(),
|
|
PhoneSubscriber: z.string(),
|
|
}),
|
|
success: z.string(),
|
|
error: z.string(),
|
|
cancel: z.string(),
|
|
}),
|
|
})
|