Files
DentalManagementMH06/packages/db/shared/schemas/objects/AppointmentOrderByWithAggregationInput.schema.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

36 lines
2.5 KiB
TypeScript

import * as z from 'zod';
import type { Prisma } from '../../../generated/prisma';
import { SortOrderSchema } from '../enums/SortOrder.schema';
import { SortOrderInputObjectSchema as SortOrderInputObjectSchema } from './SortOrderInput.schema';
import { AppointmentCountOrderByAggregateInputObjectSchema as AppointmentCountOrderByAggregateInputObjectSchema } from './AppointmentCountOrderByAggregateInput.schema';
import { AppointmentAvgOrderByAggregateInputObjectSchema as AppointmentAvgOrderByAggregateInputObjectSchema } from './AppointmentAvgOrderByAggregateInput.schema';
import { AppointmentMaxOrderByAggregateInputObjectSchema as AppointmentMaxOrderByAggregateInputObjectSchema } from './AppointmentMaxOrderByAggregateInput.schema';
import { AppointmentMinOrderByAggregateInputObjectSchema as AppointmentMinOrderByAggregateInputObjectSchema } from './AppointmentMinOrderByAggregateInput.schema';
import { AppointmentSumOrderByAggregateInputObjectSchema as AppointmentSumOrderByAggregateInputObjectSchema } from './AppointmentSumOrderByAggregateInput.schema'
const makeSchema = () => z.object({
id: SortOrderSchema.optional(),
patientId: SortOrderSchema.optional(),
userId: SortOrderSchema.optional(),
staffId: SortOrderSchema.optional(),
title: SortOrderSchema.optional(),
date: SortOrderSchema.optional(),
startTime: SortOrderSchema.optional(),
endTime: SortOrderSchema.optional(),
type: SortOrderSchema.optional(),
typeLocked: SortOrderSchema.optional(),
notes: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
procedureCodeNotes: z.union([SortOrderSchema, z.lazy(() => SortOrderInputObjectSchema)]).optional(),
status: SortOrderSchema.optional(),
movedByAi: SortOrderSchema.optional(),
createdAt: SortOrderSchema.optional(),
eligibilityStatus: SortOrderSchema.optional(),
_count: z.lazy(() => AppointmentCountOrderByAggregateInputObjectSchema).optional(),
_avg: z.lazy(() => AppointmentAvgOrderByAggregateInputObjectSchema).optional(),
_max: z.lazy(() => AppointmentMaxOrderByAggregateInputObjectSchema).optional(),
_min: z.lazy(() => AppointmentMinOrderByAggregateInputObjectSchema).optional(),
_sum: z.lazy(() => AppointmentSumOrderByAggregateInputObjectSchema).optional()
}).strict();
export const AppointmentOrderByWithAggregationInputObjectSchema: z.ZodType<Prisma.AppointmentOrderByWithAggregationInput> = makeSchema() as unknown as z.ZodType<Prisma.AppointmentOrderByWithAggregationInput>;
export const AppointmentOrderByWithAggregationInputObjectZodSchema = makeSchema();