eletrotupi / tcc/ api/src/schemas/insight.schema.ts88bac7621643f12d5f198d5c4497d44d143186d9
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>;