import { z } from 'zod'; import { ListSchema } from './common'; export const VisitHistoryItemSchema = z.object({ id: z.uuid(), productionId: z.uuid(), eventId: z.uuid().nullable(), eventStartDate: z.iso.datetime().nullable(), createdAt: z.iso.datetime(), isAddedByUser: z.boolean(), }); export type VisitHistoryItem = z.infer; export const VisitHistoryItemHalSchema = VisitHistoryItemSchema.extend({ _links: z.object({ self: z.object({ href: z.string(), }), }), }); export type VisitHistoryItemHalSchemaType = z.infer< typeof VisitHistoryItemHalSchema >; export const VisitHistoryItemHalListSchema = ListSchema.extend({ _embedded: z.object({ items: z.array(VisitHistoryItemHalSchema), }), }); export type VisitHistoryItemHalListSchemaType = z.infer< typeof VisitHistoryItemHalListSchema >; export const VisitHistoryProductionIdsHalSchema = z.object({ productionIds: z.array(z.uuid()), _links: z.object({ self: z.object({ href: z.string(), }), }), }); export type VisitHistoryProductionIdsHal = z.infer< typeof VisitHistoryProductionIdsHalSchema >;