2022-03-26 23:58:22 +00:00
|
|
|
import { withValidation } from "next-validations";
|
|
|
|
import { z } from "zod";
|
|
|
|
|
|
|
|
const schemaAvailability = z
|
|
|
|
.object({
|
2022-03-27 13:15:46 +00:00
|
|
|
id: z.number(),
|
|
|
|
userId: z.number(),
|
|
|
|
eventTypeId: z.number(),
|
|
|
|
scheduleId: z.number(),
|
|
|
|
|
|
|
|
days: z.array(z.number()),
|
|
|
|
date: z.date().or(z.string()),
|
|
|
|
startTime: z.string(),
|
|
|
|
endTime: z.string(),
|
2022-03-26 23:58:22 +00:00
|
|
|
})
|
2022-03-27 00:19:49 +00:00
|
|
|
.strict();
|
2022-03-26 23:58:22 +00:00
|
|
|
const withValidAvailability = withValidation({
|
|
|
|
schema: schemaAvailability,
|
|
|
|
type: "Zod",
|
|
|
|
mode: "body",
|
|
|
|
});
|
|
|
|
|
|
|
|
export { schemaAvailability, withValidAvailability };
|