- 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>
31 lines
2.4 KiB
TypeScript
31 lines
2.4 KiB
TypeScript
import * as z from 'zod';
|
|
import type { Prisma } from '../../../generated/prisma';
|
|
import { PatientStatusSchema } from '../enums/PatientStatus.schema';
|
|
import { PatientCreateNestedOneWithoutAppointmentsInputObjectSchema as PatientCreateNestedOneWithoutAppointmentsInputObjectSchema } from './PatientCreateNestedOneWithoutAppointmentsInput.schema';
|
|
import { StaffCreateNestedOneWithoutAppointmentsInputObjectSchema as StaffCreateNestedOneWithoutAppointmentsInputObjectSchema } from './StaffCreateNestedOneWithoutAppointmentsInput.schema';
|
|
import { AppointmentProcedureCreateNestedManyWithoutAppointmentInputObjectSchema as AppointmentProcedureCreateNestedManyWithoutAppointmentInputObjectSchema } from './AppointmentProcedureCreateNestedManyWithoutAppointmentInput.schema';
|
|
import { ClaimCreateNestedManyWithoutAppointmentInputObjectSchema as ClaimCreateNestedManyWithoutAppointmentInputObjectSchema } from './ClaimCreateNestedManyWithoutAppointmentInput.schema';
|
|
import { AppointmentFileCreateNestedManyWithoutAppointmentInputObjectSchema as AppointmentFileCreateNestedManyWithoutAppointmentInputObjectSchema } from './AppointmentFileCreateNestedManyWithoutAppointmentInput.schema'
|
|
|
|
const makeSchema = () => z.object({
|
|
title: z.string(),
|
|
date: z.coerce.date(),
|
|
startTime: z.string(),
|
|
endTime: z.string(),
|
|
type: z.string(),
|
|
typeLocked: z.boolean().optional(),
|
|
notes: z.string().optional().nullable(),
|
|
procedureCodeNotes: z.string().optional().nullable(),
|
|
status: z.string().optional(),
|
|
movedByAi: z.boolean().optional(),
|
|
createdAt: z.coerce.date().optional(),
|
|
eligibilityStatus: PatientStatusSchema.optional(),
|
|
patient: z.lazy(() => PatientCreateNestedOneWithoutAppointmentsInputObjectSchema),
|
|
staff: z.lazy(() => StaffCreateNestedOneWithoutAppointmentsInputObjectSchema).optional(),
|
|
procedures: z.lazy(() => AppointmentProcedureCreateNestedManyWithoutAppointmentInputObjectSchema).optional(),
|
|
claims: z.lazy(() => ClaimCreateNestedManyWithoutAppointmentInputObjectSchema).optional(),
|
|
files: z.lazy(() => AppointmentFileCreateNestedManyWithoutAppointmentInputObjectSchema).optional()
|
|
}).strict();
|
|
export const AppointmentCreateWithoutUserInputObjectSchema: z.ZodType<Prisma.AppointmentCreateWithoutUserInput> = makeSchema() as unknown as z.ZodType<Prisma.AppointmentCreateWithoutUserInput>;
|
|
export const AppointmentCreateWithoutUserInputObjectZodSchema = makeSchema();
|