Files
calendar/packages/trpc/server/routers/viewer/bookings/get.schema.ts
T
Lauris SkraucisandGitHub 08bcc77e2c feat: v2 GET bookings updated at filters and sort (#19133)
* fix: make Booking.updatedAt update automatically

* feat: return updatedAt by bookings endpoints

* feat: GET bookings beforeUpdatedAt, afterUpdatedAt, sortUpdated params

* docs: api

* chore: bump platform-libraries

* refactor: sortUpdated -> sortUpdatedAt query param

* chore: delete wrong migration
2025-02-11 08:39:50 +00:00

21 lines
813 B
TypeScript

import { z } from "zod";
export const ZGetInputSchema = z.object({
filters: z.object({
teamIds: z.number().array().optional(),
userIds: z.number().array().optional(),
status: z.enum(["upcoming", "recurring", "past", "cancelled", "unconfirmed"]).optional(),
eventTypeIds: z.number().array().optional(),
attendeeEmail: z.string().optional(),
attendeeName: z.string().optional(),
afterStartDate: z.string().optional(),
beforeEndDate: z.string().optional(),
afterUpdatedDate: z.string().optional(),
beforeUpdatedDate: z.string().optional(),
}),
limit: z.number().min(1).max(100).nullish(),
cursor: z.number().nullish(), // <-- "cursor" needs to exist when using useInfiniteQuery, but can be any type
});
export type TGetInputSchema = z.infer<typeof ZGetInputSchema>;