Files
calendar/packages/features/bookings/lib/getBookingDataSchema.ts
T
5f8d090d3c refactor: handleNewBooking #3 (#15612)
* refactor: handleNewBooking #3

* fix: type error

* fix: type err

* fix: type err

* refactor: create booking factor

* chore: refactor availusers

* chore: type err

---------

Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Keith Williams <keithwillcode@gmail.com>
2024-07-08 18:18:36 +00:00

23 lines
693 B
TypeScript

import { z } from "zod";
import { extendedBookingCreateBody } from "@calcom/prisma/zod-utils";
import type { getBookingFieldsWithSystemFields } from "./getBookingFields";
import getBookingResponsesSchema from "./getBookingResponsesSchema";
const getBookingDataSchema = ({
view = "booking",
bookingFields,
}: {
view: "booking" | "reschedule";
bookingFields: Awaited<ReturnType<typeof getBookingFieldsWithSystemFields>>;
}) => {
return extendedBookingCreateBody.merge(
z.object({ responses: getBookingResponsesSchema({ bookingFields, view }) })
);
};
export type TgetBookingDataSchema = z.infer<ReturnType<typeof getBookingDataSchema>>;
export default getBookingDataSchema;