23 lines
712 B
TypeScript
23 lines
712 B
TypeScript
|
|
import { z } from 'zod';
|
||
|
|
|
||
|
|
export const requestReportSchema = z.object({
|
||
|
|
reportType: z.enum(['pipeline', 'revenue', 'activity', 'occupancy']),
|
||
|
|
name: z.string().min(1).max(200),
|
||
|
|
parameters: z
|
||
|
|
.object({
|
||
|
|
dateFrom: z.string().optional(),
|
||
|
|
dateTo: z.string().optional(),
|
||
|
|
})
|
||
|
|
.optional()
|
||
|
|
.default({}),
|
||
|
|
});
|
||
|
|
|
||
|
|
export const listReportsSchema = z.object({
|
||
|
|
page: z.coerce.number().int().positive().default(1),
|
||
|
|
limit: z.coerce.number().int().positive().max(100).default(20),
|
||
|
|
status: z.enum(['queued', 'processing', 'ready', 'failed']).optional(),
|
||
|
|
});
|
||
|
|
|
||
|
|
export type RequestReportInput = z.infer<typeof requestReportSchema>;
|
||
|
|
export type ListReportsInput = z.infer<typeof listReportsSchema>;
|