eletrotupi / tcc/ api/src/schemas/trigger.schema.ts6c0f1d02fc725cde9d020ca4c6f2675f6c3698f4
432 B | 16 lines Raw
1
import { z } from 'zod';
2
import {
3
  TriggerType
4
} from '@prisma/client';
5

6
export const CreateTriggerSchema = z.object({
7
  comment: z.string().optional(),
8
  moment: z.coerce.date(),
9
  category: z.nativeEnum(TriggerType)
10
});
11

12
export type CreateTriggerInput = z.infer<typeof CreateTriggerSchema>;
13

14
export const UpdateTriggerSchema = CreateTriggerSchema.partial();
15

16
export type UpdateTriggerInput = z.infer<typeof UpdateTriggerSchema>;