/opt/mawid/packages/shared/src/schemas
Edit: /opt/mawid/packages/shared/src/schemas/appointment.ts (1064B)
import { z } from 'zod';
export const createAppointmentSchema = z.object({
patientId: z.string().min(1),
serviceId: z.string().min(1),
staffId: z.string().min(1),
startsAtUtc: z.string().datetime(),
});
export type CreateAppointmentInput = z.infer
;
export const updateAppointmentSchema = z
.object({
startsAtUtc: z.string().datetime(),
staffId: z.string().min(1),
status: z.enum(['confirmed', 'completed', 'no_show']),
})
.partial();
export type UpdateAppointmentInput = z.infer;
export const cancelAppointmentSchema = z.object({
reason: z.string().max(200).optional(),
});
export type CancelAppointmentInput = z.infer;
export const updatePatientSchema = z
.object({
name: z.string().min(1).max(120),
language: z.enum(['ar', 'tr', 'en']),
notes: z.string().max(2000).nullable(),
tags: z.array(z.string().min(1).max(40)).max(20),
})
.partial();
export type UpdatePatientInput = z.infer;