2022-03-26 23:58:22 +00:00
|
|
|
import { withValidation } from "next-validations";
|
2022-04-01 21:03:03 +00:00
|
|
|
import { z } from "zod";
|
2022-03-26 23:58:22 +00:00
|
|
|
|
2022-03-30 15:37:51 +00:00
|
|
|
import { _BookingReferenceModel as BookingReference } from "@calcom/prisma/zod";
|
|
|
|
|
2022-04-26 20:48:15 +00:00
|
|
|
export const schemaBookingReferenceBaseBodyParams = BookingReference.pick({
|
|
|
|
type: true,
|
|
|
|
bookingId: true,
|
|
|
|
uid: true,
|
|
|
|
meetingId: true,
|
|
|
|
meetingPassword: true,
|
|
|
|
meetingUrl: true,
|
|
|
|
deleted: true,
|
|
|
|
}).partial();
|
2022-03-30 15:37:51 +00:00
|
|
|
|
2022-04-26 20:48:15 +00:00
|
|
|
export const schemaBookingReferenceReadPublic = BookingReference.pick({
|
|
|
|
type: true,
|
|
|
|
bookingId: true,
|
|
|
|
uid: true,
|
|
|
|
meetingId: true,
|
|
|
|
meetingPassword: true,
|
|
|
|
meetingUrl: true,
|
|
|
|
deleted: true,
|
|
|
|
});
|
2022-03-30 15:37:51 +00:00
|
|
|
|
2022-04-26 20:48:15 +00:00
|
|
|
const schemaBookingReferenceEditParams = z.object({
|
2022-04-01 21:03:03 +00:00
|
|
|
type: z.string(),
|
|
|
|
uid: z.string(),
|
2022-04-26 20:48:15 +00:00
|
|
|
meetingId: z.string(),
|
|
|
|
meetingPassword: z.string(),
|
|
|
|
meetingUrl: z.string(),
|
|
|
|
deleted: z.boolean(),
|
2022-04-01 21:03:03 +00:00
|
|
|
});
|
2022-04-26 20:48:15 +00:00
|
|
|
const schemaBookingReferenceCreateParams = z.object({
|
|
|
|
type: z.string(),
|
|
|
|
uid: z.string(),
|
|
|
|
meetingId: z.string(),
|
|
|
|
meetingPassword: z.string(),
|
|
|
|
meetingUrl: z.string(),
|
|
|
|
deleted: z.boolean(),
|
2022-03-26 23:58:22 +00:00
|
|
|
});
|
2022-04-26 20:48:15 +00:00
|
|
|
export const schemaBookingCreateBodyParams = schemaBookingReferenceBaseBodyParams.merge(
|
|
|
|
schemaBookingReferenceCreateParams
|
|
|
|
);
|
|
|
|
export const schemaBookingEditBodyParams = schemaBookingReferenceBaseBodyParams.merge(
|
|
|
|
schemaBookingReferenceEditParams
|
|
|
|
);
|