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