import * as z from 'zod';
import { Prisma } from '../../../generated/prisma';
import Decimal from 'decimal.js';
import { PaymentMethodSchema } from '../enums/PaymentMethod.schema'

import { DecimalJSLikeSchema, isValidDecimalInput } from '../../helpers/decimal-helpers';
const makeSchema = () => z.object({
  id: z.number().int().optional(),
  serviceLineId: z.number().int(),
  transactionId: z.string().optional().nullable(),
  paidAmount: z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.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(Prisma.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()
}).strict();
export const ServiceLineTransactionUncheckedCreateWithoutPaymentInputObjectSchema: z.ZodType<Prisma.ServiceLineTransactionUncheckedCreateWithoutPaymentInput> = makeSchema() as unknown as z.ZodType<Prisma.ServiceLineTransactionUncheckedCreateWithoutPaymentInput>;
export const ServiceLineTransactionUncheckedCreateWithoutPaymentInputObjectZodSchema = makeSchema();
