import { z } from "zod";

export const patientSchema = z.object({
  patientCode: z
    .string()
    .trim()
    .max(50)
    .optional()
    .transform((v) => (v ? v.toUpperCase() : undefined)),
  firstName: z
    .string()
    .trim()
    .max(100)
    .optional()
    .transform((v) => (v ? v : undefined)),
  lastName: z
    .string()
    .trim()
    .max(100)
    .optional()
    .transform((v) => (v ? v : undefined)),
  notes: z
    .string()
    .trim()
    .max(2000)
    .optional()
    .transform((v) => (v ? v : undefined)),
});

export type PatientInput = z.infer<typeof patientSchema>;
