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


import { DecimalJSLikeSchema, isValidDecimalInput } from '../../helpers/decimal-helpers';
const nesteddecimalnullablefilterSchema = z.object({
  equals: z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'equals' must be a Decimal",
}).optional().nullable(),
  in: z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'in' must be a Decimal",
}).array().optional().nullable(),
  notIn: z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'notIn' must be a Decimal",
}).array().optional().nullable(),
  lt: z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'lt' must be a Decimal",
}).optional(),
  lte: z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'lte' must be a Decimal",
}).optional(),
  gt: z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'gt' must be a Decimal",
}).optional(),
  gte: z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'gte' must be a Decimal",
}).optional(),
  not: z.union([z.union([
  z.number(),
  z.string(),
  z.instanceof(Decimal),
  z.instanceof(Prisma.Decimal),
  DecimalJSLikeSchema,
]).refine((v) => isValidDecimalInput(v), {
  message: "Field 'not' must be a Decimal",
}), z.lazy(() => NestedDecimalNullableFilterObjectSchema)]).optional().nullable()
}).strict();
export const NestedDecimalNullableFilterObjectSchema: z.ZodType<Prisma.NestedDecimalNullableFilter> = nesteddecimalnullablefilterSchema as unknown as z.ZodType<Prisma.NestedDecimalNullableFilter>;
export const NestedDecimalNullableFilterObjectZodSchema = nesteddecimalnullablefilterSchema;
