import { z } from 'zod'; import { ListSchema } from './common'; /** * @deprecated use `VisitHistoryItemSchema` instead */ export const VisitSchema = z.object({ // TODO: Remove nullable when backend backfills the missing ids id: z.uuid().nullable(), customerId: z.uuid(), eventId: z.uuid().nullable(), productionId: z.uuid().nullable(), productionTitle: z.string().nullable(), venueId: z.uuid().nullable(), venueName: z.string().nullable(), eventStart: z.string(), isCancelled: z.boolean(), createdByClientId: z.uuid().nullable(), }); /** * @deprecated use `VisitHistoryItem` instead */ export type Visit = z.infer; /** * @deprecated use `VisitHistoryItemHalSchema` instead */ export const VisitHalSchema = VisitSchema.extend({ _links: z.object({ self: z.object({ href: z.string(), }), event: z .object({ href: z.string(), }) .nullable(), production: z .object({ href: z.string(), }) .nullable(), venue: z .object({ href: z.string(), }) .nullable(), }), }); /** * @deprecated use `VisitHistoryItemHalSchemaType` instead */ export type VisitHalSchemaType = z.infer; /** * @deprecated use `VisitHistoryItemHalListSchema` instead */ export const VisitHalListSchema = ListSchema.extend({ _embedded: z.object({ visits: z.array(VisitHalSchema), }), }); /** * @deprecated use `VisitHistoryItemHalListSchemaType` instead */ export type VisitHalListSchemaType = z.infer;