Files
DentalManagementMH06/packages/db/shared/schemas/objects/ClaimScalarWhereWithAggregatesInput.schema.ts
Gitead e1fe4862d5 fix: allow claims without appointment + support post/core multi-tooth input
- Make appointmentId nullable/optional in Prisma Zod schema via @zod rich
  comment so claims can be submitted without an existing appointment
- Convert undefined appointmentId to null in all claim form handlers and
  the backend claim creation endpoint
- Add AI classifier rule for expanding one procedure across multiple
  comma-separated tooth numbers (e.g. "post/core on #23, 24, 25, 26")
- Add "post/core" (slash) alias to CDT lookup maps

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 22:57:24 -04:00

40 lines
4.3 KiB
TypeScript

import * as z from 'zod';
import type { Prisma } from '../../../generated/prisma';
import { IntWithAggregatesFilterObjectSchema as IntWithAggregatesFilterObjectSchema } from './IntWithAggregatesFilter.schema';
import { IntNullableWithAggregatesFilterObjectSchema as IntNullableWithAggregatesFilterObjectSchema } from './IntNullableWithAggregatesFilter.schema';
import { StringWithAggregatesFilterObjectSchema as StringWithAggregatesFilterObjectSchema } from './StringWithAggregatesFilter.schema';
import { DateTimeWithAggregatesFilterObjectSchema as DateTimeWithAggregatesFilterObjectSchema } from './DateTimeWithAggregatesFilter.schema';
import { EnumMissingTeethStatusWithAggregatesFilterObjectSchema as EnumMissingTeethStatusWithAggregatesFilterObjectSchema } from './EnumMissingTeethStatusWithAggregatesFilter.schema';
import { MissingTeethStatusSchema } from '../enums/MissingTeethStatus.schema';
import { JsonNullableWithAggregatesFilterObjectSchema as JsonNullableWithAggregatesFilterObjectSchema } from './JsonNullableWithAggregatesFilter.schema';
import { EnumClaimStatusWithAggregatesFilterObjectSchema as EnumClaimStatusWithAggregatesFilterObjectSchema } from './EnumClaimStatusWithAggregatesFilter.schema';
import { ClaimStatusSchema } from '../enums/ClaimStatus.schema';
import { StringNullableWithAggregatesFilterObjectSchema as StringNullableWithAggregatesFilterObjectSchema } from './StringNullableWithAggregatesFilter.schema'
const claimscalarwherewithaggregatesinputSchema = z.object({
AND: z.union([z.lazy(() => ClaimScalarWhereWithAggregatesInputObjectSchema), z.lazy(() => ClaimScalarWhereWithAggregatesInputObjectSchema).array()]).optional(),
OR: z.lazy(() => ClaimScalarWhereWithAggregatesInputObjectSchema).array().optional(),
NOT: z.union([z.lazy(() => ClaimScalarWhereWithAggregatesInputObjectSchema), z.lazy(() => ClaimScalarWhereWithAggregatesInputObjectSchema).array()]).optional(),
id: z.union([z.lazy(() => IntWithAggregatesFilterObjectSchema), z.number().int()]).optional(),
patientId: z.union([z.lazy(() => IntWithAggregatesFilterObjectSchema), z.number().int()]).optional(),
appointmentId: z.union([z.lazy(() => IntNullableWithAggregatesFilterObjectSchema), z.number().int().int()]).optional().nullable(),
userId: z.union([z.lazy(() => IntWithAggregatesFilterObjectSchema), z.number().int()]).optional(),
staffId: z.union([z.lazy(() => IntWithAggregatesFilterObjectSchema), z.number().int()]).optional(),
patientName: z.union([z.lazy(() => StringWithAggregatesFilterObjectSchema), z.string()]).optional(),
memberId: z.union([z.lazy(() => StringWithAggregatesFilterObjectSchema), z.string()]).optional(),
dateOfBirth: z.union([z.lazy(() => DateTimeWithAggregatesFilterObjectSchema), z.coerce.date()]).optional(),
remarks: z.union([z.lazy(() => StringWithAggregatesFilterObjectSchema), z.string()]).optional(),
missingTeethStatus: z.union([z.lazy(() => EnumMissingTeethStatusWithAggregatesFilterObjectSchema), MissingTeethStatusSchema]).optional(),
missingTeeth: z.lazy(() => JsonNullableWithAggregatesFilterObjectSchema).optional(),
serviceDate: z.union([z.lazy(() => DateTimeWithAggregatesFilterObjectSchema), z.coerce.date()]).optional(),
insuranceProvider: z.union([z.lazy(() => StringWithAggregatesFilterObjectSchema), z.string()]).optional(),
createdAt: z.union([z.lazy(() => DateTimeWithAggregatesFilterObjectSchema), z.coerce.date()]).optional(),
updatedAt: z.union([z.lazy(() => DateTimeWithAggregatesFilterObjectSchema), z.coerce.date()]).optional(),
status: z.union([z.lazy(() => EnumClaimStatusWithAggregatesFilterObjectSchema), ClaimStatusSchema]).optional(),
claimNumber: z.union([z.lazy(() => StringNullableWithAggregatesFilterObjectSchema), z.string()]).optional().nullable(),
preAuthNumber: z.union([z.lazy(() => StringNullableWithAggregatesFilterObjectSchema), z.string()]).optional().nullable(),
npiProviderId: z.union([z.lazy(() => IntNullableWithAggregatesFilterObjectSchema), z.number().int()]).optional().nullable()
}).strict();
export const ClaimScalarWhereWithAggregatesInputObjectSchema: z.ZodType<Prisma.ClaimScalarWhereWithAggregatesInput> = claimscalarwherewithaggregatesinputSchema as unknown as z.ZodType<Prisma.ClaimScalarWhereWithAggregatesInput>;
export const ClaimScalarWhereWithAggregatesInputObjectZodSchema = claimscalarwherewithaggregatesinputSchema;