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