diff --git a/bun.lock b/bun.lock index cd7f2ee..6c4268e 100644 --- a/bun.lock +++ b/bun.lock @@ -50,6 +50,7 @@ "lucide-react": "^0.535.0", "next": "^15.2.3", "next-themes": "^0.4.6", + "papaparse": "^5.5.3", "pdf-lib": "^1.17.1", "pdfkit": "^0.17.1", "react": "^19.0.0", @@ -66,6 +67,7 @@ "tw-animate-css": "^1.2.4", "twilio": "^5.9.0", "uuid": "^11.1.0", + "xlsx": "^0.18.5", "zod": "^3.24.2", }, "devDependencies": { @@ -73,6 +75,7 @@ "@tailwindcss/postcss": "^4.0.15", "@types/lodash.throttle": "^4.1.9", "@types/node": "^20.14.10", + "@types/papaparse": "^5.3.16", "@types/react": "^19.0.0", "@types/react-csv": "^1.1.10", "@types/react-dom": "^19.0.0", @@ -638,6 +641,8 @@ "@types/node": ["@types/node@20.17.25", "", { "dependencies": { "undici-types": "~6.19.2" } }, "sha512-bT+r2haIlplJUYtlZrEanFHdPIZTeiMeh/fSOEbOOfWf9uTn+lg8g0KU6Q3iMgjd9FLuuMAgfCNSkjUbxL6E3Q=="], + "@types/papaparse": ["@types/papaparse@5.3.16", "", { "dependencies": { "@types/node": "*" } }, "sha512-T3VuKMC2H0lgsjI9buTB3uuKj3EMD2eap1MOuEQuBQ44EnDx/IkGhU6EwiTf9zG3za4SKlmwKAImdDKdNnCsXg=="], + "@types/pdfkit": ["@types/pdfkit@0.17.2", "", { "dependencies": { "@types/node": "*" } }, "sha512-a7mqP/l8lsLMVNhQ3N2blU5pA1KX0YFE8FxWp0OTqZQKEZoPk7ndAlW+kdFBAWpFmLpy6fFbMRm4a6ZELWNgOQ=="], "@types/react": ["@types/react@19.0.12", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-V6Ar115dBDrjbtXSrS+/Oruobc+qVbbUxDFC1RSbRqLt5SYvxxyIDrSC85RWml54g+jfNeEMZhEj7wW07ONQhA=="], @@ -712,6 +717,8 @@ "acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="], + "adler-32": ["adler-32@1.3.1", "", {}, "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A=="], + "agent-base": ["agent-base@6.0.2", "", { "dependencies": { "debug": "4" } }, "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ=="], "ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="], @@ -788,6 +795,8 @@ "caniuse-lite": ["caniuse-lite@1.0.30001707", "", {}, "sha512-3qtRjw/HQSMlDWf+X79N206fepf4SOOU6SQLMaq/0KkZLmSjPxAkBOQQ+FxbHKfHmYLZFfdWsO3KA90ceHPSnw=="], + "cfb": ["cfb@1.2.2", "", { "dependencies": { "adler-32": "~1.3.0", "crc-32": "~1.2.0" } }, "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA=="], + "chai": ["chai@5.3.3", "", { "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", "deep-eql": "^5.0.1", "loupe": "^3.1.0", "pathval": "^2.0.0" } }, "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw=="], "chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], @@ -806,6 +815,8 @@ "code-block-writer": ["code-block-writer@12.0.0", "", {}, "sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w=="], + "codepage": ["codepage@1.15.0", "", {}, "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA=="], + "color": ["color@4.2.3", "", { "dependencies": { "color-convert": "^2.0.1", "color-string": "^1.9.0" } }, "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A=="], "color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], @@ -820,6 +831,8 @@ "copy-anything": ["copy-anything@3.0.5", "", { "dependencies": { "is-what": "^4.1.8" } }, "sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w=="], + "crc-32": ["crc-32@1.2.2", "", { "bin": { "crc32": "bin/crc32.njs" } }, "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="], + "crelt": ["crelt@1.0.6", "", {}, "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g=="], "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], @@ -990,6 +1003,8 @@ "form-data": ["form-data@4.0.4", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.2", "mime-types": "^2.1.12" } }, "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow=="], + "frac": ["frac@1.1.2", "", {}, "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA=="], + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], @@ -1268,6 +1283,8 @@ "pako": ["pako@1.0.11", "", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="], + "papaparse": ["papaparse@5.5.3", "", {}, "sha512-5QvjGxYVjxO59MGU2lHVYpRWBBtKHnlIAcSe1uNFCkkptUh63NFRj0FJQm7nR67puEruUci/ZkjmEFrjCAyP4A=="], + "parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="], "parseley": ["parseley@0.12.1", "", { "dependencies": { "leac": "^0.6.0", "peberminta": "^0.9.0" } }, "sha512-e6qHKe3a9HWr0oMRVDTRhKce+bRO8VGQR3NyVwcjwrbhMmFCX9KszEV35+rn4AdilFAq9VPxP/Fe1wC9Qjd2lw=="], @@ -1454,6 +1471,8 @@ "source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="], + "ssf": ["ssf@0.11.2", "", { "dependencies": { "frac": "~1.1.2" } }, "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g=="], + "stable-hash": ["stable-hash@0.0.5", "", {}, "sha512-+L3ccpzibovGXFK+Ap/f8LOS0ahMrHTf3xu7mMLSpEGU0EO9ucaysSylKo9eRDFNhWve/y275iPmIZ4z39a9iA=="], "stackback": ["stackback@0.0.2", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="], @@ -1582,8 +1601,14 @@ "why-is-node-running": ["why-is-node-running@2.3.0", "", { "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" }, "bin": { "why-is-node-running": "cli.js" } }, "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w=="], + "wmf": ["wmf@1.0.2", "", {}, "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw=="], + + "word": ["word@0.3.0", "", {}, "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA=="], + "word-wrap": ["word-wrap@1.2.5", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="], + "xlsx": ["xlsx@0.18.5", "", { "dependencies": { "adler-32": "~1.3.0", "cfb": "~1.2.1", "codepage": "~1.15.0", "crc-32": "~1.2.1", "ssf": "~0.11.2", "wmf": "~1.0.1", "word": "~0.3.0" }, "bin": { "xlsx": "bin/xlsx.njs" } }, "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ=="], + "xmlbuilder": ["xmlbuilder@13.0.2", "", {}, "sha512-Eux0i2QdDYKbdbA6AM6xE4m6ZTZr4G4xF9kahI2ukSEMCzwce2eX9WlTI5J3s+NU7hpasFsr8hWIONae7LluAQ=="], "yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="], diff --git a/package.json b/package.json index e29d029..1acd657 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "lucide-react": "^0.535.0", "next": "^15.2.3", "next-themes": "^0.4.6", + "papaparse": "^5.5.3", "pdf-lib": "^1.17.1", "pdfkit": "^0.17.1", "react": "^19.0.0", @@ -89,6 +90,7 @@ "tw-animate-css": "^1.2.4", "twilio": "^5.9.0", "uuid": "^11.1.0", + "xlsx": "^0.18.5", "zod": "^3.24.2" }, "devDependencies": { @@ -96,6 +98,7 @@ "@tailwindcss/postcss": "^4.0.15", "@types/lodash.throttle": "^4.1.9", "@types/node": "^20.14.10", + "@types/papaparse": "^5.3.16", "@types/react": "^19.0.0", "@types/react-csv": "^1.1.10", "@types/react-dom": "^19.0.0", diff --git a/prisma/generated/zod/index.ts b/prisma/generated/zod/index.ts index d4bbc96..73fcf02 100644 --- a/prisma/generated/zod/index.ts +++ b/prisma/generated/zod/index.ts @@ -88,6 +88,14 @@ export const CustomRolePermissionScalarFieldEnumSchema = z.enum(['id','customRol export const OrganizationScalarFieldEnumSchema = z.enum(['id','name','logo','website','industry','description','createdAt','updatedAt']); +export const ImportSessionScalarFieldEnumSchema = z.enum(['id','organizationId','createdByUserId','fileName','fileSize','fileType','module','entityType','status','dedupeMode','mappingConfig','summary','rowCount','processedCount','successCount','failureCount','skippedCount','createdAt','updatedAt','startedAt','completedAt','appliedTemplateId']); + +export const ImportTemplateScalarFieldEnumSchema = z.enum(['id','organizationId','createdByUserId','name','module','entityType','mappingConfig','columnSignature','usageCount','lastUsedAt','createdAt','updatedAt']); + +export const ImportRowScalarFieldEnumSchema = z.enum(['id','sessionId','rowNumber','rawData','mappedData','status','dedupeHint','score','createdAt','updatedAt']); + +export const ImportRowIssueScalarFieldEnumSchema = z.enum(['id','sessionId','rowId','field','severity','message','hint','value','createdAt']); + export const UserOrganizationScalarFieldEnumSchema = z.enum(['userId','organizationId','role','customRoleId','joinedAt']); export const CustomerScalarFieldEnumSchema = z.enum(['id','organizationId','type','status','firstName','lastName','email','phone','company','position','address','city','state','country','postalCode','source','notes','createdAt','updatedAt']); @@ -222,16 +230,40 @@ export const EarlyAccessCodeScalarFieldEnumSchema = z.enum(['id','email','code', export const SortOrderSchema = z.enum(['asc','desc']); -export const JsonNullValueInputSchema = z.enum(['JsonNull',]).transform((value) => (value === 'JsonNull' ? Prisma.JsonNull : value)); - export const NullableJsonNullValueInputSchema = z.enum(['DbNull','JsonNull',]).transform((value) => value === 'JsonNull' ? Prisma.JsonNull : value === 'DbNull' ? Prisma.DbNull : value); +export const JsonNullValueInputSchema = z.enum(['JsonNull',]).transform((value) => (value === 'JsonNull' ? Prisma.JsonNull : value)); + export const QueryModeSchema = z.enum(['default','insensitive']); export const NullsOrderSchema = z.enum(['first','last']); export const JsonNullValueFilterSchema = z.enum(['DbNull','JsonNull','AnyNull',]).transform((value) => value === 'JsonNull' ? Prisma.JsonNull : value === 'DbNull' ? Prisma.JsonNull : value === 'AnyNull' ? Prisma.AnyNull : value); +export const ImportModuleSchema = z.enum(['CRM','HR','FINANCE','PROJECTS']); + +export type ImportModuleType = `${z.infer}` + +export const ImportEntityTypeSchema = z.enum(['CONTACT','ORGANIZATION','DEAL']); + +export type ImportEntityTypeType = `${z.infer}` + +export const ImportStatusSchema = z.enum(['DRAFT','UPLOADING','DETECTING','MAPPING_REVIEW','VALIDATING','VALIDATION_FAILED','READY_TO_IMPORT','IMPORTING','COMPLETED','IMPORT_FAILED','CANCELLED','RETRY_QUEUED']); + +export type ImportStatusType = `${z.infer}` + +export const DedupeModeSchema = z.enum(['SKIP','UPDATE','CREATE']); + +export type DedupeModeType = `${z.infer}` + +export const RowStatusSchema = z.enum(['PENDING','VALIDATED','IMPORTED','FAILED','SKIPPED']); + +export type RowStatusType = `${z.infer}` + +export const IssueSeveritySchema = z.enum(['ERROR','WARNING']); + +export type IssueSeverityType = `${z.infer}` + export const UserRoleSchema = z.enum(['ORGANIZATION_OWNER','SUPER_ADMIN','DEPARTMENT_MANAGER','HR_MANAGER','SALES_MANAGER','FINANCE_MANAGER','PROJECT_MANAGER','EMPLOYEE','CONTRACTOR','VIEWER']); export type UserRoleType = `${z.infer}` @@ -525,6 +557,95 @@ export const OrganizationSchema = z.object({ export type Organization = z.infer +///////////////////////////////////////// +// IMPORT SESSION SCHEMA +///////////////////////////////////////// + +export const ImportSessionSchema = z.object({ + module: ImportModuleSchema, + entityType: ImportEntityTypeSchema, + status: ImportStatusSchema, + dedupeMode: DedupeModeSchema, + id: z.string().cuid(), + organizationId: z.string(), + createdByUserId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().nullable(), + mappingConfig: JsonValueSchema.nullable(), + summary: JsonValueSchema.nullable(), + rowCount: z.number().int().nullable(), + processedCount: z.number().int(), + successCount: z.number().int(), + failureCount: z.number().int(), + skippedCount: z.number().int(), + createdAt: z.coerce.date(), + updatedAt: z.coerce.date(), + startedAt: z.coerce.date().nullable(), + completedAt: z.coerce.date().nullable(), + appliedTemplateId: z.string().nullable(), +}) + +export type ImportSession = z.infer + +///////////////////////////////////////// +// IMPORT TEMPLATE SCHEMA +///////////////////////////////////////// + +export const ImportTemplateSchema = z.object({ + module: ImportModuleSchema, + entityType: ImportEntityTypeSchema, + id: z.string().cuid(), + organizationId: z.string(), + createdByUserId: z.string(), + name: z.string(), + mappingConfig: JsonValueSchema, + columnSignature: JsonValueSchema, + usageCount: z.number().int(), + lastUsedAt: z.coerce.date().nullable(), + createdAt: z.coerce.date(), + updatedAt: z.coerce.date(), +}) + +export type ImportTemplate = z.infer + +///////////////////////////////////////// +// IMPORT ROW SCHEMA +///////////////////////////////////////// + +export const ImportRowSchema = z.object({ + status: RowStatusSchema, + id: z.string().cuid(), + sessionId: z.string(), + rowNumber: z.number().int(), + rawData: JsonValueSchema, + mappedData: JsonValueSchema.nullable(), + dedupeHint: z.string().nullable(), + score: z.number().int().nullable(), + createdAt: z.coerce.date(), + updatedAt: z.coerce.date(), +}) + +export type ImportRow = z.infer + +///////////////////////////////////////// +// IMPORT ROW ISSUE SCHEMA +///////////////////////////////////////// + +export const ImportRowIssueSchema = z.object({ + severity: IssueSeveritySchema, + id: z.string().cuid(), + sessionId: z.string(), + rowId: z.string(), + field: z.string().nullable(), + message: z.string(), + hint: z.string().nullable(), + value: z.string().nullable(), + createdAt: z.coerce.date(), +}) + +export type ImportRowIssue = z.infer + ///////////////////////////////////////// // USER ORGANIZATION SCHEMA ///////////////////////////////////////// @@ -2110,6 +2231,8 @@ export const OrganizationIncludeSchema: z.ZodType = templateShares: z.union([z.boolean(),z.lazy(() => TemplateShareFindManyArgsSchema)]).optional(), templateShareImports: z.union([z.boolean(),z.lazy(() => TemplateShareImportFindManyArgsSchema)]).optional(), uiConfigs: z.union([z.boolean(),z.lazy(() => OrganizationUiConfigFindManyArgsSchema)]).optional(), + importSessions: z.union([z.boolean(),z.lazy(() => ImportSessionFindManyArgsSchema)]).optional(), + importTemplates: z.union([z.boolean(),z.lazy(() => ImportTemplateFindManyArgsSchema)]).optional(), _count: z.union([z.boolean(),z.lazy(() => OrganizationCountOutputTypeArgsSchema)]).optional(), }).strict() @@ -2145,6 +2268,8 @@ export const OrganizationCountOutputTypeSelectSchema: z.ZodType = z.object({ @@ -2178,9 +2303,175 @@ export const OrganizationSelectSchema: z.ZodType = z. templateShares: z.union([z.boolean(),z.lazy(() => TemplateShareFindManyArgsSchema)]).optional(), templateShareImports: z.union([z.boolean(),z.lazy(() => TemplateShareImportFindManyArgsSchema)]).optional(), uiConfigs: z.union([z.boolean(),z.lazy(() => OrganizationUiConfigFindManyArgsSchema)]).optional(), + importSessions: z.union([z.boolean(),z.lazy(() => ImportSessionFindManyArgsSchema)]).optional(), + importTemplates: z.union([z.boolean(),z.lazy(() => ImportTemplateFindManyArgsSchema)]).optional(), _count: z.union([z.boolean(),z.lazy(() => OrganizationCountOutputTypeArgsSchema)]).optional(), }).strict() +// IMPORT SESSION +//------------------------------------------------------ + +export const ImportSessionIncludeSchema: z.ZodType = z.object({ + organization: z.union([z.boolean(),z.lazy(() => OrganizationArgsSchema)]).optional(), + createdBy: z.union([z.boolean(),z.lazy(() => UserArgsSchema)]).optional(), + rows: z.union([z.boolean(),z.lazy(() => ImportRowFindManyArgsSchema)]).optional(), + issues: z.union([z.boolean(),z.lazy(() => ImportRowIssueFindManyArgsSchema)]).optional(), + appliedTemplate: z.union([z.boolean(),z.lazy(() => ImportTemplateArgsSchema)]).optional(), + _count: z.union([z.boolean(),z.lazy(() => ImportSessionCountOutputTypeArgsSchema)]).optional(), +}).strict() + +export const ImportSessionArgsSchema: z.ZodType = z.object({ + select: z.lazy(() => ImportSessionSelectSchema).optional(), + include: z.lazy(() => ImportSessionIncludeSchema).optional(), +}).strict(); + +export const ImportSessionCountOutputTypeArgsSchema: z.ZodType = z.object({ + select: z.lazy(() => ImportSessionCountOutputTypeSelectSchema).nullish(), +}).strict(); + +export const ImportSessionCountOutputTypeSelectSchema: z.ZodType = z.object({ + rows: z.boolean().optional(), + issues: z.boolean().optional(), +}).strict(); + +export const ImportSessionSelectSchema: z.ZodType = z.object({ + id: z.boolean().optional(), + organizationId: z.boolean().optional(), + createdByUserId: z.boolean().optional(), + fileName: z.boolean().optional(), + fileSize: z.boolean().optional(), + fileType: z.boolean().optional(), + module: z.boolean().optional(), + entityType: z.boolean().optional(), + status: z.boolean().optional(), + dedupeMode: z.boolean().optional(), + mappingConfig: z.boolean().optional(), + summary: z.boolean().optional(), + rowCount: z.boolean().optional(), + processedCount: z.boolean().optional(), + successCount: z.boolean().optional(), + failureCount: z.boolean().optional(), + skippedCount: z.boolean().optional(), + createdAt: z.boolean().optional(), + updatedAt: z.boolean().optional(), + startedAt: z.boolean().optional(), + completedAt: z.boolean().optional(), + appliedTemplateId: z.boolean().optional(), + organization: z.union([z.boolean(),z.lazy(() => OrganizationArgsSchema)]).optional(), + createdBy: z.union([z.boolean(),z.lazy(() => UserArgsSchema)]).optional(), + rows: z.union([z.boolean(),z.lazy(() => ImportRowFindManyArgsSchema)]).optional(), + issues: z.union([z.boolean(),z.lazy(() => ImportRowIssueFindManyArgsSchema)]).optional(), + appliedTemplate: z.union([z.boolean(),z.lazy(() => ImportTemplateArgsSchema)]).optional(), + _count: z.union([z.boolean(),z.lazy(() => ImportSessionCountOutputTypeArgsSchema)]).optional(), +}).strict() + +// IMPORT TEMPLATE +//------------------------------------------------------ + +export const ImportTemplateIncludeSchema: z.ZodType = z.object({ + organization: z.union([z.boolean(),z.lazy(() => OrganizationArgsSchema)]).optional(), + createdBy: z.union([z.boolean(),z.lazy(() => UserArgsSchema)]).optional(), + sessions: z.union([z.boolean(),z.lazy(() => ImportSessionFindManyArgsSchema)]).optional(), + _count: z.union([z.boolean(),z.lazy(() => ImportTemplateCountOutputTypeArgsSchema)]).optional(), +}).strict() + +export const ImportTemplateArgsSchema: z.ZodType = z.object({ + select: z.lazy(() => ImportTemplateSelectSchema).optional(), + include: z.lazy(() => ImportTemplateIncludeSchema).optional(), +}).strict(); + +export const ImportTemplateCountOutputTypeArgsSchema: z.ZodType = z.object({ + select: z.lazy(() => ImportTemplateCountOutputTypeSelectSchema).nullish(), +}).strict(); + +export const ImportTemplateCountOutputTypeSelectSchema: z.ZodType = z.object({ + sessions: z.boolean().optional(), +}).strict(); + +export const ImportTemplateSelectSchema: z.ZodType = z.object({ + id: z.boolean().optional(), + organizationId: z.boolean().optional(), + createdByUserId: z.boolean().optional(), + name: z.boolean().optional(), + module: z.boolean().optional(), + entityType: z.boolean().optional(), + mappingConfig: z.boolean().optional(), + columnSignature: z.boolean().optional(), + usageCount: z.boolean().optional(), + lastUsedAt: z.boolean().optional(), + createdAt: z.boolean().optional(), + updatedAt: z.boolean().optional(), + organization: z.union([z.boolean(),z.lazy(() => OrganizationArgsSchema)]).optional(), + createdBy: z.union([z.boolean(),z.lazy(() => UserArgsSchema)]).optional(), + sessions: z.union([z.boolean(),z.lazy(() => ImportSessionFindManyArgsSchema)]).optional(), + _count: z.union([z.boolean(),z.lazy(() => ImportTemplateCountOutputTypeArgsSchema)]).optional(), +}).strict() + +// IMPORT ROW +//------------------------------------------------------ + +export const ImportRowIncludeSchema: z.ZodType = z.object({ + session: z.union([z.boolean(),z.lazy(() => ImportSessionArgsSchema)]).optional(), + issues: z.union([z.boolean(),z.lazy(() => ImportRowIssueFindManyArgsSchema)]).optional(), + _count: z.union([z.boolean(),z.lazy(() => ImportRowCountOutputTypeArgsSchema)]).optional(), +}).strict() + +export const ImportRowArgsSchema: z.ZodType = z.object({ + select: z.lazy(() => ImportRowSelectSchema).optional(), + include: z.lazy(() => ImportRowIncludeSchema).optional(), +}).strict(); + +export const ImportRowCountOutputTypeArgsSchema: z.ZodType = z.object({ + select: z.lazy(() => ImportRowCountOutputTypeSelectSchema).nullish(), +}).strict(); + +export const ImportRowCountOutputTypeSelectSchema: z.ZodType = z.object({ + issues: z.boolean().optional(), +}).strict(); + +export const ImportRowSelectSchema: z.ZodType = z.object({ + id: z.boolean().optional(), + sessionId: z.boolean().optional(), + rowNumber: z.boolean().optional(), + rawData: z.boolean().optional(), + mappedData: z.boolean().optional(), + status: z.boolean().optional(), + dedupeHint: z.boolean().optional(), + score: z.boolean().optional(), + createdAt: z.boolean().optional(), + updatedAt: z.boolean().optional(), + session: z.union([z.boolean(),z.lazy(() => ImportSessionArgsSchema)]).optional(), + issues: z.union([z.boolean(),z.lazy(() => ImportRowIssueFindManyArgsSchema)]).optional(), + _count: z.union([z.boolean(),z.lazy(() => ImportRowCountOutputTypeArgsSchema)]).optional(), +}).strict() + +// IMPORT ROW ISSUE +//------------------------------------------------------ + +export const ImportRowIssueIncludeSchema: z.ZodType = z.object({ + session: z.union([z.boolean(),z.lazy(() => ImportSessionArgsSchema)]).optional(), + row: z.union([z.boolean(),z.lazy(() => ImportRowArgsSchema)]).optional(), +}).strict() + +export const ImportRowIssueArgsSchema: z.ZodType = z.object({ + select: z.lazy(() => ImportRowIssueSelectSchema).optional(), + include: z.lazy(() => ImportRowIssueIncludeSchema).optional(), +}).strict(); + +export const ImportRowIssueSelectSchema: z.ZodType = z.object({ + id: z.boolean().optional(), + sessionId: z.boolean().optional(), + rowId: z.boolean().optional(), + field: z.boolean().optional(), + severity: z.boolean().optional(), + message: z.boolean().optional(), + hint: z.boolean().optional(), + value: z.boolean().optional(), + createdAt: z.boolean().optional(), + session: z.union([z.boolean(),z.lazy(() => ImportSessionArgsSchema)]).optional(), + row: z.union([z.boolean(),z.lazy(() => ImportRowArgsSchema)]).optional(), +}).strict() + // USER ORGANIZATION //------------------------------------------------------ @@ -3162,6 +3453,8 @@ export const SocialMediaPostSelectSchema: z.ZodType = z.object({ sessions: z.union([z.boolean(),z.lazy(() => SessionFindManyArgsSchema)]).optional(), accounts: z.union([z.boolean(),z.lazy(() => AccountFindManyArgsSchema)]).optional(), + createdImportSessions: z.union([z.boolean(),z.lazy(() => ImportSessionFindManyArgsSchema)]).optional(), + createdImportTemplates: z.union([z.boolean(),z.lazy(() => ImportTemplateFindManyArgsSchema)]).optional(), _count: z.union([z.boolean(),z.lazy(() => UserCountOutputTypeArgsSchema)]).optional(), }).strict() @@ -3177,6 +3470,8 @@ export const UserCountOutputTypeArgsSchema: z.ZodType = z.object({ sessions: z.boolean().optional(), accounts: z.boolean().optional(), + createdImportSessions: z.boolean().optional(), + createdImportTemplates: z.boolean().optional(), }).strict(); export const UserSelectSchema: z.ZodType = z.object({ @@ -3189,6 +3484,8 @@ export const UserSelectSchema: z.ZodType = z.object({ updatedAt: z.boolean().optional(), sessions: z.union([z.boolean(),z.lazy(() => SessionFindManyArgsSchema)]).optional(), accounts: z.union([z.boolean(),z.lazy(() => AccountFindManyArgsSchema)]).optional(), + createdImportSessions: z.union([z.boolean(),z.lazy(() => ImportSessionFindManyArgsSchema)]).optional(), + createdImportTemplates: z.union([z.boolean(),z.lazy(() => ImportTemplateFindManyArgsSchema)]).optional(), _count: z.union([z.boolean(),z.lazy(() => UserCountOutputTypeArgsSchema)]).optional(), }).strict() @@ -4815,7 +5112,9 @@ export const OrganizationWhereInputSchema: z.ZodType TemplateInstallationListRelationFilterSchema).optional(), templateShares: z.lazy(() => TemplateShareListRelationFilterSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportListRelationFilterSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigListRelationFilterSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigListRelationFilterSchema).optional(), + importSessions: z.lazy(() => ImportSessionListRelationFilterSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateListRelationFilterSchema).optional() }).strict(); export const OrganizationOrderByWithRelationInputSchema: z.ZodType = z.object({ @@ -4848,7 +5147,9 @@ export const OrganizationOrderByWithRelationInputSchema: z.ZodType TemplateInstallationOrderByRelationAggregateInputSchema).optional(), templateShares: z.lazy(() => TemplateShareOrderByRelationAggregateInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportOrderByRelationAggregateInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigOrderByRelationAggregateInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigOrderByRelationAggregateInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionOrderByRelationAggregateInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateOrderByRelationAggregateInputSchema).optional() }).strict(); export const OrganizationWhereUniqueInputSchema: z.ZodType = z.object({ @@ -4887,7 +5188,9 @@ export const OrganizationWhereUniqueInputSchema: z.ZodType TemplateInstallationListRelationFilterSchema).optional(), templateShares: z.lazy(() => TemplateShareListRelationFilterSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportListRelationFilterSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigListRelationFilterSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigListRelationFilterSchema).optional(), + importSessions: z.lazy(() => ImportSessionListRelationFilterSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateListRelationFilterSchema).optional() }).strict()); export const OrganizationOrderByWithAggregationInputSchema: z.ZodType = z.object({ @@ -4918,6 +5221,453 @@ export const OrganizationScalarWhereWithAggregatesInputSchema: z.ZodType DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), }).strict(); +export const ImportSessionWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportSessionWhereInputSchema),z.lazy(() => ImportSessionWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportSessionWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportSessionWhereInputSchema),z.lazy(() => ImportSessionWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdByUserId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + fileName: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + fileSize: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + fileType: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + module: z.union([ z.lazy(() => EnumImportModuleFilterSchema),z.lazy(() => ImportModuleSchema) ]).optional(), + entityType: z.union([ z.lazy(() => EnumImportEntityTypeFilterSchema),z.lazy(() => ImportEntityTypeSchema) ]).optional(), + status: z.union([ z.lazy(() => EnumImportStatusFilterSchema),z.lazy(() => ImportStatusSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => EnumDedupeModeFilterSchema),z.lazy(() => DedupeModeSchema) ]).optional(), + mappingConfig: z.lazy(() => JsonNullableFilterSchema).optional(), + summary: z.lazy(() => JsonNullableFilterSchema).optional(), + rowCount: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), + processedCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + successCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + failureCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + skippedCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + startedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + completedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + appliedTemplateId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + organization: z.union([ z.lazy(() => OrganizationRelationFilterSchema),z.lazy(() => OrganizationWhereInputSchema) ]).optional(), + createdBy: z.union([ z.lazy(() => UserRelationFilterSchema),z.lazy(() => UserWhereInputSchema) ]).optional(), + rows: z.lazy(() => ImportRowListRelationFilterSchema).optional(), + issues: z.lazy(() => ImportRowIssueListRelationFilterSchema).optional(), + appliedTemplate: z.union([ z.lazy(() => ImportTemplateNullableRelationFilterSchema),z.lazy(() => ImportTemplateWhereInputSchema) ]).optional().nullable(), +}).strict(); + +export const ImportSessionOrderByWithRelationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + createdByUserId: z.lazy(() => SortOrderSchema).optional(), + fileName: z.lazy(() => SortOrderSchema).optional(), + fileSize: z.lazy(() => SortOrderSchema).optional(), + fileType: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + module: z.lazy(() => SortOrderSchema).optional(), + entityType: z.lazy(() => SortOrderSchema).optional(), + status: z.lazy(() => SortOrderSchema).optional(), + dedupeMode: z.lazy(() => SortOrderSchema).optional(), + mappingConfig: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + summary: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + rowCount: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + processedCount: z.lazy(() => SortOrderSchema).optional(), + successCount: z.lazy(() => SortOrderSchema).optional(), + failureCount: z.lazy(() => SortOrderSchema).optional(), + skippedCount: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + startedAt: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + completedAt: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + appliedTemplateId: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + organization: z.lazy(() => OrganizationOrderByWithRelationInputSchema).optional(), + createdBy: z.lazy(() => UserOrderByWithRelationInputSchema).optional(), + rows: z.lazy(() => ImportRowOrderByRelationAggregateInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueOrderByRelationAggregateInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateOrderByWithRelationInputSchema).optional() +}).strict(); + +export const ImportSessionWhereUniqueInputSchema: z.ZodType = z.object({ + id: z.string().cuid() +}) +.and(z.object({ + id: z.string().cuid().optional(), + AND: z.union([ z.lazy(() => ImportSessionWhereInputSchema),z.lazy(() => ImportSessionWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportSessionWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportSessionWhereInputSchema),z.lazy(() => ImportSessionWhereInputSchema).array() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdByUserId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + fileName: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + fileSize: z.union([ z.lazy(() => IntFilterSchema),z.number().int() ]).optional(), + fileType: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + module: z.union([ z.lazy(() => EnumImportModuleFilterSchema),z.lazy(() => ImportModuleSchema) ]).optional(), + entityType: z.union([ z.lazy(() => EnumImportEntityTypeFilterSchema),z.lazy(() => ImportEntityTypeSchema) ]).optional(), + status: z.union([ z.lazy(() => EnumImportStatusFilterSchema),z.lazy(() => ImportStatusSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => EnumDedupeModeFilterSchema),z.lazy(() => DedupeModeSchema) ]).optional(), + mappingConfig: z.lazy(() => JsonNullableFilterSchema).optional(), + summary: z.lazy(() => JsonNullableFilterSchema).optional(), + rowCount: z.union([ z.lazy(() => IntNullableFilterSchema),z.number().int() ]).optional().nullable(), + processedCount: z.union([ z.lazy(() => IntFilterSchema),z.number().int() ]).optional(), + successCount: z.union([ z.lazy(() => IntFilterSchema),z.number().int() ]).optional(), + failureCount: z.union([ z.lazy(() => IntFilterSchema),z.number().int() ]).optional(), + skippedCount: z.union([ z.lazy(() => IntFilterSchema),z.number().int() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + startedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + completedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + appliedTemplateId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + organization: z.union([ z.lazy(() => OrganizationRelationFilterSchema),z.lazy(() => OrganizationWhereInputSchema) ]).optional(), + createdBy: z.union([ z.lazy(() => UserRelationFilterSchema),z.lazy(() => UserWhereInputSchema) ]).optional(), + rows: z.lazy(() => ImportRowListRelationFilterSchema).optional(), + issues: z.lazy(() => ImportRowIssueListRelationFilterSchema).optional(), + appliedTemplate: z.union([ z.lazy(() => ImportTemplateNullableRelationFilterSchema),z.lazy(() => ImportTemplateWhereInputSchema) ]).optional().nullable(), +}).strict()); + +export const ImportSessionOrderByWithAggregationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + createdByUserId: z.lazy(() => SortOrderSchema).optional(), + fileName: z.lazy(() => SortOrderSchema).optional(), + fileSize: z.lazy(() => SortOrderSchema).optional(), + fileType: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + module: z.lazy(() => SortOrderSchema).optional(), + entityType: z.lazy(() => SortOrderSchema).optional(), + status: z.lazy(() => SortOrderSchema).optional(), + dedupeMode: z.lazy(() => SortOrderSchema).optional(), + mappingConfig: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + summary: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + rowCount: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + processedCount: z.lazy(() => SortOrderSchema).optional(), + successCount: z.lazy(() => SortOrderSchema).optional(), + failureCount: z.lazy(() => SortOrderSchema).optional(), + skippedCount: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + startedAt: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + completedAt: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + appliedTemplateId: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + _count: z.lazy(() => ImportSessionCountOrderByAggregateInputSchema).optional(), + _avg: z.lazy(() => ImportSessionAvgOrderByAggregateInputSchema).optional(), + _max: z.lazy(() => ImportSessionMaxOrderByAggregateInputSchema).optional(), + _min: z.lazy(() => ImportSessionMinOrderByAggregateInputSchema).optional(), + _sum: z.lazy(() => ImportSessionSumOrderByAggregateInputSchema).optional() +}).strict(); + +export const ImportSessionScalarWhereWithAggregatesInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportSessionScalarWhereWithAggregatesInputSchema),z.lazy(() => ImportSessionScalarWhereWithAggregatesInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportSessionScalarWhereWithAggregatesInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportSessionScalarWhereWithAggregatesInputSchema),z.lazy(() => ImportSessionScalarWhereWithAggregatesInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + createdByUserId: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + fileName: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + fileSize: z.union([ z.lazy(() => IntWithAggregatesFilterSchema),z.number() ]).optional(), + fileType: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), + module: z.union([ z.lazy(() => EnumImportModuleWithAggregatesFilterSchema),z.lazy(() => ImportModuleSchema) ]).optional(), + entityType: z.union([ z.lazy(() => EnumImportEntityTypeWithAggregatesFilterSchema),z.lazy(() => ImportEntityTypeSchema) ]).optional(), + status: z.union([ z.lazy(() => EnumImportStatusWithAggregatesFilterSchema),z.lazy(() => ImportStatusSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => EnumDedupeModeWithAggregatesFilterSchema),z.lazy(() => DedupeModeSchema) ]).optional(), + mappingConfig: z.lazy(() => JsonNullableWithAggregatesFilterSchema).optional(), + summary: z.lazy(() => JsonNullableWithAggregatesFilterSchema).optional(), + rowCount: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), + processedCount: z.union([ z.lazy(() => IntWithAggregatesFilterSchema),z.number() ]).optional(), + successCount: z.union([ z.lazy(() => IntWithAggregatesFilterSchema),z.number() ]).optional(), + failureCount: z.union([ z.lazy(() => IntWithAggregatesFilterSchema),z.number() ]).optional(), + skippedCount: z.union([ z.lazy(() => IntWithAggregatesFilterSchema),z.number() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), + startedAt: z.union([ z.lazy(() => DateTimeNullableWithAggregatesFilterSchema),z.coerce.date() ]).optional().nullable(), + completedAt: z.union([ z.lazy(() => DateTimeNullableWithAggregatesFilterSchema),z.coerce.date() ]).optional().nullable(), + appliedTemplateId: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), +}).strict(); + +export const ImportTemplateWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportTemplateWhereInputSchema),z.lazy(() => ImportTemplateWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportTemplateWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportTemplateWhereInputSchema),z.lazy(() => ImportTemplateWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdByUserId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + module: z.union([ z.lazy(() => EnumImportModuleFilterSchema),z.lazy(() => ImportModuleSchema) ]).optional(), + entityType: z.union([ z.lazy(() => EnumImportEntityTypeFilterSchema),z.lazy(() => ImportEntityTypeSchema) ]).optional(), + mappingConfig: z.lazy(() => JsonFilterSchema).optional(), + columnSignature: z.lazy(() => JsonFilterSchema).optional(), + usageCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + lastUsedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + organization: z.union([ z.lazy(() => OrganizationRelationFilterSchema),z.lazy(() => OrganizationWhereInputSchema) ]).optional(), + createdBy: z.union([ z.lazy(() => UserRelationFilterSchema),z.lazy(() => UserWhereInputSchema) ]).optional(), + sessions: z.lazy(() => ImportSessionListRelationFilterSchema).optional() +}).strict(); + +export const ImportTemplateOrderByWithRelationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + createdByUserId: z.lazy(() => SortOrderSchema).optional(), + name: z.lazy(() => SortOrderSchema).optional(), + module: z.lazy(() => SortOrderSchema).optional(), + entityType: z.lazy(() => SortOrderSchema).optional(), + mappingConfig: z.lazy(() => SortOrderSchema).optional(), + columnSignature: z.lazy(() => SortOrderSchema).optional(), + usageCount: z.lazy(() => SortOrderSchema).optional(), + lastUsedAt: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + organization: z.lazy(() => OrganizationOrderByWithRelationInputSchema).optional(), + createdBy: z.lazy(() => UserOrderByWithRelationInputSchema).optional(), + sessions: z.lazy(() => ImportSessionOrderByRelationAggregateInputSchema).optional() +}).strict(); + +export const ImportTemplateWhereUniqueInputSchema: z.ZodType = z.union([ + z.object({ + id: z.string().cuid(), + organizationId_name: z.lazy(() => ImportTemplateOrganizationIdNameCompoundUniqueInputSchema) + }), + z.object({ + id: z.string().cuid(), + }), + z.object({ + organizationId_name: z.lazy(() => ImportTemplateOrganizationIdNameCompoundUniqueInputSchema), + }), +]) +.and(z.object({ + id: z.string().cuid().optional(), + organizationId_name: z.lazy(() => ImportTemplateOrganizationIdNameCompoundUniqueInputSchema).optional(), + AND: z.union([ z.lazy(() => ImportTemplateWhereInputSchema),z.lazy(() => ImportTemplateWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportTemplateWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportTemplateWhereInputSchema),z.lazy(() => ImportTemplateWhereInputSchema).array() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdByUserId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + module: z.union([ z.lazy(() => EnumImportModuleFilterSchema),z.lazy(() => ImportModuleSchema) ]).optional(), + entityType: z.union([ z.lazy(() => EnumImportEntityTypeFilterSchema),z.lazy(() => ImportEntityTypeSchema) ]).optional(), + mappingConfig: z.lazy(() => JsonFilterSchema).optional(), + columnSignature: z.lazy(() => JsonFilterSchema).optional(), + usageCount: z.union([ z.lazy(() => IntFilterSchema),z.number().int() ]).optional(), + lastUsedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + organization: z.union([ z.lazy(() => OrganizationRelationFilterSchema),z.lazy(() => OrganizationWhereInputSchema) ]).optional(), + createdBy: z.union([ z.lazy(() => UserRelationFilterSchema),z.lazy(() => UserWhereInputSchema) ]).optional(), + sessions: z.lazy(() => ImportSessionListRelationFilterSchema).optional() +}).strict()); + +export const ImportTemplateOrderByWithAggregationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + createdByUserId: z.lazy(() => SortOrderSchema).optional(), + name: z.lazy(() => SortOrderSchema).optional(), + module: z.lazy(() => SortOrderSchema).optional(), + entityType: z.lazy(() => SortOrderSchema).optional(), + mappingConfig: z.lazy(() => SortOrderSchema).optional(), + columnSignature: z.lazy(() => SortOrderSchema).optional(), + usageCount: z.lazy(() => SortOrderSchema).optional(), + lastUsedAt: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + _count: z.lazy(() => ImportTemplateCountOrderByAggregateInputSchema).optional(), + _avg: z.lazy(() => ImportTemplateAvgOrderByAggregateInputSchema).optional(), + _max: z.lazy(() => ImportTemplateMaxOrderByAggregateInputSchema).optional(), + _min: z.lazy(() => ImportTemplateMinOrderByAggregateInputSchema).optional(), + _sum: z.lazy(() => ImportTemplateSumOrderByAggregateInputSchema).optional() +}).strict(); + +export const ImportTemplateScalarWhereWithAggregatesInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportTemplateScalarWhereWithAggregatesInputSchema),z.lazy(() => ImportTemplateScalarWhereWithAggregatesInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportTemplateScalarWhereWithAggregatesInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportTemplateScalarWhereWithAggregatesInputSchema),z.lazy(() => ImportTemplateScalarWhereWithAggregatesInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + createdByUserId: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + name: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + module: z.union([ z.lazy(() => EnumImportModuleWithAggregatesFilterSchema),z.lazy(() => ImportModuleSchema) ]).optional(), + entityType: z.union([ z.lazy(() => EnumImportEntityTypeWithAggregatesFilterSchema),z.lazy(() => ImportEntityTypeSchema) ]).optional(), + mappingConfig: z.lazy(() => JsonWithAggregatesFilterSchema).optional(), + columnSignature: z.lazy(() => JsonWithAggregatesFilterSchema).optional(), + usageCount: z.union([ z.lazy(() => IntWithAggregatesFilterSchema),z.number() ]).optional(), + lastUsedAt: z.union([ z.lazy(() => DateTimeNullableWithAggregatesFilterSchema),z.coerce.date() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const ImportRowWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportRowWhereInputSchema),z.lazy(() => ImportRowWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportRowWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportRowWhereInputSchema),z.lazy(() => ImportRowWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + sessionId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + rowNumber: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + rawData: z.lazy(() => JsonFilterSchema).optional(), + mappedData: z.lazy(() => JsonNullableFilterSchema).optional(), + status: z.union([ z.lazy(() => EnumRowStatusFilterSchema),z.lazy(() => RowStatusSchema) ]).optional(), + dedupeHint: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + score: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + session: z.union([ z.lazy(() => ImportSessionRelationFilterSchema),z.lazy(() => ImportSessionWhereInputSchema) ]).optional(), + issues: z.lazy(() => ImportRowIssueListRelationFilterSchema).optional() +}).strict(); + +export const ImportRowOrderByWithRelationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + sessionId: z.lazy(() => SortOrderSchema).optional(), + rowNumber: z.lazy(() => SortOrderSchema).optional(), + rawData: z.lazy(() => SortOrderSchema).optional(), + mappedData: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + status: z.lazy(() => SortOrderSchema).optional(), + dedupeHint: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + score: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + session: z.lazy(() => ImportSessionOrderByWithRelationInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueOrderByRelationAggregateInputSchema).optional() +}).strict(); + +export const ImportRowWhereUniqueInputSchema: z.ZodType = z.union([ + z.object({ + id: z.string().cuid(), + sessionId_rowNumber: z.lazy(() => ImportRowSessionIdRowNumberCompoundUniqueInputSchema) + }), + z.object({ + id: z.string().cuid(), + }), + z.object({ + sessionId_rowNumber: z.lazy(() => ImportRowSessionIdRowNumberCompoundUniqueInputSchema), + }), +]) +.and(z.object({ + id: z.string().cuid().optional(), + sessionId_rowNumber: z.lazy(() => ImportRowSessionIdRowNumberCompoundUniqueInputSchema).optional(), + AND: z.union([ z.lazy(() => ImportRowWhereInputSchema),z.lazy(() => ImportRowWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportRowWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportRowWhereInputSchema),z.lazy(() => ImportRowWhereInputSchema).array() ]).optional(), + sessionId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + rowNumber: z.union([ z.lazy(() => IntFilterSchema),z.number().int() ]).optional(), + rawData: z.lazy(() => JsonFilterSchema).optional(), + mappedData: z.lazy(() => JsonNullableFilterSchema).optional(), + status: z.union([ z.lazy(() => EnumRowStatusFilterSchema),z.lazy(() => RowStatusSchema) ]).optional(), + dedupeHint: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + score: z.union([ z.lazy(() => IntNullableFilterSchema),z.number().int() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + session: z.union([ z.lazy(() => ImportSessionRelationFilterSchema),z.lazy(() => ImportSessionWhereInputSchema) ]).optional(), + issues: z.lazy(() => ImportRowIssueListRelationFilterSchema).optional() +}).strict()); + +export const ImportRowOrderByWithAggregationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + sessionId: z.lazy(() => SortOrderSchema).optional(), + rowNumber: z.lazy(() => SortOrderSchema).optional(), + rawData: z.lazy(() => SortOrderSchema).optional(), + mappedData: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + status: z.lazy(() => SortOrderSchema).optional(), + dedupeHint: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + score: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional(), + _count: z.lazy(() => ImportRowCountOrderByAggregateInputSchema).optional(), + _avg: z.lazy(() => ImportRowAvgOrderByAggregateInputSchema).optional(), + _max: z.lazy(() => ImportRowMaxOrderByAggregateInputSchema).optional(), + _min: z.lazy(() => ImportRowMinOrderByAggregateInputSchema).optional(), + _sum: z.lazy(() => ImportRowSumOrderByAggregateInputSchema).optional() +}).strict(); + +export const ImportRowScalarWhereWithAggregatesInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportRowScalarWhereWithAggregatesInputSchema),z.lazy(() => ImportRowScalarWhereWithAggregatesInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportRowScalarWhereWithAggregatesInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportRowScalarWhereWithAggregatesInputSchema),z.lazy(() => ImportRowScalarWhereWithAggregatesInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + sessionId: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + rowNumber: z.union([ z.lazy(() => IntWithAggregatesFilterSchema),z.number() ]).optional(), + rawData: z.lazy(() => JsonWithAggregatesFilterSchema).optional(), + mappedData: z.lazy(() => JsonNullableWithAggregatesFilterSchema).optional(), + status: z.union([ z.lazy(() => EnumRowStatusWithAggregatesFilterSchema),z.lazy(() => RowStatusSchema) ]).optional(), + dedupeHint: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), + score: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const ImportRowIssueWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportRowIssueWhereInputSchema),z.lazy(() => ImportRowIssueWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportRowIssueWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportRowIssueWhereInputSchema),z.lazy(() => ImportRowIssueWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + sessionId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + rowId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + field: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + severity: z.union([ z.lazy(() => EnumIssueSeverityFilterSchema),z.lazy(() => IssueSeveritySchema) ]).optional(), + message: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + hint: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + value: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + session: z.union([ z.lazy(() => ImportSessionRelationFilterSchema),z.lazy(() => ImportSessionWhereInputSchema) ]).optional(), + row: z.union([ z.lazy(() => ImportRowRelationFilterSchema),z.lazy(() => ImportRowWhereInputSchema) ]).optional(), +}).strict(); + +export const ImportRowIssueOrderByWithRelationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + sessionId: z.lazy(() => SortOrderSchema).optional(), + rowId: z.lazy(() => SortOrderSchema).optional(), + field: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + severity: z.lazy(() => SortOrderSchema).optional(), + message: z.lazy(() => SortOrderSchema).optional(), + hint: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + value: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + session: z.lazy(() => ImportSessionOrderByWithRelationInputSchema).optional(), + row: z.lazy(() => ImportRowOrderByWithRelationInputSchema).optional() +}).strict(); + +export const ImportRowIssueWhereUniqueInputSchema: z.ZodType = z.object({ + id: z.string().cuid() +}) +.and(z.object({ + id: z.string().cuid().optional(), + AND: z.union([ z.lazy(() => ImportRowIssueWhereInputSchema),z.lazy(() => ImportRowIssueWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportRowIssueWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportRowIssueWhereInputSchema),z.lazy(() => ImportRowIssueWhereInputSchema).array() ]).optional(), + sessionId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + rowId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + field: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + severity: z.union([ z.lazy(() => EnumIssueSeverityFilterSchema),z.lazy(() => IssueSeveritySchema) ]).optional(), + message: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + hint: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + value: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + session: z.union([ z.lazy(() => ImportSessionRelationFilterSchema),z.lazy(() => ImportSessionWhereInputSchema) ]).optional(), + row: z.union([ z.lazy(() => ImportRowRelationFilterSchema),z.lazy(() => ImportRowWhereInputSchema) ]).optional(), +}).strict()); + +export const ImportRowIssueOrderByWithAggregationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + sessionId: z.lazy(() => SortOrderSchema).optional(), + rowId: z.lazy(() => SortOrderSchema).optional(), + field: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + severity: z.lazy(() => SortOrderSchema).optional(), + message: z.lazy(() => SortOrderSchema).optional(), + hint: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + value: z.union([ z.lazy(() => SortOrderSchema),z.lazy(() => SortOrderInputSchema) ]).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + _count: z.lazy(() => ImportRowIssueCountOrderByAggregateInputSchema).optional(), + _max: z.lazy(() => ImportRowIssueMaxOrderByAggregateInputSchema).optional(), + _min: z.lazy(() => ImportRowIssueMinOrderByAggregateInputSchema).optional() +}).strict(); + +export const ImportRowIssueScalarWhereWithAggregatesInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportRowIssueScalarWhereWithAggregatesInputSchema),z.lazy(() => ImportRowIssueScalarWhereWithAggregatesInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportRowIssueScalarWhereWithAggregatesInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportRowIssueScalarWhereWithAggregatesInputSchema),z.lazy(() => ImportRowIssueScalarWhereWithAggregatesInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + sessionId: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + rowId: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + field: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), + severity: z.union([ z.lazy(() => EnumIssueSeverityWithAggregatesFilterSchema),z.lazy(() => IssueSeveritySchema) ]).optional(), + message: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + hint: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), + value: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeWithAggregatesFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + export const UserOrganizationWhereInputSchema: z.ZodType = z.object({ AND: z.union([ z.lazy(() => UserOrganizationWhereInputSchema),z.lazy(() => UserOrganizationWhereInputSchema).array() ]).optional(), OR: z.lazy(() => UserOrganizationWhereInputSchema).array().optional(), @@ -7801,7 +8551,9 @@ export const UserWhereInputSchema: z.ZodType = z.object({ createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), sessions: z.lazy(() => SessionListRelationFilterSchema).optional(), - accounts: z.lazy(() => AccountListRelationFilterSchema).optional() + accounts: z.lazy(() => AccountListRelationFilterSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionListRelationFilterSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateListRelationFilterSchema).optional() }).strict(); export const UserOrderByWithRelationInputSchema: z.ZodType = z.object({ @@ -7813,7 +8565,9 @@ export const UserOrderByWithRelationInputSchema: z.ZodType SortOrderSchema).optional(), updatedAt: z.lazy(() => SortOrderSchema).optional(), sessions: z.lazy(() => SessionOrderByRelationAggregateInputSchema).optional(), - accounts: z.lazy(() => AccountOrderByRelationAggregateInputSchema).optional() + accounts: z.lazy(() => AccountOrderByRelationAggregateInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionOrderByRelationAggregateInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateOrderByRelationAggregateInputSchema).optional() }).strict(); export const UserWhereUniqueInputSchema: z.ZodType = z.union([ @@ -7840,7 +8594,9 @@ export const UserWhereUniqueInputSchema: z.ZodType createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), sessions: z.lazy(() => SessionListRelationFilterSchema).optional(), - accounts: z.lazy(() => AccountListRelationFilterSchema).optional() + accounts: z.lazy(() => AccountListRelationFilterSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionListRelationFilterSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateListRelationFilterSchema).optional() }).strict()); export const UserOrderByWithAggregationInputSchema: z.ZodType = z.object({ @@ -12212,7 +12968,9 @@ export const OrganizationCreateInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateInputSchema: z.ZodType = z.object({ @@ -12245,7 +13003,9 @@ export const OrganizationUncheckedCreateInputSchema: z.ZodType TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUpdateInputSchema: z.ZodType = z.object({ @@ -12278,7 +13038,9 @@ export const OrganizationUpdateInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateInputSchema: z.ZodType = z.object({ @@ -12311,7 +13073,9 @@ export const OrganizationUncheckedUpdateInputSchema: z.ZodType TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationCreateManyInputSchema: z.ZodType = z.object({ @@ -12347,6 +13111,469 @@ export const OrganizationUncheckedUpdateManyInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), }).strict(); +export const ImportSessionCreateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + organization: z.lazy(() => OrganizationCreateNestedOneWithoutImportSessionsInputSchema), + createdBy: z.lazy(() => UserCreateNestedOneWithoutCreatedImportSessionsInputSchema), + rows: z.lazy(() => ImportRowCreateNestedManyWithoutSessionInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueCreateNestedManyWithoutSessionInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateCreateNestedOneWithoutSessionsInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedCreateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + createdByUserId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + appliedTemplateId: z.string().optional().nullable(), + rows: z.lazy(() => ImportRowUncheckedCreateNestedManyWithoutSessionInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUncheckedCreateNestedManyWithoutSessionInputSchema).optional() +}).strict(); + +export const ImportSessionUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + organization: z.lazy(() => OrganizationUpdateOneRequiredWithoutImportSessionsNestedInputSchema).optional(), + createdBy: z.lazy(() => UserUpdateOneRequiredWithoutCreatedImportSessionsNestedInputSchema).optional(), + rows: z.lazy(() => ImportRowUpdateManyWithoutSessionNestedInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUpdateManyWithoutSessionNestedInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateUpdateOneWithoutSessionsNestedInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + appliedTemplateId: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + rows: z.lazy(() => ImportRowUncheckedUpdateManyWithoutSessionNestedInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUncheckedUpdateManyWithoutSessionNestedInputSchema).optional() +}).strict(); + +export const ImportSessionCreateManyInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + createdByUserId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + appliedTemplateId: z.string().optional().nullable() +}).strict(); + +export const ImportSessionUpdateManyMutationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), +}).strict(); + +export const ImportSessionUncheckedUpdateManyInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + appliedTemplateId: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), +}).strict(); + +export const ImportTemplateCreateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + organization: z.lazy(() => OrganizationCreateNestedOneWithoutImportTemplatesInputSchema), + createdBy: z.lazy(() => UserCreateNestedOneWithoutCreatedImportTemplatesInputSchema), + sessions: z.lazy(() => ImportSessionCreateNestedManyWithoutAppliedTemplateInputSchema).optional() +}).strict(); + +export const ImportTemplateUncheckedCreateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + createdByUserId: z.string(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + sessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutAppliedTemplateInputSchema).optional() +}).strict(); + +export const ImportTemplateUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + organization: z.lazy(() => OrganizationUpdateOneRequiredWithoutImportTemplatesNestedInputSchema).optional(), + createdBy: z.lazy(() => UserUpdateOneRequiredWithoutCreatedImportTemplatesNestedInputSchema).optional(), + sessions: z.lazy(() => ImportSessionUpdateManyWithoutAppliedTemplateNestedInputSchema).optional() +}).strict(); + +export const ImportTemplateUncheckedUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + sessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutAppliedTemplateNestedInputSchema).optional() +}).strict(); + +export const ImportTemplateCreateManyInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + createdByUserId: z.string(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional() +}).strict(); + +export const ImportTemplateUpdateManyMutationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportTemplateUncheckedUpdateManyInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowCreateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + rowNumber: z.number().int(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.lazy(() => RowStatusSchema).optional(), + dedupeHint: z.string().optional().nullable(), + score: z.number().int().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + session: z.lazy(() => ImportSessionCreateNestedOneWithoutRowsInputSchema), + issues: z.lazy(() => ImportRowIssueCreateNestedManyWithoutRowInputSchema).optional() +}).strict(); + +export const ImportRowUncheckedCreateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + sessionId: z.string(), + rowNumber: z.number().int(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.lazy(() => RowStatusSchema).optional(), + dedupeHint: z.string().optional().nullable(), + score: z.number().int().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + issues: z.lazy(() => ImportRowIssueUncheckedCreateNestedManyWithoutRowInputSchema).optional() +}).strict(); + +export const ImportRowUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowNumber: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => EnumRowStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeHint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + score: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + session: z.lazy(() => ImportSessionUpdateOneRequiredWithoutRowsNestedInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUpdateManyWithoutRowNestedInputSchema).optional() +}).strict(); + +export const ImportRowUncheckedUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + sessionId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowNumber: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => EnumRowStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeHint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + score: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + issues: z.lazy(() => ImportRowIssueUncheckedUpdateManyWithoutRowNestedInputSchema).optional() +}).strict(); + +export const ImportRowCreateManyInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + sessionId: z.string(), + rowNumber: z.number().int(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.lazy(() => RowStatusSchema).optional(), + dedupeHint: z.string().optional().nullable(), + score: z.number().int().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional() +}).strict(); + +export const ImportRowUpdateManyMutationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowNumber: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => EnumRowStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeHint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + score: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowUncheckedUpdateManyInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + sessionId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowNumber: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => EnumRowStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeHint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + score: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowIssueCreateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + field: z.string().optional().nullable(), + severity: z.lazy(() => IssueSeveritySchema), + message: z.string(), + hint: z.string().optional().nullable(), + value: z.string().optional().nullable(), + createdAt: z.coerce.date().optional(), + session: z.lazy(() => ImportSessionCreateNestedOneWithoutIssuesInputSchema), + row: z.lazy(() => ImportRowCreateNestedOneWithoutIssuesInputSchema) +}).strict(); + +export const ImportRowIssueUncheckedCreateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + sessionId: z.string(), + rowId: z.string(), + field: z.string().optional().nullable(), + severity: z.lazy(() => IssueSeveritySchema), + message: z.string(), + hint: z.string().optional().nullable(), + value: z.string().optional().nullable(), + createdAt: z.coerce.date().optional() +}).strict(); + +export const ImportRowIssueUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + field: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + severity: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => EnumIssueSeverityFieldUpdateOperationsInputSchema) ]).optional(), + message: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + hint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + value: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + session: z.lazy(() => ImportSessionUpdateOneRequiredWithoutIssuesNestedInputSchema).optional(), + row: z.lazy(() => ImportRowUpdateOneRequiredWithoutIssuesNestedInputSchema).optional() +}).strict(); + +export const ImportRowIssueUncheckedUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + sessionId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + field: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + severity: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => EnumIssueSeverityFieldUpdateOperationsInputSchema) ]).optional(), + message: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + hint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + value: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowIssueCreateManyInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + sessionId: z.string(), + rowId: z.string(), + field: z.string().optional().nullable(), + severity: z.lazy(() => IssueSeveritySchema), + message: z.string(), + hint: z.string().optional().nullable(), + value: z.string().optional().nullable(), + createdAt: z.coerce.date().optional() +}).strict(); + +export const ImportRowIssueUpdateManyMutationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + field: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + severity: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => EnumIssueSeverityFieldUpdateOperationsInputSchema) ]).optional(), + message: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + hint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + value: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowIssueUncheckedUpdateManyInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + sessionId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + field: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + severity: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => EnumIssueSeverityFieldUpdateOperationsInputSchema) ]).optional(), + message: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + hint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + value: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + export const UserOrganizationCreateInputSchema: z.ZodType = z.object({ userId: z.string(), role: z.lazy(() => UserRoleSchema).optional().nullable(), @@ -15472,7 +16699,9 @@ export const UserCreateInputSchema: z.ZodType = z.object createdAt: z.coerce.date(), updatedAt: z.coerce.date(), sessions: z.lazy(() => SessionCreateNestedManyWithoutUserInputSchema).optional(), - accounts: z.lazy(() => AccountCreateNestedManyWithoutUserInputSchema).optional() + accounts: z.lazy(() => AccountCreateNestedManyWithoutUserInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutCreatedByInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutCreatedByInputSchema).optional() }).strict(); export const UserUncheckedCreateInputSchema: z.ZodType = z.object({ @@ -15484,7 +16713,9 @@ export const UserUncheckedCreateInputSchema: z.ZodType SessionUncheckedCreateNestedManyWithoutUserInputSchema).optional(), - accounts: z.lazy(() => AccountUncheckedCreateNestedManyWithoutUserInputSchema).optional() + accounts: z.lazy(() => AccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutCreatedByInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutCreatedByInputSchema).optional() }).strict(); export const UserUpdateInputSchema: z.ZodType = z.object({ @@ -15496,7 +16727,9 @@ export const UserUpdateInputSchema: z.ZodType = z.object createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), sessions: z.lazy(() => SessionUpdateManyWithoutUserNestedInputSchema).optional(), - accounts: z.lazy(() => AccountUpdateManyWithoutUserNestedInputSchema).optional() + accounts: z.lazy(() => AccountUpdateManyWithoutUserNestedInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUpdateManyWithoutCreatedByNestedInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutCreatedByNestedInputSchema).optional() }).strict(); export const UserUncheckedUpdateInputSchema: z.ZodType = z.object({ @@ -15508,7 +16741,9 @@ export const UserUncheckedUpdateInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), sessions: z.lazy(() => SessionUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), - accounts: z.lazy(() => AccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional() + accounts: z.lazy(() => AccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutCreatedByNestedInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutCreatedByNestedInputSchema).optional() }).strict(); export const UserCreateManyInputSchema: z.ZodType = z.object({ @@ -20215,6 +21450,18 @@ export const OrganizationUiConfigListRelationFilterSchema: z.ZodType OrganizationUiConfigWhereInputSchema).optional() }).strict(); +export const ImportSessionListRelationFilterSchema: z.ZodType = z.object({ + every: z.lazy(() => ImportSessionWhereInputSchema).optional(), + some: z.lazy(() => ImportSessionWhereInputSchema).optional(), + none: z.lazy(() => ImportSessionWhereInputSchema).optional() +}).strict(); + +export const ImportTemplateListRelationFilterSchema: z.ZodType = z.object({ + every: z.lazy(() => ImportTemplateWhereInputSchema).optional(), + some: z.lazy(() => ImportTemplateWhereInputSchema).optional(), + none: z.lazy(() => ImportTemplateWhereInputSchema).optional() +}).strict(); + export const CustomerOrderByRelationAggregateInputSchema: z.ZodType = z.object({ _count: z.lazy(() => SortOrderSchema).optional() }).strict(); @@ -20299,6 +21546,14 @@ export const OrganizationUiConfigOrderByRelationAggregateInputSchema: z.ZodType< _count: z.lazy(() => SortOrderSchema).optional() }).strict(); +export const ImportSessionOrderByRelationAggregateInputSchema: z.ZodType = z.object({ + _count: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportTemplateOrderByRelationAggregateInputSchema: z.ZodType = z.object({ + _count: z.lazy(() => SortOrderSchema).optional() +}).strict(); + export const OrganizationCountOrderByAggregateInputSchema: z.ZodType = z.object({ id: z.lazy(() => SortOrderSchema).optional(), name: z.lazy(() => SortOrderSchema).optional(), @@ -20332,209 +21587,294 @@ export const OrganizationMinOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional() }).strict(); -export const EnumUserRoleNullableFilterSchema: z.ZodType = z.object({ - equals: z.lazy(() => UserRoleSchema).optional().nullable(), - in: z.lazy(() => UserRoleSchema).array().optional().nullable(), - notIn: z.lazy(() => UserRoleSchema).array().optional().nullable(), - not: z.union([ z.lazy(() => UserRoleSchema),z.lazy(() => NestedEnumUserRoleNullableFilterSchema) ]).optional().nullable(), +export const IntFilterSchema: z.ZodType = z.object({ + equals: z.number().optional(), + in: z.number().array().optional(), + notIn: z.number().array().optional(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedIntFilterSchema) ]).optional(), }).strict(); -export const CustomRoleNullableRelationFilterSchema: z.ZodType = z.object({ - is: z.lazy(() => CustomRoleWhereInputSchema).optional().nullable(), - isNot: z.lazy(() => CustomRoleWhereInputSchema).optional().nullable() +export const EnumImportModuleFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportModuleSchema).optional(), + in: z.lazy(() => ImportModuleSchema).array().optional(), + notIn: z.lazy(() => ImportModuleSchema).array().optional(), + not: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => NestedEnumImportModuleFilterSchema) ]).optional(), }).strict(); -export const UserOrganizationUserIdOrganizationIdCompoundUniqueInputSchema: z.ZodType = z.object({ - userId: z.string(), - organizationId: z.string() +export const EnumImportEntityTypeFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportEntityTypeSchema).optional(), + in: z.lazy(() => ImportEntityTypeSchema).array().optional(), + notIn: z.lazy(() => ImportEntityTypeSchema).array().optional(), + not: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => NestedEnumImportEntityTypeFilterSchema) ]).optional(), }).strict(); -export const UserOrganizationCountOrderByAggregateInputSchema: z.ZodType = z.object({ - userId: z.lazy(() => SortOrderSchema).optional(), - organizationId: z.lazy(() => SortOrderSchema).optional(), - role: z.lazy(() => SortOrderSchema).optional(), - customRoleId: z.lazy(() => SortOrderSchema).optional(), - joinedAt: z.lazy(() => SortOrderSchema).optional() +export const EnumImportStatusFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportStatusSchema).optional(), + in: z.lazy(() => ImportStatusSchema).array().optional(), + notIn: z.lazy(() => ImportStatusSchema).array().optional(), + not: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => NestedEnumImportStatusFilterSchema) ]).optional(), }).strict(); -export const UserOrganizationMaxOrderByAggregateInputSchema: z.ZodType = z.object({ - userId: z.lazy(() => SortOrderSchema).optional(), - organizationId: z.lazy(() => SortOrderSchema).optional(), - role: z.lazy(() => SortOrderSchema).optional(), - customRoleId: z.lazy(() => SortOrderSchema).optional(), - joinedAt: z.lazy(() => SortOrderSchema).optional() +export const EnumDedupeModeFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => DedupeModeSchema).optional(), + in: z.lazy(() => DedupeModeSchema).array().optional(), + notIn: z.lazy(() => DedupeModeSchema).array().optional(), + not: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => NestedEnumDedupeModeFilterSchema) ]).optional(), }).strict(); -export const UserOrganizationMinOrderByAggregateInputSchema: z.ZodType = z.object({ - userId: z.lazy(() => SortOrderSchema).optional(), - organizationId: z.lazy(() => SortOrderSchema).optional(), - role: z.lazy(() => SortOrderSchema).optional(), - customRoleId: z.lazy(() => SortOrderSchema).optional(), - joinedAt: z.lazy(() => SortOrderSchema).optional() +export const JsonNullableFilterSchema: z.ZodType = z.object({ + equals: InputJsonValueSchema.optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValueSchema.optional().nullable(), + array_starts_with: InputJsonValueSchema.optional().nullable(), + array_ends_with: InputJsonValueSchema.optional().nullable(), + lt: InputJsonValueSchema.optional(), + lte: InputJsonValueSchema.optional(), + gt: InputJsonValueSchema.optional(), + gte: InputJsonValueSchema.optional(), + not: InputJsonValueSchema.optional() }).strict(); -export const EnumUserRoleNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.lazy(() => UserRoleSchema).optional().nullable(), - in: z.lazy(() => UserRoleSchema).array().optional().nullable(), - notIn: z.lazy(() => UserRoleSchema).array().optional().nullable(), - not: z.union([ z.lazy(() => UserRoleSchema),z.lazy(() => NestedEnumUserRoleNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedEnumUserRoleNullableFilterSchema).optional(), - _max: z.lazy(() => NestedEnumUserRoleNullableFilterSchema).optional() +export const IntNullableFilterSchema: z.ZodType = z.object({ + equals: z.number().optional().nullable(), + in: z.number().array().optional().nullable(), + notIn: z.number().array().optional().nullable(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedIntNullableFilterSchema) ]).optional().nullable(), }).strict(); -export const EnumCustomerTypeFilterSchema: z.ZodType = z.object({ - equals: z.lazy(() => CustomerTypeSchema).optional(), - in: z.lazy(() => CustomerTypeSchema).array().optional(), - notIn: z.lazy(() => CustomerTypeSchema).array().optional(), - not: z.union([ z.lazy(() => CustomerTypeSchema),z.lazy(() => NestedEnumCustomerTypeFilterSchema) ]).optional(), +export const DateTimeNullableFilterSchema: z.ZodType = z.object({ + equals: z.coerce.date().optional().nullable(), + in: z.coerce.date().array().optional().nullable(), + notIn: z.coerce.date().array().optional().nullable(), + lt: z.coerce.date().optional(), + lte: z.coerce.date().optional(), + gt: z.coerce.date().optional(), + gte: z.coerce.date().optional(), + not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableFilterSchema) ]).optional().nullable(), }).strict(); -export const EnumLeadStatusNullableFilterSchema: z.ZodType = z.object({ - equals: z.lazy(() => LeadStatusSchema).optional().nullable(), - in: z.lazy(() => LeadStatusSchema).array().optional().nullable(), - notIn: z.lazy(() => LeadStatusSchema).array().optional().nullable(), - not: z.union([ z.lazy(() => LeadStatusSchema),z.lazy(() => NestedEnumLeadStatusNullableFilterSchema) ]).optional().nullable(), +export const UserRelationFilterSchema: z.ZodType = z.object({ + is: z.lazy(() => UserWhereInputSchema).optional(), + isNot: z.lazy(() => UserWhereInputSchema).optional() }).strict(); -export const EnumLeadSourceNullableFilterSchema: z.ZodType = z.object({ - equals: z.lazy(() => LeadSourceSchema).optional().nullable(), - in: z.lazy(() => LeadSourceSchema).array().optional().nullable(), - notIn: z.lazy(() => LeadSourceSchema).array().optional().nullable(), - not: z.union([ z.lazy(() => LeadSourceSchema),z.lazy(() => NestedEnumLeadSourceNullableFilterSchema) ]).optional().nullable(), +export const ImportRowListRelationFilterSchema: z.ZodType = z.object({ + every: z.lazy(() => ImportRowWhereInputSchema).optional(), + some: z.lazy(() => ImportRowWhereInputSchema).optional(), + none: z.lazy(() => ImportRowWhereInputSchema).optional() }).strict(); -export const CustomerInteractionListRelationFilterSchema: z.ZodType = z.object({ - every: z.lazy(() => CustomerInteractionWhereInputSchema).optional(), - some: z.lazy(() => CustomerInteractionWhereInputSchema).optional(), - none: z.lazy(() => CustomerInteractionWhereInputSchema).optional() +export const ImportRowIssueListRelationFilterSchema: z.ZodType = z.object({ + every: z.lazy(() => ImportRowIssueWhereInputSchema).optional(), + some: z.lazy(() => ImportRowIssueWhereInputSchema).optional(), + none: z.lazy(() => ImportRowIssueWhereInputSchema).optional() }).strict(); -export const DealListRelationFilterSchema: z.ZodType = z.object({ - every: z.lazy(() => DealWhereInputSchema).optional(), - some: z.lazy(() => DealWhereInputSchema).optional(), - none: z.lazy(() => DealWhereInputSchema).optional() +export const ImportTemplateNullableRelationFilterSchema: z.ZodType = z.object({ + is: z.lazy(() => ImportTemplateWhereInputSchema).optional().nullable(), + isNot: z.lazy(() => ImportTemplateWhereInputSchema).optional().nullable() }).strict(); -export const CustomerInteractionOrderByRelationAggregateInputSchema: z.ZodType = z.object({ +export const ImportRowOrderByRelationAggregateInputSchema: z.ZodType = z.object({ _count: z.lazy(() => SortOrderSchema).optional() }).strict(); -export const DealOrderByRelationAggregateInputSchema: z.ZodType = z.object({ +export const ImportRowIssueOrderByRelationAggregateInputSchema: z.ZodType = z.object({ _count: z.lazy(() => SortOrderSchema).optional() }).strict(); -export const CustomerCountOrderByAggregateInputSchema: z.ZodType = z.object({ +export const ImportSessionCountOrderByAggregateInputSchema: z.ZodType = z.object({ id: z.lazy(() => SortOrderSchema).optional(), organizationId: z.lazy(() => SortOrderSchema).optional(), - type: z.lazy(() => SortOrderSchema).optional(), + createdByUserId: z.lazy(() => SortOrderSchema).optional(), + fileName: z.lazy(() => SortOrderSchema).optional(), + fileSize: z.lazy(() => SortOrderSchema).optional(), + fileType: z.lazy(() => SortOrderSchema).optional(), + module: z.lazy(() => SortOrderSchema).optional(), + entityType: z.lazy(() => SortOrderSchema).optional(), status: z.lazy(() => SortOrderSchema).optional(), - firstName: z.lazy(() => SortOrderSchema).optional(), - lastName: z.lazy(() => SortOrderSchema).optional(), - email: z.lazy(() => SortOrderSchema).optional(), - phone: z.lazy(() => SortOrderSchema).optional(), - company: z.lazy(() => SortOrderSchema).optional(), - position: z.lazy(() => SortOrderSchema).optional(), - address: z.lazy(() => SortOrderSchema).optional(), - city: z.lazy(() => SortOrderSchema).optional(), - state: z.lazy(() => SortOrderSchema).optional(), - country: z.lazy(() => SortOrderSchema).optional(), - postalCode: z.lazy(() => SortOrderSchema).optional(), - source: z.lazy(() => SortOrderSchema).optional(), - notes: z.lazy(() => SortOrderSchema).optional(), + dedupeMode: z.lazy(() => SortOrderSchema).optional(), + mappingConfig: z.lazy(() => SortOrderSchema).optional(), + summary: z.lazy(() => SortOrderSchema).optional(), + rowCount: z.lazy(() => SortOrderSchema).optional(), + processedCount: z.lazy(() => SortOrderSchema).optional(), + successCount: z.lazy(() => SortOrderSchema).optional(), + failureCount: z.lazy(() => SortOrderSchema).optional(), + skippedCount: z.lazy(() => SortOrderSchema).optional(), createdAt: z.lazy(() => SortOrderSchema).optional(), - updatedAt: z.lazy(() => SortOrderSchema).optional() + updatedAt: z.lazy(() => SortOrderSchema).optional(), + startedAt: z.lazy(() => SortOrderSchema).optional(), + completedAt: z.lazy(() => SortOrderSchema).optional(), + appliedTemplateId: z.lazy(() => SortOrderSchema).optional() }).strict(); -export const CustomerMaxOrderByAggregateInputSchema: z.ZodType = z.object({ +export const ImportSessionAvgOrderByAggregateInputSchema: z.ZodType = z.object({ + fileSize: z.lazy(() => SortOrderSchema).optional(), + rowCount: z.lazy(() => SortOrderSchema).optional(), + processedCount: z.lazy(() => SortOrderSchema).optional(), + successCount: z.lazy(() => SortOrderSchema).optional(), + failureCount: z.lazy(() => SortOrderSchema).optional(), + skippedCount: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportSessionMaxOrderByAggregateInputSchema: z.ZodType = z.object({ id: z.lazy(() => SortOrderSchema).optional(), organizationId: z.lazy(() => SortOrderSchema).optional(), - type: z.lazy(() => SortOrderSchema).optional(), + createdByUserId: z.lazy(() => SortOrderSchema).optional(), + fileName: z.lazy(() => SortOrderSchema).optional(), + fileSize: z.lazy(() => SortOrderSchema).optional(), + fileType: z.lazy(() => SortOrderSchema).optional(), + module: z.lazy(() => SortOrderSchema).optional(), + entityType: z.lazy(() => SortOrderSchema).optional(), status: z.lazy(() => SortOrderSchema).optional(), - firstName: z.lazy(() => SortOrderSchema).optional(), - lastName: z.lazy(() => SortOrderSchema).optional(), - email: z.lazy(() => SortOrderSchema).optional(), - phone: z.lazy(() => SortOrderSchema).optional(), - company: z.lazy(() => SortOrderSchema).optional(), - position: z.lazy(() => SortOrderSchema).optional(), - address: z.lazy(() => SortOrderSchema).optional(), - city: z.lazy(() => SortOrderSchema).optional(), - state: z.lazy(() => SortOrderSchema).optional(), - country: z.lazy(() => SortOrderSchema).optional(), - postalCode: z.lazy(() => SortOrderSchema).optional(), - source: z.lazy(() => SortOrderSchema).optional(), - notes: z.lazy(() => SortOrderSchema).optional(), + dedupeMode: z.lazy(() => SortOrderSchema).optional(), + rowCount: z.lazy(() => SortOrderSchema).optional(), + processedCount: z.lazy(() => SortOrderSchema).optional(), + successCount: z.lazy(() => SortOrderSchema).optional(), + failureCount: z.lazy(() => SortOrderSchema).optional(), + skippedCount: z.lazy(() => SortOrderSchema).optional(), createdAt: z.lazy(() => SortOrderSchema).optional(), - updatedAt: z.lazy(() => SortOrderSchema).optional() + updatedAt: z.lazy(() => SortOrderSchema).optional(), + startedAt: z.lazy(() => SortOrderSchema).optional(), + completedAt: z.lazy(() => SortOrderSchema).optional(), + appliedTemplateId: z.lazy(() => SortOrderSchema).optional() }).strict(); -export const CustomerMinOrderByAggregateInputSchema: z.ZodType = z.object({ +export const ImportSessionMinOrderByAggregateInputSchema: z.ZodType = z.object({ id: z.lazy(() => SortOrderSchema).optional(), organizationId: z.lazy(() => SortOrderSchema).optional(), - type: z.lazy(() => SortOrderSchema).optional(), + createdByUserId: z.lazy(() => SortOrderSchema).optional(), + fileName: z.lazy(() => SortOrderSchema).optional(), + fileSize: z.lazy(() => SortOrderSchema).optional(), + fileType: z.lazy(() => SortOrderSchema).optional(), + module: z.lazy(() => SortOrderSchema).optional(), + entityType: z.lazy(() => SortOrderSchema).optional(), status: z.lazy(() => SortOrderSchema).optional(), - firstName: z.lazy(() => SortOrderSchema).optional(), - lastName: z.lazy(() => SortOrderSchema).optional(), - email: z.lazy(() => SortOrderSchema).optional(), - phone: z.lazy(() => SortOrderSchema).optional(), - company: z.lazy(() => SortOrderSchema).optional(), - position: z.lazy(() => SortOrderSchema).optional(), - address: z.lazy(() => SortOrderSchema).optional(), - city: z.lazy(() => SortOrderSchema).optional(), - state: z.lazy(() => SortOrderSchema).optional(), - country: z.lazy(() => SortOrderSchema).optional(), - postalCode: z.lazy(() => SortOrderSchema).optional(), - source: z.lazy(() => SortOrderSchema).optional(), - notes: z.lazy(() => SortOrderSchema).optional(), + dedupeMode: z.lazy(() => SortOrderSchema).optional(), + rowCount: z.lazy(() => SortOrderSchema).optional(), + processedCount: z.lazy(() => SortOrderSchema).optional(), + successCount: z.lazy(() => SortOrderSchema).optional(), + failureCount: z.lazy(() => SortOrderSchema).optional(), + skippedCount: z.lazy(() => SortOrderSchema).optional(), createdAt: z.lazy(() => SortOrderSchema).optional(), - updatedAt: z.lazy(() => SortOrderSchema).optional() + updatedAt: z.lazy(() => SortOrderSchema).optional(), + startedAt: z.lazy(() => SortOrderSchema).optional(), + completedAt: z.lazy(() => SortOrderSchema).optional(), + appliedTemplateId: z.lazy(() => SortOrderSchema).optional() }).strict(); -export const EnumCustomerTypeWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.lazy(() => CustomerTypeSchema).optional(), - in: z.lazy(() => CustomerTypeSchema).array().optional(), - notIn: z.lazy(() => CustomerTypeSchema).array().optional(), - not: z.union([ z.lazy(() => CustomerTypeSchema),z.lazy(() => NestedEnumCustomerTypeWithAggregatesFilterSchema) ]).optional(), +export const ImportSessionSumOrderByAggregateInputSchema: z.ZodType = z.object({ + fileSize: z.lazy(() => SortOrderSchema).optional(), + rowCount: z.lazy(() => SortOrderSchema).optional(), + processedCount: z.lazy(() => SortOrderSchema).optional(), + successCount: z.lazy(() => SortOrderSchema).optional(), + failureCount: z.lazy(() => SortOrderSchema).optional(), + skippedCount: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const IntWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.number().optional(), + in: z.number().array().optional(), + notIn: z.number().array().optional(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedIntWithAggregatesFilterSchema) ]).optional(), _count: z.lazy(() => NestedIntFilterSchema).optional(), - _min: z.lazy(() => NestedEnumCustomerTypeFilterSchema).optional(), - _max: z.lazy(() => NestedEnumCustomerTypeFilterSchema).optional() + _avg: z.lazy(() => NestedFloatFilterSchema).optional(), + _sum: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedIntFilterSchema).optional(), + _max: z.lazy(() => NestedIntFilterSchema).optional() }).strict(); -export const EnumLeadStatusNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.lazy(() => LeadStatusSchema).optional().nullable(), - in: z.lazy(() => LeadStatusSchema).array().optional().nullable(), - notIn: z.lazy(() => LeadStatusSchema).array().optional().nullable(), - not: z.union([ z.lazy(() => LeadStatusSchema),z.lazy(() => NestedEnumLeadStatusNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedEnumLeadStatusNullableFilterSchema).optional(), - _max: z.lazy(() => NestedEnumLeadStatusNullableFilterSchema).optional() +export const EnumImportModuleWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportModuleSchema).optional(), + in: z.lazy(() => ImportModuleSchema).array().optional(), + notIn: z.lazy(() => ImportModuleSchema).array().optional(), + not: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => NestedEnumImportModuleWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumImportModuleFilterSchema).optional(), + _max: z.lazy(() => NestedEnumImportModuleFilterSchema).optional() }).strict(); -export const EnumLeadSourceNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.lazy(() => LeadSourceSchema).optional().nullable(), - in: z.lazy(() => LeadSourceSchema).array().optional().nullable(), - notIn: z.lazy(() => LeadSourceSchema).array().optional().nullable(), - not: z.union([ z.lazy(() => LeadSourceSchema),z.lazy(() => NestedEnumLeadSourceNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedEnumLeadSourceNullableFilterSchema).optional(), - _max: z.lazy(() => NestedEnumLeadSourceNullableFilterSchema).optional() +export const EnumImportEntityTypeWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportEntityTypeSchema).optional(), + in: z.lazy(() => ImportEntityTypeSchema).array().optional(), + notIn: z.lazy(() => ImportEntityTypeSchema).array().optional(), + not: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => NestedEnumImportEntityTypeWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumImportEntityTypeFilterSchema).optional(), + _max: z.lazy(() => NestedEnumImportEntityTypeFilterSchema).optional() }).strict(); -export const EnumInteractionTypeFilterSchema: z.ZodType = z.object({ - equals: z.lazy(() => InteractionTypeSchema).optional(), - in: z.lazy(() => InteractionTypeSchema).array().optional(), - notIn: z.lazy(() => InteractionTypeSchema).array().optional(), - not: z.union([ z.lazy(() => InteractionTypeSchema),z.lazy(() => NestedEnumInteractionTypeFilterSchema) ]).optional(), +export const EnumImportStatusWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportStatusSchema).optional(), + in: z.lazy(() => ImportStatusSchema).array().optional(), + notIn: z.lazy(() => ImportStatusSchema).array().optional(), + not: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => NestedEnumImportStatusWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumImportStatusFilterSchema).optional(), + _max: z.lazy(() => NestedEnumImportStatusFilterSchema).optional() }).strict(); -export const EnumInteractionMediumFilterSchema: z.ZodType = z.object({ - equals: z.lazy(() => InteractionMediumSchema).optional(), - in: z.lazy(() => InteractionMediumSchema).array().optional(), - notIn: z.lazy(() => InteractionMediumSchema).array().optional(), - not: z.union([ z.lazy(() => InteractionMediumSchema),z.lazy(() => NestedEnumInteractionMediumFilterSchema) ]).optional(), +export const EnumDedupeModeWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => DedupeModeSchema).optional(), + in: z.lazy(() => DedupeModeSchema).array().optional(), + notIn: z.lazy(() => DedupeModeSchema).array().optional(), + not: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => NestedEnumDedupeModeWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumDedupeModeFilterSchema).optional(), + _max: z.lazy(() => NestedEnumDedupeModeFilterSchema).optional() }).strict(); -export const DateTimeNullableFilterSchema: z.ZodType = z.object({ +export const JsonNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: InputJsonValueSchema.optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValueSchema.optional().nullable(), + array_starts_with: InputJsonValueSchema.optional().nullable(), + array_ends_with: InputJsonValueSchema.optional().nullable(), + lt: InputJsonValueSchema.optional(), + lte: InputJsonValueSchema.optional(), + gt: InputJsonValueSchema.optional(), + gte: InputJsonValueSchema.optional(), + not: InputJsonValueSchema.optional(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedJsonNullableFilterSchema).optional(), + _max: z.lazy(() => NestedJsonNullableFilterSchema).optional() +}).strict(); + +export const IntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.number().optional().nullable(), + in: z.number().array().optional().nullable(), + notIn: z.number().array().optional().nullable(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), + _sum: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _max: z.lazy(() => NestedIntNullableFilterSchema).optional() +}).strict(); + +export const DateTimeNullableWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.coerce.date().optional().nullable(), in: z.coerce.date().array().optional().nullable(), notIn: z.coerce.date().array().optional().nullable(), @@ -20542,15 +21882,439 @@ export const DateTimeNullableFilterSchema: z.ZodType NestedDateTimeNullableFilterSchema) ]).optional().nullable(), + not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedDateTimeNullableFilterSchema).optional(), + _max: z.lazy(() => NestedDateTimeNullableFilterSchema).optional() }).strict(); -export const CustomerRelationFilterSchema: z.ZodType = z.object({ - is: z.lazy(() => CustomerWhereInputSchema).optional(), - isNot: z.lazy(() => CustomerWhereInputSchema).optional() +export const JsonFilterSchema: z.ZodType = z.object({ + equals: InputJsonValueSchema.optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValueSchema.optional().nullable(), + array_starts_with: InputJsonValueSchema.optional().nullable(), + array_ends_with: InputJsonValueSchema.optional().nullable(), + lt: InputJsonValueSchema.optional(), + lte: InputJsonValueSchema.optional(), + gt: InputJsonValueSchema.optional(), + gte: InputJsonValueSchema.optional(), + not: InputJsonValueSchema.optional() }).strict(); -export const CustomerInteractionCountOrderByAggregateInputSchema: z.ZodType = z.object({ +export const ImportTemplateOrganizationIdNameCompoundUniqueInputSchema: z.ZodType = z.object({ + organizationId: z.string(), + name: z.string() +}).strict(); + +export const ImportTemplateCountOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + createdByUserId: z.lazy(() => SortOrderSchema).optional(), + name: z.lazy(() => SortOrderSchema).optional(), + module: z.lazy(() => SortOrderSchema).optional(), + entityType: z.lazy(() => SortOrderSchema).optional(), + mappingConfig: z.lazy(() => SortOrderSchema).optional(), + columnSignature: z.lazy(() => SortOrderSchema).optional(), + usageCount: z.lazy(() => SortOrderSchema).optional(), + lastUsedAt: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportTemplateAvgOrderByAggregateInputSchema: z.ZodType = z.object({ + usageCount: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportTemplateMaxOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + createdByUserId: z.lazy(() => SortOrderSchema).optional(), + name: z.lazy(() => SortOrderSchema).optional(), + module: z.lazy(() => SortOrderSchema).optional(), + entityType: z.lazy(() => SortOrderSchema).optional(), + usageCount: z.lazy(() => SortOrderSchema).optional(), + lastUsedAt: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportTemplateMinOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + createdByUserId: z.lazy(() => SortOrderSchema).optional(), + name: z.lazy(() => SortOrderSchema).optional(), + module: z.lazy(() => SortOrderSchema).optional(), + entityType: z.lazy(() => SortOrderSchema).optional(), + usageCount: z.lazy(() => SortOrderSchema).optional(), + lastUsedAt: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportTemplateSumOrderByAggregateInputSchema: z.ZodType = z.object({ + usageCount: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const JsonWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: InputJsonValueSchema.optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValueSchema.optional().nullable(), + array_starts_with: InputJsonValueSchema.optional().nullable(), + array_ends_with: InputJsonValueSchema.optional().nullable(), + lt: InputJsonValueSchema.optional(), + lte: InputJsonValueSchema.optional(), + gt: InputJsonValueSchema.optional(), + gte: InputJsonValueSchema.optional(), + not: InputJsonValueSchema.optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedJsonFilterSchema).optional(), + _max: z.lazy(() => NestedJsonFilterSchema).optional() +}).strict(); + +export const EnumRowStatusFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => RowStatusSchema).optional(), + in: z.lazy(() => RowStatusSchema).array().optional(), + notIn: z.lazy(() => RowStatusSchema).array().optional(), + not: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => NestedEnumRowStatusFilterSchema) ]).optional(), +}).strict(); + +export const ImportSessionRelationFilterSchema: z.ZodType = z.object({ + is: z.lazy(() => ImportSessionWhereInputSchema).optional(), + isNot: z.lazy(() => ImportSessionWhereInputSchema).optional() +}).strict(); + +export const ImportRowSessionIdRowNumberCompoundUniqueInputSchema: z.ZodType = z.object({ + sessionId: z.string(), + rowNumber: z.number() +}).strict(); + +export const ImportRowCountOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + sessionId: z.lazy(() => SortOrderSchema).optional(), + rowNumber: z.lazy(() => SortOrderSchema).optional(), + rawData: z.lazy(() => SortOrderSchema).optional(), + mappedData: z.lazy(() => SortOrderSchema).optional(), + status: z.lazy(() => SortOrderSchema).optional(), + dedupeHint: z.lazy(() => SortOrderSchema).optional(), + score: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportRowAvgOrderByAggregateInputSchema: z.ZodType = z.object({ + rowNumber: z.lazy(() => SortOrderSchema).optional(), + score: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportRowMaxOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + sessionId: z.lazy(() => SortOrderSchema).optional(), + rowNumber: z.lazy(() => SortOrderSchema).optional(), + status: z.lazy(() => SortOrderSchema).optional(), + dedupeHint: z.lazy(() => SortOrderSchema).optional(), + score: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportRowMinOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + sessionId: z.lazy(() => SortOrderSchema).optional(), + rowNumber: z.lazy(() => SortOrderSchema).optional(), + status: z.lazy(() => SortOrderSchema).optional(), + dedupeHint: z.lazy(() => SortOrderSchema).optional(), + score: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportRowSumOrderByAggregateInputSchema: z.ZodType = z.object({ + rowNumber: z.lazy(() => SortOrderSchema).optional(), + score: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const EnumRowStatusWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => RowStatusSchema).optional(), + in: z.lazy(() => RowStatusSchema).array().optional(), + notIn: z.lazy(() => RowStatusSchema).array().optional(), + not: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => NestedEnumRowStatusWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumRowStatusFilterSchema).optional(), + _max: z.lazy(() => NestedEnumRowStatusFilterSchema).optional() +}).strict(); + +export const EnumIssueSeverityFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => IssueSeveritySchema).optional(), + in: z.lazy(() => IssueSeveritySchema).array().optional(), + notIn: z.lazy(() => IssueSeveritySchema).array().optional(), + not: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => NestedEnumIssueSeverityFilterSchema) ]).optional(), +}).strict(); + +export const ImportRowRelationFilterSchema: z.ZodType = z.object({ + is: z.lazy(() => ImportRowWhereInputSchema).optional(), + isNot: z.lazy(() => ImportRowWhereInputSchema).optional() +}).strict(); + +export const ImportRowIssueCountOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + sessionId: z.lazy(() => SortOrderSchema).optional(), + rowId: z.lazy(() => SortOrderSchema).optional(), + field: z.lazy(() => SortOrderSchema).optional(), + severity: z.lazy(() => SortOrderSchema).optional(), + message: z.lazy(() => SortOrderSchema).optional(), + hint: z.lazy(() => SortOrderSchema).optional(), + value: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportRowIssueMaxOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + sessionId: z.lazy(() => SortOrderSchema).optional(), + rowId: z.lazy(() => SortOrderSchema).optional(), + field: z.lazy(() => SortOrderSchema).optional(), + severity: z.lazy(() => SortOrderSchema).optional(), + message: z.lazy(() => SortOrderSchema).optional(), + hint: z.lazy(() => SortOrderSchema).optional(), + value: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const ImportRowIssueMinOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + sessionId: z.lazy(() => SortOrderSchema).optional(), + rowId: z.lazy(() => SortOrderSchema).optional(), + field: z.lazy(() => SortOrderSchema).optional(), + severity: z.lazy(() => SortOrderSchema).optional(), + message: z.lazy(() => SortOrderSchema).optional(), + hint: z.lazy(() => SortOrderSchema).optional(), + value: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const EnumIssueSeverityWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => IssueSeveritySchema).optional(), + in: z.lazy(() => IssueSeveritySchema).array().optional(), + notIn: z.lazy(() => IssueSeveritySchema).array().optional(), + not: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => NestedEnumIssueSeverityWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumIssueSeverityFilterSchema).optional(), + _max: z.lazy(() => NestedEnumIssueSeverityFilterSchema).optional() +}).strict(); + +export const EnumUserRoleNullableFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => UserRoleSchema).optional().nullable(), + in: z.lazy(() => UserRoleSchema).array().optional().nullable(), + notIn: z.lazy(() => UserRoleSchema).array().optional().nullable(), + not: z.union([ z.lazy(() => UserRoleSchema),z.lazy(() => NestedEnumUserRoleNullableFilterSchema) ]).optional().nullable(), +}).strict(); + +export const CustomRoleNullableRelationFilterSchema: z.ZodType = z.object({ + is: z.lazy(() => CustomRoleWhereInputSchema).optional().nullable(), + isNot: z.lazy(() => CustomRoleWhereInputSchema).optional().nullable() +}).strict(); + +export const UserOrganizationUserIdOrganizationIdCompoundUniqueInputSchema: z.ZodType = z.object({ + userId: z.string(), + organizationId: z.string() +}).strict(); + +export const UserOrganizationCountOrderByAggregateInputSchema: z.ZodType = z.object({ + userId: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + role: z.lazy(() => SortOrderSchema).optional(), + customRoleId: z.lazy(() => SortOrderSchema).optional(), + joinedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const UserOrganizationMaxOrderByAggregateInputSchema: z.ZodType = z.object({ + userId: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + role: z.lazy(() => SortOrderSchema).optional(), + customRoleId: z.lazy(() => SortOrderSchema).optional(), + joinedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const UserOrganizationMinOrderByAggregateInputSchema: z.ZodType = z.object({ + userId: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + role: z.lazy(() => SortOrderSchema).optional(), + customRoleId: z.lazy(() => SortOrderSchema).optional(), + joinedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const EnumUserRoleNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => UserRoleSchema).optional().nullable(), + in: z.lazy(() => UserRoleSchema).array().optional().nullable(), + notIn: z.lazy(() => UserRoleSchema).array().optional().nullable(), + not: z.union([ z.lazy(() => UserRoleSchema),z.lazy(() => NestedEnumUserRoleNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedEnumUserRoleNullableFilterSchema).optional(), + _max: z.lazy(() => NestedEnumUserRoleNullableFilterSchema).optional() +}).strict(); + +export const EnumCustomerTypeFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => CustomerTypeSchema).optional(), + in: z.lazy(() => CustomerTypeSchema).array().optional(), + notIn: z.lazy(() => CustomerTypeSchema).array().optional(), + not: z.union([ z.lazy(() => CustomerTypeSchema),z.lazy(() => NestedEnumCustomerTypeFilterSchema) ]).optional(), +}).strict(); + +export const EnumLeadStatusNullableFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => LeadStatusSchema).optional().nullable(), + in: z.lazy(() => LeadStatusSchema).array().optional().nullable(), + notIn: z.lazy(() => LeadStatusSchema).array().optional().nullable(), + not: z.union([ z.lazy(() => LeadStatusSchema),z.lazy(() => NestedEnumLeadStatusNullableFilterSchema) ]).optional().nullable(), +}).strict(); + +export const EnumLeadSourceNullableFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => LeadSourceSchema).optional().nullable(), + in: z.lazy(() => LeadSourceSchema).array().optional().nullable(), + notIn: z.lazy(() => LeadSourceSchema).array().optional().nullable(), + not: z.union([ z.lazy(() => LeadSourceSchema),z.lazy(() => NestedEnumLeadSourceNullableFilterSchema) ]).optional().nullable(), +}).strict(); + +export const CustomerInteractionListRelationFilterSchema: z.ZodType = z.object({ + every: z.lazy(() => CustomerInteractionWhereInputSchema).optional(), + some: z.lazy(() => CustomerInteractionWhereInputSchema).optional(), + none: z.lazy(() => CustomerInteractionWhereInputSchema).optional() +}).strict(); + +export const DealListRelationFilterSchema: z.ZodType = z.object({ + every: z.lazy(() => DealWhereInputSchema).optional(), + some: z.lazy(() => DealWhereInputSchema).optional(), + none: z.lazy(() => DealWhereInputSchema).optional() +}).strict(); + +export const CustomerInteractionOrderByRelationAggregateInputSchema: z.ZodType = z.object({ + _count: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const DealOrderByRelationAggregateInputSchema: z.ZodType = z.object({ + _count: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const CustomerCountOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + type: z.lazy(() => SortOrderSchema).optional(), + status: z.lazy(() => SortOrderSchema).optional(), + firstName: z.lazy(() => SortOrderSchema).optional(), + lastName: z.lazy(() => SortOrderSchema).optional(), + email: z.lazy(() => SortOrderSchema).optional(), + phone: z.lazy(() => SortOrderSchema).optional(), + company: z.lazy(() => SortOrderSchema).optional(), + position: z.lazy(() => SortOrderSchema).optional(), + address: z.lazy(() => SortOrderSchema).optional(), + city: z.lazy(() => SortOrderSchema).optional(), + state: z.lazy(() => SortOrderSchema).optional(), + country: z.lazy(() => SortOrderSchema).optional(), + postalCode: z.lazy(() => SortOrderSchema).optional(), + source: z.lazy(() => SortOrderSchema).optional(), + notes: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const CustomerMaxOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + type: z.lazy(() => SortOrderSchema).optional(), + status: z.lazy(() => SortOrderSchema).optional(), + firstName: z.lazy(() => SortOrderSchema).optional(), + lastName: z.lazy(() => SortOrderSchema).optional(), + email: z.lazy(() => SortOrderSchema).optional(), + phone: z.lazy(() => SortOrderSchema).optional(), + company: z.lazy(() => SortOrderSchema).optional(), + position: z.lazy(() => SortOrderSchema).optional(), + address: z.lazy(() => SortOrderSchema).optional(), + city: z.lazy(() => SortOrderSchema).optional(), + state: z.lazy(() => SortOrderSchema).optional(), + country: z.lazy(() => SortOrderSchema).optional(), + postalCode: z.lazy(() => SortOrderSchema).optional(), + source: z.lazy(() => SortOrderSchema).optional(), + notes: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const CustomerMinOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + organizationId: z.lazy(() => SortOrderSchema).optional(), + type: z.lazy(() => SortOrderSchema).optional(), + status: z.lazy(() => SortOrderSchema).optional(), + firstName: z.lazy(() => SortOrderSchema).optional(), + lastName: z.lazy(() => SortOrderSchema).optional(), + email: z.lazy(() => SortOrderSchema).optional(), + phone: z.lazy(() => SortOrderSchema).optional(), + company: z.lazy(() => SortOrderSchema).optional(), + position: z.lazy(() => SortOrderSchema).optional(), + address: z.lazy(() => SortOrderSchema).optional(), + city: z.lazy(() => SortOrderSchema).optional(), + state: z.lazy(() => SortOrderSchema).optional(), + country: z.lazy(() => SortOrderSchema).optional(), + postalCode: z.lazy(() => SortOrderSchema).optional(), + source: z.lazy(() => SortOrderSchema).optional(), + notes: z.lazy(() => SortOrderSchema).optional(), + createdAt: z.lazy(() => SortOrderSchema).optional(), + updatedAt: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const EnumCustomerTypeWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => CustomerTypeSchema).optional(), + in: z.lazy(() => CustomerTypeSchema).array().optional(), + notIn: z.lazy(() => CustomerTypeSchema).array().optional(), + not: z.union([ z.lazy(() => CustomerTypeSchema),z.lazy(() => NestedEnumCustomerTypeWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumCustomerTypeFilterSchema).optional(), + _max: z.lazy(() => NestedEnumCustomerTypeFilterSchema).optional() +}).strict(); + +export const EnumLeadStatusNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => LeadStatusSchema).optional().nullable(), + in: z.lazy(() => LeadStatusSchema).array().optional().nullable(), + notIn: z.lazy(() => LeadStatusSchema).array().optional().nullable(), + not: z.union([ z.lazy(() => LeadStatusSchema),z.lazy(() => NestedEnumLeadStatusNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedEnumLeadStatusNullableFilterSchema).optional(), + _max: z.lazy(() => NestedEnumLeadStatusNullableFilterSchema).optional() +}).strict(); + +export const EnumLeadSourceNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => LeadSourceSchema).optional().nullable(), + in: z.lazy(() => LeadSourceSchema).array().optional().nullable(), + notIn: z.lazy(() => LeadSourceSchema).array().optional().nullable(), + not: z.union([ z.lazy(() => LeadSourceSchema),z.lazy(() => NestedEnumLeadSourceNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedEnumLeadSourceNullableFilterSchema).optional(), + _max: z.lazy(() => NestedEnumLeadSourceNullableFilterSchema).optional() +}).strict(); + +export const EnumInteractionTypeFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => InteractionTypeSchema).optional(), + in: z.lazy(() => InteractionTypeSchema).array().optional(), + notIn: z.lazy(() => InteractionTypeSchema).array().optional(), + not: z.union([ z.lazy(() => InteractionTypeSchema),z.lazy(() => NestedEnumInteractionTypeFilterSchema) ]).optional(), +}).strict(); + +export const EnumInteractionMediumFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => InteractionMediumSchema).optional(), + in: z.lazy(() => InteractionMediumSchema).array().optional(), + notIn: z.lazy(() => InteractionMediumSchema).array().optional(), + not: z.union([ z.lazy(() => InteractionMediumSchema),z.lazy(() => NestedEnumInteractionMediumFilterSchema) ]).optional(), +}).strict(); + +export const CustomerRelationFilterSchema: z.ZodType = z.object({ + is: z.lazy(() => CustomerWhereInputSchema).optional(), + isNot: z.lazy(() => CustomerWhereInputSchema).optional() +}).strict(); + +export const CustomerInteractionCountOrderByAggregateInputSchema: z.ZodType = z.object({ id: z.lazy(() => SortOrderSchema).optional(), customerId: z.lazy(() => SortOrderSchema).optional(), type: z.lazy(() => SortOrderSchema).optional(), @@ -20612,20 +22376,6 @@ export const EnumInteractionMediumWithAggregatesFilterSchema: z.ZodType NestedEnumInteractionMediumFilterSchema).optional() }).strict(); -export const DateTimeNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.coerce.date().optional().nullable(), - in: z.coerce.date().array().optional().nullable(), - notIn: z.coerce.date().array().optional().nullable(), - lt: z.coerce.date().optional(), - lte: z.coerce.date().optional(), - gt: z.coerce.date().optional(), - gte: z.coerce.date().optional(), - not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedDateTimeNullableFilterSchema).optional(), - _max: z.lazy(() => NestedDateTimeNullableFilterSchema).optional() -}).strict(); - export const DecimalFilterSchema: z.ZodType = z.object({ equals: z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }).optional(), in: z.union([z.number().array(),z.string().array(),z.instanceof(Decimal).array(),z.instanceof(Prisma.Decimal).array(),DecimalJsLikeSchema.array(),]).refine((v) => Array.isArray(v) && (v as any[]).every((v) => isValidDecimalInput(v)), { message: 'Must be a Decimal' }).optional(), @@ -20644,17 +22394,6 @@ export const EnumLeadStatusFilterSchema: z.ZodType not: z.union([ z.lazy(() => LeadStatusSchema),z.lazy(() => NestedEnumLeadStatusFilterSchema) ]).optional(), }).strict(); -export const IntFilterSchema: z.ZodType = z.object({ - equals: z.number().optional(), - in: z.number().array().optional(), - notIn: z.number().array().optional(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedIntFilterSchema) ]).optional(), -}).strict(); - export const FloatNullableFilterSchema: z.ZodType = z.object({ equals: z.number().optional().nullable(), in: z.number().array().optional().nullable(), @@ -20755,22 +22494,6 @@ export const EnumLeadStatusWithAggregatesFilterSchema: z.ZodType NestedEnumLeadStatusFilterSchema).optional() }).strict(); -export const IntWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.number().optional(), - in: z.number().array().optional(), - notIn: z.number().array().optional(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedIntWithAggregatesFilterSchema) ]).optional(), - _count: z.lazy(() => NestedIntFilterSchema).optional(), - _avg: z.lazy(() => NestedFloatFilterSchema).optional(), - _sum: z.lazy(() => NestedIntFilterSchema).optional(), - _min: z.lazy(() => NestedIntFilterSchema).optional(), - _max: z.lazy(() => NestedIntFilterSchema).optional() -}).strict(); - export const FloatNullableWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.number().optional().nullable(), in: z.number().array().optional().nullable(), @@ -21110,17 +22833,6 @@ export const ProjectResourceSumOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional() }).strict(); -export const IntNullableFilterSchema: z.ZodType = z.object({ - equals: z.number().optional().nullable(), - in: z.number().array().optional().nullable(), - notIn: z.number().array().optional().nullable(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedIntNullableFilterSchema) ]).optional().nullable(), -}).strict(); - export const TimeEntryCountOrderByAggregateInputSchema: z.ZodType = z.object({ id: z.lazy(() => SortOrderSchema).optional(), projectId: z.lazy(() => SortOrderSchema).optional(), @@ -21177,22 +22889,6 @@ export const TimeEntrySumOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional() }).strict(); -export const IntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.number().optional().nullable(), - in: z.number().array().optional().nullable(), - notIn: z.number().array().optional().nullable(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), - _sum: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _max: z.lazy(() => NestedIntNullableFilterSchema).optional() -}).strict(); - export const EnumInvoiceStatusFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => InvoiceStatusSchema).optional(), in: z.lazy(() => InvoiceStatusSchema).array().optional(), @@ -22745,11 +24441,6 @@ export const UserMinOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional() }).strict(); -export const UserRelationFilterSchema: z.ZodType = z.object({ - is: z.lazy(() => UserWhereInputSchema).optional(), - isNot: z.lazy(() => UserWhereInputSchema).optional() -}).strict(); - export const SessionCountOrderByAggregateInputSchema: z.ZodType = z.object({ id: z.lazy(() => SortOrderSchema).optional(), expiresAt: z.lazy(() => SortOrderSchema).optional(), @@ -22865,38 +24556,6 @@ export const EnumFinancialReportTypeFilterSchema: z.ZodType FinancialReportTypeSchema),z.lazy(() => NestedEnumFinancialReportTypeFilterSchema) ]).optional(), }).strict(); -export const JsonFilterSchema: z.ZodType = z.object({ - equals: InputJsonValueSchema.optional(), - path: z.string().array().optional(), - string_contains: z.string().optional(), - string_starts_with: z.string().optional(), - string_ends_with: z.string().optional(), - array_contains: InputJsonValueSchema.optional().nullable(), - array_starts_with: InputJsonValueSchema.optional().nullable(), - array_ends_with: InputJsonValueSchema.optional().nullable(), - lt: InputJsonValueSchema.optional(), - lte: InputJsonValueSchema.optional(), - gt: InputJsonValueSchema.optional(), - gte: InputJsonValueSchema.optional(), - not: InputJsonValueSchema.optional() -}).strict(); - -export const JsonNullableFilterSchema: z.ZodType = z.object({ - equals: InputJsonValueSchema.optional(), - path: z.string().array().optional(), - string_contains: z.string().optional(), - string_starts_with: z.string().optional(), - string_ends_with: z.string().optional(), - array_contains: InputJsonValueSchema.optional().nullable(), - array_starts_with: InputJsonValueSchema.optional().nullable(), - array_ends_with: InputJsonValueSchema.optional().nullable(), - lt: InputJsonValueSchema.optional(), - lte: InputJsonValueSchema.optional(), - gt: InputJsonValueSchema.optional(), - gte: InputJsonValueSchema.optional(), - not: InputJsonValueSchema.optional() -}).strict(); - export const EnumFinancialReportStatusFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => FinancialReportStatusSchema).optional(), in: z.lazy(() => FinancialReportStatusSchema).array().optional(), @@ -22996,44 +24655,6 @@ export const EnumFinancialReportTypeWithAggregatesFilterSchema: z.ZodType NestedEnumFinancialReportTypeFilterSchema).optional() }).strict(); -export const JsonWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: InputJsonValueSchema.optional(), - path: z.string().array().optional(), - string_contains: z.string().optional(), - string_starts_with: z.string().optional(), - string_ends_with: z.string().optional(), - array_contains: InputJsonValueSchema.optional().nullable(), - array_starts_with: InputJsonValueSchema.optional().nullable(), - array_ends_with: InputJsonValueSchema.optional().nullable(), - lt: InputJsonValueSchema.optional(), - lte: InputJsonValueSchema.optional(), - gt: InputJsonValueSchema.optional(), - gte: InputJsonValueSchema.optional(), - not: InputJsonValueSchema.optional(), - _count: z.lazy(() => NestedIntFilterSchema).optional(), - _min: z.lazy(() => NestedJsonFilterSchema).optional(), - _max: z.lazy(() => NestedJsonFilterSchema).optional() -}).strict(); - -export const JsonNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: InputJsonValueSchema.optional(), - path: z.string().array().optional(), - string_contains: z.string().optional(), - string_starts_with: z.string().optional(), - string_ends_with: z.string().optional(), - array_contains: InputJsonValueSchema.optional().nullable(), - array_starts_with: InputJsonValueSchema.optional().nullable(), - array_ends_with: InputJsonValueSchema.optional().nullable(), - lt: InputJsonValueSchema.optional(), - lte: InputJsonValueSchema.optional(), - gt: InputJsonValueSchema.optional(), - gte: InputJsonValueSchema.optional(), - not: InputJsonValueSchema.optional(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedJsonNullableFilterSchema).optional(), - _max: z.lazy(() => NestedJsonNullableFilterSchema).optional() -}).strict(); - export const EnumFinancialReportStatusWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => FinancialReportStatusSchema).optional(), in: z.lazy(() => FinancialReportStatusSchema).array().optional(), @@ -25886,6 +27507,20 @@ export const OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema: connect: z.union([ z.lazy(() => OrganizationUiConfigWhereUniqueInputSchema),z.lazy(() => OrganizationUiConfigWhereUniqueInputSchema).array() ]).optional(), }).strict(); +export const ImportSessionCreateNestedManyWithoutOrganizationInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionCreateWithoutOrganizationInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyOrganizationInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const ImportTemplateCreateNestedManyWithoutOrganizationInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateCreateWithoutOrganizationInputSchema).array(),z.lazy(() => ImportTemplateUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportTemplateCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportTemplateCreateManyOrganizationInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + export const UserOrganizationUncheckedCreateNestedManyWithoutOrganizationInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => UserOrganizationCreateWithoutOrganizationInputSchema),z.lazy(() => UserOrganizationCreateWithoutOrganizationInputSchema).array(),z.lazy(() => UserOrganizationUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => UserOrganizationUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), connectOrCreate: z.union([ z.lazy(() => UserOrganizationCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => UserOrganizationCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), @@ -26040,6 +27675,20 @@ export const OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInp connect: z.union([ z.lazy(() => OrganizationUiConfigWhereUniqueInputSchema),z.lazy(() => OrganizationUiConfigWhereUniqueInputSchema).array() ]).optional(), }).strict(); +export const ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionCreateWithoutOrganizationInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyOrganizationInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateCreateWithoutOrganizationInputSchema).array(),z.lazy(() => ImportTemplateUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportTemplateCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportTemplateCreateManyOrganizationInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + export const UserOrganizationUpdateManyWithoutOrganizationNestedInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => UserOrganizationCreateWithoutOrganizationInputSchema),z.lazy(() => UserOrganizationCreateWithoutOrganizationInputSchema).array(),z.lazy(() => UserOrganizationUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => UserOrganizationUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), connectOrCreate: z.union([ z.lazy(() => UserOrganizationCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => UserOrganizationCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), @@ -26348,6 +27997,34 @@ export const OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema: deleteMany: z.union([ z.lazy(() => OrganizationUiConfigScalarWhereInputSchema),z.lazy(() => OrganizationUiConfigScalarWhereInputSchema).array() ]).optional(), }).strict(); +export const ImportSessionUpdateManyWithoutOrganizationNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionCreateWithoutOrganizationInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutOrganizationInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyOrganizationInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutOrganizationInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportSessionUpdateManyWithWhereWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUpdateManyWithWhereWithoutOrganizationInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportSessionScalarWhereInputSchema),z.lazy(() => ImportSessionScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateCreateWithoutOrganizationInputSchema).array(),z.lazy(() => ImportTemplateUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportTemplateCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportTemplateUpsertWithWhereUniqueWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUpsertWithWhereUniqueWithoutOrganizationInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportTemplateCreateManyOrganizationInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportTemplateUpdateWithWhereUniqueWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUpdateWithWhereUniqueWithoutOrganizationInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportTemplateUpdateManyWithWhereWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUpdateManyWithWhereWithoutOrganizationInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportTemplateScalarWhereInputSchema),z.lazy(() => ImportTemplateScalarWhereInputSchema).array() ]).optional(), +}).strict(); + export const UserOrganizationUncheckedUpdateManyWithoutOrganizationNestedInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => UserOrganizationCreateWithoutOrganizationInputSchema),z.lazy(() => UserOrganizationCreateWithoutOrganizationInputSchema).array(),z.lazy(() => UserOrganizationUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => UserOrganizationUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), connectOrCreate: z.union([ z.lazy(() => UserOrganizationCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => UserOrganizationCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), @@ -26656,6 +28333,360 @@ export const OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInp deleteMany: z.union([ z.lazy(() => OrganizationUiConfigScalarWhereInputSchema),z.lazy(() => OrganizationUiConfigScalarWhereInputSchema).array() ]).optional(), }).strict(); +export const ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionCreateWithoutOrganizationInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutOrganizationInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyOrganizationInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutOrganizationInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportSessionUpdateManyWithWhereWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUpdateManyWithWhereWithoutOrganizationInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportSessionScalarWhereInputSchema),z.lazy(() => ImportSessionScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateCreateWithoutOrganizationInputSchema).array(),z.lazy(() => ImportTemplateUncheckedCreateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutOrganizationInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportTemplateCreateOrConnectWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateCreateOrConnectWithoutOrganizationInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportTemplateUpsertWithWhereUniqueWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUpsertWithWhereUniqueWithoutOrganizationInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportTemplateCreateManyOrganizationInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportTemplateUpdateWithWhereUniqueWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUpdateWithWhereUniqueWithoutOrganizationInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportTemplateUpdateManyWithWhereWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUpdateManyWithWhereWithoutOrganizationInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportTemplateScalarWhereInputSchema),z.lazy(() => ImportTemplateScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const OrganizationCreateNestedOneWithoutImportSessionsInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => OrganizationCreateWithoutImportSessionsInputSchema),z.lazy(() => OrganizationUncheckedCreateWithoutImportSessionsInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => OrganizationCreateOrConnectWithoutImportSessionsInputSchema).optional(), + connect: z.lazy(() => OrganizationWhereUniqueInputSchema).optional() +}).strict(); + +export const UserCreateNestedOneWithoutCreatedImportSessionsInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => UserCreateWithoutCreatedImportSessionsInputSchema),z.lazy(() => UserUncheckedCreateWithoutCreatedImportSessionsInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => UserCreateOrConnectWithoutCreatedImportSessionsInputSchema).optional(), + connect: z.lazy(() => UserWhereUniqueInputSchema).optional() +}).strict(); + +export const ImportRowCreateNestedManyWithoutSessionInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowCreateWithoutSessionInputSchema),z.lazy(() => ImportRowCreateWithoutSessionInputSchema).array(),z.lazy(() => ImportRowUncheckedCreateWithoutSessionInputSchema),z.lazy(() => ImportRowUncheckedCreateWithoutSessionInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowCreateOrConnectWithoutSessionInputSchema),z.lazy(() => ImportRowCreateOrConnectWithoutSessionInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowCreateManySessionInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportRowWhereUniqueInputSchema),z.lazy(() => ImportRowWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const ImportRowIssueCreateNestedManyWithoutSessionInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueCreateWithoutSessionInputSchema).array(),z.lazy(() => ImportRowIssueUncheckedCreateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutSessionInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowIssueCreateOrConnectWithoutSessionInputSchema),z.lazy(() => ImportRowIssueCreateOrConnectWithoutSessionInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowIssueCreateManySessionInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const ImportTemplateCreateNestedOneWithoutSessionsInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutSessionsInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutSessionsInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => ImportTemplateCreateOrConnectWithoutSessionsInputSchema).optional(), + connect: z.lazy(() => ImportTemplateWhereUniqueInputSchema).optional() +}).strict(); + +export const ImportRowUncheckedCreateNestedManyWithoutSessionInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowCreateWithoutSessionInputSchema),z.lazy(() => ImportRowCreateWithoutSessionInputSchema).array(),z.lazy(() => ImportRowUncheckedCreateWithoutSessionInputSchema),z.lazy(() => ImportRowUncheckedCreateWithoutSessionInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowCreateOrConnectWithoutSessionInputSchema),z.lazy(() => ImportRowCreateOrConnectWithoutSessionInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowCreateManySessionInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportRowWhereUniqueInputSchema),z.lazy(() => ImportRowWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const ImportRowIssueUncheckedCreateNestedManyWithoutSessionInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueCreateWithoutSessionInputSchema).array(),z.lazy(() => ImportRowIssueUncheckedCreateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutSessionInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowIssueCreateOrConnectWithoutSessionInputSchema),z.lazy(() => ImportRowIssueCreateOrConnectWithoutSessionInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowIssueCreateManySessionInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const IntFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.number().optional(), + increment: z.number().optional(), + decrement: z.number().optional(), + multiply: z.number().optional(), + divide: z.number().optional() +}).strict(); + +export const EnumImportModuleFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.lazy(() => ImportModuleSchema).optional() +}).strict(); + +export const EnumImportEntityTypeFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.lazy(() => ImportEntityTypeSchema).optional() +}).strict(); + +export const EnumImportStatusFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.lazy(() => ImportStatusSchema).optional() +}).strict(); + +export const EnumDedupeModeFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.lazy(() => DedupeModeSchema).optional() +}).strict(); + +export const NullableIntFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.number().optional().nullable(), + increment: z.number().optional(), + decrement: z.number().optional(), + multiply: z.number().optional(), + divide: z.number().optional() +}).strict(); + +export const NullableDateTimeFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.coerce.date().optional().nullable() +}).strict(); + +export const OrganizationUpdateOneRequiredWithoutImportSessionsNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => OrganizationCreateWithoutImportSessionsInputSchema),z.lazy(() => OrganizationUncheckedCreateWithoutImportSessionsInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => OrganizationCreateOrConnectWithoutImportSessionsInputSchema).optional(), + upsert: z.lazy(() => OrganizationUpsertWithoutImportSessionsInputSchema).optional(), + connect: z.lazy(() => OrganizationWhereUniqueInputSchema).optional(), + update: z.union([ z.lazy(() => OrganizationUpdateToOneWithWhereWithoutImportSessionsInputSchema),z.lazy(() => OrganizationUpdateWithoutImportSessionsInputSchema),z.lazy(() => OrganizationUncheckedUpdateWithoutImportSessionsInputSchema) ]).optional(), +}).strict(); + +export const UserUpdateOneRequiredWithoutCreatedImportSessionsNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => UserCreateWithoutCreatedImportSessionsInputSchema),z.lazy(() => UserUncheckedCreateWithoutCreatedImportSessionsInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => UserCreateOrConnectWithoutCreatedImportSessionsInputSchema).optional(), + upsert: z.lazy(() => UserUpsertWithoutCreatedImportSessionsInputSchema).optional(), + connect: z.lazy(() => UserWhereUniqueInputSchema).optional(), + update: z.union([ z.lazy(() => UserUpdateToOneWithWhereWithoutCreatedImportSessionsInputSchema),z.lazy(() => UserUpdateWithoutCreatedImportSessionsInputSchema),z.lazy(() => UserUncheckedUpdateWithoutCreatedImportSessionsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowUpdateManyWithoutSessionNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowCreateWithoutSessionInputSchema),z.lazy(() => ImportRowCreateWithoutSessionInputSchema).array(),z.lazy(() => ImportRowUncheckedCreateWithoutSessionInputSchema),z.lazy(() => ImportRowUncheckedCreateWithoutSessionInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowCreateOrConnectWithoutSessionInputSchema),z.lazy(() => ImportRowCreateOrConnectWithoutSessionInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportRowUpsertWithWhereUniqueWithoutSessionInputSchema),z.lazy(() => ImportRowUpsertWithWhereUniqueWithoutSessionInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowCreateManySessionInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportRowWhereUniqueInputSchema),z.lazy(() => ImportRowWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportRowWhereUniqueInputSchema),z.lazy(() => ImportRowWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportRowWhereUniqueInputSchema),z.lazy(() => ImportRowWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportRowWhereUniqueInputSchema),z.lazy(() => ImportRowWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportRowUpdateWithWhereUniqueWithoutSessionInputSchema),z.lazy(() => ImportRowUpdateWithWhereUniqueWithoutSessionInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportRowUpdateManyWithWhereWithoutSessionInputSchema),z.lazy(() => ImportRowUpdateManyWithWhereWithoutSessionInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportRowScalarWhereInputSchema),z.lazy(() => ImportRowScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportRowIssueUpdateManyWithoutSessionNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueCreateWithoutSessionInputSchema).array(),z.lazy(() => ImportRowIssueUncheckedCreateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutSessionInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowIssueCreateOrConnectWithoutSessionInputSchema),z.lazy(() => ImportRowIssueCreateOrConnectWithoutSessionInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportRowIssueUpsertWithWhereUniqueWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUpsertWithWhereUniqueWithoutSessionInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowIssueCreateManySessionInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportRowIssueUpdateWithWhereUniqueWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUpdateWithWhereUniqueWithoutSessionInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportRowIssueUpdateManyWithWhereWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUpdateManyWithWhereWithoutSessionInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportRowIssueScalarWhereInputSchema),z.lazy(() => ImportRowIssueScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportTemplateUpdateOneWithoutSessionsNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutSessionsInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutSessionsInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => ImportTemplateCreateOrConnectWithoutSessionsInputSchema).optional(), + upsert: z.lazy(() => ImportTemplateUpsertWithoutSessionsInputSchema).optional(), + disconnect: z.union([ z.boolean(),z.lazy(() => ImportTemplateWhereInputSchema) ]).optional(), + delete: z.union([ z.boolean(),z.lazy(() => ImportTemplateWhereInputSchema) ]).optional(), + connect: z.lazy(() => ImportTemplateWhereUniqueInputSchema).optional(), + update: z.union([ z.lazy(() => ImportTemplateUpdateToOneWithWhereWithoutSessionsInputSchema),z.lazy(() => ImportTemplateUpdateWithoutSessionsInputSchema),z.lazy(() => ImportTemplateUncheckedUpdateWithoutSessionsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowUncheckedUpdateManyWithoutSessionNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowCreateWithoutSessionInputSchema),z.lazy(() => ImportRowCreateWithoutSessionInputSchema).array(),z.lazy(() => ImportRowUncheckedCreateWithoutSessionInputSchema),z.lazy(() => ImportRowUncheckedCreateWithoutSessionInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowCreateOrConnectWithoutSessionInputSchema),z.lazy(() => ImportRowCreateOrConnectWithoutSessionInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportRowUpsertWithWhereUniqueWithoutSessionInputSchema),z.lazy(() => ImportRowUpsertWithWhereUniqueWithoutSessionInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowCreateManySessionInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportRowWhereUniqueInputSchema),z.lazy(() => ImportRowWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportRowWhereUniqueInputSchema),z.lazy(() => ImportRowWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportRowWhereUniqueInputSchema),z.lazy(() => ImportRowWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportRowWhereUniqueInputSchema),z.lazy(() => ImportRowWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportRowUpdateWithWhereUniqueWithoutSessionInputSchema),z.lazy(() => ImportRowUpdateWithWhereUniqueWithoutSessionInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportRowUpdateManyWithWhereWithoutSessionInputSchema),z.lazy(() => ImportRowUpdateManyWithWhereWithoutSessionInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportRowScalarWhereInputSchema),z.lazy(() => ImportRowScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportRowIssueUncheckedUpdateManyWithoutSessionNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueCreateWithoutSessionInputSchema).array(),z.lazy(() => ImportRowIssueUncheckedCreateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutSessionInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowIssueCreateOrConnectWithoutSessionInputSchema),z.lazy(() => ImportRowIssueCreateOrConnectWithoutSessionInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportRowIssueUpsertWithWhereUniqueWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUpsertWithWhereUniqueWithoutSessionInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowIssueCreateManySessionInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportRowIssueUpdateWithWhereUniqueWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUpdateWithWhereUniqueWithoutSessionInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportRowIssueUpdateManyWithWhereWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUpdateManyWithWhereWithoutSessionInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportRowIssueScalarWhereInputSchema),z.lazy(() => ImportRowIssueScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const OrganizationCreateNestedOneWithoutImportTemplatesInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => OrganizationCreateWithoutImportTemplatesInputSchema),z.lazy(() => OrganizationUncheckedCreateWithoutImportTemplatesInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => OrganizationCreateOrConnectWithoutImportTemplatesInputSchema).optional(), + connect: z.lazy(() => OrganizationWhereUniqueInputSchema).optional() +}).strict(); + +export const UserCreateNestedOneWithoutCreatedImportTemplatesInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => UserCreateWithoutCreatedImportTemplatesInputSchema),z.lazy(() => UserUncheckedCreateWithoutCreatedImportTemplatesInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => UserCreateOrConnectWithoutCreatedImportTemplatesInputSchema).optional(), + connect: z.lazy(() => UserWhereUniqueInputSchema).optional() +}).strict(); + +export const ImportSessionCreateNestedManyWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionCreateWithoutAppliedTemplateInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutAppliedTemplateInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyAppliedTemplateInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const ImportSessionUncheckedCreateNestedManyWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionCreateWithoutAppliedTemplateInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutAppliedTemplateInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyAppliedTemplateInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const OrganizationUpdateOneRequiredWithoutImportTemplatesNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => OrganizationCreateWithoutImportTemplatesInputSchema),z.lazy(() => OrganizationUncheckedCreateWithoutImportTemplatesInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => OrganizationCreateOrConnectWithoutImportTemplatesInputSchema).optional(), + upsert: z.lazy(() => OrganizationUpsertWithoutImportTemplatesInputSchema).optional(), + connect: z.lazy(() => OrganizationWhereUniqueInputSchema).optional(), + update: z.union([ z.lazy(() => OrganizationUpdateToOneWithWhereWithoutImportTemplatesInputSchema),z.lazy(() => OrganizationUpdateWithoutImportTemplatesInputSchema),z.lazy(() => OrganizationUncheckedUpdateWithoutImportTemplatesInputSchema) ]).optional(), +}).strict(); + +export const UserUpdateOneRequiredWithoutCreatedImportTemplatesNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => UserCreateWithoutCreatedImportTemplatesInputSchema),z.lazy(() => UserUncheckedCreateWithoutCreatedImportTemplatesInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => UserCreateOrConnectWithoutCreatedImportTemplatesInputSchema).optional(), + upsert: z.lazy(() => UserUpsertWithoutCreatedImportTemplatesInputSchema).optional(), + connect: z.lazy(() => UserWhereUniqueInputSchema).optional(), + update: z.union([ z.lazy(() => UserUpdateToOneWithWhereWithoutCreatedImportTemplatesInputSchema),z.lazy(() => UserUpdateWithoutCreatedImportTemplatesInputSchema),z.lazy(() => UserUncheckedUpdateWithoutCreatedImportTemplatesInputSchema) ]).optional(), +}).strict(); + +export const ImportSessionUpdateManyWithoutAppliedTemplateNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionCreateWithoutAppliedTemplateInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutAppliedTemplateInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutAppliedTemplateInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyAppliedTemplateInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutAppliedTemplateInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportSessionUpdateManyWithWhereWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUpdateManyWithWhereWithoutAppliedTemplateInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportSessionScalarWhereInputSchema),z.lazy(() => ImportSessionScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportSessionUncheckedUpdateManyWithoutAppliedTemplateNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionCreateWithoutAppliedTemplateInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutAppliedTemplateInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutAppliedTemplateInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyAppliedTemplateInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutAppliedTemplateInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportSessionUpdateManyWithWhereWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUpdateManyWithWhereWithoutAppliedTemplateInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportSessionScalarWhereInputSchema),z.lazy(() => ImportSessionScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportSessionCreateNestedOneWithoutRowsInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutRowsInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutRowsInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => ImportSessionCreateOrConnectWithoutRowsInputSchema).optional(), + connect: z.lazy(() => ImportSessionWhereUniqueInputSchema).optional() +}).strict(); + +export const ImportRowIssueCreateNestedManyWithoutRowInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutRowInputSchema),z.lazy(() => ImportRowIssueCreateWithoutRowInputSchema).array(),z.lazy(() => ImportRowIssueUncheckedCreateWithoutRowInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutRowInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowIssueCreateOrConnectWithoutRowInputSchema),z.lazy(() => ImportRowIssueCreateOrConnectWithoutRowInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowIssueCreateManyRowInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const ImportRowIssueUncheckedCreateNestedManyWithoutRowInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutRowInputSchema),z.lazy(() => ImportRowIssueCreateWithoutRowInputSchema).array(),z.lazy(() => ImportRowIssueUncheckedCreateWithoutRowInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutRowInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowIssueCreateOrConnectWithoutRowInputSchema),z.lazy(() => ImportRowIssueCreateOrConnectWithoutRowInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowIssueCreateManyRowInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const EnumRowStatusFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.lazy(() => RowStatusSchema).optional() +}).strict(); + +export const ImportSessionUpdateOneRequiredWithoutRowsNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutRowsInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutRowsInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => ImportSessionCreateOrConnectWithoutRowsInputSchema).optional(), + upsert: z.lazy(() => ImportSessionUpsertWithoutRowsInputSchema).optional(), + connect: z.lazy(() => ImportSessionWhereUniqueInputSchema).optional(), + update: z.union([ z.lazy(() => ImportSessionUpdateToOneWithWhereWithoutRowsInputSchema),z.lazy(() => ImportSessionUpdateWithoutRowsInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutRowsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowIssueUpdateManyWithoutRowNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutRowInputSchema),z.lazy(() => ImportRowIssueCreateWithoutRowInputSchema).array(),z.lazy(() => ImportRowIssueUncheckedCreateWithoutRowInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutRowInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowIssueCreateOrConnectWithoutRowInputSchema),z.lazy(() => ImportRowIssueCreateOrConnectWithoutRowInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportRowIssueUpsertWithWhereUniqueWithoutRowInputSchema),z.lazy(() => ImportRowIssueUpsertWithWhereUniqueWithoutRowInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowIssueCreateManyRowInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportRowIssueUpdateWithWhereUniqueWithoutRowInputSchema),z.lazy(() => ImportRowIssueUpdateWithWhereUniqueWithoutRowInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportRowIssueUpdateManyWithWhereWithoutRowInputSchema),z.lazy(() => ImportRowIssueUpdateManyWithWhereWithoutRowInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportRowIssueScalarWhereInputSchema),z.lazy(() => ImportRowIssueScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportRowIssueUncheckedUpdateManyWithoutRowNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutRowInputSchema),z.lazy(() => ImportRowIssueCreateWithoutRowInputSchema).array(),z.lazy(() => ImportRowIssueUncheckedCreateWithoutRowInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutRowInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportRowIssueCreateOrConnectWithoutRowInputSchema),z.lazy(() => ImportRowIssueCreateOrConnectWithoutRowInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportRowIssueUpsertWithWhereUniqueWithoutRowInputSchema),z.lazy(() => ImportRowIssueUpsertWithWhereUniqueWithoutRowInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportRowIssueCreateManyRowInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportRowIssueWhereUniqueInputSchema),z.lazy(() => ImportRowIssueWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportRowIssueUpdateWithWhereUniqueWithoutRowInputSchema),z.lazy(() => ImportRowIssueUpdateWithWhereUniqueWithoutRowInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportRowIssueUpdateManyWithWhereWithoutRowInputSchema),z.lazy(() => ImportRowIssueUpdateManyWithWhereWithoutRowInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportRowIssueScalarWhereInputSchema),z.lazy(() => ImportRowIssueScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportSessionCreateNestedOneWithoutIssuesInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutIssuesInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutIssuesInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => ImportSessionCreateOrConnectWithoutIssuesInputSchema).optional(), + connect: z.lazy(() => ImportSessionWhereUniqueInputSchema).optional() +}).strict(); + +export const ImportRowCreateNestedOneWithoutIssuesInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowCreateWithoutIssuesInputSchema),z.lazy(() => ImportRowUncheckedCreateWithoutIssuesInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => ImportRowCreateOrConnectWithoutIssuesInputSchema).optional(), + connect: z.lazy(() => ImportRowWhereUniqueInputSchema).optional() +}).strict(); + +export const EnumIssueSeverityFieldUpdateOperationsInputSchema: z.ZodType = z.object({ + set: z.lazy(() => IssueSeveritySchema).optional() +}).strict(); + +export const ImportSessionUpdateOneRequiredWithoutIssuesNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutIssuesInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutIssuesInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => ImportSessionCreateOrConnectWithoutIssuesInputSchema).optional(), + upsert: z.lazy(() => ImportSessionUpsertWithoutIssuesInputSchema).optional(), + connect: z.lazy(() => ImportSessionWhereUniqueInputSchema).optional(), + update: z.union([ z.lazy(() => ImportSessionUpdateToOneWithWhereWithoutIssuesInputSchema),z.lazy(() => ImportSessionUpdateWithoutIssuesInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutIssuesInputSchema) ]).optional(), +}).strict(); + +export const ImportRowUpdateOneRequiredWithoutIssuesNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportRowCreateWithoutIssuesInputSchema),z.lazy(() => ImportRowUncheckedCreateWithoutIssuesInputSchema) ]).optional(), + connectOrCreate: z.lazy(() => ImportRowCreateOrConnectWithoutIssuesInputSchema).optional(), + upsert: z.lazy(() => ImportRowUpsertWithoutIssuesInputSchema).optional(), + connect: z.lazy(() => ImportRowWhereUniqueInputSchema).optional(), + update: z.union([ z.lazy(() => ImportRowUpdateToOneWithWhereWithoutIssuesInputSchema),z.lazy(() => ImportRowUpdateWithoutIssuesInputSchema),z.lazy(() => ImportRowUncheckedUpdateWithoutIssuesInputSchema) ]).optional(), +}).strict(); + export const OrganizationCreateNestedOneWithoutUsersInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => OrganizationCreateWithoutUsersInputSchema),z.lazy(() => OrganizationUncheckedCreateWithoutUsersInputSchema) ]).optional(), connectOrCreate: z.lazy(() => OrganizationCreateOrConnectWithoutUsersInputSchema).optional(), @@ -26870,10 +28901,6 @@ export const EnumInteractionMediumFieldUpdateOperationsInputSchema: z.ZodType InteractionMediumSchema).optional() }).strict(); -export const NullableDateTimeFieldUpdateOperationsInputSchema: z.ZodType = z.object({ - set: z.coerce.date().optional().nullable() -}).strict(); - export const CustomerUpdateOneRequiredWithoutInteractionsNestedInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => CustomerCreateWithoutInteractionsInputSchema),z.lazy(() => CustomerUncheckedCreateWithoutInteractionsInputSchema) ]).optional(), connectOrCreate: z.lazy(() => CustomerCreateOrConnectWithoutInteractionsInputSchema).optional(), @@ -26928,14 +28955,6 @@ export const EnumLeadStatusFieldUpdateOperationsInputSchema: z.ZodType LeadStatusSchema).optional() }).strict(); -export const IntFieldUpdateOperationsInputSchema: z.ZodType = z.object({ - set: z.number().optional(), - increment: z.number().optional(), - decrement: z.number().optional(), - multiply: z.number().optional(), - divide: z.number().optional() -}).strict(); - export const NullableFloatFieldUpdateOperationsInputSchema: z.ZodType = z.object({ set: z.number().optional().nullable(), increment: z.number().optional(), @@ -27410,14 +29429,6 @@ export const TaskCreateNestedOneWithoutTimeEntriesInputSchema: z.ZodType TaskWhereUniqueInputSchema).optional() }).strict(); -export const NullableIntFieldUpdateOperationsInputSchema: z.ZodType = z.object({ - set: z.number().optional().nullable(), - increment: z.number().optional(), - decrement: z.number().optional(), - multiply: z.number().optional(), - divide: z.number().optional() -}).strict(); - export const ProjectUpdateOneWithoutTimeEntriesNestedInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => ProjectCreateWithoutTimeEntriesInputSchema),z.lazy(() => ProjectUncheckedCreateWithoutTimeEntriesInputSchema) ]).optional(), connectOrCreate: z.lazy(() => ProjectCreateOrConnectWithoutTimeEntriesInputSchema).optional(), @@ -28294,6 +30305,20 @@ export const AccountCreateNestedManyWithoutUserInputSchema: z.ZodType AccountWhereUniqueInputSchema),z.lazy(() => AccountWhereUniqueInputSchema).array() ]).optional(), }).strict(); +export const ImportSessionCreateNestedManyWithoutCreatedByInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionCreateWithoutCreatedByInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutCreatedByInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutCreatedByInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutCreatedByInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyCreatedByInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const ImportTemplateCreateNestedManyWithoutCreatedByInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateCreateWithoutCreatedByInputSchema).array(),z.lazy(() => ImportTemplateUncheckedCreateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutCreatedByInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportTemplateCreateOrConnectWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateCreateOrConnectWithoutCreatedByInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportTemplateCreateManyCreatedByInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + export const SessionUncheckedCreateNestedManyWithoutUserInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => SessionCreateWithoutUserInputSchema),z.lazy(() => SessionCreateWithoutUserInputSchema).array(),z.lazy(() => SessionUncheckedCreateWithoutUserInputSchema),z.lazy(() => SessionUncheckedCreateWithoutUserInputSchema).array() ]).optional(), connectOrCreate: z.union([ z.lazy(() => SessionCreateOrConnectWithoutUserInputSchema),z.lazy(() => SessionCreateOrConnectWithoutUserInputSchema).array() ]).optional(), @@ -28308,6 +30333,20 @@ export const AccountUncheckedCreateNestedManyWithoutUserInputSchema: z.ZodType

AccountWhereUniqueInputSchema),z.lazy(() => AccountWhereUniqueInputSchema).array() ]).optional(), }).strict(); +export const ImportSessionUncheckedCreateNestedManyWithoutCreatedByInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionCreateWithoutCreatedByInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutCreatedByInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutCreatedByInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutCreatedByInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyCreatedByInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + +export const ImportTemplateUncheckedCreateNestedManyWithoutCreatedByInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateCreateWithoutCreatedByInputSchema).array(),z.lazy(() => ImportTemplateUncheckedCreateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutCreatedByInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportTemplateCreateOrConnectWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateCreateOrConnectWithoutCreatedByInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportTemplateCreateManyCreatedByInputEnvelopeSchema).optional(), + connect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), +}).strict(); + export const SessionUpdateManyWithoutUserNestedInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => SessionCreateWithoutUserInputSchema),z.lazy(() => SessionCreateWithoutUserInputSchema).array(),z.lazy(() => SessionUncheckedCreateWithoutUserInputSchema),z.lazy(() => SessionUncheckedCreateWithoutUserInputSchema).array() ]).optional(), connectOrCreate: z.union([ z.lazy(() => SessionCreateOrConnectWithoutUserInputSchema),z.lazy(() => SessionCreateOrConnectWithoutUserInputSchema).array() ]).optional(), @@ -28336,6 +30375,34 @@ export const AccountUpdateManyWithoutUserNestedInputSchema: z.ZodType AccountScalarWhereInputSchema),z.lazy(() => AccountScalarWhereInputSchema).array() ]).optional(), }).strict(); +export const ImportSessionUpdateManyWithoutCreatedByNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionCreateWithoutCreatedByInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutCreatedByInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutCreatedByInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutCreatedByInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutCreatedByInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyCreatedByInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutCreatedByInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportSessionUpdateManyWithWhereWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUpdateManyWithWhereWithoutCreatedByInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportSessionScalarWhereInputSchema),z.lazy(() => ImportSessionScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportTemplateUpdateManyWithoutCreatedByNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateCreateWithoutCreatedByInputSchema).array(),z.lazy(() => ImportTemplateUncheckedCreateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutCreatedByInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportTemplateCreateOrConnectWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateCreateOrConnectWithoutCreatedByInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportTemplateUpsertWithWhereUniqueWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUpsertWithWhereUniqueWithoutCreatedByInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportTemplateCreateManyCreatedByInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportTemplateUpdateWithWhereUniqueWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUpdateWithWhereUniqueWithoutCreatedByInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportTemplateUpdateManyWithWhereWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUpdateManyWithWhereWithoutCreatedByInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportTemplateScalarWhereInputSchema),z.lazy(() => ImportTemplateScalarWhereInputSchema).array() ]).optional(), +}).strict(); + export const SessionUncheckedUpdateManyWithoutUserNestedInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => SessionCreateWithoutUserInputSchema),z.lazy(() => SessionCreateWithoutUserInputSchema).array(),z.lazy(() => SessionUncheckedCreateWithoutUserInputSchema),z.lazy(() => SessionUncheckedCreateWithoutUserInputSchema).array() ]).optional(), connectOrCreate: z.union([ z.lazy(() => SessionCreateOrConnectWithoutUserInputSchema),z.lazy(() => SessionCreateOrConnectWithoutUserInputSchema).array() ]).optional(), @@ -28364,6 +30431,34 @@ export const AccountUncheckedUpdateManyWithoutUserNestedInputSchema: z.ZodType

AccountScalarWhereInputSchema),z.lazy(() => AccountScalarWhereInputSchema).array() ]).optional(), }).strict(); +export const ImportSessionUncheckedUpdateManyWithoutCreatedByNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportSessionCreateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionCreateWithoutCreatedByInputSchema).array(),z.lazy(() => ImportSessionUncheckedCreateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutCreatedByInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportSessionCreateOrConnectWithoutCreatedByInputSchema),z.lazy(() => ImportSessionCreateOrConnectWithoutCreatedByInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUpsertWithWhereUniqueWithoutCreatedByInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportSessionCreateManyCreatedByInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportSessionWhereUniqueInputSchema),z.lazy(() => ImportSessionWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUpdateWithWhereUniqueWithoutCreatedByInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportSessionUpdateManyWithWhereWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUpdateManyWithWhereWithoutCreatedByInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportSessionScalarWhereInputSchema),z.lazy(() => ImportSessionScalarWhereInputSchema).array() ]).optional(), +}).strict(); + +export const ImportTemplateUncheckedUpdateManyWithoutCreatedByNestedInputSchema: z.ZodType = z.object({ + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateCreateWithoutCreatedByInputSchema).array(),z.lazy(() => ImportTemplateUncheckedCreateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutCreatedByInputSchema).array() ]).optional(), + connectOrCreate: z.union([ z.lazy(() => ImportTemplateCreateOrConnectWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateCreateOrConnectWithoutCreatedByInputSchema).array() ]).optional(), + upsert: z.union([ z.lazy(() => ImportTemplateUpsertWithWhereUniqueWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUpsertWithWhereUniqueWithoutCreatedByInputSchema).array() ]).optional(), + createMany: z.lazy(() => ImportTemplateCreateManyCreatedByInputEnvelopeSchema).optional(), + set: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + disconnect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + delete: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + connect: z.union([ z.lazy(() => ImportTemplateWhereUniqueInputSchema),z.lazy(() => ImportTemplateWhereUniqueInputSchema).array() ]).optional(), + update: z.union([ z.lazy(() => ImportTemplateUpdateWithWhereUniqueWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUpdateWithWhereUniqueWithoutCreatedByInputSchema).array() ]).optional(), + updateMany: z.union([ z.lazy(() => ImportTemplateUpdateManyWithWhereWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUpdateManyWithWhereWithoutCreatedByInputSchema).array() ]).optional(), + deleteMany: z.union([ z.lazy(() => ImportTemplateScalarWhereInputSchema),z.lazy(() => ImportTemplateScalarWhereInputSchema).array() ]).optional(), +}).strict(); + export const UserCreateNestedOneWithoutSessionsInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => UserCreateWithoutSessionsInputSchema),z.lazy(() => UserUncheckedCreateWithoutSessionsInputSchema) ]).optional(), connectOrCreate: z.lazy(() => UserCreateOrConnectWithoutSessionsInputSchema).optional(), @@ -30759,6 +32854,219 @@ export const NestedBoolWithAggregatesFilterSchema: z.ZodType NestedBoolFilterSchema).optional() }).strict(); +export const NestedEnumImportModuleFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportModuleSchema).optional(), + in: z.lazy(() => ImportModuleSchema).array().optional(), + notIn: z.lazy(() => ImportModuleSchema).array().optional(), + not: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => NestedEnumImportModuleFilterSchema) ]).optional(), +}).strict(); + +export const NestedEnumImportEntityTypeFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportEntityTypeSchema).optional(), + in: z.lazy(() => ImportEntityTypeSchema).array().optional(), + notIn: z.lazy(() => ImportEntityTypeSchema).array().optional(), + not: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => NestedEnumImportEntityTypeFilterSchema) ]).optional(), +}).strict(); + +export const NestedEnumImportStatusFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportStatusSchema).optional(), + in: z.lazy(() => ImportStatusSchema).array().optional(), + notIn: z.lazy(() => ImportStatusSchema).array().optional(), + not: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => NestedEnumImportStatusFilterSchema) ]).optional(), +}).strict(); + +export const NestedEnumDedupeModeFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => DedupeModeSchema).optional(), + in: z.lazy(() => DedupeModeSchema).array().optional(), + notIn: z.lazy(() => DedupeModeSchema).array().optional(), + not: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => NestedEnumDedupeModeFilterSchema) ]).optional(), +}).strict(); + +export const NestedDateTimeNullableFilterSchema: z.ZodType = z.object({ + equals: z.coerce.date().optional().nullable(), + in: z.coerce.date().array().optional().nullable(), + notIn: z.coerce.date().array().optional().nullable(), + lt: z.coerce.date().optional(), + lte: z.coerce.date().optional(), + gt: z.coerce.date().optional(), + gte: z.coerce.date().optional(), + not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableFilterSchema) ]).optional().nullable(), +}).strict(); + +export const NestedIntWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.number().optional(), + in: z.number().array().optional(), + notIn: z.number().array().optional(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedIntWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _avg: z.lazy(() => NestedFloatFilterSchema).optional(), + _sum: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedIntFilterSchema).optional(), + _max: z.lazy(() => NestedIntFilterSchema).optional() +}).strict(); + +export const NestedFloatFilterSchema: z.ZodType = z.object({ + equals: z.number().optional(), + in: z.number().array().optional(), + notIn: z.number().array().optional(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedFloatFilterSchema) ]).optional(), +}).strict(); + +export const NestedEnumImportModuleWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportModuleSchema).optional(), + in: z.lazy(() => ImportModuleSchema).array().optional(), + notIn: z.lazy(() => ImportModuleSchema).array().optional(), + not: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => NestedEnumImportModuleWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumImportModuleFilterSchema).optional(), + _max: z.lazy(() => NestedEnumImportModuleFilterSchema).optional() +}).strict(); + +export const NestedEnumImportEntityTypeWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportEntityTypeSchema).optional(), + in: z.lazy(() => ImportEntityTypeSchema).array().optional(), + notIn: z.lazy(() => ImportEntityTypeSchema).array().optional(), + not: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => NestedEnumImportEntityTypeWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumImportEntityTypeFilterSchema).optional(), + _max: z.lazy(() => NestedEnumImportEntityTypeFilterSchema).optional() +}).strict(); + +export const NestedEnumImportStatusWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => ImportStatusSchema).optional(), + in: z.lazy(() => ImportStatusSchema).array().optional(), + notIn: z.lazy(() => ImportStatusSchema).array().optional(), + not: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => NestedEnumImportStatusWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumImportStatusFilterSchema).optional(), + _max: z.lazy(() => NestedEnumImportStatusFilterSchema).optional() +}).strict(); + +export const NestedEnumDedupeModeWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => DedupeModeSchema).optional(), + in: z.lazy(() => DedupeModeSchema).array().optional(), + notIn: z.lazy(() => DedupeModeSchema).array().optional(), + not: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => NestedEnumDedupeModeWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumDedupeModeFilterSchema).optional(), + _max: z.lazy(() => NestedEnumDedupeModeFilterSchema).optional() +}).strict(); + +export const NestedJsonNullableFilterSchema: z.ZodType = z.object({ + equals: InputJsonValueSchema.optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValueSchema.optional().nullable(), + array_starts_with: InputJsonValueSchema.optional().nullable(), + array_ends_with: InputJsonValueSchema.optional().nullable(), + lt: InputJsonValueSchema.optional(), + lte: InputJsonValueSchema.optional(), + gt: InputJsonValueSchema.optional(), + gte: InputJsonValueSchema.optional(), + not: InputJsonValueSchema.optional() +}).strict(); + +export const NestedIntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.number().optional().nullable(), + in: z.number().array().optional().nullable(), + notIn: z.number().array().optional().nullable(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), + _sum: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _max: z.lazy(() => NestedIntNullableFilterSchema).optional() +}).strict(); + +export const NestedFloatNullableFilterSchema: z.ZodType = z.object({ + equals: z.number().optional().nullable(), + in: z.number().array().optional().nullable(), + notIn: z.number().array().optional().nullable(), + lt: z.number().optional(), + lte: z.number().optional(), + gt: z.number().optional(), + gte: z.number().optional(), + not: z.union([ z.number(),z.lazy(() => NestedFloatNullableFilterSchema) ]).optional().nullable(), +}).strict(); + +export const NestedDateTimeNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.coerce.date().optional().nullable(), + in: z.coerce.date().array().optional().nullable(), + notIn: z.coerce.date().array().optional().nullable(), + lt: z.coerce.date().optional(), + lte: z.coerce.date().optional(), + gt: z.coerce.date().optional(), + gte: z.coerce.date().optional(), + not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableWithAggregatesFilterSchema) ]).optional().nullable(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedDateTimeNullableFilterSchema).optional(), + _max: z.lazy(() => NestedDateTimeNullableFilterSchema).optional() +}).strict(); + +export const NestedJsonFilterSchema: z.ZodType = z.object({ + equals: InputJsonValueSchema.optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValueSchema.optional().nullable(), + array_starts_with: InputJsonValueSchema.optional().nullable(), + array_ends_with: InputJsonValueSchema.optional().nullable(), + lt: InputJsonValueSchema.optional(), + lte: InputJsonValueSchema.optional(), + gt: InputJsonValueSchema.optional(), + gte: InputJsonValueSchema.optional(), + not: InputJsonValueSchema.optional() +}).strict(); + +export const NestedEnumRowStatusFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => RowStatusSchema).optional(), + in: z.lazy(() => RowStatusSchema).array().optional(), + notIn: z.lazy(() => RowStatusSchema).array().optional(), + not: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => NestedEnumRowStatusFilterSchema) ]).optional(), +}).strict(); + +export const NestedEnumRowStatusWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => RowStatusSchema).optional(), + in: z.lazy(() => RowStatusSchema).array().optional(), + notIn: z.lazy(() => RowStatusSchema).array().optional(), + not: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => NestedEnumRowStatusWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumRowStatusFilterSchema).optional(), + _max: z.lazy(() => NestedEnumRowStatusFilterSchema).optional() +}).strict(); + +export const NestedEnumIssueSeverityFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => IssueSeveritySchema).optional(), + in: z.lazy(() => IssueSeveritySchema).array().optional(), + notIn: z.lazy(() => IssueSeveritySchema).array().optional(), + not: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => NestedEnumIssueSeverityFilterSchema) ]).optional(), +}).strict(); + +export const NestedEnumIssueSeverityWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.lazy(() => IssueSeveritySchema).optional(), + in: z.lazy(() => IssueSeveritySchema).array().optional(), + notIn: z.lazy(() => IssueSeveritySchema).array().optional(), + not: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => NestedEnumIssueSeverityWithAggregatesFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntFilterSchema).optional(), + _min: z.lazy(() => NestedEnumIssueSeverityFilterSchema).optional(), + _max: z.lazy(() => NestedEnumIssueSeverityFilterSchema).optional() +}).strict(); + export const NestedEnumUserRoleNullableFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => UserRoleSchema).optional().nullable(), in: z.lazy(() => UserRoleSchema).array().optional().nullable(), @@ -30841,17 +33149,6 @@ export const NestedEnumInteractionMediumFilterSchema: z.ZodType InteractionMediumSchema),z.lazy(() => NestedEnumInteractionMediumFilterSchema) ]).optional(), }).strict(); -export const NestedDateTimeNullableFilterSchema: z.ZodType = z.object({ - equals: z.coerce.date().optional().nullable(), - in: z.coerce.date().array().optional().nullable(), - notIn: z.coerce.date().array().optional().nullable(), - lt: z.coerce.date().optional(), - lte: z.coerce.date().optional(), - gt: z.coerce.date().optional(), - gte: z.coerce.date().optional(), - not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableFilterSchema) ]).optional().nullable(), -}).strict(); - export const NestedEnumInteractionTypeWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => InteractionTypeSchema).optional(), in: z.lazy(() => InteractionTypeSchema).array().optional(), @@ -30872,20 +33169,6 @@ export const NestedEnumInteractionMediumWithAggregatesFilterSchema: z.ZodType NestedEnumInteractionMediumFilterSchema).optional() }).strict(); -export const NestedDateTimeNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.coerce.date().optional().nullable(), - in: z.coerce.date().array().optional().nullable(), - notIn: z.coerce.date().array().optional().nullable(), - lt: z.coerce.date().optional(), - lte: z.coerce.date().optional(), - gt: z.coerce.date().optional(), - gte: z.coerce.date().optional(), - not: z.union([ z.coerce.date(),z.lazy(() => NestedDateTimeNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedDateTimeNullableFilterSchema).optional(), - _max: z.lazy(() => NestedDateTimeNullableFilterSchema).optional() -}).strict(); - export const NestedDecimalFilterSchema: z.ZodType = z.object({ equals: z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }).optional(), in: z.union([z.number().array(),z.string().array(),z.instanceof(Decimal).array(),z.instanceof(Prisma.Decimal).array(),DecimalJsLikeSchema.array(),]).refine((v) => Array.isArray(v) && (v as any[]).every((v) => isValidDecimalInput(v)), { message: 'Must be a Decimal' }).optional(), @@ -30904,17 +33187,6 @@ export const NestedEnumLeadStatusFilterSchema: z.ZodType LeadStatusSchema),z.lazy(() => NestedEnumLeadStatusFilterSchema) ]).optional(), }).strict(); -export const NestedFloatNullableFilterSchema: z.ZodType = z.object({ - equals: z.number().optional().nullable(), - in: z.number().array().optional().nullable(), - notIn: z.number().array().optional().nullable(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedFloatNullableFilterSchema) ]).optional().nullable(), -}).strict(); - export const NestedDecimalWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.union([z.number(),z.string(),z.instanceof(Decimal),z.instanceof(Prisma.Decimal),DecimalJsLikeSchema,]).refine((v) => isValidDecimalInput(v), { message: 'Must be a Decimal' }).optional(), in: z.union([z.number().array(),z.string().array(),z.instanceof(Decimal).array(),z.instanceof(Prisma.Decimal).array(),DecimalJsLikeSchema.array(),]).refine((v) => Array.isArray(v) && (v as any[]).every((v) => isValidDecimalInput(v)), { message: 'Must be a Decimal' }).optional(), @@ -30941,33 +33213,6 @@ export const NestedEnumLeadStatusWithAggregatesFilterSchema: z.ZodType NestedEnumLeadStatusFilterSchema).optional() }).strict(); -export const NestedIntWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.number().optional(), - in: z.number().array().optional(), - notIn: z.number().array().optional(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedIntWithAggregatesFilterSchema) ]).optional(), - _count: z.lazy(() => NestedIntFilterSchema).optional(), - _avg: z.lazy(() => NestedFloatFilterSchema).optional(), - _sum: z.lazy(() => NestedIntFilterSchema).optional(), - _min: z.lazy(() => NestedIntFilterSchema).optional(), - _max: z.lazy(() => NestedIntFilterSchema).optional() -}).strict(); - -export const NestedFloatFilterSchema: z.ZodType = z.object({ - equals: z.number().optional(), - in: z.number().array().optional(), - notIn: z.number().array().optional(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedFloatFilterSchema) ]).optional(), -}).strict(); - export const NestedFloatNullableWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.number().optional().nullable(), in: z.number().array().optional().nullable(), @@ -31062,22 +33307,6 @@ export const NestedEnumPriorityWithAggregatesFilterSchema: z.ZodType NestedEnumPriorityFilterSchema).optional() }).strict(); -export const NestedIntNullableWithAggregatesFilterSchema: z.ZodType = z.object({ - equals: z.number().optional().nullable(), - in: z.number().array().optional().nullable(), - notIn: z.number().array().optional().nullable(), - lt: z.number().optional(), - lte: z.number().optional(), - gt: z.number().optional(), - gte: z.number().optional(), - not: z.union([ z.number(),z.lazy(() => NestedIntNullableWithAggregatesFilterSchema) ]).optional().nullable(), - _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _avg: z.lazy(() => NestedFloatNullableFilterSchema).optional(), - _sum: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _min: z.lazy(() => NestedIntNullableFilterSchema).optional(), - _max: z.lazy(() => NestedIntNullableFilterSchema).optional() -}).strict(); - export const NestedEnumInvoiceStatusFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => InvoiceStatusSchema).optional(), in: z.lazy(() => InvoiceStatusSchema).array().optional(), @@ -31373,38 +33602,6 @@ export const NestedEnumFinancialReportTypeWithAggregatesFilterSchema: z.ZodType< _max: z.lazy(() => NestedEnumFinancialReportTypeFilterSchema).optional() }).strict(); -export const NestedJsonFilterSchema: z.ZodType = z.object({ - equals: InputJsonValueSchema.optional(), - path: z.string().array().optional(), - string_contains: z.string().optional(), - string_starts_with: z.string().optional(), - string_ends_with: z.string().optional(), - array_contains: InputJsonValueSchema.optional().nullable(), - array_starts_with: InputJsonValueSchema.optional().nullable(), - array_ends_with: InputJsonValueSchema.optional().nullable(), - lt: InputJsonValueSchema.optional(), - lte: InputJsonValueSchema.optional(), - gt: InputJsonValueSchema.optional(), - gte: InputJsonValueSchema.optional(), - not: InputJsonValueSchema.optional() -}).strict(); - -export const NestedJsonNullableFilterSchema: z.ZodType = z.object({ - equals: InputJsonValueSchema.optional(), - path: z.string().array().optional(), - string_contains: z.string().optional(), - string_starts_with: z.string().optional(), - string_ends_with: z.string().optional(), - array_contains: InputJsonValueSchema.optional().nullable(), - array_starts_with: InputJsonValueSchema.optional().nullable(), - array_ends_with: InputJsonValueSchema.optional().nullable(), - lt: InputJsonValueSchema.optional(), - lte: InputJsonValueSchema.optional(), - gt: InputJsonValueSchema.optional(), - gte: InputJsonValueSchema.optional(), - not: InputJsonValueSchema.optional() -}).strict(); - export const NestedEnumFinancialReportStatusWithAggregatesFilterSchema: z.ZodType = z.object({ equals: z.lazy(() => FinancialReportStatusSchema).optional(), in: z.lazy(() => FinancialReportStatusSchema).array().optional(), @@ -32059,7 +34256,9 @@ export const OrganizationCreateWithoutCustomRolesInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutCustomRolesInputSchema: z.ZodType = z.object({ @@ -32091,7 +34290,9 @@ export const OrganizationUncheckedCreateWithoutCustomRolesInputSchema: z.ZodType templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutCustomRolesInputSchema: z.ZodType = z.object({ @@ -32185,7 +34386,9 @@ export const OrganizationUpdateWithoutCustomRolesInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutCustomRolesInputSchema: z.ZodType = z.object({ @@ -32217,7 +34420,9 @@ export const OrganizationUncheckedUpdateWithoutCustomRolesInputSchema: z.ZodType templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const CustomRolePermissionUpsertWithWhereUniqueWithoutCustomRoleInputSchema: z.ZodType = z.object({ @@ -33457,6 +35662,108 @@ export const OrganizationUiConfigCreateManyOrganizationInputEnvelopeSchema: z.Zo skipDuplicates: z.boolean().optional() }).strict(); +export const ImportSessionCreateWithoutOrganizationInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + createdBy: z.lazy(() => UserCreateNestedOneWithoutCreatedImportSessionsInputSchema), + rows: z.lazy(() => ImportRowCreateNestedManyWithoutSessionInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueCreateNestedManyWithoutSessionInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateCreateNestedOneWithoutSessionsInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedCreateWithoutOrganizationInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + createdByUserId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + appliedTemplateId: z.string().optional().nullable(), + rows: z.lazy(() => ImportRowUncheckedCreateNestedManyWithoutSessionInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUncheckedCreateNestedManyWithoutSessionInputSchema).optional() +}).strict(); + +export const ImportSessionCreateOrConnectWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportSessionCreateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ImportSessionCreateManyOrganizationInputEnvelopeSchema: z.ZodType = z.object({ + data: z.union([ z.lazy(() => ImportSessionCreateManyOrganizationInputSchema),z.lazy(() => ImportSessionCreateManyOrganizationInputSchema).array() ]), + skipDuplicates: z.boolean().optional() +}).strict(); + +export const ImportTemplateCreateWithoutOrganizationInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + createdBy: z.lazy(() => UserCreateNestedOneWithoutCreatedImportTemplatesInputSchema), + sessions: z.lazy(() => ImportSessionCreateNestedManyWithoutAppliedTemplateInputSchema).optional() +}).strict(); + +export const ImportTemplateUncheckedCreateWithoutOrganizationInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + createdByUserId: z.string(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + sessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutAppliedTemplateInputSchema).optional() +}).strict(); + +export const ImportTemplateCreateOrConnectWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportTemplateWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ImportTemplateCreateManyOrganizationInputEnvelopeSchema: z.ZodType = z.object({ + data: z.union([ z.lazy(() => ImportTemplateCreateManyOrganizationInputSchema),z.lazy(() => ImportTemplateCreateManyOrganizationInputSchema).array() ]), + skipDuplicates: z.boolean().optional() +}).strict(); + export const UserOrganizationUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ where: z.lazy(() => UserOrganizationWhereUniqueInputSchema), update: z.union([ z.lazy(() => UserOrganizationUpdateWithoutOrganizationInputSchema),z.lazy(() => UserOrganizationUncheckedUpdateWithoutOrganizationInputSchema) ]), @@ -33930,341 +36237,1500 @@ export const FinancialReportScalarWhereInputSchema: z.ZodType DateTimeFilterSchema),z.coerce.date() ]).optional(), }).strict(); -export const WorkflowUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => WorkflowWhereUniqueInputSchema), - update: z.union([ z.lazy(() => WorkflowUpdateWithoutOrganizationInputSchema),z.lazy(() => WorkflowUncheckedUpdateWithoutOrganizationInputSchema) ]), - create: z.union([ z.lazy(() => WorkflowCreateWithoutOrganizationInputSchema),z.lazy(() => WorkflowUncheckedCreateWithoutOrganizationInputSchema) ]), +export const WorkflowUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => WorkflowWhereUniqueInputSchema), + update: z.union([ z.lazy(() => WorkflowUpdateWithoutOrganizationInputSchema),z.lazy(() => WorkflowUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => WorkflowCreateWithoutOrganizationInputSchema),z.lazy(() => WorkflowUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const WorkflowUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => WorkflowWhereUniqueInputSchema), + data: z.union([ z.lazy(() => WorkflowUpdateWithoutOrganizationInputSchema),z.lazy(() => WorkflowUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const WorkflowUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => WorkflowScalarWhereInputSchema), + data: z.union([ z.lazy(() => WorkflowUpdateManyMutationInputSchema),z.lazy(() => WorkflowUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const WorkflowScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => WorkflowScalarWhereInputSchema),z.lazy(() => WorkflowScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => WorkflowScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => WorkflowScalarWhereInputSchema),z.lazy(() => WorkflowScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + description: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + version: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + status: z.union([ z.lazy(() => EnumWorkflowStatusFilterSchema),z.lazy(() => WorkflowStatusSchema) ]).optional(), + isTemplate: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), + category: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + canvasData: z.lazy(() => JsonNullableFilterSchema).optional(), + retryConfig: z.lazy(() => JsonNullableFilterSchema).optional(), + timeoutConfig: z.lazy(() => JsonNullableFilterSchema).optional(), + totalExecutions: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + successfulExecutions: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + failedExecutions: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + lastExecutedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + createdById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + updatedById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + publishedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + publishedById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + archivedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const ActionTemplateUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ActionTemplateWhereUniqueInputSchema), + update: z.union([ z.lazy(() => ActionTemplateUpdateWithoutOrganizationInputSchema),z.lazy(() => ActionTemplateUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => ActionTemplateCreateWithoutOrganizationInputSchema),z.lazy(() => ActionTemplateUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ActionTemplateUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ActionTemplateWhereUniqueInputSchema), + data: z.union([ z.lazy(() => ActionTemplateUpdateWithoutOrganizationInputSchema),z.lazy(() => ActionTemplateUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ActionTemplateUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ActionTemplateScalarWhereInputSchema), + data: z.union([ z.lazy(() => ActionTemplateUpdateManyMutationInputSchema),z.lazy(() => ActionTemplateUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ActionTemplateScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ActionTemplateScalarWhereInputSchema),z.lazy(() => ActionTemplateScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ActionTemplateScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ActionTemplateScalarWhereInputSchema),z.lazy(() => ActionTemplateScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + description: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + category: z.union([ z.lazy(() => EnumActionTemplateCategoryFilterSchema),z.lazy(() => ActionTemplateCategorySchema) ]).optional(), + type: z.union([ z.lazy(() => EnumWorkflowNodeTypeFilterSchema),z.lazy(() => WorkflowNodeTypeSchema) ]).optional(), + template: z.lazy(() => JsonFilterSchema).optional(), + defaultConfig: z.lazy(() => JsonNullableFilterSchema).optional(), + schema: z.lazy(() => JsonNullableFilterSchema).optional(), + version: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + isPublic: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), + isActive: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), + usageCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + isLocked: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), + requiredVariables: z.lazy(() => JsonNullableFilterSchema).optional(), + optionalVariables: z.lazy(() => JsonNullableFilterSchema).optional(), + createdById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const VariableDefinitionUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => VariableDefinitionWhereUniqueInputSchema), + update: z.union([ z.lazy(() => VariableDefinitionUpdateWithoutOrganizationInputSchema),z.lazy(() => VariableDefinitionUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => VariableDefinitionCreateWithoutOrganizationInputSchema),z.lazy(() => VariableDefinitionUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const VariableDefinitionUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => VariableDefinitionWhereUniqueInputSchema), + data: z.union([ z.lazy(() => VariableDefinitionUpdateWithoutOrganizationInputSchema),z.lazy(() => VariableDefinitionUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const VariableDefinitionUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => VariableDefinitionScalarWhereInputSchema), + data: z.union([ z.lazy(() => VariableDefinitionUpdateManyMutationInputSchema),z.lazy(() => VariableDefinitionUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const VariableDefinitionScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => VariableDefinitionScalarWhereInputSchema),z.lazy(() => VariableDefinitionScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => VariableDefinitionScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => VariableDefinitionScalarWhereInputSchema),z.lazy(() => VariableDefinitionScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + displayName: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + description: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + category: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + dataType: z.union([ z.lazy(() => EnumVariableDataTypeFilterSchema),z.lazy(() => VariableDataTypeSchema) ]).optional(), + defaultValue: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + validation: z.lazy(() => JsonNullableFilterSchema).optional(), + formatting: z.lazy(() => JsonNullableFilterSchema).optional(), + isRequired: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), + isCustom: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), + scope: z.union([ z.lazy(() => EnumVariableScopeFilterSchema),z.lazy(() => VariableScopeSchema) ]).optional(), + moduleScope: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + createdById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const IntegrationConfigUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => IntegrationConfigWhereUniqueInputSchema), + update: z.union([ z.lazy(() => IntegrationConfigUpdateWithoutOrganizationInputSchema),z.lazy(() => IntegrationConfigUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => IntegrationConfigCreateWithoutOrganizationInputSchema),z.lazy(() => IntegrationConfigUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const IntegrationConfigUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => IntegrationConfigWhereUniqueInputSchema), + data: z.union([ z.lazy(() => IntegrationConfigUpdateWithoutOrganizationInputSchema),z.lazy(() => IntegrationConfigUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const IntegrationConfigUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => IntegrationConfigScalarWhereInputSchema), + data: z.union([ z.lazy(() => IntegrationConfigUpdateManyMutationInputSchema),z.lazy(() => IntegrationConfigUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const IntegrationConfigScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => IntegrationConfigScalarWhereInputSchema),z.lazy(() => IntegrationConfigScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => IntegrationConfigScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => IntegrationConfigScalarWhereInputSchema),z.lazy(() => IntegrationConfigScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + type: z.union([ z.lazy(() => EnumIntegrationTypeFilterSchema),z.lazy(() => IntegrationTypeSchema) ]).optional(), + config: z.lazy(() => JsonFilterSchema).optional(), + credentials: z.lazy(() => JsonNullableFilterSchema).optional(), + endpoints: z.lazy(() => JsonNullableFilterSchema).optional(), + isActive: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), + isHealthy: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), + lastHealthCheck: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + healthDetails: z.lazy(() => JsonNullableFilterSchema).optional(), + requestCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + errorCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + lastUsedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + createdById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const TemplatePackageUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplatePackageWhereUniqueInputSchema), + update: z.union([ z.lazy(() => TemplatePackageUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplatePackageUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => TemplatePackageCreateWithoutOrganizationInputSchema),z.lazy(() => TemplatePackageUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplatePackageUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplatePackageWhereUniqueInputSchema), + data: z.union([ z.lazy(() => TemplatePackageUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplatePackageUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplatePackageUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplatePackageScalarWhereInputSchema), + data: z.union([ z.lazy(() => TemplatePackageUpdateManyMutationInputSchema),z.lazy(() => TemplatePackageUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplatePackageScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => TemplatePackageScalarWhereInputSchema),z.lazy(() => TemplatePackageScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => TemplatePackageScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => TemplatePackageScalarWhereInputSchema),z.lazy(() => TemplatePackageScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + description: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + category: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + version: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + visibility: z.union([ z.lazy(() => EnumTemplateVisibilityFilterSchema),z.lazy(() => TemplateVisibilitySchema) ]).optional(), + status: z.union([ z.lazy(() => EnumTemplateStatusFilterSchema),z.lazy(() => TemplateStatusSchema) ]).optional(), + iconUrl: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + tags: z.lazy(() => JsonNullableFilterSchema).optional(), + manifest: z.lazy(() => JsonFilterSchema).optional(), + assetsCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + sizeBytes: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), + createdById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const TemplateInstallationUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplateInstallationWhereUniqueInputSchema), + update: z.union([ z.lazy(() => TemplateInstallationUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateInstallationUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => TemplateInstallationCreateWithoutOrganizationInputSchema),z.lazy(() => TemplateInstallationUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplateInstallationUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplateInstallationWhereUniqueInputSchema), + data: z.union([ z.lazy(() => TemplateInstallationUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateInstallationUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplateInstallationUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplateInstallationScalarWhereInputSchema), + data: z.union([ z.lazy(() => TemplateInstallationUpdateManyMutationInputSchema),z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplateInstallationScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => TemplateInstallationScalarWhereInputSchema),z.lazy(() => TemplateInstallationScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => TemplateInstallationScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => TemplateInstallationScalarWhereInputSchema),z.lazy(() => TemplateInstallationScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + templatePackageId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + templateVersionId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + status: z.union([ z.lazy(() => EnumTemplateInstallStatusFilterSchema),z.lazy(() => TemplateInstallStatusSchema) ]).optional(), + strategy: z.union([ z.lazy(() => EnumTemplateInstallStrategyFilterSchema),z.lazy(() => TemplateInstallStrategySchema) ]).optional(), + namePrefix: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + preflight: z.lazy(() => JsonNullableFilterSchema).optional(), + logs: z.lazy(() => JsonNullableFilterSchema).optional(), + error: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + createdById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + completedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), +}).strict(); + +export const TemplateShareUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplateShareWhereUniqueInputSchema), + update: z.union([ z.lazy(() => TemplateShareUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => TemplateShareCreateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplateShareUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplateShareWhereUniqueInputSchema), + data: z.union([ z.lazy(() => TemplateShareUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplateShareUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplateShareScalarWhereInputSchema), + data: z.union([ z.lazy(() => TemplateShareUpdateManyMutationInputSchema),z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplateShareScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => TemplateShareScalarWhereInputSchema),z.lazy(() => TemplateShareScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => TemplateShareScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => TemplateShareScalarWhereInputSchema),z.lazy(() => TemplateShareScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + templatePackageId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + name: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + shareMode: z.union([ z.lazy(() => EnumTemplateShareModeFilterSchema),z.lazy(() => TemplateShareModeSchema) ]).optional(), + tokenHash: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + expiresAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + maxUses: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), + allowExternal: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), + notes: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + status: z.union([ z.lazy(() => EnumTemplateShareStatusFilterSchema),z.lazy(() => TemplateShareStatusSchema) ]).optional(), + usageCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + lastAccessedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + revokedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + revokedById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + snapshotData: z.lazy(() => JsonFilterSchema).optional(), + snapshotVersion: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const TemplateShareImportUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplateShareImportWhereUniqueInputSchema), + update: z.union([ z.lazy(() => TemplateShareImportUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareImportUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => TemplateShareImportCreateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareImportUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplateShareImportUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplateShareImportWhereUniqueInputSchema), + data: z.union([ z.lazy(() => TemplateShareImportUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareImportUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplateShareImportUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => TemplateShareImportScalarWhereInputSchema), + data: z.union([ z.lazy(() => TemplateShareImportUpdateManyMutationInputSchema),z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const TemplateShareImportScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => TemplateShareImportScalarWhereInputSchema),z.lazy(() => TemplateShareImportScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => TemplateShareImportScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => TemplateShareImportScalarWhereInputSchema),z.lazy(() => TemplateShareImportScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + shareId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + templatePackageId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + importedById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + importedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + originalPackageId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + originalOrgId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + snapshotVersion: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), +}).strict(); + +export const OrganizationUiConfigUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => OrganizationUiConfigWhereUniqueInputSchema), + update: z.union([ z.lazy(() => OrganizationUiConfigUpdateWithoutOrganizationInputSchema),z.lazy(() => OrganizationUiConfigUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => OrganizationUiConfigCreateWithoutOrganizationInputSchema),z.lazy(() => OrganizationUiConfigUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const OrganizationUiConfigUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => OrganizationUiConfigWhereUniqueInputSchema), + data: z.union([ z.lazy(() => OrganizationUiConfigUpdateWithoutOrganizationInputSchema),z.lazy(() => OrganizationUiConfigUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const OrganizationUiConfigUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => OrganizationUiConfigScalarWhereInputSchema), + data: z.union([ z.lazy(() => OrganizationUiConfigUpdateManyMutationInputSchema),z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const OrganizationUiConfigScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => OrganizationUiConfigScalarWhereInputSchema),z.lazy(() => OrganizationUiConfigScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => OrganizationUiConfigScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => OrganizationUiConfigScalarWhereInputSchema),z.lazy(() => OrganizationUiConfigScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + key: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + config: z.lazy(() => JsonFilterSchema).optional(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const ImportSessionUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + update: z.union([ z.lazy(() => ImportSessionUpdateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => ImportSessionCreateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ImportSessionUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + data: z.union([ z.lazy(() => ImportSessionUpdateWithoutOrganizationInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ImportSessionUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionScalarWhereInputSchema), + data: z.union([ z.lazy(() => ImportSessionUpdateManyMutationInputSchema),z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ImportSessionScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportSessionScalarWhereInputSchema),z.lazy(() => ImportSessionScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportSessionScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportSessionScalarWhereInputSchema),z.lazy(() => ImportSessionScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdByUserId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + fileName: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + fileSize: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + fileType: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + module: z.union([ z.lazy(() => EnumImportModuleFilterSchema),z.lazy(() => ImportModuleSchema) ]).optional(), + entityType: z.union([ z.lazy(() => EnumImportEntityTypeFilterSchema),z.lazy(() => ImportEntityTypeSchema) ]).optional(), + status: z.union([ z.lazy(() => EnumImportStatusFilterSchema),z.lazy(() => ImportStatusSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => EnumDedupeModeFilterSchema),z.lazy(() => DedupeModeSchema) ]).optional(), + mappingConfig: z.lazy(() => JsonNullableFilterSchema).optional(), + summary: z.lazy(() => JsonNullableFilterSchema).optional(), + rowCount: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), + processedCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + successCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + failureCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + skippedCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + startedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + completedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + appliedTemplateId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), +}).strict(); + +export const ImportTemplateUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportTemplateWhereUniqueInputSchema), + update: z.union([ z.lazy(() => ImportTemplateUpdateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUncheckedUpdateWithoutOrganizationInputSchema) ]), + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ImportTemplateUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportTemplateWhereUniqueInputSchema), + data: z.union([ z.lazy(() => ImportTemplateUpdateWithoutOrganizationInputSchema),z.lazy(() => ImportTemplateUncheckedUpdateWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ImportTemplateUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportTemplateScalarWhereInputSchema), + data: z.union([ z.lazy(() => ImportTemplateUpdateManyMutationInputSchema),z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +}).strict(); + +export const ImportTemplateScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportTemplateScalarWhereInputSchema),z.lazy(() => ImportTemplateScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportTemplateScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportTemplateScalarWhereInputSchema),z.lazy(() => ImportTemplateScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + createdByUserId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + module: z.union([ z.lazy(() => EnumImportModuleFilterSchema),z.lazy(() => ImportModuleSchema) ]).optional(), + entityType: z.union([ z.lazy(() => EnumImportEntityTypeFilterSchema),z.lazy(() => ImportEntityTypeSchema) ]).optional(), + mappingConfig: z.lazy(() => JsonFilterSchema).optional(), + columnSignature: z.lazy(() => JsonFilterSchema).optional(), + usageCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + lastUsedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const OrganizationCreateWithoutImportSessionsInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + name: z.string(), + logo: z.string().optional().nullable(), + website: z.string().optional().nullable(), + industry: z.string().optional().nullable(), + description: z.string().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + users: z.lazy(() => UserOrganizationCreateNestedManyWithoutOrganizationInputSchema).optional(), + customers: z.lazy(() => CustomerCreateNestedManyWithoutOrganizationInputSchema).optional(), + projects: z.lazy(() => ProjectCreateNestedManyWithoutOrganizationInputSchema).optional(), + tasks: z.lazy(() => TaskCreateNestedManyWithoutOrganizationInputSchema).optional(), + invoices: z.lazy(() => InvoiceCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenses: z.lazy(() => ExpenseCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenseCategories: z.lazy(() => ExpenseCategoryCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenseTags: z.lazy(() => ExpenseTagCreateNestedManyWithoutOrganizationInputSchema).optional(), + employees: z.lazy(() => EmployeeCreateNestedManyWithoutOrganizationInputSchema).optional(), + campaigns: z.lazy(() => MarketingCampaignCreateNestedManyWithoutOrganizationInputSchema).optional(), + invitations: z.lazy(() => InvitationCreateNestedManyWithoutOrganizationInputSchema).optional(), + customRoles: z.lazy(() => CustomRoleCreateNestedManyWithoutOrganizationInputSchema).optional(), + financialReports: z.lazy(() => FinancialReportCreateNestedManyWithoutOrganizationInputSchema).optional(), + workflows: z.lazy(() => WorkflowCreateNestedManyWithoutOrganizationInputSchema).optional(), + actionTemplates: z.lazy(() => ActionTemplateCreateNestedManyWithoutOrganizationInputSchema).optional(), + variableDefinitions: z.lazy(() => VariableDefinitionCreateNestedManyWithoutOrganizationInputSchema).optional(), + integrationConfigs: z.lazy(() => IntegrationConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + templatePackages: z.lazy(() => TemplatePackageCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateInstallations: z.lazy(() => TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() +}).strict(); + +export const OrganizationUncheckedCreateWithoutImportSessionsInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + name: z.string(), + logo: z.string().optional().nullable(), + website: z.string().optional().nullable(), + industry: z.string().optional().nullable(), + description: z.string().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + users: z.lazy(() => UserOrganizationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + customers: z.lazy(() => CustomerUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + projects: z.lazy(() => ProjectUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + tasks: z.lazy(() => TaskUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + invoices: z.lazy(() => InvoiceUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenses: z.lazy(() => ExpenseUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenseCategories: z.lazy(() => ExpenseCategoryUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenseTags: z.lazy(() => ExpenseTagUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + employees: z.lazy(() => EmployeeUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + campaigns: z.lazy(() => MarketingCampaignUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + invitations: z.lazy(() => InvitationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + customRoles: z.lazy(() => CustomRoleUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + financialReports: z.lazy(() => FinancialReportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + workflows: z.lazy(() => WorkflowUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + actionTemplates: z.lazy(() => ActionTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + variableDefinitions: z.lazy(() => VariableDefinitionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + integrationConfigs: z.lazy(() => IntegrationConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + templatePackages: z.lazy(() => TemplatePackageUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() +}).strict(); + +export const OrganizationCreateOrConnectWithoutImportSessionsInputSchema: z.ZodType = z.object({ + where: z.lazy(() => OrganizationWhereUniqueInputSchema), + create: z.union([ z.lazy(() => OrganizationCreateWithoutImportSessionsInputSchema),z.lazy(() => OrganizationUncheckedCreateWithoutImportSessionsInputSchema) ]), +}).strict(); + +export const UserCreateWithoutCreatedImportSessionsInputSchema: z.ZodType = z.object({ + id: z.string(), + name: z.string(), + email: z.string(), + emailVerified: z.boolean(), + image: z.string().optional().nullable(), + createdAt: z.coerce.date(), + updatedAt: z.coerce.date(), + sessions: z.lazy(() => SessionCreateNestedManyWithoutUserInputSchema).optional(), + accounts: z.lazy(() => AccountCreateNestedManyWithoutUserInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutCreatedByInputSchema).optional() +}).strict(); + +export const UserUncheckedCreateWithoutCreatedImportSessionsInputSchema: z.ZodType = z.object({ + id: z.string(), + name: z.string(), + email: z.string(), + emailVerified: z.boolean(), + image: z.string().optional().nullable(), + createdAt: z.coerce.date(), + updatedAt: z.coerce.date(), + sessions: z.lazy(() => SessionUncheckedCreateNestedManyWithoutUserInputSchema).optional(), + accounts: z.lazy(() => AccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutCreatedByInputSchema).optional() +}).strict(); + +export const UserCreateOrConnectWithoutCreatedImportSessionsInputSchema: z.ZodType = z.object({ + where: z.lazy(() => UserWhereUniqueInputSchema), + create: z.union([ z.lazy(() => UserCreateWithoutCreatedImportSessionsInputSchema),z.lazy(() => UserUncheckedCreateWithoutCreatedImportSessionsInputSchema) ]), +}).strict(); + +export const ImportRowCreateWithoutSessionInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + rowNumber: z.number().int(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.lazy(() => RowStatusSchema).optional(), + dedupeHint: z.string().optional().nullable(), + score: z.number().int().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + issues: z.lazy(() => ImportRowIssueCreateNestedManyWithoutRowInputSchema).optional() +}).strict(); + +export const ImportRowUncheckedCreateWithoutSessionInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + rowNumber: z.number().int(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.lazy(() => RowStatusSchema).optional(), + dedupeHint: z.string().optional().nullable(), + score: z.number().int().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + issues: z.lazy(() => ImportRowIssueUncheckedCreateNestedManyWithoutRowInputSchema).optional() +}).strict(); + +export const ImportRowCreateOrConnectWithoutSessionInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportRowCreateWithoutSessionInputSchema),z.lazy(() => ImportRowUncheckedCreateWithoutSessionInputSchema) ]), +}).strict(); + +export const ImportRowCreateManySessionInputEnvelopeSchema: z.ZodType = z.object({ + data: z.union([ z.lazy(() => ImportRowCreateManySessionInputSchema),z.lazy(() => ImportRowCreateManySessionInputSchema).array() ]), + skipDuplicates: z.boolean().optional() +}).strict(); + +export const ImportRowIssueCreateWithoutSessionInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + field: z.string().optional().nullable(), + severity: z.lazy(() => IssueSeveritySchema), + message: z.string(), + hint: z.string().optional().nullable(), + value: z.string().optional().nullable(), + createdAt: z.coerce.date().optional(), + row: z.lazy(() => ImportRowCreateNestedOneWithoutIssuesInputSchema) +}).strict(); + +export const ImportRowIssueUncheckedCreateWithoutSessionInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + rowId: z.string(), + field: z.string().optional().nullable(), + severity: z.lazy(() => IssueSeveritySchema), + message: z.string(), + hint: z.string().optional().nullable(), + value: z.string().optional().nullable(), + createdAt: z.coerce.date().optional() +}).strict(); + +export const ImportRowIssueCreateOrConnectWithoutSessionInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowIssueWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutSessionInputSchema) ]), +}).strict(); + +export const ImportRowIssueCreateManySessionInputEnvelopeSchema: z.ZodType = z.object({ + data: z.union([ z.lazy(() => ImportRowIssueCreateManySessionInputSchema),z.lazy(() => ImportRowIssueCreateManySessionInputSchema).array() ]), + skipDuplicates: z.boolean().optional() +}).strict(); + +export const ImportTemplateCreateWithoutSessionsInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + organization: z.lazy(() => OrganizationCreateNestedOneWithoutImportTemplatesInputSchema), + createdBy: z.lazy(() => UserCreateNestedOneWithoutCreatedImportTemplatesInputSchema) +}).strict(); + +export const ImportTemplateUncheckedCreateWithoutSessionsInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + createdByUserId: z.string(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional() +}).strict(); + +export const ImportTemplateCreateOrConnectWithoutSessionsInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportTemplateWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutSessionsInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutSessionsInputSchema) ]), +}).strict(); + +export const OrganizationUpsertWithoutImportSessionsInputSchema: z.ZodType = z.object({ + update: z.union([ z.lazy(() => OrganizationUpdateWithoutImportSessionsInputSchema),z.lazy(() => OrganizationUncheckedUpdateWithoutImportSessionsInputSchema) ]), + create: z.union([ z.lazy(() => OrganizationCreateWithoutImportSessionsInputSchema),z.lazy(() => OrganizationUncheckedCreateWithoutImportSessionsInputSchema) ]), + where: z.lazy(() => OrganizationWhereInputSchema).optional() +}).strict(); + +export const OrganizationUpdateToOneWithWhereWithoutImportSessionsInputSchema: z.ZodType = z.object({ + where: z.lazy(() => OrganizationWhereInputSchema).optional(), + data: z.union([ z.lazy(() => OrganizationUpdateWithoutImportSessionsInputSchema),z.lazy(() => OrganizationUncheckedUpdateWithoutImportSessionsInputSchema) ]), +}).strict(); + +export const OrganizationUpdateWithoutImportSessionsInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + logo: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + website: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + industry: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + description: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + users: z.lazy(() => UserOrganizationUpdateManyWithoutOrganizationNestedInputSchema).optional(), + customers: z.lazy(() => CustomerUpdateManyWithoutOrganizationNestedInputSchema).optional(), + projects: z.lazy(() => ProjectUpdateManyWithoutOrganizationNestedInputSchema).optional(), + tasks: z.lazy(() => TaskUpdateManyWithoutOrganizationNestedInputSchema).optional(), + invoices: z.lazy(() => InvoiceUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenses: z.lazy(() => ExpenseUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenseCategories: z.lazy(() => ExpenseCategoryUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenseTags: z.lazy(() => ExpenseTagUpdateManyWithoutOrganizationNestedInputSchema).optional(), + employees: z.lazy(() => EmployeeUpdateManyWithoutOrganizationNestedInputSchema).optional(), + campaigns: z.lazy(() => MarketingCampaignUpdateManyWithoutOrganizationNestedInputSchema).optional(), + invitations: z.lazy(() => InvitationUpdateManyWithoutOrganizationNestedInputSchema).optional(), + customRoles: z.lazy(() => CustomRoleUpdateManyWithoutOrganizationNestedInputSchema).optional(), + financialReports: z.lazy(() => FinancialReportUpdateManyWithoutOrganizationNestedInputSchema).optional(), + workflows: z.lazy(() => WorkflowUpdateManyWithoutOrganizationNestedInputSchema).optional(), + actionTemplates: z.lazy(() => ActionTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional(), + variableDefinitions: z.lazy(() => VariableDefinitionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + integrationConfigs: z.lazy(() => IntegrationConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templatePackages: z.lazy(() => TemplatePackageUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateInstallations: z.lazy(() => TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() +}).strict(); + +export const OrganizationUncheckedUpdateWithoutImportSessionsInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + logo: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + website: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + industry: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + description: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + users: z.lazy(() => UserOrganizationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + customers: z.lazy(() => CustomerUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + projects: z.lazy(() => ProjectUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + tasks: z.lazy(() => TaskUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + invoices: z.lazy(() => InvoiceUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenses: z.lazy(() => ExpenseUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenseCategories: z.lazy(() => ExpenseCategoryUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenseTags: z.lazy(() => ExpenseTagUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + employees: z.lazy(() => EmployeeUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + campaigns: z.lazy(() => MarketingCampaignUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + invitations: z.lazy(() => InvitationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + customRoles: z.lazy(() => CustomRoleUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + financialReports: z.lazy(() => FinancialReportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + workflows: z.lazy(() => WorkflowUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + actionTemplates: z.lazy(() => ActionTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + variableDefinitions: z.lazy(() => VariableDefinitionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + integrationConfigs: z.lazy(() => IntegrationConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templatePackages: z.lazy(() => TemplatePackageUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() +}).strict(); + +export const UserUpsertWithoutCreatedImportSessionsInputSchema: z.ZodType = z.object({ + update: z.union([ z.lazy(() => UserUpdateWithoutCreatedImportSessionsInputSchema),z.lazy(() => UserUncheckedUpdateWithoutCreatedImportSessionsInputSchema) ]), + create: z.union([ z.lazy(() => UserCreateWithoutCreatedImportSessionsInputSchema),z.lazy(() => UserUncheckedCreateWithoutCreatedImportSessionsInputSchema) ]), + where: z.lazy(() => UserWhereInputSchema).optional() +}).strict(); + +export const UserUpdateToOneWithWhereWithoutCreatedImportSessionsInputSchema: z.ZodType = z.object({ + where: z.lazy(() => UserWhereInputSchema).optional(), + data: z.union([ z.lazy(() => UserUpdateWithoutCreatedImportSessionsInputSchema),z.lazy(() => UserUncheckedUpdateWithoutCreatedImportSessionsInputSchema) ]), +}).strict(); + +export const UserUpdateWithoutCreatedImportSessionsInputSchema: z.ZodType = z.object({ + id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + emailVerified: z.union([ z.boolean(),z.lazy(() => BoolFieldUpdateOperationsInputSchema) ]).optional(), + image: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + sessions: z.lazy(() => SessionUpdateManyWithoutUserNestedInputSchema).optional(), + accounts: z.lazy(() => AccountUpdateManyWithoutUserNestedInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutCreatedByNestedInputSchema).optional() +}).strict(); + +export const UserUncheckedUpdateWithoutCreatedImportSessionsInputSchema: z.ZodType = z.object({ + id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + emailVerified: z.union([ z.boolean(),z.lazy(() => BoolFieldUpdateOperationsInputSchema) ]).optional(), + image: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + sessions: z.lazy(() => SessionUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), + accounts: z.lazy(() => AccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutCreatedByNestedInputSchema).optional() +}).strict(); + +export const ImportRowUpsertWithWhereUniqueWithoutSessionInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowWhereUniqueInputSchema), + update: z.union([ z.lazy(() => ImportRowUpdateWithoutSessionInputSchema),z.lazy(() => ImportRowUncheckedUpdateWithoutSessionInputSchema) ]), + create: z.union([ z.lazy(() => ImportRowCreateWithoutSessionInputSchema),z.lazy(() => ImportRowUncheckedCreateWithoutSessionInputSchema) ]), +}).strict(); + +export const ImportRowUpdateWithWhereUniqueWithoutSessionInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowWhereUniqueInputSchema), + data: z.union([ z.lazy(() => ImportRowUpdateWithoutSessionInputSchema),z.lazy(() => ImportRowUncheckedUpdateWithoutSessionInputSchema) ]), +}).strict(); + +export const ImportRowUpdateManyWithWhereWithoutSessionInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowScalarWhereInputSchema), + data: z.union([ z.lazy(() => ImportRowUpdateManyMutationInputSchema),z.lazy(() => ImportRowUncheckedUpdateManyWithoutSessionInputSchema) ]), +}).strict(); + +export const ImportRowScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportRowScalarWhereInputSchema),z.lazy(() => ImportRowScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportRowScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportRowScalarWhereInputSchema),z.lazy(() => ImportRowScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + sessionId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + rowNumber: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), + rawData: z.lazy(() => JsonFilterSchema).optional(), + mappedData: z.lazy(() => JsonNullableFilterSchema).optional(), + status: z.union([ z.lazy(() => EnumRowStatusFilterSchema),z.lazy(() => RowStatusSchema) ]).optional(), + dedupeHint: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + score: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), + updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const ImportRowIssueUpsertWithWhereUniqueWithoutSessionInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowIssueWhereUniqueInputSchema), + update: z.union([ z.lazy(() => ImportRowIssueUpdateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUncheckedUpdateWithoutSessionInputSchema) ]), + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutSessionInputSchema) ]), +}).strict(); + +export const ImportRowIssueUpdateWithWhereUniqueWithoutSessionInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowIssueWhereUniqueInputSchema), + data: z.union([ z.lazy(() => ImportRowIssueUpdateWithoutSessionInputSchema),z.lazy(() => ImportRowIssueUncheckedUpdateWithoutSessionInputSchema) ]), +}).strict(); + +export const ImportRowIssueUpdateManyWithWhereWithoutSessionInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowIssueScalarWhereInputSchema), + data: z.union([ z.lazy(() => ImportRowIssueUpdateManyMutationInputSchema),z.lazy(() => ImportRowIssueUncheckedUpdateManyWithoutSessionInputSchema) ]), +}).strict(); + +export const ImportRowIssueScalarWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => ImportRowIssueScalarWhereInputSchema),z.lazy(() => ImportRowIssueScalarWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => ImportRowIssueScalarWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => ImportRowIssueScalarWhereInputSchema),z.lazy(() => ImportRowIssueScalarWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + sessionId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + rowId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + field: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + severity: z.union([ z.lazy(() => EnumIssueSeverityFilterSchema),z.lazy(() => IssueSeveritySchema) ]).optional(), + message: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + hint: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + value: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), + createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +}).strict(); + +export const ImportTemplateUpsertWithoutSessionsInputSchema: z.ZodType = z.object({ + update: z.union([ z.lazy(() => ImportTemplateUpdateWithoutSessionsInputSchema),z.lazy(() => ImportTemplateUncheckedUpdateWithoutSessionsInputSchema) ]), + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutSessionsInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutSessionsInputSchema) ]), + where: z.lazy(() => ImportTemplateWhereInputSchema).optional() +}).strict(); + +export const ImportTemplateUpdateToOneWithWhereWithoutSessionsInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportTemplateWhereInputSchema).optional(), + data: z.union([ z.lazy(() => ImportTemplateUpdateWithoutSessionsInputSchema),z.lazy(() => ImportTemplateUncheckedUpdateWithoutSessionsInputSchema) ]), +}).strict(); + +export const ImportTemplateUpdateWithoutSessionsInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + organization: z.lazy(() => OrganizationUpdateOneRequiredWithoutImportTemplatesNestedInputSchema).optional(), + createdBy: z.lazy(() => UserUpdateOneRequiredWithoutCreatedImportTemplatesNestedInputSchema).optional() +}).strict(); + +export const ImportTemplateUncheckedUpdateWithoutSessionsInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const OrganizationCreateWithoutImportTemplatesInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + name: z.string(), + logo: z.string().optional().nullable(), + website: z.string().optional().nullable(), + industry: z.string().optional().nullable(), + description: z.string().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + users: z.lazy(() => UserOrganizationCreateNestedManyWithoutOrganizationInputSchema).optional(), + customers: z.lazy(() => CustomerCreateNestedManyWithoutOrganizationInputSchema).optional(), + projects: z.lazy(() => ProjectCreateNestedManyWithoutOrganizationInputSchema).optional(), + tasks: z.lazy(() => TaskCreateNestedManyWithoutOrganizationInputSchema).optional(), + invoices: z.lazy(() => InvoiceCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenses: z.lazy(() => ExpenseCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenseCategories: z.lazy(() => ExpenseCategoryCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenseTags: z.lazy(() => ExpenseTagCreateNestedManyWithoutOrganizationInputSchema).optional(), + employees: z.lazy(() => EmployeeCreateNestedManyWithoutOrganizationInputSchema).optional(), + campaigns: z.lazy(() => MarketingCampaignCreateNestedManyWithoutOrganizationInputSchema).optional(), + invitations: z.lazy(() => InvitationCreateNestedManyWithoutOrganizationInputSchema).optional(), + customRoles: z.lazy(() => CustomRoleCreateNestedManyWithoutOrganizationInputSchema).optional(), + financialReports: z.lazy(() => FinancialReportCreateNestedManyWithoutOrganizationInputSchema).optional(), + workflows: z.lazy(() => WorkflowCreateNestedManyWithoutOrganizationInputSchema).optional(), + actionTemplates: z.lazy(() => ActionTemplateCreateNestedManyWithoutOrganizationInputSchema).optional(), + variableDefinitions: z.lazy(() => VariableDefinitionCreateNestedManyWithoutOrganizationInputSchema).optional(), + integrationConfigs: z.lazy(() => IntegrationConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + templatePackages: z.lazy(() => TemplatePackageCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateInstallations: z.lazy(() => TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional() +}).strict(); + +export const OrganizationUncheckedCreateWithoutImportTemplatesInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + name: z.string(), + logo: z.string().optional().nullable(), + website: z.string().optional().nullable(), + industry: z.string().optional().nullable(), + description: z.string().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + users: z.lazy(() => UserOrganizationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + customers: z.lazy(() => CustomerUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + projects: z.lazy(() => ProjectUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + tasks: z.lazy(() => TaskUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + invoices: z.lazy(() => InvoiceUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenses: z.lazy(() => ExpenseUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenseCategories: z.lazy(() => ExpenseCategoryUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + expenseTags: z.lazy(() => ExpenseTagUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + employees: z.lazy(() => EmployeeUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + campaigns: z.lazy(() => MarketingCampaignUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + invitations: z.lazy(() => InvitationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + customRoles: z.lazy(() => CustomRoleUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + financialReports: z.lazy(() => FinancialReportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + workflows: z.lazy(() => WorkflowUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + actionTemplates: z.lazy(() => ActionTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + variableDefinitions: z.lazy(() => VariableDefinitionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + integrationConfigs: z.lazy(() => IntegrationConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + templatePackages: z.lazy(() => TemplatePackageUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() +}).strict(); + +export const OrganizationCreateOrConnectWithoutImportTemplatesInputSchema: z.ZodType = z.object({ + where: z.lazy(() => OrganizationWhereUniqueInputSchema), + create: z.union([ z.lazy(() => OrganizationCreateWithoutImportTemplatesInputSchema),z.lazy(() => OrganizationUncheckedCreateWithoutImportTemplatesInputSchema) ]), +}).strict(); + +export const UserCreateWithoutCreatedImportTemplatesInputSchema: z.ZodType = z.object({ + id: z.string(), + name: z.string(), + email: z.string(), + emailVerified: z.boolean(), + image: z.string().optional().nullable(), + createdAt: z.coerce.date(), + updatedAt: z.coerce.date(), + sessions: z.lazy(() => SessionCreateNestedManyWithoutUserInputSchema).optional(), + accounts: z.lazy(() => AccountCreateNestedManyWithoutUserInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutCreatedByInputSchema).optional() +}).strict(); + +export const UserUncheckedCreateWithoutCreatedImportTemplatesInputSchema: z.ZodType = z.object({ + id: z.string(), + name: z.string(), + email: z.string(), + emailVerified: z.boolean(), + image: z.string().optional().nullable(), + createdAt: z.coerce.date(), + updatedAt: z.coerce.date(), + sessions: z.lazy(() => SessionUncheckedCreateNestedManyWithoutUserInputSchema).optional(), + accounts: z.lazy(() => AccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutCreatedByInputSchema).optional() +}).strict(); + +export const UserCreateOrConnectWithoutCreatedImportTemplatesInputSchema: z.ZodType = z.object({ + where: z.lazy(() => UserWhereUniqueInputSchema), + create: z.union([ z.lazy(() => UserCreateWithoutCreatedImportTemplatesInputSchema),z.lazy(() => UserUncheckedCreateWithoutCreatedImportTemplatesInputSchema) ]), +}).strict(); + +export const ImportSessionCreateWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + organization: z.lazy(() => OrganizationCreateNestedOneWithoutImportSessionsInputSchema), + createdBy: z.lazy(() => UserCreateNestedOneWithoutCreatedImportSessionsInputSchema), + rows: z.lazy(() => ImportRowCreateNestedManyWithoutSessionInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueCreateNestedManyWithoutSessionInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + createdByUserId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + rows: z.lazy(() => ImportRowUncheckedCreateNestedManyWithoutSessionInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUncheckedCreateNestedManyWithoutSessionInputSchema).optional() +}).strict(); + +export const ImportSessionCreateOrConnectWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportSessionCreateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema) ]), +}).strict(); + +export const ImportSessionCreateManyAppliedTemplateInputEnvelopeSchema: z.ZodType = z.object({ + data: z.union([ z.lazy(() => ImportSessionCreateManyAppliedTemplateInputSchema),z.lazy(() => ImportSessionCreateManyAppliedTemplateInputSchema).array() ]), + skipDuplicates: z.boolean().optional() +}).strict(); + +export const OrganizationUpsertWithoutImportTemplatesInputSchema: z.ZodType = z.object({ + update: z.union([ z.lazy(() => OrganizationUpdateWithoutImportTemplatesInputSchema),z.lazy(() => OrganizationUncheckedUpdateWithoutImportTemplatesInputSchema) ]), + create: z.union([ z.lazy(() => OrganizationCreateWithoutImportTemplatesInputSchema),z.lazy(() => OrganizationUncheckedCreateWithoutImportTemplatesInputSchema) ]), + where: z.lazy(() => OrganizationWhereInputSchema).optional() +}).strict(); + +export const OrganizationUpdateToOneWithWhereWithoutImportTemplatesInputSchema: z.ZodType = z.object({ + where: z.lazy(() => OrganizationWhereInputSchema).optional(), + data: z.union([ z.lazy(() => OrganizationUpdateWithoutImportTemplatesInputSchema),z.lazy(() => OrganizationUncheckedUpdateWithoutImportTemplatesInputSchema) ]), }).strict(); -export const WorkflowUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => WorkflowWhereUniqueInputSchema), - data: z.union([ z.lazy(() => WorkflowUpdateWithoutOrganizationInputSchema),z.lazy(() => WorkflowUncheckedUpdateWithoutOrganizationInputSchema) ]), +export const OrganizationUpdateWithoutImportTemplatesInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + logo: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + website: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + industry: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + description: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + users: z.lazy(() => UserOrganizationUpdateManyWithoutOrganizationNestedInputSchema).optional(), + customers: z.lazy(() => CustomerUpdateManyWithoutOrganizationNestedInputSchema).optional(), + projects: z.lazy(() => ProjectUpdateManyWithoutOrganizationNestedInputSchema).optional(), + tasks: z.lazy(() => TaskUpdateManyWithoutOrganizationNestedInputSchema).optional(), + invoices: z.lazy(() => InvoiceUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenses: z.lazy(() => ExpenseUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenseCategories: z.lazy(() => ExpenseCategoryUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenseTags: z.lazy(() => ExpenseTagUpdateManyWithoutOrganizationNestedInputSchema).optional(), + employees: z.lazy(() => EmployeeUpdateManyWithoutOrganizationNestedInputSchema).optional(), + campaigns: z.lazy(() => MarketingCampaignUpdateManyWithoutOrganizationNestedInputSchema).optional(), + invitations: z.lazy(() => InvitationUpdateManyWithoutOrganizationNestedInputSchema).optional(), + customRoles: z.lazy(() => CustomRoleUpdateManyWithoutOrganizationNestedInputSchema).optional(), + financialReports: z.lazy(() => FinancialReportUpdateManyWithoutOrganizationNestedInputSchema).optional(), + workflows: z.lazy(() => WorkflowUpdateManyWithoutOrganizationNestedInputSchema).optional(), + actionTemplates: z.lazy(() => ActionTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional(), + variableDefinitions: z.lazy(() => VariableDefinitionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + integrationConfigs: z.lazy(() => IntegrationConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templatePackages: z.lazy(() => TemplatePackageUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateInstallations: z.lazy(() => TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); -export const WorkflowUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => WorkflowScalarWhereInputSchema), - data: z.union([ z.lazy(() => WorkflowUpdateManyMutationInputSchema),z.lazy(() => WorkflowUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +export const OrganizationUncheckedUpdateWithoutImportTemplatesInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + logo: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + website: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + industry: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + description: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + users: z.lazy(() => UserOrganizationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + customers: z.lazy(() => CustomerUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + projects: z.lazy(() => ProjectUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + tasks: z.lazy(() => TaskUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + invoices: z.lazy(() => InvoiceUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenses: z.lazy(() => ExpenseUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenseCategories: z.lazy(() => ExpenseCategoryUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + expenseTags: z.lazy(() => ExpenseTagUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + employees: z.lazy(() => EmployeeUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + campaigns: z.lazy(() => MarketingCampaignUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + invitations: z.lazy(() => InvitationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + customRoles: z.lazy(() => CustomRoleUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + financialReports: z.lazy(() => FinancialReportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + workflows: z.lazy(() => WorkflowUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + actionTemplates: z.lazy(() => ActionTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + variableDefinitions: z.lazy(() => VariableDefinitionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + integrationConfigs: z.lazy(() => IntegrationConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templatePackages: z.lazy(() => TemplatePackageUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); -export const WorkflowScalarWhereInputSchema: z.ZodType = z.object({ - AND: z.union([ z.lazy(() => WorkflowScalarWhereInputSchema),z.lazy(() => WorkflowScalarWhereInputSchema).array() ]).optional(), - OR: z.lazy(() => WorkflowScalarWhereInputSchema).array().optional(), - NOT: z.union([ z.lazy(() => WorkflowScalarWhereInputSchema),z.lazy(() => WorkflowScalarWhereInputSchema).array() ]).optional(), - id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - description: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - version: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), - status: z.union([ z.lazy(() => EnumWorkflowStatusFilterSchema),z.lazy(() => WorkflowStatusSchema) ]).optional(), - isTemplate: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), - category: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - canvasData: z.lazy(() => JsonNullableFilterSchema).optional(), - retryConfig: z.lazy(() => JsonNullableFilterSchema).optional(), - timeoutConfig: z.lazy(() => JsonNullableFilterSchema).optional(), - totalExecutions: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), - successfulExecutions: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), - failedExecutions: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), - lastExecutedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), - createdById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - updatedById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - publishedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), - publishedById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - archivedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), - createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), - updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +export const UserUpsertWithoutCreatedImportTemplatesInputSchema: z.ZodType = z.object({ + update: z.union([ z.lazy(() => UserUpdateWithoutCreatedImportTemplatesInputSchema),z.lazy(() => UserUncheckedUpdateWithoutCreatedImportTemplatesInputSchema) ]), + create: z.union([ z.lazy(() => UserCreateWithoutCreatedImportTemplatesInputSchema),z.lazy(() => UserUncheckedCreateWithoutCreatedImportTemplatesInputSchema) ]), + where: z.lazy(() => UserWhereInputSchema).optional() }).strict(); -export const ActionTemplateUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => ActionTemplateWhereUniqueInputSchema), - update: z.union([ z.lazy(() => ActionTemplateUpdateWithoutOrganizationInputSchema),z.lazy(() => ActionTemplateUncheckedUpdateWithoutOrganizationInputSchema) ]), - create: z.union([ z.lazy(() => ActionTemplateCreateWithoutOrganizationInputSchema),z.lazy(() => ActionTemplateUncheckedCreateWithoutOrganizationInputSchema) ]), +export const UserUpdateToOneWithWhereWithoutCreatedImportTemplatesInputSchema: z.ZodType = z.object({ + where: z.lazy(() => UserWhereInputSchema).optional(), + data: z.union([ z.lazy(() => UserUpdateWithoutCreatedImportTemplatesInputSchema),z.lazy(() => UserUncheckedUpdateWithoutCreatedImportTemplatesInputSchema) ]), }).strict(); -export const ActionTemplateUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => ActionTemplateWhereUniqueInputSchema), - data: z.union([ z.lazy(() => ActionTemplateUpdateWithoutOrganizationInputSchema),z.lazy(() => ActionTemplateUncheckedUpdateWithoutOrganizationInputSchema) ]), +export const UserUpdateWithoutCreatedImportTemplatesInputSchema: z.ZodType = z.object({ + id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + emailVerified: z.union([ z.boolean(),z.lazy(() => BoolFieldUpdateOperationsInputSchema) ]).optional(), + image: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + sessions: z.lazy(() => SessionUpdateManyWithoutUserNestedInputSchema).optional(), + accounts: z.lazy(() => AccountUpdateManyWithoutUserNestedInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUpdateManyWithoutCreatedByNestedInputSchema).optional() }).strict(); -export const ActionTemplateUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => ActionTemplateScalarWhereInputSchema), - data: z.union([ z.lazy(() => ActionTemplateUpdateManyMutationInputSchema),z.lazy(() => ActionTemplateUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +export const UserUncheckedUpdateWithoutCreatedImportTemplatesInputSchema: z.ZodType = z.object({ + id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + email: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + emailVerified: z.union([ z.boolean(),z.lazy(() => BoolFieldUpdateOperationsInputSchema) ]).optional(), + image: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + sessions: z.lazy(() => SessionUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), + accounts: z.lazy(() => AccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutCreatedByNestedInputSchema).optional() }).strict(); -export const ActionTemplateScalarWhereInputSchema: z.ZodType = z.object({ - AND: z.union([ z.lazy(() => ActionTemplateScalarWhereInputSchema),z.lazy(() => ActionTemplateScalarWhereInputSchema).array() ]).optional(), - OR: z.lazy(() => ActionTemplateScalarWhereInputSchema).array().optional(), - NOT: z.union([ z.lazy(() => ActionTemplateScalarWhereInputSchema),z.lazy(() => ActionTemplateScalarWhereInputSchema).array() ]).optional(), - id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - organizationId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - description: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - category: z.union([ z.lazy(() => EnumActionTemplateCategoryFilterSchema),z.lazy(() => ActionTemplateCategorySchema) ]).optional(), - type: z.union([ z.lazy(() => EnumWorkflowNodeTypeFilterSchema),z.lazy(() => WorkflowNodeTypeSchema) ]).optional(), - template: z.lazy(() => JsonFilterSchema).optional(), - defaultConfig: z.lazy(() => JsonNullableFilterSchema).optional(), - schema: z.lazy(() => JsonNullableFilterSchema).optional(), - version: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - isPublic: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), - isActive: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), - usageCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), - isLocked: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), - requiredVariables: z.lazy(() => JsonNullableFilterSchema).optional(), - optionalVariables: z.lazy(() => JsonNullableFilterSchema).optional(), - createdById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), - updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +export const ImportSessionUpsertWithWhereUniqueWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + update: z.union([ z.lazy(() => ImportSessionUpdateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutAppliedTemplateInputSchema) ]), + create: z.union([ z.lazy(() => ImportSessionCreateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutAppliedTemplateInputSchema) ]), }).strict(); -export const VariableDefinitionUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => VariableDefinitionWhereUniqueInputSchema), - update: z.union([ z.lazy(() => VariableDefinitionUpdateWithoutOrganizationInputSchema),z.lazy(() => VariableDefinitionUncheckedUpdateWithoutOrganizationInputSchema) ]), - create: z.union([ z.lazy(() => VariableDefinitionCreateWithoutOrganizationInputSchema),z.lazy(() => VariableDefinitionUncheckedCreateWithoutOrganizationInputSchema) ]), +export const ImportSessionUpdateWithWhereUniqueWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + data: z.union([ z.lazy(() => ImportSessionUpdateWithoutAppliedTemplateInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutAppliedTemplateInputSchema) ]), }).strict(); -export const VariableDefinitionUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => VariableDefinitionWhereUniqueInputSchema), - data: z.union([ z.lazy(() => VariableDefinitionUpdateWithoutOrganizationInputSchema),z.lazy(() => VariableDefinitionUncheckedUpdateWithoutOrganizationInputSchema) ]), +export const ImportSessionUpdateManyWithWhereWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionScalarWhereInputSchema), + data: z.union([ z.lazy(() => ImportSessionUpdateManyMutationInputSchema),z.lazy(() => ImportSessionUncheckedUpdateManyWithoutAppliedTemplateInputSchema) ]), }).strict(); -export const VariableDefinitionUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => VariableDefinitionScalarWhereInputSchema), - data: z.union([ z.lazy(() => VariableDefinitionUpdateManyMutationInputSchema),z.lazy(() => VariableDefinitionUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +export const ImportSessionCreateWithoutRowsInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + organization: z.lazy(() => OrganizationCreateNestedOneWithoutImportSessionsInputSchema), + createdBy: z.lazy(() => UserCreateNestedOneWithoutCreatedImportSessionsInputSchema), + issues: z.lazy(() => ImportRowIssueCreateNestedManyWithoutSessionInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateCreateNestedOneWithoutSessionsInputSchema).optional() }).strict(); -export const VariableDefinitionScalarWhereInputSchema: z.ZodType = z.object({ - AND: z.union([ z.lazy(() => VariableDefinitionScalarWhereInputSchema),z.lazy(() => VariableDefinitionScalarWhereInputSchema).array() ]).optional(), - OR: z.lazy(() => VariableDefinitionScalarWhereInputSchema).array().optional(), - NOT: z.union([ z.lazy(() => VariableDefinitionScalarWhereInputSchema),z.lazy(() => VariableDefinitionScalarWhereInputSchema).array() ]).optional(), - id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - organizationId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - displayName: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - description: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - category: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - dataType: z.union([ z.lazy(() => EnumVariableDataTypeFilterSchema),z.lazy(() => VariableDataTypeSchema) ]).optional(), - defaultValue: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - validation: z.lazy(() => JsonNullableFilterSchema).optional(), - formatting: z.lazy(() => JsonNullableFilterSchema).optional(), - isRequired: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), - isCustom: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), - scope: z.union([ z.lazy(() => EnumVariableScopeFilterSchema),z.lazy(() => VariableScopeSchema) ]).optional(), - moduleScope: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - createdById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), - updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +export const ImportSessionUncheckedCreateWithoutRowsInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + createdByUserId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + appliedTemplateId: z.string().optional().nullable(), + issues: z.lazy(() => ImportRowIssueUncheckedCreateNestedManyWithoutSessionInputSchema).optional() }).strict(); -export const IntegrationConfigUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => IntegrationConfigWhereUniqueInputSchema), - update: z.union([ z.lazy(() => IntegrationConfigUpdateWithoutOrganizationInputSchema),z.lazy(() => IntegrationConfigUncheckedUpdateWithoutOrganizationInputSchema) ]), - create: z.union([ z.lazy(() => IntegrationConfigCreateWithoutOrganizationInputSchema),z.lazy(() => IntegrationConfigUncheckedCreateWithoutOrganizationInputSchema) ]), +export const ImportSessionCreateOrConnectWithoutRowsInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportSessionCreateWithoutRowsInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutRowsInputSchema) ]), }).strict(); -export const IntegrationConfigUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => IntegrationConfigWhereUniqueInputSchema), - data: z.union([ z.lazy(() => IntegrationConfigUpdateWithoutOrganizationInputSchema),z.lazy(() => IntegrationConfigUncheckedUpdateWithoutOrganizationInputSchema) ]), +export const ImportRowIssueCreateWithoutRowInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + field: z.string().optional().nullable(), + severity: z.lazy(() => IssueSeveritySchema), + message: z.string(), + hint: z.string().optional().nullable(), + value: z.string().optional().nullable(), + createdAt: z.coerce.date().optional(), + session: z.lazy(() => ImportSessionCreateNestedOneWithoutIssuesInputSchema) }).strict(); -export const IntegrationConfigUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => IntegrationConfigScalarWhereInputSchema), - data: z.union([ z.lazy(() => IntegrationConfigUpdateManyMutationInputSchema),z.lazy(() => IntegrationConfigUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +export const ImportRowIssueUncheckedCreateWithoutRowInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + sessionId: z.string(), + field: z.string().optional().nullable(), + severity: z.lazy(() => IssueSeveritySchema), + message: z.string(), + hint: z.string().optional().nullable(), + value: z.string().optional().nullable(), + createdAt: z.coerce.date().optional() }).strict(); -export const IntegrationConfigScalarWhereInputSchema: z.ZodType = z.object({ - AND: z.union([ z.lazy(() => IntegrationConfigScalarWhereInputSchema),z.lazy(() => IntegrationConfigScalarWhereInputSchema).array() ]).optional(), - OR: z.lazy(() => IntegrationConfigScalarWhereInputSchema).array().optional(), - NOT: z.union([ z.lazy(() => IntegrationConfigScalarWhereInputSchema),z.lazy(() => IntegrationConfigScalarWhereInputSchema).array() ]).optional(), - id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - type: z.union([ z.lazy(() => EnumIntegrationTypeFilterSchema),z.lazy(() => IntegrationTypeSchema) ]).optional(), - config: z.lazy(() => JsonFilterSchema).optional(), - credentials: z.lazy(() => JsonNullableFilterSchema).optional(), - endpoints: z.lazy(() => JsonNullableFilterSchema).optional(), - isActive: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), - isHealthy: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), - lastHealthCheck: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), - healthDetails: z.lazy(() => JsonNullableFilterSchema).optional(), - requestCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), - errorCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), - lastUsedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), - createdById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), - updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +export const ImportRowIssueCreateOrConnectWithoutRowInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowIssueWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutRowInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutRowInputSchema) ]), }).strict(); -export const TemplatePackageUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplatePackageWhereUniqueInputSchema), - update: z.union([ z.lazy(() => TemplatePackageUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplatePackageUncheckedUpdateWithoutOrganizationInputSchema) ]), - create: z.union([ z.lazy(() => TemplatePackageCreateWithoutOrganizationInputSchema),z.lazy(() => TemplatePackageUncheckedCreateWithoutOrganizationInputSchema) ]), +export const ImportRowIssueCreateManyRowInputEnvelopeSchema: z.ZodType = z.object({ + data: z.union([ z.lazy(() => ImportRowIssueCreateManyRowInputSchema),z.lazy(() => ImportRowIssueCreateManyRowInputSchema).array() ]), + skipDuplicates: z.boolean().optional() }).strict(); -export const TemplatePackageUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplatePackageWhereUniqueInputSchema), - data: z.union([ z.lazy(() => TemplatePackageUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplatePackageUncheckedUpdateWithoutOrganizationInputSchema) ]), +export const ImportSessionUpsertWithoutRowsInputSchema: z.ZodType = z.object({ + update: z.union([ z.lazy(() => ImportSessionUpdateWithoutRowsInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutRowsInputSchema) ]), + create: z.union([ z.lazy(() => ImportSessionCreateWithoutRowsInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutRowsInputSchema) ]), + where: z.lazy(() => ImportSessionWhereInputSchema).optional() }).strict(); -export const TemplatePackageUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplatePackageScalarWhereInputSchema), - data: z.union([ z.lazy(() => TemplatePackageUpdateManyMutationInputSchema),z.lazy(() => TemplatePackageUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +export const ImportSessionUpdateToOneWithWhereWithoutRowsInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereInputSchema).optional(), + data: z.union([ z.lazy(() => ImportSessionUpdateWithoutRowsInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutRowsInputSchema) ]), }).strict(); -export const TemplatePackageScalarWhereInputSchema: z.ZodType = z.object({ - AND: z.union([ z.lazy(() => TemplatePackageScalarWhereInputSchema),z.lazy(() => TemplatePackageScalarWhereInputSchema).array() ]).optional(), - OR: z.lazy(() => TemplatePackageScalarWhereInputSchema).array().optional(), - NOT: z.union([ z.lazy(() => TemplatePackageScalarWhereInputSchema),z.lazy(() => TemplatePackageScalarWhereInputSchema).array() ]).optional(), - id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - organizationId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - name: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - description: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - category: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - version: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - visibility: z.union([ z.lazy(() => EnumTemplateVisibilityFilterSchema),z.lazy(() => TemplateVisibilitySchema) ]).optional(), - status: z.union([ z.lazy(() => EnumTemplateStatusFilterSchema),z.lazy(() => TemplateStatusSchema) ]).optional(), - iconUrl: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - tags: z.lazy(() => JsonNullableFilterSchema).optional(), - manifest: z.lazy(() => JsonFilterSchema).optional(), - assetsCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), - sizeBytes: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), - createdById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), - updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +export const ImportSessionUpdateWithoutRowsInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + organization: z.lazy(() => OrganizationUpdateOneRequiredWithoutImportSessionsNestedInputSchema).optional(), + createdBy: z.lazy(() => UserUpdateOneRequiredWithoutCreatedImportSessionsNestedInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUpdateManyWithoutSessionNestedInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateUpdateOneWithoutSessionsNestedInputSchema).optional() }).strict(); -export const TemplateInstallationUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplateInstallationWhereUniqueInputSchema), - update: z.union([ z.lazy(() => TemplateInstallationUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateInstallationUncheckedUpdateWithoutOrganizationInputSchema) ]), - create: z.union([ z.lazy(() => TemplateInstallationCreateWithoutOrganizationInputSchema),z.lazy(() => TemplateInstallationUncheckedCreateWithoutOrganizationInputSchema) ]), +export const ImportSessionUncheckedUpdateWithoutRowsInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + appliedTemplateId: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + issues: z.lazy(() => ImportRowIssueUncheckedUpdateManyWithoutSessionNestedInputSchema).optional() }).strict(); -export const TemplateInstallationUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplateInstallationWhereUniqueInputSchema), - data: z.union([ z.lazy(() => TemplateInstallationUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateInstallationUncheckedUpdateWithoutOrganizationInputSchema) ]), +export const ImportRowIssueUpsertWithWhereUniqueWithoutRowInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowIssueWhereUniqueInputSchema), + update: z.union([ z.lazy(() => ImportRowIssueUpdateWithoutRowInputSchema),z.lazy(() => ImportRowIssueUncheckedUpdateWithoutRowInputSchema) ]), + create: z.union([ z.lazy(() => ImportRowIssueCreateWithoutRowInputSchema),z.lazy(() => ImportRowIssueUncheckedCreateWithoutRowInputSchema) ]), }).strict(); -export const TemplateInstallationUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplateInstallationScalarWhereInputSchema), - data: z.union([ z.lazy(() => TemplateInstallationUpdateManyMutationInputSchema),z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +export const ImportRowIssueUpdateWithWhereUniqueWithoutRowInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowIssueWhereUniqueInputSchema), + data: z.union([ z.lazy(() => ImportRowIssueUpdateWithoutRowInputSchema),z.lazy(() => ImportRowIssueUncheckedUpdateWithoutRowInputSchema) ]), }).strict(); -export const TemplateInstallationScalarWhereInputSchema: z.ZodType = z.object({ - AND: z.union([ z.lazy(() => TemplateInstallationScalarWhereInputSchema),z.lazy(() => TemplateInstallationScalarWhereInputSchema).array() ]).optional(), - OR: z.lazy(() => TemplateInstallationScalarWhereInputSchema).array().optional(), - NOT: z.union([ z.lazy(() => TemplateInstallationScalarWhereInputSchema),z.lazy(() => TemplateInstallationScalarWhereInputSchema).array() ]).optional(), - id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - templatePackageId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - templateVersionId: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - status: z.union([ z.lazy(() => EnumTemplateInstallStatusFilterSchema),z.lazy(() => TemplateInstallStatusSchema) ]).optional(), - strategy: z.union([ z.lazy(() => EnumTemplateInstallStrategyFilterSchema),z.lazy(() => TemplateInstallStrategySchema) ]).optional(), - namePrefix: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - preflight: z.lazy(() => JsonNullableFilterSchema).optional(), - logs: z.lazy(() => JsonNullableFilterSchema).optional(), - error: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - createdById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), - completedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), +export const ImportRowIssueUpdateManyWithWhereWithoutRowInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowIssueScalarWhereInputSchema), + data: z.union([ z.lazy(() => ImportRowIssueUpdateManyMutationInputSchema),z.lazy(() => ImportRowIssueUncheckedUpdateManyWithoutRowInputSchema) ]), }).strict(); -export const TemplateShareUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplateShareWhereUniqueInputSchema), - update: z.union([ z.lazy(() => TemplateShareUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareUncheckedUpdateWithoutOrganizationInputSchema) ]), - create: z.union([ z.lazy(() => TemplateShareCreateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareUncheckedCreateWithoutOrganizationInputSchema) ]), +export const ImportSessionCreateWithoutIssuesInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + organization: z.lazy(() => OrganizationCreateNestedOneWithoutImportSessionsInputSchema), + createdBy: z.lazy(() => UserCreateNestedOneWithoutCreatedImportSessionsInputSchema), + rows: z.lazy(() => ImportRowCreateNestedManyWithoutSessionInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateCreateNestedOneWithoutSessionsInputSchema).optional() }).strict(); -export const TemplateShareUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplateShareWhereUniqueInputSchema), - data: z.union([ z.lazy(() => TemplateShareUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareUncheckedUpdateWithoutOrganizationInputSchema) ]), +export const ImportSessionUncheckedCreateWithoutIssuesInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + createdByUserId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + appliedTemplateId: z.string().optional().nullable(), + rows: z.lazy(() => ImportRowUncheckedCreateNestedManyWithoutSessionInputSchema).optional() }).strict(); -export const TemplateShareUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplateShareScalarWhereInputSchema), - data: z.union([ z.lazy(() => TemplateShareUpdateManyMutationInputSchema),z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +export const ImportSessionCreateOrConnectWithoutIssuesInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportSessionCreateWithoutIssuesInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutIssuesInputSchema) ]), }).strict(); -export const TemplateShareScalarWhereInputSchema: z.ZodType = z.object({ - AND: z.union([ z.lazy(() => TemplateShareScalarWhereInputSchema),z.lazy(() => TemplateShareScalarWhereInputSchema).array() ]).optional(), - OR: z.lazy(() => TemplateShareScalarWhereInputSchema).array().optional(), - NOT: z.union([ z.lazy(() => TemplateShareScalarWhereInputSchema),z.lazy(() => TemplateShareScalarWhereInputSchema).array() ]).optional(), - id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - templatePackageId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - name: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - shareMode: z.union([ z.lazy(() => EnumTemplateShareModeFilterSchema),z.lazy(() => TemplateShareModeSchema) ]).optional(), - tokenHash: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - expiresAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), - maxUses: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), - allowExternal: z.union([ z.lazy(() => BoolFilterSchema),z.boolean() ]).optional(), - notes: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - status: z.union([ z.lazy(() => EnumTemplateShareStatusFilterSchema),z.lazy(() => TemplateShareStatusSchema) ]).optional(), - usageCount: z.union([ z.lazy(() => IntFilterSchema),z.number() ]).optional(), - lastAccessedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), - revokedAt: z.union([ z.lazy(() => DateTimeNullableFilterSchema),z.coerce.date() ]).optional().nullable(), - revokedById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(), - snapshotData: z.lazy(() => JsonFilterSchema).optional(), - snapshotVersion: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - createdById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), - updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +export const ImportRowCreateWithoutIssuesInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + rowNumber: z.number().int(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.lazy(() => RowStatusSchema).optional(), + dedupeHint: z.string().optional().nullable(), + score: z.number().int().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + session: z.lazy(() => ImportSessionCreateNestedOneWithoutRowsInputSchema) }).strict(); -export const TemplateShareImportUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplateShareImportWhereUniqueInputSchema), - update: z.union([ z.lazy(() => TemplateShareImportUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareImportUncheckedUpdateWithoutOrganizationInputSchema) ]), - create: z.union([ z.lazy(() => TemplateShareImportCreateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareImportUncheckedCreateWithoutOrganizationInputSchema) ]), +export const ImportRowUncheckedCreateWithoutIssuesInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + sessionId: z.string(), + rowNumber: z.number().int(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.lazy(() => RowStatusSchema).optional(), + dedupeHint: z.string().optional().nullable(), + score: z.number().int().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional() }).strict(); -export const TemplateShareImportUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplateShareImportWhereUniqueInputSchema), - data: z.union([ z.lazy(() => TemplateShareImportUpdateWithoutOrganizationInputSchema),z.lazy(() => TemplateShareImportUncheckedUpdateWithoutOrganizationInputSchema) ]), +export const ImportRowCreateOrConnectWithoutIssuesInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportRowCreateWithoutIssuesInputSchema),z.lazy(() => ImportRowUncheckedCreateWithoutIssuesInputSchema) ]), }).strict(); -export const TemplateShareImportUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => TemplateShareImportScalarWhereInputSchema), - data: z.union([ z.lazy(() => TemplateShareImportUpdateManyMutationInputSchema),z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +export const ImportSessionUpsertWithoutIssuesInputSchema: z.ZodType = z.object({ + update: z.union([ z.lazy(() => ImportSessionUpdateWithoutIssuesInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutIssuesInputSchema) ]), + create: z.union([ z.lazy(() => ImportSessionCreateWithoutIssuesInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutIssuesInputSchema) ]), + where: z.lazy(() => ImportSessionWhereInputSchema).optional() }).strict(); -export const TemplateShareImportScalarWhereInputSchema: z.ZodType = z.object({ - AND: z.union([ z.lazy(() => TemplateShareImportScalarWhereInputSchema),z.lazy(() => TemplateShareImportScalarWhereInputSchema).array() ]).optional(), - OR: z.lazy(() => TemplateShareImportScalarWhereInputSchema).array().optional(), - NOT: z.union([ z.lazy(() => TemplateShareImportScalarWhereInputSchema),z.lazy(() => TemplateShareImportScalarWhereInputSchema).array() ]).optional(), - id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - shareId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - templatePackageId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - importedById: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - importedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), - originalPackageId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - originalOrgId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - snapshotVersion: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), +export const ImportSessionUpdateToOneWithWhereWithoutIssuesInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereInputSchema).optional(), + data: z.union([ z.lazy(() => ImportSessionUpdateWithoutIssuesInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutIssuesInputSchema) ]), }).strict(); -export const OrganizationUiConfigUpsertWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => OrganizationUiConfigWhereUniqueInputSchema), - update: z.union([ z.lazy(() => OrganizationUiConfigUpdateWithoutOrganizationInputSchema),z.lazy(() => OrganizationUiConfigUncheckedUpdateWithoutOrganizationInputSchema) ]), - create: z.union([ z.lazy(() => OrganizationUiConfigCreateWithoutOrganizationInputSchema),z.lazy(() => OrganizationUiConfigUncheckedCreateWithoutOrganizationInputSchema) ]), +export const ImportSessionUpdateWithoutIssuesInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + organization: z.lazy(() => OrganizationUpdateOneRequiredWithoutImportSessionsNestedInputSchema).optional(), + createdBy: z.lazy(() => UserUpdateOneRequiredWithoutCreatedImportSessionsNestedInputSchema).optional(), + rows: z.lazy(() => ImportRowUpdateManyWithoutSessionNestedInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateUpdateOneWithoutSessionsNestedInputSchema).optional() }).strict(); -export const OrganizationUiConfigUpdateWithWhereUniqueWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => OrganizationUiConfigWhereUniqueInputSchema), - data: z.union([ z.lazy(() => OrganizationUiConfigUpdateWithoutOrganizationInputSchema),z.lazy(() => OrganizationUiConfigUncheckedUpdateWithoutOrganizationInputSchema) ]), +export const ImportSessionUncheckedUpdateWithoutIssuesInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + appliedTemplateId: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + rows: z.lazy(() => ImportRowUncheckedUpdateManyWithoutSessionNestedInputSchema).optional() }).strict(); -export const OrganizationUiConfigUpdateManyWithWhereWithoutOrganizationInputSchema: z.ZodType = z.object({ - where: z.lazy(() => OrganizationUiConfigScalarWhereInputSchema), - data: z.union([ z.lazy(() => OrganizationUiConfigUpdateManyMutationInputSchema),z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationInputSchema) ]), +export const ImportRowUpsertWithoutIssuesInputSchema: z.ZodType = z.object({ + update: z.union([ z.lazy(() => ImportRowUpdateWithoutIssuesInputSchema),z.lazy(() => ImportRowUncheckedUpdateWithoutIssuesInputSchema) ]), + create: z.union([ z.lazy(() => ImportRowCreateWithoutIssuesInputSchema),z.lazy(() => ImportRowUncheckedCreateWithoutIssuesInputSchema) ]), + where: z.lazy(() => ImportRowWhereInputSchema).optional() }).strict(); -export const OrganizationUiConfigScalarWhereInputSchema: z.ZodType = z.object({ - AND: z.union([ z.lazy(() => OrganizationUiConfigScalarWhereInputSchema),z.lazy(() => OrganizationUiConfigScalarWhereInputSchema).array() ]).optional(), - OR: z.lazy(() => OrganizationUiConfigScalarWhereInputSchema).array().optional(), - NOT: z.union([ z.lazy(() => OrganizationUiConfigScalarWhereInputSchema),z.lazy(() => OrganizationUiConfigScalarWhereInputSchema).array() ]).optional(), - id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - organizationId: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - key: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), - config: z.lazy(() => JsonFilterSchema).optional(), - createdAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), - updatedAt: z.union([ z.lazy(() => DateTimeFilterSchema),z.coerce.date() ]).optional(), +export const ImportRowUpdateToOneWithWhereWithoutIssuesInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportRowWhereInputSchema).optional(), + data: z.union([ z.lazy(() => ImportRowUpdateWithoutIssuesInputSchema),z.lazy(() => ImportRowUncheckedUpdateWithoutIssuesInputSchema) ]), +}).strict(); + +export const ImportRowUpdateWithoutIssuesInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowNumber: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => EnumRowStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeHint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + score: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + session: z.lazy(() => ImportSessionUpdateOneRequiredWithoutRowsNestedInputSchema).optional() +}).strict(); + +export const ImportRowUncheckedUpdateWithoutIssuesInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + sessionId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowNumber: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => EnumRowStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeHint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + score: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), }).strict(); export const OrganizationCreateWithoutUsersInputSchema: z.ZodType = z.object({ @@ -34296,7 +37762,9 @@ export const OrganizationCreateWithoutUsersInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutUsersInputSchema: z.ZodType = z.object({ @@ -34328,7 +37796,9 @@ export const OrganizationUncheckedCreateWithoutUsersInputSchema: z.ZodType TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutUsersInputSchema: z.ZodType = z.object({ @@ -34407,7 +37877,9 @@ export const OrganizationUpdateWithoutUsersInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutUsersInputSchema: z.ZodType = z.object({ @@ -34439,7 +37911,9 @@ export const OrganizationUncheckedUpdateWithoutUsersInputSchema: z.ZodType TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const CustomRoleUpsertWithoutUserAssignmentsInputSchema: z.ZodType = z.object({ @@ -34508,7 +37982,9 @@ export const OrganizationCreateWithoutCustomersInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutCustomersInputSchema: z.ZodType = z.object({ @@ -34540,7 +38016,9 @@ export const OrganizationUncheckedCreateWithoutCustomersInputSchema: z.ZodType

TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutCustomersInputSchema: z.ZodType = z.object({ @@ -34748,7 +38226,9 @@ export const OrganizationUpdateWithoutCustomersInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutCustomersInputSchema: z.ZodType = z.object({ @@ -34780,7 +38260,9 @@ export const OrganizationUncheckedUpdateWithoutCustomersInputSchema: z.ZodType

TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const CustomerInteractionUpsertWithWhereUniqueWithoutCustomerInputSchema: z.ZodType = z.object({ @@ -35197,7 +38679,9 @@ export const OrganizationCreateWithoutProjectsInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutProjectsInputSchema: z.ZodType = z.object({ @@ -35229,7 +38713,9 @@ export const OrganizationUncheckedCreateWithoutProjectsInputSchema: z.ZodType TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutProjectsInputSchema: z.ZodType = z.object({ @@ -35477,7 +38963,9 @@ export const OrganizationUpdateWithoutProjectsInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutProjectsInputSchema: z.ZodType = z.object({ @@ -35509,7 +38997,9 @@ export const OrganizationUncheckedUpdateWithoutProjectsInputSchema: z.ZodType TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const TaskUpsertWithWhereUniqueWithoutProjectInputSchema: z.ZodType = z.object({ @@ -35640,7 +39130,9 @@ export const OrganizationCreateWithoutTasksInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutTasksInputSchema: z.ZodType = z.object({ @@ -35672,7 +39164,9 @@ export const OrganizationUncheckedCreateWithoutTasksInputSchema: z.ZodType TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutTasksInputSchema: z.ZodType = z.object({ @@ -36007,7 +39501,9 @@ export const OrganizationUpdateWithoutTasksInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutTasksInputSchema: z.ZodType = z.object({ @@ -36039,7 +39535,9 @@ export const OrganizationUncheckedUpdateWithoutTasksInputSchema: z.ZodType TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const ProjectUpsertWithoutTasksInputSchema: z.ZodType = z.object({ @@ -36601,7 +40099,9 @@ export const OrganizationCreateWithoutInvoicesInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutInvoicesInputSchema: z.ZodType = z.object({ @@ -36633,7 +40133,9 @@ export const OrganizationUncheckedCreateWithoutInvoicesInputSchema: z.ZodType TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutInvoicesInputSchema: z.ZodType = z.object({ @@ -36816,7 +40318,9 @@ export const OrganizationUpdateWithoutInvoicesInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutInvoicesInputSchema: z.ZodType = z.object({ @@ -36848,7 +40352,9 @@ export const OrganizationUncheckedUpdateWithoutInvoicesInputSchema: z.ZodType TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const CustomerUpsertWithoutInvoicesInputSchema: z.ZodType = z.object({ @@ -37322,7 +40828,9 @@ export const OrganizationCreateWithoutExpensesInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutExpensesInputSchema: z.ZodType = z.object({ @@ -37354,7 +40862,9 @@ export const OrganizationUncheckedCreateWithoutExpensesInputSchema: z.ZodType TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutExpensesInputSchema: z.ZodType = z.object({ @@ -37488,7 +40998,9 @@ export const OrganizationUpdateWithoutExpensesInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutExpensesInputSchema: z.ZodType = z.object({ @@ -37520,7 +41032,9 @@ export const OrganizationUncheckedUpdateWithoutExpensesInputSchema: z.ZodType TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const ExpenseCategoryUpsertWithoutExpensesInputSchema: z.ZodType = z.object({ @@ -37656,7 +41170,9 @@ export const OrganizationCreateWithoutExpenseCategoriesInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutExpenseCategoriesInputSchema: z.ZodType = z.object({ @@ -37688,7 +41204,9 @@ export const OrganizationUncheckedCreateWithoutExpenseCategoriesInputSchema: z.Z templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutExpenseCategoriesInputSchema: z.ZodType = z.object({ @@ -37802,7 +41320,9 @@ export const OrganizationUpdateWithoutExpenseCategoriesInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutExpenseCategoriesInputSchema: z.ZodType = z.object({ @@ -37834,7 +41354,9 @@ export const OrganizationUncheckedUpdateWithoutExpenseCategoriesInputSchema: z.Z templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const ExpenseUpsertWithWhereUniqueWithoutCategoryInputSchema: z.ZodType = z.object({ @@ -37882,7 +41404,9 @@ export const OrganizationCreateWithoutExpenseTagsInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutExpenseTagsInputSchema: z.ZodType = z.object({ @@ -37914,7 +41438,9 @@ export const OrganizationUncheckedCreateWithoutExpenseTagsInputSchema: z.ZodType templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutExpenseTagsInputSchema: z.ZodType = z.object({ @@ -37980,7 +41506,9 @@ export const OrganizationUpdateWithoutExpenseTagsInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutExpenseTagsInputSchema: z.ZodType = z.object({ @@ -38012,7 +41540,9 @@ export const OrganizationUncheckedUpdateWithoutExpenseTagsInputSchema: z.ZodType templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const ExpenseToTagUpsertWithWhereUniqueWithoutTagInputSchema: z.ZodType = z.object({ @@ -38587,7 +42117,9 @@ export const OrganizationCreateWithoutInvitationsInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutInvitationsInputSchema: z.ZodType = z.object({ @@ -38619,7 +42151,9 @@ export const OrganizationUncheckedCreateWithoutInvitationsInputSchema: z.ZodType templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutInvitationsInputSchema: z.ZodType = z.object({ @@ -38667,7 +42201,9 @@ export const OrganizationUpdateWithoutInvitationsInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutInvitationsInputSchema: z.ZodType = z.object({ @@ -38699,7 +42235,9 @@ export const OrganizationUncheckedUpdateWithoutInvitationsInputSchema: z.ZodType templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationCreateWithoutEmployeesInputSchema: z.ZodType = z.object({ @@ -38731,7 +42269,9 @@ export const OrganizationCreateWithoutEmployeesInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutEmployeesInputSchema: z.ZodType = z.object({ @@ -38763,7 +42303,9 @@ export const OrganizationUncheckedCreateWithoutEmployeesInputSchema: z.ZodType

TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutEmployeesInputSchema: z.ZodType = z.object({ @@ -38937,7 +42479,9 @@ export const OrganizationUpdateWithoutEmployeesInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutEmployeesInputSchema: z.ZodType = z.object({ @@ -38969,7 +42513,9 @@ export const OrganizationUncheckedUpdateWithoutEmployeesInputSchema: z.ZodType

TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const PayrollUpsertWithWhereUniqueWithoutEmployeeInputSchema: z.ZodType = z.object({ @@ -39493,7 +43039,9 @@ export const OrganizationCreateWithoutCampaignsInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutCampaignsInputSchema: z.ZodType = z.object({ @@ -39525,7 +43073,9 @@ export const OrganizationUncheckedCreateWithoutCampaignsInputSchema: z.ZodType

TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutCampaignsInputSchema: z.ZodType = z.object({ @@ -39649,7 +43199,9 @@ export const OrganizationUpdateWithoutCampaignsInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutCampaignsInputSchema: z.ZodType = z.object({ @@ -39681,7 +43233,9 @@ export const OrganizationUncheckedUpdateWithoutCampaignsInputSchema: z.ZodType

TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const EmailCampaignUpsertWithWhereUniqueWithoutCampaignInputSchema: z.ZodType = z.object({ @@ -39998,6 +43552,108 @@ export const AccountCreateManyUserInputEnvelopeSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + organization: z.lazy(() => OrganizationCreateNestedOneWithoutImportSessionsInputSchema), + rows: z.lazy(() => ImportRowCreateNestedManyWithoutSessionInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueCreateNestedManyWithoutSessionInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateCreateNestedOneWithoutSessionsInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedCreateWithoutCreatedByInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + appliedTemplateId: z.string().optional().nullable(), + rows: z.lazy(() => ImportRowUncheckedCreateNestedManyWithoutSessionInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUncheckedCreateNestedManyWithoutSessionInputSchema).optional() +}).strict(); + +export const ImportSessionCreateOrConnectWithoutCreatedByInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportSessionCreateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutCreatedByInputSchema) ]), +}).strict(); + +export const ImportSessionCreateManyCreatedByInputEnvelopeSchema: z.ZodType = z.object({ + data: z.union([ z.lazy(() => ImportSessionCreateManyCreatedByInputSchema),z.lazy(() => ImportSessionCreateManyCreatedByInputSchema).array() ]), + skipDuplicates: z.boolean().optional() +}).strict(); + +export const ImportTemplateCreateWithoutCreatedByInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + organization: z.lazy(() => OrganizationCreateNestedOneWithoutImportTemplatesInputSchema), + sessions: z.lazy(() => ImportSessionCreateNestedManyWithoutAppliedTemplateInputSchema).optional() +}).strict(); + +export const ImportTemplateUncheckedCreateWithoutCreatedByInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + sessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutAppliedTemplateInputSchema).optional() +}).strict(); + +export const ImportTemplateCreateOrConnectWithoutCreatedByInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportTemplateWhereUniqueInputSchema), + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutCreatedByInputSchema) ]), +}).strict(); + +export const ImportTemplateCreateManyCreatedByInputEnvelopeSchema: z.ZodType = z.object({ + data: z.union([ z.lazy(() => ImportTemplateCreateManyCreatedByInputSchema),z.lazy(() => ImportTemplateCreateManyCreatedByInputSchema).array() ]), + skipDuplicates: z.boolean().optional() +}).strict(); + export const SessionUpsertWithWhereUniqueWithoutUserInputSchema: z.ZodType = z.object({ where: z.lazy(() => SessionWhereUniqueInputSchema), update: z.union([ z.lazy(() => SessionUpdateWithoutUserInputSchema),z.lazy(() => SessionUncheckedUpdateWithoutUserInputSchema) ]), @@ -40063,6 +43719,38 @@ export const AccountScalarWhereInputSchema: z.ZodType DateTimeFilterSchema),z.coerce.date() ]).optional(), }).strict(); +export const ImportSessionUpsertWithWhereUniqueWithoutCreatedByInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + update: z.union([ z.lazy(() => ImportSessionUpdateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutCreatedByInputSchema) ]), + create: z.union([ z.lazy(() => ImportSessionCreateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUncheckedCreateWithoutCreatedByInputSchema) ]), +}).strict(); + +export const ImportSessionUpdateWithWhereUniqueWithoutCreatedByInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionWhereUniqueInputSchema), + data: z.union([ z.lazy(() => ImportSessionUpdateWithoutCreatedByInputSchema),z.lazy(() => ImportSessionUncheckedUpdateWithoutCreatedByInputSchema) ]), +}).strict(); + +export const ImportSessionUpdateManyWithWhereWithoutCreatedByInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportSessionScalarWhereInputSchema), + data: z.union([ z.lazy(() => ImportSessionUpdateManyMutationInputSchema),z.lazy(() => ImportSessionUncheckedUpdateManyWithoutCreatedByInputSchema) ]), +}).strict(); + +export const ImportTemplateUpsertWithWhereUniqueWithoutCreatedByInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportTemplateWhereUniqueInputSchema), + update: z.union([ z.lazy(() => ImportTemplateUpdateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUncheckedUpdateWithoutCreatedByInputSchema) ]), + create: z.union([ z.lazy(() => ImportTemplateCreateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUncheckedCreateWithoutCreatedByInputSchema) ]), +}).strict(); + +export const ImportTemplateUpdateWithWhereUniqueWithoutCreatedByInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportTemplateWhereUniqueInputSchema), + data: z.union([ z.lazy(() => ImportTemplateUpdateWithoutCreatedByInputSchema),z.lazy(() => ImportTemplateUncheckedUpdateWithoutCreatedByInputSchema) ]), +}).strict(); + +export const ImportTemplateUpdateManyWithWhereWithoutCreatedByInputSchema: z.ZodType = z.object({ + where: z.lazy(() => ImportTemplateScalarWhereInputSchema), + data: z.union([ z.lazy(() => ImportTemplateUpdateManyMutationInputSchema),z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutCreatedByInputSchema) ]), +}).strict(); + export const UserCreateWithoutSessionsInputSchema: z.ZodType = z.object({ id: z.string(), name: z.string(), @@ -40071,7 +43759,9 @@ export const UserCreateWithoutSessionsInputSchema: z.ZodType AccountCreateNestedManyWithoutUserInputSchema).optional() + accounts: z.lazy(() => AccountCreateNestedManyWithoutUserInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutCreatedByInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutCreatedByInputSchema).optional() }).strict(); export const UserUncheckedCreateWithoutSessionsInputSchema: z.ZodType = z.object({ @@ -40082,7 +43772,9 @@ export const UserUncheckedCreateWithoutSessionsInputSchema: z.ZodType AccountUncheckedCreateNestedManyWithoutUserInputSchema).optional() + accounts: z.lazy(() => AccountUncheckedCreateNestedManyWithoutUserInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutCreatedByInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutCreatedByInputSchema).optional() }).strict(); export const UserCreateOrConnectWithoutSessionsInputSchema: z.ZodType = z.object({ @@ -40109,7 +43801,9 @@ export const UserUpdateWithoutSessionsInputSchema: z.ZodType NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), - accounts: z.lazy(() => AccountUpdateManyWithoutUserNestedInputSchema).optional() + accounts: z.lazy(() => AccountUpdateManyWithoutUserNestedInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUpdateManyWithoutCreatedByNestedInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutCreatedByNestedInputSchema).optional() }).strict(); export const UserUncheckedUpdateWithoutSessionsInputSchema: z.ZodType = z.object({ @@ -40120,7 +43814,9 @@ export const UserUncheckedUpdateWithoutSessionsInputSchema: z.ZodType NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), - accounts: z.lazy(() => AccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional() + accounts: z.lazy(() => AccountUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutCreatedByNestedInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutCreatedByNestedInputSchema).optional() }).strict(); export const UserCreateWithoutAccountsInputSchema: z.ZodType = z.object({ @@ -40131,7 +43827,9 @@ export const UserCreateWithoutAccountsInputSchema: z.ZodType SessionCreateNestedManyWithoutUserInputSchema).optional() + sessions: z.lazy(() => SessionCreateNestedManyWithoutUserInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutCreatedByInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutCreatedByInputSchema).optional() }).strict(); export const UserUncheckedCreateWithoutAccountsInputSchema: z.ZodType = z.object({ @@ -40142,7 +43840,9 @@ export const UserUncheckedCreateWithoutAccountsInputSchema: z.ZodType SessionUncheckedCreateNestedManyWithoutUserInputSchema).optional() + sessions: z.lazy(() => SessionUncheckedCreateNestedManyWithoutUserInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutCreatedByInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutCreatedByInputSchema).optional() }).strict(); export const UserCreateOrConnectWithoutAccountsInputSchema: z.ZodType = z.object({ @@ -40169,7 +43869,9 @@ export const UserUpdateWithoutAccountsInputSchema: z.ZodType NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), - sessions: z.lazy(() => SessionUpdateManyWithoutUserNestedInputSchema).optional() + sessions: z.lazy(() => SessionUpdateManyWithoutUserNestedInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUpdateManyWithoutCreatedByNestedInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutCreatedByNestedInputSchema).optional() }).strict(); export const UserUncheckedUpdateWithoutAccountsInputSchema: z.ZodType = z.object({ @@ -40180,7 +43882,9 @@ export const UserUncheckedUpdateWithoutAccountsInputSchema: z.ZodType NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), - sessions: z.lazy(() => SessionUncheckedUpdateManyWithoutUserNestedInputSchema).optional() + sessions: z.lazy(() => SessionUncheckedUpdateManyWithoutUserNestedInputSchema).optional(), + createdImportSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutCreatedByNestedInputSchema).optional(), + createdImportTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutCreatedByNestedInputSchema).optional() }).strict(); export const OrganizationCreateWithoutFinancialReportsInputSchema: z.ZodType = z.object({ @@ -40212,7 +43916,9 @@ export const OrganizationCreateWithoutFinancialReportsInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutFinancialReportsInputSchema: z.ZodType = z.object({ @@ -40244,7 +43950,9 @@ export const OrganizationUncheckedCreateWithoutFinancialReportsInputSchema: z.Zo templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutFinancialReportsInputSchema: z.ZodType = z.object({ @@ -40398,7 +44106,9 @@ export const OrganizationUpdateWithoutFinancialReportsInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutFinancialReportsInputSchema: z.ZodType = z.object({ @@ -40430,7 +44140,9 @@ export const OrganizationUncheckedUpdateWithoutFinancialReportsInputSchema: z.Zo templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const FinancialReportDataUpsertWithWhereUniqueWithoutReportInputSchema: z.ZodType = z.object({ @@ -40872,7 +44584,9 @@ export const OrganizationCreateWithoutTemplatePackagesInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutTemplatePackagesInputSchema: z.ZodType = z.object({ @@ -40904,7 +44618,9 @@ export const OrganizationUncheckedCreateWithoutTemplatePackagesInputSchema: z.Zo templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutTemplatePackagesInputSchema: z.ZodType = z.object({ @@ -41118,7 +44834,9 @@ export const OrganizationUpdateWithoutTemplatePackagesInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutTemplatePackagesInputSchema: z.ZodType = z.object({ @@ -41150,7 +44868,9 @@ export const OrganizationUncheckedUpdateWithoutTemplatePackagesInputSchema: z.Zo templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const TemplateVersionUpsertWithWhereUniqueWithoutTemplatePackageInputSchema: z.ZodType = z.object({ @@ -41422,7 +45142,9 @@ export const OrganizationCreateWithoutTemplateInstallationsInputSchema: z.ZodTyp templatePackages: z.lazy(() => TemplatePackageCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutTemplateInstallationsInputSchema: z.ZodType = z.object({ @@ -41454,7 +45176,9 @@ export const OrganizationUncheckedCreateWithoutTemplateInstallationsInputSchema: templatePackages: z.lazy(() => TemplatePackageUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutTemplateInstallationsInputSchema: z.ZodType = z.object({ @@ -41610,7 +45334,9 @@ export const OrganizationUpdateWithoutTemplateInstallationsInputSchema: z.ZodTyp templatePackages: z.lazy(() => TemplatePackageUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutTemplateInstallationsInputSchema: z.ZodType = z.object({ @@ -41642,7 +45368,9 @@ export const OrganizationUncheckedUpdateWithoutTemplateInstallationsInputSchema: templatePackages: z.lazy(() => TemplatePackageUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const TemplatePackageUpsertWithoutInstallationsInputSchema: z.ZodType = z.object({ @@ -41873,7 +45601,9 @@ export const OrganizationCreateWithoutWorkflowsInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutWorkflowsInputSchema: z.ZodType = z.object({ @@ -41905,7 +45635,9 @@ export const OrganizationUncheckedCreateWithoutWorkflowsInputSchema: z.ZodType

TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutWorkflowsInputSchema: z.ZodType = z.object({ @@ -42227,7 +45959,9 @@ export const OrganizationUpdateWithoutWorkflowsInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutWorkflowsInputSchema: z.ZodType = z.object({ @@ -42259,7 +45993,9 @@ export const OrganizationUncheckedUpdateWithoutWorkflowsInputSchema: z.ZodType

TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const WorkflowTriggerUpsertWithWhereUniqueWithoutWorkflowInputSchema: z.ZodType = z.object({ @@ -42487,7 +46223,9 @@ export const OrganizationCreateWithoutUiConfigsInputSchema: z.ZodType TemplatePackageCreateNestedManyWithoutOrganizationInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), - templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional() + templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutUiConfigsInputSchema: z.ZodType = z.object({ @@ -42519,7 +46257,9 @@ export const OrganizationUncheckedCreateWithoutUiConfigsInputSchema: z.ZodType

TemplatePackageUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutUiConfigsInputSchema: z.ZodType = z.object({ @@ -42567,7 +46307,9 @@ export const OrganizationUpdateWithoutUiConfigsInputSchema: z.ZodType TemplatePackageUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), - templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional() + templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutUiConfigsInputSchema: z.ZodType = z.object({ @@ -42599,7 +46341,9 @@ export const OrganizationUncheckedUpdateWithoutUiConfigsInputSchema: z.ZodType

TemplatePackageUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const WorkflowCreateWithoutTriggersInputSchema: z.ZodType = z.object({ @@ -44659,7 +48403,9 @@ export const OrganizationCreateWithoutActionTemplatesInputSchema: z.ZodType TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutActionTemplatesInputSchema: z.ZodType = z.object({ @@ -44691,7 +48437,9 @@ export const OrganizationUncheckedCreateWithoutActionTemplatesInputSchema: z.Zod templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutActionTemplatesInputSchema: z.ZodType = z.object({ @@ -44769,7 +48517,9 @@ export const OrganizationUpdateWithoutActionTemplatesInputSchema: z.ZodType TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutActionTemplatesInputSchema: z.ZodType = z.object({ @@ -44801,7 +48551,9 @@ export const OrganizationUncheckedUpdateWithoutActionTemplatesInputSchema: z.Zod templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const ActionTemplateVersionUpsertWithWhereUniqueWithoutActionTemplateInputSchema: z.ZodType = z.object({ @@ -44967,7 +48719,9 @@ export const OrganizationCreateWithoutVariableDefinitionsInputSchema: z.ZodType< templateInstallations: z.lazy(() => TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutVariableDefinitionsInputSchema: z.ZodType = z.object({ @@ -44999,7 +48753,9 @@ export const OrganizationUncheckedCreateWithoutVariableDefinitionsInputSchema: z templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutVariableDefinitionsInputSchema: z.ZodType = z.object({ @@ -45113,7 +48869,9 @@ export const OrganizationUpdateWithoutVariableDefinitionsInputSchema: z.ZodType< templateInstallations: z.lazy(() => TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutVariableDefinitionsInputSchema: z.ZodType = z.object({ @@ -45145,7 +48903,9 @@ export const OrganizationUncheckedUpdateWithoutVariableDefinitionsInputSchema: z templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const TriggerVariableUpsertWithWhereUniqueWithoutVariableInputSchema: z.ZodType = z.object({ @@ -46436,7 +50196,9 @@ export const OrganizationCreateWithoutIntegrationConfigsInputSchema: z.ZodType

TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutIntegrationConfigsInputSchema: z.ZodType = z.object({ @@ -46468,7 +50230,9 @@ export const OrganizationUncheckedCreateWithoutIntegrationConfigsInputSchema: z. templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutIntegrationConfigsInputSchema: z.ZodType = z.object({ @@ -46516,7 +50280,9 @@ export const OrganizationUpdateWithoutIntegrationConfigsInputSchema: z.ZodType

TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutIntegrationConfigsInputSchema: z.ZodType = z.object({ @@ -46548,7 +50314,9 @@ export const OrganizationUncheckedUpdateWithoutIntegrationConfigsInputSchema: z. templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const WorkflowNodeCreateWithoutEmailActionInputSchema: z.ZodType = z.object({ @@ -47421,7 +51189,9 @@ export const OrganizationCreateWithoutTemplateSharesInputSchema: z.ZodType TemplatePackageCreateNestedManyWithoutOrganizationInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutTemplateSharesInputSchema: z.ZodType = z.object({ @@ -47453,7 +51223,9 @@ export const OrganizationUncheckedCreateWithoutTemplateSharesInputSchema: z.ZodT templatePackages: z.lazy(() => TemplatePackageUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutTemplateSharesInputSchema: z.ZodType = z.object({ @@ -47650,7 +51422,9 @@ export const OrganizationUpdateWithoutTemplateSharesInputSchema: z.ZodType TemplatePackageUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutTemplateSharesInputSchema: z.ZodType = z.object({ @@ -47682,7 +51456,9 @@ export const OrganizationUncheckedUpdateWithoutTemplateSharesInputSchema: z.ZodT templatePackages: z.lazy(() => TemplatePackageUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShareImports: z.lazy(() => TemplateShareImportUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const TemplateShareRecipientUpsertWithWhereUniqueWithoutShareInputSchema: z.ZodType = z.object({ @@ -48078,7 +51854,9 @@ export const OrganizationCreateWithoutTemplateShareImportsInputSchema: z.ZodType templatePackages: z.lazy(() => TemplatePackageCreateNestedManyWithoutOrganizationInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationUncheckedCreateWithoutTemplateShareImportsInputSchema: z.ZodType = z.object({ @@ -48110,7 +51888,9 @@ export const OrganizationUncheckedCreateWithoutTemplateShareImportsInputSchema: templatePackages: z.lazy(() => TemplatePackageUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedCreateNestedManyWithoutOrganizationInputSchema).optional() }).strict(); export const OrganizationCreateOrConnectWithoutTemplateShareImportsInputSchema: z.ZodType = z.object({ @@ -48268,7 +52048,9 @@ export const OrganizationUpdateWithoutTemplateShareImportsInputSchema: z.ZodType templatePackages: z.lazy(() => TemplatePackageUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const OrganizationUncheckedUpdateWithoutTemplateShareImportsInputSchema: z.ZodType = z.object({ @@ -48300,7 +52082,9 @@ export const OrganizationUncheckedUpdateWithoutTemplateShareImportsInputSchema: templatePackages: z.lazy(() => TemplatePackageUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateInstallations: z.lazy(() => TemplateInstallationUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), templateShares: z.lazy(() => TemplateShareUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), - uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() + uiConfigs: z.lazy(() => OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importSessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional(), + importTemplates: z.lazy(() => ImportTemplateUncheckedUpdateManyWithoutOrganizationNestedInputSchema).optional() }).strict(); export const TemplatePackageUpsertWithoutShareImportsInputSchema: z.ZodType = z.object({ @@ -48839,6 +52623,44 @@ export const OrganizationUiConfigCreateManyOrganizationInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + createdByUserId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + appliedTemplateId: z.string().optional().nullable() +}).strict(); + +export const ImportTemplateCreateManyOrganizationInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + createdByUserId: z.string(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional() +}).strict(); + export const UserOrganizationUpdateWithoutOrganizationInputSchema: z.ZodType = z.object({ userId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), role: z.union([ z.lazy(() => UserRoleSchema),z.lazy(() => NullableEnumUserRoleFieldUpdateOperationsInputSchema) ]).optional().nullable(), @@ -50066,6 +53888,364 @@ export const OrganizationUiConfigUncheckedUpdateManyWithoutOrganizationInputSche updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), }).strict(); +export const ImportSessionUpdateWithoutOrganizationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdBy: z.lazy(() => UserUpdateOneRequiredWithoutCreatedImportSessionsNestedInputSchema).optional(), + rows: z.lazy(() => ImportRowUpdateManyWithoutSessionNestedInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUpdateManyWithoutSessionNestedInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateUpdateOneWithoutSessionsNestedInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedUpdateWithoutOrganizationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + appliedTemplateId: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + rows: z.lazy(() => ImportRowUncheckedUpdateManyWithoutSessionNestedInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUncheckedUpdateManyWithoutSessionNestedInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedUpdateManyWithoutOrganizationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + appliedTemplateId: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), +}).strict(); + +export const ImportTemplateUpdateWithoutOrganizationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + createdBy: z.lazy(() => UserUpdateOneRequiredWithoutCreatedImportTemplatesNestedInputSchema).optional(), + sessions: z.lazy(() => ImportSessionUpdateManyWithoutAppliedTemplateNestedInputSchema).optional() +}).strict(); + +export const ImportTemplateUncheckedUpdateWithoutOrganizationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + sessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutAppliedTemplateNestedInputSchema).optional() +}).strict(); + +export const ImportTemplateUncheckedUpdateManyWithoutOrganizationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowCreateManySessionInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + rowNumber: z.number().int(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.lazy(() => RowStatusSchema).optional(), + dedupeHint: z.string().optional().nullable(), + score: z.number().int().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional() +}).strict(); + +export const ImportRowIssueCreateManySessionInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + rowId: z.string(), + field: z.string().optional().nullable(), + severity: z.lazy(() => IssueSeveritySchema), + message: z.string(), + hint: z.string().optional().nullable(), + value: z.string().optional().nullable(), + createdAt: z.coerce.date().optional() +}).strict(); + +export const ImportRowUpdateWithoutSessionInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowNumber: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => EnumRowStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeHint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + score: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + issues: z.lazy(() => ImportRowIssueUpdateManyWithoutRowNestedInputSchema).optional() +}).strict(); + +export const ImportRowUncheckedUpdateWithoutSessionInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowNumber: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => EnumRowStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeHint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + score: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + issues: z.lazy(() => ImportRowIssueUncheckedUpdateManyWithoutRowNestedInputSchema).optional() +}).strict(); + +export const ImportRowUncheckedUpdateManyWithoutSessionInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowNumber: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + rawData: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + mappedData: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + status: z.union([ z.lazy(() => RowStatusSchema),z.lazy(() => EnumRowStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeHint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + score: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowIssueUpdateWithoutSessionInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + field: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + severity: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => EnumIssueSeverityFieldUpdateOperationsInputSchema) ]).optional(), + message: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + hint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + value: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + row: z.lazy(() => ImportRowUpdateOneRequiredWithoutIssuesNestedInputSchema).optional() +}).strict(); + +export const ImportRowIssueUncheckedUpdateWithoutSessionInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + field: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + severity: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => EnumIssueSeverityFieldUpdateOperationsInputSchema) ]).optional(), + message: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + hint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + value: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowIssueUncheckedUpdateManyWithoutSessionInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + rowId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + field: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + severity: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => EnumIssueSeverityFieldUpdateOperationsInputSchema) ]).optional(), + message: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + hint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + value: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportSessionCreateManyAppliedTemplateInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + createdByUserId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable() +}).strict(); + +export const ImportSessionUpdateWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + organization: z.lazy(() => OrganizationUpdateOneRequiredWithoutImportSessionsNestedInputSchema).optional(), + createdBy: z.lazy(() => UserUpdateOneRequiredWithoutCreatedImportSessionsNestedInputSchema).optional(), + rows: z.lazy(() => ImportRowUpdateManyWithoutSessionNestedInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUpdateManyWithoutSessionNestedInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedUpdateWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + rows: z.lazy(() => ImportRowUncheckedUpdateManyWithoutSessionNestedInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUncheckedUpdateManyWithoutSessionNestedInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedUpdateManyWithoutAppliedTemplateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + createdByUserId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), +}).strict(); + +export const ImportRowIssueCreateManyRowInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + sessionId: z.string(), + field: z.string().optional().nullable(), + severity: z.lazy(() => IssueSeveritySchema), + message: z.string(), + hint: z.string().optional().nullable(), + value: z.string().optional().nullable(), + createdAt: z.coerce.date().optional() +}).strict(); + +export const ImportRowIssueUpdateWithoutRowInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + field: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + severity: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => EnumIssueSeverityFieldUpdateOperationsInputSchema) ]).optional(), + message: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + hint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + value: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + session: z.lazy(() => ImportSessionUpdateOneRequiredWithoutIssuesNestedInputSchema).optional() +}).strict(); + +export const ImportRowIssueUncheckedUpdateWithoutRowInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + sessionId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + field: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + severity: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => EnumIssueSeverityFieldUpdateOperationsInputSchema) ]).optional(), + message: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + hint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + value: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + +export const ImportRowIssueUncheckedUpdateManyWithoutRowInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + sessionId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + field: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + severity: z.union([ z.lazy(() => IssueSeveritySchema),z.lazy(() => EnumIssueSeverityFieldUpdateOperationsInputSchema) ]).optional(), + message: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + hint: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + value: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + export const CustomerInteractionCreateManyCustomerInputSchema: z.ZodType = z.object({ id: z.string().cuid().optional(), type: z.lazy(() => InteractionTypeSchema), @@ -51573,6 +55753,44 @@ export const AccountCreateManyUserInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + fileName: z.string(), + fileSize: z.number().int(), + fileType: z.string().optional().nullable(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + status: z.lazy(() => ImportStatusSchema).optional(), + dedupeMode: z.lazy(() => DedupeModeSchema).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.number().int().optional().nullable(), + processedCount: z.number().int().optional(), + successCount: z.number().int().optional(), + failureCount: z.number().int().optional(), + skippedCount: z.number().int().optional(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional(), + startedAt: z.coerce.date().optional().nullable(), + completedAt: z.coerce.date().optional().nullable(), + appliedTemplateId: z.string().optional().nullable() +}).strict(); + +export const ImportTemplateCreateManyCreatedByInputSchema: z.ZodType = z.object({ + id: z.string().cuid().optional(), + organizationId: z.string(), + name: z.string(), + module: z.lazy(() => ImportModuleSchema), + entityType: z.lazy(() => ImportEntityTypeSchema), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), + usageCount: z.number().int().optional(), + lastUsedAt: z.coerce.date().optional().nullable(), + createdAt: z.coerce.date().optional(), + updatedAt: z.coerce.date().optional() +}).strict(); + export const SessionUpdateWithoutUserInputSchema: z.ZodType = z.object({ id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), expiresAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), @@ -51648,6 +55866,126 @@ export const AccountUncheckedUpdateManyWithoutUserInputSchema: z.ZodType DateTimeFieldUpdateOperationsInputSchema) ]).optional(), }).strict(); +export const ImportSessionUpdateWithoutCreatedByInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + organization: z.lazy(() => OrganizationUpdateOneRequiredWithoutImportSessionsNestedInputSchema).optional(), + rows: z.lazy(() => ImportRowUpdateManyWithoutSessionNestedInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUpdateManyWithoutSessionNestedInputSchema).optional(), + appliedTemplate: z.lazy(() => ImportTemplateUpdateOneWithoutSessionsNestedInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedUpdateWithoutCreatedByInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + appliedTemplateId: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + rows: z.lazy(() => ImportRowUncheckedUpdateManyWithoutSessionNestedInputSchema).optional(), + issues: z.lazy(() => ImportRowIssueUncheckedUpdateManyWithoutSessionNestedInputSchema).optional() +}).strict(); + +export const ImportSessionUncheckedUpdateManyWithoutCreatedByInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileName: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + fileSize: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + fileType: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + status: z.union([ z.lazy(() => ImportStatusSchema),z.lazy(() => EnumImportStatusFieldUpdateOperationsInputSchema) ]).optional(), + dedupeMode: z.union([ z.lazy(() => DedupeModeSchema),z.lazy(() => EnumDedupeModeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + summary: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + rowCount: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), + processedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + successCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + failureCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + skippedCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + startedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + completedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + appliedTemplateId: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(), +}).strict(); + +export const ImportTemplateUpdateWithoutCreatedByInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + organization: z.lazy(() => OrganizationUpdateOneRequiredWithoutImportTemplatesNestedInputSchema).optional(), + sessions: z.lazy(() => ImportSessionUpdateManyWithoutAppliedTemplateNestedInputSchema).optional() +}).strict(); + +export const ImportTemplateUncheckedUpdateWithoutCreatedByInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + sessions: z.lazy(() => ImportSessionUncheckedUpdateManyWithoutAppliedTemplateNestedInputSchema).optional() +}).strict(); + +export const ImportTemplateUncheckedUpdateManyWithoutCreatedByInputSchema: z.ZodType = z.object({ + id: z.union([ z.string().cuid(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + organizationId: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + name: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + module: z.union([ z.lazy(() => ImportModuleSchema),z.lazy(() => EnumImportModuleFieldUpdateOperationsInputSchema) ]).optional(), + entityType: z.union([ z.lazy(() => ImportEntityTypeSchema),z.lazy(() => EnumImportEntityTypeFieldUpdateOperationsInputSchema) ]).optional(), + mappingConfig: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + columnSignature: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]).optional(), + usageCount: z.union([ z.number().int(),z.lazy(() => IntFieldUpdateOperationsInputSchema) ]).optional(), + lastUsedAt: z.union([ z.coerce.date(),z.lazy(() => NullableDateTimeFieldUpdateOperationsInputSchema) ]).optional().nullable(), + createdAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), + updatedAt: z.union([ z.coerce.date(),z.lazy(() => DateTimeFieldUpdateOperationsInputSchema) ]).optional(), +}).strict(); + export const FinancialReportDataCreateManyReportInputSchema: z.ZodType = z.object({ id: z.string().cuid().optional(), data: z.union([ z.lazy(() => JsonNullValueInputSchema),InputJsonValueSchema ]), @@ -53716,6 +58054,254 @@ export const OrganizationFindUniqueOrThrowArgsSchema: z.ZodType = z.object({ + select: ImportSessionSelectSchema.optional(), + include: ImportSessionIncludeSchema.optional(), + where: ImportSessionWhereInputSchema.optional(), + orderBy: z.union([ ImportSessionOrderByWithRelationInputSchema.array(),ImportSessionOrderByWithRelationInputSchema ]).optional(), + cursor: ImportSessionWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportSessionScalarFieldEnumSchema,ImportSessionScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportSessionFindFirstOrThrowArgsSchema: z.ZodType = z.object({ + select: ImportSessionSelectSchema.optional(), + include: ImportSessionIncludeSchema.optional(), + where: ImportSessionWhereInputSchema.optional(), + orderBy: z.union([ ImportSessionOrderByWithRelationInputSchema.array(),ImportSessionOrderByWithRelationInputSchema ]).optional(), + cursor: ImportSessionWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportSessionScalarFieldEnumSchema,ImportSessionScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportSessionFindManyArgsSchema: z.ZodType = z.object({ + select: ImportSessionSelectSchema.optional(), + include: ImportSessionIncludeSchema.optional(), + where: ImportSessionWhereInputSchema.optional(), + orderBy: z.union([ ImportSessionOrderByWithRelationInputSchema.array(),ImportSessionOrderByWithRelationInputSchema ]).optional(), + cursor: ImportSessionWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportSessionScalarFieldEnumSchema,ImportSessionScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportSessionAggregateArgsSchema: z.ZodType = z.object({ + where: ImportSessionWhereInputSchema.optional(), + orderBy: z.union([ ImportSessionOrderByWithRelationInputSchema.array(),ImportSessionOrderByWithRelationInputSchema ]).optional(), + cursor: ImportSessionWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() ; + +export const ImportSessionGroupByArgsSchema: z.ZodType = z.object({ + where: ImportSessionWhereInputSchema.optional(), + orderBy: z.union([ ImportSessionOrderByWithAggregationInputSchema.array(),ImportSessionOrderByWithAggregationInputSchema ]).optional(), + by: ImportSessionScalarFieldEnumSchema.array(), + having: ImportSessionScalarWhereWithAggregatesInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() ; + +export const ImportSessionFindUniqueArgsSchema: z.ZodType = z.object({ + select: ImportSessionSelectSchema.optional(), + include: ImportSessionIncludeSchema.optional(), + where: ImportSessionWhereUniqueInputSchema, +}).strict() ; + +export const ImportSessionFindUniqueOrThrowArgsSchema: z.ZodType = z.object({ + select: ImportSessionSelectSchema.optional(), + include: ImportSessionIncludeSchema.optional(), + where: ImportSessionWhereUniqueInputSchema, +}).strict() ; + +export const ImportTemplateFindFirstArgsSchema: z.ZodType = z.object({ + select: ImportTemplateSelectSchema.optional(), + include: ImportTemplateIncludeSchema.optional(), + where: ImportTemplateWhereInputSchema.optional(), + orderBy: z.union([ ImportTemplateOrderByWithRelationInputSchema.array(),ImportTemplateOrderByWithRelationInputSchema ]).optional(), + cursor: ImportTemplateWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportTemplateScalarFieldEnumSchema,ImportTemplateScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportTemplateFindFirstOrThrowArgsSchema: z.ZodType = z.object({ + select: ImportTemplateSelectSchema.optional(), + include: ImportTemplateIncludeSchema.optional(), + where: ImportTemplateWhereInputSchema.optional(), + orderBy: z.union([ ImportTemplateOrderByWithRelationInputSchema.array(),ImportTemplateOrderByWithRelationInputSchema ]).optional(), + cursor: ImportTemplateWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportTemplateScalarFieldEnumSchema,ImportTemplateScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportTemplateFindManyArgsSchema: z.ZodType = z.object({ + select: ImportTemplateSelectSchema.optional(), + include: ImportTemplateIncludeSchema.optional(), + where: ImportTemplateWhereInputSchema.optional(), + orderBy: z.union([ ImportTemplateOrderByWithRelationInputSchema.array(),ImportTemplateOrderByWithRelationInputSchema ]).optional(), + cursor: ImportTemplateWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportTemplateScalarFieldEnumSchema,ImportTemplateScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportTemplateAggregateArgsSchema: z.ZodType = z.object({ + where: ImportTemplateWhereInputSchema.optional(), + orderBy: z.union([ ImportTemplateOrderByWithRelationInputSchema.array(),ImportTemplateOrderByWithRelationInputSchema ]).optional(), + cursor: ImportTemplateWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() ; + +export const ImportTemplateGroupByArgsSchema: z.ZodType = z.object({ + where: ImportTemplateWhereInputSchema.optional(), + orderBy: z.union([ ImportTemplateOrderByWithAggregationInputSchema.array(),ImportTemplateOrderByWithAggregationInputSchema ]).optional(), + by: ImportTemplateScalarFieldEnumSchema.array(), + having: ImportTemplateScalarWhereWithAggregatesInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() ; + +export const ImportTemplateFindUniqueArgsSchema: z.ZodType = z.object({ + select: ImportTemplateSelectSchema.optional(), + include: ImportTemplateIncludeSchema.optional(), + where: ImportTemplateWhereUniqueInputSchema, +}).strict() ; + +export const ImportTemplateFindUniqueOrThrowArgsSchema: z.ZodType = z.object({ + select: ImportTemplateSelectSchema.optional(), + include: ImportTemplateIncludeSchema.optional(), + where: ImportTemplateWhereUniqueInputSchema, +}).strict() ; + +export const ImportRowFindFirstArgsSchema: z.ZodType = z.object({ + select: ImportRowSelectSchema.optional(), + include: ImportRowIncludeSchema.optional(), + where: ImportRowWhereInputSchema.optional(), + orderBy: z.union([ ImportRowOrderByWithRelationInputSchema.array(),ImportRowOrderByWithRelationInputSchema ]).optional(), + cursor: ImportRowWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportRowScalarFieldEnumSchema,ImportRowScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportRowFindFirstOrThrowArgsSchema: z.ZodType = z.object({ + select: ImportRowSelectSchema.optional(), + include: ImportRowIncludeSchema.optional(), + where: ImportRowWhereInputSchema.optional(), + orderBy: z.union([ ImportRowOrderByWithRelationInputSchema.array(),ImportRowOrderByWithRelationInputSchema ]).optional(), + cursor: ImportRowWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportRowScalarFieldEnumSchema,ImportRowScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportRowFindManyArgsSchema: z.ZodType = z.object({ + select: ImportRowSelectSchema.optional(), + include: ImportRowIncludeSchema.optional(), + where: ImportRowWhereInputSchema.optional(), + orderBy: z.union([ ImportRowOrderByWithRelationInputSchema.array(),ImportRowOrderByWithRelationInputSchema ]).optional(), + cursor: ImportRowWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportRowScalarFieldEnumSchema,ImportRowScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportRowAggregateArgsSchema: z.ZodType = z.object({ + where: ImportRowWhereInputSchema.optional(), + orderBy: z.union([ ImportRowOrderByWithRelationInputSchema.array(),ImportRowOrderByWithRelationInputSchema ]).optional(), + cursor: ImportRowWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() ; + +export const ImportRowGroupByArgsSchema: z.ZodType = z.object({ + where: ImportRowWhereInputSchema.optional(), + orderBy: z.union([ ImportRowOrderByWithAggregationInputSchema.array(),ImportRowOrderByWithAggregationInputSchema ]).optional(), + by: ImportRowScalarFieldEnumSchema.array(), + having: ImportRowScalarWhereWithAggregatesInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() ; + +export const ImportRowFindUniqueArgsSchema: z.ZodType = z.object({ + select: ImportRowSelectSchema.optional(), + include: ImportRowIncludeSchema.optional(), + where: ImportRowWhereUniqueInputSchema, +}).strict() ; + +export const ImportRowFindUniqueOrThrowArgsSchema: z.ZodType = z.object({ + select: ImportRowSelectSchema.optional(), + include: ImportRowIncludeSchema.optional(), + where: ImportRowWhereUniqueInputSchema, +}).strict() ; + +export const ImportRowIssueFindFirstArgsSchema: z.ZodType = z.object({ + select: ImportRowIssueSelectSchema.optional(), + include: ImportRowIssueIncludeSchema.optional(), + where: ImportRowIssueWhereInputSchema.optional(), + orderBy: z.union([ ImportRowIssueOrderByWithRelationInputSchema.array(),ImportRowIssueOrderByWithRelationInputSchema ]).optional(), + cursor: ImportRowIssueWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportRowIssueScalarFieldEnumSchema,ImportRowIssueScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportRowIssueFindFirstOrThrowArgsSchema: z.ZodType = z.object({ + select: ImportRowIssueSelectSchema.optional(), + include: ImportRowIssueIncludeSchema.optional(), + where: ImportRowIssueWhereInputSchema.optional(), + orderBy: z.union([ ImportRowIssueOrderByWithRelationInputSchema.array(),ImportRowIssueOrderByWithRelationInputSchema ]).optional(), + cursor: ImportRowIssueWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportRowIssueScalarFieldEnumSchema,ImportRowIssueScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportRowIssueFindManyArgsSchema: z.ZodType = z.object({ + select: ImportRowIssueSelectSchema.optional(), + include: ImportRowIssueIncludeSchema.optional(), + where: ImportRowIssueWhereInputSchema.optional(), + orderBy: z.union([ ImportRowIssueOrderByWithRelationInputSchema.array(),ImportRowIssueOrderByWithRelationInputSchema ]).optional(), + cursor: ImportRowIssueWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: z.union([ ImportRowIssueScalarFieldEnumSchema,ImportRowIssueScalarFieldEnumSchema.array() ]).optional(), +}).strict() ; + +export const ImportRowIssueAggregateArgsSchema: z.ZodType = z.object({ + where: ImportRowIssueWhereInputSchema.optional(), + orderBy: z.union([ ImportRowIssueOrderByWithRelationInputSchema.array(),ImportRowIssueOrderByWithRelationInputSchema ]).optional(), + cursor: ImportRowIssueWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() ; + +export const ImportRowIssueGroupByArgsSchema: z.ZodType = z.object({ + where: ImportRowIssueWhereInputSchema.optional(), + orderBy: z.union([ ImportRowIssueOrderByWithAggregationInputSchema.array(),ImportRowIssueOrderByWithAggregationInputSchema ]).optional(), + by: ImportRowIssueScalarFieldEnumSchema.array(), + having: ImportRowIssueScalarWhereWithAggregatesInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() ; + +export const ImportRowIssueFindUniqueArgsSchema: z.ZodType = z.object({ + select: ImportRowIssueSelectSchema.optional(), + include: ImportRowIssueIncludeSchema.optional(), + where: ImportRowIssueWhereUniqueInputSchema, +}).strict() ; + +export const ImportRowIssueFindUniqueOrThrowArgsSchema: z.ZodType = z.object({ + select: ImportRowIssueSelectSchema.optional(), + include: ImportRowIssueIncludeSchema.optional(), + where: ImportRowIssueWhereUniqueInputSchema, +}).strict() ; + export const UserOrganizationFindFirstArgsSchema: z.ZodType = z.object({ select: UserOrganizationSelectSchema.optional(), include: UserOrganizationIncludeSchema.optional(), @@ -58023,6 +62609,190 @@ export const OrganizationDeleteManyArgsSchema: z.ZodType = z.object({ + select: ImportSessionSelectSchema.optional(), + include: ImportSessionIncludeSchema.optional(), + data: z.union([ ImportSessionCreateInputSchema,ImportSessionUncheckedCreateInputSchema ]), +}).strict() ; + +export const ImportSessionUpsertArgsSchema: z.ZodType = z.object({ + select: ImportSessionSelectSchema.optional(), + include: ImportSessionIncludeSchema.optional(), + where: ImportSessionWhereUniqueInputSchema, + create: z.union([ ImportSessionCreateInputSchema,ImportSessionUncheckedCreateInputSchema ]), + update: z.union([ ImportSessionUpdateInputSchema,ImportSessionUncheckedUpdateInputSchema ]), +}).strict() ; + +export const ImportSessionCreateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportSessionCreateManyInputSchema,ImportSessionCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() ; + +export const ImportSessionCreateManyAndReturnArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportSessionCreateManyInputSchema,ImportSessionCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() ; + +export const ImportSessionDeleteArgsSchema: z.ZodType = z.object({ + select: ImportSessionSelectSchema.optional(), + include: ImportSessionIncludeSchema.optional(), + where: ImportSessionWhereUniqueInputSchema, +}).strict() ; + +export const ImportSessionUpdateArgsSchema: z.ZodType = z.object({ + select: ImportSessionSelectSchema.optional(), + include: ImportSessionIncludeSchema.optional(), + data: z.union([ ImportSessionUpdateInputSchema,ImportSessionUncheckedUpdateInputSchema ]), + where: ImportSessionWhereUniqueInputSchema, +}).strict() ; + +export const ImportSessionUpdateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportSessionUpdateManyMutationInputSchema,ImportSessionUncheckedUpdateManyInputSchema ]), + where: ImportSessionWhereInputSchema.optional(), +}).strict() ; + +export const ImportSessionDeleteManyArgsSchema: z.ZodType = z.object({ + where: ImportSessionWhereInputSchema.optional(), +}).strict() ; + +export const ImportTemplateCreateArgsSchema: z.ZodType = z.object({ + select: ImportTemplateSelectSchema.optional(), + include: ImportTemplateIncludeSchema.optional(), + data: z.union([ ImportTemplateCreateInputSchema,ImportTemplateUncheckedCreateInputSchema ]), +}).strict() ; + +export const ImportTemplateUpsertArgsSchema: z.ZodType = z.object({ + select: ImportTemplateSelectSchema.optional(), + include: ImportTemplateIncludeSchema.optional(), + where: ImportTemplateWhereUniqueInputSchema, + create: z.union([ ImportTemplateCreateInputSchema,ImportTemplateUncheckedCreateInputSchema ]), + update: z.union([ ImportTemplateUpdateInputSchema,ImportTemplateUncheckedUpdateInputSchema ]), +}).strict() ; + +export const ImportTemplateCreateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportTemplateCreateManyInputSchema,ImportTemplateCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() ; + +export const ImportTemplateCreateManyAndReturnArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportTemplateCreateManyInputSchema,ImportTemplateCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() ; + +export const ImportTemplateDeleteArgsSchema: z.ZodType = z.object({ + select: ImportTemplateSelectSchema.optional(), + include: ImportTemplateIncludeSchema.optional(), + where: ImportTemplateWhereUniqueInputSchema, +}).strict() ; + +export const ImportTemplateUpdateArgsSchema: z.ZodType = z.object({ + select: ImportTemplateSelectSchema.optional(), + include: ImportTemplateIncludeSchema.optional(), + data: z.union([ ImportTemplateUpdateInputSchema,ImportTemplateUncheckedUpdateInputSchema ]), + where: ImportTemplateWhereUniqueInputSchema, +}).strict() ; + +export const ImportTemplateUpdateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportTemplateUpdateManyMutationInputSchema,ImportTemplateUncheckedUpdateManyInputSchema ]), + where: ImportTemplateWhereInputSchema.optional(), +}).strict() ; + +export const ImportTemplateDeleteManyArgsSchema: z.ZodType = z.object({ + where: ImportTemplateWhereInputSchema.optional(), +}).strict() ; + +export const ImportRowCreateArgsSchema: z.ZodType = z.object({ + select: ImportRowSelectSchema.optional(), + include: ImportRowIncludeSchema.optional(), + data: z.union([ ImportRowCreateInputSchema,ImportRowUncheckedCreateInputSchema ]), +}).strict() ; + +export const ImportRowUpsertArgsSchema: z.ZodType = z.object({ + select: ImportRowSelectSchema.optional(), + include: ImportRowIncludeSchema.optional(), + where: ImportRowWhereUniqueInputSchema, + create: z.union([ ImportRowCreateInputSchema,ImportRowUncheckedCreateInputSchema ]), + update: z.union([ ImportRowUpdateInputSchema,ImportRowUncheckedUpdateInputSchema ]), +}).strict() ; + +export const ImportRowCreateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportRowCreateManyInputSchema,ImportRowCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() ; + +export const ImportRowCreateManyAndReturnArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportRowCreateManyInputSchema,ImportRowCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() ; + +export const ImportRowDeleteArgsSchema: z.ZodType = z.object({ + select: ImportRowSelectSchema.optional(), + include: ImportRowIncludeSchema.optional(), + where: ImportRowWhereUniqueInputSchema, +}).strict() ; + +export const ImportRowUpdateArgsSchema: z.ZodType = z.object({ + select: ImportRowSelectSchema.optional(), + include: ImportRowIncludeSchema.optional(), + data: z.union([ ImportRowUpdateInputSchema,ImportRowUncheckedUpdateInputSchema ]), + where: ImportRowWhereUniqueInputSchema, +}).strict() ; + +export const ImportRowUpdateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportRowUpdateManyMutationInputSchema,ImportRowUncheckedUpdateManyInputSchema ]), + where: ImportRowWhereInputSchema.optional(), +}).strict() ; + +export const ImportRowDeleteManyArgsSchema: z.ZodType = z.object({ + where: ImportRowWhereInputSchema.optional(), +}).strict() ; + +export const ImportRowIssueCreateArgsSchema: z.ZodType = z.object({ + select: ImportRowIssueSelectSchema.optional(), + include: ImportRowIssueIncludeSchema.optional(), + data: z.union([ ImportRowIssueCreateInputSchema,ImportRowIssueUncheckedCreateInputSchema ]), +}).strict() ; + +export const ImportRowIssueUpsertArgsSchema: z.ZodType = z.object({ + select: ImportRowIssueSelectSchema.optional(), + include: ImportRowIssueIncludeSchema.optional(), + where: ImportRowIssueWhereUniqueInputSchema, + create: z.union([ ImportRowIssueCreateInputSchema,ImportRowIssueUncheckedCreateInputSchema ]), + update: z.union([ ImportRowIssueUpdateInputSchema,ImportRowIssueUncheckedUpdateInputSchema ]), +}).strict() ; + +export const ImportRowIssueCreateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportRowIssueCreateManyInputSchema,ImportRowIssueCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() ; + +export const ImportRowIssueCreateManyAndReturnArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportRowIssueCreateManyInputSchema,ImportRowIssueCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() ; + +export const ImportRowIssueDeleteArgsSchema: z.ZodType = z.object({ + select: ImportRowIssueSelectSchema.optional(), + include: ImportRowIssueIncludeSchema.optional(), + where: ImportRowIssueWhereUniqueInputSchema, +}).strict() ; + +export const ImportRowIssueUpdateArgsSchema: z.ZodType = z.object({ + select: ImportRowIssueSelectSchema.optional(), + include: ImportRowIssueIncludeSchema.optional(), + data: z.union([ ImportRowIssueUpdateInputSchema,ImportRowIssueUncheckedUpdateInputSchema ]), + where: ImportRowIssueWhereUniqueInputSchema, +}).strict() ; + +export const ImportRowIssueUpdateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ ImportRowIssueUpdateManyMutationInputSchema,ImportRowIssueUncheckedUpdateManyInputSchema ]), + where: ImportRowIssueWhereInputSchema.optional(), +}).strict() ; + +export const ImportRowIssueDeleteManyArgsSchema: z.ZodType = z.object({ + where: ImportRowIssueWhereInputSchema.optional(), +}).strict() ; + export const UserOrganizationCreateArgsSchema: z.ZodType = z.object({ select: UserOrganizationSelectSchema.optional(), include: UserOrganizationIncludeSchema.optional(), diff --git a/prisma/migrations/20251009152803_/migration.sql b/prisma/migrations/20251009152803_/migration.sql new file mode 100644 index 0000000..bbb0e6d --- /dev/null +++ b/prisma/migrations/20251009152803_/migration.sql @@ -0,0 +1,154 @@ +-- CreateEnum +CREATE TYPE "ImportModule" AS ENUM ('CRM', 'HR', 'FINANCE', 'PROJECTS'); + +-- CreateEnum +CREATE TYPE "ImportEntityType" AS ENUM ('CONTACT', 'ORGANIZATION', 'DEAL'); + +-- CreateEnum +CREATE TYPE "ImportStatus" AS ENUM ('DRAFT', 'UPLOADING', 'DETECTING', 'MAPPING_REVIEW', 'VALIDATING', 'VALIDATION_FAILED', 'READY_TO_IMPORT', 'IMPORTING', 'COMPLETED', 'IMPORT_FAILED', 'CANCELLED', 'RETRY_QUEUED'); + +-- CreateEnum +CREATE TYPE "DedupeMode" AS ENUM ('SKIP', 'UPDATE', 'CREATE'); + +-- CreateEnum +CREATE TYPE "RowStatus" AS ENUM ('PENDING', 'VALIDATED', 'IMPORTED', 'FAILED', 'SKIPPED'); + +-- CreateEnum +CREATE TYPE "IssueSeverity" AS ENUM ('ERROR', 'WARNING'); + +-- CreateTable +CREATE TABLE "ImportSession" ( + "id" TEXT NOT NULL, + "organizationId" TEXT NOT NULL, + "createdByUserId" TEXT NOT NULL, + "fileName" TEXT NOT NULL, + "fileSize" INTEGER NOT NULL, + "fileType" TEXT, + "module" "ImportModule" NOT NULL, + "entityType" "ImportEntityType" NOT NULL, + "status" "ImportStatus" NOT NULL DEFAULT 'DRAFT', + "dedupeMode" "DedupeMode" NOT NULL DEFAULT 'SKIP', + "mappingConfig" JSONB, + "summary" JSONB, + "rowCount" INTEGER, + "processedCount" INTEGER NOT NULL DEFAULT 0, + "successCount" INTEGER NOT NULL DEFAULT 0, + "failureCount" INTEGER NOT NULL DEFAULT 0, + "skippedCount" INTEGER NOT NULL DEFAULT 0, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + "startedAt" TIMESTAMP(3), + "completedAt" TIMESTAMP(3), + "appliedTemplateId" TEXT, + + CONSTRAINT "ImportSession_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ImportTemplate" ( + "id" TEXT NOT NULL, + "organizationId" TEXT NOT NULL, + "createdByUserId" TEXT NOT NULL, + "name" TEXT NOT NULL, + "module" "ImportModule" NOT NULL, + "entityType" "ImportEntityType" NOT NULL, + "mappingConfig" JSONB NOT NULL, + "columnSignature" JSONB NOT NULL, + "usageCount" INTEGER NOT NULL DEFAULT 0, + "lastUsedAt" TIMESTAMP(3), + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "ImportTemplate_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ImportRow" ( + "id" TEXT NOT NULL, + "sessionId" TEXT NOT NULL, + "rowNumber" INTEGER NOT NULL, + "rawData" JSONB NOT NULL, + "mappedData" JSONB, + "status" "RowStatus" NOT NULL DEFAULT 'PENDING', + "dedupeHint" TEXT, + "score" INTEGER, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "ImportRow_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "ImportRowIssue" ( + "id" TEXT NOT NULL, + "sessionId" TEXT NOT NULL, + "rowId" TEXT NOT NULL, + "field" TEXT, + "severity" "IssueSeverity" NOT NULL, + "message" TEXT NOT NULL, + "hint" TEXT, + "value" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "ImportRowIssue_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE INDEX "ImportSession_organizationId_idx" ON "ImportSession"("organizationId"); + +-- CreateIndex +CREATE INDEX "ImportSession_status_idx" ON "ImportSession"("status"); + +-- CreateIndex +CREATE INDEX "ImportSession_createdByUserId_idx" ON "ImportSession"("createdByUserId"); + +-- CreateIndex +CREATE INDEX "ImportSession_appliedTemplateId_idx" ON "ImportSession"("appliedTemplateId"); + +-- CreateIndex +CREATE INDEX "ImportTemplate_organizationId_idx" ON "ImportTemplate"("organizationId"); + +-- CreateIndex +CREATE INDEX "ImportTemplate_module_entityType_idx" ON "ImportTemplate"("module", "entityType"); + +-- CreateIndex +CREATE INDEX "ImportTemplate_createdByUserId_idx" ON "ImportTemplate"("createdByUserId"); + +-- CreateIndex +CREATE UNIQUE INDEX "ImportTemplate_organizationId_name_key" ON "ImportTemplate"("organizationId", "name"); + +-- CreateIndex +CREATE INDEX "ImportRow_sessionId_idx" ON "ImportRow"("sessionId"); + +-- CreateIndex +CREATE UNIQUE INDEX "ImportRow_sessionId_rowNumber_key" ON "ImportRow"("sessionId", "rowNumber"); + +-- CreateIndex +CREATE INDEX "ImportRowIssue_sessionId_idx" ON "ImportRowIssue"("sessionId"); + +-- CreateIndex +CREATE INDEX "ImportRowIssue_rowId_idx" ON "ImportRowIssue"("rowId"); + +-- AddForeignKey +ALTER TABLE "ImportSession" ADD CONSTRAINT "ImportSession_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ImportSession" ADD CONSTRAINT "ImportSession_createdByUserId_fkey" FOREIGN KEY ("createdByUserId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ImportSession" ADD CONSTRAINT "ImportSession_appliedTemplateId_fkey" FOREIGN KEY ("appliedTemplateId") REFERENCES "ImportTemplate"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ImportTemplate" ADD CONSTRAINT "ImportTemplate_organizationId_fkey" FOREIGN KEY ("organizationId") REFERENCES "Organization"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ImportTemplate" ADD CONSTRAINT "ImportTemplate_createdByUserId_fkey" FOREIGN KEY ("createdByUserId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ImportRow" ADD CONSTRAINT "ImportRow_sessionId_fkey" FOREIGN KEY ("sessionId") REFERENCES "ImportSession"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ImportRowIssue" ADD CONSTRAINT "ImportRowIssue_sessionId_fkey" FOREIGN KEY ("sessionId") REFERENCES "ImportSession"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "ImportRowIssue" ADD CONSTRAINT "ImportRowIssue_rowId_fkey" FOREIGN KEY ("rowId") REFERENCES "ImportRow"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 2a7a679..29addab 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -123,6 +123,156 @@ model Organization { templateShares TemplateShare[] templateShareImports TemplateShareImport[] uiConfigs OrganizationUiConfig[] + importSessions ImportSession[] + importTemplates ImportTemplate[] +} + +enum ImportModule { + CRM + HR + FINANCE + PROJECTS +} + +enum ImportEntityType { + CONTACT + ORGANIZATION + DEAL +} + +enum ImportStatus { + DRAFT + UPLOADING + DETECTING + MAPPING_REVIEW + VALIDATING + VALIDATION_FAILED + READY_TO_IMPORT + IMPORTING + COMPLETED + IMPORT_FAILED + CANCELLED + RETRY_QUEUED +} + +enum DedupeMode { + SKIP + UPDATE + CREATE +} + +enum RowStatus { + PENDING + VALIDATED + IMPORTED + FAILED + SKIPPED +} + +enum IssueSeverity { + ERROR + WARNING +} + +model ImportSession { + id String @id @default(cuid()) + organizationId String + createdByUserId String + fileName String + fileSize Int + fileType String? + module ImportModule + entityType ImportEntityType + status ImportStatus @default(DRAFT) + dedupeMode DedupeMode @default(SKIP) + mappingConfig Json? + summary Json? + rowCount Int? + processedCount Int @default(0) + successCount Int @default(0) + failureCount Int @default(0) + skippedCount Int @default(0) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + startedAt DateTime? + completedAt DateTime? + appliedTemplateId String? + + // Relations + organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade) + createdBy User @relation("CreatedImportSessions", fields: [createdByUserId], references: [id], onDelete: Cascade) + rows ImportRow[] + issues ImportRowIssue[] + appliedTemplate ImportTemplate? @relation(fields: [appliedTemplateId], references: [id], onDelete: SetNull) + + @@index([organizationId]) + @@index([status]) + @@index([createdByUserId]) + @@index([appliedTemplateId]) +} + +model ImportTemplate { + id String @id @default(cuid()) + organizationId String + createdByUserId String + name String + module ImportModule + entityType ImportEntityType + mappingConfig Json + columnSignature Json + usageCount Int @default(0) + lastUsedAt DateTime? + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + // Relations + organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade) + createdBy User @relation("CreatedImportTemplates", fields: [createdByUserId], references: [id], onDelete: Cascade) + sessions ImportSession[] + + @@unique([organizationId, name]) + @@index([organizationId]) + @@index([module, entityType]) + @@index([createdByUserId]) +} + +model ImportRow { + id String @id @default(cuid()) + sessionId String + rowNumber Int + rawData Json + mappedData Json? + status RowStatus @default(PENDING) + dedupeHint String? + score Int? // reserved for future confidence scoring + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + // Relations + session ImportSession @relation(fields: [sessionId], references: [id], onDelete: Cascade) + issues ImportRowIssue[] + + @@index([sessionId]) + @@unique([sessionId, rowNumber]) +} + +model ImportRowIssue { + id String @id @default(cuid()) + sessionId String + rowId String + field String? + severity IssueSeverity + message String + hint String? + value String? + createdAt DateTime @default(now()) + + // Relations + session ImportSession @relation(fields: [sessionId], references: [id], onDelete: Cascade) + row ImportRow @relation(fields: [rowId], references: [id], onDelete: Cascade) + + @@index([sessionId]) + @@index([rowId]) } model UserOrganization { @@ -1033,6 +1183,8 @@ model User { updatedAt DateTime sessions Session[] accounts Account[] + createdImportSessions ImportSession[] @relation("CreatedImportSessions") + createdImportTemplates ImportTemplate[] @relation("CreatedImportTemplates") @@unique([email]) @@map("user") diff --git a/src/app/(dashboard)/[orgId]/crm/import/page.tsx b/src/app/(dashboard)/[orgId]/crm/import/page.tsx new file mode 100644 index 0000000..621e620 --- /dev/null +++ b/src/app/(dashboard)/[orgId]/crm/import/page.tsx @@ -0,0 +1,5 @@ +import { CRMImportWizard } from "~/components/crm/import-wizard"; + +export default function CRMImportPage() { + return ; +} diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsx index 2508192..12ddbdf 100644 --- a/src/components/app-sidebar.tsx +++ b/src/components/app-sidebar.tsx @@ -105,6 +105,10 @@ export function AppSidebar({ ...props }: React.ComponentProps) { title: "Sales Pipeline", url: "/[orgId]/crm/pipeline", }, + { + title: "Import", + url: "/[orgId]/crm/import", + }, ], }); } diff --git a/src/components/crm/import-wizard/import-wizard.tsx b/src/components/crm/import-wizard/import-wizard.tsx new file mode 100644 index 0000000..1265354 --- /dev/null +++ b/src/components/crm/import-wizard/import-wizard.tsx @@ -0,0 +1,1757 @@ +"use client"; + +import { useCallback, useEffect, useMemo, useState } from "react"; +import Papa from "papaparse"; +import { read, utils } from "xlsx"; +import { useParams, useRouter } from "next/navigation"; +import { toast } from "sonner"; +import { + UploadCloud, + FileSpreadsheet, + ArrowLeft, + CheckCircle2, + Loader2, + Sparkles, + ShieldCheck, + ListChecks, +} from "lucide-react"; +import { + CRM_CONTACT_FIELDS, + CRM_REQUIRED_CONTACT_FIELDS, + DEDUPE_MODES, + type CRMContactFieldKey, + type DedupeModeValue, + type ImportRowRecord, + type ImportableValue, + isCRMContactField, +} from "~/lib/imports/definitions"; +import { + generateContactSchemaSuggestions, + type ColumnSuggestionMap, +} from "~/lib/imports/schema-detection"; +import { + applyTemplateEntriesToColumns, + type TemplateColumnSignature, + type TemplateMappingConfig, +} from "~/lib/imports/templates"; +import { Button } from "~/components/ui/button"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "~/components/ui/card"; +import { Badge } from "~/components/ui/badge"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "~/components/ui/select"; +import { Alert, AlertDescription, AlertTitle } from "~/components/ui/alert"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "~/components/ui/table"; +import { api } from "~/trpc/react"; +import { ClientPermissionGuard } from "~/components/shared/client-permission-guard"; +import { PERMISSIONS } from "~/lib/rbac"; +import Link from "next/link"; +import { + Dialog, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, +} from "~/components/ui/dialog"; +import { Input } from "~/components/ui/input"; + +type WizardStep = "upload" | "mapping" | "validation" | "summary"; + +interface ParsedDataset { + columns: string[]; + rows: ImportRowRecord[]; + rowCount: number; + samples: Record; + file: File; +} + +const MAX_ROWS_FOR_VALIDATION = 250; + +const CRM_FIELD_LABEL_LOOKUP: Record = + CRM_CONTACT_FIELDS.reduce( + (accumulator, field) => { + accumulator[field.key] = field.label; + return accumulator; + }, + {} as Record + ); + +const REQUIRED_FIELD_SET = new Set( + CRM_REQUIRED_CONTACT_FIELDS +); + +type ConfidenceLevel = "high" | "medium" | "low"; + +type TemplateSummary = { + id: string; + name: string; + usageCount: number; + lastUsedAt: string | null; + mapping: TemplateMappingConfig; + columnSignature: TemplateColumnSignature; + matchScore: number | null; + coverage: number | null; +}; + +function normalizeImportCellValue(value: unknown): ImportableValue { + if (value === undefined || value === null) { + return null; + } + + if (typeof value === "string") { + const trimmed = value.trim(); + return trimmed.length > 0 ? trimmed : null; + } + + if (value instanceof Date) { + const iso = value.toISOString(); + return iso.length > 0 ? iso : null; + } + + if (typeof value === "number") { + return Number.isFinite(value) ? value : null; + } + + if (typeof value === "boolean") { + return value; + } + + return null; +} + +function sanitizeColumnLabel(value: unknown): string { + if (value === null || value === undefined) { + return ""; + } + + if (typeof value === "string") { + return value.trim(); + } + + if (typeof value === "number") { + return Number.isFinite(value) ? value.toString() : ""; + } + + if (value instanceof Date) { + return value.toISOString(); + } + + return ""; +} + +function collectSamples(rows: ImportRowRecord[], column: string): string[] { + const seen = new Set(); + const samples: string[] = []; + + for (const row of rows) { + const value = row[column]; + if (value === null || value === undefined) { + continue; + } + + let text: string | null = null; + if (typeof value === "string") { + text = value; + } else if (typeof value === "number") { + text = Number.isFinite(value) ? value.toString() : null; + } else if (typeof value === "boolean") { + text = value ? "true" : "false"; + } + + if (text === null || text.length === 0 || seen.has(text)) { + continue; + } + + seen.add(text); + samples.push(text); + + if (samples.length >= 3) { + break; + } + } + + return samples; +} + +function getConfidenceLevel(confidence: number): ConfidenceLevel { + if (confidence >= 80) { + return "high"; + } + + if (confidence >= 50) { + return "medium"; + } + + return "low"; +} + +async function parseCsvFile( + file: File +): Promise> { + const text = await file.text(); + return await new Promise((resolve, reject) => { + Papa.parse>(text, { + header: true, + skipEmptyLines: "greedy", + delimiter: ",", + complete: result => { + if (result.errors.length > 0) { + reject(new Error(result.errors[0]?.message ?? "Failed to parse CSV")); + return; + } + + const fields = result.meta.fields ?? []; + const columns = fields + .filter((field): field is string => typeof field === "string") + .map(field => sanitizeColumnLabel(field)) + .filter(field => field.length > 0); + + const rows = result.data + .map(record => { + const row: ImportRowRecord = {}; + columns.forEach(column => { + row[column] = normalizeImportCellValue(record[column]); + }); + return row; + }) + .filter(row => columns.some(column => row[column] !== null)); + + resolve({ columns, rows }); + }, + error: (error: unknown) => { + reject(error instanceof Error ? error : new Error(String(error))); + }, + }); + }); +} + +async function parseExcelFile( + file: File +): Promise> { + const buffer = await file.arrayBuffer(); + const workbook = read(buffer, { type: "array" }); + const firstSheetName = workbook.SheetNames[0]; + + if (!firstSheetName) { + throw new Error("Unable to locate the first worksheet in the file"); + } + + const worksheet = workbook.Sheets[firstSheetName]; + if (!worksheet) { + throw new Error("Unable to read worksheet data from the file"); + } + const sheetRows = utils.sheet_to_json(worksheet, { + header: 1, + blankrows: false, + defval: null, + }); + + if (sheetRows.length === 0) { + return { columns: [], rows: [] }; + } + + const [headerRowRaw, ...dataRows] = sheetRows; + const headerRow = Array.isArray(headerRowRaw) ? headerRowRaw : []; + + const columns = headerRow + .map(cell => sanitizeColumnLabel(cell)) + .filter(cell => cell.length > 0); + + const rows = dataRows + .map(row => { + const record: ImportRowRecord = {}; + columns.forEach((column, index) => { + record[column] = normalizeImportCellValue( + Array.isArray(row) ? row[index] : null + ); + }); + return record; + }) + .filter(row => columns.some(column => row[column] !== null)); + + return { columns, rows }; +} + +async function parseFile(file: File): Promise { + const extension = file.name.split(".").pop()?.toLowerCase() ?? ""; + let parsed: Pick; + + if (extension === "xlsx" || extension === "xls") { + parsed = await parseExcelFile(file); + } else { + parsed = await parseCsvFile(file); + } + + const rowCount = parsed.rows.length; + const limitedRows = parsed.rows.slice(0, MAX_ROWS_FOR_VALIDATION); + + const samples: Record = {}; + parsed.columns.forEach(column => { + samples[column] = collectSamples(limitedRows, column); + }); + + return { + columns: parsed.columns, + rows: limitedRows, + samples, + rowCount, + file, + }; +} + +function StepIndicator({ step }: { step: WizardStep }) { + const steps: { id: WizardStep; label: string }[] = [ + { id: "upload", label: "Upload" }, + { id: "mapping", label: "Mapping" }, + { id: "validation", label: "Validation" }, + { id: "summary", label: "Summary" }, + ]; + + const activeIndex = steps.findIndex(entry => entry.id === step); + const progressPercentage = + activeIndex <= 0 + ? 0 + : Math.min(100, Math.round((activeIndex / (steps.length - 1)) * 100)); + + return ( +

+
+ {steps.map((item, index) => { + const isActive = activeIndex === index; + const isCompleted = index < activeIndex; + + return ( +
+
+ {isCompleted ? : index + 1} +
+ + {item.label} + +
+ ); + })} +
+
+
+
+
+ ); +} + +function formatFileSize(size: number): string { + if (size < 1024) { + return `${size} B`; + } + if (size < 1024 * 1024) { + return `${(size / 1024).toFixed(1)} KB`; + } + return `${(size / (1024 * 1024)).toFixed(1)} MB`; +} + +function ConfidenceBadge({ confidence }: { confidence: number }) { + const level = getConfidenceLevel(confidence); + const label = `${Math.round(confidence)}% match`; + + if (level === "high") { + return ( + + {label} + + ); + } + + if (level === "medium") { + return ( + + {label} + + ); + } + + return ( + + {label} + + ); +} + +export function CRMImportWizard() { + const params = useParams(); + const router = useRouter(); + const organizationId = params.orgId as string; + + const [step, setStep] = useState("upload"); + const [parsedDataset, setParsedDataset] = useState( + null + ); + const [mapping, setMapping] = useState< + Record + >({}); + const [columnSuggestions, setColumnSuggestions] = + useState({}); + const [dedupeMode, setDedupeMode] = useState("SKIP"); + const [sessionId, setSessionId] = useState(null); + const [appliedTemplateId, setAppliedTemplateId] = useState( + null + ); + const [isTemplateDialogOpen, setIsTemplateDialogOpen] = useState(false); + const [templateName, setTemplateName] = useState(""); + + const createSession = api.crmImport.createUploadSession.useMutation(); + const detectSchema = api.crmImport.detectSchema.useMutation(); + const validatePreview = api.crmImport.validateManualPreview.useMutation(); + const commitImport = api.crmImport.commitImport.useMutation(); + const templateQuery = api.crmImport.listTemplates.useQuery( + { + organizationId, + columns: parsedDataset?.columns ?? [], + }, + { + enabled: parsedDataset !== null, + staleTime: 60_000, + } + ); + const saveTemplateMutation = api.crmImport.saveTemplate.useMutation(); + const markTemplateUsage = api.crmImport.markTemplateUsage.useMutation(); + const sessionSummary = api.crmImport.getSessionSummary.useQuery( + sessionId && organizationId + ? { sessionId, organizationId } + : { sessionId: "", organizationId: "" }, + { + enabled: false, + } + ); + const templates = useMemo( + () => templateQuery.data ?? [], + [templateQuery.data] + ); + const isTemplateLoading = templateQuery.isLoading; + const templateLoadError = templateQuery.isError ? templateQuery.error : null; + + const recommendedTemplate = useMemo(() => { + if (templates.length === 0) { + return null; + } + + const ranked = [...templates].sort((a, b) => { + const aScore = a.matchScore ?? 0; + const bScore = b.matchScore ?? 0; + return bScore - aScore; + }); + + return ranked[0] ?? null; + }, [templates]); + + const otherTemplates = useMemo(() => { + if (!recommendedTemplate) { + return templates; + } + + return templates.filter(template => template.id !== recommendedTemplate.id); + }, [templates, recommendedTemplate]); + + const [validationResult, setValidationResult] = useState + > | null>(null); + const [commitResult, setCommitResult] = useState + > | null>(null); + const [isParsing, setIsParsing] = useState(false); + const mappingValues = useMemo(() => Object.values(mapping), [mapping]); + const mappedFieldCount = useMemo( + () => mappingValues.filter(value => value !== "").length, + [mappingValues] + ); + const requiredMissingFields = useMemo( + () => + CRM_REQUIRED_CONTACT_FIELDS.filter( + field => !mappingValues.includes(field) + ), + [mappingValues] + ); + const mappingCoverage = useMemo(() => { + if (!parsedDataset || parsedDataset.columns.length === 0) { + return 0; + } + return Math.round((mappedFieldCount / parsedDataset.columns.length) * 100); + }, [parsedDataset, mappedFieldCount]); + const showUploadOverlay = + isParsing || createSession.isPending || detectSchema.isPending; + const uploadOverlayMessage = useMemo(() => { + if (isParsing) { + return "Analyzing file"; + } + if (detectSchema.isPending) { + return "Detecting data schema"; + } + if (createSession.isPending) { + return "Preparing upload session"; + } + return "Processing"; + }, [isParsing, detectSchema.isPending, createSession.isPending]); + const showTemplateSkeleton = isTemplateLoading && templates.length === 0; + + const requiredFieldsSatisfied = useMemo(() => { + const mappedValues = new Set( + Object.values(mapping).filter( + (value): value is CRMContactFieldKey => value !== "" + ) + ); + + return CRM_REQUIRED_CONTACT_FIELDS.every(field => mappedValues.has(field)); + }, [mapping]); + const canSaveTemplate = + parsedDataset !== null && sessionId !== null && requiredFieldsSatisfied; + + const uploadDisabled = + createSession.isPending || detectSchema.isPending || isParsing; + const canProceedToValidation = + parsedDataset !== null && + sessionId !== null && + requiredFieldsSatisfied && + !validatePreview.isPending; + const canCommit = + validationResult?.summary.status === "READY_TO_IMPORT" && + !commitImport.isPending && + sessionId !== null; + + async function handleFileSelection(files: FileList | null) { + if (!files || files.length === 0) { + return; + } + + const file = files.item(0); + if (!file) { + toast.error("No file was provided. Please try again."); + return; + } + setIsParsing(true); + setAppliedTemplateId(null); + setTemplateName(""); + + try { + const dataset = await parseFile(file); + + if (dataset.columns.length === 0 || dataset.rows.length === 0) { + toast.error("We could not find any data rows in this file."); + setIsParsing(false); + return; + } + + const session = await createSession.mutateAsync({ + organizationId, + entityType: "CONTACT", + fileName: file.name, + fileSize: file.size, + fileType: file.type ?? undefined, + columns: dataset.columns, + rowCount: dataset.rowCount, + }); + + let detectionSuggestions: ColumnSuggestionMap = {}; + let recommendedMapping: Record = {}; + + try { + const detection = await detectSchema.mutateAsync({ + sessionId: session.id, + organizationId, + columns: dataset.columns, + sampleRows: dataset.rows, + }); + + detectionSuggestions = detection.columnSuggestions; + recommendedMapping = detection.recommendedMapping; + } catch (error) { + const fallback = generateContactSchemaSuggestions({ + columns: dataset.columns, + rows: dataset.rows, + }); + + detectionSuggestions = fallback.columnSuggestions; + recommendedMapping = fallback.recommendedMapping; + + const message = + error instanceof Error + ? error.message + : "Automatic detection failed. We generated suggestions locally."; + toast.warning(message); + } + + const initialMapping: Record = {}; + dataset.columns.forEach(column => { + const recommendedField = recommendedMapping[column] ?? null; + initialMapping[column] = recommendedField ?? ""; + }); + + setParsedDataset(dataset); + setColumnSuggestions(detectionSuggestions); + setMapping(initialMapping); + setSessionId(session.id); + setIsTemplateDialogOpen(false); + setStep("mapping"); + toast.success("File uploaded. Configure your field mapping next."); + } catch (error) { + const message = + error instanceof Error + ? error.message + : "Unable to read the selected file."; + toast.error(message); + } finally { + setIsParsing(false); + } + } + + function handleMappingChange(column: string, value: string) { + const normalizedValue = value === "empty" ? "" : value; + setMapping(current => ({ + ...current, + [column]: + normalizedValue === "" ? "" : (normalizedValue as CRMContactFieldKey), + })); + } + + function handleApplySuggestion(column: string, field: CRMContactFieldKey) { + setMapping(current => ({ + ...current, + [column]: field, + })); + } + + const handleApplyTemplate = useCallback( + (template: TemplateSummary, options?: { quiet?: boolean }) => { + if (!parsedDataset) { + return; + } + + const templateMapping = applyTemplateEntriesToColumns({ + entries: template.mapping.entries, + columns: parsedDataset.columns, + }); + + setMapping(current => { + const next = { ...current }; + parsedDataset.columns.forEach(column => { + const targetField = templateMapping[column]; + if (targetField) { + next[column] = targetField; + } + }); + return next; + }); + + setDedupeMode(template.mapping.dedupeMode); + setAppliedTemplateId(template.id); + + if (sessionId) { + markTemplateUsage.mutate({ + templateId: template.id, + organizationId, + sessionId, + }); + } + + if (!options?.quiet) { + toast.success(`Applied template "${template.name}".`); + } + }, + [parsedDataset, sessionId, markTemplateUsage, organizationId] + ); + + async function handleValidatePreview() { + if (!parsedDataset || sessionId === null) { + return; + } + + try { + const mappingPayload = parsedDataset.columns.map(column => { + const rawValue = mapping[column]; + const targetField: CRMContactFieldKey | null = + typeof rawValue === "string" && isCRMContactField(rawValue) + ? rawValue + : null; + + return { + sourceColumn: column, + targetField, + }; + }); + + const result = await validatePreview.mutateAsync({ + sessionId, + organizationId, + mapping: mappingPayload, + rows: parsedDataset.rows, + dedupeMode, + }); + + setValidationResult(result); + setCommitResult(null); + setStep("validation"); + toast.success( + "Preview generated. Review validation results before importing." + ); + } catch (error) { + const message = + error instanceof Error + ? error.message + : "Validation failed. Please review your mapping."; + toast.error(message); + } + } + + async function handleCommit() { + if (sessionId === null) { + return; + } + + try { + const result = await commitImport.mutateAsync({ + sessionId, + organizationId, + }); + + setCommitResult(result); + setStep("summary"); + toast.success("Import completed successfully."); + await sessionSummary.refetch(); + } catch (error) { + const message = + error instanceof Error + ? error.message + : "Import failed. Please try again."; + toast.error(message); + } + } + + async function handleSaveTemplate() { + if (!parsedDataset || sessionId === null) { + return; + } + + const trimmedName = templateName.trim(); + if (trimmedName.length < 2) { + toast.error("Template name must be at least 2 characters."); + return; + } + + try { + const mappingPayload = parsedDataset.columns.map(column => { + const rawValue = mapping[column]; + const targetField = + typeof rawValue === "string" && isCRMContactField(rawValue) + ? rawValue + : null; + + return { + sourceColumn: column, + targetField, + }; + }); + + const savedTemplate = await saveTemplateMutation.mutateAsync({ + sessionId, + organizationId, + name: trimmedName, + mapping: mappingPayload, + columns: parsedDataset.columns, + dedupeMode, + }); + + toast.success(`Saved template "${savedTemplate.name}".`); + setIsTemplateDialogOpen(false); + setTemplateName(""); + setAppliedTemplateId(savedTemplate.id); + await templateQuery.refetch(); + } catch (error) { + const message = + error instanceof Error + ? error.message + : "Unable to save this template. Please try again."; + toast.error(message); + } + } + + function resetWizard() { + setParsedDataset(null); + setMapping({}); + setDedupeMode("SKIP"); + setColumnSuggestions({}); + setSessionId(null); + setValidationResult(null); + setCommitResult(null); + setStep("upload"); + setAppliedTemplateId(null); + setTemplateName(""); + setIsTemplateDialogOpen(false); + } + + useEffect(() => { + if ( + step === "mapping" && + parsedDataset && + recommendedTemplate && + appliedTemplateId === null && + (recommendedTemplate.matchScore ?? 0) >= 80 + ) { + handleApplyTemplate(recommendedTemplate, { quiet: true }); + toast.success( + `Automatically applied template "${recommendedTemplate.name}" (${recommendedTemplate.matchScore ?? 0}% match).` + ); + } + }, [ + step, + parsedDataset, + recommendedTemplate, + appliedTemplateId, + handleApplyTemplate, + ]); + + return ( + + Permission required + + You need crm:write access to + import CRM data. + + + } + > +
+
+
+ + CRM Data Import + + + Upload a CSV or Excel file, map your fields, and import contacts + in bulk. + +
+ +
+ + {step === "upload" && ( + +
+
+
+ + + + Intelligent Import Assistant + + + Upload your CRM data file + + + Upload clean CSV or Excel files up to 10 MB (100k rows). We + only validate the first {MAX_ROWS_FOR_VALIDATION} rows to keep + things fast, but the full dataset is imported once everything + looks good. + + + +
+
+ +

+ Smart suggestions +

+

+ We auto-map columns for you and surface confidence scores + per field. +

+
+
+ +

+ Safe & secure +

+

+ Data stays in your tenant. Nothing is stored beyond this + import session. +

+
+
+ +

+ Built for teams +

+

+ Save mapping templates so everyone can reuse a proven + configuration. +

+
+
+ +
+ +
+ +
+

+ File preparation tips +

+
    +
  • + + + Place column headers in the first row — we use them for + smart suggestions. + +
  • +
  • + + + Keep one contact per row and remove blank rows or totals. + +
  • +
  • + + + Ensure email addresses are valid if you plan to dedupe on + email. + +
  • +
  • + + + Include consistent country / region values to improve + mapping accuracy. + +
  • +
+
+ +
+ +
+
+ + )} + + {step === "mapping" && parsedDataset && ( + + + + + Map your columns to CRM fields + + + File:{" "} + {parsedDataset.file.name} ·{" "} + {formatFileSize(parsedDataset.file.size)} ·{" "} + {parsedDataset.rowCount} rows detected + + + +
+
+

+ Mapping coverage +

+

+ {mappingCoverage}% +

+

+ {mappedFieldCount} of {parsedDataset.columns.length} columns + mapped +

+
+
+

+ Required fields +

+

+ {CRM_REQUIRED_CONTACT_FIELDS.length - + requiredMissingFields.length}{" "} + / {CRM_REQUIRED_CONTACT_FIELDS.length} +

+

+ {requiredMissingFields.length === 0 + ? "All required fields mapped" + : `${requiredMissingFields.length} required fields still unmapped`} +

+
+
+

+ Dedupe strategy +

+

+ {dedupeMode.toLowerCase()} +

+

+ Configure how we treat matches in your existing CRM data. +

+
+
+

+ Template match +

+

+ {recommendedTemplate?.matchScore + ? `${recommendedTemplate.matchScore}% best match` + : "No templates yet"} +

+

+ {templates.length === 0 + ? "Save this configuration to accelerate future imports." + : "Apply a saved template to jump-start mapping."} +

+
+
+ + + Required fields + + Map{" "} + + {CRM_REQUIRED_CONTACT_FIELDS.join(", ")} + {" "} + before continuing. Only the first {MAX_ROWS_FOR_VALIDATION}{" "} + rows are validated to keep things fast. + + + {requiredMissingFields.length > 0 && ( +
+

Missing required fields

+

+ Map the following fields to continue: +

+
+ {requiredMissingFields.map(field => ( + + {field} + + ))} +
+
+ )} + +
+
+
+ Saved templates +

+ {isTemplateLoading + ? "Loading templates..." + : templates.length > 0 + ? "Apply a saved mapping or save the current configuration for later." + : "Save this mapping configuration to reuse it in future imports."} +

+
+ +
+ {templateLoadError && ( +

+ {templateLoadError.message ?? + "We couldn't load your templates right now."} +

+ )} + {showTemplateSkeleton && ( +
+ {Array.from({ length: 2 }).map((_, index) => ( +
+ ))} +
+ )} + {!isTemplateLoading && + templates.length === 0 && + !templateLoadError && ( +

+ No templates yet. Configure your mapping and save it for + the next import. +

+ )} + {templates.length > 0 && ( +
+ {recommendedTemplate && ( +
+
+
+
+ + {recommendedTemplate.name} + + {recommendedTemplate.matchScore !== null && ( + + {recommendedTemplate.matchScore}% match + + )} +
+

+ {recommendedTemplate.mapping.entries.length}{" "} + mapped fields · {recommendedTemplate.usageCount}{" "} + uses +

+
+ +
+
+ )} + {otherTemplates.length > 0 && ( +
+ {otherTemplates.map(template => ( +
+
+
+
+ + {template.name} + + {template.matchScore !== null && ( + + {template.matchScore}% match + + )} +
+

+ {template.mapping.entries.length} mapped + fields · {template.usageCount} uses +

+
+ +
+
+ ))} +
+ )} +
+ )} +
+ +
+
+ + Deduplication strategy + +

+ Decide how we should handle contacts that already exist in + your CRM. +

+
+ +
+ +
+ + + + Source column + Suggested match + Sample data + CRM field + + + + {parsedDataset.columns.map(column => { + const samples = parsedDataset.samples[column] ?? []; + const mappedField = mapping[column] ?? ""; + const mappedFieldKey = + mappedField === "" ? null : mappedField; + const requiredMappedField = + mappedFieldKey !== null && + REQUIRED_FIELD_SET.has(mappedFieldKey); + const suggestionsForColumn = + columnSuggestions[column] ?? []; + const bestSuggestion = suggestionsForColumn[0]; + const suggestionLabel = bestSuggestion + ? CRM_FIELD_LABEL_LOOKUP[bestSuggestion.field] + : undefined; + const suggestionApplied = + bestSuggestion !== undefined && + mappedFieldKey === bestSuggestion.field; + + return ( + + + {column} + + + {bestSuggestion ? ( +
+
+
+ + {suggestionLabel ?? bestSuggestion.field} + + +
+ {suggestionApplied && ( + + Applied + + )} +
+ {bestSuggestion.reasons.length > 0 && ( +

+ {bestSuggestion.reasons[0]} +

+ )} +
+ +
+
+ ) : ( + + No suggestion yet + + )} +
+ +
+ {samples.length === 0 && ( + + No sample data + + )} + {samples.map(sample => ( + + {sample} + + ))} +
+
+ + + +
+ ); + })} +
+
+
+ +
+ + +
+ + + )} + + {step === "validation" && validationResult && ( + + + Validation results + + Review rows with errors or warnings before committing the + import. Only rows shown here were validated. + + + + + + + Summary snapshot + + + We validated {validationResult.summary.totalRows} rows. + Resolve any errors below and re-run the preview if needed. + + +
+ + + + Total rows + + + {validationResult.summary.totalRows} + + + + + + + Valid rows + + + {validationResult.summary.validRows} + + + + + + + Rows with errors + + + {validationResult.summary.failedRows} + + + + + + + Skipped (dedupe) + + + {validationResult.summary.skippedRows} + + + +
+ +
+ + + + # + Status + Issues + Mapped data + + + + {validationResult.previewRows.map(row => ( + + + {row.rowNumber} + + + + {row.status.toLowerCase()} + + + +
+ {row.issues.length === 0 && ( + + No issues detected + + )} + {row.issues.map(issue => ( + + + {issue.severity.toLowerCase()} + + +

{issue.message}

+ {issue.field && ( +

+ Field: {issue.field} +

+ )} + {issue.hint && ( +

+ Hint: {issue.hint} +

+ )} +
+
+ ))} +
+
+ +
+ {Object.entries(row.mappedData).map( + ([key, value]) => ( + + {key}:{" "} + {value ?? ""} + + ) + )} +
+
+
+ ))} +
+
+
+ +
+ + +
+
+
+ )} + + {step === "summary" && commitResult && ( + + + Import summary + + {commitResult.results.total} rows processed. Download error + reports from the validation step if you need to retry. + + + + + + Import completed + successfully + + + Your contacts are now available in the CRM. You can review the + imported records or start a new import. + + +
+ + + + Imported + + + {commitResult.results.imported} + + + + + + + Failed + + + {commitResult.results.failed} + + + + + + + Skipped + + + {commitResult.results.skipped} + + + + + + + Status + + + {commitResult.status.toLowerCase()} + + + +
+ +
+ + +
+
+
+ )} +
+ + + + + Save mapping as template + +
+

+ Give this mapping a descriptive name so you can reuse it for the + next import. +

+ setTemplateName(event.target.value)} + placeholder="e.g. HubSpot contact export" + autoFocus + /> +
+ + + + +
+
+ + ); +} diff --git a/src/components/crm/import-wizard/index.ts b/src/components/crm/import-wizard/index.ts new file mode 100644 index 0000000..c948805 --- /dev/null +++ b/src/components/crm/import-wizard/index.ts @@ -0,0 +1 @@ +export { CRMImportWizard } from "./import-wizard"; diff --git a/src/lib/imports/definitions.ts b/src/lib/imports/definitions.ts new file mode 100644 index 0000000..2fc4f12 --- /dev/null +++ b/src/lib/imports/definitions.ts @@ -0,0 +1,174 @@ +import { CustomerType, LeadSource, LeadStatus } from "@prisma/client"; +import type { Customer } from "@prisma/client"; + +export const CRM_CONTACT_FIELDS = [ + { + key: "firstName", + label: "First Name", + description: "Given name of the contact", + required: true, + }, + { + key: "lastName", + label: "Last Name", + description: "Family name of the contact", + required: true, + }, + { + key: "email", + label: "Email", + description: "Primary email address", + required: false, + }, + { + key: "phone", + label: "Phone", + description: "Primary phone number", + required: false, + }, + { + key: "company", + label: "Company", + description: "Associated organization or company name", + required: false, + }, + { + key: "position", + label: "Title", + description: "Role or job title", + required: false, + }, + { + key: "status", + label: "Lead Status", + description: "Pipeline status (e.g. NEW, QUALIFIED)", + required: false, + }, + { + key: "type", + label: "Contact Type", + description: "Lead, prospect, or customer designation", + required: false, + }, + { + key: "source", + label: "Source", + description: "Acquisition channel", + required: false, + }, + { + key: "address", + label: "Address", + description: "Street address", + required: false, + }, + { + key: "city", + label: "City", + description: "City name", + required: false, + }, + { + key: "state", + label: "State / Region", + description: "State, province, or region", + required: false, + }, + { + key: "country", + label: "Country", + description: "Country name", + required: false, + }, + { + key: "postalCode", + label: "Postal Code", + description: "Zip or postal code", + required: false, + }, + { + key: "notes", + label: "Notes", + description: "Internal notes about the contact", + required: false, + }, +] as const; + +export type CRMContactFieldKey = (typeof CRM_CONTACT_FIELDS)[number]["key"]; + +export interface CRMContactFieldDefinition { + key: CRMContactFieldKey; + label: string; + description: string; + required: boolean; +} + +export interface ColumnMetadata { + name: string; + sampleValues: string[]; +} + +export const CRM_CONTACT_FIELD_MAP: Record = + { + firstName: "firstName", + lastName: "lastName", + email: "email", + phone: "phone", + company: "company", + position: "position", + status: "status", + type: "type", + source: "source", + address: "address", + city: "city", + state: "state", + country: "country", + postalCode: "postalCode", + notes: "notes", + }; + +export const CRM_REQUIRED_CONTACT_FIELDS: CRMContactFieldKey[] = + CRM_CONTACT_FIELDS.filter(field => field.required).map(field => field.key); + +export const CRM_OPTIONAL_CONTACT_FIELDS: CRMContactFieldKey[] = + CRM_CONTACT_FIELDS.filter(field => !field.required).map(field => field.key); + +export const DEDUPE_MODES = ["SKIP", "UPDATE", "CREATE"] as const; +export type DedupeModeValue = (typeof DEDUPE_MODES)[number]; + +export const CRM_SUPPORTED_CONTACT_TYPES: CustomerType[] = [ + CustomerType.LEAD, + CustomerType.PROSPECT, + CustomerType.CUSTOMER, + CustomerType.FORMER, +]; + +export const CRM_SUPPORTED_LEAD_STATUS: LeadStatus[] = [ + LeadStatus.NEW, + LeadStatus.CONTACTED, + LeadStatus.QUALIFIED, + LeadStatus.PROPOSAL, + LeadStatus.NEGOTIATION, + LeadStatus.CLOSED_WON, + LeadStatus.CLOSED_LOST, +]; + +export const CRM_SUPPORTED_LEAD_SOURCES: LeadSource[] = [ + LeadSource.WEBSITE, + LeadSource.REFERRAL, + LeadSource.SOCIAL_MEDIA, + LeadSource.EMAIL_CAMPAIGN, + LeadSource.EVENT, + LeadSource.COLD_CALL, + LeadSource.OTHER, +]; + +export type ImportableValue = string | number | boolean | null; + +export type ImportRowRecord = Record; + +export const EMAIL_REGEX = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i; + +export function isCRMContactField(key: string): key is CRMContactFieldKey { + return CRM_CONTACT_FIELDS.some(field => field.key === key); +} diff --git a/src/lib/imports/schema-detection.ts b/src/lib/imports/schema-detection.ts new file mode 100644 index 0000000..198ac76 --- /dev/null +++ b/src/lib/imports/schema-detection.ts @@ -0,0 +1,357 @@ +import { + CRM_CONTACT_FIELDS, + CRM_SUPPORTED_CONTACT_TYPES, + CRM_SUPPORTED_LEAD_SOURCES, + CRM_SUPPORTED_LEAD_STATUS, + EMAIL_REGEX, + type CRMContactFieldKey, + type ImportRowRecord, +} from "~/lib/imports/definitions"; + +export type FieldSuggestion = { + field: CRMContactFieldKey; + confidence: number; + reasons: string[]; +}; + +export type ColumnSuggestionMap = Record; + +const UPPERCASE_STATUS_VALUES = new Set( + CRM_SUPPORTED_LEAD_STATUS.map(status => status.toUpperCase()) +); + +const UPPERCASE_TYPE_VALUES = new Set( + CRM_SUPPORTED_CONTACT_TYPES.map(type => type.toUpperCase()) +); + +const UPPERCASE_SOURCE_VALUES = new Set( + CRM_SUPPORTED_LEAD_SOURCES.map(source => source.toUpperCase()) +); + +function clampConfidence(value: number): number { + if (value < 0) { + return 0; + } + + if (value > 100) { + return 100; + } + + return value; +} + +export function normalizeColumnHeader(raw: string): string { + return raw + .trim() + .toLowerCase() + .replace(/[^a-z0-9]/g, ""); +} + +function normalizeSample(value: unknown): string | null { + if (value === null || value === undefined) { + return null; + } + + if (typeof value === "string") { + const trimmed = value.trim(); + return trimmed.length > 0 ? trimmed : null; + } + + if (typeof value === "number") { + return Number.isFinite(value) ? value.toString() : null; + } + + if (typeof value === "boolean") { + return value ? "true" : "false"; + } + + return null; +} + +function collectSamples( + rows: ImportRowRecord[], + column: string, + maxSamples: number +): string[] { + const seen = new Set(); + const samples: string[] = []; + + for (const row of rows) { + const rawValue = row[column]; + const normalized = normalizeSample(rawValue); + + if (!normalized) { + continue; + } + + if (seen.has(normalized)) { + continue; + } + + seen.add(normalized); + samples.push(normalized); + + if (samples.length >= maxSamples) { + break; + } + } + + return samples; +} + +function levenshteinDistance(a: string, b: string): number { + const aLength = a.length; + const bLength = b.length; + + if (aLength === 0) { + return bLength; + } + + if (bLength === 0) { + return aLength; + } + + let previousRow = new Array(bLength + 1).fill(0); + let currentRow = new Array(bLength + 1).fill(0); + + for (let j = 0; j <= bLength; j += 1) { + previousRow[j] = j; + } + + for (let i = 1; i <= aLength; i += 1) { + currentRow[0] = i; + + for (let j = 1; j <= bLength; j += 1) { + const cost = a[i - 1] === b[j - 1] ? 0 : 1; + const deletion = (previousRow[j] ?? Number.POSITIVE_INFINITY) + 1; + const insertion = (currentRow[j - 1] ?? Number.POSITIVE_INFINITY) + 1; + const substitution = + (previousRow[j - 1] ?? Number.POSITIVE_INFINITY) + cost; + + currentRow[j] = Math.min(deletion, insertion, substitution); + } + + [previousRow, currentRow] = [currentRow, previousRow]; + } + + const result = previousRow[bLength]; + return result ?? Math.max(aLength, bLength); +} + +function calculateHeaderSimilarity(source: string, target: string): number { + if (source.length === 0 || target.length === 0) { + return 0; + } + + const distance = levenshteinDistance(source, target); + const maxLength = Math.max(source.length, target.length); + + if (maxLength === 0) { + return 0; + } + + return 1 - distance / maxLength; +} + +function calculateRatio(matches: number, total: number): number { + if (total === 0) { + return 0; + } + + return matches / total; +} + +function generateColumnSuggestion( + column: string, + samples: string[] +): FieldSuggestion[] { + const normalizedColumn = normalizeColumnHeader(column); + const upperSamples = samples.map(sample => sample.toUpperCase()); + + const suggestions: FieldSuggestion[] = []; + + for (const field of CRM_CONTACT_FIELDS) { + let confidence = 0; + const reasons: string[] = []; + + const normalizedLabel = normalizeColumnHeader(field.label); + const normalizedKey = normalizeColumnHeader(field.key); + + const similarityToLabel = calculateHeaderSimilarity( + normalizedColumn, + normalizedLabel + ); + const similarityToKey = calculateHeaderSimilarity( + normalizedColumn, + normalizedKey + ); + const bestHeaderSimilarity = Math.max(similarityToLabel, similarityToKey); + + if (bestHeaderSimilarity > 0) { + const headerScore = Math.round(bestHeaderSimilarity * 60); + confidence += headerScore; + reasons.push( + `Header similarity ${(bestHeaderSimilarity * 100).toFixed(0)}%` + ); + } + + if ( + normalizedColumn.length > 0 && + (normalizedColumn === normalizedLabel || + normalizedColumn === normalizedKey) + ) { + confidence += 20; + reasons.push("Column header matches CRM field"); + } + + if (samples.length > 0) { + switch (field.key) { + case "email": { + const matchCount = samples.filter(sample => + EMAIL_REGEX.test(sample) + ).length; + const ratio = calculateRatio(matchCount, samples.length); + if (ratio >= 0.6) { + confidence += 30; + reasons.push("Sample values look like valid email addresses"); + } + break; + } + case "status": { + const validCount = upperSamples.filter(sample => + UPPERCASE_STATUS_VALUES.has(sample) + ).length; + const ratio = calculateRatio(validCount, upperSamples.length); + if (ratio >= 0.6 && upperSamples.length > 0) { + confidence += 30; + reasons.push("Sample values match known CRM statuses"); + } + break; + } + case "type": { + const validCount = upperSamples.filter(sample => + UPPERCASE_TYPE_VALUES.has(sample) + ).length; + const ratio = calculateRatio(validCount, upperSamples.length); + if (ratio >= 0.6 && upperSamples.length > 0) { + confidence += 30; + reasons.push("Sample values match supported contact types"); + } + break; + } + case "source": { + const validCount = upperSamples.filter(sample => + UPPERCASE_SOURCE_VALUES.has(sample) + ).length; + const ratio = calculateRatio(validCount, upperSamples.length); + if (ratio >= 0.6 && upperSamples.length > 0) { + confidence += 25; + reasons.push("Sample values align with known lead sources"); + } + break; + } + case "phone": { + const numericCount = samples.filter(sample => { + const digits = sample.replace(/\D/g, ""); + return digits.length >= 7; + }).length; + const ratio = calculateRatio(numericCount, samples.length); + if (ratio >= 0.6) { + confidence += 20; + reasons.push("Sample values resemble phone numbers"); + } + break; + } + case "postalCode": { + const postalMatches = samples.filter(sample => + /[A-Za-z0-9]{4,}/.test(sample) + ).length; + const ratio = calculateRatio(postalMatches, samples.length); + if (ratio >= 0.6) { + confidence += 10; + reasons.push("Sample values look like postal codes"); + } + break; + } + default: + break; + } + } + + const clampedConfidence = clampConfidence(confidence); + if (clampedConfidence > 0) { + suggestions.push({ + field: field.key, + confidence: clampedConfidence, + reasons, + }); + } + } + + return suggestions.sort((a, b) => b.confidence - a.confidence); +} + +function buildInitialMapping( + columns: string[], + columnSuggestions: ColumnSuggestionMap, + autoMapThreshold: number +): Record { + const mapping: Record = {}; + + const candidateMap = new Map( + CRM_CONTACT_FIELDS.map(field => [ + normalizeColumnHeader(field.label), + field.key, + ]) + ); + + columns.forEach(column => { + const normalized = normalizeColumnHeader(column); + const directMatch = candidateMap.get(normalized); + + if (directMatch) { + mapping[column] = directMatch; + return; + } + + const suggestion = columnSuggestions[column]?.[0]; + if (suggestion && suggestion.confidence >= autoMapThreshold) { + mapping[column] = suggestion.field; + return; + } + + mapping[column] = null; + }); + + return mapping; +} + +export function generateContactSchemaSuggestions(args: { + columns: string[]; + rows: ImportRowRecord[]; + sampleSize?: number; + autoMapThreshold?: number; +}): { + columnSuggestions: ColumnSuggestionMap; + recommendedMapping: Record; +} { + const { columns, rows, sampleSize = 5, autoMapThreshold = 80 } = args; + + const columnSuggestions: ColumnSuggestionMap = {}; + + columns.forEach(column => { + const samples = collectSamples(rows, column, sampleSize); + columnSuggestions[column] = generateColumnSuggestion(column, samples); + }); + + const recommendedMapping = buildInitialMapping( + columns, + columnSuggestions, + autoMapThreshold + ); + + return { + columnSuggestions, + recommendedMapping, + }; +} diff --git a/src/lib/imports/templates.ts b/src/lib/imports/templates.ts new file mode 100644 index 0000000..41da9c5 --- /dev/null +++ b/src/lib/imports/templates.ts @@ -0,0 +1,124 @@ +import type { + CRMContactFieldKey, + DedupeModeValue, +} from "~/lib/imports/definitions"; +import { isCRMContactField } from "~/lib/imports/definitions"; +import { normalizeColumnHeader } from "~/lib/imports/schema-detection"; + +export type TemplateMappingEntry = { + sourceColumn: string; + normalizedSourceColumn: string; + targetField: CRMContactFieldKey; +}; + +export type TemplateMappingConfig = { + entries: TemplateMappingEntry[]; + dedupeMode: DedupeModeValue; + updatedAt: string; +}; + +export type TemplateColumnSignature = { + columns: string[]; + normalizedColumns: string[]; + generatedAt: string; +}; + +export function buildTemplateColumnSignature( + columns: string[] +): TemplateColumnSignature { + const normalizedColumns = columns.map(column => + normalizeColumnHeader(column) + ); + return { + columns, + normalizedColumns, + generatedAt: new Date().toISOString(), + } satisfies TemplateColumnSignature; +} + +export function buildTemplateMappingEntries(args: { + columns: string[]; + mapping: Record; +}): TemplateMappingEntry[] { + const { columns, mapping } = args; + + return columns + .map(column => { + const targetField = mapping[column]; + if (!targetField) { + return null; + } + + if (!isCRMContactField(targetField)) { + return null; + } + + return { + sourceColumn: column, + normalizedSourceColumn: normalizeColumnHeader(column), + targetField, + } satisfies TemplateMappingEntry; + }) + .filter((entry): entry is TemplateMappingEntry => entry !== null); +} + +export function applyTemplateEntriesToColumns(args: { + entries: TemplateMappingEntry[]; + columns: string[]; +}): Record { + const { entries, columns } = args; + const normalizedColumnMap = new Map(); + columns.forEach(column => { + normalizedColumnMap.set(normalizeColumnHeader(column), column); + }); + + const mapping: Record = {}; + entries.forEach(entry => { + const column = normalizedColumnMap.get(entry.normalizedSourceColumn); + if (column) { + mapping[column] = entry.targetField; + } + }); + + return mapping; +} + +export function calculateTemplateMatch(args: { + signature: TemplateColumnSignature; + columns: string[]; +}): { + score: number; + coverage: number; + matchedNormalizedColumns: string[]; +} { + const { signature, columns } = args; + const normalizedTargetColumns = columns.map(column => + normalizeColumnHeader(column) + ); + const templateNormalized = new Set(signature.normalizedColumns); + const matchedNormalizedColumns: string[] = []; + + let matchedCount = 0; + normalizedTargetColumns.forEach(normalized => { + if (!normalized) { + return; + } + + if (templateNormalized.has(normalized)) { + matchedCount += 1; + matchedNormalizedColumns.push(normalized); + } + }); + + const targetCount = normalizedTargetColumns.length; + const templateCount = signature.normalizedColumns.length; + const coverage = templateCount === 0 ? 0 : matchedCount / templateCount; + const accuracy = targetCount === 0 ? 0 : matchedCount / targetCount; + const score = Math.round(((coverage + accuracy) / 2) * 100); + + return { + score, + coverage, + matchedNormalizedColumns, + }; +} diff --git a/src/server/api/root.ts b/src/server/api/root.ts index c635fa7..799a2b7 100644 --- a/src/server/api/root.ts +++ b/src/server/api/root.ts @@ -18,6 +18,7 @@ import { templatesRouter } from "./routers/templates"; import { templateSharingRouter } from "./routers/template-sharing"; import { adminRouter } from "./routers/admin"; import { earlyAccessRouter } from "./routers/early-access"; +import { crmImportRouter } from "./routers/crm/import"; /** * This is the primary router for your server. @@ -44,6 +45,7 @@ export const appRouter = createTRPCRouter({ templateSharing: templateSharingRouter, admin: adminRouter, earlyAccess: earlyAccessRouter, + crmImport: crmImportRouter, }); // export type definition of API diff --git a/src/server/api/routers/crm/import.ts b/src/server/api/routers/crm/import.ts new file mode 100644 index 0000000..1dd7f15 --- /dev/null +++ b/src/server/api/routers/crm/import.ts @@ -0,0 +1,1276 @@ +import { Prisma } from "@prisma/client"; +import type { + PrismaClient, + CustomerType, + DedupeMode, + ImportEntityType, + ImportModule, + ImportStatus, + IssueSeverity, + LeadSource, + LeadStatus, + RowStatus, +} from "@prisma/client"; +import { z } from "zod"; +import { PERMISSIONS } from "~/lib/rbac"; +import { + CRM_CONTACT_FIELDS, + CRM_REQUIRED_CONTACT_FIELDS, + CRM_SUPPORTED_CONTACT_TYPES, + CRM_SUPPORTED_LEAD_STATUS, + DEDUPE_MODES, + EMAIL_REGEX, + type CRMContactFieldKey, + type DedupeModeValue, + type ImportRowRecord, + type ImportableValue, +} from "~/lib/imports/definitions"; +import { + generateContactSchemaSuggestions, + type ColumnSuggestionMap, +} from "~/lib/imports/schema-detection"; +import { + buildTemplateColumnSignature, + buildTemplateMappingEntries, + calculateTemplateMatch, + type TemplateColumnSignature, + type TemplateMappingConfig, +} from "~/lib/imports/templates"; +import { createPermissionProcedure, createTRPCRouter } from "../../trpc"; + +const contactFieldKeyTuple = CRM_CONTACT_FIELDS.map(field => field.key) as [ + CRMContactFieldKey, + ...CRMContactFieldKey[], +]; + +const dedupeModeTuple = [...DEDUPE_MODES] as [ + DedupeModeValue, + ...DedupeModeValue[], +]; +const importEntityTypeTuple = [ + "CONTACT", + "ORGANIZATION", + "DEAL", +] as const satisfies readonly ImportEntityType[]; + +const CRM_SUPPORTED_LEAD_SOURCES = [ + "WEBSITE", + "REFERRAL", + "SOCIAL_MEDIA", + "EMAIL_CAMPAIGN", + "EVENT", + "COLD_CALL", + "OTHER", +] as const satisfies readonly LeadSource[]; + +const ISSUE_SEVERITY_ERROR: IssueSeverity = "ERROR"; +const ISSUE_SEVERITY_WARNING: IssueSeverity = "WARNING"; + +const ROW_STATUS_VALIDATED: RowStatus = "VALIDATED"; +const ROW_STATUS_FAILED: RowStatus = "FAILED"; +const ROW_STATUS_SKIPPED: RowStatus = "SKIPPED"; +const ROW_STATUS_IMPORTED: RowStatus = "IMPORTED"; + +const IMPORT_STATUS_UPLOADING: ImportStatus = "UPLOADING"; +const IMPORT_STATUS_DETECTING: ImportStatus = "DETECTING"; +const IMPORT_STATUS_MAPPING_REVIEW: ImportStatus = "MAPPING_REVIEW"; +const IMPORT_STATUS_VALIDATING: ImportStatus = "VALIDATING"; +const IMPORT_STATUS_READY: ImportStatus = "READY_TO_IMPORT"; +const IMPORT_STATUS_VALIDATION_FAILED: ImportStatus = "VALIDATION_FAILED"; +const IMPORT_STATUS_IMPORTING: ImportStatus = "IMPORTING"; +const IMPORT_STATUS_COMPLETED: ImportStatus = "COMPLETED"; + +const IMPORT_MODULE_CRM: ImportModule = "CRM"; + +const rowValueSchema = z.union([z.string(), z.number(), z.boolean(), z.null()]); +const rowRecordSchema = z.record(rowValueSchema); +const MAX_DETECTION_SAMPLE_ROWS = 500; + +const mappingSchema = z.object({ + sourceColumn: z.string().min(1), + targetField: z.enum(contactFieldKeyTuple).optional().nullable(), +}); + +const templateMappingEntrySchema = z.object({ + sourceColumn: z.string().min(1), + normalizedSourceColumn: z.string().min(1), + targetField: z.enum(contactFieldKeyTuple), +}); + +const templateMappingConfigSchema = z.object({ + entries: z.array(templateMappingEntrySchema).min(1), + dedupeMode: z.enum(dedupeModeTuple), + updatedAt: z.string(), +}); + +const templateColumnSignatureSchema = z.object({ + columns: z.array(z.string().min(1)), + normalizedColumns: z.array(z.string()), + generatedAt: z.string(), +}); + +type MappingEntry = z.infer; + +type ValidationIssue = { + severity: IssueSeverity; + field?: string; + message: string; + hint?: string; + value?: string | null; +}; + +type ValidationRowResult = { + rowNumber: number; + rawData: ImportRowRecord; + mappedData: Partial>; + issues: ValidationIssue[]; + status: RowStatus; + dedupeHint?: string | null; +}; + +type DetectionPayload = { + columnSuggestions: ColumnSuggestionMap; + recommendedMapping: Record; + columns: string[]; + sampleRowCount: number; + generatedAt: string; +}; + +function parseTemplateMappingConfig( + value: unknown +): TemplateMappingConfig | null { + const result = templateMappingConfigSchema.safeParse(value); + if (!result.success) { + return null; + } + + return result.data; +} + +function parseTemplateColumnSignature( + value: unknown +): TemplateColumnSignature | null { + const result = templateColumnSignatureSchema.safeParse(value); + if (!result.success) { + return null; + } + + return result.data; +} + +type ImportTemplateDelegate = { + findMany: (args: unknown) => Promise; + findFirst: (args: unknown) => Promise; + create: (args: unknown) => Promise; + update: (args: unknown) => Promise; + updateMany: (args: unknown) => Promise<{ count: number }>; +}; + +function getImportTemplateDelegate( + db: PrismaClient | Prisma.TransactionClient +): ImportTemplateDelegate { + return db.importTemplate as unknown as ImportTemplateDelegate; +} + +const importTemplateRecordSchema = z.object({ + id: z.string(), + organizationId: z.string(), + name: z.string(), + usageCount: z.number(), + lastUsedAt: z.date().nullable(), + mappingConfig: z.unknown(), + columnSignature: z.unknown(), + module: z.string(), + entityType: z.string(), +}); + +const importTemplateArraySchema = z.array(importTemplateRecordSchema); + +function normalizeCellValue(value: ImportableValue | undefined): string | null { + if (value === undefined || value === null) { + return null; + } + + if (typeof value === "string") { + const trimmed = value.trim(); + return trimmed.length > 0 ? trimmed : null; + } + + if (typeof value === "number") { + if (!Number.isFinite(value)) { + return null; + } + + return String(value); + } + + return value ? "true" : "false"; +} + +function normalizeChoiceValue(value: string, uppercase = true): string { + const formatted = uppercase ? value.toUpperCase() : value; + return formatted.replace(/\s+/g, "_"); +} + +function ensureJsonObject( + data: Record +): Prisma.JsonObject { + const result: Record = {}; + for (const [key, value] of Object.entries(data)) { + result[key] = value as Prisma.JsonValue; + } + + return result as Prisma.JsonObject; +} + +function extractExistingId(hint: string | null | undefined): string | null { + if (!hint) { + return null; + } + + if (hint.startsWith("existing:")) { + const parts = hint.split(":"); + return parts[1] ?? null; + } + + return null; +} + +function buildCustomerData( + mappedData: Partial>, + organizationId: string +): Prisma.CustomerUncheckedCreateInput { + const typeValue = + (mappedData.type as CustomerType | null | undefined) ?? "LEAD"; + const statusValue = + (mappedData.status as LeadStatus | null | undefined) ?? null; + const sourceValue = + (mappedData.source as LeadSource | null | undefined) ?? null; + + return { + organizationId, + type: typeValue, + status: statusValue, + firstName: mappedData.firstName ?? "", + lastName: mappedData.lastName ?? "", + email: mappedData.email ?? null, + phone: mappedData.phone ?? null, + company: mappedData.company ?? null, + position: mappedData.position ?? null, + address: mappedData.address ?? null, + city: mappedData.city ?? null, + state: mappedData.state ?? null, + country: mappedData.country ?? null, + postalCode: mappedData.postalCode ?? null, + source: sourceValue, + notes: mappedData.notes ?? null, + } satisfies Prisma.CustomerUncheckedCreateInput; +} + +function filterUpdateData( + mappedData: Partial> +): Prisma.CustomerUncheckedUpdateInput { + const update: Prisma.CustomerUncheckedUpdateInput = {}; + + if (mappedData.firstName !== undefined && mappedData.firstName !== null) { + update.firstName = mappedData.firstName; + } + if (mappedData.lastName !== undefined && mappedData.lastName !== null) { + update.lastName = mappedData.lastName; + } + if (mappedData.email !== undefined && mappedData.email !== null) { + update.email = mappedData.email; + } + if (mappedData.phone !== undefined && mappedData.phone !== null) { + update.phone = mappedData.phone; + } + if (mappedData.company !== undefined && mappedData.company !== null) { + update.company = mappedData.company; + } + if (mappedData.position !== undefined && mappedData.position !== null) { + update.position = mappedData.position; + } + if (mappedData.address !== undefined && mappedData.address !== null) { + update.address = mappedData.address; + } + if (mappedData.city !== undefined && mappedData.city !== null) { + update.city = mappedData.city; + } + if (mappedData.state !== undefined && mappedData.state !== null) { + update.state = mappedData.state; + } + if (mappedData.country !== undefined && mappedData.country !== null) { + update.country = mappedData.country; + } + if (mappedData.postalCode !== undefined && mappedData.postalCode !== null) { + update.postalCode = mappedData.postalCode; + } + if (mappedData.notes !== undefined && mappedData.notes !== null) { + update.notes = mappedData.notes; + } + if (mappedData.type !== undefined && mappedData.type !== null) { + update.type = mappedData.type as CustomerType; + } + if (mappedData.status !== undefined && mappedData.status !== null) { + update.status = mappedData.status as LeadStatus; + } + if (mappedData.source !== undefined && mappedData.source !== null) { + update.source = mappedData.source as LeadSource; + } + + return update; +} + +async function fetchExistingContacts( + prisma: PrismaClient, + organizationId: string, + candidateEmails: Set +): Promise> { + if (candidateEmails.size === 0) { + return new Map(); + } + + const contacts = await prisma.customer.findMany({ + where: { + organizationId, + email: { + in: Array.from(candidateEmails), + }, + }, + select: { + id: true, + email: true, + }, + }); + + const map = new Map(); + for (const contact of contacts) { + if (!contact.email) { + continue; + } + + map.set(contact.email.toLowerCase(), { id: contact.id }); + } + + return map; +} + +function validateRequiredFields( + mappedData: Partial> +): ValidationIssue[] { + const issues: ValidationIssue[] = []; + + for (const requiredField of CRM_REQUIRED_CONTACT_FIELDS) { + if (!mappedData[requiredField]) { + issues.push({ + severity: ISSUE_SEVERITY_ERROR, + field: requiredField, + message: `${requiredField} is required`, + hint: "Map this field before continuing", + }); + } + } + + return issues; +} + +async function prepareValidation( + rows: ImportRowRecord[], + mapping: MappingEntry[], + dedupeMode: DedupeModeValue, + existingByEmail: Map +): Promise<{ + processedRows: ValidationRowResult[]; + totals: { + valid: number; + failed: number; + skipped: number; + duplicates: number; + }; +}> { + const processedRows: ValidationRowResult[] = []; + let valid = 0; + let failed = 0; + let skipped = 0; + let duplicates = 0; + + const fileEmailTracker = new Map(); + + rows.forEach((row, index) => { + const issues: ValidationIssue[] = []; + const mapped: Partial> = {}; + + for (const entry of mapping) { + const { sourceColumn, targetField } = entry; + if (!targetField) { + continue; + } + + const rawValue = row[sourceColumn]; + const normalized = normalizeCellValue(rawValue); + if (normalized === null) { + mapped[targetField] = null; + continue; + } + + if (targetField === "email") { + if (EMAIL_REGEX.test(normalized)) { + mapped.email = normalized.toLowerCase(); + } else { + issues.push({ + severity: ISSUE_SEVERITY_ERROR, + field: targetField, + message: "Email is not valid", + hint: "Provide a valid email address", + value: normalized, + }); + } + continue; + } + + if (targetField === "status") { + const candidate = normalizeChoiceValue(normalized); + if (CRM_SUPPORTED_LEAD_STATUS.some(status => status === candidate)) { + mapped.status = candidate; + } else { + issues.push({ + severity: ISSUE_SEVERITY_ERROR, + field: targetField, + message: "Status is not recognized", + hint: "Use a valid CRM lead status", + value: normalized, + }); + } + continue; + } + + if (targetField === "type") { + const candidate = normalizeChoiceValue(normalized); + if (CRM_SUPPORTED_CONTACT_TYPES.some(type => type === candidate)) { + mapped.type = candidate; + } else { + issues.push({ + severity: ISSUE_SEVERITY_ERROR, + field: targetField, + message: "Contact type is not recognized", + hint: "Use lead, prospect, customer, or former", + value: normalized, + }); + } + continue; + } + + if (targetField === "source") { + const candidate = normalizeChoiceValue(normalized); + if (CRM_SUPPORTED_LEAD_SOURCES.some(source => source === candidate)) { + mapped.source = candidate; + } else { + issues.push({ + severity: ISSUE_SEVERITY_ERROR, + field: targetField, + message: "Lead source is not recognized", + hint: "Use one of the supported CRM lead sources", + value: normalized, + }); + } + continue; + } + + mapped[targetField] = normalized; + } + + issues.push(...validateRequiredFields(mapped)); + + const normalizedEmail = mapped.email ?? null; + let dedupeHint: string | null = null; + if (normalizedEmail) { + const lowerEmail = normalizedEmail.toLowerCase(); + const seenCount = fileEmailTracker.get(lowerEmail) ?? 0; + fileEmailTracker.set(lowerEmail, seenCount + 1); + if (seenCount > 0) { + duplicates += 1; + issues.push({ + severity: ISSUE_SEVERITY_ERROR, + field: "email", + message: "Duplicate email in file", + hint: "Ensure each row has a unique email", + value: lowerEmail, + }); + } + + const existing = existingByEmail.get(lowerEmail); + if (existing) { + if (dedupeMode === "SKIP") { + issues.push({ + severity: ISSUE_SEVERITY_WARNING, + field: "email", + message: "Existing contact will be skipped", + hint: "Select UPDATE mode to merge with existing contacts", + value: lowerEmail, + }); + } + dedupeHint = `existing:${existing.id}`; + } + } + + let status: RowStatus = ROW_STATUS_VALIDATED; + if (issues.some(issue => issue.severity === ISSUE_SEVERITY_ERROR)) { + status = ROW_STATUS_FAILED; + failed += 1; + } else if (dedupeMode === "SKIP" && dedupeHint) { + status = ROW_STATUS_SKIPPED; + skipped += 1; + } else { + valid += 1; + } + + processedRows.push({ + rowNumber: index + 1, + rawData: row, + mappedData: mapped, + issues, + status, + dedupeHint, + }); + }); + + return { + processedRows, + totals: { + valid, + failed, + skipped, + duplicates, + }, + }; +} + +function toMappedData( + json: Prisma.JsonObject | null +): Partial> { + if (!json) { + return {}; + } + + const mapped: Partial> = {}; + + for (const [key, value] of Object.entries(json)) { + const fieldKey = key as CRMContactFieldKey; + if (typeof value === "string") { + mapped[fieldKey] = value; + } else if (value === null) { + mapped[fieldKey] = null; + } else if (typeof value === "number" || typeof value === "boolean") { + mapped[fieldKey] = String(value); + } else { + mapped[fieldKey] = null; + } + } + + return mapped; +} + +export const crmImportRouter = createTRPCRouter({ + createUploadSession: createPermissionProcedure(PERMISSIONS.CRM_WRITE) + .input( + z.object({ + organizationId: z.string().cuid(), + entityType: z.enum(importEntityTypeTuple).default("CONTACT"), + fileName: z.string().min(1), + fileSize: z.number().int().nonnegative(), + fileType: z.string().optional(), + columns: z.array(z.string().min(1)).min(1), + rowCount: z.number().int().nonnegative(), + }) + ) + .mutation(async ({ input, ctx }) => { + await ctx.requirePermission(input.organizationId); + + const session = await ctx.db.importSession.create({ + data: { + organizationId: input.organizationId, + createdByUserId: ctx.user.id, + fileName: input.fileName, + fileSize: input.fileSize, + fileType: input.fileType ?? null, + module: IMPORT_MODULE_CRM, + entityType: input.entityType as ImportEntityType, + status: IMPORT_STATUS_UPLOADING, + rowCount: input.rowCount, + }, + select: { + id: true, + status: true, + rowCount: true, + }, + }); + + return session; + }), + + detectSchema: createPermissionProcedure(PERMISSIONS.CRM_WRITE) + .input( + z.object({ + sessionId: z.string().cuid(), + organizationId: z.string().cuid(), + columns: z.array(z.string().min(1)).min(1), + sampleRows: z + .array(rowRecordSchema) + .min(1) + .max(MAX_DETECTION_SAMPLE_ROWS), + }) + ) + .mutation(async ({ input, ctx }) => { + await ctx.requirePermission(input.organizationId); + + const session = await ctx.db.importSession.findFirst({ + where: { + id: input.sessionId, + organizationId: input.organizationId, + }, + select: { + id: true, + mappingConfig: true, + }, + }); + + if (!session) { + throw new Error("Import session not found"); + } + + await ctx.db.importSession.update({ + where: { id: session.id }, + data: { + status: IMPORT_STATUS_DETECTING, + }, + }); + + const { columnSuggestions, recommendedMapping } = + generateContactSchemaSuggestions({ + columns: input.columns, + rows: input.sampleRows, + }); + + const detectionPayload: DetectionPayload = { + columnSuggestions, + recommendedMapping, + columns: input.columns, + sampleRowCount: input.sampleRows.length, + generatedAt: new Date().toISOString(), + }; + + const existingConfig = + session.mappingConfig && + typeof session.mappingConfig === "object" && + !Array.isArray(session.mappingConfig) + ? (session.mappingConfig as Record) + : undefined; + const baseConfig = existingConfig ?? {}; + + await ctx.db.importSession.update({ + where: { id: session.id }, + data: { + status: IMPORT_STATUS_MAPPING_REVIEW, + mappingConfig: { + ...baseConfig, + detection: detectionPayload, + }, + }, + }); + + return detectionPayload; + }), + + listTemplates: createPermissionProcedure(PERMISSIONS.CRM_WRITE) + .input( + z.object({ + organizationId: z.string().cuid(), + columns: z.array(z.string().min(1)).optional(), + limit: z.number().int().min(1).max(50).optional(), + }) + ) + .query(async ({ input, ctx }) => { + await ctx.requirePermission(input.organizationId); + + const importTemplateDelegate = getImportTemplateDelegate(ctx.db); + + const rawTemplates = await importTemplateDelegate.findMany({ + where: { + organizationId: input.organizationId, + module: IMPORT_MODULE_CRM, + entityType: "CONTACT", + }, + orderBy: [{ usageCount: "desc" }, { createdAt: "desc" }], + take: input.limit ?? 25, + }); + + const templates = importTemplateArraySchema.parse(rawTemplates); + + const columns = input.columns ?? []; + + const summaries = templates + .map(template => { + const mappingConfig = parseTemplateMappingConfig( + template.mappingConfig + ); + const columnSignature = parseTemplateColumnSignature( + template.columnSignature + ); + + if (!mappingConfig || !columnSignature) { + return null; + } + + const matchResult = + columns.length > 0 + ? calculateTemplateMatch({ + signature: columnSignature, + columns, + }) + : null; + + return { + id: template.id, + name: template.name, + usageCount: template.usageCount, + lastUsedAt: template.lastUsedAt + ? template.lastUsedAt.toISOString() + : null, + mapping: mappingConfig, + columnSignature, + matchScore: matchResult?.score ?? null, + coverage: matchResult?.coverage ?? null, + }; + }) + .filter( + (entry): entry is Exclude => entry !== null + ); + + return summaries; + }), + + saveTemplate: createPermissionProcedure(PERMISSIONS.CRM_WRITE) + .input( + z.object({ + sessionId: z.string().cuid(), + organizationId: z.string().cuid(), + name: z.string().min(2).max(100), + mapping: z.array(mappingSchema).min(1), + columns: z.array(z.string().min(1)).min(1), + dedupeMode: z.enum(dedupeModeTuple), + }) + ) + .mutation(async ({ input, ctx }) => { + await ctx.requirePermission(input.organizationId); + + const session = await ctx.db.importSession.findFirst({ + where: { + id: input.sessionId, + organizationId: input.organizationId, + }, + select: { + id: true, + }, + }); + + if (!session) { + throw new Error("Import session not found"); + } + + const templateName = input.name.trim(); + if (templateName.length < 2) { + throw new Error("Template name must be at least 2 characters long"); + } + + const mappingRecord: Record = {}; + input.mapping.forEach(entry => { + const target = entry.targetField ?? null; + mappingRecord[entry.sourceColumn] = target ?? ""; + }); + + const entries = buildTemplateMappingEntries({ + columns: input.columns, + mapping: mappingRecord, + }); + + if (entries.length === 0) { + throw new Error( + "Map at least one field before saving this configuration as a template" + ); + } + + const mappedTargets = new Set(entries.map(entry => entry.targetField)); + for (const required of CRM_REQUIRED_CONTACT_FIELDS) { + if (!mappedTargets.has(required)) { + throw new Error( + `Required field "${required}" must be mapped before saving a template` + ); + } + } + + const mappingConfig: TemplateMappingConfig = { + entries, + dedupeMode: input.dedupeMode, + updatedAt: new Date().toISOString(), + }; + + const columnSignature = buildTemplateColumnSignature(input.columns); + + const importTemplateDelegate = getImportTemplateDelegate(ctx.db); + + try { + const createdTemplate = await importTemplateDelegate.create({ + data: { + organizationId: input.organizationId, + createdByUserId: ctx.user.id, + name: templateName, + module: IMPORT_MODULE_CRM, + entityType: "CONTACT", + mappingConfig: mappingConfig as unknown as Prisma.JsonObject, + columnSignature: columnSignature as unknown as Prisma.JsonObject, + }, + }); + + const template = importTemplateRecordSchema.parse(createdTemplate); + + return { + id: template.id, + name: template.name, + usageCount: template.usageCount, + lastUsedAt: template.lastUsedAt + ? template.lastUsedAt.toISOString() + : null, + mapping: mappingConfig, + columnSignature, + matchScore: null, + coverage: null, + }; + } catch (error) { + if ( + error instanceof Prisma.PrismaClientKnownRequestError && + error.code === "P2002" + ) { + throw new Error( + "A template with this name already exists in your organization" + ); + } + + throw error; + } + }), + + markTemplateUsage: createPermissionProcedure(PERMISSIONS.CRM_WRITE) + .input( + z.object({ + templateId: z.string().cuid(), + organizationId: z.string().cuid(), + sessionId: z.string().cuid().optional(), + }) + ) + .mutation(async ({ input, ctx }) => { + await ctx.requirePermission(input.organizationId); + + const importTemplateDelegate = getImportTemplateDelegate(ctx.db); + + const rawTemplate = await importTemplateDelegate.findFirst({ + where: { + id: input.templateId, + organizationId: input.organizationId, + }, + }); + + const template = importTemplateRecordSchema.nullable().parse(rawTemplate); + + if (!template) { + throw new Error("Template not found"); + } + + await ctx.db.$transaction(async tx => { + const txTemplateDelegate = getImportTemplateDelegate(tx); + + await txTemplateDelegate.update({ + where: { id: template.id }, + data: { + usageCount: { increment: 1 }, + lastUsedAt: new Date(), + }, + }); + + if (input.sessionId) { + await tx.importSession.updateMany({ + where: { + id: input.sessionId, + organizationId: input.organizationId, + }, + data: { + appliedTemplateId: template.id, + }, + }); + } + }); + + return { templateId: template.id }; + }), + + validateManualPreview: createPermissionProcedure(PERMISSIONS.CRM_WRITE) + .input( + z.object({ + sessionId: z.string().cuid(), + organizationId: z.string().cuid(), + mapping: z.array(mappingSchema).min(1), + rows: z.array(rowRecordSchema).min(1), + dedupeMode: z.enum(dedupeModeTuple), + }) + ) + .mutation(async ({ input, ctx }) => { + await ctx.requirePermission(input.organizationId); + + const session = await ctx.db.importSession.findFirst({ + where: { + id: input.sessionId, + organizationId: input.organizationId, + }, + select: { + id: true, + mappingConfig: true, + }, + }); + + if (!session) { + throw new Error("Import session not found"); + } + + const existingConfig = + session.mappingConfig && + typeof session.mappingConfig === "object" && + !Array.isArray(session.mappingConfig) + ? (session.mappingConfig as Record) + : undefined; + + const detectionConfig = + existingConfig && typeof existingConfig.detection !== "undefined" + ? existingConfig.detection + : undefined; + + await ctx.db.importSession.update({ + where: { id: session.id }, + data: { + status: IMPORT_STATUS_VALIDATING, + }, + }); + + const activeMapping = input.mapping.filter(entry => entry.targetField); + const mappedTargets = new Set( + activeMapping + .map(entry => entry.targetField) + .filter( + (target): target is CRMContactFieldKey => + target !== undefined && target !== null + ) + ); + + for (const required of CRM_REQUIRED_CONTACT_FIELDS) { + if (!mappedTargets.has(required)) { + throw new Error( + `Required field "${required}" is missing from the field mapping` + ); + } + } + + const candidateEmails = new Set(); + for (const row of input.rows) { + for (const mappingEntry of activeMapping) { + if (mappingEntry.targetField !== "email") { + continue; + } + + const value = normalizeCellValue(row[mappingEntry.sourceColumn]); + if (value) { + candidateEmails.add(value.toLowerCase()); + } + } + } + + const existingByEmail = await fetchExistingContacts( + ctx.db, + input.organizationId, + candidateEmails + ); + + const { processedRows, totals } = await prepareValidation( + input.rows, + activeMapping, + input.dedupeMode, + existingByEmail + ); + + const previewRows = processedRows.slice(0, 25).map(row => ({ + rowNumber: row.rowNumber, + status: row.status, + issues: row.issues, + rawData: row.rawData, + mappedData: row.mappedData, + })); + + const sessionStatus = + totals.failed > 0 + ? IMPORT_STATUS_VALIDATION_FAILED + : IMPORT_STATUS_READY; + + await ctx.db.$transaction(async tx => { + await tx.importRowIssue.deleteMany({ + where: { sessionId: input.sessionId }, + }); + await tx.importRow.deleteMany({ + where: { sessionId: input.sessionId }, + }); + + for (const row of processedRows) { + const createdRow = await tx.importRow.create({ + data: { + sessionId: input.sessionId, + rowNumber: row.rowNumber, + rawData: ensureJsonObject(row.rawData), + mappedData: ensureJsonObject( + Object.fromEntries( + Object.entries(row.mappedData).map(([key, value]) => [ + key, + value ?? null, + ]) + ) + ), + status: row.status, + dedupeHint: row.dedupeHint ?? null, + }, + }); + + if (row.issues.length > 0) { + await tx.importRowIssue.createMany({ + data: row.issues.map(issue => ({ + sessionId: input.sessionId, + rowId: createdRow.id, + field: issue.field ?? null, + severity: issue.severity, + message: issue.message, + hint: issue.hint ?? null, + value: issue.value ?? null, + })), + }); + } + } + + const mappingConfigPayload = { + ...(detectionConfig !== undefined + ? { detection: detectionConfig as Prisma.JsonValue } + : {}), + mapping: { + entries: activeMapping, + dedupeMode: input.dedupeMode, + updatedAt: new Date().toISOString(), + }, + } as const; + + await tx.importSession.update({ + where: { id: input.sessionId }, + data: { + mappingConfig: mappingConfigPayload as Prisma.JsonObject, + dedupeMode: input.dedupeMode as DedupeMode, + status: sessionStatus, + processedCount: totals.valid + totals.failed + totals.skipped, + successCount: totals.valid, + failureCount: totals.failed, + skippedCount: totals.skipped, + }, + }); + }); + + return { + sessionId: input.sessionId, + previewRows, + summary: { + totalRows: processedRows.length, + validRows: totals.valid, + failedRows: totals.failed, + skippedRows: totals.skipped, + duplicateEmails: totals.duplicates, + status: sessionStatus, + }, + }; + }), + + commitImport: createPermissionProcedure(PERMISSIONS.CRM_WRITE) + .input( + z.object({ + sessionId: z.string().cuid(), + organizationId: z.string().cuid(), + }) + ) + .mutation(async ({ input, ctx }) => { + await ctx.requirePermission(input.organizationId); + + const session = await ctx.db.importSession.findFirst({ + where: { + id: input.sessionId, + organizationId: input.organizationId, + }, + include: { + rows: true, + }, + }); + + if (!session) { + throw new Error("Import session not found"); + } + + if (session.status !== IMPORT_STATUS_READY) { + throw new Error( + "Import session is not ready to import. Resolve validation issues first." + ); + } + + const dedupeMode = session.dedupeMode; + + await ctx.db.importSession.update({ + where: { id: session.id }, + data: { + status: IMPORT_STATUS_IMPORTING, + startedAt: session.startedAt ?? new Date(), + }, + }); + + let successCount = 0; + let failureCount = 0; + let skippedCount = 0; + + await ctx.db.$transaction(async tx => { + for (const row of session.rows) { + if (row.status === ROW_STATUS_SKIPPED) { + skippedCount += 1; + continue; + } + + const mappedData = toMappedData( + row.mappedData as Prisma.JsonObject | null + ); + if (Object.keys(mappedData).length === 0) { + failureCount += 1; + await tx.importRow.update({ + where: { id: row.id }, + data: { status: ROW_STATUS_FAILED }, + }); + continue; + } + + const existingId = extractExistingId(row.dedupeHint); + + try { + if (dedupeMode === "UPDATE" && existingId) { + const updateData = filterUpdateData(mappedData); + if (Object.keys(updateData).length === 0) { + skippedCount += 1; + await tx.importRow.update({ + where: { id: row.id }, + data: { status: ROW_STATUS_SKIPPED }, + }); + continue; + } + + await tx.customer.update({ + where: { + id: existingId, + }, + data: updateData, + }); + } else { + const createData = buildCustomerData( + mappedData, + input.organizationId + ); + await tx.customer.create({ + data: createData, + }); + } + + successCount += 1; + await tx.importRow.update({ + where: { id: row.id }, + data: { status: ROW_STATUS_IMPORTED }, + }); + } catch (error) { + console.error("Failed to import row", error); + failureCount += 1; + await tx.importRow.update({ + where: { id: row.id }, + data: { status: ROW_STATUS_FAILED }, + }); + + await tx.importRowIssue.create({ + data: { + sessionId: session.id, + rowId: row.id, + severity: ISSUE_SEVERITY_ERROR, + message: "Failed to import row", + hint: "Please review the row data and try again", + value: null, + }, + }); + } + } + + await tx.importSession.update({ + where: { id: session.id }, + data: { + status: IMPORT_STATUS_COMPLETED, + successCount, + failureCount, + skippedCount, + completedAt: new Date(), + }, + }); + }); + + return { + sessionId: session.id, + status: IMPORT_STATUS_COMPLETED, + results: { + imported: successCount, + failed: failureCount, + skipped: skippedCount, + total: successCount + failureCount + skippedCount, + }, + }; + }), + + getSessionSummary: createPermissionProcedure(PERMISSIONS.CRM_WRITE) + .input( + z.object({ + sessionId: z.string().cuid(), + organizationId: z.string().cuid(), + }) + ) + .query(async ({ input, ctx }) => { + await ctx.requirePermission(input.organizationId); + + const session = await ctx.db.importSession.findFirst({ + where: { + id: input.sessionId, + organizationId: input.organizationId, + }, + select: { + id: true, + status: true, + successCount: true, + failureCount: true, + skippedCount: true, + rowCount: true, + completedAt: true, + }, + }); + + if (!session) { + throw new Error("Import session not found"); + } + + return session; + }), +});