eletrotupi / tcc/ api/src/schemas/insight.schema.tsb77de0cf2fd487c62b9c698932d65906b0ef9398
369 B | 10 lines Raw
1
import { z } from 'zod';
2
import { InsightPeriod, InsightType } from '@prisma/client';
3

4
export const InsightsQuerySchema = z.object({
5
  type: z.nativeEnum(InsightType).optional(),
6
  period: z.nativeEnum(InsightPeriod).optional(),
7
  limit: z.coerce.number().int().positive().max(100).optional(),
8
});
9

10
export type InsightsQueryInput = z.infer<typeof InsightsQuerySchema>;