import * as z from 'zod'; import type { Prisma } from '../../../generated/prisma'; import { PaymentMethodSchema } from '../enums/PaymentMethod.schema'; import { ServiceLineCreateNestedOneWithoutServiceLineTransactionsInputObjectSchema as ServiceLineCreateNestedOneWithoutServiceLineTransactionsInputObjectSchema } from './ServiceLineCreateNestedOneWithoutServiceLineTransactionsInput.schema' import { DecimalJSLikeSchema, isValidDecimalInput } from '../../helpers/decimal-helpers'; import Decimal from "decimal.js"; const makeSchema = () => z.object({ transactionId: z.string().optional().nullable(), paidAmount: z.union([ z.number(), z.string(), z.instanceof(Decimal), z.instanceof(Decimal), DecimalJSLikeSchema, ]).refine((v) => isValidDecimalInput(v), { message: "Field 'paidAmount' must be a Decimal", }), adjustedAmount: z.union([ z.number(), z.string(), z.instanceof(Decimal), z.instanceof(Decimal), DecimalJSLikeSchema, ]).refine((v) => isValidDecimalInput(v), { message: "Field 'adjustedAmount' must be a Decimal", }).optional(), method: PaymentMethodSchema, receivedDate: z.coerce.date(), payerName: z.string().optional().nullable(), notes: z.string().optional().nullable(), createdAt: z.coerce.date().optional(), serviceLine: z.lazy(() => ServiceLineCreateNestedOneWithoutServiceLineTransactionsInputObjectSchema) }).strict(); export const ServiceLineTransactionCreateWithoutPaymentInputObjectSchema: z.ZodType = makeSchema() as unknown as z.ZodType; export const ServiceLineTransactionCreateWithoutPaymentInputObjectZodSchema = makeSchema();