Files
DentalManagementMH06/packages/db/shared/schemas/variants/input/Appointment.input.ts
ff 9d0cfe5dba feat: appointment type inference, procedure codes on cards, claim attachment fixes
- Add appointment type categories matching insurance claim form (recall, filling, pedo, dentures, implant, endo, crown, perio, extraction, ortho, consultation, emergency, other)
- Auto-infer appointment type from CDT codes with priority rules (endo > implant > crown > ...)
- typeLocked flag prevents auto-overwrite when user manually sets type
- Show appointment type label and procedure codes on schedule cards
- Background sync on /day route retroactively fixes stale appointment types
- Fix PUT /api/claims/:id to save claimFiles (previously silently dropped)
- Auto-link AppointmentFile records to ClaimFile when claim is created or updated
- Fix D5750 (denture reline) CDT range to map correctly to dentures category
- Fix typeLocked Zod rejection in appointment update route

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 14:18:10 -04:00

30 lines
944 B
TypeScript

import * as z from 'zod';
import { PatientStatusSchema } from '../../enums/PatientStatus.schema';
// prettier-ignore
export const AppointmentInputSchema = z.object({
id: z.number().int(),
patientId: z.number().int(),
userId: z.number().int(),
staffId: z.number().int(),
title: z.string(),
date: z.date(),
startTime: z.string(),
endTime: z.string(),
type: z.string(),
typeLocked: z.boolean(),
notes: z.string().optional().nullable(),
procedureCodeNotes: z.string().optional().nullable(),
status: z.string(),
movedByAi: z.boolean(),
createdAt: z.date(),
eligibilityStatus: PatientStatusSchema,
patient: z.unknown(),
user: z.unknown(),
staff: z.unknown().optional().nullable(),
procedures: z.array(z.unknown()),
claims: z.array(z.unknown()),
files: z.array(z.unknown())
}).strict();
export type AppointmentInputType = z.infer<typeof AppointmentInputSchema>;