Files
calendar/packages/features/insights/server/raw-data.schema.ts
T
Eunjae LeeandGitHub fdc8e084ea fix: stats on /insights/routing (#18985)
* fix: replace filter implementation on /insights/routing

* remove unused functions

* fix type error

* refactor: extract insights parameters

* remove FiltersProvider
2025-01-31 17:16:53 +01:00

32 lines
1.0 KiB
TypeScript

import z from "zod";
import { ZColumnFilter, ZSorting } from "@calcom/features/data-table";
export const rawDataInputSchema = z.object({
startDate: z.string(),
endDate: z.string(),
teamId: z.coerce.number().optional().nullable(),
userId: z.coerce.number().optional().nullable(),
memberUserId: z.coerce.number().optional().nullable(),
isAll: z.coerce.boolean().optional(),
eventTypeId: z.coerce.number().optional().nullable(),
});
export type RawDataInput = z.infer<typeof rawDataInputSchema>;
export const routingFormResponsesInputSchema = z.object({
startDate: z.string(),
endDate: z.string(),
teamId: z.coerce.number().optional(),
userId: z.coerce.number().optional(),
memberUserIds: z.number().array().optional(),
isAll: z.coerce.boolean(),
routingFormId: z.string().optional(),
cursor: z.number().optional(),
limit: z.number().optional(),
columnFilters: z.array(ZColumnFilter),
sorting: z.array(ZSorting).optional(),
});
export type RoutingFormResponsesInput = z.infer<typeof routingFormResponsesInputSchema>;