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