Files
DentalManagementMHAprilgg/packages/db/shared/schemas/objects/ServiceLineUncheckedCreateWithoutClaimInput.schema.ts
2026-04-04 22:13:55 -04:00

59 lines
2.3 KiB
TypeScript

import * as z from 'zod';
import type { Prisma } from '../../../generated/prisma';
import { ServiceLineStatusSchema } from '../enums/ServiceLineStatus.schema';
import { ServiceLineTransactionUncheckedCreateNestedManyWithoutServiceLineInputObjectSchema as ServiceLineTransactionUncheckedCreateNestedManyWithoutServiceLineInputObjectSchema } from './ServiceLineTransactionUncheckedCreateNestedManyWithoutServiceLineInput.schema'
import { DecimalJSLikeSchema, isValidDecimalInput } from '../../helpers/decimal-helpers';
import Decimal from "decimal.js";
const makeSchema = () => z.object({
id: z.number().int().optional(),
paymentId: z.number().int().optional().nullable(),
procedureCode: z.string(),
procedureDate: z.coerce.date(),
quad: z.string().optional().nullable(),
arch: z.string().optional().nullable(),
toothNumber: z.string().optional().nullable(),
toothSurface: z.string().optional().nullable(),
totalBilled: z.union([
z.number(),
z.string(),
z.instanceof(Decimal),
z.instanceof(Decimal),
DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
message: "Field 'totalBilled' must be a Decimal",
}),
totalPaid: z.union([
z.number(),
z.string(),
z.instanceof(Decimal),
z.instanceof(Decimal),
DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
message: "Field 'totalPaid' must be a Decimal",
}).optional(),
totalAdjusted: z.union([
z.number(),
z.string(),
z.instanceof(Decimal),
z.instanceof(Decimal),
DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
message: "Field 'totalAdjusted' must be a Decimal",
}).optional(),
totalDue: z.union([
z.number(),
z.string(),
z.instanceof(Decimal),
z.instanceof(Decimal),
DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
message: "Field 'totalDue' must be a Decimal",
}).optional(),
status: ServiceLineStatusSchema.optional(),
serviceLineTransactions: z.lazy(() => ServiceLineTransactionUncheckedCreateNestedManyWithoutServiceLineInputObjectSchema).optional()
}).strict();
export const ServiceLineUncheckedCreateWithoutClaimInputObjectSchema: z.ZodType<Prisma.ServiceLineUncheckedCreateWithoutClaimInput> = makeSchema() as unknown as z.ZodType<Prisma.ServiceLineUncheckedCreateWithoutClaimInput>;
export const ServiceLineUncheckedCreateWithoutClaimInputObjectZodSchema = makeSchema();