import * as z from 'zod';
import { Prisma } from '../../../generated/prisma';
import Decimal from 'decimal.js';
import { IntFieldUpdateOperationsInputObjectSchema as IntFieldUpdateOperationsInputObjectSchema } from './IntFieldUpdateOperationsInput.schema';
import { DecimalFieldUpdateOperationsInputObjectSchema as DecimalFieldUpdateOperationsInputObjectSchema } from './DecimalFieldUpdateOperationsInput.schema';
import { NullableDecimalFieldUpdateOperationsInputObjectSchema as NullableDecimalFieldUpdateOperationsInputObjectSchema } from './NullableDecimalFieldUpdateOperationsInput.schema';
import { PaymentStatusSchema } from '../enums/PaymentStatus.schema';
import { EnumPaymentStatusFieldUpdateOperationsInputObjectSchema as EnumPaymentStatusFieldUpdateOperationsInputObjectSchema } from './EnumPaymentStatusFieldUpdateOperationsInput.schema';
import { NullableStringFieldUpdateOperationsInputObjectSchema as NullableStringFieldUpdateOperationsInputObjectSchema } from './NullableStringFieldUpdateOperationsInput.schema';
import { DateTimeFieldUpdateOperationsInputObjectSchema as DateTimeFieldUpdateOperationsInputObjectSchema } from './DateTimeFieldUpdateOperationsInput.schema';
import { ClaimUpdateOneWithoutPaymentNestedInputObjectSchema as ClaimUpdateOneWithoutPaymentNestedInputObjectSchema } from './ClaimUpdateOneWithoutPaymentNestedInput.schema';
import { PatientUpdateOneRequiredWithoutPaymentNestedInputObjectSchema as PatientUpdateOneRequiredWithoutPaymentNestedInputObjectSchema } from './PatientUpdateOneRequiredWithoutPaymentNestedInput.schema';
import { UserUpdateOneWithoutUpdatedPaymentsNestedInputObjectSchema as UserUpdateOneWithoutUpdatedPaymentsNestedInputObjectSchema } from './UserUpdateOneWithoutUpdatedPaymentsNestedInput.schema';
import { NpiProviderUpdateOneWithoutPaymentsNestedInputObjectSchema as NpiProviderUpdateOneWithoutPaymentsNestedInputObjectSchema } from './NpiProviderUpdateOneWithoutPaymentsNestedInput.schema';
import { ServiceLineTransactionUpdateManyWithoutPaymentNestedInputObjectSchema as ServiceLineTransactionUpdateManyWithoutPaymentNestedInputObjectSchema } from './ServiceLineTransactionUpdateManyWithoutPaymentNestedInput.schema';
import { ServiceLineUpdateManyWithoutPaymentNestedInputObjectSchema as ServiceLineUpdateManyWithoutPaymentNestedInputObjectSchema } from './ServiceLineUpdateManyWithoutPaymentNestedInput.schema';
import { CommissionBatchItemUpdateManyWithoutPaymentNestedInputObjectSchema as CommissionBatchItemUpdateManyWithoutPaymentNestedInputObjectSchema } from './CommissionBatchItemUpdateManyWithoutPaymentNestedInput.schema'

import { DecimalJSLikeSchema, isValidDecimalInput } from '../../helpers/decimal-helpers';
const makeSchema = () => z.object({
  userId: z.union([z.number().int(), z.lazy(() => IntFieldUpdateOperationsInputObjectSchema)]).optional(),
  totalBilled: z.union([z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'totalBilled' must be a Decimal",
}), z.lazy(() => DecimalFieldUpdateOperationsInputObjectSchema)]).optional(),
  totalPaid: z.union([z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'totalPaid' must be a Decimal",
}), z.lazy(() => DecimalFieldUpdateOperationsInputObjectSchema)]).optional(),
  totalAdjusted: z.union([z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'totalAdjusted' must be a Decimal",
}), z.lazy(() => DecimalFieldUpdateOperationsInputObjectSchema)]).optional(),
  totalDue: z.union([z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'totalDue' must be a Decimal",
}), z.lazy(() => DecimalFieldUpdateOperationsInputObjectSchema)]).optional(),
  mhPaidAmount: z.union([z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'mhPaidAmount' must be a Decimal",
}), z.lazy(() => NullableDecimalFieldUpdateOperationsInputObjectSchema)]).optional().nullable(),
  copayment: z.union([z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'copayment' must be a Decimal",
}), z.lazy(() => DecimalFieldUpdateOperationsInputObjectSchema)]).optional(),
  adjustment: z.union([z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'adjustment' must be a Decimal",
}), z.lazy(() => DecimalFieldUpdateOperationsInputObjectSchema)]).optional(),
  status: z.union([PaymentStatusSchema, z.lazy(() => EnumPaymentStatusFieldUpdateOperationsInputObjectSchema)]).optional(),
  notes: z.union([z.string(), z.lazy(() => NullableStringFieldUpdateOperationsInputObjectSchema)]).optional().nullable(),
  icn: z.union([z.string(), z.lazy(() => NullableStringFieldUpdateOperationsInputObjectSchema)]).optional().nullable(),
  createdAt: z.union([z.coerce.date(), z.lazy(() => DateTimeFieldUpdateOperationsInputObjectSchema)]).optional(),
  updatedAt: z.union([z.coerce.date(), z.lazy(() => DateTimeFieldUpdateOperationsInputObjectSchema)]).optional(),
  claim: z.lazy(() => ClaimUpdateOneWithoutPaymentNestedInputObjectSchema).optional(),
  patient: z.lazy(() => PatientUpdateOneRequiredWithoutPaymentNestedInputObjectSchema).optional(),
  updatedBy: z.lazy(() => UserUpdateOneWithoutUpdatedPaymentsNestedInputObjectSchema).optional(),
  npiProvider: z.lazy(() => NpiProviderUpdateOneWithoutPaymentsNestedInputObjectSchema).optional(),
  serviceLineTransactions: z.lazy(() => ServiceLineTransactionUpdateManyWithoutPaymentNestedInputObjectSchema).optional(),
  serviceLines: z.lazy(() => ServiceLineUpdateManyWithoutPaymentNestedInputObjectSchema).optional(),
  commissionBatchItems: z.lazy(() => CommissionBatchItemUpdateManyWithoutPaymentNestedInputObjectSchema).optional()
}).strict();
export const PaymentUpdateInputObjectSchema: z.ZodType<Prisma.PaymentUpdateInput> = makeSchema() as unknown as z.ZodType<Prisma.PaymentUpdateInput>;
export const PaymentUpdateInputObjectZodSchema = makeSchema();
