2022-04-02 01:46:24 +00:00
|
|
|
import { z } from "zod";
|
2022-03-26 23:58:22 +00:00
|
|
|
|
2022-03-30 15:37:51 +00:00
|
|
|
import { _DestinationCalendarModel as DestinationCalendar } from "@calcom/prisma/zod";
|
|
|
|
|
2022-04-27 17:25:36 +00:00
|
|
|
export const schemaDestinationCalendarBaseBodyParams = DestinationCalendar.pick({
|
2023-10-17 00:09:22 +00:00
|
|
|
credentialId: true,
|
2022-04-27 17:25:36 +00:00
|
|
|
integration: true,
|
|
|
|
externalId: true,
|
|
|
|
eventTypeId: true,
|
|
|
|
bookingId: true,
|
|
|
|
userId: true,
|
|
|
|
}).partial();
|
2022-04-02 01:46:24 +00:00
|
|
|
|
2022-04-27 17:45:59 +00:00
|
|
|
const schemaDestinationCalendarCreateParams = z
|
|
|
|
.object({
|
|
|
|
integration: z.string(),
|
|
|
|
externalId: z.string(),
|
2023-10-17 00:09:22 +00:00
|
|
|
credentialId: z.number(),
|
2023-10-12 20:53:48 +00:00
|
|
|
eventTypeId: z.number().optional(),
|
|
|
|
bookingId: z.number().optional(),
|
|
|
|
userId: z.number().optional(),
|
2022-04-27 17:45:59 +00:00
|
|
|
})
|
|
|
|
.strict();
|
2022-03-30 15:37:51 +00:00
|
|
|
|
2022-04-27 17:25:36 +00:00
|
|
|
export const schemaDestinationCalendarCreateBodyParams = schemaDestinationCalendarBaseBodyParams.merge(
|
|
|
|
schemaDestinationCalendarCreateParams
|
|
|
|
);
|
2022-03-30 15:37:51 +00:00
|
|
|
|
2022-04-27 17:45:59 +00:00
|
|
|
const schemaDestinationCalendarEditParams = z
|
|
|
|
.object({
|
|
|
|
integration: z.string().optional(),
|
|
|
|
externalId: z.string().optional(),
|
|
|
|
eventTypeId: z.number().optional(),
|
|
|
|
bookingId: z.number().optional(),
|
|
|
|
userId: z.number().optional(),
|
|
|
|
})
|
|
|
|
.strict();
|
|
|
|
|
|
|
|
export const schemaDestinationCalendarEditBodyParams = schemaDestinationCalendarBaseBodyParams.merge(
|
|
|
|
schemaDestinationCalendarEditParams
|
|
|
|
);
|
|
|
|
|
2022-04-27 17:25:36 +00:00
|
|
|
export const schemaDestinationCalendarReadPublic = DestinationCalendar.pick({
|
|
|
|
id: true,
|
|
|
|
integration: true,
|
|
|
|
externalId: true,
|
|
|
|
eventTypeId: true,
|
|
|
|
bookingId: true,
|
|
|
|
userId: true,
|
2023-10-17 00:09:22 +00:00
|
|
|
credentialId: true,
|
2022-03-26 23:58:22 +00:00
|
|
|
});
|