- 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>
66 lines
4.0 KiB
TypeScript
66 lines
4.0 KiB
TypeScript
import type { Prisma } from '../../generated/prisma';
|
|
import * as z from 'zod';
|
|
import { AppointmentIncludeObjectSchema as AppointmentIncludeObjectSchema } from './objects/AppointmentInclude.schema';
|
|
import { AppointmentOrderByWithRelationInputObjectSchema as AppointmentOrderByWithRelationInputObjectSchema } from './objects/AppointmentOrderByWithRelationInput.schema';
|
|
import { AppointmentWhereInputObjectSchema as AppointmentWhereInputObjectSchema } from './objects/AppointmentWhereInput.schema';
|
|
import { AppointmentWhereUniqueInputObjectSchema as AppointmentWhereUniqueInputObjectSchema } from './objects/AppointmentWhereUniqueInput.schema';
|
|
import { AppointmentScalarFieldEnumSchema } from './enums/AppointmentScalarFieldEnum.schema';
|
|
|
|
// Select schema needs to be in file to prevent circular imports
|
|
//------------------------------------------------------
|
|
|
|
export const AppointmentFindManySelectSchema: z.ZodType<Prisma.AppointmentSelect> = z.object({
|
|
id: z.boolean().optional(),
|
|
patientId: z.boolean().optional(),
|
|
userId: z.boolean().optional(),
|
|
staffId: z.boolean().optional(),
|
|
title: z.boolean().optional(),
|
|
date: z.boolean().optional(),
|
|
startTime: z.boolean().optional(),
|
|
endTime: z.boolean().optional(),
|
|
type: z.boolean().optional(),
|
|
typeLocked: z.boolean().optional(),
|
|
notes: z.boolean().optional(),
|
|
procedureCodeNotes: z.boolean().optional(),
|
|
status: z.boolean().optional(),
|
|
movedByAi: z.boolean().optional(),
|
|
createdAt: z.boolean().optional(),
|
|
eligibilityStatus: z.boolean().optional(),
|
|
patient: z.boolean().optional(),
|
|
user: z.boolean().optional(),
|
|
staff: z.boolean().optional(),
|
|
procedures: z.boolean().optional(),
|
|
claims: z.boolean().optional(),
|
|
files: z.boolean().optional(),
|
|
_count: z.boolean().optional()
|
|
}).strict() as unknown as z.ZodType<Prisma.AppointmentSelect>;
|
|
|
|
export const AppointmentFindManySelectZodSchema = z.object({
|
|
id: z.boolean().optional(),
|
|
patientId: z.boolean().optional(),
|
|
userId: z.boolean().optional(),
|
|
staffId: z.boolean().optional(),
|
|
title: z.boolean().optional(),
|
|
date: z.boolean().optional(),
|
|
startTime: z.boolean().optional(),
|
|
endTime: z.boolean().optional(),
|
|
type: z.boolean().optional(),
|
|
typeLocked: z.boolean().optional(),
|
|
notes: z.boolean().optional(),
|
|
procedureCodeNotes: z.boolean().optional(),
|
|
status: z.boolean().optional(),
|
|
movedByAi: z.boolean().optional(),
|
|
createdAt: z.boolean().optional(),
|
|
eligibilityStatus: z.boolean().optional(),
|
|
patient: z.boolean().optional(),
|
|
user: z.boolean().optional(),
|
|
staff: z.boolean().optional(),
|
|
procedures: z.boolean().optional(),
|
|
claims: z.boolean().optional(),
|
|
files: z.boolean().optional(),
|
|
_count: z.boolean().optional()
|
|
}).strict();
|
|
|
|
export const AppointmentFindManySchema: z.ZodType<Prisma.AppointmentFindManyArgs> = z.object({ select: AppointmentFindManySelectSchema.optional(), include: z.lazy(() => AppointmentIncludeObjectSchema.optional()), orderBy: z.union([AppointmentOrderByWithRelationInputObjectSchema, AppointmentOrderByWithRelationInputObjectSchema.array()]).optional(), where: AppointmentWhereInputObjectSchema.optional(), cursor: AppointmentWhereUniqueInputObjectSchema.optional(), take: z.number().optional(), skip: z.number().optional(), distinct: z.union([AppointmentScalarFieldEnumSchema, AppointmentScalarFieldEnumSchema.array()]).optional() }).strict() as unknown as z.ZodType<Prisma.AppointmentFindManyArgs>;
|
|
|
|
export const AppointmentFindManyZodSchema = z.object({ select: AppointmentFindManySelectSchema.optional(), include: z.lazy(() => AppointmentIncludeObjectSchema.optional()), orderBy: z.union([AppointmentOrderByWithRelationInputObjectSchema, AppointmentOrderByWithRelationInputObjectSchema.array()]).optional(), where: AppointmentWhereInputObjectSchema.optional(), cursor: AppointmentWhereUniqueInputObjectSchema.optional(), take: z.number().optional(), skip: z.number().optional(), distinct: z.union([AppointmentScalarFieldEnumSchema, AppointmentScalarFieldEnumSchema.array()]).optional() }).strict(); |