From 8c5f1d4d49dcfaecb48107fec34a8089ced3343a Mon Sep 17 00:00:00 2001 From: ahasani194 Date: Sat, 7 Mar 2026 11:25:11 +0330 Subject: [PATCH] transform core api codes into this project, update modules as admin/pos context modules --- package.json | 2 + pnpm-lock.yaml | 34 + .../20260304125039_init/migration.sql | 272 ++ .../20260305132229_init/migration.sql | 31 + .../20260306193857_init/migration.sql | 21 + prisma/schema/admin/auth.prisma | 26 + prisma/schema/admin/business.prisma | 96 + prisma/schema/admin/devices.prisma | 25 + prisma/schema/admin/license.prisma | 14 + prisma/schema/admin/partners.prisma | 25 + prisma/schema/admin/profiles.prisma | 72 + prisma/schema/admin/providers.prisma | 25 + prisma/schema/enum.prisma | 40 - prisma/schema/good.prisma | 37 - .../user_devices.prisma} | 4 +- prisma/schema/{ => shared}/customers.prisma | 0 prisma/schema/shared/enum.prisma | 119 + prisma/schema/shared/good.prisma | 45 + prisma/schema/{ => shared}/sales.prisma | 15 +- prisma/schema/{ => shared}/service.prisma | 0 prisma/seed.ts | 354 +-- src/app.module.ts | 20 +- src/common/constants/translates/enums.ts | 11 + src/common/constants/translates/translates.ts | 5 + src/common/database/transaction.helper.ts | 2 +- src/common/enums/enums.ts | 20 +- src/common/filters/prisma-exception.filter.ts | 2 +- src/common/guards/context.guard.ts | 57 + .../auth => common/guards}/jwt-auth.guard.ts | 10 +- .../response-mapping.interceptor.ts | 14 +- src/common/response/response-mapper.ts | 23 +- src/common/utils/jwt-user.util.ts | 30 + src/common/utils/password.util.ts | 11 + src/generated/prisma/browser.ts | 85 +- src/generated/prisma/client.ts | 89 +- src/generated/prisma/commonInputTypes.ts | 700 +++-- src/generated/prisma/enums.ts | 129 +- src/generated/prisma/internal/class.ts | 182 +- .../prisma/internal/prismaNamespace.ts | 1632 +++++++++-- .../prisma/internal/prismaNamespaceBrowser.ts | 430 ++- src/generated/prisma/models.ts | 17 +- src/generated/prisma/models/Account.ts | 2443 +++++++++++++++++ .../prisma/models/BusinessActivity.ts | 1604 +++++++++++ src/generated/prisma/models/Complex.ts | 1608 +++++++++++ src/generated/prisma/models/Customer.ts | 8 - .../prisma/models/CustomerIndividual.ts | 4 - src/generated/prisma/models/CustomerLegal.ts | 4 +- src/generated/prisma/models/Device.ts | 808 +++--- src/generated/prisma/models/DeviceBrand.ts | 1184 ++++++++ src/generated/prisma/models/Good.ts | 703 ++++- src/generated/prisma/models/GoodCategory.ts | 492 +++- src/generated/prisma/models/Guild.ts | 1387 ++++++++++ src/generated/prisma/models/License.ts | 1377 ++++++++++ src/generated/prisma/models/Partner.ts | 1267 +++++++++ src/generated/prisma/models/Pos.ts | 2020 ++++++++++++++ src/generated/prisma/models/Provider.ts | 1264 +++++++++ src/generated/prisma/models/SalesInvoice.ts | 8 + .../prisma/models/SalesInvoiceItem.ts | 51 +- src/generated/prisma/models/Token.ts | 1269 +++++++++ src/generated/prisma/models/User.ts | 1362 +++++++++ src/generated/prisma/models/UserDevices.ts | 1246 +++++++++ .../prisma/models/VerificationCode.ts | 1255 +++++++++ src/main.ts | 2 +- src/modules/admin/admin.controller.ts | 6 + src/modules/admin/admin.guard.ts | 14 + src/modules/admin/admin.middleware.ts | 24 + src/modules/admin/admin.module.ts | 38 + .../device-brands/device-brands.controller.ts | 34 + .../device-brands/device-brands.module.ts | 11 + .../device-brands/device-brands.service.ts | 35 + .../dto/create-device-brand.dto.ts | 6 + .../dto/update-device-brand.dto.ts | 4 + .../admin/devices/devices.controller.ts | 33 + src/modules/admin/devices/devices.module.ts | 11 + src/modules/admin/devices/devices.service.ts | 52 + src/modules/admin/devices/dto/device.dto.ts | 26 + .../admin/guilds/dto/create-guild.dto.ts | 10 + .../admin/guilds/dto/update-guild.dto.ts | 4 + .../dto/create-good-category.dto.ts | 0 .../good-categories.controller.ts | 35 + .../good-categories/good-categories.module.ts | 9 + .../good-categories.service.ts | 121 + .../admin/guilds/goods/dto/create-good.dto.ts | 39 + .../admin/guilds/goods/goods.controller.ts | 23 + .../admin/guilds/goods/goods.module.ts | 9 + .../admin/guilds/goods/goods.service.ts | 73 + src/modules/admin/guilds/guilds.controller.ts | 37 + src/modules/admin/guilds/guilds.module.ts | 13 + src/modules/admin/guilds/guilds.service.ts | 66 + src/modules/admin/licenses/dto/license.dto.ts | 41 + .../admin/licenses/licenses.controller.ts | 33 + src/modules/admin/licenses/licenses.module.ts | 12 + .../admin/licenses/licenses.service.ts | 122 + src/modules/admin/partners/dto/partner.dto.ts | 20 + .../partners/licenses/dto/license.dto.ts | 71 + .../partners/licenses/licenses.controller.ts | 37 + .../partners/licenses/licenses.module.ts | 12 + .../partners/licenses/licenses.service.ts | 197 ++ .../partnerAccounts/accounts.controller.ts | 33 + .../partnerAccounts/accounts.module.ts | 12 + .../partnerAccounts/accounts.service.ts | 82 + .../partnerAccounts/dto/account.dto.ts | 36 + .../admin/partners/partners.controller.ts | 33 + src/modules/admin/partners/partners.module.ts | 15 + .../admin/partners/partners.service.ts | 36 + .../admin/providers/dto/provider.dto.ts | 20 + .../admin/providers/providers.controller.ts | 35 + .../admin/providers/providers.module.ts | 12 + .../admin/providers/providers.service.ts | 37 + .../admin/translate/translate.controller.ts | 12 + .../admin/translate/translate.module.ts | 10 + .../admin/translate/translate.service.ts | 68 + .../users/accounts/accounts.controller.ts | 35 + .../admin/users/accounts/accounts.module.ts | 12 + .../admin/users/accounts/accounts.service.ts | 47 + .../admin/users/accounts/dto/account.dto.ts | 41 + .../business-activities.controller.ts | 40 + .../business-activities.module.ts | 11 + .../business-activities.service.ts | 57 + .../dto/create-business-activities.dto.ts | 12 + .../dto/update-business-activities.dto.ts | 4 + src/modules/admin/users/dto/user.dto.ts | 28 + src/modules/admin/users/users.controller.ts | 33 + src/modules/admin/users/users.module.ts | 14 + src/modules/admin/users/users.service.ts | 42 + src/modules/auth/auth.controller.ts | 53 +- src/modules/auth/auth.module.ts | 2 +- src/modules/auth/auth.service.ts | 224 +- src/modules/auth/current-user.decorator.ts | 2 +- src/modules/auth/dto/login.dto.ts | 2 +- src/modules/auth/models/index.ts | 19 + src/modules/enums/enums.controller.ts | 80 + src/modules/enums/enums.service.ts | 48 +- .../{ => pos}/config/config.controller.ts | 2 +- src/modules/{ => pos}/config/config.module.ts | 2 +- .../{ => pos}/config/config.service.ts | 10 +- .../{ => pos}/config/dto/create-config.dto.ts | 0 .../customers/customers.controller.ts | 2 +- .../{ => pos}/customers/customers.module.ts | 2 +- .../{ => pos}/customers/customers.service.ts | 0 .../dto/create-customer-individual.dto.ts | 0 .../dto/create-customer-legal.dto.ts | 0 .../customers/dto/create-customer.dto.ts | 0 .../dto/create-good-category.dto.ts | 20 + .../good-categories.controller.ts | 4 +- .../good-categories/good-categories.module.ts | 2 +- .../good-categories.service.ts | 6 +- .../{ => pos}/goods/dto/create-good.dto.ts | 0 .../{ => pos}/goods/goods.controller.ts | 4 +- src/modules/{ => pos}/goods/goods.module.ts | 2 +- src/modules/{ => pos}/goods/goods.service.ts | 26 +- src/modules/pos/pos.middleware.ts | 24 + src/modules/pos/pos.module.ts | 27 + .../dto/create-sales-invoice.dto.ts | 11 +- .../dto/create-sales-invoice-item.dto.ts | 12 +- .../sales-invoice-items.controller.ts | 0 .../sales-invoice-items.module.ts | 0 .../sales-invoice-items.service.ts | 0 .../dto/create-sales-invoice-payment.dto.ts | 0 .../sales-invoice-payments.controller.ts | 0 .../sales-invoice-payments.module.ts | 0 .../sales-invoice-payments.service.ts | 0 .../sales-invoices.controller.ts | 5 +- .../sales-invoices/sales-invoices.module.ts | 2 +- .../sales-invoices/sales-invoices.service.ts | 10 +- src/modules/profile/profile.service.ts | 8 +- tsconfig.json | 14 + 167 files changed, 26975 insertions(+), 1837 deletions(-) create mode 100644 prisma/migrations/20260304125039_init/migration.sql create mode 100644 prisma/migrations/20260305132229_init/migration.sql create mode 100644 prisma/migrations/20260306193857_init/migration.sql create mode 100644 prisma/schema/admin/auth.prisma create mode 100644 prisma/schema/admin/business.prisma create mode 100644 prisma/schema/admin/devices.prisma create mode 100644 prisma/schema/admin/license.prisma create mode 100644 prisma/schema/admin/partners.prisma create mode 100644 prisma/schema/admin/profiles.prisma create mode 100644 prisma/schema/admin/providers.prisma delete mode 100644 prisma/schema/enum.prisma delete mode 100644 prisma/schema/good.prisma rename prisma/schema/{devices.prisma => pos/user_devices.prisma} (92%) rename prisma/schema/{ => shared}/customers.prisma (100%) create mode 100644 prisma/schema/shared/enum.prisma create mode 100644 prisma/schema/shared/good.prisma rename prisma/schema/{ => shared}/sales.prisma (72%) rename prisma/schema/{ => shared}/service.prisma (100%) create mode 100644 src/common/constants/translates/enums.ts create mode 100644 src/common/constants/translates/translates.ts create mode 100644 src/common/guards/context.guard.ts rename src/{modules/auth => common/guards}/jwt-auth.guard.ts (84%) create mode 100644 src/common/utils/jwt-user.util.ts create mode 100644 src/common/utils/password.util.ts create mode 100644 src/generated/prisma/models/Account.ts create mode 100644 src/generated/prisma/models/BusinessActivity.ts create mode 100644 src/generated/prisma/models/Complex.ts create mode 100644 src/generated/prisma/models/DeviceBrand.ts create mode 100644 src/generated/prisma/models/Guild.ts create mode 100644 src/generated/prisma/models/License.ts create mode 100644 src/generated/prisma/models/Partner.ts create mode 100644 src/generated/prisma/models/Pos.ts create mode 100644 src/generated/prisma/models/Provider.ts create mode 100644 src/generated/prisma/models/Token.ts create mode 100644 src/generated/prisma/models/User.ts create mode 100644 src/generated/prisma/models/UserDevices.ts create mode 100644 src/generated/prisma/models/VerificationCode.ts create mode 100644 src/modules/admin/admin.controller.ts create mode 100644 src/modules/admin/admin.guard.ts create mode 100644 src/modules/admin/admin.middleware.ts create mode 100644 src/modules/admin/admin.module.ts create mode 100644 src/modules/admin/device-brands/device-brands.controller.ts create mode 100644 src/modules/admin/device-brands/device-brands.module.ts create mode 100644 src/modules/admin/device-brands/device-brands.service.ts create mode 100644 src/modules/admin/device-brands/dto/create-device-brand.dto.ts create mode 100644 src/modules/admin/device-brands/dto/update-device-brand.dto.ts create mode 100644 src/modules/admin/devices/devices.controller.ts create mode 100644 src/modules/admin/devices/devices.module.ts create mode 100644 src/modules/admin/devices/devices.service.ts create mode 100644 src/modules/admin/devices/dto/device.dto.ts create mode 100644 src/modules/admin/guilds/dto/create-guild.dto.ts create mode 100644 src/modules/admin/guilds/dto/update-guild.dto.ts rename src/modules/{ => admin/guilds}/good-categories/dto/create-good-category.dto.ts (100%) create mode 100644 src/modules/admin/guilds/good-categories/good-categories.controller.ts create mode 100644 src/modules/admin/guilds/good-categories/good-categories.module.ts create mode 100644 src/modules/admin/guilds/good-categories/good-categories.service.ts create mode 100644 src/modules/admin/guilds/goods/dto/create-good.dto.ts create mode 100644 src/modules/admin/guilds/goods/goods.controller.ts create mode 100644 src/modules/admin/guilds/goods/goods.module.ts create mode 100644 src/modules/admin/guilds/goods/goods.service.ts create mode 100644 src/modules/admin/guilds/guilds.controller.ts create mode 100644 src/modules/admin/guilds/guilds.module.ts create mode 100644 src/modules/admin/guilds/guilds.service.ts create mode 100644 src/modules/admin/licenses/dto/license.dto.ts create mode 100644 src/modules/admin/licenses/licenses.controller.ts create mode 100644 src/modules/admin/licenses/licenses.module.ts create mode 100644 src/modules/admin/licenses/licenses.service.ts create mode 100644 src/modules/admin/partners/dto/partner.dto.ts create mode 100644 src/modules/admin/partners/licenses/dto/license.dto.ts create mode 100644 src/modules/admin/partners/licenses/licenses.controller.ts create mode 100644 src/modules/admin/partners/licenses/licenses.module.ts create mode 100644 src/modules/admin/partners/licenses/licenses.service.ts create mode 100644 src/modules/admin/partners/partnerAccounts/accounts.controller.ts create mode 100644 src/modules/admin/partners/partnerAccounts/accounts.module.ts create mode 100644 src/modules/admin/partners/partnerAccounts/accounts.service.ts create mode 100644 src/modules/admin/partners/partnerAccounts/dto/account.dto.ts create mode 100644 src/modules/admin/partners/partners.controller.ts create mode 100644 src/modules/admin/partners/partners.module.ts create mode 100644 src/modules/admin/partners/partners.service.ts create mode 100644 src/modules/admin/providers/dto/provider.dto.ts create mode 100644 src/modules/admin/providers/providers.controller.ts create mode 100644 src/modules/admin/providers/providers.module.ts create mode 100644 src/modules/admin/providers/providers.service.ts create mode 100644 src/modules/admin/translate/translate.controller.ts create mode 100644 src/modules/admin/translate/translate.module.ts create mode 100644 src/modules/admin/translate/translate.service.ts create mode 100644 src/modules/admin/users/accounts/accounts.controller.ts create mode 100644 src/modules/admin/users/accounts/accounts.module.ts create mode 100644 src/modules/admin/users/accounts/accounts.service.ts create mode 100644 src/modules/admin/users/accounts/dto/account.dto.ts create mode 100644 src/modules/admin/users/business-activities/business-activities.controller.ts create mode 100644 src/modules/admin/users/business-activities/business-activities.module.ts create mode 100644 src/modules/admin/users/business-activities/business-activities.service.ts create mode 100644 src/modules/admin/users/business-activities/dto/create-business-activities.dto.ts create mode 100644 src/modules/admin/users/business-activities/dto/update-business-activities.dto.ts create mode 100644 src/modules/admin/users/dto/user.dto.ts create mode 100644 src/modules/admin/users/users.controller.ts create mode 100644 src/modules/admin/users/users.module.ts create mode 100644 src/modules/admin/users/users.service.ts create mode 100644 src/modules/auth/models/index.ts rename src/modules/{ => pos}/config/config.controller.ts (94%) rename src/modules/{ => pos}/config/config.module.ts (87%) rename src/modules/{ => pos}/config/config.service.ts (65%) rename src/modules/{ => pos}/config/dto/create-config.dto.ts (100%) rename src/modules/{ => pos}/customers/customers.controller.ts (94%) rename src/modules/{ => pos}/customers/customers.module.ts (87%) rename src/modules/{ => pos}/customers/customers.service.ts (100%) rename src/modules/{ => pos}/customers/dto/create-customer-individual.dto.ts (100%) rename src/modules/{ => pos}/customers/dto/create-customer-legal.dto.ts (100%) rename src/modules/{ => pos}/customers/dto/create-customer.dto.ts (100%) create mode 100644 src/modules/pos/good-categories/dto/create-good-category.dto.ts rename src/modules/{ => pos}/good-categories/good-categories.controller.ts (88%) rename src/modules/{ => pos}/good-categories/good-categories.module.ts (87%) rename src/modules/{ => pos}/good-categories/good-categories.service.ts (85%) rename src/modules/{ => pos}/goods/dto/create-good.dto.ts (100%) rename src/modules/{ => pos}/goods/goods.controller.ts (87%) rename src/modules/{ => pos}/goods/goods.module.ts (87%) rename src/modules/{ => pos}/goods/goods.service.ts (74%) create mode 100644 src/modules/pos/pos.middleware.ts create mode 100644 src/modules/pos/pos.module.ts rename src/modules/{ => pos}/sales-invoices/dto/create-sales-invoice.dto.ts (76%) rename src/modules/{ => pos/sales-invoices}/sales-invoice-items/dto/create-sales-invoice-item.dto.ts (73%) rename src/modules/{ => pos/sales-invoices}/sales-invoice-items/sales-invoice-items.controller.ts (100%) rename src/modules/{ => pos/sales-invoices}/sales-invoice-items/sales-invoice-items.module.ts (100%) rename src/modules/{ => pos/sales-invoices}/sales-invoice-items/sales-invoice-items.service.ts (100%) rename src/modules/{ => pos/sales-invoices}/sales-invoice-payments/dto/create-sales-invoice-payment.dto.ts (100%) rename src/modules/{ => pos/sales-invoices}/sales-invoice-payments/sales-invoice-payments.controller.ts (100%) rename src/modules/{ => pos/sales-invoices}/sales-invoice-payments/sales-invoice-payments.module.ts (100%) rename src/modules/{ => pos/sales-invoices}/sales-invoice-payments/sales-invoice-payments.service.ts (100%) rename src/modules/{ => pos}/sales-invoices/sales-invoices.controller.ts (86%) rename src/modules/{ => pos}/sales-invoices/sales-invoices.module.ts (87%) rename src/modules/{ => pos}/sales-invoices/sales-invoices.service.ts (94%) diff --git a/package.json b/package.json index dfe7a3e..11fdfa0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "@nestjs/platform-express": "^11.0.1", "@nestjs/swagger": "^11.2.3", "@prisma/adapter-mariadb": "^7.1.0", + "@types/bcrypt": "^6.0.0", "@types/multer": "^2.0.0", + "bcrypt": "^6.0.0", "class-transformer": "^0.5.1", "class-validator": "^0.14.3", "cookie-parser": "^1.4.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dfcc6e5..b962106 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,9 +26,15 @@ importers: '@prisma/adapter-mariadb': specifier: ^7.1.0 version: 7.1.0 + '@types/bcrypt': + specifier: ^6.0.0 + version: 6.0.0 '@types/multer': specifier: ^2.0.0 version: 2.0.0 + bcrypt: + specifier: ^6.0.0 + version: 6.0.0 class-transformer: specifier: ^0.5.1 version: 0.5.1 @@ -1125,6 +1131,9 @@ packages: '@types/babel__traverse@7.28.0': resolution: {integrity: sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==} + '@types/bcrypt@6.0.0': + resolution: {integrity: sha512-/oJGukuH3D2+D+3H4JWLaAsJ/ji86dhRidzZ/Od7H/i8g+aCmvkeCc6Ni/f9uxGLSQVCRZkX2/lqEFG2BvWtlQ==} + '@types/body-parser@1.19.6': resolution: {integrity: sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==} @@ -1581,6 +1590,10 @@ packages: resolution: {integrity: sha512-Mh++g+2LPfzZToywfE1BUzvZbfOY52Nil0rn9H1CPC5DJ7fX+Vir7nToBeoiSbB1zTNeGYbELEvJESujgGrzXw==} hasBin: true + bcrypt@6.0.0: + resolution: {integrity: sha512-cU8v/EGSrnH+HnxV2z0J7/blxH8gq7Xh2JFT6Aroax7UohdmiJJlxApMxtKfuI7z68NvvVcmR78k2LbT6efhRg==} + engines: {node: '>= 18'} + bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -2837,12 +2850,20 @@ packages: node-abort-controller@3.1.1: resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} + node-addon-api@8.5.0: + resolution: {integrity: sha512-/bRZty2mXUIFY/xU5HLvveNHlswNJej+RnxBjOMkidWfwZzgTbPG1E3K5TOxRLOR+5hX7bSofy8yf1hZevMS8A==} + engines: {node: ^18 || ^20 || >= 21} + node-emoji@1.11.0: resolution: {integrity: sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==} node-fetch-native@1.6.7: resolution: {integrity: sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==} + node-gyp-build@4.8.4: + resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} + hasBin: true + node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} @@ -4745,6 +4766,10 @@ snapshots: dependencies: '@babel/types': 7.28.5 + '@types/bcrypt@6.0.0': + dependencies: + '@types/node': 22.19.1 + '@types/body-parser@1.19.6': dependencies: '@types/connect': 3.4.38 @@ -5246,6 +5271,11 @@ snapshots: baseline-browser-mapping@2.9.0: {} + bcrypt@6.0.0: + dependencies: + node-addon-api: 8.5.0 + node-gyp-build: 4.8.4 + bl@4.1.0: dependencies: buffer: 5.7.1 @@ -6694,12 +6724,16 @@ snapshots: node-abort-controller@3.1.1: {} + node-addon-api@8.5.0: {} + node-emoji@1.11.0: dependencies: lodash: 4.17.21 node-fetch-native@1.6.7: {} + node-gyp-build@4.8.4: {} + node-int64@0.4.0: {} node-releases@2.0.27: {} diff --git a/prisma/migrations/20260304125039_init/migration.sql b/prisma/migrations/20260304125039_init/migration.sql new file mode 100644 index 0000000..a9f5ce6 --- /dev/null +++ b/prisma/migrations/20260304125039_init/migration.sql @@ -0,0 +1,272 @@ +/* + Warnings: + + - The primary key for the `devices` table will be changed. If it partially fails, the table could be left without primary key constraint. + - You are about to drop the column `account_id` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `app_version` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `brand` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `browser_name` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `build_number` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `device` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `fcm_token` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `model` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `platform` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `release_number` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `sdk_version` on the `devices` table. All the data in the column will be lost. + - You are about to drop the column `uuid` on the `devices` table. All the data in the column will be lost. + - A unique constraint covering the columns `[complex_id,national_id]` on the table `customer_individuals` will be added. If there are existing duplicate values, this will fail. + - A unique constraint covering the columns `[complex_id,registration_number]` on the table `customer_legal` will be added. If there are existing duplicate values, this will fail. + - Added the required column `complex_id` to the `customer_individuals` table without a default value. This is not possible if the table is not empty. + - Added the required column `complex_id` to the `customer_legal` table without a default value. This is not possible if the table is not empty. + - Added the required column `brand_id` to the `devices` table without a default value. This is not possible if the table is not empty. + - The required column `id` was added to the `devices` table with a prisma-level default value. This is not possible if the table is not empty. Please add this column as optional, then populate it before making it required. + - Added the required column `name` to the `devices` table without a default value. This is not possible if the table is not empty. + - Added the required column `updated_at` to the `devices` table without a default value. This is not possible if the table is not empty. + +*/ +-- DropIndex +DROP INDEX `devices_uuid_key` ON `devices`; + +-- AlterTable +ALTER TABLE `customer_individuals` ADD COLUMN `complex_id` VARCHAR(191) NOT NULL; + +-- AlterTable +ALTER TABLE `customer_legal` ADD COLUMN `complex_id` VARCHAR(191) NOT NULL; + +-- AlterTable +ALTER TABLE `devices` DROP PRIMARY KEY, + DROP COLUMN `account_id`, + DROP COLUMN `app_version`, + DROP COLUMN `brand`, + DROP COLUMN `browser_name`, + DROP COLUMN `build_number`, + DROP COLUMN `device`, + DROP COLUMN `fcm_token`, + DROP COLUMN `model`, + DROP COLUMN `platform`, + DROP COLUMN `release_number`, + DROP COLUMN `sdk_version`, + DROP COLUMN `uuid`, + ADD COLUMN `brand_id` VARCHAR(191) NOT NULL, + ADD COLUMN `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + ADD COLUMN `id` VARCHAR(191) NOT NULL, + ADD COLUMN `name` VARCHAR(191) NOT NULL, + ADD COLUMN `updated_at` DATETIME(3) NOT NULL, + MODIFY `os_version` VARCHAR(191) NULL, + ADD PRIMARY KEY (`id`); + +-- CreateTable +CREATE TABLE `tokens` ( + `id` VARCHAR(191) NOT NULL, + `token` VARCHAR(191) NOT NULL, + `type` ENUM('ACCESS', 'REFRESH') NOT NULL, + `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + `expires_at` DATETIME(3) NOT NULL, + `account_id` VARCHAR(191) NOT NULL, + + UNIQUE INDEX `tokens_token_key`(`token`), + UNIQUE INDEX `tokens_type_account_id_key`(`type`, `account_id`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `verification_codes` ( + `id` VARCHAR(191) NOT NULL, + `code` VARCHAR(191) NOT NULL, + `is_used` BOOLEAN NOT NULL DEFAULT false, + `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + `expires_at` DATETIME(3) NOT NULL, + `account_id` VARCHAR(191) NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `guilds` ( + `id` VARCHAR(191) NOT NULL, + `name` VARCHAR(191) NOT NULL, + `code` VARCHAR(191) NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `business_activities` ( + `id` VARCHAR(191) NOT NULL, + `name` VARCHAR(191) NOT NULL, + `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + `tax_id` VARCHAR(191) NULL, + `guild_id` VARCHAR(191) NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `complexes` ( + `id` VARCHAR(191) NOT NULL, + `name` VARCHAR(191) NOT NULL, + `address` VARCHAR(191) NULL, + `business_activity_id` VARCHAR(191) NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `poses` ( + `id` VARCHAR(191) NOT NULL, + `serial` VARCHAR(191) NOT NULL, + `model` VARCHAR(191) NULL, + `status` ENUM('ACTIVE', 'DISABLED') NOT NULL DEFAULT 'ACTIVE', + `pos_type` ENUM('PSP', 'MOBILE', 'API') NOT NULL, + `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + `updated_at` DATETIME(3) NOT NULL, + `complex_id` VARCHAR(191) NOT NULL, + `device_id` VARCHAR(191) NOT NULL, + `provider_id` VARCHAR(191) NULL, + + UNIQUE INDEX `poses_serial_key`(`serial`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `device_brands` ( + `id` VARCHAR(191) NOT NULL, + `name` VARCHAR(191) NOT NULL, + `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + `updated_at` DATETIME(3) NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `licenses` ( + `id` VARCHAR(191) NOT NULL, + `pos_id` VARCHAR(191) NOT NULL, + `partner_id` VARCHAR(191) NOT NULL, + `starts_at` DATETIME(3) NOT NULL, + `expires_at` DATETIME(3) NOT NULL, + `status` ENUM('ACTIVE', 'EXPIRED', 'SUSPENDED') NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `partners` ( + `id` VARCHAR(191) NOT NULL, + `name` VARCHAR(191) NOT NULL, + `code` VARCHAR(191) NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `users` ( + `id` VARCHAR(191) NOT NULL, + `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + `mobile_number` VARCHAR(191) NOT NULL, + `national_code` VARCHAR(191) NULL, + `first_name` VARCHAR(191) NOT NULL, + `last_name` VARCHAR(191) NOT NULL, + + UNIQUE INDEX `users_mobile_number_key`(`mobile_number`), + UNIQUE INDEX `users_national_code_key`(`national_code`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `accounts` ( + `id` VARCHAR(191) NOT NULL, + `username` VARCHAR(191) NOT NULL, + `type` ENUM('PARTNER', 'BUSINESS', 'ADMIN', 'PROVIDER', 'POS') NOT NULL, + `status` ENUM('ACTIVE', 'SUSPENDED') NOT NULL, + `password` VARCHAR(191) NOT NULL, + `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), + `user_id` VARCHAR(191) NOT NULL, + `partner_id` VARCHAR(191) NULL, + `business_id` VARCHAR(191) NULL, + `provider_id` VARCHAR(191) NULL, + `pos_id` VARCHAR(191) NULL, + + UNIQUE INDEX `accounts_username_key`(`username`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `providers` ( + `id` VARCHAR(191) NOT NULL, + `name` VARCHAR(191) NOT NULL, + `code` VARCHAR(191) NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `user_devices` ( + `account_id` VARCHAR(255) NULL, + `app_version` VARCHAR(20) NOT NULL, + `build_number` VARCHAR(20) NOT NULL, + `uuid` VARCHAR(255) NOT NULL, + `platform` VARCHAR(100) NOT NULL, + `brand` VARCHAR(100) NOT NULL, + `model` VARCHAR(100) NOT NULL, + `device` VARCHAR(100) NOT NULL, + `os_version` VARCHAR(20) NOT NULL, + `sdk_version` VARCHAR(20) NOT NULL, + `release_number` VARCHAR(20) NOT NULL, + `browser_name` VARCHAR(100) NULL, + `fcm_token` VARCHAR(100) NULL, + + UNIQUE INDEX `user_devices_uuid_key`(`uuid`), + PRIMARY KEY (`uuid`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateIndex +CREATE UNIQUE INDEX `customer_individuals_complex_id_national_id_key` ON `customer_individuals`(`complex_id`, `national_id`); + +-- CreateIndex +CREATE UNIQUE INDEX `customer_legal_complex_id_registration_number_key` ON `customer_legal`(`complex_id`, `registration_number`); + +-- AddForeignKey +ALTER TABLE `tokens` ADD CONSTRAINT `tokens_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `verification_codes` ADD CONSTRAINT `verification_codes_account_id_fkey` FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `business_activities` ADD CONSTRAINT `business_activities_guild_id_fkey` FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `complexes` ADD CONSTRAINT `complexes_business_activity_id_fkey` FOREIGN KEY (`business_activity_id`) REFERENCES `business_activities`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `poses` ADD CONSTRAINT `poses_complex_id_fkey` FOREIGN KEY (`complex_id`) REFERENCES `complexes`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `poses` ADD CONSTRAINT `poses_device_id_fkey` FOREIGN KEY (`device_id`) REFERENCES `devices`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `poses` ADD CONSTRAINT `poses_provider_id_fkey` FOREIGN KEY (`provider_id`) REFERENCES `providers`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `devices` ADD CONSTRAINT `devices_brand_id_fkey` FOREIGN KEY (`brand_id`) REFERENCES `device_brands`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `licenses` ADD CONSTRAINT `licenses_pos_id_fkey` FOREIGN KEY (`pos_id`) REFERENCES `poses`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `licenses` ADD CONSTRAINT `licenses_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `accounts` ADD CONSTRAINT `accounts_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `accounts` ADD CONSTRAINT `accounts_partner_id_fkey` FOREIGN KEY (`partner_id`) REFERENCES `partners`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `accounts` ADD CONSTRAINT `accounts_business_id_fkey` FOREIGN KEY (`business_id`) REFERENCES `business_activities`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `accounts` ADD CONSTRAINT `accounts_provider_id_fkey` FOREIGN KEY (`provider_id`) REFERENCES `providers`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `accounts` ADD CONSTRAINT `accounts_pos_id_fkey` FOREIGN KEY (`pos_id`) REFERENCES `poses`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20260305132229_init/migration.sql b/prisma/migrations/20260305132229_init/migration.sql new file mode 100644 index 0000000..cf1ea40 --- /dev/null +++ b/prisma/migrations/20260305132229_init/migration.sql @@ -0,0 +1,31 @@ +/* + Warnings: + + - You are about to drop the column `account_id` on the `good_categories` table. All the data in the column will be lost. + - You are about to drop the column `account_id` on the `goods` table. All the data in the column will be lost. + +*/ +-- AlterTable +ALTER TABLE `good_categories` DROP COLUMN `account_id`, + ADD COLUMN `guild_id` VARCHAR(191) NULL, + ADD COLUMN `is_default_guild_good` BOOLEAN NOT NULL DEFAULT false, + MODIFY `complex_id` VARCHAR(191) NULL; + +-- AlterTable +ALTER TABLE `goods` DROP COLUMN `account_id`, + ADD COLUMN `guild_id` VARCHAR(191) NULL, + ADD COLUMN `is_default_guild_good` BOOLEAN NOT NULL DEFAULT false, + MODIFY `base_sale_price` DECIMAL(15, 0) NULL DEFAULT 0.00, + MODIFY `complex_id` VARCHAR(191) NULL; + +-- AddForeignKey +ALTER TABLE `goods` ADD CONSTRAINT `goods_complex_id_fkey` FOREIGN KEY (`complex_id`) REFERENCES `complexes`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `goods` ADD CONSTRAINT `goods_guild_id_fkey` FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `good_categories` ADD CONSTRAINT `good_categories_guild_id_fkey` FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `good_categories` ADD CONSTRAINT `good_categories_complex_id_fkey` FOREIGN KEY (`complex_id`) REFERENCES `complexes`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/prisma/migrations/20260306193857_init/migration.sql b/prisma/migrations/20260306193857_init/migration.sql new file mode 100644 index 0000000..07c4f30 --- /dev/null +++ b/prisma/migrations/20260306193857_init/migration.sql @@ -0,0 +1,21 @@ +/* + Warnings: + + - You are about to drop the column `tax_id` on the `business_activities` table. All the data in the column will be lost. + - You are about to drop the column `pricingModel` on the `sales_invoice_items` table. All the data in the column will be lost. + - Added the required column `owner_id` to the `business_activities` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE `business_activities` DROP COLUMN `tax_id`, + ADD COLUMN `owner_id` VARCHAR(191) NOT NULL; + +-- AlterTable +ALTER TABLE `complexes` ADD COLUMN `tax_id` VARCHAR(191) NULL; + +-- AlterTable +ALTER TABLE `sales_invoice_items` DROP COLUMN `pricingModel`, + MODIFY `unit_type` ENUM('COUNT', 'GRAM', 'KILOGRAM', 'MILLILITER', 'LITER', 'METER', 'HOUR') NOT NULL; + +-- AddForeignKey +ALTER TABLE `business_activities` ADD CONSTRAINT `business_activities_owner_id_fkey` FOREIGN KEY (`owner_id`) REFERENCES `users`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/schema/admin/auth.prisma b/prisma/schema/admin/auth.prisma new file mode 100644 index 0000000..e77a45c --- /dev/null +++ b/prisma/schema/admin/auth.prisma @@ -0,0 +1,26 @@ +model Token { + id String @id @default(uuid()) + token String @unique + type TokenType + created_at DateTime @default(now()) + expires_at DateTime + + account_id String + account Account @relation(fields: [account_id], references: [id]) + + @@unique([type, account_id]) + @@map("tokens") +} + +model VerificationCode { + id String @id @default(uuid()) + code String + is_used Boolean @default(false) + created_at DateTime @default(now()) + expires_at DateTime + + account_id String + account Account @relation(fields: [account_id], references: [id]) + + @@map("verification_codes") +} diff --git a/prisma/schema/admin/business.prisma b/prisma/schema/admin/business.prisma new file mode 100644 index 0000000..b9635a4 --- /dev/null +++ b/prisma/schema/admin/business.prisma @@ -0,0 +1,96 @@ +model Guild { + id String @id @default(uuid()) + name String + code String? + + business_activities BusinessActivity[] + goods Good[] + good_categories GoodCategory[] + + @@map("guilds") +} + +model BusinessActivity { + id String @id @default(uuid()) + name String + created_at DateTime @default(now()) + guild_id String + owner_id String + + guild Guild @relation(fields: [guild_id], references: [id]) + user User @relation(fields: [owner_id], references: [id]) + + complexes Complex[] + accounts Account[] + + @@map("business_activities") +} + +model Complex { + id String @id @default(uuid()) + name String + address String? + tax_id String? + + business_activity_id String + + business_activity BusinessActivity @relation(fields: [business_activity_id], references: [id]) + + pos_list Pos[] + goods Good[] + good_categories GoodCategory[] + + @@map("complexes") +} + +model Pos { + id String @id @default(uuid()) + serial String @unique + model String? + status POSStatus @default(ACTIVE) + pos_type POSType + created_at DateTime @default(now()) + updated_at DateTime @updatedAt() + + complex_id String + device_id String + provider_id String? + + complex Complex @relation(fields: [complex_id], references: [id]) + device Device @relation(fields: [device_id], references: [id]) + provider Provider? @relation(fields: [provider_id], references: [id]) + + licenses License[] + accounts Account[] + + @@map("poses") +} + +// model BusinessAccount { +// id String @id @default(uuid()) +// role BusinessRole +// status AccountStatus @default(ACTIVE) +// created_at DateTime @default(now()) +// business_activity_id String +// account_id String @unique + +// account Account @relation(fields: [account_id], references: [id]) +// owned_activities BusinessActivity[] @relation("business_owner") + +// @@unique([business_activity_id, account_id]) +// @@map("business_accounts") +// } + +// model PosAccount { +// id String @id @default(uuid()) +// pos_id String +// account_id String +// role POSRole +// created_at DateTime @default(now()) + +// pos Pos @relation(fields: [pos_id], references: [id]) +// account Account @relation(fields: [account_id], references: [id]) + +// @@unique([pos_id, account_id]) +// @@map("pos_accounts") +// } diff --git a/prisma/schema/admin/devices.prisma b/prisma/schema/admin/devices.prisma new file mode 100644 index 0000000..2e09f53 --- /dev/null +++ b/prisma/schema/admin/devices.prisma @@ -0,0 +1,25 @@ +model DeviceBrand { + id String @id @default(uuid()) + name String + + created_at DateTime @default(now()) + updated_at DateTime @updatedAt() + + devices Device[] + + @@map("device_brands") +} + +model Device { + id String @id @default(uuid()) + name String + os_version String? + created_at DateTime @default(now()) + updated_at DateTime @updatedAt() + brand_id String + + brand DeviceBrand @relation(fields: [brand_id], references: [id]) + poses Pos[] + + @@map("devices") +} diff --git a/prisma/schema/admin/license.prisma b/prisma/schema/admin/license.prisma new file mode 100644 index 0000000..05ec6d8 --- /dev/null +++ b/prisma/schema/admin/license.prisma @@ -0,0 +1,14 @@ +model License { + id String @id @default(uuid()) + starts_at DateTime + expires_at DateTime + status LicenseStatus + + pos_id String + partner_id String + + pos Pos @relation(fields: [pos_id], references: [id]) + partner Partner @relation(fields: [partner_id], references: [id]) + + @@map("licenses") +} diff --git a/prisma/schema/admin/partners.prisma b/prisma/schema/admin/partners.prisma new file mode 100644 index 0000000..9a98de7 --- /dev/null +++ b/prisma/schema/admin/partners.prisma @@ -0,0 +1,25 @@ +model Partner { + id String @id @default(uuid()) + name String + code String? + + licenses License[] + account Account[] + + @@map("partners") +} + +// model PartnerAccount { +// id String @id @default(uuid()) +// role PartnerRole +// status AccountStatus @default(ACTIVE) +// created_at DateTime @default(now()) +// partner_id String +// account_id String @unique + +// partner Partner @relation(fields: [partner_id], references: [id]) +// account Account @relation(fields: [account_id], references: [id]) + +// @@unique([partner_id, account_id]) +// @@map("partner_accounts") +// } diff --git a/prisma/schema/admin/profiles.prisma b/prisma/schema/admin/profiles.prisma new file mode 100644 index 0000000..a0bdb83 --- /dev/null +++ b/prisma/schema/admin/profiles.prisma @@ -0,0 +1,72 @@ +model User { + id String @id @default(uuid()) + // user_type UserType + created_at DateTime @default(now()) + + // individual_profile IndividualProfile? + // legal_profile LegalProfile? + mobile_number String @unique() + national_code String? @unique() + first_name String + last_name String + // username String + accounts Account[] + businessActivities BusinessActivity[] + + @@map("users") +} + +// model LegalProfile { +// user_id String @id +// company_name String +// register_no String @unique() +// representative_name String? +// representative_national_id String? + +// // user User @relation(fields: [user_id], references: [id]) + +// @@map("legal_profiles") +// } + +// model IndividualProfile { +// user_id String @id +// national_code String @unique() +// first_name String +// last_name String +// birth_date DateTime? +// mobile_number String +// // user User @relation(fields: [user_id], references: [id]) + +// @@map("individual_profiles") +// } + +model Account { + id String @id @default(uuid()) + username String @unique() + // first_name String + // last_name String + type AccountType + status AccountStatus + password String + created_at DateTime @default(now()) + + user_id String + user User @relation(fields: [user_id], references: [id]) + + partner_id String? + partner Partner? @relation(fields: [partner_id], references: [id]) + + business_id String? + business BusinessActivity? @relation(fields: [business_id], references: [id]) + + provider_id String? + provider Provider? @relation(fields: [provider_id], references: [id]) + + pos_id String? + pos Pos? @relation(fields: [pos_id], references: [id]) + + verification_codes VerificationCode[] + tokens Token[] + + @@map("accounts") +} diff --git a/prisma/schema/admin/providers.prisma b/prisma/schema/admin/providers.prisma new file mode 100644 index 0000000..cb88b56 --- /dev/null +++ b/prisma/schema/admin/providers.prisma @@ -0,0 +1,25 @@ +model Provider { + id String @id @default(uuid()) + name String + code String? + + pos_list Pos[] + accounts Account[] + + @@map("providers") +} + +// model ProviderAccount { +// id String @id @default(uuid()) +// role ProviderRole +// status AccountStatus @default(ACTIVE) +// created_at DateTime @default(now()) +// provider_id String +// account_id String @unique + +// provider Provider @relation(fields: [provider_id], references: [id]) +// account Account @relation(fields: [account_id], references: [id]) + +// @@unique([provider_id, account_id]) +// @@map("provider_accounts") +// } diff --git a/prisma/schema/enum.prisma b/prisma/schema/enum.prisma deleted file mode 100644 index fcb95dd..0000000 --- a/prisma/schema/enum.prisma +++ /dev/null @@ -1,40 +0,0 @@ -enum PaymentMethodType { - TERMINAL - CASH - SET_OFF - CARD - BANK - CHECK - OTHER -} - -enum PurchaseReceiptStatus { - UNPAID - PARTIALLY_PAID - PAID -} - -enum SalesInvoiceType { - GOOD - SERVICE -} - -enum UnitType { - COUNT - GRAM - KILOGRAM - LITER - METER - HOUR -} - -enum CustomerType { - INDIVIDUAL - LEGAL - UNKNOWN -} - -enum SalesInvoiceItemPricingModel { - STANDARD - GOLD -} diff --git a/prisma/schema/good.prisma b/prisma/schema/good.prisma deleted file mode 100644 index cb6060d..0000000 --- a/prisma/schema/good.prisma +++ /dev/null @@ -1,37 +0,0 @@ -model Good { - id String @id @default(uuid()) - name String @db.VarChar(255) - description String? @db.Text - sku String @db.VarChar(100) - local_sku String? @unique() @db.VarChar(100) - barcode String? @unique() @db.VarChar(100) - created_at DateTime @default(now()) @db.Timestamp(0) - updated_at DateTime @updatedAt @db.Timestamp(0) - deleted_at DateTime? @db.Timestamp(0) - category_id String? - base_sale_price Decimal @default(0.00) @db.Decimal(15, 0) - account_id String - complex_id String - - category GoodCategory? @relation(fields: [category_id], references: [id]) - sales_invoice_items SalesInvoiceItem[] - - @@index([category_id]) - @@map("goods") -} - -model GoodCategory { - id String @id @default(uuid()) - name String @db.VarChar(100) - description String? @db.Text - image_url String? @db.VarChar(255) - account_id String - complex_id String - created_at DateTime @default(now()) @db.Timestamp(0) - updated_at DateTime @updatedAt @db.Timestamp(0) - deleted_at DateTime? @db.Timestamp(0) - - goods Good[] - - @@map("good_categories") -} diff --git a/prisma/schema/devices.prisma b/prisma/schema/pos/user_devices.prisma similarity index 92% rename from prisma/schema/devices.prisma rename to prisma/schema/pos/user_devices.prisma index 858f35d..c8ea312 100644 --- a/prisma/schema/devices.prisma +++ b/prisma/schema/pos/user_devices.prisma @@ -1,4 +1,4 @@ -model Device { +model UserDevices { account_id String? @db.VarChar(255) app_version String @db.VarChar(20) build_number String @db.VarChar(20) @@ -14,5 +14,5 @@ model Device { browser_name String? @db.VarChar(100) fcm_token String? @db.VarChar(100) - @@map("devices") + @@map("user_devices") } diff --git a/prisma/schema/customers.prisma b/prisma/schema/shared/customers.prisma similarity index 100% rename from prisma/schema/customers.prisma rename to prisma/schema/shared/customers.prisma diff --git a/prisma/schema/shared/enum.prisma b/prisma/schema/shared/enum.prisma new file mode 100644 index 0000000..337d1e7 --- /dev/null +++ b/prisma/schema/shared/enum.prisma @@ -0,0 +1,119 @@ +enum PaymentMethodType { + TERMINAL + CASH + SET_OFF + CARD + BANK + CHECK + OTHER +} + +enum PurchaseReceiptStatus { + UNPAID + PARTIALLY_PAID + PAID +} + +enum SalesInvoiceType { + GOOD + SERVICE +} + +enum UnitType { + COUNT + GRAM + KILOGRAM + MILLILITER + LITER + METER + HOUR +} + +enum GoodPricingModel { + STANDARD + GOLD +} + +enum CustomerType { + INDIVIDUAL + LEGAL + UNKNOWN +} + +enum UserStatus { + ACTIVE + INACTIVE +} + +enum AccountRole { + OWNER + OPERATOR + ACCOUNTANT +} + +enum AccountStatus { + ACTIVE + SUSPENDED +} + +enum POSStatus { + ACTIVE + DISABLED +} + +enum POSRole { + MANAGER + OPERATOR + VIEWER +} + +enum LicenseType { + BASIC + PRO + ENTERPRISE +} + +enum LicenseStatus { + ACTIVE + EXPIRED + SUSPENDED +} + +enum POSType { + PSP + MOBILE + API +} + +enum UserType { + LEGAL + INDIVIDUAL +} + +enum AccountType { + PARTNER + BUSINESS + ADMIN + PROVIDER + POS +} + +enum PartnerRole { + ADMIN + OPERATOR +} + +enum BusinessRole { + ADMIN + OPERATOR +} + +enum ProviderRole { + ADMIN + OPERATOR +} + +enum TokenType { + ACCESS + REFRESH +} diff --git a/prisma/schema/shared/good.prisma b/prisma/schema/shared/good.prisma new file mode 100644 index 0000000..6036a44 --- /dev/null +++ b/prisma/schema/shared/good.prisma @@ -0,0 +1,45 @@ +model Good { + id String @id @default(uuid()) + name String @db.VarChar(255) + description String? @db.Text + sku String @db.VarChar(100) + local_sku String? @unique() @db.VarChar(100) + barcode String? @unique() @db.VarChar(100) + base_sale_price Decimal? @default(0.00) @db.Decimal(15, 0) + is_default_guild_good Boolean @default(false) + created_at DateTime @default(now()) @db.Timestamp(0) + updated_at DateTime @updatedAt @db.Timestamp(0) + deleted_at DateTime? @db.Timestamp(0) + + complex_id String? + category_id String? + guild_id String? + + category GoodCategory? @relation(fields: [category_id], references: [id]) + complex Complex? @relation(fields: [complex_id], references: [id]) + guild Guild? @relation(fields: [guild_id], references: [id]) + sales_invoice_items SalesInvoiceItem[] + + @@index([category_id]) + @@map("goods") +} + +model GoodCategory { + id String @id @default(uuid()) + name String @db.VarChar(100) + description String? @db.Text + image_url String? @db.VarChar(255) + complex_id String? + is_default_guild_good Boolean @default(false) + guild_id String? + + created_at DateTime @default(now()) @db.Timestamp(0) + updated_at DateTime @updatedAt @db.Timestamp(0) + deleted_at DateTime? @db.Timestamp(0) + + goods Good[] + guild Guild? @relation(fields: [guild_id], references: [id]) + complex Complex? @relation(fields: [complex_id], references: [id]) + + @@map("good_categories") +} diff --git a/prisma/schema/sales.prisma b/prisma/schema/shared/sales.prisma similarity index 72% rename from prisma/schema/sales.prisma rename to prisma/schema/shared/sales.prisma index 66799f7..7311680 100644 --- a/prisma/schema/sales.prisma +++ b/prisma/schema/shared/sales.prisma @@ -20,15 +20,14 @@ model SalesInvoice { } model SalesInvoiceItem { - id String @id @default(uuid()) - quantity Decimal @db.Decimal(10, 0) + id String @id @default(uuid()) + quantity Decimal @db.Decimal(10, 0) unit_type UnitType - unit_price Decimal @default(0.00) @db.Decimal(15, 2) - total_amount Decimal @default(0.00) @db.Decimal(15, 2) - created_at DateTime @default(now()) @db.Timestamp(0) - discount Decimal @default(0.00) @db.Decimal(15, 2) - notes String? @db.Text - pricingModel SalesInvoiceItemPricingModel @default(STANDARD) + unit_price Decimal @default(0.00) @db.Decimal(15, 2) + total_amount Decimal @default(0.00) @db.Decimal(15, 2) + created_at DateTime @default(now()) @db.Timestamp(0) + discount Decimal @default(0.00) @db.Decimal(15, 2) + notes String? @db.Text invoice_id String good_id String? diff --git a/prisma/schema/service.prisma b/prisma/schema/shared/service.prisma similarity index 100% rename from prisma/schema/service.prisma rename to prisma/schema/shared/service.prisma diff --git a/prisma/seed.ts b/prisma/seed.ts index 773225f..682a60e 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -1,340 +1,26 @@ +import { PasswordUtil } from '@/common/utils/password.util' import { prisma } from '../src/lib/prisma' async function main() { - // if ((await prisma.role.count()) === 0) { - // await prisma.role.upsert({ - // where: { id: 0, name: 'Admin' }, - // update: {}, - // create: { - // name: 'Admin', - // }, - // }) - // } - // if ((await prisma.user.count()) === 0) { - // const adminRole = await prisma.role.findUnique({ where: { name: 'Admin' } }) - // if (!adminRole) { - // return - // } - // await prisma.user.upsert({ - // where: { id: 1, firstName: 'عباس', lastName: 'حسنی' }, - // update: {}, - // create: { - // firstName: 'عباس', - // lastName: 'حسنی', - // roleId: adminRole.id, - // mobileNumber: '09120258156', - // password: '12345678', - // }, - // }) - // } - // if ((await prisma.inventory.count()) === 0) { - // await prisma.inventory.createMany({ - // data: [ - // { name: 'انبار مرکزی', location: 'تهران', isPointOfSale: false, isActive: true }, - // { - // name: 'فروشگاه حضوری', - // location: 'مرکز شهر', - // isPointOfSale: true, - // isActive: true, - // }, - // { - // name: 'فروشگاه اینترنتی', - // location: 'مرکز شهر', - // isPointOfSale: true, - // isActive: true, - // }, - // ], - // }) - // } - // if ((await prisma.productCategory.count()) === 0) { - // await prisma.productCategory.createMany({ - // data: Array.from({ length: 10 }, (_, i) => ({ name: `دسته‌ی ${i + 1}` })), - // }) - // } - // if ((await prisma.productBrand.count()) === 0) { - // await prisma.productBrand.createMany({ - // data: Array.from({ length: 10 }, (_, i) => ({ name: `برند ${i + 1}` })), - // }) - // } - // if ((await prisma.supplier.count()) === 0) { - // await prisma.supplier.createMany({ - // data: Array.from({ length: 9 }, (_, i) => ({ - // firstName: 'تامین‌', - // lastName: `کننده ${i + 1}`, - // mobileNumber: `0912000000${i + 1}`, - // email: `supplier${i + 1}@example.com`, - // })), - // }) - // } - // if ((await prisma.customer.count()) === 0) { - // await prisma.customer.createMany({ - // data: Array.from({ length: 5 }, (_, i) => ({ - // firstName: 'مشتری', - // lastName: `${i + 1}`, - // mobileNumber: `0913000000${i + 1}`, - // email: `customer${i + 1}@example.com`, - // })), - // }) - // } - // if ((await prisma.product.count()) === 0) { - // const categories = await prisma.productCategory.findMany() - // const brands = await prisma.productBrand.findMany() - // await prisma.product.createMany({ - // data: Array.from({ length: 20 }, (_, i) => ({ - // name: `کالای ${i + 1}`, - // sku: `SKU-${1000 + i + 1}`, - // salePrice: parseInt((Math.random() * (100 - 10) + 10).toString()) * 10000, - // categoryId: categories[i % categories.length].id, - // brandId: brands[i % brands.length].id, - // })), - // }) - // } - // if ((await prisma.bank.count()) === 0) { - // await prisma.bank.createMany({ - // data: [ - // { - // name: 'آینده', - // shortName: 'ain', - // }, - // { - // name: 'ایران زمین', - // shortName: 'irz', - // }, - // { - // name: 'اقتصاد نوین', - // shortName: 'eqn', - // }, - // { - // name: 'انصار', - // shortName: 'ans', - // }, - // { - // name: 'پاسارگاد', - // shortName: 'pas', - // }, - // { - // name: 'پارسیان', - // shortName: 'prs', - // }, - // { - // name: 'پست‌ بانک ایران', - // shortName: 'pbi', - // }, - // { - // name: 'تجارت', - // shortName: 'tej', - // }, - // { - // name: 'توسعه تعاون', - // shortName: 'tav', - // }, - // { - // name: 'توسعه صادرات', - // shortName: 'tes', - // }, - // { - // name: 'حکمت ایرانیان', - // shortName: 'hek', - // }, - // { - // name: 'رفاه کارگران', - // shortName: 'ref', - // }, - // { - // name: 'قرض‌الحسنه رسالت', - // shortName: 'res', - // }, - // { - // name: 'قرض‌الحسنه مهر ایران', - // shortName: 'meh', - // }, - // { - // name: 'قوامین', - // shortName: 'qva', - // }, - // { - // name: 'کشاورزی', - // shortName: 'kes', - // }, - // { - // name: 'کوثر', - // shortName: 'kos', - // }, - // { - // name: 'دی', - // shortName: 'diy', - // }, - // { - // name: 'صنعت و معدن', - // shortName: 'san', - // }, - // { - // name: 'سینا', - // shortName: 'sin', - // }, - // { - // name: 'سرمایه', - // shortName: 'sar', - // }, - // { - // name: 'سپه', - // shortName: 'sep', - // }, - // { - // name: 'شهر', - // shortName: 'shr', - // }, - // { - // name: 'صادرات ایران', - // shortName: 'sir', - // }, - // { - // name: 'سامان', - // shortName: 'sam', - // }, - // { - // name: 'مرکزی', - // shortName: 'mar', - // }, - // { - // name: 'مسکن', - // shortName: 'mas', - // }, - // { - // name: 'ملت', - // shortName: 'mel', - // }, - // { - // name: 'ملی ایران', - // shortName: 'mli', - // }, - // { - // name: 'مهر اقتصاد', - // shortName: 'meg', - // }, - // { - // name: 'کارآفرین', - // shortName: 'kar', - // }, - // { - // name: 'تات', - // shortName: 'tat', - // }, - // ], - // }) - // } - // if ((await prisma.bankBranch.count()) === 0) { - // await prisma.bankBranch.createMany({ - // data: [ - // { - // bankId: 1, - // name: 'شعبه مرکزی', - // code: '001', - // }, - // { - // bankId: 2, - // name: 'شعبه مرکزی', - // code: '002', - // }, - // { - // bankId: 1, - // name: 'شعبه ونک', - // code: '003', - // }, - // ], - // }) - // } - // if ((await prisma.bankAccount.count()) === 0) { - // await prisma.bankAccount.createMany({ - // data: [ - // { - // branchId: 1, - // accountNumber: '1234567890', - // name: 'حساب اصلی آینده', - // iban: 'IR000123456789012345678901', - // }, - // { - // branchId: 2, - // accountNumber: '0987654321', - // name: 'حساب اصلی ایران زمین', - // iban: 'IR000987654321098765432109', - // }, - // { - // branchId: 3, - // accountNumber: '1122334455', - // name: 'حساب ونک آینده', - // iban: 'IR000112233445566778899001', - // }, - // ], - // }) - // } - // if ((await prisma.inventoryBankAccount.count()) === 0) { - // const inventories = await prisma.inventory.findMany() - // const bankAccounts = await prisma.bankAccount.findMany() - // if (inventories.length || bankAccounts.length) { - // // Assign bank accounts to inventories - // const inventoryBankAccounts = [] - // for (let i = 0; i < inventories.length; i++) { - // const inventory = inventories[i] - // const bankAccount = bankAccounts[i % bankAccounts.length] // Cycle through bank accounts - // // @ts-ignore - // inventoryBankAccounts.push({ - // inventoryId: inventory.id, - // bankAccountId: bankAccount.id, - // }) - // } - // await prisma.inventoryBankAccount.createMany({ - // data: inventoryBankAccounts, - // }) - // } - // } - // if ((await prisma.posAccount.count()) === 0) { - // const inventories = await prisma.inventory.findMany({ - // where: { isPointOfSale: true }, - // }) - // const inventoryBankAccounts = await prisma.inventoryBankAccount.findMany() - // const posAccounts = [] - // for (let i = 0; i < inventories.length; i++) { - // const inventory = inventories[i] - // // Find a bank account assigned to this inventory - // const inventoryBankAccount = inventoryBankAccounts.find( - // iba => iba.inventoryId === inventory.id, - // ) - // if (inventoryBankAccount) { - // // @ts-ignore - // posAccounts.push({ - // name: `پوز ${inventory.name}`, - // code: `POS${(i + 1).toString().padStart(3, '0')}`, - // description: `پوز فروشگاه ${inventory.name}`, - // inventoryId: inventory.id, - // bankAccountId: inventoryBankAccount.bankAccountId, - // }) - // } - // } - // await prisma.posAccount.createMany({ - // data: posAccounts, - // }) - // } - // Seed purchase, transfer, and sales transactions - // const inventories = await prisma.inventory.findMany() - // const products = await prisma.product.findMany({ take: 5 }) // select 5 products for demo - // const supplier = await prisma.supplier.findFirst() - // const customers = await prisma.customer.findMany({ take: 2 }) - // if (supplier && customers.length > 0) { - // PurchaseReceiptsService.prototype.create({ - // code: '123123', - // inventoryId: inventories[0].id, - // supplierId: supplier.id, - // paidAmount: 0, - // totalAmount: products.reduce((acc, a) => (acc += Number(a.salePrice) * 10), 0), - // items: products.map(product => ({ - // productId: product.id, - // count: 10, - // unitPrice: Number(product.salePrice), - // total: 10 * Number(product.salePrice), - // })), - // }) - // } + const password = await PasswordUtil.hash('123456') + const adminUser = await prisma.account.upsert({ + where: { username: 'superAdmin' }, + update: {}, + create: { + username: 'superAdmin', + password, + type: 'ADMIN', + status: 'ACTIVE', + user: { + create: { + first_name: 'عباس', + last_name: 'حسنی', + national_code: '0016022289', + mobile_number: '09120258156', + }, + }, + }, + }) } main() diff --git a/src/app.module.ts b/src/app.module.ts index 514748e..77ec1b1 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -1,16 +1,13 @@ import { Module } from '@nestjs/common' import { AppController } from './app.controller' import { AppService } from './app.service' +import { AdminModule } from './modules/admin/admin.module' import { AuthModule } from './modules/auth/auth.module' -import { ConfigModule } from './modules/config/config.module' -import { CustomersModule } from './modules/customers/customers.module' import { EnumsModule } from './modules/enums/enums.module' -import { GoodCategoriesModule } from './modules/good-categories/good-categories.module' -import { GoodsModule } from './modules/goods/goods.module' +import { PosModule } from './modules/pos/pos.module' +import { SalesInvoiceItemsModule } from './modules/pos/sales-invoices/sales-invoice-items/sales-invoice-items.module' +import { SalesInvoicePaymentsModule } from './modules/pos/sales-invoices/sales-invoice-payments/sales-invoice-payments.module' import { ProfileModule } from './modules/profile/profile.module' -import { SalesInvoiceItemsModule } from './modules/sales-invoice-items/sales-invoice-items.module' -import { SalesInvoicePaymentsModule } from './modules/sales-invoice-payments/sales-invoice-payments.module' -import { SalesInvoicesModule } from './modules/sales-invoices/sales-invoices.module' import { ServiceCategoriesModule } from './modules/service-categories/service-categories.module' import { ServicesModule } from './modules/services/services.module' import { TriggerLogsModule } from './modules/trigger-logs/trigger-logs.module' @@ -20,20 +17,17 @@ import { PrismaModule } from './prisma/prisma.module' @Module({ imports: [ PrismaModule, + EnumsModule, + AdminModule, + PosModule, AuthModule, - CustomersModule, - GoodCategoriesModule, - GoodsModule, SalesInvoiceItemsModule, SalesInvoicePaymentsModule, - SalesInvoicesModule, ServiceCategoriesModule, ServicesModule, TriggerLogsModule, UploadersModule, - ConfigModule, ProfileModule, - EnumsModule, ], controllers: [AppController], providers: [AppService], diff --git a/src/common/constants/translates/enums.ts b/src/common/constants/translates/enums.ts new file mode 100644 index 0000000..58cf5c5 --- /dev/null +++ b/src/common/constants/translates/enums.ts @@ -0,0 +1,11 @@ +export default { + COUNT: 'تعداد', + GRAM: 'گرم', + KILO_GRAM: 'کیلوگرم', + LITER: 'لیتر', + MILLILITER: 'میلی‌لیتر', + STANDARD: 'استاندارد', + GOLD: 'طلا', + ACTIVE: 'فعال', + SUSPENDED: 'غیرفعال', +} diff --git a/src/common/constants/translates/translates.ts b/src/common/constants/translates/translates.ts new file mode 100644 index 0000000..38f8c8d --- /dev/null +++ b/src/common/constants/translates/translates.ts @@ -0,0 +1,5 @@ +import enums from './enums' + +export default { + enums, +} diff --git a/src/common/database/transaction.helper.ts b/src/common/database/transaction.helper.ts index 1eafd4d..43d12c3 100644 --- a/src/common/database/transaction.helper.ts +++ b/src/common/database/transaction.helper.ts @@ -1,5 +1,5 @@ // src/common/database/transaction.helper.ts -import { PrismaService } from '../../prisma/prisma.service' +import { PrismaService } from '@/prisma/prisma.service' export async function withTransaction( prisma: PrismaService, diff --git a/src/common/enums/enums.ts b/src/common/enums/enums.ts index 815df99..914509d 100644 --- a/src/common/enums/enums.ts +++ b/src/common/enums/enums.ts @@ -1,18 +1,18 @@ export enum TokenType { - ACCESS, - REFRESH, + ACCESS = 'ACCESS', + REFRESH = 'REFRESH', } export enum AccountType { - PARTNER, - BUSINESS, - ADMIN, - PROVIDER, - POS, + PARTNER = 'PARTNER', + BUSINESS = 'BUSINESS', + ADMIN = 'ADMIN', + PROVIDER = 'PROVIDER', + POS = 'POS', } export enum GoldKarat { - KARAT_18 = 18, - KARAT_21 = 21, - KARAT_24 = 24, + KARAT_18 = '18', + KARAT_21 = '21', + KARAT_24 = '24', } diff --git a/src/common/filters/prisma-exception.filter.ts b/src/common/filters/prisma-exception.filter.ts index ab2f810..25f85c8 100644 --- a/src/common/filters/prisma-exception.filter.ts +++ b/src/common/filters/prisma-exception.filter.ts @@ -6,7 +6,7 @@ import { HttpStatus, } from '@nestjs/common' import type { Request, Response } from 'express' -import { Prisma } from '../../generated/prisma/client' +import { Prisma } from 'generated/prisma/client' @Catch() export class PrismaExceptionFilter implements ExceptionFilter { diff --git a/src/common/guards/context.guard.ts b/src/common/guards/context.guard.ts new file mode 100644 index 0000000..440a2e3 --- /dev/null +++ b/src/common/guards/context.guard.ts @@ -0,0 +1,57 @@ +import { + CanActivate, + ExecutionContext, + Injectable, + UnauthorizedException, +} from '@nestjs/common' +import { Reflector } from '@nestjs/core' +import { JwtService } from '@nestjs/jwt' +import { IS_PUBLIC_KEY } from '../decorators/public.decorator' +import { IWithJWTPayloadRequest } from '../models/token-model' + +@Injectable() +export class JwtAuthGuard implements CanActivate { + constructor( + private jwt: JwtService, + private reflector: Reflector, + ) {} + + async canActivate(context: ExecutionContext): Promise { + const isPublic = this.reflector.getAllAndOverride(IS_PUBLIC_KEY, [ + context.getHandler(), + context.getClass(), + ]) + if (isPublic) return true + + const req = context.switchToHttp().getRequest() + + let token: string | undefined = req.cookies?.accessToken + if (!token) { + const authHeader = (req.headers.authorization || req.headers.Authorization) as + | string + | undefined + if (authHeader && authHeader.startsWith('Bearer ')) { + token = authHeader.slice(7) + } + } + + if (!token) throw new UnauthorizedException('Missing access token') + + try { + const payload = this.jwt.verify(token, { + secret: process.env.JWT_SECRET || 'secret', + }) + + if (payload.type !== 'POS') + throw new UnauthorizedException('Invalid or expired token') + + // Set the typed dataPayload to the request + req.dataPayload = payload + + return true + } catch (err) { + console.log(err) + throw new UnauthorizedException('Invalid or expired token') + } + } +} diff --git a/src/modules/auth/jwt-auth.guard.ts b/src/common/guards/jwt-auth.guard.ts similarity index 84% rename from src/modules/auth/jwt-auth.guard.ts rename to src/common/guards/jwt-auth.guard.ts index 2f3e1e0..7c0a0a3 100644 --- a/src/modules/auth/jwt-auth.guard.ts +++ b/src/common/guards/jwt-auth.guard.ts @@ -6,8 +6,8 @@ import { } from '@nestjs/common' import { Reflector } from '@nestjs/core' import { JwtService } from '@nestjs/jwt' -import { IS_PUBLIC_KEY } from '../../common/decorators/public.decorator' -import { IWithJWTPayloadRequest } from '../../common/models/token-model' +import { IS_PUBLIC_KEY } from '../decorators/public.decorator' +import { IWithJWTPayloadRequest } from '../models/token-model' @Injectable() export class JwtAuthGuard implements CanActivate { @@ -17,6 +17,8 @@ export class JwtAuthGuard implements CanActivate { ) {} async canActivate(context: ExecutionContext): Promise { + console.log('asd') + const isPublic = this.reflector.getAllAndOverride(IS_PUBLIC_KEY, [ context.getHandler(), context.getClass(), @@ -42,8 +44,8 @@ export class JwtAuthGuard implements CanActivate { secret: process.env.JWT_SECRET || 'secret', }) - if (payload.type !== 'POS') - throw new UnauthorizedException('Invalid or expired token') + // if (payload.type !== 'POS') + // throw new UnauthorizedException('Invalid or expired token') // Set the typed dataPayload to the request req.dataPayload = payload diff --git a/src/common/interceptors/response-mapping.interceptor.ts b/src/common/interceptors/response-mapping.interceptor.ts index 134dbe2..521a1f3 100644 --- a/src/common/interceptors/response-mapping.interceptor.ts +++ b/src/common/interceptors/response-mapping.interceptor.ts @@ -76,12 +76,12 @@ export class ResponseMappingInterceptor implements NestInterceptor { break case 'list': payload = Array.isArray(wrapped.items) ? wrapped.items : [] - meta = { - totalRecords: payload.length, - totalPages: 1, - page: 1, - perPage: payload.length, - } + // meta = { + // totalRecords: payload.length, + // totalPages: 1, + // page: 1, + // perPage: payload.length, + // } break case 'paginate': { const items = Array.isArray(wrapped.items) ? wrapped.items : [] @@ -193,7 +193,7 @@ export class ResponseMappingInterceptor implements NestInterceptor { } } - if (meta) + if (meta || ['list', 'paginate'].includes((data as any).__mapped)) return { data: data.items, meta, diff --git a/src/common/response/response-mapper.ts b/src/common/response/response-mapper.ts index 5a32747..ea05bbe 100644 --- a/src/common/response/response-mapper.ts +++ b/src/common/response/response-mapper.ts @@ -5,10 +5,17 @@ * the global `ResponseMappingInterceptor` understands and normalizes. */ export type MapperWrapper = - | { __mapped: 'create' | 'update' | 'single' | 'delete'; data: T } + | { __mapped: 'create' | 'update' | 'single'; data: T } | { __mapped: 'list'; items: T[] } - | { __mapped: 'paginate'; items: T[]; total: number; page?: number; perPage?: number } + | { __mapped: 'paginate'; items: T[]; count: number; page?: number; pageSize?: number } | { __mapped: 'sequelize'; rows: T[]; count: number; page?: number; perPage?: number } + | { __mapped: 'delete' } + +interface IPaginateMeta { + count: number + page?: number + pageSize?: number +} export const ResponseMapper = { create(item: T): MapperWrapper { @@ -23,20 +30,20 @@ export const ResponseMapper = { return { __mapped: 'single', data: item } }, - delete(item: T): MapperWrapper { - return { __mapped: 'delete', data: item } + delete(): MapperWrapper { + return { __mapped: 'delete' } }, list(items: T[]): MapperWrapper { return { __mapped: 'list', items } }, - paginate(items: T[], total: number, page = 1, perPage = items.length) { - return { __mapped: 'paginate', items, total, page, perPage } + paginate(items: T[], { count, page = 1, pageSize: perPage }: IPaginateMeta) { + return { __mapped: 'paginate', items, count, page, perPage } }, - sequelizePaginate(rows: T[], count: number, page = 1, perPage = rows.length) { - return { __mapped: 'sequelize', rows, count, page, perPage } + sequelizePaginate(rows: T[], count: number, page = 1, pageSize = rows.length) { + return { __mapped: 'sequelize', rows, count, page, pageSize } }, } diff --git a/src/common/utils/jwt-user.util.ts b/src/common/utils/jwt-user.util.ts new file mode 100644 index 0000000..6ea6d1b --- /dev/null +++ b/src/common/utils/jwt-user.util.ts @@ -0,0 +1,30 @@ +import { UnauthorizedException } from '@nestjs/common' +import { JwtService } from '@nestjs/jwt' +import { Request } from 'express' +import { AccessTokenPayload } from 'modules/auth/models' + +export function getAccountIdFromJwt(req: Request, jwtService: JwtService): string | null { + // Try to get token from Authorization header + + let token = req.cookies?.accessToken + + if (!token) { + const authHeader = (req.headers.authorization || req.headers.Authorization) as + | string + | undefined + if (authHeader && authHeader.startsWith('Bearer ')) { + token = authHeader.slice(7) + } + } + if (!token) throw new UnauthorizedException('Missing accessToken cookie') + + // const token = authHeader.replace('Bearer ', '') + try { + const payload = jwtService.decode(token) as AccessTokenPayload + console.log(payload) + + return payload?.account_id || null + } catch { + return null + } +} diff --git a/src/common/utils/password.util.ts b/src/common/utils/password.util.ts new file mode 100644 index 0000000..9d33696 --- /dev/null +++ b/src/common/utils/password.util.ts @@ -0,0 +1,11 @@ +import * as bcrypt from 'bcrypt' + +export class PasswordUtil { + static async hash(password: string, saltRounds = 10): Promise { + return bcrypt.hash(password, saltRounds) + } + + static async compare(password: string, hashedPassword: string): Promise { + return bcrypt.compare(password, hashedPassword) + } +} diff --git a/src/generated/prisma/browser.ts b/src/generated/prisma/browser.ts index c538525..2a39cca 100644 --- a/src/generated/prisma/browser.ts +++ b/src/generated/prisma/browser.ts @@ -17,6 +17,81 @@ import * as Prisma from './internal/prismaNamespaceBrowser.js' export { Prisma } export * as $Enums from './enums.js' export * from './enums.js'; +/** + * Model Token + * + */ +export type Token = Prisma.TokenModel +/** + * Model VerificationCode + * + */ +export type VerificationCode = Prisma.VerificationCodeModel +/** + * Model Guild + * + */ +export type Guild = Prisma.GuildModel +/** + * Model BusinessActivity + * + */ +export type BusinessActivity = Prisma.BusinessActivityModel +/** + * Model Complex + * + */ +export type Complex = Prisma.ComplexModel +/** + * Model Pos + * + */ +export type Pos = Prisma.PosModel +/** + * Model DeviceBrand + * + */ +export type DeviceBrand = Prisma.DeviceBrandModel +/** + * Model Device + * + */ +export type Device = Prisma.DeviceModel +/** + * Model License + * + */ +export type License = Prisma.LicenseModel +/** + * Model Partner + * + */ +export type Partner = Prisma.PartnerModel +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Account + * + */ +export type Account = Prisma.AccountModel +/** + * Model Provider + * + */ +export type Provider = Prisma.ProviderModel +/** + * Model TriggerLog + * + */ +export type TriggerLog = Prisma.TriggerLogModel +/** + * Model UserDevices + * + */ +export type UserDevices = Prisma.UserDevicesModel /** * Model Customer * @@ -32,11 +107,6 @@ export type CustomerIndividual = Prisma.CustomerIndividualModel * */ export type CustomerLegal = Prisma.CustomerLegalModel -/** - * Model Device - * - */ -export type Device = Prisma.DeviceModel /** * Model Good * @@ -47,11 +117,6 @@ export type Good = Prisma.GoodModel * */ export type GoodCategory = Prisma.GoodCategoryModel -/** - * Model TriggerLog - * - */ -export type TriggerLog = Prisma.TriggerLogModel /** * Model SalesInvoice * diff --git a/src/generated/prisma/client.ts b/src/generated/prisma/client.ts index 1fcc61a..345c3d0 100644 --- a/src/generated/prisma/client.ts +++ b/src/generated/prisma/client.ts @@ -27,8 +27,8 @@ export * from "./enums.js" * @example * ``` * const prisma = new PrismaClient() - * // Fetch zero or more Customers - * const customers = await prisma.customer.findMany() + * // Fetch zero or more Tokens + * const tokens = await prisma.token.findMany() * ``` * * Read more in our [docs](https://pris.ly/d/client). @@ -37,6 +37,81 @@ export const PrismaClient = $Class.getPrismaClientClass() export type PrismaClient = $Class.PrismaClient export { Prisma } +/** + * Model Token + * + */ +export type Token = Prisma.TokenModel +/** + * Model VerificationCode + * + */ +export type VerificationCode = Prisma.VerificationCodeModel +/** + * Model Guild + * + */ +export type Guild = Prisma.GuildModel +/** + * Model BusinessActivity + * + */ +export type BusinessActivity = Prisma.BusinessActivityModel +/** + * Model Complex + * + */ +export type Complex = Prisma.ComplexModel +/** + * Model Pos + * + */ +export type Pos = Prisma.PosModel +/** + * Model DeviceBrand + * + */ +export type DeviceBrand = Prisma.DeviceBrandModel +/** + * Model Device + * + */ +export type Device = Prisma.DeviceModel +/** + * Model License + * + */ +export type License = Prisma.LicenseModel +/** + * Model Partner + * + */ +export type Partner = Prisma.PartnerModel +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Account + * + */ +export type Account = Prisma.AccountModel +/** + * Model Provider + * + */ +export type Provider = Prisma.ProviderModel +/** + * Model TriggerLog + * + */ +export type TriggerLog = Prisma.TriggerLogModel +/** + * Model UserDevices + * + */ +export type UserDevices = Prisma.UserDevicesModel /** * Model Customer * @@ -52,11 +127,6 @@ export type CustomerIndividual = Prisma.CustomerIndividualModel * */ export type CustomerLegal = Prisma.CustomerLegalModel -/** - * Model Device - * - */ -export type Device = Prisma.DeviceModel /** * Model Good * @@ -67,11 +137,6 @@ export type Good = Prisma.GoodModel * */ export type GoodCategory = Prisma.GoodCategoryModel -/** - * Model TriggerLog - * - */ -export type TriggerLog = Prisma.TriggerLogModel /** * Model SalesInvoice * diff --git a/src/generated/prisma/commonInputTypes.ts b/src/generated/prisma/commonInputTypes.ts index ca45ae3..dfffca5 100644 --- a/src/generated/prisma/commonInputTypes.ts +++ b/src/generated/prisma/commonInputTypes.ts @@ -29,6 +29,13 @@ export type StringFilter<$PrismaModel = never> = { not?: Prisma.NestedStringFilter<$PrismaModel> | string } +export type EnumTokenTypeFilter<$PrismaModel = never> = { + equals?: $Enums.TokenType | Prisma.EnumTokenTypeFieldRefInput<$PrismaModel> + in?: $Enums.TokenType[] + notIn?: $Enums.TokenType[] + not?: Prisma.NestedEnumTokenTypeFilter<$PrismaModel> | $Enums.TokenType +} + export type DateTimeFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> in?: Date[] | string[] @@ -40,6 +47,211 @@ export type DateTimeFilter<$PrismaModel = never> = { not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string } +export type StringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] + notIn?: string[] + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + search?: string + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type EnumTokenTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.TokenType | Prisma.EnumTokenTypeFieldRefInput<$PrismaModel> + in?: $Enums.TokenType[] + notIn?: $Enums.TokenType[] + not?: Prisma.NestedEnumTokenTypeWithAggregatesFilter<$PrismaModel> | $Enums.TokenType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumTokenTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumTokenTypeFilter<$PrismaModel> +} + +export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] + notIn?: Date[] | string[] + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeFilter<$PrismaModel> +} + +export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type StringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + search?: string + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type SortOrderInput = { + sort: Prisma.SortOrder + nulls?: Prisma.NullsOrder +} + +export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + search?: string + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type EnumPOSStatusFilter<$PrismaModel = never> = { + equals?: $Enums.POSStatus | Prisma.EnumPOSStatusFieldRefInput<$PrismaModel> + in?: $Enums.POSStatus[] + notIn?: $Enums.POSStatus[] + not?: Prisma.NestedEnumPOSStatusFilter<$PrismaModel> | $Enums.POSStatus +} + +export type EnumPOSTypeFilter<$PrismaModel = never> = { + equals?: $Enums.POSType | Prisma.EnumPOSTypeFieldRefInput<$PrismaModel> + in?: $Enums.POSType[] + notIn?: $Enums.POSType[] + not?: Prisma.NestedEnumPOSTypeFilter<$PrismaModel> | $Enums.POSType +} + +export type EnumPOSStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.POSStatus | Prisma.EnumPOSStatusFieldRefInput<$PrismaModel> + in?: $Enums.POSStatus[] + notIn?: $Enums.POSStatus[] + not?: Prisma.NestedEnumPOSStatusWithAggregatesFilter<$PrismaModel> | $Enums.POSStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumPOSStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumPOSStatusFilter<$PrismaModel> +} + +export type EnumPOSTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.POSType | Prisma.EnumPOSTypeFieldRefInput<$PrismaModel> + in?: $Enums.POSType[] + notIn?: $Enums.POSType[] + not?: Prisma.NestedEnumPOSTypeWithAggregatesFilter<$PrismaModel> | $Enums.POSType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumPOSTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumPOSTypeFilter<$PrismaModel> +} + +export type EnumLicenseStatusFilter<$PrismaModel = never> = { + equals?: $Enums.LicenseStatus | Prisma.EnumLicenseStatusFieldRefInput<$PrismaModel> + in?: $Enums.LicenseStatus[] + notIn?: $Enums.LicenseStatus[] + not?: Prisma.NestedEnumLicenseStatusFilter<$PrismaModel> | $Enums.LicenseStatus +} + +export type EnumLicenseStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.LicenseStatus | Prisma.EnumLicenseStatusFieldRefInput<$PrismaModel> + in?: $Enums.LicenseStatus[] + notIn?: $Enums.LicenseStatus[] + not?: Prisma.NestedEnumLicenseStatusWithAggregatesFilter<$PrismaModel> | $Enums.LicenseStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumLicenseStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumLicenseStatusFilter<$PrismaModel> +} + +export type EnumAccountTypeFilter<$PrismaModel = never> = { + equals?: $Enums.AccountType | Prisma.EnumAccountTypeFieldRefInput<$PrismaModel> + in?: $Enums.AccountType[] + notIn?: $Enums.AccountType[] + not?: Prisma.NestedEnumAccountTypeFilter<$PrismaModel> | $Enums.AccountType +} + +export type EnumAccountStatusFilter<$PrismaModel = never> = { + equals?: $Enums.AccountStatus | Prisma.EnumAccountStatusFieldRefInput<$PrismaModel> + in?: $Enums.AccountStatus[] + notIn?: $Enums.AccountStatus[] + not?: Prisma.NestedEnumAccountStatusFilter<$PrismaModel> | $Enums.AccountStatus +} + +export type EnumAccountTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.AccountType | Prisma.EnumAccountTypeFieldRefInput<$PrismaModel> + in?: $Enums.AccountType[] + notIn?: $Enums.AccountType[] + not?: Prisma.NestedEnumAccountTypeWithAggregatesFilter<$PrismaModel> | $Enums.AccountType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumAccountTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumAccountTypeFilter<$PrismaModel> +} + +export type EnumAccountStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.AccountStatus | Prisma.EnumAccountStatusFieldRefInput<$PrismaModel> + in?: $Enums.AccountStatus[] + notIn?: $Enums.AccountStatus[] + not?: Prisma.NestedEnumAccountStatusWithAggregatesFilter<$PrismaModel> | $Enums.AccountStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumAccountStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumAccountStatusFilter<$PrismaModel> +} + +export type IntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] + notIn?: number[] + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + export type DateTimeNullableFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null in?: Date[] | string[] | null @@ -63,43 +275,6 @@ export type BoolNullableFilter<$PrismaModel = never> = { not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null } -export type SortOrderInput = { - sort: Prisma.SortOrder - nulls?: Prisma.NullsOrder -} - -export type StringWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> - in?: string[] - notIn?: string[] - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - search?: string - not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedStringFilter<$PrismaModel> - _max?: Prisma.NestedStringFilter<$PrismaModel> -} - -export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] - notIn?: Date[] | string[] - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedDateTimeFilter<$PrismaModel> - _max?: Prisma.NestedDateTimeFilter<$PrismaModel> -} - export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null in?: Date[] | string[] | null @@ -132,37 +307,31 @@ export type BoolNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedBoolNullableFilter<$PrismaModel> } -export type StringNullableFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - search?: string - not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +export type DecimalNullableFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> | null + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | null + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | null + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalNullableFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string | null } -export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - search?: string - not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null +export type DecimalNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> | null + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | null + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | null + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalNullableWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string | null _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedStringNullableFilter<$PrismaModel> - _max?: Prisma.NestedStringNullableFilter<$PrismaModel> + _avg?: Prisma.NestedDecimalNullableFilter<$PrismaModel> + _sum?: Prisma.NestedDecimalNullableFilter<$PrismaModel> + _min?: Prisma.NestedDecimalNullableFilter<$PrismaModel> + _max?: Prisma.NestedDecimalNullableFilter<$PrismaModel> } export type DecimalFilter<$PrismaModel = never> = { @@ -176,49 +345,6 @@ export type DecimalFilter<$PrismaModel = never> = { not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string } -export type DecimalWithAggregatesFilter<$PrismaModel = never> = { - equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] - notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] - lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string - _count?: Prisma.NestedIntFilter<$PrismaModel> - _avg?: Prisma.NestedDecimalFilter<$PrismaModel> - _sum?: Prisma.NestedDecimalFilter<$PrismaModel> - _min?: Prisma.NestedDecimalFilter<$PrismaModel> - _max?: Prisma.NestedDecimalFilter<$PrismaModel> -} - -export type IntFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntFilter<$PrismaModel> | number -} - -export type IntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] - notIn?: number[] - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: Prisma.NestedIntFilter<$PrismaModel> - _avg?: Prisma.NestedFloatFilter<$PrismaModel> - _sum?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedIntFilter<$PrismaModel> - _max?: Prisma.NestedIntFilter<$PrismaModel> -} - export type JsonNullableFilter<$PrismaModel = never> = | Prisma.PatchUndefined< Prisma.Either>, Exclude>, 'path'>>, @@ -243,6 +369,22 @@ export type JsonNullableFilterBase<$PrismaModel = never> = { not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter } +export type DecimalWithAggregatesFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedDecimalFilter<$PrismaModel> + _sum?: Prisma.NestedDecimalFilter<$PrismaModel> + _min?: Prisma.NestedDecimalFilter<$PrismaModel> + _max?: Prisma.NestedDecimalFilter<$PrismaModel> +} + export type JsonNullableWithAggregatesFilter<$PrismaModel = never> = | Prisma.PatchUndefined< Prisma.Either>, Exclude>, 'path'>>, @@ -277,13 +419,6 @@ export type EnumUnitTypeFilter<$PrismaModel = never> = { not?: Prisma.NestedEnumUnitTypeFilter<$PrismaModel> | $Enums.UnitType } -export type EnumSalesInvoiceItemPricingModelFilter<$PrismaModel = never> = { - equals?: $Enums.SalesInvoiceItemPricingModel | Prisma.EnumSalesInvoiceItemPricingModelFieldRefInput<$PrismaModel> - in?: $Enums.SalesInvoiceItemPricingModel[] - notIn?: $Enums.SalesInvoiceItemPricingModel[] - not?: Prisma.NestedEnumSalesInvoiceItemPricingModelFilter<$PrismaModel> | $Enums.SalesInvoiceItemPricingModel -} - export type EnumUnitTypeWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.UnitType | Prisma.EnumUnitTypeFieldRefInput<$PrismaModel> in?: $Enums.UnitType[] @@ -294,16 +429,6 @@ export type EnumUnitTypeWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedEnumUnitTypeFilter<$PrismaModel> } -export type EnumSalesInvoiceItemPricingModelWithAggregatesFilter<$PrismaModel = never> = { - equals?: $Enums.SalesInvoiceItemPricingModel | Prisma.EnumSalesInvoiceItemPricingModelFieldRefInput<$PrismaModel> - in?: $Enums.SalesInvoiceItemPricingModel[] - notIn?: $Enums.SalesInvoiceItemPricingModel[] - not?: Prisma.NestedEnumSalesInvoiceItemPricingModelWithAggregatesFilter<$PrismaModel> | $Enums.SalesInvoiceItemPricingModel - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedEnumSalesInvoiceItemPricingModelFilter<$PrismaModel> - _max?: Prisma.NestedEnumSalesInvoiceItemPricingModelFilter<$PrismaModel> -} - export type EnumPaymentMethodTypeFilter<$PrismaModel = never> = { equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel> in?: $Enums.PaymentMethodType[] @@ -336,6 +461,13 @@ export type NestedStringFilter<$PrismaModel = never> = { not?: Prisma.NestedStringFilter<$PrismaModel> | string } +export type NestedEnumTokenTypeFilter<$PrismaModel = never> = { + equals?: $Enums.TokenType | Prisma.EnumTokenTypeFieldRefInput<$PrismaModel> + in?: $Enums.TokenType[] + notIn?: $Enums.TokenType[] + not?: Prisma.NestedEnumTokenTypeFilter<$PrismaModel> | $Enums.TokenType +} + export type NestedDateTimeFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> in?: Date[] | string[] @@ -347,29 +479,6 @@ export type NestedDateTimeFilter<$PrismaModel = never> = { not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string } -export type NestedDateTimeNullableFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null -} - -export type NestedEnumCustomerTypeFilter<$PrismaModel = never> = { - equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel> - in?: $Enums.CustomerType[] - notIn?: $Enums.CustomerType[] - not?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel> | $Enums.CustomerType -} - -export type NestedBoolNullableFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null - not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null -} - export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> in?: string[] @@ -399,6 +508,16 @@ export type NestedIntFilter<$PrismaModel = never> = { not?: Prisma.NestedIntFilter<$PrismaModel> | number } +export type NestedEnumTokenTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.TokenType | Prisma.EnumTokenTypeFieldRefInput<$PrismaModel> + in?: $Enums.TokenType[] + notIn?: $Enums.TokenType[] + not?: Prisma.NestedEnumTokenTypeWithAggregatesFilter<$PrismaModel> | $Enums.TokenType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumTokenTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumTokenTypeFilter<$PrismaModel> +} + export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> in?: Date[] | string[] @@ -413,47 +532,17 @@ export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDateTimeFilter<$PrismaModel> } -export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> - _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> +export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean } -export type NestedIntNullableFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null -} - -export type NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel = never> = { - equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel> - in?: $Enums.CustomerType[] - notIn?: $Enums.CustomerType[] - not?: Prisma.NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel> | $Enums.CustomerType +export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel> - _max?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel> -} - -export type NestedBoolNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null - not?: Prisma.NestedBoolNullableWithAggregatesFilter<$PrismaModel> | boolean | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedBoolNullableFilter<$PrismaModel> - _max?: Prisma.NestedBoolNullableFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> } export type NestedStringNullableFilter<$PrismaModel = never> = { @@ -489,31 +578,100 @@ export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedStringNullableFilter<$PrismaModel> } -export type NestedDecimalFilter<$PrismaModel = never> = { - equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] - notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] - lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string +export type NestedIntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | null + notIn?: number[] | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null } -export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = { - equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] - notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] - lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> - not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string +export type NestedEnumPOSStatusFilter<$PrismaModel = never> = { + equals?: $Enums.POSStatus | Prisma.EnumPOSStatusFieldRefInput<$PrismaModel> + in?: $Enums.POSStatus[] + notIn?: $Enums.POSStatus[] + not?: Prisma.NestedEnumPOSStatusFilter<$PrismaModel> | $Enums.POSStatus +} + +export type NestedEnumPOSTypeFilter<$PrismaModel = never> = { + equals?: $Enums.POSType | Prisma.EnumPOSTypeFieldRefInput<$PrismaModel> + in?: $Enums.POSType[] + notIn?: $Enums.POSType[] + not?: Prisma.NestedEnumPOSTypeFilter<$PrismaModel> | $Enums.POSType +} + +export type NestedEnumPOSStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.POSStatus | Prisma.EnumPOSStatusFieldRefInput<$PrismaModel> + in?: $Enums.POSStatus[] + notIn?: $Enums.POSStatus[] + not?: Prisma.NestedEnumPOSStatusWithAggregatesFilter<$PrismaModel> | $Enums.POSStatus _count?: Prisma.NestedIntFilter<$PrismaModel> - _avg?: Prisma.NestedDecimalFilter<$PrismaModel> - _sum?: Prisma.NestedDecimalFilter<$PrismaModel> - _min?: Prisma.NestedDecimalFilter<$PrismaModel> - _max?: Prisma.NestedDecimalFilter<$PrismaModel> + _min?: Prisma.NestedEnumPOSStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumPOSStatusFilter<$PrismaModel> +} + +export type NestedEnumPOSTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.POSType | Prisma.EnumPOSTypeFieldRefInput<$PrismaModel> + in?: $Enums.POSType[] + notIn?: $Enums.POSType[] + not?: Prisma.NestedEnumPOSTypeWithAggregatesFilter<$PrismaModel> | $Enums.POSType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumPOSTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumPOSTypeFilter<$PrismaModel> +} + +export type NestedEnumLicenseStatusFilter<$PrismaModel = never> = { + equals?: $Enums.LicenseStatus | Prisma.EnumLicenseStatusFieldRefInput<$PrismaModel> + in?: $Enums.LicenseStatus[] + notIn?: $Enums.LicenseStatus[] + not?: Prisma.NestedEnumLicenseStatusFilter<$PrismaModel> | $Enums.LicenseStatus +} + +export type NestedEnumLicenseStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.LicenseStatus | Prisma.EnumLicenseStatusFieldRefInput<$PrismaModel> + in?: $Enums.LicenseStatus[] + notIn?: $Enums.LicenseStatus[] + not?: Prisma.NestedEnumLicenseStatusWithAggregatesFilter<$PrismaModel> | $Enums.LicenseStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumLicenseStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumLicenseStatusFilter<$PrismaModel> +} + +export type NestedEnumAccountTypeFilter<$PrismaModel = never> = { + equals?: $Enums.AccountType | Prisma.EnumAccountTypeFieldRefInput<$PrismaModel> + in?: $Enums.AccountType[] + notIn?: $Enums.AccountType[] + not?: Prisma.NestedEnumAccountTypeFilter<$PrismaModel> | $Enums.AccountType +} + +export type NestedEnumAccountStatusFilter<$PrismaModel = never> = { + equals?: $Enums.AccountStatus | Prisma.EnumAccountStatusFieldRefInput<$PrismaModel> + in?: $Enums.AccountStatus[] + notIn?: $Enums.AccountStatus[] + not?: Prisma.NestedEnumAccountStatusFilter<$PrismaModel> | $Enums.AccountStatus +} + +export type NestedEnumAccountTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.AccountType | Prisma.EnumAccountTypeFieldRefInput<$PrismaModel> + in?: $Enums.AccountType[] + notIn?: $Enums.AccountType[] + not?: Prisma.NestedEnumAccountTypeWithAggregatesFilter<$PrismaModel> | $Enums.AccountType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumAccountTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumAccountTypeFilter<$PrismaModel> +} + +export type NestedEnumAccountStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.AccountStatus | Prisma.EnumAccountStatusFieldRefInput<$PrismaModel> + in?: $Enums.AccountStatus[] + notIn?: $Enums.AccountStatus[] + not?: Prisma.NestedEnumAccountStatusWithAggregatesFilter<$PrismaModel> | $Enums.AccountStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumAccountStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumAccountStatusFilter<$PrismaModel> } export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { @@ -543,6 +701,115 @@ export type NestedFloatFilter<$PrismaModel = never> = { not?: Prisma.NestedFloatFilter<$PrismaModel> | number } +export type NestedDateTimeNullableFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | null + notIn?: Date[] | string[] | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null +} + +export type NestedEnumCustomerTypeFilter<$PrismaModel = never> = { + equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel> + in?: $Enums.CustomerType[] + notIn?: $Enums.CustomerType[] + not?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel> | $Enums.CustomerType +} + +export type NestedBoolNullableFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null + not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null +} + +export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | null + notIn?: Date[] | string[] | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> +} + +export type NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.CustomerType | Prisma.EnumCustomerTypeFieldRefInput<$PrismaModel> + in?: $Enums.CustomerType[] + notIn?: $Enums.CustomerType[] + not?: Prisma.NestedEnumCustomerTypeWithAggregatesFilter<$PrismaModel> | $Enums.CustomerType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumCustomerTypeFilter<$PrismaModel> +} + +export type NestedBoolNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null + not?: Prisma.NestedBoolNullableWithAggregatesFilter<$PrismaModel> | boolean | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedBoolNullableFilter<$PrismaModel> + _max?: Prisma.NestedBoolNullableFilter<$PrismaModel> +} + +export type NestedDecimalNullableFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> | null + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | null + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | null + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalNullableFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string | null +} + +export type NestedDecimalNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> | null + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | null + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | null + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalNullableWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _avg?: Prisma.NestedDecimalNullableFilter<$PrismaModel> + _sum?: Prisma.NestedDecimalNullableFilter<$PrismaModel> + _min?: Prisma.NestedDecimalNullableFilter<$PrismaModel> + _max?: Prisma.NestedDecimalNullableFilter<$PrismaModel> +} + +export type NestedDecimalFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = { + equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] + notIn?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] + lt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + lte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gt?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + gte?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> + not?: Prisma.NestedDecimalWithAggregatesFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedDecimalFilter<$PrismaModel> + _sum?: Prisma.NestedDecimalFilter<$PrismaModel> + _min?: Prisma.NestedDecimalFilter<$PrismaModel> + _max?: Prisma.NestedDecimalFilter<$PrismaModel> +} + export type NestedJsonNullableFilter<$PrismaModel = never> = | Prisma.PatchUndefined< Prisma.Either>, Exclude>, 'path'>>, @@ -574,13 +841,6 @@ export type NestedEnumUnitTypeFilter<$PrismaModel = never> = { not?: Prisma.NestedEnumUnitTypeFilter<$PrismaModel> | $Enums.UnitType } -export type NestedEnumSalesInvoiceItemPricingModelFilter<$PrismaModel = never> = { - equals?: $Enums.SalesInvoiceItemPricingModel | Prisma.EnumSalesInvoiceItemPricingModelFieldRefInput<$PrismaModel> - in?: $Enums.SalesInvoiceItemPricingModel[] - notIn?: $Enums.SalesInvoiceItemPricingModel[] - not?: Prisma.NestedEnumSalesInvoiceItemPricingModelFilter<$PrismaModel> | $Enums.SalesInvoiceItemPricingModel -} - export type NestedEnumUnitTypeWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.UnitType | Prisma.EnumUnitTypeFieldRefInput<$PrismaModel> in?: $Enums.UnitType[] @@ -591,16 +851,6 @@ export type NestedEnumUnitTypeWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedEnumUnitTypeFilter<$PrismaModel> } -export type NestedEnumSalesInvoiceItemPricingModelWithAggregatesFilter<$PrismaModel = never> = { - equals?: $Enums.SalesInvoiceItemPricingModel | Prisma.EnumSalesInvoiceItemPricingModelFieldRefInput<$PrismaModel> - in?: $Enums.SalesInvoiceItemPricingModel[] - notIn?: $Enums.SalesInvoiceItemPricingModel[] - not?: Prisma.NestedEnumSalesInvoiceItemPricingModelWithAggregatesFilter<$PrismaModel> | $Enums.SalesInvoiceItemPricingModel - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedEnumSalesInvoiceItemPricingModelFilter<$PrismaModel> - _max?: Prisma.NestedEnumSalesInvoiceItemPricingModelFilter<$PrismaModel> -} - export type NestedEnumPaymentMethodTypeFilter<$PrismaModel = never> = { equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel> in?: $Enums.PaymentMethodType[] diff --git a/src/generated/prisma/enums.ts b/src/generated/prisma/enums.ts index 7dc317f..dcfa01b 100644 --- a/src/generated/prisma/enums.ts +++ b/src/generated/prisma/enums.ts @@ -43,6 +43,7 @@ export const UnitType = { COUNT: 'COUNT', GRAM: 'GRAM', KILOGRAM: 'KILOGRAM', + MILLILITER: 'MILLILITER', LITER: 'LITER', METER: 'METER', HOUR: 'HOUR' @@ -51,6 +52,14 @@ export const UnitType = { export type UnitType = (typeof UnitType)[keyof typeof UnitType] +export const GoodPricingModel = { + STANDARD: 'STANDARD', + GOLD: 'GOLD' +} as const + +export type GoodPricingModel = (typeof GoodPricingModel)[keyof typeof GoodPricingModel] + + export const CustomerType = { INDIVIDUAL: 'INDIVIDUAL', LEGAL: 'LEGAL', @@ -60,9 +69,121 @@ export const CustomerType = { export type CustomerType = (typeof CustomerType)[keyof typeof CustomerType] -export const SalesInvoiceItemPricingModel = { - STANDARD: 'STANDARD', - GOLD: 'GOLD' +export const UserStatus = { + ACTIVE: 'ACTIVE', + INACTIVE: 'INACTIVE' } as const -export type SalesInvoiceItemPricingModel = (typeof SalesInvoiceItemPricingModel)[keyof typeof SalesInvoiceItemPricingModel] +export type UserStatus = (typeof UserStatus)[keyof typeof UserStatus] + + +export const AccountRole = { + OWNER: 'OWNER', + OPERATOR: 'OPERATOR', + ACCOUNTANT: 'ACCOUNTANT' +} as const + +export type AccountRole = (typeof AccountRole)[keyof typeof AccountRole] + + +export const AccountStatus = { + ACTIVE: 'ACTIVE', + SUSPENDED: 'SUSPENDED' +} as const + +export type AccountStatus = (typeof AccountStatus)[keyof typeof AccountStatus] + + +export const POSStatus = { + ACTIVE: 'ACTIVE', + DISABLED: 'DISABLED' +} as const + +export type POSStatus = (typeof POSStatus)[keyof typeof POSStatus] + + +export const POSRole = { + MANAGER: 'MANAGER', + OPERATOR: 'OPERATOR', + VIEWER: 'VIEWER' +} as const + +export type POSRole = (typeof POSRole)[keyof typeof POSRole] + + +export const LicenseType = { + BASIC: 'BASIC', + PRO: 'PRO', + ENTERPRISE: 'ENTERPRISE' +} as const + +export type LicenseType = (typeof LicenseType)[keyof typeof LicenseType] + + +export const LicenseStatus = { + ACTIVE: 'ACTIVE', + EXPIRED: 'EXPIRED', + SUSPENDED: 'SUSPENDED' +} as const + +export type LicenseStatus = (typeof LicenseStatus)[keyof typeof LicenseStatus] + + +export const POSType = { + PSP: 'PSP', + MOBILE: 'MOBILE', + API: 'API' +} as const + +export type POSType = (typeof POSType)[keyof typeof POSType] + + +export const UserType = { + LEGAL: 'LEGAL', + INDIVIDUAL: 'INDIVIDUAL' +} as const + +export type UserType = (typeof UserType)[keyof typeof UserType] + + +export const AccountType = { + PARTNER: 'PARTNER', + BUSINESS: 'BUSINESS', + ADMIN: 'ADMIN', + PROVIDER: 'PROVIDER', + POS: 'POS' +} as const + +export type AccountType = (typeof AccountType)[keyof typeof AccountType] + + +export const PartnerRole = { + ADMIN: 'ADMIN', + OPERATOR: 'OPERATOR' +} as const + +export type PartnerRole = (typeof PartnerRole)[keyof typeof PartnerRole] + + +export const BusinessRole = { + ADMIN: 'ADMIN', + OPERATOR: 'OPERATOR' +} as const + +export type BusinessRole = (typeof BusinessRole)[keyof typeof BusinessRole] + + +export const ProviderRole = { + ADMIN: 'ADMIN', + OPERATOR: 'OPERATOR' +} as const + +export type ProviderRole = (typeof ProviderRole)[keyof typeof ProviderRole] + + +export const TokenType = { + ACCESS: 'ACCESS', + REFRESH: 'REFRESH' +} as const + +export type TokenType = (typeof TokenType)[keyof typeof TokenType] diff --git a/src/generated/prisma/internal/class.ts b/src/generated/prisma/internal/class.ts index b48c3b8..09e11f6 100644 --- a/src/generated/prisma/internal/class.ts +++ b/src/generated/prisma/internal/class.ts @@ -22,7 +22,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.2.0", "engineVersion": "0c8ef2ce45c83248ab3df073180d5eda9e8be7a3", "activeProvider": "mysql", - "inlineSchema": "model Customer {\n id String @id @default(uuid())\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n type CustomerType\n complex_id String\n is_favorite Boolean? @default(false)\n\n sales_invoices SalesInvoice[]\n customerIndividuals CustomerIndividual?\n customerLegals CustomerLegal?\n\n @@map(\"customers\")\n}\n\nmodel CustomerIndividual {\n customer_id String @id\n first_name String @db.VarChar(255)\n last_name String @db.VarChar(255)\n national_id String @db.Char(10)\n postal_code String @db.Char(10)\n economic_code String? @db.Char(10)\n complex_id String\n\n customer Customer @relation(fields: [customer_id], references: [id])\n\n @@unique([complex_id, national_id])\n @@map(\"customer_individuals\")\n}\n\nmodel CustomerLegal {\n customer_id String @id\n company_name String @db.VarChar(255)\n economic_code String @db.Char(10)\n registration_number String @unique() @db.Char(20)\n postal_code String @db.Char(10)\n complex_id String\n\n customer Customer @relation(fields: [customer_id], references: [id])\n\n @@unique([complex_id, registration_number])\n @@map(\"customer_legal\")\n}\n\nmodel Device {\n account_id String? @db.VarChar(255)\n app_version String @db.VarChar(20)\n build_number String @db.VarChar(20)\n\n uuid String @id @unique() @db.VarChar(255)\n platform String @db.VarChar(100)\n brand String @db.VarChar(100)\n model String @db.VarChar(100)\n device String @db.VarChar(100)\n os_version String @db.VarChar(20)\n sdk_version String @db.VarChar(20)\n release_number String @db.VarChar(20)\n browser_name String? @db.VarChar(100)\n fcm_token String? @db.VarChar(100)\n\n @@map(\"devices\")\n}\n\nenum PaymentMethodType {\n TERMINAL\n CASH\n SET_OFF\n CARD\n BANK\n CHECK\n OTHER\n}\n\nenum PurchaseReceiptStatus {\n UNPAID\n PARTIALLY_PAID\n PAID\n}\n\nenum SalesInvoiceType {\n GOOD\n SERVICE\n}\n\nenum UnitType {\n COUNT\n GRAM\n KILOGRAM\n LITER\n METER\n HOUR\n}\n\nenum CustomerType {\n INDIVIDUAL\n LEGAL\n UNKNOWN\n}\n\nenum SalesInvoiceItemPricingModel {\n STANDARD\n GOLD\n}\n\nmodel Good {\n id String @id @default(uuid())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String @db.VarChar(100)\n local_sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n category_id String?\n base_sale_price Decimal @default(0.00) @db.Decimal(15, 0)\n account_id String\n complex_id String\n\n category GoodCategory? @relation(fields: [category_id], references: [id])\n sales_invoice_items SalesInvoiceItem[]\n\n @@index([category_id])\n @@map(\"goods\")\n}\n\nmodel GoodCategory {\n id String @id @default(uuid())\n name String @db.VarChar(100)\n description String? @db.Text\n image_url String? @db.VarChar(255)\n account_id String\n complex_id String\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n goods Good[]\n\n @@map(\"good_categories\")\n}\n\nmodel TriggerLog {\n id Int @id @default(autoincrement())\n message String @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n name String @db.Text\n\n @@map(\"trigger_logs\")\n}\n\nmodel SalesInvoice {\n id String @id @default(uuid())\n code String @unique @db.VarChar(100)\n total_amount Decimal @db.Decimal(15, 2)\n notes String? @db.Text\n unknown_customer Json? @db.Json\n invoice_date DateTime? @default(now()) @db.Timestamp(0)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n\n customer_id String?\n account_id String\n complex_id String\n\n customer Customer? @relation(fields: [customer_id], references: [id])\n items SalesInvoiceItem[]\n payments SalesInvoicePayment[]\n\n @@map(\"sales_invoices\")\n}\n\nmodel SalesInvoiceItem {\n id String @id @default(uuid())\n quantity Decimal @db.Decimal(10, 0)\n unit_type UnitType\n unit_price Decimal @default(0.00) @db.Decimal(15, 2)\n total_amount Decimal @default(0.00) @db.Decimal(15, 2)\n created_at DateTime @default(now()) @db.Timestamp(0)\n discount Decimal @default(0.00) @db.Decimal(15, 2)\n notes String? @db.Text\n pricingModel SalesInvoiceItemPricingModel @default(STANDARD)\n\n invoice_id String\n good_id String?\n service_id String?\n\n payload Json?\n\n invoice SalesInvoice @relation(fields: [invoice_id], references: [id])\n good Good? @relation(fields: [good_id], references: [id])\n service Service? @relation(fields: [service_id], references: [id])\n\n @@index([invoice_id, good_id])\n @@map(\"sales_invoice_items\")\n}\n\nmodel SalesInvoicePayment {\n id String @id @default(uuid())\n invoice_id String\n amount Decimal @db.Decimal(15, 2)\n payment_method PaymentMethodType\n paid_at DateTime\n created_at DateTime @default(now())\n\n invoice SalesInvoice @relation(fields: [invoice_id], references: [id])\n\n @@index([invoice_id])\n @@map(\"sales_invoice_payments\")\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../../src/generated/prisma\"\n moduleFormat = \"cjs\"\n previewFeatures = [\"views\"]\n}\n\ndatasource db {\n provider = \"mysql\"\n}\n\nmodel Service {\n id String @id @default(uuid())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String @unique() @db.VarChar(100)\n local_sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n category_id String?\n base_sale_price Decimal @default(0.00) @db.Decimal(15, 0)\n account_id String\n complex_id String\n\n category ServiceCategory? @relation(fields: [category_id], references: [id])\n sales_invoice_items SalesInvoiceItem[]\n\n @@index([category_id])\n @@map(\"services\")\n}\n\nmodel ServiceCategory {\n id String @id @default(uuid())\n name String @db.VarChar(100)\n description String? @db.Text\n image_url String? @db.VarChar(255)\n account_id String\n complex_id String\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n services Service[]\n\n @@map(\"service_categories\")\n}\n", + "inlineSchema": "model Token {\n id String @id @default(uuid())\n token String @unique\n type TokenType\n created_at DateTime @default(now())\n expires_at DateTime\n\n account_id String\n account Account @relation(fields: [account_id], references: [id])\n\n @@unique([type, account_id])\n @@map(\"tokens\")\n}\n\nmodel VerificationCode {\n id String @id @default(uuid())\n code String\n is_used Boolean @default(false)\n created_at DateTime @default(now())\n expires_at DateTime\n\n account_id String\n account Account @relation(fields: [account_id], references: [id])\n\n @@map(\"verification_codes\")\n}\n\nmodel Guild {\n id String @id @default(uuid())\n name String\n code String?\n\n business_activities BusinessActivity[]\n goods Good[]\n good_categories GoodCategory[]\n\n @@map(\"guilds\")\n}\n\nmodel BusinessActivity {\n id String @id @default(uuid())\n name String\n created_at DateTime @default(now())\n guild_id String\n owner_id String\n\n guild Guild @relation(fields: [guild_id], references: [id])\n user User @relation(fields: [owner_id], references: [id])\n\n complexes Complex[]\n accounts Account[]\n\n @@map(\"business_activities\")\n}\n\nmodel Complex {\n id String @id @default(uuid())\n name String\n address String?\n tax_id String?\n\n business_activity_id String\n\n business_activity BusinessActivity @relation(fields: [business_activity_id], references: [id])\n\n pos_list Pos[]\n goods Good[]\n good_categories GoodCategory[]\n\n @@map(\"complexes\")\n}\n\nmodel Pos {\n id String @id @default(uuid())\n serial String @unique\n model String?\n status POSStatus @default(ACTIVE)\n pos_type POSType\n created_at DateTime @default(now())\n updated_at DateTime @updatedAt()\n\n complex_id String\n device_id String\n provider_id String?\n\n complex Complex @relation(fields: [complex_id], references: [id])\n device Device @relation(fields: [device_id], references: [id])\n provider Provider? @relation(fields: [provider_id], references: [id])\n\n licenses License[]\n accounts Account[]\n\n @@map(\"poses\")\n}\n\n// model BusinessAccount {\n// id String @id @default(uuid())\n// role BusinessRole\n// status AccountStatus @default(ACTIVE)\n// created_at DateTime @default(now())\n// business_activity_id String\n// account_id String @unique\n\n// account Account @relation(fields: [account_id], references: [id])\n// owned_activities BusinessActivity[] @relation(\"business_owner\")\n\n// @@unique([business_activity_id, account_id])\n// @@map(\"business_accounts\")\n// }\n\n// model PosAccount {\n// id String @id @default(uuid())\n// pos_id String\n// account_id String\n// role POSRole\n// created_at DateTime @default(now())\n\n// pos Pos @relation(fields: [pos_id], references: [id])\n// account Account @relation(fields: [account_id], references: [id])\n\n// @@unique([pos_id, account_id])\n// @@map(\"pos_accounts\")\n// }\n\nmodel DeviceBrand {\n id String @id @default(uuid())\n name String\n\n created_at DateTime @default(now())\n updated_at DateTime @updatedAt()\n\n devices Device[]\n\n @@map(\"device_brands\")\n}\n\nmodel Device {\n id String @id @default(uuid())\n name String\n os_version String?\n created_at DateTime @default(now())\n updated_at DateTime @updatedAt()\n brand_id String\n\n brand DeviceBrand @relation(fields: [brand_id], references: [id])\n poses Pos[]\n\n @@map(\"devices\")\n}\n\nmodel License {\n id String @id @default(uuid())\n starts_at DateTime\n expires_at DateTime\n status LicenseStatus\n\n pos_id String\n partner_id String\n\n pos Pos @relation(fields: [pos_id], references: [id])\n partner Partner @relation(fields: [partner_id], references: [id])\n\n @@map(\"licenses\")\n}\n\nmodel Partner {\n id String @id @default(uuid())\n name String\n code String?\n\n licenses License[]\n account Account[]\n\n @@map(\"partners\")\n}\n\n// model PartnerAccount {\n// id String @id @default(uuid())\n// role PartnerRole\n// status AccountStatus @default(ACTIVE)\n// created_at DateTime @default(now())\n// partner_id String\n// account_id String @unique\n\n// partner Partner @relation(fields: [partner_id], references: [id])\n// account Account @relation(fields: [account_id], references: [id])\n\n// @@unique([partner_id, account_id])\n// @@map(\"partner_accounts\")\n// }\n\nmodel User {\n id String @id @default(uuid())\n // user_type UserType\n created_at DateTime @default(now())\n\n // individual_profile IndividualProfile?\n // legal_profile LegalProfile?\n mobile_number String @unique()\n national_code String? @unique()\n first_name String\n last_name String\n // username String\n accounts Account[]\n businessActivities BusinessActivity[]\n\n @@map(\"users\")\n}\n\n// model LegalProfile {\n// user_id String @id\n// company_name String\n// register_no String @unique()\n// representative_name String?\n// representative_national_id String?\n\n// // user User @relation(fields: [user_id], references: [id])\n\n// @@map(\"legal_profiles\")\n// }\n\n// model IndividualProfile {\n// user_id String @id\n// national_code String @unique()\n// first_name String\n// last_name String\n// birth_date DateTime?\n// mobile_number String\n// // user User @relation(fields: [user_id], references: [id])\n\n// @@map(\"individual_profiles\")\n// }\n\nmodel Account {\n id String @id @default(uuid())\n username String @unique()\n // first_name String\n // last_name String\n type AccountType\n status AccountStatus\n password String\n created_at DateTime @default(now())\n\n user_id String\n user User @relation(fields: [user_id], references: [id])\n\n partner_id String?\n partner Partner? @relation(fields: [partner_id], references: [id])\n\n business_id String?\n business BusinessActivity? @relation(fields: [business_id], references: [id])\n\n provider_id String?\n provider Provider? @relation(fields: [provider_id], references: [id])\n\n pos_id String?\n pos Pos? @relation(fields: [pos_id], references: [id])\n\n verification_codes VerificationCode[]\n tokens Token[]\n\n @@map(\"accounts\")\n}\n\nmodel Provider {\n id String @id @default(uuid())\n name String\n code String?\n\n pos_list Pos[]\n accounts Account[]\n\n @@map(\"providers\")\n}\n\n// model ProviderAccount {\n// id String @id @default(uuid())\n// role ProviderRole\n// status AccountStatus @default(ACTIVE)\n// created_at DateTime @default(now())\n// provider_id String\n// account_id String @unique\n\n// provider Provider @relation(fields: [provider_id], references: [id])\n// account Account @relation(fields: [account_id], references: [id])\n\n// @@unique([provider_id, account_id])\n// @@map(\"provider_accounts\")\n// }\n\nmodel TriggerLog {\n id Int @id @default(autoincrement())\n message String @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n name String @db.Text\n\n @@map(\"trigger_logs\")\n}\n\nmodel UserDevices {\n account_id String? @db.VarChar(255)\n app_version String @db.VarChar(20)\n build_number String @db.VarChar(20)\n\n uuid String @id @unique() @db.VarChar(255)\n platform String @db.VarChar(100)\n brand String @db.VarChar(100)\n model String @db.VarChar(100)\n device String @db.VarChar(100)\n os_version String @db.VarChar(20)\n sdk_version String @db.VarChar(20)\n release_number String @db.VarChar(20)\n browser_name String? @db.VarChar(100)\n fcm_token String? @db.VarChar(100)\n\n @@map(\"user_devices\")\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../../src/generated/prisma\"\n moduleFormat = \"cjs\"\n previewFeatures = [\"views\"]\n}\n\ndatasource db {\n provider = \"mysql\"\n}\n\nmodel Customer {\n id String @id @default(uuid())\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n type CustomerType\n complex_id String\n is_favorite Boolean? @default(false)\n\n sales_invoices SalesInvoice[]\n customerIndividuals CustomerIndividual?\n customerLegals CustomerLegal?\n\n @@map(\"customers\")\n}\n\nmodel CustomerIndividual {\n customer_id String @id\n first_name String @db.VarChar(255)\n last_name String @db.VarChar(255)\n national_id String @db.Char(10)\n postal_code String @db.Char(10)\n economic_code String? @db.Char(10)\n complex_id String\n\n customer Customer @relation(fields: [customer_id], references: [id])\n\n @@unique([complex_id, national_id])\n @@map(\"customer_individuals\")\n}\n\nmodel CustomerLegal {\n customer_id String @id\n company_name String @db.VarChar(255)\n economic_code String @db.Char(10)\n registration_number String @db.Char(20)\n postal_code String @db.Char(10)\n complex_id String\n\n customer Customer @relation(fields: [customer_id], references: [id])\n\n @@unique([complex_id, registration_number])\n @@map(\"customer_legal\")\n}\n\nenum PaymentMethodType {\n TERMINAL\n CASH\n SET_OFF\n CARD\n BANK\n CHECK\n OTHER\n}\n\nenum PurchaseReceiptStatus {\n UNPAID\n PARTIALLY_PAID\n PAID\n}\n\nenum SalesInvoiceType {\n GOOD\n SERVICE\n}\n\nenum UnitType {\n COUNT\n GRAM\n KILOGRAM\n MILLILITER\n LITER\n METER\n HOUR\n}\n\nenum GoodPricingModel {\n STANDARD\n GOLD\n}\n\nenum CustomerType {\n INDIVIDUAL\n LEGAL\n UNKNOWN\n}\n\nenum UserStatus {\n ACTIVE\n INACTIVE\n}\n\nenum AccountRole {\n OWNER\n OPERATOR\n ACCOUNTANT\n}\n\nenum AccountStatus {\n ACTIVE\n SUSPENDED\n}\n\nenum POSStatus {\n ACTIVE\n DISABLED\n}\n\nenum POSRole {\n MANAGER\n OPERATOR\n VIEWER\n}\n\nenum LicenseType {\n BASIC\n PRO\n ENTERPRISE\n}\n\nenum LicenseStatus {\n ACTIVE\n EXPIRED\n SUSPENDED\n}\n\nenum POSType {\n PSP\n MOBILE\n API\n}\n\nenum UserType {\n LEGAL\n INDIVIDUAL\n}\n\nenum AccountType {\n PARTNER\n BUSINESS\n ADMIN\n PROVIDER\n POS\n}\n\nenum PartnerRole {\n ADMIN\n OPERATOR\n}\n\nenum BusinessRole {\n ADMIN\n OPERATOR\n}\n\nenum ProviderRole {\n ADMIN\n OPERATOR\n}\n\nenum TokenType {\n ACCESS\n REFRESH\n}\n\nmodel Good {\n id String @id @default(uuid())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String @db.VarChar(100)\n local_sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n base_sale_price Decimal? @default(0.00) @db.Decimal(15, 0)\n is_default_guild_good Boolean @default(false)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n complex_id String?\n category_id String?\n guild_id String?\n\n category GoodCategory? @relation(fields: [category_id], references: [id])\n complex Complex? @relation(fields: [complex_id], references: [id])\n guild Guild? @relation(fields: [guild_id], references: [id])\n sales_invoice_items SalesInvoiceItem[]\n\n @@index([category_id])\n @@map(\"goods\")\n}\n\nmodel GoodCategory {\n id String @id @default(uuid())\n name String @db.VarChar(100)\n description String? @db.Text\n image_url String? @db.VarChar(255)\n complex_id String?\n is_default_guild_good Boolean @default(false)\n guild_id String?\n\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n goods Good[]\n guild Guild? @relation(fields: [guild_id], references: [id])\n complex Complex? @relation(fields: [complex_id], references: [id])\n\n @@map(\"good_categories\")\n}\n\nmodel SalesInvoice {\n id String @id @default(uuid())\n code String @unique @db.VarChar(100)\n total_amount Decimal @db.Decimal(15, 2)\n notes String? @db.Text\n unknown_customer Json? @db.Json\n invoice_date DateTime? @default(now()) @db.Timestamp(0)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n\n customer_id String?\n account_id String\n complex_id String\n\n customer Customer? @relation(fields: [customer_id], references: [id])\n items SalesInvoiceItem[]\n payments SalesInvoicePayment[]\n\n @@map(\"sales_invoices\")\n}\n\nmodel SalesInvoiceItem {\n id String @id @default(uuid())\n quantity Decimal @db.Decimal(10, 0)\n unit_type UnitType\n unit_price Decimal @default(0.00) @db.Decimal(15, 2)\n total_amount Decimal @default(0.00) @db.Decimal(15, 2)\n created_at DateTime @default(now()) @db.Timestamp(0)\n discount Decimal @default(0.00) @db.Decimal(15, 2)\n notes String? @db.Text\n\n invoice_id String\n good_id String?\n service_id String?\n\n payload Json?\n\n invoice SalesInvoice @relation(fields: [invoice_id], references: [id])\n good Good? @relation(fields: [good_id], references: [id])\n service Service? @relation(fields: [service_id], references: [id])\n\n @@index([invoice_id, good_id])\n @@map(\"sales_invoice_items\")\n}\n\nmodel SalesInvoicePayment {\n id String @id @default(uuid())\n invoice_id String\n amount Decimal @db.Decimal(15, 2)\n payment_method PaymentMethodType\n paid_at DateTime\n created_at DateTime @default(now())\n\n invoice SalesInvoice @relation(fields: [invoice_id], references: [id])\n\n @@index([invoice_id])\n @@map(\"sales_invoice_payments\")\n}\n\nmodel Service {\n id String @id @default(uuid())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String @unique() @db.VarChar(100)\n local_sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n category_id String?\n base_sale_price Decimal @default(0.00) @db.Decimal(15, 0)\n account_id String\n complex_id String\n\n category ServiceCategory? @relation(fields: [category_id], references: [id])\n sales_invoice_items SalesInvoiceItem[]\n\n @@index([category_id])\n @@map(\"services\")\n}\n\nmodel ServiceCategory {\n id String @id @default(uuid())\n name String @db.VarChar(100)\n description String? @db.Text\n image_url String? @db.VarChar(255)\n account_id String\n complex_id String\n created_at DateTime @default(now()) @db.Timestamp(0)\n updated_at DateTime @updatedAt @db.Timestamp(0)\n deleted_at DateTime? @db.Timestamp(0)\n\n services Service[]\n\n @@map(\"service_categories\")\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -30,7 +30,7 @@ const config: runtime.GetPrismaClientConfig = { } } -config.runtimeDataModel = JSON.parse("{\"models\":{\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"CustomerType\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_favorite\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"sales_invoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"customerIndividuals\",\"kind\":\"object\",\"type\":\"CustomerIndividual\",\"relationName\":\"CustomerToCustomerIndividual\"},{\"name\":\"customerLegals\",\"kind\":\"object\",\"type\":\"CustomerLegal\",\"relationName\":\"CustomerToCustomerLegal\"}],\"dbName\":\"customers\"},\"CustomerIndividual\":{\"fields\":[{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"national_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"postal_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"economic_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerIndividual\"}],\"dbName\":\"customer_individuals\"},\"CustomerLegal\":{\"fields\":[{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"company_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"economic_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"registration_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"postal_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerLegal\"}],\"dbName\":\"customer_legal\"},\"Device\":{\"fields\":[{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"app_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"build_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"uuid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"platform\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"brand\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"model\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"device\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"os_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sdk_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"release_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"browser_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"fcm_token\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"devices\"},\"Good\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"local_sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"category_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"base_sale_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"GoodToGoodCategory\"},{\"name\":\"sales_invoice_items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"GoodToSalesInvoiceItem\"}],\"dbName\":\"goods\"},\"GoodCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"image_url\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"goods\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToGoodCategory\"}],\"dbName\":\"good_categories\"},\"TriggerLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"trigger_logs\"},\"SalesInvoice\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"total_amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"notes\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"unknown_customer\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"invoice_date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"payments\",\"kind\":\"object\",\"type\":\"SalesInvoicePayment\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"sales_invoices\"},\"SalesInvoiceItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unit_type\",\"kind\":\"enum\",\"type\":\"UnitType\"},{\"name\":\"unit_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"total_amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"discount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"notes\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"pricingModel\",\"kind\":\"enum\",\"type\":\"SalesInvoiceItemPricingModel\"},{\"name\":\"invoice_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"good_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"service_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"payload\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"good\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToSalesInvoiceItem\"},{\"name\":\"service\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"sales_invoice_items\"},\"SalesInvoicePayment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"invoice_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"payment_method\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"name\":\"paid_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"sales_invoice_payments\"},\"Service\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"local_sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"category_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"base_sale_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ServiceCategory\",\"relationName\":\"ServiceToServiceCategory\"},{\"name\":\"sales_invoice_items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"services\"},\"ServiceCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"image_url\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"services\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"ServiceToServiceCategory\"}],\"dbName\":\"service_categories\"}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"Token\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"token\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"TokenType\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"expires_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToToken\"}],\"dbName\":\"tokens\"},\"VerificationCode\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_used\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"expires_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToVerificationCode\"}],\"dbName\":\"verification_codes\"},\"Guild\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"business_activities\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToGuild\"},{\"name\":\"goods\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToGuild\"},{\"name\":\"good_categories\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"GoodCategoryToGuild\"}],\"dbName\":\"guilds\"},\"BusinessActivity\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"guild_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"owner_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"guild\",\"kind\":\"object\",\"type\":\"Guild\",\"relationName\":\"BusinessActivityToGuild\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"BusinessActivityToUser\"},{\"name\":\"complexes\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"BusinessActivityToComplex\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToBusinessActivity\"}],\"dbName\":\"business_activities\"},\"Complex\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"tax_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"business_activity_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"business_activity\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToComplex\"},{\"name\":\"pos_list\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"ComplexToPos\"},{\"name\":\"goods\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"ComplexToGood\"},{\"name\":\"good_categories\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"ComplexToGoodCategory\"}],\"dbName\":\"complexes\"},\"Pos\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"serial\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"model\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"POSStatus\"},{\"name\":\"pos_type\",\"kind\":\"enum\",\"type\":\"POSType\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"device_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"provider_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToPos\"},{\"name\":\"device\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"DeviceToPos\"},{\"name\":\"provider\",\"kind\":\"object\",\"type\":\"Provider\",\"relationName\":\"PosToProvider\"},{\"name\":\"licenses\",\"kind\":\"object\",\"type\":\"License\",\"relationName\":\"LicenseToPos\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToPos\"}],\"dbName\":\"poses\"},\"DeviceBrand\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"devices\",\"kind\":\"object\",\"type\":\"Device\",\"relationName\":\"DeviceToDeviceBrand\"}],\"dbName\":\"device_brands\"},\"Device\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"os_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"brand_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"brand\",\"kind\":\"object\",\"type\":\"DeviceBrand\",\"relationName\":\"DeviceToDeviceBrand\"},{\"name\":\"poses\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"DeviceToPos\"}],\"dbName\":\"devices\"},\"License\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"starts_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"expires_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"LicenseStatus\"},{\"name\":\"pos_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"partner_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"pos\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"LicenseToPos\"},{\"name\":\"partner\",\"kind\":\"object\",\"type\":\"Partner\",\"relationName\":\"LicenseToPartner\"}],\"dbName\":\"licenses\"},\"Partner\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"licenses\",\"kind\":\"object\",\"type\":\"License\",\"relationName\":\"LicenseToPartner\"},{\"name\":\"account\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToPartner\"}],\"dbName\":\"partners\"},\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"mobile_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"national_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToUser\"},{\"name\":\"businessActivities\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"BusinessActivityToUser\"}],\"dbName\":\"users\"},\"Account\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"username\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"AccountType\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"AccountStatus\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"AccountToUser\"},{\"name\":\"partner_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"partner\",\"kind\":\"object\",\"type\":\"Partner\",\"relationName\":\"AccountToPartner\"},{\"name\":\"business_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"business\",\"kind\":\"object\",\"type\":\"BusinessActivity\",\"relationName\":\"AccountToBusinessActivity\"},{\"name\":\"provider_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"provider\",\"kind\":\"object\",\"type\":\"Provider\",\"relationName\":\"AccountToProvider\"},{\"name\":\"pos_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"pos\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"AccountToPos\"},{\"name\":\"verification_codes\",\"kind\":\"object\",\"type\":\"VerificationCode\",\"relationName\":\"AccountToVerificationCode\"},{\"name\":\"tokens\",\"kind\":\"object\",\"type\":\"Token\",\"relationName\":\"AccountToToken\"}],\"dbName\":\"accounts\"},\"Provider\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"pos_list\",\"kind\":\"object\",\"type\":\"Pos\",\"relationName\":\"PosToProvider\"},{\"name\":\"accounts\",\"kind\":\"object\",\"type\":\"Account\",\"relationName\":\"AccountToProvider\"}],\"dbName\":\"providers\"},\"TriggerLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"trigger_logs\"},\"UserDevices\":{\"fields\":[{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"app_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"build_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"uuid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"platform\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"brand\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"model\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"device\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"os_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sdk_version\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"release_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"browser_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"fcm_token\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"user_devices\"},\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"CustomerType\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_favorite\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"sales_invoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"customerIndividuals\",\"kind\":\"object\",\"type\":\"CustomerIndividual\",\"relationName\":\"CustomerToCustomerIndividual\"},{\"name\":\"customerLegals\",\"kind\":\"object\",\"type\":\"CustomerLegal\",\"relationName\":\"CustomerToCustomerLegal\"}],\"dbName\":\"customers\"},\"CustomerIndividual\":{\"fields\":[{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"national_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"postal_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"economic_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerIndividual\"}],\"dbName\":\"customer_individuals\"},\"CustomerLegal\":{\"fields\":[{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"company_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"economic_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"registration_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"postal_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerLegal\"}],\"dbName\":\"customer_legal\"},\"Good\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"local_sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"base_sale_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"is_default_guild_good\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"guild_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"GoodCategory\",\"relationName\":\"GoodToGoodCategory\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToGood\"},{\"name\":\"guild\",\"kind\":\"object\",\"type\":\"Guild\",\"relationName\":\"GoodToGuild\"},{\"name\":\"sales_invoice_items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"GoodToSalesInvoiceItem\"}],\"dbName\":\"goods\"},\"GoodCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"image_url\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_default_guild_good\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"guild_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"goods\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToGoodCategory\"},{\"name\":\"guild\",\"kind\":\"object\",\"type\":\"Guild\",\"relationName\":\"GoodCategoryToGuild\"},{\"name\":\"complex\",\"kind\":\"object\",\"type\":\"Complex\",\"relationName\":\"ComplexToGoodCategory\"}],\"dbName\":\"good_categories\"},\"SalesInvoice\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"total_amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"notes\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"unknown_customer\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"invoice_date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"customer_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"payments\",\"kind\":\"object\",\"type\":\"SalesInvoicePayment\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"sales_invoices\"},\"SalesInvoiceItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unit_type\",\"kind\":\"enum\",\"type\":\"UnitType\"},{\"name\":\"unit_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"total_amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"discount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"notes\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"invoice_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"good_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"service_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"payload\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"good\",\"kind\":\"object\",\"type\":\"Good\",\"relationName\":\"GoodToSalesInvoiceItem\"},{\"name\":\"service\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"sales_invoice_items\"},\"SalesInvoicePayment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"invoice_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"payment_method\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"name\":\"paid_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"sales_invoice_payments\"},\"Service\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"local_sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"category_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"base_sale_price\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ServiceCategory\",\"relationName\":\"ServiceToServiceCategory\"},{\"name\":\"sales_invoice_items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceItemToService\"}],\"dbName\":\"services\"},\"ServiceCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"image_url\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"account_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complex_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deleted_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"services\",\"kind\":\"object\",\"type\":\"Service\",\"relationName\":\"ServiceToServiceCategory\"}],\"dbName\":\"service_categories\"}},\"enums\":{},\"types\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') @@ -60,8 +60,8 @@ export interface PrismaClientConstructor { * @example * ``` * const prisma = new PrismaClient() - * // Fetch zero or more Customers - * const customers = await prisma.customer.findMany() + * // Fetch zero or more Tokens + * const tokens = await prisma.token.findMany() * ``` * * Read more in our [docs](https://pris.ly/d/client). @@ -82,8 +82,8 @@ export interface PrismaClientConstructor { * @example * ``` * const prisma = new PrismaClient() - * // Fetch zero or more Customers - * const customers = await prisma.customer.findMany() + * // Fetch zero or more Tokens + * const tokens = await prisma.token.findMany() * ``` * * Read more in our [docs](https://pris.ly/d/client). @@ -177,6 +177,156 @@ export interface PrismaClient< }>> /** + * `prisma.token`: Exposes CRUD operations for the **Token** model. + * Example usage: + * ```ts + * // Fetch zero or more Tokens + * const tokens = await prisma.token.findMany() + * ``` + */ + get token(): Prisma.TokenDelegate; + + /** + * `prisma.verificationCode`: Exposes CRUD operations for the **VerificationCode** model. + * Example usage: + * ```ts + * // Fetch zero or more VerificationCodes + * const verificationCodes = await prisma.verificationCode.findMany() + * ``` + */ + get verificationCode(): Prisma.VerificationCodeDelegate; + + /** + * `prisma.guild`: Exposes CRUD operations for the **Guild** model. + * Example usage: + * ```ts + * // Fetch zero or more Guilds + * const guilds = await prisma.guild.findMany() + * ``` + */ + get guild(): Prisma.GuildDelegate; + + /** + * `prisma.businessActivity`: Exposes CRUD operations for the **BusinessActivity** model. + * Example usage: + * ```ts + * // Fetch zero or more BusinessActivities + * const businessActivities = await prisma.businessActivity.findMany() + * ``` + */ + get businessActivity(): Prisma.BusinessActivityDelegate; + + /** + * `prisma.complex`: Exposes CRUD operations for the **Complex** model. + * Example usage: + * ```ts + * // Fetch zero or more Complexes + * const complexes = await prisma.complex.findMany() + * ``` + */ + get complex(): Prisma.ComplexDelegate; + + /** + * `prisma.pos`: Exposes CRUD operations for the **Pos** model. + * Example usage: + * ```ts + * // Fetch zero or more Pos + * const pos = await prisma.pos.findMany() + * ``` + */ + get pos(): Prisma.PosDelegate; + + /** + * `prisma.deviceBrand`: Exposes CRUD operations for the **DeviceBrand** model. + * Example usage: + * ```ts + * // Fetch zero or more DeviceBrands + * const deviceBrands = await prisma.deviceBrand.findMany() + * ``` + */ + get deviceBrand(): Prisma.DeviceBrandDelegate; + + /** + * `prisma.device`: Exposes CRUD operations for the **Device** model. + * Example usage: + * ```ts + * // Fetch zero or more Devices + * const devices = await prisma.device.findMany() + * ``` + */ + get device(): Prisma.DeviceDelegate; + + /** + * `prisma.license`: Exposes CRUD operations for the **License** model. + * Example usage: + * ```ts + * // Fetch zero or more Licenses + * const licenses = await prisma.license.findMany() + * ``` + */ + get license(): Prisma.LicenseDelegate; + + /** + * `prisma.partner`: Exposes CRUD operations for the **Partner** model. + * Example usage: + * ```ts + * // Fetch zero or more Partners + * const partners = await prisma.partner.findMany() + * ``` + */ + get partner(): Prisma.PartnerDelegate; + + /** + * `prisma.user`: Exposes CRUD operations for the **User** model. + * Example usage: + * ```ts + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + */ + get user(): Prisma.UserDelegate; + + /** + * `prisma.account`: Exposes CRUD operations for the **Account** model. + * Example usage: + * ```ts + * // Fetch zero or more Accounts + * const accounts = await prisma.account.findMany() + * ``` + */ + get account(): Prisma.AccountDelegate; + + /** + * `prisma.provider`: Exposes CRUD operations for the **Provider** model. + * Example usage: + * ```ts + * // Fetch zero or more Providers + * const providers = await prisma.provider.findMany() + * ``` + */ + get provider(): Prisma.ProviderDelegate; + + /** + * `prisma.triggerLog`: Exposes CRUD operations for the **TriggerLog** model. + * Example usage: + * ```ts + * // Fetch zero or more TriggerLogs + * const triggerLogs = await prisma.triggerLog.findMany() + * ``` + */ + get triggerLog(): Prisma.TriggerLogDelegate; + + /** + * `prisma.userDevices`: Exposes CRUD operations for the **UserDevices** model. + * Example usage: + * ```ts + * // Fetch zero or more UserDevices + * const userDevices = await prisma.userDevices.findMany() + * ``` + */ + get userDevices(): Prisma.UserDevicesDelegate; + + /** * `prisma.customer`: Exposes CRUD operations for the **Customer** model. * Example usage: * ```ts @@ -206,16 +356,6 @@ export interface PrismaClient< */ get customerLegal(): Prisma.CustomerLegalDelegate; - /** - * `prisma.device`: Exposes CRUD operations for the **Device** model. - * Example usage: - * ```ts - * // Fetch zero or more Devices - * const devices = await prisma.device.findMany() - * ``` - */ - get device(): Prisma.DeviceDelegate; - /** * `prisma.good`: Exposes CRUD operations for the **Good** model. * Example usage: @@ -236,16 +376,6 @@ export interface PrismaClient< */ get goodCategory(): Prisma.GoodCategoryDelegate; - /** - * `prisma.triggerLog`: Exposes CRUD operations for the **TriggerLog** model. - * Example usage: - * ```ts - * // Fetch zero or more TriggerLogs - * const triggerLogs = await prisma.triggerLog.findMany() - * ``` - */ - get triggerLog(): Prisma.TriggerLogDelegate; - /** * `prisma.salesInvoice`: Exposes CRUD operations for the **SalesInvoice** model. * Example usage: diff --git a/src/generated/prisma/internal/prismaNamespace.ts b/src/generated/prisma/internal/prismaNamespace.ts index d59dcba..5fc9b3d 100644 --- a/src/generated/prisma/internal/prismaNamespace.ts +++ b/src/generated/prisma/internal/prismaNamespace.ts @@ -384,13 +384,26 @@ type FieldRefInputType = Model extends never ? never : FieldRe export const ModelName = { + Token: 'Token', + VerificationCode: 'VerificationCode', + Guild: 'Guild', + BusinessActivity: 'BusinessActivity', + Complex: 'Complex', + Pos: 'Pos', + DeviceBrand: 'DeviceBrand', + Device: 'Device', + License: 'License', + Partner: 'Partner', + User: 'User', + Account: 'Account', + Provider: 'Provider', + TriggerLog: 'TriggerLog', + UserDevices: 'UserDevices', Customer: 'Customer', CustomerIndividual: 'CustomerIndividual', CustomerLegal: 'CustomerLegal', - Device: 'Device', Good: 'Good', GoodCategory: 'GoodCategory', - TriggerLog: 'TriggerLog', SalesInvoice: 'SalesInvoice', SalesInvoiceItem: 'SalesInvoiceItem', SalesInvoicePayment: 'SalesInvoicePayment', @@ -411,10 +424,1000 @@ export type TypeMap + fields: Prisma.TokenFieldRefs + operations: { + findUnique: { + args: Prisma.TokenFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.TokenFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.TokenFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.TokenFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.TokenFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.TokenCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.TokenCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.TokenDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.TokenUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.TokenDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.TokenUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.TokenUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.TokenAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.TokenGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.TokenCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + VerificationCode: { + payload: Prisma.$VerificationCodePayload + fields: Prisma.VerificationCodeFieldRefs + operations: { + findUnique: { + args: Prisma.VerificationCodeFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.VerificationCodeFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.VerificationCodeFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.VerificationCodeFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.VerificationCodeFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.VerificationCodeCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.VerificationCodeCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.VerificationCodeDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.VerificationCodeUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.VerificationCodeDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.VerificationCodeUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.VerificationCodeUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.VerificationCodeAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.VerificationCodeGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.VerificationCodeCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Guild: { + payload: Prisma.$GuildPayload + fields: Prisma.GuildFieldRefs + operations: { + findUnique: { + args: Prisma.GuildFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.GuildFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.GuildFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.GuildFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.GuildFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.GuildCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.GuildCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.GuildDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.GuildUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.GuildDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.GuildUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.GuildUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.GuildAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.GuildGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.GuildCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + BusinessActivity: { + payload: Prisma.$BusinessActivityPayload + fields: Prisma.BusinessActivityFieldRefs + operations: { + findUnique: { + args: Prisma.BusinessActivityFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.BusinessActivityFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.BusinessActivityFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.BusinessActivityFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.BusinessActivityFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.BusinessActivityCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.BusinessActivityCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.BusinessActivityDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.BusinessActivityUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.BusinessActivityDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.BusinessActivityUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.BusinessActivityUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.BusinessActivityAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.BusinessActivityGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.BusinessActivityCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Complex: { + payload: Prisma.$ComplexPayload + fields: Prisma.ComplexFieldRefs + operations: { + findUnique: { + args: Prisma.ComplexFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.ComplexFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.ComplexFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.ComplexFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.ComplexFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.ComplexCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.ComplexCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.ComplexDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.ComplexUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.ComplexDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.ComplexUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.ComplexUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.ComplexAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.ComplexGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.ComplexCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Pos: { + payload: Prisma.$PosPayload + fields: Prisma.PosFieldRefs + operations: { + findUnique: { + args: Prisma.PosFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.PosFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.PosFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.PosFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.PosFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.PosCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.PosCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.PosDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.PosUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.PosDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.PosUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.PosUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.PosAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.PosGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.PosCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + DeviceBrand: { + payload: Prisma.$DeviceBrandPayload + fields: Prisma.DeviceBrandFieldRefs + operations: { + findUnique: { + args: Prisma.DeviceBrandFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.DeviceBrandFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.DeviceBrandFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.DeviceBrandFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.DeviceBrandFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.DeviceBrandCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.DeviceBrandCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.DeviceBrandDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.DeviceBrandUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.DeviceBrandDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.DeviceBrandUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.DeviceBrandUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.DeviceBrandAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.DeviceBrandGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.DeviceBrandCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Device: { + payload: Prisma.$DevicePayload + fields: Prisma.DeviceFieldRefs + operations: { + findUnique: { + args: Prisma.DeviceFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.DeviceFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.DeviceFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.DeviceFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.DeviceFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.DeviceCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.DeviceCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.DeviceDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.DeviceUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.DeviceDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.DeviceUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.DeviceUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.DeviceAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.DeviceGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.DeviceCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + License: { + payload: Prisma.$LicensePayload + fields: Prisma.LicenseFieldRefs + operations: { + findUnique: { + args: Prisma.LicenseFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.LicenseFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.LicenseFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.LicenseFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.LicenseFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.LicenseCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.LicenseCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.LicenseDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.LicenseUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.LicenseDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.LicenseUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.LicenseUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.LicenseAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.LicenseGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.LicenseCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Partner: { + payload: Prisma.$PartnerPayload + fields: Prisma.PartnerFieldRefs + operations: { + findUnique: { + args: Prisma.PartnerFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.PartnerFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.PartnerFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.PartnerFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.PartnerFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.PartnerCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.PartnerCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.PartnerDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.PartnerUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.PartnerDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.PartnerUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.PartnerUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.PartnerAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.PartnerGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.PartnerCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + User: { + payload: Prisma.$UserPayload + fields: Prisma.UserFieldRefs + operations: { + findUnique: { + args: Prisma.UserFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.UserFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.UserFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.UserFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.UserFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.UserCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.UserCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.UserDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.UserUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.UserDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.UserUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.UserUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.UserAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.UserGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.UserCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Account: { + payload: Prisma.$AccountPayload + fields: Prisma.AccountFieldRefs + operations: { + findUnique: { + args: Prisma.AccountFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.AccountFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.AccountFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.AccountFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.AccountFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.AccountCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.AccountCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.AccountDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.AccountUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.AccountDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.AccountUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.AccountUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.AccountAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.AccountGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.AccountCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Provider: { + payload: Prisma.$ProviderPayload + fields: Prisma.ProviderFieldRefs + operations: { + findUnique: { + args: Prisma.ProviderFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.ProviderFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.ProviderFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.ProviderFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.ProviderFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.ProviderCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.ProviderCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.ProviderDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.ProviderUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.ProviderDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.ProviderUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.ProviderUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.ProviderAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.ProviderGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.ProviderCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + TriggerLog: { + payload: Prisma.$TriggerLogPayload + fields: Prisma.TriggerLogFieldRefs + operations: { + findUnique: { + args: Prisma.TriggerLogFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.TriggerLogFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.TriggerLogFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.TriggerLogFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.TriggerLogFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.TriggerLogCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.TriggerLogCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.TriggerLogDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.TriggerLogUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.TriggerLogDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.TriggerLogUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.TriggerLogUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.TriggerLogAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.TriggerLogGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.TriggerLogCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + UserDevices: { + payload: Prisma.$UserDevicesPayload + fields: Prisma.UserDevicesFieldRefs + operations: { + findUnique: { + args: Prisma.UserDevicesFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.UserDevicesFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.UserDevicesFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.UserDevicesFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.UserDevicesFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.UserDevicesCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.UserDevicesCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.UserDevicesDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.UserDevicesUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.UserDevicesDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.UserDevicesUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.UserDevicesUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.UserDevicesAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.UserDevicesGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.UserDevicesCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } Customer: { payload: Prisma.$CustomerPayload fields: Prisma.CustomerFieldRefs @@ -613,72 +1616,6 @@ export type TypeMap - fields: Prisma.DeviceFieldRefs - operations: { - findUnique: { - args: Prisma.DeviceFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.DeviceFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.DeviceFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.DeviceFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.DeviceFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.DeviceCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.DeviceCreateManyArgs - result: BatchPayload - } - delete: { - args: Prisma.DeviceDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.DeviceUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.DeviceDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.DeviceUpdateManyArgs - result: BatchPayload - } - upsert: { - args: Prisma.DeviceUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.DeviceAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.DeviceGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.DeviceCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } Good: { payload: Prisma.$GoodPayload fields: Prisma.GoodFieldRefs @@ -811,72 +1748,6 @@ export type TypeMap - fields: Prisma.TriggerLogFieldRefs - operations: { - findUnique: { - args: Prisma.TriggerLogFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.TriggerLogFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.TriggerLogFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.TriggerLogFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.TriggerLogFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.TriggerLogCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.TriggerLogCreateManyArgs - result: BatchPayload - } - delete: { - args: Prisma.TriggerLogDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.TriggerLogUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.TriggerLogDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.TriggerLogUpdateManyArgs - result: BatchPayload - } - upsert: { - args: Prisma.TriggerLogUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.TriggerLogAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.TriggerLogGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.TriggerLogCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } SalesInvoice: { payload: Prisma.$SalesInvoicePayload fields: Prisma.SalesInvoiceFieldRefs @@ -1246,6 +2117,187 @@ export const TransactionIsolationLevel = runtime.makeStrictEnum({ export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] +export const TokenScalarFieldEnum = { + id: 'id', + token: 'token', + type: 'type', + created_at: 'created_at', + expires_at: 'expires_at', + account_id: 'account_id' +} as const + +export type TokenScalarFieldEnum = (typeof TokenScalarFieldEnum)[keyof typeof TokenScalarFieldEnum] + + +export const VerificationCodeScalarFieldEnum = { + id: 'id', + code: 'code', + is_used: 'is_used', + created_at: 'created_at', + expires_at: 'expires_at', + account_id: 'account_id' +} as const + +export type VerificationCodeScalarFieldEnum = (typeof VerificationCodeScalarFieldEnum)[keyof typeof VerificationCodeScalarFieldEnum] + + +export const GuildScalarFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type GuildScalarFieldEnum = (typeof GuildScalarFieldEnum)[keyof typeof GuildScalarFieldEnum] + + +export const BusinessActivityScalarFieldEnum = { + id: 'id', + name: 'name', + created_at: 'created_at', + guild_id: 'guild_id', + owner_id: 'owner_id' +} as const + +export type BusinessActivityScalarFieldEnum = (typeof BusinessActivityScalarFieldEnum)[keyof typeof BusinessActivityScalarFieldEnum] + + +export const ComplexScalarFieldEnum = { + id: 'id', + name: 'name', + address: 'address', + tax_id: 'tax_id', + business_activity_id: 'business_activity_id' +} as const + +export type ComplexScalarFieldEnum = (typeof ComplexScalarFieldEnum)[keyof typeof ComplexScalarFieldEnum] + + +export const PosScalarFieldEnum = { + id: 'id', + serial: 'serial', + model: 'model', + status: 'status', + pos_type: 'pos_type', + created_at: 'created_at', + updated_at: 'updated_at', + complex_id: 'complex_id', + device_id: 'device_id', + provider_id: 'provider_id' +} as const + +export type PosScalarFieldEnum = (typeof PosScalarFieldEnum)[keyof typeof PosScalarFieldEnum] + + +export const DeviceBrandScalarFieldEnum = { + id: 'id', + name: 'name', + created_at: 'created_at', + updated_at: 'updated_at' +} as const + +export type DeviceBrandScalarFieldEnum = (typeof DeviceBrandScalarFieldEnum)[keyof typeof DeviceBrandScalarFieldEnum] + + +export const DeviceScalarFieldEnum = { + id: 'id', + name: 'name', + os_version: 'os_version', + created_at: 'created_at', + updated_at: 'updated_at', + brand_id: 'brand_id' +} as const + +export type DeviceScalarFieldEnum = (typeof DeviceScalarFieldEnum)[keyof typeof DeviceScalarFieldEnum] + + +export const LicenseScalarFieldEnum = { + id: 'id', + starts_at: 'starts_at', + expires_at: 'expires_at', + status: 'status', + pos_id: 'pos_id', + partner_id: 'partner_id' +} as const + +export type LicenseScalarFieldEnum = (typeof LicenseScalarFieldEnum)[keyof typeof LicenseScalarFieldEnum] + + +export const PartnerScalarFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type PartnerScalarFieldEnum = (typeof PartnerScalarFieldEnum)[keyof typeof PartnerScalarFieldEnum] + + +export const UserScalarFieldEnum = { + id: 'id', + created_at: 'created_at', + mobile_number: 'mobile_number', + national_code: 'national_code', + first_name: 'first_name', + last_name: 'last_name' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const AccountScalarFieldEnum = { + id: 'id', + username: 'username', + type: 'type', + status: 'status', + password: 'password', + created_at: 'created_at', + user_id: 'user_id', + partner_id: 'partner_id', + business_id: 'business_id', + provider_id: 'provider_id', + pos_id: 'pos_id' +} as const + +export type AccountScalarFieldEnum = (typeof AccountScalarFieldEnum)[keyof typeof AccountScalarFieldEnum] + + +export const ProviderScalarFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type ProviderScalarFieldEnum = (typeof ProviderScalarFieldEnum)[keyof typeof ProviderScalarFieldEnum] + + +export const TriggerLogScalarFieldEnum = { + id: 'id', + message: 'message', + createdAt: 'createdAt', + name: 'name' +} as const + +export type TriggerLogScalarFieldEnum = (typeof TriggerLogScalarFieldEnum)[keyof typeof TriggerLogScalarFieldEnum] + + +export const UserDevicesScalarFieldEnum = { + account_id: 'account_id', + app_version: 'app_version', + build_number: 'build_number', + uuid: 'uuid', + platform: 'platform', + brand: 'brand', + model: 'model', + device: 'device', + os_version: 'os_version', + sdk_version: 'sdk_version', + release_number: 'release_number', + browser_name: 'browser_name', + fcm_token: 'fcm_token' +} as const + +export type UserDevicesScalarFieldEnum = (typeof UserDevicesScalarFieldEnum)[keyof typeof UserDevicesScalarFieldEnum] + + export const CustomerScalarFieldEnum = { id: 'id', created_at: 'created_at', @@ -1284,25 +2336,6 @@ export const CustomerLegalScalarFieldEnum = { export type CustomerLegalScalarFieldEnum = (typeof CustomerLegalScalarFieldEnum)[keyof typeof CustomerLegalScalarFieldEnum] -export const DeviceScalarFieldEnum = { - account_id: 'account_id', - app_version: 'app_version', - build_number: 'build_number', - uuid: 'uuid', - platform: 'platform', - brand: 'brand', - model: 'model', - device: 'device', - os_version: 'os_version', - sdk_version: 'sdk_version', - release_number: 'release_number', - browser_name: 'browser_name', - fcm_token: 'fcm_token' -} as const - -export type DeviceScalarFieldEnum = (typeof DeviceScalarFieldEnum)[keyof typeof DeviceScalarFieldEnum] - - export const GoodScalarFieldEnum = { id: 'id', name: 'name', @@ -1310,13 +2343,14 @@ export const GoodScalarFieldEnum = { sku: 'sku', local_sku: 'local_sku', barcode: 'barcode', + base_sale_price: 'base_sale_price', + is_default_guild_good: 'is_default_guild_good', created_at: 'created_at', updated_at: 'updated_at', deleted_at: 'deleted_at', + complex_id: 'complex_id', category_id: 'category_id', - base_sale_price: 'base_sale_price', - account_id: 'account_id', - complex_id: 'complex_id' + guild_id: 'guild_id' } as const export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum] @@ -1327,8 +2361,9 @@ export const GoodCategoryScalarFieldEnum = { name: 'name', description: 'description', image_url: 'image_url', - account_id: 'account_id', complex_id: 'complex_id', + is_default_guild_good: 'is_default_guild_good', + guild_id: 'guild_id', created_at: 'created_at', updated_at: 'updated_at', deleted_at: 'deleted_at' @@ -1337,16 +2372,6 @@ export const GoodCategoryScalarFieldEnum = { export type GoodCategoryScalarFieldEnum = (typeof GoodCategoryScalarFieldEnum)[keyof typeof GoodCategoryScalarFieldEnum] -export const TriggerLogScalarFieldEnum = { - id: 'id', - message: 'message', - createdAt: 'createdAt', - name: 'name' -} as const - -export type TriggerLogScalarFieldEnum = (typeof TriggerLogScalarFieldEnum)[keyof typeof TriggerLogScalarFieldEnum] - - export const SalesInvoiceScalarFieldEnum = { id: 'id', code: 'code', @@ -1373,7 +2398,6 @@ export const SalesInvoiceItemScalarFieldEnum = { created_at: 'created_at', discount: 'discount', notes: 'notes', - pricingModel: 'pricingModel', invoice_id: 'invoice_id', good_id: 'good_id', service_id: 'service_id', @@ -1445,6 +2469,24 @@ export const NullableJsonNullValueInput = { export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput] +export const TokenOrderByRelevanceFieldEnum = { + id: 'id', + token: 'token', + account_id: 'account_id' +} as const + +export type TokenOrderByRelevanceFieldEnum = (typeof TokenOrderByRelevanceFieldEnum)[keyof typeof TokenOrderByRelevanceFieldEnum] + + +export const VerificationCodeOrderByRelevanceFieldEnum = { + id: 'id', + code: 'code', + account_id: 'account_id' +} as const + +export type VerificationCodeOrderByRelevanceFieldEnum = (typeof VerificationCodeOrderByRelevanceFieldEnum)[keyof typeof VerificationCodeOrderByRelevanceFieldEnum] + + export const NullsOrder = { first: 'first', last: 'last' @@ -1453,6 +2495,145 @@ export const NullsOrder = { export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] +export const GuildOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type GuildOrderByRelevanceFieldEnum = (typeof GuildOrderByRelevanceFieldEnum)[keyof typeof GuildOrderByRelevanceFieldEnum] + + +export const BusinessActivityOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + guild_id: 'guild_id', + owner_id: 'owner_id' +} as const + +export type BusinessActivityOrderByRelevanceFieldEnum = (typeof BusinessActivityOrderByRelevanceFieldEnum)[keyof typeof BusinessActivityOrderByRelevanceFieldEnum] + + +export const ComplexOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + address: 'address', + tax_id: 'tax_id', + business_activity_id: 'business_activity_id' +} as const + +export type ComplexOrderByRelevanceFieldEnum = (typeof ComplexOrderByRelevanceFieldEnum)[keyof typeof ComplexOrderByRelevanceFieldEnum] + + +export const PosOrderByRelevanceFieldEnum = { + id: 'id', + serial: 'serial', + model: 'model', + complex_id: 'complex_id', + device_id: 'device_id', + provider_id: 'provider_id' +} as const + +export type PosOrderByRelevanceFieldEnum = (typeof PosOrderByRelevanceFieldEnum)[keyof typeof PosOrderByRelevanceFieldEnum] + + +export const DeviceBrandOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name' +} as const + +export type DeviceBrandOrderByRelevanceFieldEnum = (typeof DeviceBrandOrderByRelevanceFieldEnum)[keyof typeof DeviceBrandOrderByRelevanceFieldEnum] + + +export const DeviceOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + os_version: 'os_version', + brand_id: 'brand_id' +} as const + +export type DeviceOrderByRelevanceFieldEnum = (typeof DeviceOrderByRelevanceFieldEnum)[keyof typeof DeviceOrderByRelevanceFieldEnum] + + +export const LicenseOrderByRelevanceFieldEnum = { + id: 'id', + pos_id: 'pos_id', + partner_id: 'partner_id' +} as const + +export type LicenseOrderByRelevanceFieldEnum = (typeof LicenseOrderByRelevanceFieldEnum)[keyof typeof LicenseOrderByRelevanceFieldEnum] + + +export const PartnerOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type PartnerOrderByRelevanceFieldEnum = (typeof PartnerOrderByRelevanceFieldEnum)[keyof typeof PartnerOrderByRelevanceFieldEnum] + + +export const UserOrderByRelevanceFieldEnum = { + id: 'id', + mobile_number: 'mobile_number', + national_code: 'national_code', + first_name: 'first_name', + last_name: 'last_name' +} as const + +export type UserOrderByRelevanceFieldEnum = (typeof UserOrderByRelevanceFieldEnum)[keyof typeof UserOrderByRelevanceFieldEnum] + + +export const AccountOrderByRelevanceFieldEnum = { + id: 'id', + username: 'username', + password: 'password', + user_id: 'user_id', + partner_id: 'partner_id', + business_id: 'business_id', + provider_id: 'provider_id', + pos_id: 'pos_id' +} as const + +export type AccountOrderByRelevanceFieldEnum = (typeof AccountOrderByRelevanceFieldEnum)[keyof typeof AccountOrderByRelevanceFieldEnum] + + +export const ProviderOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type ProviderOrderByRelevanceFieldEnum = (typeof ProviderOrderByRelevanceFieldEnum)[keyof typeof ProviderOrderByRelevanceFieldEnum] + + +export const TriggerLogOrderByRelevanceFieldEnum = { + message: 'message', + name: 'name' +} as const + +export type TriggerLogOrderByRelevanceFieldEnum = (typeof TriggerLogOrderByRelevanceFieldEnum)[keyof typeof TriggerLogOrderByRelevanceFieldEnum] + + +export const UserDevicesOrderByRelevanceFieldEnum = { + account_id: 'account_id', + app_version: 'app_version', + build_number: 'build_number', + uuid: 'uuid', + platform: 'platform', + brand: 'brand', + model: 'model', + device: 'device', + os_version: 'os_version', + sdk_version: 'sdk_version', + release_number: 'release_number', + browser_name: 'browser_name', + fcm_token: 'fcm_token' +} as const + +export type UserDevicesOrderByRelevanceFieldEnum = (typeof UserDevicesOrderByRelevanceFieldEnum)[keyof typeof UserDevicesOrderByRelevanceFieldEnum] + + export const CustomerOrderByRelevanceFieldEnum = { id: 'id', complex_id: 'complex_id' @@ -1486,25 +2667,6 @@ export const CustomerLegalOrderByRelevanceFieldEnum = { export type CustomerLegalOrderByRelevanceFieldEnum = (typeof CustomerLegalOrderByRelevanceFieldEnum)[keyof typeof CustomerLegalOrderByRelevanceFieldEnum] -export const DeviceOrderByRelevanceFieldEnum = { - account_id: 'account_id', - app_version: 'app_version', - build_number: 'build_number', - uuid: 'uuid', - platform: 'platform', - brand: 'brand', - model: 'model', - device: 'device', - os_version: 'os_version', - sdk_version: 'sdk_version', - release_number: 'release_number', - browser_name: 'browser_name', - fcm_token: 'fcm_token' -} as const - -export type DeviceOrderByRelevanceFieldEnum = (typeof DeviceOrderByRelevanceFieldEnum)[keyof typeof DeviceOrderByRelevanceFieldEnum] - - export const GoodOrderByRelevanceFieldEnum = { id: 'id', name: 'name', @@ -1512,9 +2674,9 @@ export const GoodOrderByRelevanceFieldEnum = { sku: 'sku', local_sku: 'local_sku', barcode: 'barcode', + complex_id: 'complex_id', category_id: 'category_id', - account_id: 'account_id', - complex_id: 'complex_id' + guild_id: 'guild_id' } as const export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum] @@ -1525,21 +2687,13 @@ export const GoodCategoryOrderByRelevanceFieldEnum = { name: 'name', description: 'description', image_url: 'image_url', - account_id: 'account_id', - complex_id: 'complex_id' + complex_id: 'complex_id', + guild_id: 'guild_id' } as const export type GoodCategoryOrderByRelevanceFieldEnum = (typeof GoodCategoryOrderByRelevanceFieldEnum)[keyof typeof GoodCategoryOrderByRelevanceFieldEnum] -export const TriggerLogOrderByRelevanceFieldEnum = { - message: 'message', - name: 'name' -} as const - -export type TriggerLogOrderByRelevanceFieldEnum = (typeof TriggerLogOrderByRelevanceFieldEnum)[keyof typeof TriggerLogOrderByRelevanceFieldEnum] - - export const JsonNullValueFilter = { DbNull: DbNull, JsonNull: JsonNull, @@ -1629,16 +2783,16 @@ export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, /** - * Reference to a field of type 'DateTime' + * Reference to a field of type 'TokenType' */ -export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> +export type EnumTokenTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'TokenType'> /** - * Reference to a field of type 'CustomerType' + * Reference to a field of type 'DateTime' */ -export type EnumCustomerTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CustomerType'> +export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> @@ -1650,9 +2804,37 @@ export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, /** - * Reference to a field of type 'Decimal' + * Reference to a field of type 'POSStatus' */ -export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Decimal'> +export type EnumPOSStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'POSStatus'> + + + +/** + * Reference to a field of type 'POSType' + */ +export type EnumPOSTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'POSType'> + + + +/** + * Reference to a field of type 'LicenseStatus' + */ +export type EnumLicenseStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'LicenseStatus'> + + + +/** + * Reference to a field of type 'AccountType' + */ +export type EnumAccountTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'AccountType'> + + + +/** + * Reference to a field of type 'AccountStatus' + */ +export type EnumAccountStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'AccountStatus'> @@ -1663,6 +2845,20 @@ export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'In +/** + * Reference to a field of type 'CustomerType' + */ +export type EnumCustomerTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CustomerType'> + + + +/** + * Reference to a field of type 'Decimal' + */ +export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Decimal'> + + + /** * Reference to a field of type 'Json' */ @@ -1684,13 +2880,6 @@ export type EnumUnitTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaM -/** - * Reference to a field of type 'SalesInvoiceItemPricingModel' - */ -export type EnumSalesInvoiceItemPricingModelFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'SalesInvoiceItemPricingModel'> - - - /** * Reference to a field of type 'PaymentMethodType' */ @@ -1799,13 +2988,26 @@ export type PrismaClientOptions = ({ comments?: runtime.SqlCommenterPlugin[] } export type GlobalOmitConfig = { + token?: Prisma.TokenOmit + verificationCode?: Prisma.VerificationCodeOmit + guild?: Prisma.GuildOmit + businessActivity?: Prisma.BusinessActivityOmit + complex?: Prisma.ComplexOmit + pos?: Prisma.PosOmit + deviceBrand?: Prisma.DeviceBrandOmit + device?: Prisma.DeviceOmit + license?: Prisma.LicenseOmit + partner?: Prisma.PartnerOmit + user?: Prisma.UserOmit + account?: Prisma.AccountOmit + provider?: Prisma.ProviderOmit + triggerLog?: Prisma.TriggerLogOmit + userDevices?: Prisma.UserDevicesOmit customer?: Prisma.CustomerOmit customerIndividual?: Prisma.CustomerIndividualOmit customerLegal?: Prisma.CustomerLegalOmit - device?: Prisma.DeviceOmit good?: Prisma.GoodOmit goodCategory?: Prisma.GoodCategoryOmit - triggerLog?: Prisma.TriggerLogOmit salesInvoice?: Prisma.SalesInvoiceOmit salesInvoiceItem?: Prisma.SalesInvoiceItemOmit salesInvoicePayment?: Prisma.SalesInvoicePaymentOmit diff --git a/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/generated/prisma/internal/prismaNamespaceBrowser.ts index 14ebf7e..c47aff2 100644 --- a/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -51,13 +51,26 @@ export const AnyNull = runtime.AnyNull export const ModelName = { + Token: 'Token', + VerificationCode: 'VerificationCode', + Guild: 'Guild', + BusinessActivity: 'BusinessActivity', + Complex: 'Complex', + Pos: 'Pos', + DeviceBrand: 'DeviceBrand', + Device: 'Device', + License: 'License', + Partner: 'Partner', + User: 'User', + Account: 'Account', + Provider: 'Provider', + TriggerLog: 'TriggerLog', + UserDevices: 'UserDevices', Customer: 'Customer', CustomerIndividual: 'CustomerIndividual', CustomerLegal: 'CustomerLegal', - Device: 'Device', Good: 'Good', GoodCategory: 'GoodCategory', - TriggerLog: 'TriggerLog', SalesInvoice: 'SalesInvoice', SalesInvoiceItem: 'SalesInvoiceItem', SalesInvoicePayment: 'SalesInvoicePayment', @@ -81,6 +94,187 @@ export const TransactionIsolationLevel = { export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] +export const TokenScalarFieldEnum = { + id: 'id', + token: 'token', + type: 'type', + created_at: 'created_at', + expires_at: 'expires_at', + account_id: 'account_id' +} as const + +export type TokenScalarFieldEnum = (typeof TokenScalarFieldEnum)[keyof typeof TokenScalarFieldEnum] + + +export const VerificationCodeScalarFieldEnum = { + id: 'id', + code: 'code', + is_used: 'is_used', + created_at: 'created_at', + expires_at: 'expires_at', + account_id: 'account_id' +} as const + +export type VerificationCodeScalarFieldEnum = (typeof VerificationCodeScalarFieldEnum)[keyof typeof VerificationCodeScalarFieldEnum] + + +export const GuildScalarFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type GuildScalarFieldEnum = (typeof GuildScalarFieldEnum)[keyof typeof GuildScalarFieldEnum] + + +export const BusinessActivityScalarFieldEnum = { + id: 'id', + name: 'name', + created_at: 'created_at', + guild_id: 'guild_id', + owner_id: 'owner_id' +} as const + +export type BusinessActivityScalarFieldEnum = (typeof BusinessActivityScalarFieldEnum)[keyof typeof BusinessActivityScalarFieldEnum] + + +export const ComplexScalarFieldEnum = { + id: 'id', + name: 'name', + address: 'address', + tax_id: 'tax_id', + business_activity_id: 'business_activity_id' +} as const + +export type ComplexScalarFieldEnum = (typeof ComplexScalarFieldEnum)[keyof typeof ComplexScalarFieldEnum] + + +export const PosScalarFieldEnum = { + id: 'id', + serial: 'serial', + model: 'model', + status: 'status', + pos_type: 'pos_type', + created_at: 'created_at', + updated_at: 'updated_at', + complex_id: 'complex_id', + device_id: 'device_id', + provider_id: 'provider_id' +} as const + +export type PosScalarFieldEnum = (typeof PosScalarFieldEnum)[keyof typeof PosScalarFieldEnum] + + +export const DeviceBrandScalarFieldEnum = { + id: 'id', + name: 'name', + created_at: 'created_at', + updated_at: 'updated_at' +} as const + +export type DeviceBrandScalarFieldEnum = (typeof DeviceBrandScalarFieldEnum)[keyof typeof DeviceBrandScalarFieldEnum] + + +export const DeviceScalarFieldEnum = { + id: 'id', + name: 'name', + os_version: 'os_version', + created_at: 'created_at', + updated_at: 'updated_at', + brand_id: 'brand_id' +} as const + +export type DeviceScalarFieldEnum = (typeof DeviceScalarFieldEnum)[keyof typeof DeviceScalarFieldEnum] + + +export const LicenseScalarFieldEnum = { + id: 'id', + starts_at: 'starts_at', + expires_at: 'expires_at', + status: 'status', + pos_id: 'pos_id', + partner_id: 'partner_id' +} as const + +export type LicenseScalarFieldEnum = (typeof LicenseScalarFieldEnum)[keyof typeof LicenseScalarFieldEnum] + + +export const PartnerScalarFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type PartnerScalarFieldEnum = (typeof PartnerScalarFieldEnum)[keyof typeof PartnerScalarFieldEnum] + + +export const UserScalarFieldEnum = { + id: 'id', + created_at: 'created_at', + mobile_number: 'mobile_number', + national_code: 'national_code', + first_name: 'first_name', + last_name: 'last_name' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const AccountScalarFieldEnum = { + id: 'id', + username: 'username', + type: 'type', + status: 'status', + password: 'password', + created_at: 'created_at', + user_id: 'user_id', + partner_id: 'partner_id', + business_id: 'business_id', + provider_id: 'provider_id', + pos_id: 'pos_id' +} as const + +export type AccountScalarFieldEnum = (typeof AccountScalarFieldEnum)[keyof typeof AccountScalarFieldEnum] + + +export const ProviderScalarFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type ProviderScalarFieldEnum = (typeof ProviderScalarFieldEnum)[keyof typeof ProviderScalarFieldEnum] + + +export const TriggerLogScalarFieldEnum = { + id: 'id', + message: 'message', + createdAt: 'createdAt', + name: 'name' +} as const + +export type TriggerLogScalarFieldEnum = (typeof TriggerLogScalarFieldEnum)[keyof typeof TriggerLogScalarFieldEnum] + + +export const UserDevicesScalarFieldEnum = { + account_id: 'account_id', + app_version: 'app_version', + build_number: 'build_number', + uuid: 'uuid', + platform: 'platform', + brand: 'brand', + model: 'model', + device: 'device', + os_version: 'os_version', + sdk_version: 'sdk_version', + release_number: 'release_number', + browser_name: 'browser_name', + fcm_token: 'fcm_token' +} as const + +export type UserDevicesScalarFieldEnum = (typeof UserDevicesScalarFieldEnum)[keyof typeof UserDevicesScalarFieldEnum] + + export const CustomerScalarFieldEnum = { id: 'id', created_at: 'created_at', @@ -119,25 +313,6 @@ export const CustomerLegalScalarFieldEnum = { export type CustomerLegalScalarFieldEnum = (typeof CustomerLegalScalarFieldEnum)[keyof typeof CustomerLegalScalarFieldEnum] -export const DeviceScalarFieldEnum = { - account_id: 'account_id', - app_version: 'app_version', - build_number: 'build_number', - uuid: 'uuid', - platform: 'platform', - brand: 'brand', - model: 'model', - device: 'device', - os_version: 'os_version', - sdk_version: 'sdk_version', - release_number: 'release_number', - browser_name: 'browser_name', - fcm_token: 'fcm_token' -} as const - -export type DeviceScalarFieldEnum = (typeof DeviceScalarFieldEnum)[keyof typeof DeviceScalarFieldEnum] - - export const GoodScalarFieldEnum = { id: 'id', name: 'name', @@ -145,13 +320,14 @@ export const GoodScalarFieldEnum = { sku: 'sku', local_sku: 'local_sku', barcode: 'barcode', + base_sale_price: 'base_sale_price', + is_default_guild_good: 'is_default_guild_good', created_at: 'created_at', updated_at: 'updated_at', deleted_at: 'deleted_at', + complex_id: 'complex_id', category_id: 'category_id', - base_sale_price: 'base_sale_price', - account_id: 'account_id', - complex_id: 'complex_id' + guild_id: 'guild_id' } as const export type GoodScalarFieldEnum = (typeof GoodScalarFieldEnum)[keyof typeof GoodScalarFieldEnum] @@ -162,8 +338,9 @@ export const GoodCategoryScalarFieldEnum = { name: 'name', description: 'description', image_url: 'image_url', - account_id: 'account_id', complex_id: 'complex_id', + is_default_guild_good: 'is_default_guild_good', + guild_id: 'guild_id', created_at: 'created_at', updated_at: 'updated_at', deleted_at: 'deleted_at' @@ -172,16 +349,6 @@ export const GoodCategoryScalarFieldEnum = { export type GoodCategoryScalarFieldEnum = (typeof GoodCategoryScalarFieldEnum)[keyof typeof GoodCategoryScalarFieldEnum] -export const TriggerLogScalarFieldEnum = { - id: 'id', - message: 'message', - createdAt: 'createdAt', - name: 'name' -} as const - -export type TriggerLogScalarFieldEnum = (typeof TriggerLogScalarFieldEnum)[keyof typeof TriggerLogScalarFieldEnum] - - export const SalesInvoiceScalarFieldEnum = { id: 'id', code: 'code', @@ -208,7 +375,6 @@ export const SalesInvoiceItemScalarFieldEnum = { created_at: 'created_at', discount: 'discount', notes: 'notes', - pricingModel: 'pricingModel', invoice_id: 'invoice_id', good_id: 'good_id', service_id: 'service_id', @@ -280,6 +446,24 @@ export const NullableJsonNullValueInput = { export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput] +export const TokenOrderByRelevanceFieldEnum = { + id: 'id', + token: 'token', + account_id: 'account_id' +} as const + +export type TokenOrderByRelevanceFieldEnum = (typeof TokenOrderByRelevanceFieldEnum)[keyof typeof TokenOrderByRelevanceFieldEnum] + + +export const VerificationCodeOrderByRelevanceFieldEnum = { + id: 'id', + code: 'code', + account_id: 'account_id' +} as const + +export type VerificationCodeOrderByRelevanceFieldEnum = (typeof VerificationCodeOrderByRelevanceFieldEnum)[keyof typeof VerificationCodeOrderByRelevanceFieldEnum] + + export const NullsOrder = { first: 'first', last: 'last' @@ -288,6 +472,145 @@ export const NullsOrder = { export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] +export const GuildOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type GuildOrderByRelevanceFieldEnum = (typeof GuildOrderByRelevanceFieldEnum)[keyof typeof GuildOrderByRelevanceFieldEnum] + + +export const BusinessActivityOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + guild_id: 'guild_id', + owner_id: 'owner_id' +} as const + +export type BusinessActivityOrderByRelevanceFieldEnum = (typeof BusinessActivityOrderByRelevanceFieldEnum)[keyof typeof BusinessActivityOrderByRelevanceFieldEnum] + + +export const ComplexOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + address: 'address', + tax_id: 'tax_id', + business_activity_id: 'business_activity_id' +} as const + +export type ComplexOrderByRelevanceFieldEnum = (typeof ComplexOrderByRelevanceFieldEnum)[keyof typeof ComplexOrderByRelevanceFieldEnum] + + +export const PosOrderByRelevanceFieldEnum = { + id: 'id', + serial: 'serial', + model: 'model', + complex_id: 'complex_id', + device_id: 'device_id', + provider_id: 'provider_id' +} as const + +export type PosOrderByRelevanceFieldEnum = (typeof PosOrderByRelevanceFieldEnum)[keyof typeof PosOrderByRelevanceFieldEnum] + + +export const DeviceBrandOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name' +} as const + +export type DeviceBrandOrderByRelevanceFieldEnum = (typeof DeviceBrandOrderByRelevanceFieldEnum)[keyof typeof DeviceBrandOrderByRelevanceFieldEnum] + + +export const DeviceOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + os_version: 'os_version', + brand_id: 'brand_id' +} as const + +export type DeviceOrderByRelevanceFieldEnum = (typeof DeviceOrderByRelevanceFieldEnum)[keyof typeof DeviceOrderByRelevanceFieldEnum] + + +export const LicenseOrderByRelevanceFieldEnum = { + id: 'id', + pos_id: 'pos_id', + partner_id: 'partner_id' +} as const + +export type LicenseOrderByRelevanceFieldEnum = (typeof LicenseOrderByRelevanceFieldEnum)[keyof typeof LicenseOrderByRelevanceFieldEnum] + + +export const PartnerOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type PartnerOrderByRelevanceFieldEnum = (typeof PartnerOrderByRelevanceFieldEnum)[keyof typeof PartnerOrderByRelevanceFieldEnum] + + +export const UserOrderByRelevanceFieldEnum = { + id: 'id', + mobile_number: 'mobile_number', + national_code: 'national_code', + first_name: 'first_name', + last_name: 'last_name' +} as const + +export type UserOrderByRelevanceFieldEnum = (typeof UserOrderByRelevanceFieldEnum)[keyof typeof UserOrderByRelevanceFieldEnum] + + +export const AccountOrderByRelevanceFieldEnum = { + id: 'id', + username: 'username', + password: 'password', + user_id: 'user_id', + partner_id: 'partner_id', + business_id: 'business_id', + provider_id: 'provider_id', + pos_id: 'pos_id' +} as const + +export type AccountOrderByRelevanceFieldEnum = (typeof AccountOrderByRelevanceFieldEnum)[keyof typeof AccountOrderByRelevanceFieldEnum] + + +export const ProviderOrderByRelevanceFieldEnum = { + id: 'id', + name: 'name', + code: 'code' +} as const + +export type ProviderOrderByRelevanceFieldEnum = (typeof ProviderOrderByRelevanceFieldEnum)[keyof typeof ProviderOrderByRelevanceFieldEnum] + + +export const TriggerLogOrderByRelevanceFieldEnum = { + message: 'message', + name: 'name' +} as const + +export type TriggerLogOrderByRelevanceFieldEnum = (typeof TriggerLogOrderByRelevanceFieldEnum)[keyof typeof TriggerLogOrderByRelevanceFieldEnum] + + +export const UserDevicesOrderByRelevanceFieldEnum = { + account_id: 'account_id', + app_version: 'app_version', + build_number: 'build_number', + uuid: 'uuid', + platform: 'platform', + brand: 'brand', + model: 'model', + device: 'device', + os_version: 'os_version', + sdk_version: 'sdk_version', + release_number: 'release_number', + browser_name: 'browser_name', + fcm_token: 'fcm_token' +} as const + +export type UserDevicesOrderByRelevanceFieldEnum = (typeof UserDevicesOrderByRelevanceFieldEnum)[keyof typeof UserDevicesOrderByRelevanceFieldEnum] + + export const CustomerOrderByRelevanceFieldEnum = { id: 'id', complex_id: 'complex_id' @@ -321,25 +644,6 @@ export const CustomerLegalOrderByRelevanceFieldEnum = { export type CustomerLegalOrderByRelevanceFieldEnum = (typeof CustomerLegalOrderByRelevanceFieldEnum)[keyof typeof CustomerLegalOrderByRelevanceFieldEnum] -export const DeviceOrderByRelevanceFieldEnum = { - account_id: 'account_id', - app_version: 'app_version', - build_number: 'build_number', - uuid: 'uuid', - platform: 'platform', - brand: 'brand', - model: 'model', - device: 'device', - os_version: 'os_version', - sdk_version: 'sdk_version', - release_number: 'release_number', - browser_name: 'browser_name', - fcm_token: 'fcm_token' -} as const - -export type DeviceOrderByRelevanceFieldEnum = (typeof DeviceOrderByRelevanceFieldEnum)[keyof typeof DeviceOrderByRelevanceFieldEnum] - - export const GoodOrderByRelevanceFieldEnum = { id: 'id', name: 'name', @@ -347,9 +651,9 @@ export const GoodOrderByRelevanceFieldEnum = { sku: 'sku', local_sku: 'local_sku', barcode: 'barcode', + complex_id: 'complex_id', category_id: 'category_id', - account_id: 'account_id', - complex_id: 'complex_id' + guild_id: 'guild_id' } as const export type GoodOrderByRelevanceFieldEnum = (typeof GoodOrderByRelevanceFieldEnum)[keyof typeof GoodOrderByRelevanceFieldEnum] @@ -360,21 +664,13 @@ export const GoodCategoryOrderByRelevanceFieldEnum = { name: 'name', description: 'description', image_url: 'image_url', - account_id: 'account_id', - complex_id: 'complex_id' + complex_id: 'complex_id', + guild_id: 'guild_id' } as const export type GoodCategoryOrderByRelevanceFieldEnum = (typeof GoodCategoryOrderByRelevanceFieldEnum)[keyof typeof GoodCategoryOrderByRelevanceFieldEnum] -export const TriggerLogOrderByRelevanceFieldEnum = { - message: 'message', - name: 'name' -} as const - -export type TriggerLogOrderByRelevanceFieldEnum = (typeof TriggerLogOrderByRelevanceFieldEnum)[keyof typeof TriggerLogOrderByRelevanceFieldEnum] - - export const JsonNullValueFilter = { DbNull: 'DbNull', JsonNull: 'JsonNull', diff --git a/src/generated/prisma/models.ts b/src/generated/prisma/models.ts index 8f5950b..817dc54 100644 --- a/src/generated/prisma/models.ts +++ b/src/generated/prisma/models.ts @@ -8,13 +8,26 @@ * * 🟢 You can import this file directly. */ +export type * from './models/Token.js' +export type * from './models/VerificationCode.js' +export type * from './models/Guild.js' +export type * from './models/BusinessActivity.js' +export type * from './models/Complex.js' +export type * from './models/Pos.js' +export type * from './models/DeviceBrand.js' +export type * from './models/Device.js' +export type * from './models/License.js' +export type * from './models/Partner.js' +export type * from './models/User.js' +export type * from './models/Account.js' +export type * from './models/Provider.js' +export type * from './models/TriggerLog.js' +export type * from './models/UserDevices.js' export type * from './models/Customer.js' export type * from './models/CustomerIndividual.js' export type * from './models/CustomerLegal.js' -export type * from './models/Device.js' export type * from './models/Good.js' export type * from './models/GoodCategory.js' -export type * from './models/TriggerLog.js' export type * from './models/SalesInvoice.js' export type * from './models/SalesInvoiceItem.js' export type * from './models/SalesInvoicePayment.js' diff --git a/src/generated/prisma/models/Account.ts b/src/generated/prisma/models/Account.ts new file mode 100644 index 0000000..ffecd88 --- /dev/null +++ b/src/generated/prisma/models/Account.ts @@ -0,0 +1,2443 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Account` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Account + * + */ +export type AccountModel = runtime.Types.Result.DefaultSelection + +export type AggregateAccount = { + _count: AccountCountAggregateOutputType | null + _min: AccountMinAggregateOutputType | null + _max: AccountMaxAggregateOutputType | null +} + +export type AccountMinAggregateOutputType = { + id: string | null + username: string | null + type: $Enums.AccountType | null + status: $Enums.AccountStatus | null + password: string | null + created_at: Date | null + user_id: string | null + partner_id: string | null + business_id: string | null + provider_id: string | null + pos_id: string | null +} + +export type AccountMaxAggregateOutputType = { + id: string | null + username: string | null + type: $Enums.AccountType | null + status: $Enums.AccountStatus | null + password: string | null + created_at: Date | null + user_id: string | null + partner_id: string | null + business_id: string | null + provider_id: string | null + pos_id: string | null +} + +export type AccountCountAggregateOutputType = { + id: number + username: number + type: number + status: number + password: number + created_at: number + user_id: number + partner_id: number + business_id: number + provider_id: number + pos_id: number + _all: number +} + + +export type AccountMinAggregateInputType = { + id?: true + username?: true + type?: true + status?: true + password?: true + created_at?: true + user_id?: true + partner_id?: true + business_id?: true + provider_id?: true + pos_id?: true +} + +export type AccountMaxAggregateInputType = { + id?: true + username?: true + type?: true + status?: true + password?: true + created_at?: true + user_id?: true + partner_id?: true + business_id?: true + provider_id?: true + pos_id?: true +} + +export type AccountCountAggregateInputType = { + id?: true + username?: true + type?: true + status?: true + password?: true + created_at?: true + user_id?: true + partner_id?: true + business_id?: true + provider_id?: true + pos_id?: true + _all?: true +} + +export type AccountAggregateArgs = { + /** + * Filter which Account to aggregate. + */ + where?: Prisma.AccountWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Accounts to fetch. + */ + orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.AccountWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Accounts from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Accounts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Accounts + **/ + _count?: true | AccountCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: AccountMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: AccountMaxAggregateInputType +} + +export type GetAccountAggregateType = { + [P in keyof T & keyof AggregateAccount]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type AccountGroupByArgs = { + where?: Prisma.AccountWhereInput + orderBy?: Prisma.AccountOrderByWithAggregationInput | Prisma.AccountOrderByWithAggregationInput[] + by: Prisma.AccountScalarFieldEnum[] | Prisma.AccountScalarFieldEnum + having?: Prisma.AccountScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: AccountCountAggregateInputType | true + _min?: AccountMinAggregateInputType + _max?: AccountMaxAggregateInputType +} + +export type AccountGroupByOutputType = { + id: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at: Date + user_id: string + partner_id: string | null + business_id: string | null + provider_id: string | null + pos_id: string | null + _count: AccountCountAggregateOutputType | null + _min: AccountMinAggregateOutputType | null + _max: AccountMaxAggregateOutputType | null +} + +type GetAccountGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof AccountGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type AccountWhereInput = { + AND?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[] + OR?: Prisma.AccountWhereInput[] + NOT?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[] + id?: Prisma.StringFilter<"Account"> | string + username?: Prisma.StringFilter<"Account"> | string + type?: Prisma.EnumAccountTypeFilter<"Account"> | $Enums.AccountType + status?: Prisma.EnumAccountStatusFilter<"Account"> | $Enums.AccountStatus + password?: Prisma.StringFilter<"Account"> | string + created_at?: Prisma.DateTimeFilter<"Account"> | Date | string + user_id?: Prisma.StringFilter<"Account"> | string + partner_id?: Prisma.StringNullableFilter<"Account"> | string | null + business_id?: Prisma.StringNullableFilter<"Account"> | string | null + provider_id?: Prisma.StringNullableFilter<"Account"> | string | null + pos_id?: Prisma.StringNullableFilter<"Account"> | string | null + user?: Prisma.XOR + partner?: Prisma.XOR | null + business?: Prisma.XOR | null + provider?: Prisma.XOR | null + pos?: Prisma.XOR | null + verification_codes?: Prisma.VerificationCodeListRelationFilter + tokens?: Prisma.TokenListRelationFilter +} + +export type AccountOrderByWithRelationInput = { + id?: Prisma.SortOrder + username?: Prisma.SortOrder + type?: Prisma.SortOrder + status?: Prisma.SortOrder + password?: Prisma.SortOrder + created_at?: Prisma.SortOrder + user_id?: Prisma.SortOrder + partner_id?: Prisma.SortOrderInput | Prisma.SortOrder + business_id?: Prisma.SortOrderInput | Prisma.SortOrder + provider_id?: Prisma.SortOrderInput | Prisma.SortOrder + pos_id?: Prisma.SortOrderInput | Prisma.SortOrder + user?: Prisma.UserOrderByWithRelationInput + partner?: Prisma.PartnerOrderByWithRelationInput + business?: Prisma.BusinessActivityOrderByWithRelationInput + provider?: Prisma.ProviderOrderByWithRelationInput + pos?: Prisma.PosOrderByWithRelationInput + verification_codes?: Prisma.VerificationCodeOrderByRelationAggregateInput + tokens?: Prisma.TokenOrderByRelationAggregateInput + _relevance?: Prisma.AccountOrderByRelevanceInput +} + +export type AccountWhereUniqueInput = Prisma.AtLeast<{ + id?: string + username?: string + AND?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[] + OR?: Prisma.AccountWhereInput[] + NOT?: Prisma.AccountWhereInput | Prisma.AccountWhereInput[] + type?: Prisma.EnumAccountTypeFilter<"Account"> | $Enums.AccountType + status?: Prisma.EnumAccountStatusFilter<"Account"> | $Enums.AccountStatus + password?: Prisma.StringFilter<"Account"> | string + created_at?: Prisma.DateTimeFilter<"Account"> | Date | string + user_id?: Prisma.StringFilter<"Account"> | string + partner_id?: Prisma.StringNullableFilter<"Account"> | string | null + business_id?: Prisma.StringNullableFilter<"Account"> | string | null + provider_id?: Prisma.StringNullableFilter<"Account"> | string | null + pos_id?: Prisma.StringNullableFilter<"Account"> | string | null + user?: Prisma.XOR + partner?: Prisma.XOR | null + business?: Prisma.XOR | null + provider?: Prisma.XOR | null + pos?: Prisma.XOR | null + verification_codes?: Prisma.VerificationCodeListRelationFilter + tokens?: Prisma.TokenListRelationFilter +}, "id" | "username"> + +export type AccountOrderByWithAggregationInput = { + id?: Prisma.SortOrder + username?: Prisma.SortOrder + type?: Prisma.SortOrder + status?: Prisma.SortOrder + password?: Prisma.SortOrder + created_at?: Prisma.SortOrder + user_id?: Prisma.SortOrder + partner_id?: Prisma.SortOrderInput | Prisma.SortOrder + business_id?: Prisma.SortOrderInput | Prisma.SortOrder + provider_id?: Prisma.SortOrderInput | Prisma.SortOrder + pos_id?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.AccountCountOrderByAggregateInput + _max?: Prisma.AccountMaxOrderByAggregateInput + _min?: Prisma.AccountMinOrderByAggregateInput +} + +export type AccountScalarWhereWithAggregatesInput = { + AND?: Prisma.AccountScalarWhereWithAggregatesInput | Prisma.AccountScalarWhereWithAggregatesInput[] + OR?: Prisma.AccountScalarWhereWithAggregatesInput[] + NOT?: Prisma.AccountScalarWhereWithAggregatesInput | Prisma.AccountScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Account"> | string + username?: Prisma.StringWithAggregatesFilter<"Account"> | string + type?: Prisma.EnumAccountTypeWithAggregatesFilter<"Account"> | $Enums.AccountType + status?: Prisma.EnumAccountStatusWithAggregatesFilter<"Account"> | $Enums.AccountStatus + password?: Prisma.StringWithAggregatesFilter<"Account"> | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"Account"> | Date | string + user_id?: Prisma.StringWithAggregatesFilter<"Account"> | string + partner_id?: Prisma.StringNullableWithAggregatesFilter<"Account"> | string | null + business_id?: Prisma.StringNullableWithAggregatesFilter<"Account"> | string | null + provider_id?: Prisma.StringNullableWithAggregatesFilter<"Account"> | string | null + pos_id?: Prisma.StringNullableWithAggregatesFilter<"Account"> | string | null +} + +export type AccountCreateInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user: Prisma.UserCreateNestedOneWithoutAccountsInput + partner?: Prisma.PartnerCreateNestedOneWithoutAccountInput + business?: Prisma.BusinessActivityCreateNestedOneWithoutAccountsInput + provider?: Prisma.ProviderCreateNestedOneWithoutAccountsInput + pos?: Prisma.PosCreateNestedOneWithoutAccountsInput + verification_codes?: Prisma.VerificationCodeCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenCreateNestedManyWithoutAccountInput +} + +export type AccountUncheckedCreateInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + partner_id?: string | null + business_id?: string | null + provider_id?: string | null + pos_id?: string | null + verification_codes?: Prisma.VerificationCodeUncheckedCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenUncheckedCreateNestedManyWithoutAccountInput +} + +export type AccountUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutAccountsNestedInput + partner?: Prisma.PartnerUpdateOneWithoutAccountNestedInput + business?: Prisma.BusinessActivityUpdateOneWithoutAccountsNestedInput + provider?: Prisma.ProviderUpdateOneWithoutAccountsNestedInput + pos?: Prisma.PosUpdateOneWithoutAccountsNestedInput + verification_codes?: Prisma.VerificationCodeUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + verification_codes?: Prisma.VerificationCodeUncheckedUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUncheckedUpdateManyWithoutAccountNestedInput +} + +export type AccountCreateManyInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + partner_id?: string | null + business_id?: string | null + provider_id?: string | null + pos_id?: string | null +} + +export type AccountUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type AccountUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type AccountScalarRelationFilter = { + is?: Prisma.AccountWhereInput + isNot?: Prisma.AccountWhereInput +} + +export type AccountListRelationFilter = { + every?: Prisma.AccountWhereInput + some?: Prisma.AccountWhereInput + none?: Prisma.AccountWhereInput +} + +export type AccountOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type AccountOrderByRelevanceInput = { + fields: Prisma.AccountOrderByRelevanceFieldEnum | Prisma.AccountOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type AccountCountOrderByAggregateInput = { + id?: Prisma.SortOrder + username?: Prisma.SortOrder + type?: Prisma.SortOrder + status?: Prisma.SortOrder + password?: Prisma.SortOrder + created_at?: Prisma.SortOrder + user_id?: Prisma.SortOrder + partner_id?: Prisma.SortOrder + business_id?: Prisma.SortOrder + provider_id?: Prisma.SortOrder + pos_id?: Prisma.SortOrder +} + +export type AccountMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + username?: Prisma.SortOrder + type?: Prisma.SortOrder + status?: Prisma.SortOrder + password?: Prisma.SortOrder + created_at?: Prisma.SortOrder + user_id?: Prisma.SortOrder + partner_id?: Prisma.SortOrder + business_id?: Prisma.SortOrder + provider_id?: Prisma.SortOrder + pos_id?: Prisma.SortOrder +} + +export type AccountMinOrderByAggregateInput = { + id?: Prisma.SortOrder + username?: Prisma.SortOrder + type?: Prisma.SortOrder + status?: Prisma.SortOrder + password?: Prisma.SortOrder + created_at?: Prisma.SortOrder + user_id?: Prisma.SortOrder + partner_id?: Prisma.SortOrder + business_id?: Prisma.SortOrder + provider_id?: Prisma.SortOrder + pos_id?: Prisma.SortOrder +} + +export type AccountCreateNestedOneWithoutTokensInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutTokensInput + connect?: Prisma.AccountWhereUniqueInput +} + +export type AccountUpdateOneRequiredWithoutTokensNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutTokensInput + upsert?: Prisma.AccountUpsertWithoutTokensInput + connect?: Prisma.AccountWhereUniqueInput + update?: Prisma.XOR, Prisma.AccountUncheckedUpdateWithoutTokensInput> +} + +export type AccountCreateNestedOneWithoutVerification_codesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutVerification_codesInput + connect?: Prisma.AccountWhereUniqueInput +} + +export type AccountUpdateOneRequiredWithoutVerification_codesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutVerification_codesInput + upsert?: Prisma.AccountUpsertWithoutVerification_codesInput + connect?: Prisma.AccountWhereUniqueInput + update?: Prisma.XOR, Prisma.AccountUncheckedUpdateWithoutVerification_codesInput> +} + +export type AccountCreateNestedManyWithoutBusinessInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutBusinessInput[] | Prisma.AccountUncheckedCreateWithoutBusinessInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutBusinessInput | Prisma.AccountCreateOrConnectWithoutBusinessInput[] + createMany?: Prisma.AccountCreateManyBusinessInputEnvelope + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] +} + +export type AccountUncheckedCreateNestedManyWithoutBusinessInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutBusinessInput[] | Prisma.AccountUncheckedCreateWithoutBusinessInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutBusinessInput | Prisma.AccountCreateOrConnectWithoutBusinessInput[] + createMany?: Prisma.AccountCreateManyBusinessInputEnvelope + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] +} + +export type AccountUpdateManyWithoutBusinessNestedInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutBusinessInput[] | Prisma.AccountUncheckedCreateWithoutBusinessInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutBusinessInput | Prisma.AccountCreateOrConnectWithoutBusinessInput[] + upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutBusinessInput | Prisma.AccountUpsertWithWhereUniqueWithoutBusinessInput[] + createMany?: Prisma.AccountCreateManyBusinessInputEnvelope + set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + update?: Prisma.AccountUpdateWithWhereUniqueWithoutBusinessInput | Prisma.AccountUpdateWithWhereUniqueWithoutBusinessInput[] + updateMany?: Prisma.AccountUpdateManyWithWhereWithoutBusinessInput | Prisma.AccountUpdateManyWithWhereWithoutBusinessInput[] + deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] +} + +export type AccountUncheckedUpdateManyWithoutBusinessNestedInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutBusinessInput[] | Prisma.AccountUncheckedCreateWithoutBusinessInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutBusinessInput | Prisma.AccountCreateOrConnectWithoutBusinessInput[] + upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutBusinessInput | Prisma.AccountUpsertWithWhereUniqueWithoutBusinessInput[] + createMany?: Prisma.AccountCreateManyBusinessInputEnvelope + set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + update?: Prisma.AccountUpdateWithWhereUniqueWithoutBusinessInput | Prisma.AccountUpdateWithWhereUniqueWithoutBusinessInput[] + updateMany?: Prisma.AccountUpdateManyWithWhereWithoutBusinessInput | Prisma.AccountUpdateManyWithWhereWithoutBusinessInput[] + deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] +} + +export type AccountCreateNestedManyWithoutPosInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutPosInput[] | Prisma.AccountUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutPosInput | Prisma.AccountCreateOrConnectWithoutPosInput[] + createMany?: Prisma.AccountCreateManyPosInputEnvelope + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] +} + +export type AccountUncheckedCreateNestedManyWithoutPosInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutPosInput[] | Prisma.AccountUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutPosInput | Prisma.AccountCreateOrConnectWithoutPosInput[] + createMany?: Prisma.AccountCreateManyPosInputEnvelope + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] +} + +export type AccountUpdateManyWithoutPosNestedInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutPosInput[] | Prisma.AccountUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutPosInput | Prisma.AccountCreateOrConnectWithoutPosInput[] + upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutPosInput | Prisma.AccountUpsertWithWhereUniqueWithoutPosInput[] + createMany?: Prisma.AccountCreateManyPosInputEnvelope + set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + update?: Prisma.AccountUpdateWithWhereUniqueWithoutPosInput | Prisma.AccountUpdateWithWhereUniqueWithoutPosInput[] + updateMany?: Prisma.AccountUpdateManyWithWhereWithoutPosInput | Prisma.AccountUpdateManyWithWhereWithoutPosInput[] + deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] +} + +export type AccountUncheckedUpdateManyWithoutPosNestedInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutPosInput[] | Prisma.AccountUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutPosInput | Prisma.AccountCreateOrConnectWithoutPosInput[] + upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutPosInput | Prisma.AccountUpsertWithWhereUniqueWithoutPosInput[] + createMany?: Prisma.AccountCreateManyPosInputEnvelope + set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + update?: Prisma.AccountUpdateWithWhereUniqueWithoutPosInput | Prisma.AccountUpdateWithWhereUniqueWithoutPosInput[] + updateMany?: Prisma.AccountUpdateManyWithWhereWithoutPosInput | Prisma.AccountUpdateManyWithWhereWithoutPosInput[] + deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] +} + +export type AccountCreateNestedManyWithoutPartnerInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutPartnerInput[] | Prisma.AccountUncheckedCreateWithoutPartnerInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutPartnerInput | Prisma.AccountCreateOrConnectWithoutPartnerInput[] + createMany?: Prisma.AccountCreateManyPartnerInputEnvelope + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] +} + +export type AccountUncheckedCreateNestedManyWithoutPartnerInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutPartnerInput[] | Prisma.AccountUncheckedCreateWithoutPartnerInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutPartnerInput | Prisma.AccountCreateOrConnectWithoutPartnerInput[] + createMany?: Prisma.AccountCreateManyPartnerInputEnvelope + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] +} + +export type AccountUpdateManyWithoutPartnerNestedInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutPartnerInput[] | Prisma.AccountUncheckedCreateWithoutPartnerInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutPartnerInput | Prisma.AccountCreateOrConnectWithoutPartnerInput[] + upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutPartnerInput | Prisma.AccountUpsertWithWhereUniqueWithoutPartnerInput[] + createMany?: Prisma.AccountCreateManyPartnerInputEnvelope + set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + update?: Prisma.AccountUpdateWithWhereUniqueWithoutPartnerInput | Prisma.AccountUpdateWithWhereUniqueWithoutPartnerInput[] + updateMany?: Prisma.AccountUpdateManyWithWhereWithoutPartnerInput | Prisma.AccountUpdateManyWithWhereWithoutPartnerInput[] + deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] +} + +export type AccountUncheckedUpdateManyWithoutPartnerNestedInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutPartnerInput[] | Prisma.AccountUncheckedCreateWithoutPartnerInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutPartnerInput | Prisma.AccountCreateOrConnectWithoutPartnerInput[] + upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutPartnerInput | Prisma.AccountUpsertWithWhereUniqueWithoutPartnerInput[] + createMany?: Prisma.AccountCreateManyPartnerInputEnvelope + set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + update?: Prisma.AccountUpdateWithWhereUniqueWithoutPartnerInput | Prisma.AccountUpdateWithWhereUniqueWithoutPartnerInput[] + updateMany?: Prisma.AccountUpdateManyWithWhereWithoutPartnerInput | Prisma.AccountUpdateManyWithWhereWithoutPartnerInput[] + deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] +} + +export type AccountCreateNestedManyWithoutUserInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutUserInput[] | Prisma.AccountUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutUserInput | Prisma.AccountCreateOrConnectWithoutUserInput[] + createMany?: Prisma.AccountCreateManyUserInputEnvelope + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] +} + +export type AccountUncheckedCreateNestedManyWithoutUserInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutUserInput[] | Prisma.AccountUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutUserInput | Prisma.AccountCreateOrConnectWithoutUserInput[] + createMany?: Prisma.AccountCreateManyUserInputEnvelope + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] +} + +export type AccountUpdateManyWithoutUserNestedInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutUserInput[] | Prisma.AccountUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutUserInput | Prisma.AccountCreateOrConnectWithoutUserInput[] + upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutUserInput | Prisma.AccountUpsertWithWhereUniqueWithoutUserInput[] + createMany?: Prisma.AccountCreateManyUserInputEnvelope + set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + update?: Prisma.AccountUpdateWithWhereUniqueWithoutUserInput | Prisma.AccountUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: Prisma.AccountUpdateManyWithWhereWithoutUserInput | Prisma.AccountUpdateManyWithWhereWithoutUserInput[] + deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] +} + +export type AccountUncheckedUpdateManyWithoutUserNestedInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutUserInput[] | Prisma.AccountUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutUserInput | Prisma.AccountCreateOrConnectWithoutUserInput[] + upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutUserInput | Prisma.AccountUpsertWithWhereUniqueWithoutUserInput[] + createMany?: Prisma.AccountCreateManyUserInputEnvelope + set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + update?: Prisma.AccountUpdateWithWhereUniqueWithoutUserInput | Prisma.AccountUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: Prisma.AccountUpdateManyWithWhereWithoutUserInput | Prisma.AccountUpdateManyWithWhereWithoutUserInput[] + deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] +} + +export type EnumAccountTypeFieldUpdateOperationsInput = { + set?: $Enums.AccountType +} + +export type EnumAccountStatusFieldUpdateOperationsInput = { + set?: $Enums.AccountStatus +} + +export type AccountCreateNestedManyWithoutProviderInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutProviderInput[] | Prisma.AccountUncheckedCreateWithoutProviderInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutProviderInput | Prisma.AccountCreateOrConnectWithoutProviderInput[] + createMany?: Prisma.AccountCreateManyProviderInputEnvelope + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] +} + +export type AccountUncheckedCreateNestedManyWithoutProviderInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutProviderInput[] | Prisma.AccountUncheckedCreateWithoutProviderInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutProviderInput | Prisma.AccountCreateOrConnectWithoutProviderInput[] + createMany?: Prisma.AccountCreateManyProviderInputEnvelope + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] +} + +export type AccountUpdateManyWithoutProviderNestedInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutProviderInput[] | Prisma.AccountUncheckedCreateWithoutProviderInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutProviderInput | Prisma.AccountCreateOrConnectWithoutProviderInput[] + upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutProviderInput | Prisma.AccountUpsertWithWhereUniqueWithoutProviderInput[] + createMany?: Prisma.AccountCreateManyProviderInputEnvelope + set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + update?: Prisma.AccountUpdateWithWhereUniqueWithoutProviderInput | Prisma.AccountUpdateWithWhereUniqueWithoutProviderInput[] + updateMany?: Prisma.AccountUpdateManyWithWhereWithoutProviderInput | Prisma.AccountUpdateManyWithWhereWithoutProviderInput[] + deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] +} + +export type AccountUncheckedUpdateManyWithoutProviderNestedInput = { + create?: Prisma.XOR | Prisma.AccountCreateWithoutProviderInput[] | Prisma.AccountUncheckedCreateWithoutProviderInput[] + connectOrCreate?: Prisma.AccountCreateOrConnectWithoutProviderInput | Prisma.AccountCreateOrConnectWithoutProviderInput[] + upsert?: Prisma.AccountUpsertWithWhereUniqueWithoutProviderInput | Prisma.AccountUpsertWithWhereUniqueWithoutProviderInput[] + createMany?: Prisma.AccountCreateManyProviderInputEnvelope + set?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + disconnect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + delete?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + connect?: Prisma.AccountWhereUniqueInput | Prisma.AccountWhereUniqueInput[] + update?: Prisma.AccountUpdateWithWhereUniqueWithoutProviderInput | Prisma.AccountUpdateWithWhereUniqueWithoutProviderInput[] + updateMany?: Prisma.AccountUpdateManyWithWhereWithoutProviderInput | Prisma.AccountUpdateManyWithWhereWithoutProviderInput[] + deleteMany?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] +} + +export type AccountCreateWithoutTokensInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user: Prisma.UserCreateNestedOneWithoutAccountsInput + partner?: Prisma.PartnerCreateNestedOneWithoutAccountInput + business?: Prisma.BusinessActivityCreateNestedOneWithoutAccountsInput + provider?: Prisma.ProviderCreateNestedOneWithoutAccountsInput + pos?: Prisma.PosCreateNestedOneWithoutAccountsInput + verification_codes?: Prisma.VerificationCodeCreateNestedManyWithoutAccountInput +} + +export type AccountUncheckedCreateWithoutTokensInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + partner_id?: string | null + business_id?: string | null + provider_id?: string | null + pos_id?: string | null + verification_codes?: Prisma.VerificationCodeUncheckedCreateNestedManyWithoutAccountInput +} + +export type AccountCreateOrConnectWithoutTokensInput = { + where: Prisma.AccountWhereUniqueInput + create: Prisma.XOR +} + +export type AccountUpsertWithoutTokensInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.AccountWhereInput +} + +export type AccountUpdateToOneWithWhereWithoutTokensInput = { + where?: Prisma.AccountWhereInput + data: Prisma.XOR +} + +export type AccountUpdateWithoutTokensInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutAccountsNestedInput + partner?: Prisma.PartnerUpdateOneWithoutAccountNestedInput + business?: Prisma.BusinessActivityUpdateOneWithoutAccountsNestedInput + provider?: Prisma.ProviderUpdateOneWithoutAccountsNestedInput + pos?: Prisma.PosUpdateOneWithoutAccountsNestedInput + verification_codes?: Prisma.VerificationCodeUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateWithoutTokensInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + verification_codes?: Prisma.VerificationCodeUncheckedUpdateManyWithoutAccountNestedInput +} + +export type AccountCreateWithoutVerification_codesInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user: Prisma.UserCreateNestedOneWithoutAccountsInput + partner?: Prisma.PartnerCreateNestedOneWithoutAccountInput + business?: Prisma.BusinessActivityCreateNestedOneWithoutAccountsInput + provider?: Prisma.ProviderCreateNestedOneWithoutAccountsInput + pos?: Prisma.PosCreateNestedOneWithoutAccountsInput + tokens?: Prisma.TokenCreateNestedManyWithoutAccountInput +} + +export type AccountUncheckedCreateWithoutVerification_codesInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + partner_id?: string | null + business_id?: string | null + provider_id?: string | null + pos_id?: string | null + tokens?: Prisma.TokenUncheckedCreateNestedManyWithoutAccountInput +} + +export type AccountCreateOrConnectWithoutVerification_codesInput = { + where: Prisma.AccountWhereUniqueInput + create: Prisma.XOR +} + +export type AccountUpsertWithoutVerification_codesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.AccountWhereInput +} + +export type AccountUpdateToOneWithWhereWithoutVerification_codesInput = { + where?: Prisma.AccountWhereInput + data: Prisma.XOR +} + +export type AccountUpdateWithoutVerification_codesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutAccountsNestedInput + partner?: Prisma.PartnerUpdateOneWithoutAccountNestedInput + business?: Prisma.BusinessActivityUpdateOneWithoutAccountsNestedInput + provider?: Prisma.ProviderUpdateOneWithoutAccountsNestedInput + pos?: Prisma.PosUpdateOneWithoutAccountsNestedInput + tokens?: Prisma.TokenUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateWithoutVerification_codesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tokens?: Prisma.TokenUncheckedUpdateManyWithoutAccountNestedInput +} + +export type AccountCreateWithoutBusinessInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user: Prisma.UserCreateNestedOneWithoutAccountsInput + partner?: Prisma.PartnerCreateNestedOneWithoutAccountInput + provider?: Prisma.ProviderCreateNestedOneWithoutAccountsInput + pos?: Prisma.PosCreateNestedOneWithoutAccountsInput + verification_codes?: Prisma.VerificationCodeCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenCreateNestedManyWithoutAccountInput +} + +export type AccountUncheckedCreateWithoutBusinessInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + partner_id?: string | null + provider_id?: string | null + pos_id?: string | null + verification_codes?: Prisma.VerificationCodeUncheckedCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenUncheckedCreateNestedManyWithoutAccountInput +} + +export type AccountCreateOrConnectWithoutBusinessInput = { + where: Prisma.AccountWhereUniqueInput + create: Prisma.XOR +} + +export type AccountCreateManyBusinessInputEnvelope = { + data: Prisma.AccountCreateManyBusinessInput | Prisma.AccountCreateManyBusinessInput[] + skipDuplicates?: boolean +} + +export type AccountUpsertWithWhereUniqueWithoutBusinessInput = { + where: Prisma.AccountWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type AccountUpdateWithWhereUniqueWithoutBusinessInput = { + where: Prisma.AccountWhereUniqueInput + data: Prisma.XOR +} + +export type AccountUpdateManyWithWhereWithoutBusinessInput = { + where: Prisma.AccountScalarWhereInput + data: Prisma.XOR +} + +export type AccountScalarWhereInput = { + AND?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] + OR?: Prisma.AccountScalarWhereInput[] + NOT?: Prisma.AccountScalarWhereInput | Prisma.AccountScalarWhereInput[] + id?: Prisma.StringFilter<"Account"> | string + username?: Prisma.StringFilter<"Account"> | string + type?: Prisma.EnumAccountTypeFilter<"Account"> | $Enums.AccountType + status?: Prisma.EnumAccountStatusFilter<"Account"> | $Enums.AccountStatus + password?: Prisma.StringFilter<"Account"> | string + created_at?: Prisma.DateTimeFilter<"Account"> | Date | string + user_id?: Prisma.StringFilter<"Account"> | string + partner_id?: Prisma.StringNullableFilter<"Account"> | string | null + business_id?: Prisma.StringNullableFilter<"Account"> | string | null + provider_id?: Prisma.StringNullableFilter<"Account"> | string | null + pos_id?: Prisma.StringNullableFilter<"Account"> | string | null +} + +export type AccountCreateWithoutPosInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user: Prisma.UserCreateNestedOneWithoutAccountsInput + partner?: Prisma.PartnerCreateNestedOneWithoutAccountInput + business?: Prisma.BusinessActivityCreateNestedOneWithoutAccountsInput + provider?: Prisma.ProviderCreateNestedOneWithoutAccountsInput + verification_codes?: Prisma.VerificationCodeCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenCreateNestedManyWithoutAccountInput +} + +export type AccountUncheckedCreateWithoutPosInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + partner_id?: string | null + business_id?: string | null + provider_id?: string | null + verification_codes?: Prisma.VerificationCodeUncheckedCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenUncheckedCreateNestedManyWithoutAccountInput +} + +export type AccountCreateOrConnectWithoutPosInput = { + where: Prisma.AccountWhereUniqueInput + create: Prisma.XOR +} + +export type AccountCreateManyPosInputEnvelope = { + data: Prisma.AccountCreateManyPosInput | Prisma.AccountCreateManyPosInput[] + skipDuplicates?: boolean +} + +export type AccountUpsertWithWhereUniqueWithoutPosInput = { + where: Prisma.AccountWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type AccountUpdateWithWhereUniqueWithoutPosInput = { + where: Prisma.AccountWhereUniqueInput + data: Prisma.XOR +} + +export type AccountUpdateManyWithWhereWithoutPosInput = { + where: Prisma.AccountScalarWhereInput + data: Prisma.XOR +} + +export type AccountCreateWithoutPartnerInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user: Prisma.UserCreateNestedOneWithoutAccountsInput + business?: Prisma.BusinessActivityCreateNestedOneWithoutAccountsInput + provider?: Prisma.ProviderCreateNestedOneWithoutAccountsInput + pos?: Prisma.PosCreateNestedOneWithoutAccountsInput + verification_codes?: Prisma.VerificationCodeCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenCreateNestedManyWithoutAccountInput +} + +export type AccountUncheckedCreateWithoutPartnerInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + business_id?: string | null + provider_id?: string | null + pos_id?: string | null + verification_codes?: Prisma.VerificationCodeUncheckedCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenUncheckedCreateNestedManyWithoutAccountInput +} + +export type AccountCreateOrConnectWithoutPartnerInput = { + where: Prisma.AccountWhereUniqueInput + create: Prisma.XOR +} + +export type AccountCreateManyPartnerInputEnvelope = { + data: Prisma.AccountCreateManyPartnerInput | Prisma.AccountCreateManyPartnerInput[] + skipDuplicates?: boolean +} + +export type AccountUpsertWithWhereUniqueWithoutPartnerInput = { + where: Prisma.AccountWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type AccountUpdateWithWhereUniqueWithoutPartnerInput = { + where: Prisma.AccountWhereUniqueInput + data: Prisma.XOR +} + +export type AccountUpdateManyWithWhereWithoutPartnerInput = { + where: Prisma.AccountScalarWhereInput + data: Prisma.XOR +} + +export type AccountCreateWithoutUserInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + partner?: Prisma.PartnerCreateNestedOneWithoutAccountInput + business?: Prisma.BusinessActivityCreateNestedOneWithoutAccountsInput + provider?: Prisma.ProviderCreateNestedOneWithoutAccountsInput + pos?: Prisma.PosCreateNestedOneWithoutAccountsInput + verification_codes?: Prisma.VerificationCodeCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenCreateNestedManyWithoutAccountInput +} + +export type AccountUncheckedCreateWithoutUserInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + partner_id?: string | null + business_id?: string | null + provider_id?: string | null + pos_id?: string | null + verification_codes?: Prisma.VerificationCodeUncheckedCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenUncheckedCreateNestedManyWithoutAccountInput +} + +export type AccountCreateOrConnectWithoutUserInput = { + where: Prisma.AccountWhereUniqueInput + create: Prisma.XOR +} + +export type AccountCreateManyUserInputEnvelope = { + data: Prisma.AccountCreateManyUserInput | Prisma.AccountCreateManyUserInput[] + skipDuplicates?: boolean +} + +export type AccountUpsertWithWhereUniqueWithoutUserInput = { + where: Prisma.AccountWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type AccountUpdateWithWhereUniqueWithoutUserInput = { + where: Prisma.AccountWhereUniqueInput + data: Prisma.XOR +} + +export type AccountUpdateManyWithWhereWithoutUserInput = { + where: Prisma.AccountScalarWhereInput + data: Prisma.XOR +} + +export type AccountCreateWithoutProviderInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user: Prisma.UserCreateNestedOneWithoutAccountsInput + partner?: Prisma.PartnerCreateNestedOneWithoutAccountInput + business?: Prisma.BusinessActivityCreateNestedOneWithoutAccountsInput + pos?: Prisma.PosCreateNestedOneWithoutAccountsInput + verification_codes?: Prisma.VerificationCodeCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenCreateNestedManyWithoutAccountInput +} + +export type AccountUncheckedCreateWithoutProviderInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + partner_id?: string | null + business_id?: string | null + pos_id?: string | null + verification_codes?: Prisma.VerificationCodeUncheckedCreateNestedManyWithoutAccountInput + tokens?: Prisma.TokenUncheckedCreateNestedManyWithoutAccountInput +} + +export type AccountCreateOrConnectWithoutProviderInput = { + where: Prisma.AccountWhereUniqueInput + create: Prisma.XOR +} + +export type AccountCreateManyProviderInputEnvelope = { + data: Prisma.AccountCreateManyProviderInput | Prisma.AccountCreateManyProviderInput[] + skipDuplicates?: boolean +} + +export type AccountUpsertWithWhereUniqueWithoutProviderInput = { + where: Prisma.AccountWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type AccountUpdateWithWhereUniqueWithoutProviderInput = { + where: Prisma.AccountWhereUniqueInput + data: Prisma.XOR +} + +export type AccountUpdateManyWithWhereWithoutProviderInput = { + where: Prisma.AccountScalarWhereInput + data: Prisma.XOR +} + +export type AccountCreateManyBusinessInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + partner_id?: string | null + provider_id?: string | null + pos_id?: string | null +} + +export type AccountUpdateWithoutBusinessInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutAccountsNestedInput + partner?: Prisma.PartnerUpdateOneWithoutAccountNestedInput + provider?: Prisma.ProviderUpdateOneWithoutAccountsNestedInput + pos?: Prisma.PosUpdateOneWithoutAccountsNestedInput + verification_codes?: Prisma.VerificationCodeUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateWithoutBusinessInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + verification_codes?: Prisma.VerificationCodeUncheckedUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUncheckedUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateManyWithoutBusinessInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type AccountCreateManyPosInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + partner_id?: string | null + business_id?: string | null + provider_id?: string | null +} + +export type AccountUpdateWithoutPosInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutAccountsNestedInput + partner?: Prisma.PartnerUpdateOneWithoutAccountNestedInput + business?: Prisma.BusinessActivityUpdateOneWithoutAccountsNestedInput + provider?: Prisma.ProviderUpdateOneWithoutAccountsNestedInput + verification_codes?: Prisma.VerificationCodeUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateWithoutPosInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + verification_codes?: Prisma.VerificationCodeUncheckedUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUncheckedUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateManyWithoutPosInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type AccountCreateManyPartnerInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + business_id?: string | null + provider_id?: string | null + pos_id?: string | null +} + +export type AccountUpdateWithoutPartnerInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutAccountsNestedInput + business?: Prisma.BusinessActivityUpdateOneWithoutAccountsNestedInput + provider?: Prisma.ProviderUpdateOneWithoutAccountsNestedInput + pos?: Prisma.PosUpdateOneWithoutAccountsNestedInput + verification_codes?: Prisma.VerificationCodeUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateWithoutPartnerInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + verification_codes?: Prisma.VerificationCodeUncheckedUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUncheckedUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateManyWithoutPartnerInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type AccountCreateManyUserInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + partner_id?: string | null + business_id?: string | null + provider_id?: string | null + pos_id?: string | null +} + +export type AccountUpdateWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + partner?: Prisma.PartnerUpdateOneWithoutAccountNestedInput + business?: Prisma.BusinessActivityUpdateOneWithoutAccountsNestedInput + provider?: Prisma.ProviderUpdateOneWithoutAccountsNestedInput + pos?: Prisma.PosUpdateOneWithoutAccountsNestedInput + verification_codes?: Prisma.VerificationCodeUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + verification_codes?: Prisma.VerificationCodeUncheckedUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUncheckedUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateManyWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type AccountCreateManyProviderInput = { + id?: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at?: Date | string + user_id: string + partner_id?: string | null + business_id?: string | null + pos_id?: string | null +} + +export type AccountUpdateWithoutProviderInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutAccountsNestedInput + partner?: Prisma.PartnerUpdateOneWithoutAccountNestedInput + business?: Prisma.BusinessActivityUpdateOneWithoutAccountsNestedInput + pos?: Prisma.PosUpdateOneWithoutAccountsNestedInput + verification_codes?: Prisma.VerificationCodeUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateWithoutProviderInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + verification_codes?: Prisma.VerificationCodeUncheckedUpdateManyWithoutAccountNestedInput + tokens?: Prisma.TokenUncheckedUpdateManyWithoutAccountNestedInput +} + +export type AccountUncheckedUpdateManyWithoutProviderInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + username?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumAccountTypeFieldUpdateOperationsInput | $Enums.AccountType + status?: Prisma.EnumAccountStatusFieldUpdateOperationsInput | $Enums.AccountStatus + password?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + +/** + * Count Type AccountCountOutputType + */ + +export type AccountCountOutputType = { + verification_codes: number + tokens: number +} + +export type AccountCountOutputTypeSelect = { + verification_codes?: boolean | AccountCountOutputTypeCountVerification_codesArgs + tokens?: boolean | AccountCountOutputTypeCountTokensArgs +} + +/** + * AccountCountOutputType without action + */ +export type AccountCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the AccountCountOutputType + */ + select?: Prisma.AccountCountOutputTypeSelect | null +} + +/** + * AccountCountOutputType without action + */ +export type AccountCountOutputTypeCountVerification_codesArgs = { + where?: Prisma.VerificationCodeWhereInput +} + +/** + * AccountCountOutputType without action + */ +export type AccountCountOutputTypeCountTokensArgs = { + where?: Prisma.TokenWhereInput +} + + +export type AccountSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + username?: boolean + type?: boolean + status?: boolean + password?: boolean + created_at?: boolean + user_id?: boolean + partner_id?: boolean + business_id?: boolean + provider_id?: boolean + pos_id?: boolean + user?: boolean | Prisma.UserDefaultArgs + partner?: boolean | Prisma.Account$partnerArgs + business?: boolean | Prisma.Account$businessArgs + provider?: boolean | Prisma.Account$providerArgs + pos?: boolean | Prisma.Account$posArgs + verification_codes?: boolean | Prisma.Account$verification_codesArgs + tokens?: boolean | Prisma.Account$tokensArgs + _count?: boolean | Prisma.AccountCountOutputTypeDefaultArgs +}, ExtArgs["result"]["account"]> + + + +export type AccountSelectScalar = { + id?: boolean + username?: boolean + type?: boolean + status?: boolean + password?: boolean + created_at?: boolean + user_id?: boolean + partner_id?: boolean + business_id?: boolean + provider_id?: boolean + pos_id?: boolean +} + +export type AccountOmit = runtime.Types.Extensions.GetOmit<"id" | "username" | "type" | "status" | "password" | "created_at" | "user_id" | "partner_id" | "business_id" | "provider_id" | "pos_id", ExtArgs["result"]["account"]> +export type AccountInclude = { + user?: boolean | Prisma.UserDefaultArgs + partner?: boolean | Prisma.Account$partnerArgs + business?: boolean | Prisma.Account$businessArgs + provider?: boolean | Prisma.Account$providerArgs + pos?: boolean | Prisma.Account$posArgs + verification_codes?: boolean | Prisma.Account$verification_codesArgs + tokens?: boolean | Prisma.Account$tokensArgs + _count?: boolean | Prisma.AccountCountOutputTypeDefaultArgs +} + +export type $AccountPayload = { + name: "Account" + objects: { + user: Prisma.$UserPayload + partner: Prisma.$PartnerPayload | null + business: Prisma.$BusinessActivityPayload | null + provider: Prisma.$ProviderPayload | null + pos: Prisma.$PosPayload | null + verification_codes: Prisma.$VerificationCodePayload[] + tokens: Prisma.$TokenPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + username: string + type: $Enums.AccountType + status: $Enums.AccountStatus + password: string + created_at: Date + user_id: string + partner_id: string | null + business_id: string | null + provider_id: string | null + pos_id: string | null + }, ExtArgs["result"]["account"]> + composites: {} +} + +export type AccountGetPayload = runtime.Types.Result.GetResult + +export type AccountCountArgs = + Omit & { + select?: AccountCountAggregateInputType | true + } + +export interface AccountDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Account'], meta: { name: 'Account' } } + /** + * Find zero or one Account that matches the filter. + * @param {AccountFindUniqueArgs} args - Arguments to find a Account + * @example + * // Get one Account + * const account = await prisma.account.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Account that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {AccountFindUniqueOrThrowArgs} args - Arguments to find a Account + * @example + * // Get one Account + * const account = await prisma.account.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Account that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountFindFirstArgs} args - Arguments to find a Account + * @example + * // Get one Account + * const account = await prisma.account.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Account that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountFindFirstOrThrowArgs} args - Arguments to find a Account + * @example + * // Get one Account + * const account = await prisma.account.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Accounts that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Accounts + * const accounts = await prisma.account.findMany() + * + * // Get first 10 Accounts + * const accounts = await prisma.account.findMany({ take: 10 }) + * + * // Only select the `id` + * const accountWithIdOnly = await prisma.account.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Account. + * @param {AccountCreateArgs} args - Arguments to create a Account. + * @example + * // Create one Account + * const Account = await prisma.account.create({ + * data: { + * // ... data to create a Account + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Accounts. + * @param {AccountCreateManyArgs} args - Arguments to create many Accounts. + * @example + * // Create many Accounts + * const account = await prisma.account.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a Account. + * @param {AccountDeleteArgs} args - Arguments to delete one Account. + * @example + * // Delete one Account + * const Account = await prisma.account.delete({ + * where: { + * // ... filter to delete one Account + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Account. + * @param {AccountUpdateArgs} args - Arguments to update one Account. + * @example + * // Update one Account + * const account = await prisma.account.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Accounts. + * @param {AccountDeleteManyArgs} args - Arguments to filter Accounts to delete. + * @example + * // Delete a few Accounts + * const { count } = await prisma.account.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Accounts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Accounts + * const account = await prisma.account.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Account. + * @param {AccountUpsertArgs} args - Arguments to update or create a Account. + * @example + * // Update or create a Account + * const account = await prisma.account.upsert({ + * create: { + * // ... data to create a Account + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Account we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__AccountClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Accounts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountCountArgs} args - Arguments to filter Accounts to count. + * @example + * // Count the number of Accounts + * const count = await prisma.account.count({ + * where: { + * // ... the filter for the Accounts we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Account. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Account. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {AccountGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends AccountGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: AccountGroupByArgs['orderBy'] } + : { orderBy?: AccountGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetAccountGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Account model + */ +readonly fields: AccountFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Account. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__AccountClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + user = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + partner = {}>(args?: Prisma.Subset>): Prisma.Prisma__PartnerClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + business = {}>(args?: Prisma.Subset>): Prisma.Prisma__BusinessActivityClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + provider = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProviderClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + pos = {}>(args?: Prisma.Subset>): Prisma.Prisma__PosClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + verification_codes = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + tokens = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Account model + */ +export interface AccountFieldRefs { + readonly id: Prisma.FieldRef<"Account", 'String'> + readonly username: Prisma.FieldRef<"Account", 'String'> + readonly type: Prisma.FieldRef<"Account", 'AccountType'> + readonly status: Prisma.FieldRef<"Account", 'AccountStatus'> + readonly password: Prisma.FieldRef<"Account", 'String'> + readonly created_at: Prisma.FieldRef<"Account", 'DateTime'> + readonly user_id: Prisma.FieldRef<"Account", 'String'> + readonly partner_id: Prisma.FieldRef<"Account", 'String'> + readonly business_id: Prisma.FieldRef<"Account", 'String'> + readonly provider_id: Prisma.FieldRef<"Account", 'String'> + readonly pos_id: Prisma.FieldRef<"Account", 'String'> +} + + +// Custom InputTypes +/** + * Account findUnique + */ +export type AccountFindUniqueArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + /** + * Filter, which Account to fetch. + */ + where: Prisma.AccountWhereUniqueInput +} + +/** + * Account findUniqueOrThrow + */ +export type AccountFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + /** + * Filter, which Account to fetch. + */ + where: Prisma.AccountWhereUniqueInput +} + +/** + * Account findFirst + */ +export type AccountFindFirstArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + /** + * Filter, which Account to fetch. + */ + where?: Prisma.AccountWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Accounts to fetch. + */ + orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Accounts. + */ + cursor?: Prisma.AccountWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Accounts from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Accounts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Accounts. + */ + distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] +} + +/** + * Account findFirstOrThrow + */ +export type AccountFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + /** + * Filter, which Account to fetch. + */ + where?: Prisma.AccountWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Accounts to fetch. + */ + orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Accounts. + */ + cursor?: Prisma.AccountWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Accounts from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Accounts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Accounts. + */ + distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] +} + +/** + * Account findMany + */ +export type AccountFindManyArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + /** + * Filter, which Accounts to fetch. + */ + where?: Prisma.AccountWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Accounts to fetch. + */ + orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Accounts. + */ + cursor?: Prisma.AccountWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Accounts from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Accounts. + */ + skip?: number + distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] +} + +/** + * Account create + */ +export type AccountCreateArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + /** + * The data needed to create a Account. + */ + data: Prisma.XOR +} + +/** + * Account createMany + */ +export type AccountCreateManyArgs = { + /** + * The data used to create many Accounts. + */ + data: Prisma.AccountCreateManyInput | Prisma.AccountCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Account update + */ +export type AccountUpdateArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + /** + * The data needed to update a Account. + */ + data: Prisma.XOR + /** + * Choose, which Account to update. + */ + where: Prisma.AccountWhereUniqueInput +} + +/** + * Account updateMany + */ +export type AccountUpdateManyArgs = { + /** + * The data used to update Accounts. + */ + data: Prisma.XOR + /** + * Filter which Accounts to update + */ + where?: Prisma.AccountWhereInput + /** + * Limit how many Accounts to update. + */ + limit?: number +} + +/** + * Account upsert + */ +export type AccountUpsertArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + /** + * The filter to search for the Account to update in case it exists. + */ + where: Prisma.AccountWhereUniqueInput + /** + * In case the Account found by the `where` argument doesn't exist, create a new Account with this data. + */ + create: Prisma.XOR + /** + * In case the Account was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Account delete + */ +export type AccountDeleteArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + /** + * Filter which Account to delete. + */ + where: Prisma.AccountWhereUniqueInput +} + +/** + * Account deleteMany + */ +export type AccountDeleteManyArgs = { + /** + * Filter which Accounts to delete + */ + where?: Prisma.AccountWhereInput + /** + * Limit how many Accounts to delete. + */ + limit?: number +} + +/** + * Account.partner + */ +export type Account$partnerArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null + where?: Prisma.PartnerWhereInput +} + +/** + * Account.business + */ +export type Account$businessArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + where?: Prisma.BusinessActivityWhereInput +} + +/** + * Account.provider + */ +export type Account$providerArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + where?: Prisma.ProviderWhereInput +} + +/** + * Account.pos + */ +export type Account$posArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + where?: Prisma.PosWhereInput +} + +/** + * Account.verification_codes + */ +export type Account$verification_codesArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null + where?: Prisma.VerificationCodeWhereInput + orderBy?: Prisma.VerificationCodeOrderByWithRelationInput | Prisma.VerificationCodeOrderByWithRelationInput[] + cursor?: Prisma.VerificationCodeWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.VerificationCodeScalarFieldEnum | Prisma.VerificationCodeScalarFieldEnum[] +} + +/** + * Account.tokens + */ +export type Account$tokensArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null + where?: Prisma.TokenWhereInput + orderBy?: Prisma.TokenOrderByWithRelationInput | Prisma.TokenOrderByWithRelationInput[] + cursor?: Prisma.TokenWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.TokenScalarFieldEnum | Prisma.TokenScalarFieldEnum[] +} + +/** + * Account without action + */ +export type AccountDefaultArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null +} diff --git a/src/generated/prisma/models/BusinessActivity.ts b/src/generated/prisma/models/BusinessActivity.ts new file mode 100644 index 0000000..1b10131 --- /dev/null +++ b/src/generated/prisma/models/BusinessActivity.ts @@ -0,0 +1,1604 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `BusinessActivity` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model BusinessActivity + * + */ +export type BusinessActivityModel = runtime.Types.Result.DefaultSelection + +export type AggregateBusinessActivity = { + _count: BusinessActivityCountAggregateOutputType | null + _min: BusinessActivityMinAggregateOutputType | null + _max: BusinessActivityMaxAggregateOutputType | null +} + +export type BusinessActivityMinAggregateOutputType = { + id: string | null + name: string | null + created_at: Date | null + guild_id: string | null + owner_id: string | null +} + +export type BusinessActivityMaxAggregateOutputType = { + id: string | null + name: string | null + created_at: Date | null + guild_id: string | null + owner_id: string | null +} + +export type BusinessActivityCountAggregateOutputType = { + id: number + name: number + created_at: number + guild_id: number + owner_id: number + _all: number +} + + +export type BusinessActivityMinAggregateInputType = { + id?: true + name?: true + created_at?: true + guild_id?: true + owner_id?: true +} + +export type BusinessActivityMaxAggregateInputType = { + id?: true + name?: true + created_at?: true + guild_id?: true + owner_id?: true +} + +export type BusinessActivityCountAggregateInputType = { + id?: true + name?: true + created_at?: true + guild_id?: true + owner_id?: true + _all?: true +} + +export type BusinessActivityAggregateArgs = { + /** + * Filter which BusinessActivity to aggregate. + */ + where?: Prisma.BusinessActivityWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BusinessActivities to fetch. + */ + orderBy?: Prisma.BusinessActivityOrderByWithRelationInput | Prisma.BusinessActivityOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.BusinessActivityWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BusinessActivities from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` BusinessActivities. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned BusinessActivities + **/ + _count?: true | BusinessActivityCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: BusinessActivityMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: BusinessActivityMaxAggregateInputType +} + +export type GetBusinessActivityAggregateType = { + [P in keyof T & keyof AggregateBusinessActivity]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type BusinessActivityGroupByArgs = { + where?: Prisma.BusinessActivityWhereInput + orderBy?: Prisma.BusinessActivityOrderByWithAggregationInput | Prisma.BusinessActivityOrderByWithAggregationInput[] + by: Prisma.BusinessActivityScalarFieldEnum[] | Prisma.BusinessActivityScalarFieldEnum + having?: Prisma.BusinessActivityScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: BusinessActivityCountAggregateInputType | true + _min?: BusinessActivityMinAggregateInputType + _max?: BusinessActivityMaxAggregateInputType +} + +export type BusinessActivityGroupByOutputType = { + id: string + name: string + created_at: Date + guild_id: string + owner_id: string + _count: BusinessActivityCountAggregateOutputType | null + _min: BusinessActivityMinAggregateOutputType | null + _max: BusinessActivityMaxAggregateOutputType | null +} + +type GetBusinessActivityGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof BusinessActivityGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type BusinessActivityWhereInput = { + AND?: Prisma.BusinessActivityWhereInput | Prisma.BusinessActivityWhereInput[] + OR?: Prisma.BusinessActivityWhereInput[] + NOT?: Prisma.BusinessActivityWhereInput | Prisma.BusinessActivityWhereInput[] + id?: Prisma.StringFilter<"BusinessActivity"> | string + name?: Prisma.StringFilter<"BusinessActivity"> | string + created_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string + guild_id?: Prisma.StringFilter<"BusinessActivity"> | string + owner_id?: Prisma.StringFilter<"BusinessActivity"> | string + guild?: Prisma.XOR + user?: Prisma.XOR + complexes?: Prisma.ComplexListRelationFilter + accounts?: Prisma.AccountListRelationFilter +} + +export type BusinessActivityOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + created_at?: Prisma.SortOrder + guild_id?: Prisma.SortOrder + owner_id?: Prisma.SortOrder + guild?: Prisma.GuildOrderByWithRelationInput + user?: Prisma.UserOrderByWithRelationInput + complexes?: Prisma.ComplexOrderByRelationAggregateInput + accounts?: Prisma.AccountOrderByRelationAggregateInput + _relevance?: Prisma.BusinessActivityOrderByRelevanceInput +} + +export type BusinessActivityWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.BusinessActivityWhereInput | Prisma.BusinessActivityWhereInput[] + OR?: Prisma.BusinessActivityWhereInput[] + NOT?: Prisma.BusinessActivityWhereInput | Prisma.BusinessActivityWhereInput[] + name?: Prisma.StringFilter<"BusinessActivity"> | string + created_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string + guild_id?: Prisma.StringFilter<"BusinessActivity"> | string + owner_id?: Prisma.StringFilter<"BusinessActivity"> | string + guild?: Prisma.XOR + user?: Prisma.XOR + complexes?: Prisma.ComplexListRelationFilter + accounts?: Prisma.AccountListRelationFilter +}, "id"> + +export type BusinessActivityOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + created_at?: Prisma.SortOrder + guild_id?: Prisma.SortOrder + owner_id?: Prisma.SortOrder + _count?: Prisma.BusinessActivityCountOrderByAggregateInput + _max?: Prisma.BusinessActivityMaxOrderByAggregateInput + _min?: Prisma.BusinessActivityMinOrderByAggregateInput +} + +export type BusinessActivityScalarWhereWithAggregatesInput = { + AND?: Prisma.BusinessActivityScalarWhereWithAggregatesInput | Prisma.BusinessActivityScalarWhereWithAggregatesInput[] + OR?: Prisma.BusinessActivityScalarWhereWithAggregatesInput[] + NOT?: Prisma.BusinessActivityScalarWhereWithAggregatesInput | Prisma.BusinessActivityScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"BusinessActivity"> | string + name?: Prisma.StringWithAggregatesFilter<"BusinessActivity"> | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"BusinessActivity"> | Date | string + guild_id?: Prisma.StringWithAggregatesFilter<"BusinessActivity"> | string + owner_id?: Prisma.StringWithAggregatesFilter<"BusinessActivity"> | string +} + +export type BusinessActivityCreateInput = { + id?: string + name: string + created_at?: Date | string + guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput + user: Prisma.UserCreateNestedOneWithoutBusinessActivitiesInput + complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput + accounts?: Prisma.AccountCreateNestedManyWithoutBusinessInput +} + +export type BusinessActivityUncheckedCreateInput = { + id?: string + name: string + created_at?: Date | string + guild_id: string + owner_id: string + complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutBusinessInput +} + +export type BusinessActivityUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput + user?: Prisma.UserUpdateOneRequiredWithoutBusinessActivitiesNestedInput + complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput + accounts?: Prisma.AccountUpdateManyWithoutBusinessNestedInput +} + +export type BusinessActivityUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + guild_id?: Prisma.StringFieldUpdateOperationsInput | string + owner_id?: Prisma.StringFieldUpdateOperationsInput | string + complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput + accounts?: Prisma.AccountUncheckedUpdateManyWithoutBusinessNestedInput +} + +export type BusinessActivityCreateManyInput = { + id?: string + name: string + created_at?: Date | string + guild_id: string + owner_id: string +} + +export type BusinessActivityUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type BusinessActivityUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + guild_id?: Prisma.StringFieldUpdateOperationsInput | string + owner_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type BusinessActivityListRelationFilter = { + every?: Prisma.BusinessActivityWhereInput + some?: Prisma.BusinessActivityWhereInput + none?: Prisma.BusinessActivityWhereInput +} + +export type BusinessActivityOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type BusinessActivityOrderByRelevanceInput = { + fields: Prisma.BusinessActivityOrderByRelevanceFieldEnum | Prisma.BusinessActivityOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type BusinessActivityCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + created_at?: Prisma.SortOrder + guild_id?: Prisma.SortOrder + owner_id?: Prisma.SortOrder +} + +export type BusinessActivityMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + created_at?: Prisma.SortOrder + guild_id?: Prisma.SortOrder + owner_id?: Prisma.SortOrder +} + +export type BusinessActivityMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + created_at?: Prisma.SortOrder + guild_id?: Prisma.SortOrder + owner_id?: Prisma.SortOrder +} + +export type BusinessActivityScalarRelationFilter = { + is?: Prisma.BusinessActivityWhereInput + isNot?: Prisma.BusinessActivityWhereInput +} + +export type BusinessActivityNullableScalarRelationFilter = { + is?: Prisma.BusinessActivityWhereInput | null + isNot?: Prisma.BusinessActivityWhereInput | null +} + +export type BusinessActivityCreateNestedManyWithoutGuildInput = { + create?: Prisma.XOR | Prisma.BusinessActivityCreateWithoutGuildInput[] | Prisma.BusinessActivityUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutGuildInput | Prisma.BusinessActivityCreateOrConnectWithoutGuildInput[] + createMany?: Prisma.BusinessActivityCreateManyGuildInputEnvelope + connect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] +} + +export type BusinessActivityUncheckedCreateNestedManyWithoutGuildInput = { + create?: Prisma.XOR | Prisma.BusinessActivityCreateWithoutGuildInput[] | Prisma.BusinessActivityUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutGuildInput | Prisma.BusinessActivityCreateOrConnectWithoutGuildInput[] + createMany?: Prisma.BusinessActivityCreateManyGuildInputEnvelope + connect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] +} + +export type BusinessActivityUpdateManyWithoutGuildNestedInput = { + create?: Prisma.XOR | Prisma.BusinessActivityCreateWithoutGuildInput[] | Prisma.BusinessActivityUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutGuildInput | Prisma.BusinessActivityCreateOrConnectWithoutGuildInput[] + upsert?: Prisma.BusinessActivityUpsertWithWhereUniqueWithoutGuildInput | Prisma.BusinessActivityUpsertWithWhereUniqueWithoutGuildInput[] + createMany?: Prisma.BusinessActivityCreateManyGuildInputEnvelope + set?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + disconnect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + delete?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + connect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + update?: Prisma.BusinessActivityUpdateWithWhereUniqueWithoutGuildInput | Prisma.BusinessActivityUpdateWithWhereUniqueWithoutGuildInput[] + updateMany?: Prisma.BusinessActivityUpdateManyWithWhereWithoutGuildInput | Prisma.BusinessActivityUpdateManyWithWhereWithoutGuildInput[] + deleteMany?: Prisma.BusinessActivityScalarWhereInput | Prisma.BusinessActivityScalarWhereInput[] +} + +export type BusinessActivityUncheckedUpdateManyWithoutGuildNestedInput = { + create?: Prisma.XOR | Prisma.BusinessActivityCreateWithoutGuildInput[] | Prisma.BusinessActivityUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutGuildInput | Prisma.BusinessActivityCreateOrConnectWithoutGuildInput[] + upsert?: Prisma.BusinessActivityUpsertWithWhereUniqueWithoutGuildInput | Prisma.BusinessActivityUpsertWithWhereUniqueWithoutGuildInput[] + createMany?: Prisma.BusinessActivityCreateManyGuildInputEnvelope + set?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + disconnect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + delete?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + connect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + update?: Prisma.BusinessActivityUpdateWithWhereUniqueWithoutGuildInput | Prisma.BusinessActivityUpdateWithWhereUniqueWithoutGuildInput[] + updateMany?: Prisma.BusinessActivityUpdateManyWithWhereWithoutGuildInput | Prisma.BusinessActivityUpdateManyWithWhereWithoutGuildInput[] + deleteMany?: Prisma.BusinessActivityScalarWhereInput | Prisma.BusinessActivityScalarWhereInput[] +} + +export type BusinessActivityCreateNestedOneWithoutComplexesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutComplexesInput + connect?: Prisma.BusinessActivityWhereUniqueInput +} + +export type BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutComplexesInput + upsert?: Prisma.BusinessActivityUpsertWithoutComplexesInput + connect?: Prisma.BusinessActivityWhereUniqueInput + update?: Prisma.XOR, Prisma.BusinessActivityUncheckedUpdateWithoutComplexesInput> +} + +export type BusinessActivityCreateNestedManyWithoutUserInput = { + create?: Prisma.XOR | Prisma.BusinessActivityCreateWithoutUserInput[] | Prisma.BusinessActivityUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutUserInput | Prisma.BusinessActivityCreateOrConnectWithoutUserInput[] + createMany?: Prisma.BusinessActivityCreateManyUserInputEnvelope + connect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] +} + +export type BusinessActivityUncheckedCreateNestedManyWithoutUserInput = { + create?: Prisma.XOR | Prisma.BusinessActivityCreateWithoutUserInput[] | Prisma.BusinessActivityUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutUserInput | Prisma.BusinessActivityCreateOrConnectWithoutUserInput[] + createMany?: Prisma.BusinessActivityCreateManyUserInputEnvelope + connect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] +} + +export type BusinessActivityUpdateManyWithoutUserNestedInput = { + create?: Prisma.XOR | Prisma.BusinessActivityCreateWithoutUserInput[] | Prisma.BusinessActivityUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutUserInput | Prisma.BusinessActivityCreateOrConnectWithoutUserInput[] + upsert?: Prisma.BusinessActivityUpsertWithWhereUniqueWithoutUserInput | Prisma.BusinessActivityUpsertWithWhereUniqueWithoutUserInput[] + createMany?: Prisma.BusinessActivityCreateManyUserInputEnvelope + set?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + disconnect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + delete?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + connect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + update?: Prisma.BusinessActivityUpdateWithWhereUniqueWithoutUserInput | Prisma.BusinessActivityUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: Prisma.BusinessActivityUpdateManyWithWhereWithoutUserInput | Prisma.BusinessActivityUpdateManyWithWhereWithoutUserInput[] + deleteMany?: Prisma.BusinessActivityScalarWhereInput | Prisma.BusinessActivityScalarWhereInput[] +} + +export type BusinessActivityUncheckedUpdateManyWithoutUserNestedInput = { + create?: Prisma.XOR | Prisma.BusinessActivityCreateWithoutUserInput[] | Prisma.BusinessActivityUncheckedCreateWithoutUserInput[] + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutUserInput | Prisma.BusinessActivityCreateOrConnectWithoutUserInput[] + upsert?: Prisma.BusinessActivityUpsertWithWhereUniqueWithoutUserInput | Prisma.BusinessActivityUpsertWithWhereUniqueWithoutUserInput[] + createMany?: Prisma.BusinessActivityCreateManyUserInputEnvelope + set?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + disconnect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + delete?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + connect?: Prisma.BusinessActivityWhereUniqueInput | Prisma.BusinessActivityWhereUniqueInput[] + update?: Prisma.BusinessActivityUpdateWithWhereUniqueWithoutUserInput | Prisma.BusinessActivityUpdateWithWhereUniqueWithoutUserInput[] + updateMany?: Prisma.BusinessActivityUpdateManyWithWhereWithoutUserInput | Prisma.BusinessActivityUpdateManyWithWhereWithoutUserInput[] + deleteMany?: Prisma.BusinessActivityScalarWhereInput | Prisma.BusinessActivityScalarWhereInput[] +} + +export type BusinessActivityCreateNestedOneWithoutAccountsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutAccountsInput + connect?: Prisma.BusinessActivityWhereUniqueInput +} + +export type BusinessActivityUpdateOneWithoutAccountsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.BusinessActivityCreateOrConnectWithoutAccountsInput + upsert?: Prisma.BusinessActivityUpsertWithoutAccountsInput + disconnect?: Prisma.BusinessActivityWhereInput | boolean + delete?: Prisma.BusinessActivityWhereInput | boolean + connect?: Prisma.BusinessActivityWhereUniqueInput + update?: Prisma.XOR, Prisma.BusinessActivityUncheckedUpdateWithoutAccountsInput> +} + +export type BusinessActivityCreateWithoutGuildInput = { + id?: string + name: string + created_at?: Date | string + user: Prisma.UserCreateNestedOneWithoutBusinessActivitiesInput + complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput + accounts?: Prisma.AccountCreateNestedManyWithoutBusinessInput +} + +export type BusinessActivityUncheckedCreateWithoutGuildInput = { + id?: string + name: string + created_at?: Date | string + owner_id: string + complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutBusinessInput +} + +export type BusinessActivityCreateOrConnectWithoutGuildInput = { + where: Prisma.BusinessActivityWhereUniqueInput + create: Prisma.XOR +} + +export type BusinessActivityCreateManyGuildInputEnvelope = { + data: Prisma.BusinessActivityCreateManyGuildInput | Prisma.BusinessActivityCreateManyGuildInput[] + skipDuplicates?: boolean +} + +export type BusinessActivityUpsertWithWhereUniqueWithoutGuildInput = { + where: Prisma.BusinessActivityWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type BusinessActivityUpdateWithWhereUniqueWithoutGuildInput = { + where: Prisma.BusinessActivityWhereUniqueInput + data: Prisma.XOR +} + +export type BusinessActivityUpdateManyWithWhereWithoutGuildInput = { + where: Prisma.BusinessActivityScalarWhereInput + data: Prisma.XOR +} + +export type BusinessActivityScalarWhereInput = { + AND?: Prisma.BusinessActivityScalarWhereInput | Prisma.BusinessActivityScalarWhereInput[] + OR?: Prisma.BusinessActivityScalarWhereInput[] + NOT?: Prisma.BusinessActivityScalarWhereInput | Prisma.BusinessActivityScalarWhereInput[] + id?: Prisma.StringFilter<"BusinessActivity"> | string + name?: Prisma.StringFilter<"BusinessActivity"> | string + created_at?: Prisma.DateTimeFilter<"BusinessActivity"> | Date | string + guild_id?: Prisma.StringFilter<"BusinessActivity"> | string + owner_id?: Prisma.StringFilter<"BusinessActivity"> | string +} + +export type BusinessActivityCreateWithoutComplexesInput = { + id?: string + name: string + created_at?: Date | string + guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput + user: Prisma.UserCreateNestedOneWithoutBusinessActivitiesInput + accounts?: Prisma.AccountCreateNestedManyWithoutBusinessInput +} + +export type BusinessActivityUncheckedCreateWithoutComplexesInput = { + id?: string + name: string + created_at?: Date | string + guild_id: string + owner_id: string + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutBusinessInput +} + +export type BusinessActivityCreateOrConnectWithoutComplexesInput = { + where: Prisma.BusinessActivityWhereUniqueInput + create: Prisma.XOR +} + +export type BusinessActivityUpsertWithoutComplexesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.BusinessActivityWhereInput +} + +export type BusinessActivityUpdateToOneWithWhereWithoutComplexesInput = { + where?: Prisma.BusinessActivityWhereInput + data: Prisma.XOR +} + +export type BusinessActivityUpdateWithoutComplexesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput + user?: Prisma.UserUpdateOneRequiredWithoutBusinessActivitiesNestedInput + accounts?: Prisma.AccountUpdateManyWithoutBusinessNestedInput +} + +export type BusinessActivityUncheckedUpdateWithoutComplexesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + guild_id?: Prisma.StringFieldUpdateOperationsInput | string + owner_id?: Prisma.StringFieldUpdateOperationsInput | string + accounts?: Prisma.AccountUncheckedUpdateManyWithoutBusinessNestedInput +} + +export type BusinessActivityCreateWithoutUserInput = { + id?: string + name: string + created_at?: Date | string + guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput + complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput + accounts?: Prisma.AccountCreateNestedManyWithoutBusinessInput +} + +export type BusinessActivityUncheckedCreateWithoutUserInput = { + id?: string + name: string + created_at?: Date | string + guild_id: string + complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutBusinessInput +} + +export type BusinessActivityCreateOrConnectWithoutUserInput = { + where: Prisma.BusinessActivityWhereUniqueInput + create: Prisma.XOR +} + +export type BusinessActivityCreateManyUserInputEnvelope = { + data: Prisma.BusinessActivityCreateManyUserInput | Prisma.BusinessActivityCreateManyUserInput[] + skipDuplicates?: boolean +} + +export type BusinessActivityUpsertWithWhereUniqueWithoutUserInput = { + where: Prisma.BusinessActivityWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type BusinessActivityUpdateWithWhereUniqueWithoutUserInput = { + where: Prisma.BusinessActivityWhereUniqueInput + data: Prisma.XOR +} + +export type BusinessActivityUpdateManyWithWhereWithoutUserInput = { + where: Prisma.BusinessActivityScalarWhereInput + data: Prisma.XOR +} + +export type BusinessActivityCreateWithoutAccountsInput = { + id?: string + name: string + created_at?: Date | string + guild: Prisma.GuildCreateNestedOneWithoutBusiness_activitiesInput + user: Prisma.UserCreateNestedOneWithoutBusinessActivitiesInput + complexes?: Prisma.ComplexCreateNestedManyWithoutBusiness_activityInput +} + +export type BusinessActivityUncheckedCreateWithoutAccountsInput = { + id?: string + name: string + created_at?: Date | string + guild_id: string + owner_id: string + complexes?: Prisma.ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput +} + +export type BusinessActivityCreateOrConnectWithoutAccountsInput = { + where: Prisma.BusinessActivityWhereUniqueInput + create: Prisma.XOR +} + +export type BusinessActivityUpsertWithoutAccountsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.BusinessActivityWhereInput +} + +export type BusinessActivityUpdateToOneWithWhereWithoutAccountsInput = { + where?: Prisma.BusinessActivityWhereInput + data: Prisma.XOR +} + +export type BusinessActivityUpdateWithoutAccountsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput + user?: Prisma.UserUpdateOneRequiredWithoutBusinessActivitiesNestedInput + complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput +} + +export type BusinessActivityUncheckedUpdateWithoutAccountsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + guild_id?: Prisma.StringFieldUpdateOperationsInput | string + owner_id?: Prisma.StringFieldUpdateOperationsInput | string + complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput +} + +export type BusinessActivityCreateManyGuildInput = { + id?: string + name: string + created_at?: Date | string + owner_id: string +} + +export type BusinessActivityUpdateWithoutGuildInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + user?: Prisma.UserUpdateOneRequiredWithoutBusinessActivitiesNestedInput + complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput + accounts?: Prisma.AccountUpdateManyWithoutBusinessNestedInput +} + +export type BusinessActivityUncheckedUpdateWithoutGuildInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + owner_id?: Prisma.StringFieldUpdateOperationsInput | string + complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput + accounts?: Prisma.AccountUncheckedUpdateManyWithoutBusinessNestedInput +} + +export type BusinessActivityUncheckedUpdateManyWithoutGuildInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + owner_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type BusinessActivityCreateManyUserInput = { + id?: string + name: string + created_at?: Date | string + guild_id: string +} + +export type BusinessActivityUpdateWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + guild?: Prisma.GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput + complexes?: Prisma.ComplexUpdateManyWithoutBusiness_activityNestedInput + accounts?: Prisma.AccountUpdateManyWithoutBusinessNestedInput +} + +export type BusinessActivityUncheckedUpdateWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + guild_id?: Prisma.StringFieldUpdateOperationsInput | string + complexes?: Prisma.ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput + accounts?: Prisma.AccountUncheckedUpdateManyWithoutBusinessNestedInput +} + +export type BusinessActivityUncheckedUpdateManyWithoutUserInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + guild_id?: Prisma.StringFieldUpdateOperationsInput | string +} + + +/** + * Count Type BusinessActivityCountOutputType + */ + +export type BusinessActivityCountOutputType = { + complexes: number + accounts: number +} + +export type BusinessActivityCountOutputTypeSelect = { + complexes?: boolean | BusinessActivityCountOutputTypeCountComplexesArgs + accounts?: boolean | BusinessActivityCountOutputTypeCountAccountsArgs +} + +/** + * BusinessActivityCountOutputType without action + */ +export type BusinessActivityCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the BusinessActivityCountOutputType + */ + select?: Prisma.BusinessActivityCountOutputTypeSelect | null +} + +/** + * BusinessActivityCountOutputType without action + */ +export type BusinessActivityCountOutputTypeCountComplexesArgs = { + where?: Prisma.ComplexWhereInput +} + +/** + * BusinessActivityCountOutputType without action + */ +export type BusinessActivityCountOutputTypeCountAccountsArgs = { + where?: Prisma.AccountWhereInput +} + + +export type BusinessActivitySelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + created_at?: boolean + guild_id?: boolean + owner_id?: boolean + guild?: boolean | Prisma.GuildDefaultArgs + user?: boolean | Prisma.UserDefaultArgs + complexes?: boolean | Prisma.BusinessActivity$complexesArgs + accounts?: boolean | Prisma.BusinessActivity$accountsArgs + _count?: boolean | Prisma.BusinessActivityCountOutputTypeDefaultArgs +}, ExtArgs["result"]["businessActivity"]> + + + +export type BusinessActivitySelectScalar = { + id?: boolean + name?: boolean + created_at?: boolean + guild_id?: boolean + owner_id?: boolean +} + +export type BusinessActivityOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "created_at" | "guild_id" | "owner_id", ExtArgs["result"]["businessActivity"]> +export type BusinessActivityInclude = { + guild?: boolean | Prisma.GuildDefaultArgs + user?: boolean | Prisma.UserDefaultArgs + complexes?: boolean | Prisma.BusinessActivity$complexesArgs + accounts?: boolean | Prisma.BusinessActivity$accountsArgs + _count?: boolean | Prisma.BusinessActivityCountOutputTypeDefaultArgs +} + +export type $BusinessActivityPayload = { + name: "BusinessActivity" + objects: { + guild: Prisma.$GuildPayload + user: Prisma.$UserPayload + complexes: Prisma.$ComplexPayload[] + accounts: Prisma.$AccountPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + created_at: Date + guild_id: string + owner_id: string + }, ExtArgs["result"]["businessActivity"]> + composites: {} +} + +export type BusinessActivityGetPayload = runtime.Types.Result.GetResult + +export type BusinessActivityCountArgs = + Omit & { + select?: BusinessActivityCountAggregateInputType | true + } + +export interface BusinessActivityDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['BusinessActivity'], meta: { name: 'BusinessActivity' } } + /** + * Find zero or one BusinessActivity that matches the filter. + * @param {BusinessActivityFindUniqueArgs} args - Arguments to find a BusinessActivity + * @example + * // Get one BusinessActivity + * const businessActivity = await prisma.businessActivity.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__BusinessActivityClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one BusinessActivity that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {BusinessActivityFindUniqueOrThrowArgs} args - Arguments to find a BusinessActivity + * @example + * // Get one BusinessActivity + * const businessActivity = await prisma.businessActivity.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__BusinessActivityClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first BusinessActivity that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BusinessActivityFindFirstArgs} args - Arguments to find a BusinessActivity + * @example + * // Get one BusinessActivity + * const businessActivity = await prisma.businessActivity.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__BusinessActivityClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first BusinessActivity that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BusinessActivityFindFirstOrThrowArgs} args - Arguments to find a BusinessActivity + * @example + * // Get one BusinessActivity + * const businessActivity = await prisma.businessActivity.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__BusinessActivityClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more BusinessActivities that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BusinessActivityFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all BusinessActivities + * const businessActivities = await prisma.businessActivity.findMany() + * + * // Get first 10 BusinessActivities + * const businessActivities = await prisma.businessActivity.findMany({ take: 10 }) + * + * // Only select the `id` + * const businessActivityWithIdOnly = await prisma.businessActivity.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a BusinessActivity. + * @param {BusinessActivityCreateArgs} args - Arguments to create a BusinessActivity. + * @example + * // Create one BusinessActivity + * const BusinessActivity = await prisma.businessActivity.create({ + * data: { + * // ... data to create a BusinessActivity + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__BusinessActivityClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many BusinessActivities. + * @param {BusinessActivityCreateManyArgs} args - Arguments to create many BusinessActivities. + * @example + * // Create many BusinessActivities + * const businessActivity = await prisma.businessActivity.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a BusinessActivity. + * @param {BusinessActivityDeleteArgs} args - Arguments to delete one BusinessActivity. + * @example + * // Delete one BusinessActivity + * const BusinessActivity = await prisma.businessActivity.delete({ + * where: { + * // ... filter to delete one BusinessActivity + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__BusinessActivityClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one BusinessActivity. + * @param {BusinessActivityUpdateArgs} args - Arguments to update one BusinessActivity. + * @example + * // Update one BusinessActivity + * const businessActivity = await prisma.businessActivity.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__BusinessActivityClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more BusinessActivities. + * @param {BusinessActivityDeleteManyArgs} args - Arguments to filter BusinessActivities to delete. + * @example + * // Delete a few BusinessActivities + * const { count } = await prisma.businessActivity.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more BusinessActivities. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BusinessActivityUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many BusinessActivities + * const businessActivity = await prisma.businessActivity.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one BusinessActivity. + * @param {BusinessActivityUpsertArgs} args - Arguments to update or create a BusinessActivity. + * @example + * // Update or create a BusinessActivity + * const businessActivity = await prisma.businessActivity.upsert({ + * create: { + * // ... data to create a BusinessActivity + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the BusinessActivity we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__BusinessActivityClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of BusinessActivities. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BusinessActivityCountArgs} args - Arguments to filter BusinessActivities to count. + * @example + * // Count the number of BusinessActivities + * const count = await prisma.businessActivity.count({ + * where: { + * // ... the filter for the BusinessActivities we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a BusinessActivity. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BusinessActivityAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by BusinessActivity. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BusinessActivityGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends BusinessActivityGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: BusinessActivityGroupByArgs['orderBy'] } + : { orderBy?: BusinessActivityGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetBusinessActivityGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the BusinessActivity model + */ +readonly fields: BusinessActivityFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for BusinessActivity. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__BusinessActivityClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + guild = {}>(args?: Prisma.Subset>): Prisma.Prisma__GuildClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + user = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + complexes = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + accounts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the BusinessActivity model + */ +export interface BusinessActivityFieldRefs { + readonly id: Prisma.FieldRef<"BusinessActivity", 'String'> + readonly name: Prisma.FieldRef<"BusinessActivity", 'String'> + readonly created_at: Prisma.FieldRef<"BusinessActivity", 'DateTime'> + readonly guild_id: Prisma.FieldRef<"BusinessActivity", 'String'> + readonly owner_id: Prisma.FieldRef<"BusinessActivity", 'String'> +} + + +// Custom InputTypes +/** + * BusinessActivity findUnique + */ +export type BusinessActivityFindUniqueArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + /** + * Filter, which BusinessActivity to fetch. + */ + where: Prisma.BusinessActivityWhereUniqueInput +} + +/** + * BusinessActivity findUniqueOrThrow + */ +export type BusinessActivityFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + /** + * Filter, which BusinessActivity to fetch. + */ + where: Prisma.BusinessActivityWhereUniqueInput +} + +/** + * BusinessActivity findFirst + */ +export type BusinessActivityFindFirstArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + /** + * Filter, which BusinessActivity to fetch. + */ + where?: Prisma.BusinessActivityWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BusinessActivities to fetch. + */ + orderBy?: Prisma.BusinessActivityOrderByWithRelationInput | Prisma.BusinessActivityOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for BusinessActivities. + */ + cursor?: Prisma.BusinessActivityWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BusinessActivities from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` BusinessActivities. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of BusinessActivities. + */ + distinct?: Prisma.BusinessActivityScalarFieldEnum | Prisma.BusinessActivityScalarFieldEnum[] +} + +/** + * BusinessActivity findFirstOrThrow + */ +export type BusinessActivityFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + /** + * Filter, which BusinessActivity to fetch. + */ + where?: Prisma.BusinessActivityWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BusinessActivities to fetch. + */ + orderBy?: Prisma.BusinessActivityOrderByWithRelationInput | Prisma.BusinessActivityOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for BusinessActivities. + */ + cursor?: Prisma.BusinessActivityWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BusinessActivities from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` BusinessActivities. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of BusinessActivities. + */ + distinct?: Prisma.BusinessActivityScalarFieldEnum | Prisma.BusinessActivityScalarFieldEnum[] +} + +/** + * BusinessActivity findMany + */ +export type BusinessActivityFindManyArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + /** + * Filter, which BusinessActivities to fetch. + */ + where?: Prisma.BusinessActivityWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BusinessActivities to fetch. + */ + orderBy?: Prisma.BusinessActivityOrderByWithRelationInput | Prisma.BusinessActivityOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing BusinessActivities. + */ + cursor?: Prisma.BusinessActivityWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BusinessActivities from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` BusinessActivities. + */ + skip?: number + distinct?: Prisma.BusinessActivityScalarFieldEnum | Prisma.BusinessActivityScalarFieldEnum[] +} + +/** + * BusinessActivity create + */ +export type BusinessActivityCreateArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + /** + * The data needed to create a BusinessActivity. + */ + data: Prisma.XOR +} + +/** + * BusinessActivity createMany + */ +export type BusinessActivityCreateManyArgs = { + /** + * The data used to create many BusinessActivities. + */ + data: Prisma.BusinessActivityCreateManyInput | Prisma.BusinessActivityCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * BusinessActivity update + */ +export type BusinessActivityUpdateArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + /** + * The data needed to update a BusinessActivity. + */ + data: Prisma.XOR + /** + * Choose, which BusinessActivity to update. + */ + where: Prisma.BusinessActivityWhereUniqueInput +} + +/** + * BusinessActivity updateMany + */ +export type BusinessActivityUpdateManyArgs = { + /** + * The data used to update BusinessActivities. + */ + data: Prisma.XOR + /** + * Filter which BusinessActivities to update + */ + where?: Prisma.BusinessActivityWhereInput + /** + * Limit how many BusinessActivities to update. + */ + limit?: number +} + +/** + * BusinessActivity upsert + */ +export type BusinessActivityUpsertArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + /** + * The filter to search for the BusinessActivity to update in case it exists. + */ + where: Prisma.BusinessActivityWhereUniqueInput + /** + * In case the BusinessActivity found by the `where` argument doesn't exist, create a new BusinessActivity with this data. + */ + create: Prisma.XOR + /** + * In case the BusinessActivity was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * BusinessActivity delete + */ +export type BusinessActivityDeleteArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + /** + * Filter which BusinessActivity to delete. + */ + where: Prisma.BusinessActivityWhereUniqueInput +} + +/** + * BusinessActivity deleteMany + */ +export type BusinessActivityDeleteManyArgs = { + /** + * Filter which BusinessActivities to delete + */ + where?: Prisma.BusinessActivityWhereInput + /** + * Limit how many BusinessActivities to delete. + */ + limit?: number +} + +/** + * BusinessActivity.complexes + */ +export type BusinessActivity$complexesArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + where?: Prisma.ComplexWhereInput + orderBy?: Prisma.ComplexOrderByWithRelationInput | Prisma.ComplexOrderByWithRelationInput[] + cursor?: Prisma.ComplexWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.ComplexScalarFieldEnum | Prisma.ComplexScalarFieldEnum[] +} + +/** + * BusinessActivity.accounts + */ +export type BusinessActivity$accountsArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + where?: Prisma.AccountWhereInput + orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] + cursor?: Prisma.AccountWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] +} + +/** + * BusinessActivity without action + */ +export type BusinessActivityDefaultArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null +} diff --git a/src/generated/prisma/models/Complex.ts b/src/generated/prisma/models/Complex.ts new file mode 100644 index 0000000..f497933 --- /dev/null +++ b/src/generated/prisma/models/Complex.ts @@ -0,0 +1,1608 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Complex` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Complex + * + */ +export type ComplexModel = runtime.Types.Result.DefaultSelection + +export type AggregateComplex = { + _count: ComplexCountAggregateOutputType | null + _min: ComplexMinAggregateOutputType | null + _max: ComplexMaxAggregateOutputType | null +} + +export type ComplexMinAggregateOutputType = { + id: string | null + name: string | null + address: string | null + tax_id: string | null + business_activity_id: string | null +} + +export type ComplexMaxAggregateOutputType = { + id: string | null + name: string | null + address: string | null + tax_id: string | null + business_activity_id: string | null +} + +export type ComplexCountAggregateOutputType = { + id: number + name: number + address: number + tax_id: number + business_activity_id: number + _all: number +} + + +export type ComplexMinAggregateInputType = { + id?: true + name?: true + address?: true + tax_id?: true + business_activity_id?: true +} + +export type ComplexMaxAggregateInputType = { + id?: true + name?: true + address?: true + tax_id?: true + business_activity_id?: true +} + +export type ComplexCountAggregateInputType = { + id?: true + name?: true + address?: true + tax_id?: true + business_activity_id?: true + _all?: true +} + +export type ComplexAggregateArgs = { + /** + * Filter which Complex to aggregate. + */ + where?: Prisma.ComplexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Complexes to fetch. + */ + orderBy?: Prisma.ComplexOrderByWithRelationInput | Prisma.ComplexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.ComplexWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Complexes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Complexes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Complexes + **/ + _count?: true | ComplexCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ComplexMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ComplexMaxAggregateInputType +} + +export type GetComplexAggregateType = { + [P in keyof T & keyof AggregateComplex]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type ComplexGroupByArgs = { + where?: Prisma.ComplexWhereInput + orderBy?: Prisma.ComplexOrderByWithAggregationInput | Prisma.ComplexOrderByWithAggregationInput[] + by: Prisma.ComplexScalarFieldEnum[] | Prisma.ComplexScalarFieldEnum + having?: Prisma.ComplexScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ComplexCountAggregateInputType | true + _min?: ComplexMinAggregateInputType + _max?: ComplexMaxAggregateInputType +} + +export type ComplexGroupByOutputType = { + id: string + name: string + address: string | null + tax_id: string | null + business_activity_id: string + _count: ComplexCountAggregateOutputType | null + _min: ComplexMinAggregateOutputType | null + _max: ComplexMaxAggregateOutputType | null +} + +type GetComplexGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof ComplexGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type ComplexWhereInput = { + AND?: Prisma.ComplexWhereInput | Prisma.ComplexWhereInput[] + OR?: Prisma.ComplexWhereInput[] + NOT?: Prisma.ComplexWhereInput | Prisma.ComplexWhereInput[] + id?: Prisma.StringFilter<"Complex"> | string + name?: Prisma.StringFilter<"Complex"> | string + address?: Prisma.StringNullableFilter<"Complex"> | string | null + tax_id?: Prisma.StringNullableFilter<"Complex"> | string | null + business_activity_id?: Prisma.StringFilter<"Complex"> | string + business_activity?: Prisma.XOR + pos_list?: Prisma.PosListRelationFilter + goods?: Prisma.GoodListRelationFilter + good_categories?: Prisma.GoodCategoryListRelationFilter +} + +export type ComplexOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + address?: Prisma.SortOrderInput | Prisma.SortOrder + tax_id?: Prisma.SortOrderInput | Prisma.SortOrder + business_activity_id?: Prisma.SortOrder + business_activity?: Prisma.BusinessActivityOrderByWithRelationInput + pos_list?: Prisma.PosOrderByRelationAggregateInput + goods?: Prisma.GoodOrderByRelationAggregateInput + good_categories?: Prisma.GoodCategoryOrderByRelationAggregateInput + _relevance?: Prisma.ComplexOrderByRelevanceInput +} + +export type ComplexWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.ComplexWhereInput | Prisma.ComplexWhereInput[] + OR?: Prisma.ComplexWhereInput[] + NOT?: Prisma.ComplexWhereInput | Prisma.ComplexWhereInput[] + name?: Prisma.StringFilter<"Complex"> | string + address?: Prisma.StringNullableFilter<"Complex"> | string | null + tax_id?: Prisma.StringNullableFilter<"Complex"> | string | null + business_activity_id?: Prisma.StringFilter<"Complex"> | string + business_activity?: Prisma.XOR + pos_list?: Prisma.PosListRelationFilter + goods?: Prisma.GoodListRelationFilter + good_categories?: Prisma.GoodCategoryListRelationFilter +}, "id"> + +export type ComplexOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + address?: Prisma.SortOrderInput | Prisma.SortOrder + tax_id?: Prisma.SortOrderInput | Prisma.SortOrder + business_activity_id?: Prisma.SortOrder + _count?: Prisma.ComplexCountOrderByAggregateInput + _max?: Prisma.ComplexMaxOrderByAggregateInput + _min?: Prisma.ComplexMinOrderByAggregateInput +} + +export type ComplexScalarWhereWithAggregatesInput = { + AND?: Prisma.ComplexScalarWhereWithAggregatesInput | Prisma.ComplexScalarWhereWithAggregatesInput[] + OR?: Prisma.ComplexScalarWhereWithAggregatesInput[] + NOT?: Prisma.ComplexScalarWhereWithAggregatesInput | Prisma.ComplexScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Complex"> | string + name?: Prisma.StringWithAggregatesFilter<"Complex"> | string + address?: Prisma.StringNullableWithAggregatesFilter<"Complex"> | string | null + tax_id?: Prisma.StringNullableWithAggregatesFilter<"Complex"> | string | null + business_activity_id?: Prisma.StringWithAggregatesFilter<"Complex"> | string +} + +export type ComplexCreateInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + business_activity: Prisma.BusinessActivityCreateNestedOneWithoutComplexesInput + pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput + goods?: Prisma.GoodCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + business_activity_id: string + pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput + pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput + goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput + goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexCreateManyInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + business_activity_id: string +} + +export type ComplexUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type ComplexUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type ComplexListRelationFilter = { + every?: Prisma.ComplexWhereInput + some?: Prisma.ComplexWhereInput + none?: Prisma.ComplexWhereInput +} + +export type ComplexOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type ComplexOrderByRelevanceInput = { + fields: Prisma.ComplexOrderByRelevanceFieldEnum | Prisma.ComplexOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type ComplexCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + address?: Prisma.SortOrder + tax_id?: Prisma.SortOrder + business_activity_id?: Prisma.SortOrder +} + +export type ComplexMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + address?: Prisma.SortOrder + tax_id?: Prisma.SortOrder + business_activity_id?: Prisma.SortOrder +} + +export type ComplexMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + address?: Prisma.SortOrder + tax_id?: Prisma.SortOrder + business_activity_id?: Prisma.SortOrder +} + +export type ComplexScalarRelationFilter = { + is?: Prisma.ComplexWhereInput + isNot?: Prisma.ComplexWhereInput +} + +export type ComplexNullableScalarRelationFilter = { + is?: Prisma.ComplexWhereInput | null + isNot?: Prisma.ComplexWhereInput | null +} + +export type ComplexCreateNestedManyWithoutBusiness_activityInput = { + create?: Prisma.XOR | Prisma.ComplexCreateWithoutBusiness_activityInput[] | Prisma.ComplexUncheckedCreateWithoutBusiness_activityInput[] + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutBusiness_activityInput | Prisma.ComplexCreateOrConnectWithoutBusiness_activityInput[] + createMany?: Prisma.ComplexCreateManyBusiness_activityInputEnvelope + connect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] +} + +export type ComplexUncheckedCreateNestedManyWithoutBusiness_activityInput = { + create?: Prisma.XOR | Prisma.ComplexCreateWithoutBusiness_activityInput[] | Prisma.ComplexUncheckedCreateWithoutBusiness_activityInput[] + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutBusiness_activityInput | Prisma.ComplexCreateOrConnectWithoutBusiness_activityInput[] + createMany?: Prisma.ComplexCreateManyBusiness_activityInputEnvelope + connect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] +} + +export type ComplexUpdateManyWithoutBusiness_activityNestedInput = { + create?: Prisma.XOR | Prisma.ComplexCreateWithoutBusiness_activityInput[] | Prisma.ComplexUncheckedCreateWithoutBusiness_activityInput[] + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutBusiness_activityInput | Prisma.ComplexCreateOrConnectWithoutBusiness_activityInput[] + upsert?: Prisma.ComplexUpsertWithWhereUniqueWithoutBusiness_activityInput | Prisma.ComplexUpsertWithWhereUniqueWithoutBusiness_activityInput[] + createMany?: Prisma.ComplexCreateManyBusiness_activityInputEnvelope + set?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + disconnect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + delete?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + connect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + update?: Prisma.ComplexUpdateWithWhereUniqueWithoutBusiness_activityInput | Prisma.ComplexUpdateWithWhereUniqueWithoutBusiness_activityInput[] + updateMany?: Prisma.ComplexUpdateManyWithWhereWithoutBusiness_activityInput | Prisma.ComplexUpdateManyWithWhereWithoutBusiness_activityInput[] + deleteMany?: Prisma.ComplexScalarWhereInput | Prisma.ComplexScalarWhereInput[] +} + +export type ComplexUncheckedUpdateManyWithoutBusiness_activityNestedInput = { + create?: Prisma.XOR | Prisma.ComplexCreateWithoutBusiness_activityInput[] | Prisma.ComplexUncheckedCreateWithoutBusiness_activityInput[] + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutBusiness_activityInput | Prisma.ComplexCreateOrConnectWithoutBusiness_activityInput[] + upsert?: Prisma.ComplexUpsertWithWhereUniqueWithoutBusiness_activityInput | Prisma.ComplexUpsertWithWhereUniqueWithoutBusiness_activityInput[] + createMany?: Prisma.ComplexCreateManyBusiness_activityInputEnvelope + set?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + disconnect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + delete?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + connect?: Prisma.ComplexWhereUniqueInput | Prisma.ComplexWhereUniqueInput[] + update?: Prisma.ComplexUpdateWithWhereUniqueWithoutBusiness_activityInput | Prisma.ComplexUpdateWithWhereUniqueWithoutBusiness_activityInput[] + updateMany?: Prisma.ComplexUpdateManyWithWhereWithoutBusiness_activityInput | Prisma.ComplexUpdateManyWithWhereWithoutBusiness_activityInput[] + deleteMany?: Prisma.ComplexScalarWhereInput | Prisma.ComplexScalarWhereInput[] +} + +export type ComplexCreateNestedOneWithoutPos_listInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutPos_listInput + connect?: Prisma.ComplexWhereUniqueInput +} + +export type ComplexUpdateOneRequiredWithoutPos_listNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutPos_listInput + upsert?: Prisma.ComplexUpsertWithoutPos_listInput + connect?: Prisma.ComplexWhereUniqueInput + update?: Prisma.XOR, Prisma.ComplexUncheckedUpdateWithoutPos_listInput> +} + +export type ComplexCreateNestedOneWithoutGoodsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutGoodsInput + connect?: Prisma.ComplexWhereUniqueInput +} + +export type ComplexUpdateOneWithoutGoodsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutGoodsInput + upsert?: Prisma.ComplexUpsertWithoutGoodsInput + disconnect?: Prisma.ComplexWhereInput | boolean + delete?: Prisma.ComplexWhereInput | boolean + connect?: Prisma.ComplexWhereUniqueInput + update?: Prisma.XOR, Prisma.ComplexUncheckedUpdateWithoutGoodsInput> +} + +export type ComplexCreateNestedOneWithoutGood_categoriesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutGood_categoriesInput + connect?: Prisma.ComplexWhereUniqueInput +} + +export type ComplexUpdateOneWithoutGood_categoriesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ComplexCreateOrConnectWithoutGood_categoriesInput + upsert?: Prisma.ComplexUpsertWithoutGood_categoriesInput + disconnect?: Prisma.ComplexWhereInput | boolean + delete?: Prisma.ComplexWhereInput | boolean + connect?: Prisma.ComplexWhereUniqueInput + update?: Prisma.XOR, Prisma.ComplexUncheckedUpdateWithoutGood_categoriesInput> +} + +export type ComplexCreateWithoutBusiness_activityInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput + goods?: Prisma.GoodCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateWithoutBusiness_activityInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexCreateOrConnectWithoutBusiness_activityInput = { + where: Prisma.ComplexWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexCreateManyBusiness_activityInputEnvelope = { + data: Prisma.ComplexCreateManyBusiness_activityInput | Prisma.ComplexCreateManyBusiness_activityInput[] + skipDuplicates?: boolean +} + +export type ComplexUpsertWithWhereUniqueWithoutBusiness_activityInput = { + where: Prisma.ComplexWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type ComplexUpdateWithWhereUniqueWithoutBusiness_activityInput = { + where: Prisma.ComplexWhereUniqueInput + data: Prisma.XOR +} + +export type ComplexUpdateManyWithWhereWithoutBusiness_activityInput = { + where: Prisma.ComplexScalarWhereInput + data: Prisma.XOR +} + +export type ComplexScalarWhereInput = { + AND?: Prisma.ComplexScalarWhereInput | Prisma.ComplexScalarWhereInput[] + OR?: Prisma.ComplexScalarWhereInput[] + NOT?: Prisma.ComplexScalarWhereInput | Prisma.ComplexScalarWhereInput[] + id?: Prisma.StringFilter<"Complex"> | string + name?: Prisma.StringFilter<"Complex"> | string + address?: Prisma.StringNullableFilter<"Complex"> | string | null + tax_id?: Prisma.StringNullableFilter<"Complex"> | string | null + business_activity_id?: Prisma.StringFilter<"Complex"> | string +} + +export type ComplexCreateWithoutPos_listInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + business_activity: Prisma.BusinessActivityCreateNestedOneWithoutComplexesInput + goods?: Prisma.GoodCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateWithoutPos_listInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + business_activity_id: string + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexCreateOrConnectWithoutPos_listInput = { + where: Prisma.ComplexWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexUpsertWithoutPos_listInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ComplexWhereInput +} + +export type ComplexUpdateToOneWithWhereWithoutPos_listInput = { + where?: Prisma.ComplexWhereInput + data: Prisma.XOR +} + +export type ComplexUpdateWithoutPos_listInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput + goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateWithoutPos_listInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string + goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexCreateWithoutGoodsInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + business_activity: Prisma.BusinessActivityCreateNestedOneWithoutComplexesInput + pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateWithoutGoodsInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + business_activity_id: string + pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput + good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexCreateOrConnectWithoutGoodsInput = { + where: Prisma.ComplexWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexUpsertWithoutGoodsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ComplexWhereInput +} + +export type ComplexUpdateToOneWithWhereWithoutGoodsInput = { + where?: Prisma.ComplexWhereInput + data: Prisma.XOR +} + +export type ComplexUpdateWithoutGoodsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput + pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateWithoutGoodsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexCreateWithoutGood_categoriesInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + business_activity: Prisma.BusinessActivityCreateNestedOneWithoutComplexesInput + pos_list?: Prisma.PosCreateNestedManyWithoutComplexInput + goods?: Prisma.GoodCreateNestedManyWithoutComplexInput +} + +export type ComplexUncheckedCreateWithoutGood_categoriesInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null + business_activity_id: string + pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutComplexInput + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutComplexInput +} + +export type ComplexCreateOrConnectWithoutGood_categoriesInput = { + where: Prisma.ComplexWhereUniqueInput + create: Prisma.XOR +} + +export type ComplexUpsertWithoutGood_categoriesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ComplexWhereInput +} + +export type ComplexUpdateToOneWithWhereWithoutGood_categoriesInput = { + where?: Prisma.ComplexWhereInput + data: Prisma.XOR +} + +export type ComplexUpdateWithoutGood_categoriesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activity?: Prisma.BusinessActivityUpdateOneRequiredWithoutComplexesNestedInput + pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput + goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateWithoutGood_categoriesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activity_id?: Prisma.StringFieldUpdateOperationsInput | string + pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput + goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexCreateManyBusiness_activityInput = { + id?: string + name: string + address?: string | null + tax_id?: string | null +} + +export type ComplexUpdateWithoutBusiness_activityInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_list?: Prisma.PosUpdateManyWithoutComplexNestedInput + goods?: Prisma.GoodUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateWithoutBusiness_activityInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_list?: Prisma.PosUncheckedUpdateManyWithoutComplexNestedInput + goods?: Prisma.GoodUncheckedUpdateManyWithoutComplexNestedInput + good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput +} + +export type ComplexUncheckedUpdateManyWithoutBusiness_activityInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + tax_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + +/** + * Count Type ComplexCountOutputType + */ + +export type ComplexCountOutputType = { + pos_list: number + goods: number + good_categories: number +} + +export type ComplexCountOutputTypeSelect = { + pos_list?: boolean | ComplexCountOutputTypeCountPos_listArgs + goods?: boolean | ComplexCountOutputTypeCountGoodsArgs + good_categories?: boolean | ComplexCountOutputTypeCountGood_categoriesArgs +} + +/** + * ComplexCountOutputType without action + */ +export type ComplexCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the ComplexCountOutputType + */ + select?: Prisma.ComplexCountOutputTypeSelect | null +} + +/** + * ComplexCountOutputType without action + */ +export type ComplexCountOutputTypeCountPos_listArgs = { + where?: Prisma.PosWhereInput +} + +/** + * ComplexCountOutputType without action + */ +export type ComplexCountOutputTypeCountGoodsArgs = { + where?: Prisma.GoodWhereInput +} + +/** + * ComplexCountOutputType without action + */ +export type ComplexCountOutputTypeCountGood_categoriesArgs = { + where?: Prisma.GoodCategoryWhereInput +} + + +export type ComplexSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + address?: boolean + tax_id?: boolean + business_activity_id?: boolean + business_activity?: boolean | Prisma.BusinessActivityDefaultArgs + pos_list?: boolean | Prisma.Complex$pos_listArgs + goods?: boolean | Prisma.Complex$goodsArgs + good_categories?: boolean | Prisma.Complex$good_categoriesArgs + _count?: boolean | Prisma.ComplexCountOutputTypeDefaultArgs +}, ExtArgs["result"]["complex"]> + + + +export type ComplexSelectScalar = { + id?: boolean + name?: boolean + address?: boolean + tax_id?: boolean + business_activity_id?: boolean +} + +export type ComplexOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "address" | "tax_id" | "business_activity_id", ExtArgs["result"]["complex"]> +export type ComplexInclude = { + business_activity?: boolean | Prisma.BusinessActivityDefaultArgs + pos_list?: boolean | Prisma.Complex$pos_listArgs + goods?: boolean | Prisma.Complex$goodsArgs + good_categories?: boolean | Prisma.Complex$good_categoriesArgs + _count?: boolean | Prisma.ComplexCountOutputTypeDefaultArgs +} + +export type $ComplexPayload = { + name: "Complex" + objects: { + business_activity: Prisma.$BusinessActivityPayload + pos_list: Prisma.$PosPayload[] + goods: Prisma.$GoodPayload[] + good_categories: Prisma.$GoodCategoryPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + address: string | null + tax_id: string | null + business_activity_id: string + }, ExtArgs["result"]["complex"]> + composites: {} +} + +export type ComplexGetPayload = runtime.Types.Result.GetResult + +export type ComplexCountArgs = + Omit & { + select?: ComplexCountAggregateInputType | true + } + +export interface ComplexDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Complex'], meta: { name: 'Complex' } } + /** + * Find zero or one Complex that matches the filter. + * @param {ComplexFindUniqueArgs} args - Arguments to find a Complex + * @example + * // Get one Complex + * const complex = await prisma.complex.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Complex that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ComplexFindUniqueOrThrowArgs} args - Arguments to find a Complex + * @example + * // Get one Complex + * const complex = await prisma.complex.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Complex that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexFindFirstArgs} args - Arguments to find a Complex + * @example + * // Get one Complex + * const complex = await prisma.complex.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Complex that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexFindFirstOrThrowArgs} args - Arguments to find a Complex + * @example + * // Get one Complex + * const complex = await prisma.complex.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Complexes that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Complexes + * const complexes = await prisma.complex.findMany() + * + * // Get first 10 Complexes + * const complexes = await prisma.complex.findMany({ take: 10 }) + * + * // Only select the `id` + * const complexWithIdOnly = await prisma.complex.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Complex. + * @param {ComplexCreateArgs} args - Arguments to create a Complex. + * @example + * // Create one Complex + * const Complex = await prisma.complex.create({ + * data: { + * // ... data to create a Complex + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Complexes. + * @param {ComplexCreateManyArgs} args - Arguments to create many Complexes. + * @example + * // Create many Complexes + * const complex = await prisma.complex.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a Complex. + * @param {ComplexDeleteArgs} args - Arguments to delete one Complex. + * @example + * // Delete one Complex + * const Complex = await prisma.complex.delete({ + * where: { + * // ... filter to delete one Complex + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Complex. + * @param {ComplexUpdateArgs} args - Arguments to update one Complex. + * @example + * // Update one Complex + * const complex = await prisma.complex.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Complexes. + * @param {ComplexDeleteManyArgs} args - Arguments to filter Complexes to delete. + * @example + * // Delete a few Complexes + * const { count } = await prisma.complex.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Complexes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Complexes + * const complex = await prisma.complex.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Complex. + * @param {ComplexUpsertArgs} args - Arguments to update or create a Complex. + * @example + * // Update or create a Complex + * const complex = await prisma.complex.upsert({ + * create: { + * // ... data to create a Complex + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Complex we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__ComplexClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Complexes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexCountArgs} args - Arguments to filter Complexes to count. + * @example + * // Count the number of Complexes + * const count = await prisma.complex.count({ + * where: { + * // ... the filter for the Complexes we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Complex. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Complex. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ComplexGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends ComplexGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: ComplexGroupByArgs['orderBy'] } + : { orderBy?: ComplexGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetComplexGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Complex model + */ +readonly fields: ComplexFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Complex. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__ComplexClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + business_activity = {}>(args?: Prisma.Subset>): Prisma.Prisma__BusinessActivityClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + pos_list = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + goods = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + good_categories = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Complex model + */ +export interface ComplexFieldRefs { + readonly id: Prisma.FieldRef<"Complex", 'String'> + readonly name: Prisma.FieldRef<"Complex", 'String'> + readonly address: Prisma.FieldRef<"Complex", 'String'> + readonly tax_id: Prisma.FieldRef<"Complex", 'String'> + readonly business_activity_id: Prisma.FieldRef<"Complex", 'String'> +} + + +// Custom InputTypes +/** + * Complex findUnique + */ +export type ComplexFindUniqueArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter, which Complex to fetch. + */ + where: Prisma.ComplexWhereUniqueInput +} + +/** + * Complex findUniqueOrThrow + */ +export type ComplexFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter, which Complex to fetch. + */ + where: Prisma.ComplexWhereUniqueInput +} + +/** + * Complex findFirst + */ +export type ComplexFindFirstArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter, which Complex to fetch. + */ + where?: Prisma.ComplexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Complexes to fetch. + */ + orderBy?: Prisma.ComplexOrderByWithRelationInput | Prisma.ComplexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Complexes. + */ + cursor?: Prisma.ComplexWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Complexes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Complexes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Complexes. + */ + distinct?: Prisma.ComplexScalarFieldEnum | Prisma.ComplexScalarFieldEnum[] +} + +/** + * Complex findFirstOrThrow + */ +export type ComplexFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter, which Complex to fetch. + */ + where?: Prisma.ComplexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Complexes to fetch. + */ + orderBy?: Prisma.ComplexOrderByWithRelationInput | Prisma.ComplexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Complexes. + */ + cursor?: Prisma.ComplexWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Complexes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Complexes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Complexes. + */ + distinct?: Prisma.ComplexScalarFieldEnum | Prisma.ComplexScalarFieldEnum[] +} + +/** + * Complex findMany + */ +export type ComplexFindManyArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter, which Complexes to fetch. + */ + where?: Prisma.ComplexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Complexes to fetch. + */ + orderBy?: Prisma.ComplexOrderByWithRelationInput | Prisma.ComplexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Complexes. + */ + cursor?: Prisma.ComplexWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Complexes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Complexes. + */ + skip?: number + distinct?: Prisma.ComplexScalarFieldEnum | Prisma.ComplexScalarFieldEnum[] +} + +/** + * Complex create + */ +export type ComplexCreateArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * The data needed to create a Complex. + */ + data: Prisma.XOR +} + +/** + * Complex createMany + */ +export type ComplexCreateManyArgs = { + /** + * The data used to create many Complexes. + */ + data: Prisma.ComplexCreateManyInput | Prisma.ComplexCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Complex update + */ +export type ComplexUpdateArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * The data needed to update a Complex. + */ + data: Prisma.XOR + /** + * Choose, which Complex to update. + */ + where: Prisma.ComplexWhereUniqueInput +} + +/** + * Complex updateMany + */ +export type ComplexUpdateManyArgs = { + /** + * The data used to update Complexes. + */ + data: Prisma.XOR + /** + * Filter which Complexes to update + */ + where?: Prisma.ComplexWhereInput + /** + * Limit how many Complexes to update. + */ + limit?: number +} + +/** + * Complex upsert + */ +export type ComplexUpsertArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * The filter to search for the Complex to update in case it exists. + */ + where: Prisma.ComplexWhereUniqueInput + /** + * In case the Complex found by the `where` argument doesn't exist, create a new Complex with this data. + */ + create: Prisma.XOR + /** + * In case the Complex was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Complex delete + */ +export type ComplexDeleteArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + /** + * Filter which Complex to delete. + */ + where: Prisma.ComplexWhereUniqueInput +} + +/** + * Complex deleteMany + */ +export type ComplexDeleteManyArgs = { + /** + * Filter which Complexes to delete + */ + where?: Prisma.ComplexWhereInput + /** + * Limit how many Complexes to delete. + */ + limit?: number +} + +/** + * Complex.pos_list + */ +export type Complex$pos_listArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + where?: Prisma.PosWhereInput + orderBy?: Prisma.PosOrderByWithRelationInput | Prisma.PosOrderByWithRelationInput[] + cursor?: Prisma.PosWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PosScalarFieldEnum | Prisma.PosScalarFieldEnum[] +} + +/** + * Complex.goods + */ +export type Complex$goodsArgs = { + /** + * Select specific fields to fetch from the Good + */ + select?: Prisma.GoodSelect | null + /** + * Omit specific fields from the Good + */ + omit?: Prisma.GoodOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GoodInclude | null + where?: Prisma.GoodWhereInput + orderBy?: Prisma.GoodOrderByWithRelationInput | Prisma.GoodOrderByWithRelationInput[] + cursor?: Prisma.GoodWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.GoodScalarFieldEnum | Prisma.GoodScalarFieldEnum[] +} + +/** + * Complex.good_categories + */ +export type Complex$good_categoriesArgs = { + /** + * Select specific fields to fetch from the GoodCategory + */ + select?: Prisma.GoodCategorySelect | null + /** + * Omit specific fields from the GoodCategory + */ + omit?: Prisma.GoodCategoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GoodCategoryInclude | null + where?: Prisma.GoodCategoryWhereInput + orderBy?: Prisma.GoodCategoryOrderByWithRelationInput | Prisma.GoodCategoryOrderByWithRelationInput[] + cursor?: Prisma.GoodCategoryWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.GoodCategoryScalarFieldEnum | Prisma.GoodCategoryScalarFieldEnum[] +} + +/** + * Complex without action + */ +export type ComplexDefaultArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null +} diff --git a/src/generated/prisma/models/Customer.ts b/src/generated/prisma/models/Customer.ts index aeb46fc..1101653 100644 --- a/src/generated/prisma/models/Customer.ts +++ b/src/generated/prisma/models/Customer.ts @@ -387,14 +387,6 @@ export type CustomerNullableScalarRelationFilter = { isNot?: Prisma.CustomerWhereInput | null } -export type StringFieldUpdateOperationsInput = { - set?: string -} - -export type DateTimeFieldUpdateOperationsInput = { - set?: Date | string -} - export type NullableDateTimeFieldUpdateOperationsInput = { set?: Date | string | null } diff --git a/src/generated/prisma/models/CustomerIndividual.ts b/src/generated/prisma/models/CustomerIndividual.ts index 502568f..da398ac 100644 --- a/src/generated/prisma/models/CustomerIndividual.ts +++ b/src/generated/prisma/models/CustomerIndividual.ts @@ -401,10 +401,6 @@ export type CustomerIndividualUncheckedUpdateOneWithoutCustomerNestedInput = { update?: Prisma.XOR, Prisma.CustomerIndividualUncheckedUpdateWithoutCustomerInput> } -export type NullableStringFieldUpdateOperationsInput = { - set?: string | null -} - export type CustomerIndividualCreateWithoutCustomerInput = { first_name: string last_name: string diff --git a/src/generated/prisma/models/CustomerLegal.ts b/src/generated/prisma/models/CustomerLegal.ts index 042cbc9..900998c 100644 --- a/src/generated/prisma/models/CustomerLegal.ts +++ b/src/generated/prisma/models/CustomerLegal.ts @@ -206,17 +206,17 @@ export type CustomerLegalOrderByWithRelationInput = { export type CustomerLegalWhereUniqueInput = Prisma.AtLeast<{ customer_id?: string - registration_number?: string complex_id_registration_number?: Prisma.CustomerLegalComplex_idRegistration_numberCompoundUniqueInput AND?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[] OR?: Prisma.CustomerLegalWhereInput[] NOT?: Prisma.CustomerLegalWhereInput | Prisma.CustomerLegalWhereInput[] company_name?: Prisma.StringFilter<"CustomerLegal"> | string economic_code?: Prisma.StringFilter<"CustomerLegal"> | string + registration_number?: Prisma.StringFilter<"CustomerLegal"> | string postal_code?: Prisma.StringFilter<"CustomerLegal"> | string complex_id?: Prisma.StringFilter<"CustomerLegal"> | string customer?: Prisma.XOR -}, "customer_id" | "registration_number" | "complex_id_registration_number"> +}, "customer_id" | "complex_id_registration_number"> export type CustomerLegalOrderByWithAggregationInput = { customer_id?: Prisma.SortOrder diff --git a/src/generated/prisma/models/Device.ts b/src/generated/prisma/models/Device.ts index b343d73..c05bfed 100644 --- a/src/generated/prisma/models/Device.ts +++ b/src/generated/prisma/models/Device.ts @@ -25,101 +25,59 @@ export type AggregateDevice = { } export type DeviceMinAggregateOutputType = { - account_id: string | null - app_version: string | null - build_number: string | null - uuid: string | null - platform: string | null - brand: string | null - model: string | null - device: string | null + id: string | null + name: string | null os_version: string | null - sdk_version: string | null - release_number: string | null - browser_name: string | null - fcm_token: string | null + created_at: Date | null + updated_at: Date | null + brand_id: string | null } export type DeviceMaxAggregateOutputType = { - account_id: string | null - app_version: string | null - build_number: string | null - uuid: string | null - platform: string | null - brand: string | null - model: string | null - device: string | null + id: string | null + name: string | null os_version: string | null - sdk_version: string | null - release_number: string | null - browser_name: string | null - fcm_token: string | null + created_at: Date | null + updated_at: Date | null + brand_id: string | null } export type DeviceCountAggregateOutputType = { - account_id: number - app_version: number - build_number: number - uuid: number - platform: number - brand: number - model: number - device: number + id: number + name: number os_version: number - sdk_version: number - release_number: number - browser_name: number - fcm_token: number + created_at: number + updated_at: number + brand_id: number _all: number } export type DeviceMinAggregateInputType = { - account_id?: true - app_version?: true - build_number?: true - uuid?: true - platform?: true - brand?: true - model?: true - device?: true + id?: true + name?: true os_version?: true - sdk_version?: true - release_number?: true - browser_name?: true - fcm_token?: true + created_at?: true + updated_at?: true + brand_id?: true } export type DeviceMaxAggregateInputType = { - account_id?: true - app_version?: true - build_number?: true - uuid?: true - platform?: true - brand?: true - model?: true - device?: true + id?: true + name?: true os_version?: true - sdk_version?: true - release_number?: true - browser_name?: true - fcm_token?: true + created_at?: true + updated_at?: true + brand_id?: true } export type DeviceCountAggregateInputType = { - account_id?: true - app_version?: true - build_number?: true - uuid?: true - platform?: true - brand?: true - model?: true - device?: true + id?: true + name?: true os_version?: true - sdk_version?: true - release_number?: true - browser_name?: true - fcm_token?: true + created_at?: true + updated_at?: true + brand_id?: true _all?: true } @@ -196,19 +154,12 @@ export type DeviceGroupByArgs | string | null - app_version?: Prisma.StringFilter<"Device"> | string - build_number?: Prisma.StringFilter<"Device"> | string - uuid?: Prisma.StringFilter<"Device"> | string - platform?: Prisma.StringFilter<"Device"> | string - brand?: Prisma.StringFilter<"Device"> | string - model?: Prisma.StringFilter<"Device"> | string - device?: Prisma.StringFilter<"Device"> | string - os_version?: Prisma.StringFilter<"Device"> | string - sdk_version?: Prisma.StringFilter<"Device"> | string - release_number?: Prisma.StringFilter<"Device"> | string - browser_name?: Prisma.StringNullableFilter<"Device"> | string | null - fcm_token?: Prisma.StringNullableFilter<"Device"> | string | null + id?: Prisma.StringFilter<"Device"> | string + name?: Prisma.StringFilter<"Device"> | string + os_version?: Prisma.StringNullableFilter<"Device"> | string | null + created_at?: Prisma.DateTimeFilter<"Device"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Device"> | Date | string + brand_id?: Prisma.StringFilter<"Device"> | string + brand?: Prisma.XOR + poses?: Prisma.PosListRelationFilter } export type DeviceOrderByWithRelationInput = { - account_id?: Prisma.SortOrderInput | Prisma.SortOrder - app_version?: Prisma.SortOrder - build_number?: Prisma.SortOrder - uuid?: Prisma.SortOrder - platform?: Prisma.SortOrder - brand?: Prisma.SortOrder - model?: Prisma.SortOrder - device?: Prisma.SortOrder - os_version?: Prisma.SortOrder - sdk_version?: Prisma.SortOrder - release_number?: Prisma.SortOrder - browser_name?: Prisma.SortOrderInput | Prisma.SortOrder - fcm_token?: Prisma.SortOrderInput | Prisma.SortOrder + id?: Prisma.SortOrder + name?: Prisma.SortOrder + os_version?: Prisma.SortOrderInput | Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + brand_id?: Prisma.SortOrder + brand?: Prisma.DeviceBrandOrderByWithRelationInput + poses?: Prisma.PosOrderByRelationAggregateInput _relevance?: Prisma.DeviceOrderByRelevanceInput } export type DeviceWhereUniqueInput = Prisma.AtLeast<{ - uuid?: string + id?: string AND?: Prisma.DeviceWhereInput | Prisma.DeviceWhereInput[] OR?: Prisma.DeviceWhereInput[] NOT?: Prisma.DeviceWhereInput | Prisma.DeviceWhereInput[] - account_id?: Prisma.StringNullableFilter<"Device"> | string | null - app_version?: Prisma.StringFilter<"Device"> | string - build_number?: Prisma.StringFilter<"Device"> | string - platform?: Prisma.StringFilter<"Device"> | string - brand?: Prisma.StringFilter<"Device"> | string - model?: Prisma.StringFilter<"Device"> | string - device?: Prisma.StringFilter<"Device"> | string - os_version?: Prisma.StringFilter<"Device"> | string - sdk_version?: Prisma.StringFilter<"Device"> | string - release_number?: Prisma.StringFilter<"Device"> | string - browser_name?: Prisma.StringNullableFilter<"Device"> | string | null - fcm_token?: Prisma.StringNullableFilter<"Device"> | string | null -}, "uuid" | "uuid"> + name?: Prisma.StringFilter<"Device"> | string + os_version?: Prisma.StringNullableFilter<"Device"> | string | null + created_at?: Prisma.DateTimeFilter<"Device"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Device"> | Date | string + brand_id?: Prisma.StringFilter<"Device"> | string + brand?: Prisma.XOR + poses?: Prisma.PosListRelationFilter +}, "id"> export type DeviceOrderByWithAggregationInput = { - account_id?: Prisma.SortOrderInput | Prisma.SortOrder - app_version?: Prisma.SortOrder - build_number?: Prisma.SortOrder - uuid?: Prisma.SortOrder - platform?: Prisma.SortOrder - brand?: Prisma.SortOrder - model?: Prisma.SortOrder - device?: Prisma.SortOrder - os_version?: Prisma.SortOrder - sdk_version?: Prisma.SortOrder - release_number?: Prisma.SortOrder - browser_name?: Prisma.SortOrderInput | Prisma.SortOrder - fcm_token?: Prisma.SortOrderInput | Prisma.SortOrder + id?: Prisma.SortOrder + name?: Prisma.SortOrder + os_version?: Prisma.SortOrderInput | Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + brand_id?: Prisma.SortOrder _count?: Prisma.DeviceCountOrderByAggregateInput _max?: Prisma.DeviceMaxOrderByAggregateInput _min?: Prisma.DeviceMinOrderByAggregateInput @@ -307,131 +236,93 @@ export type DeviceScalarWhereWithAggregatesInput = { AND?: Prisma.DeviceScalarWhereWithAggregatesInput | Prisma.DeviceScalarWhereWithAggregatesInput[] OR?: Prisma.DeviceScalarWhereWithAggregatesInput[] NOT?: Prisma.DeviceScalarWhereWithAggregatesInput | Prisma.DeviceScalarWhereWithAggregatesInput[] - account_id?: Prisma.StringNullableWithAggregatesFilter<"Device"> | string | null - app_version?: Prisma.StringWithAggregatesFilter<"Device"> | string - build_number?: Prisma.StringWithAggregatesFilter<"Device"> | string - uuid?: Prisma.StringWithAggregatesFilter<"Device"> | string - platform?: Prisma.StringWithAggregatesFilter<"Device"> | string - brand?: Prisma.StringWithAggregatesFilter<"Device"> | string - model?: Prisma.StringWithAggregatesFilter<"Device"> | string - device?: Prisma.StringWithAggregatesFilter<"Device"> | string - os_version?: Prisma.StringWithAggregatesFilter<"Device"> | string - sdk_version?: Prisma.StringWithAggregatesFilter<"Device"> | string - release_number?: Prisma.StringWithAggregatesFilter<"Device"> | string - browser_name?: Prisma.StringNullableWithAggregatesFilter<"Device"> | string | null - fcm_token?: Prisma.StringNullableWithAggregatesFilter<"Device"> | string | null + id?: Prisma.StringWithAggregatesFilter<"Device"> | string + name?: Prisma.StringWithAggregatesFilter<"Device"> | string + os_version?: Prisma.StringNullableWithAggregatesFilter<"Device"> | string | null + created_at?: Prisma.DateTimeWithAggregatesFilter<"Device"> | Date | string + updated_at?: Prisma.DateTimeWithAggregatesFilter<"Device"> | Date | string + brand_id?: Prisma.StringWithAggregatesFilter<"Device"> | string } export type DeviceCreateInput = { - account_id?: string | null - app_version: string - build_number: string - uuid: string - platform: string - brand: string - model: string - device: string - os_version: string - sdk_version: string - release_number: string - browser_name?: string | null - fcm_token?: string | null + id?: string + name: string + os_version?: string | null + created_at?: Date | string + updated_at?: Date | string + brand: Prisma.DeviceBrandCreateNestedOneWithoutDevicesInput + poses?: Prisma.PosCreateNestedManyWithoutDeviceInput } export type DeviceUncheckedCreateInput = { - account_id?: string | null - app_version: string - build_number: string - uuid: string - platform: string - brand: string - model: string - device: string - os_version: string - sdk_version: string - release_number: string - browser_name?: string | null - fcm_token?: string | null + id?: string + name: string + os_version?: string | null + created_at?: Date | string + updated_at?: Date | string + brand_id: string + poses?: Prisma.PosUncheckedCreateNestedManyWithoutDeviceInput } export type DeviceUpdateInput = { - account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - app_version?: Prisma.StringFieldUpdateOperationsInput | string - build_number?: Prisma.StringFieldUpdateOperationsInput | string - uuid?: Prisma.StringFieldUpdateOperationsInput | string - platform?: Prisma.StringFieldUpdateOperationsInput | string - brand?: Prisma.StringFieldUpdateOperationsInput | string - model?: Prisma.StringFieldUpdateOperationsInput | string - device?: Prisma.StringFieldUpdateOperationsInput | string - os_version?: Prisma.StringFieldUpdateOperationsInput | string - sdk_version?: Prisma.StringFieldUpdateOperationsInput | string - release_number?: Prisma.StringFieldUpdateOperationsInput | string - browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + brand?: Prisma.DeviceBrandUpdateOneRequiredWithoutDevicesNestedInput + poses?: Prisma.PosUpdateManyWithoutDeviceNestedInput } export type DeviceUncheckedUpdateInput = { - account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - app_version?: Prisma.StringFieldUpdateOperationsInput | string - build_number?: Prisma.StringFieldUpdateOperationsInput | string - uuid?: Prisma.StringFieldUpdateOperationsInput | string - platform?: Prisma.StringFieldUpdateOperationsInput | string - brand?: Prisma.StringFieldUpdateOperationsInput | string - model?: Prisma.StringFieldUpdateOperationsInput | string - device?: Prisma.StringFieldUpdateOperationsInput | string - os_version?: Prisma.StringFieldUpdateOperationsInput | string - sdk_version?: Prisma.StringFieldUpdateOperationsInput | string - release_number?: Prisma.StringFieldUpdateOperationsInput | string - browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + brand_id?: Prisma.StringFieldUpdateOperationsInput | string + poses?: Prisma.PosUncheckedUpdateManyWithoutDeviceNestedInput } export type DeviceCreateManyInput = { - account_id?: string | null - app_version: string - build_number: string - uuid: string - platform: string - brand: string - model: string - device: string - os_version: string - sdk_version: string - release_number: string - browser_name?: string | null - fcm_token?: string | null + id?: string + name: string + os_version?: string | null + created_at?: Date | string + updated_at?: Date | string + brand_id: string } export type DeviceUpdateManyMutationInput = { - account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - app_version?: Prisma.StringFieldUpdateOperationsInput | string - build_number?: Prisma.StringFieldUpdateOperationsInput | string - uuid?: Prisma.StringFieldUpdateOperationsInput | string - platform?: Prisma.StringFieldUpdateOperationsInput | string - brand?: Prisma.StringFieldUpdateOperationsInput | string - model?: Prisma.StringFieldUpdateOperationsInput | string - device?: Prisma.StringFieldUpdateOperationsInput | string - os_version?: Prisma.StringFieldUpdateOperationsInput | string - sdk_version?: Prisma.StringFieldUpdateOperationsInput | string - release_number?: Prisma.StringFieldUpdateOperationsInput | string - browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type DeviceUncheckedUpdateManyInput = { - account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - app_version?: Prisma.StringFieldUpdateOperationsInput | string - build_number?: Prisma.StringFieldUpdateOperationsInput | string - uuid?: Prisma.StringFieldUpdateOperationsInput | string - platform?: Prisma.StringFieldUpdateOperationsInput | string - brand?: Prisma.StringFieldUpdateOperationsInput | string - model?: Prisma.StringFieldUpdateOperationsInput | string - device?: Prisma.StringFieldUpdateOperationsInput | string - os_version?: Prisma.StringFieldUpdateOperationsInput | string - sdk_version?: Prisma.StringFieldUpdateOperationsInput | string - release_number?: Prisma.StringFieldUpdateOperationsInput | string - browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + brand_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type DeviceScalarRelationFilter = { + is?: Prisma.DeviceWhereInput + isNot?: Prisma.DeviceWhereInput +} + +export type DeviceListRelationFilter = { + every?: Prisma.DeviceWhereInput + some?: Prisma.DeviceWhereInput + none?: Prisma.DeviceWhereInput +} + +export type DeviceOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder } export type DeviceOrderByRelevanceInput = { @@ -441,108 +332,304 @@ export type DeviceOrderByRelevanceInput = { } export type DeviceCountOrderByAggregateInput = { - account_id?: Prisma.SortOrder - app_version?: Prisma.SortOrder - build_number?: Prisma.SortOrder - uuid?: Prisma.SortOrder - platform?: Prisma.SortOrder - brand?: Prisma.SortOrder - model?: Prisma.SortOrder - device?: Prisma.SortOrder + id?: Prisma.SortOrder + name?: Prisma.SortOrder os_version?: Prisma.SortOrder - sdk_version?: Prisma.SortOrder - release_number?: Prisma.SortOrder - browser_name?: Prisma.SortOrder - fcm_token?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + brand_id?: Prisma.SortOrder } export type DeviceMaxOrderByAggregateInput = { - account_id?: Prisma.SortOrder - app_version?: Prisma.SortOrder - build_number?: Prisma.SortOrder - uuid?: Prisma.SortOrder - platform?: Prisma.SortOrder - brand?: Prisma.SortOrder - model?: Prisma.SortOrder - device?: Prisma.SortOrder + id?: Prisma.SortOrder + name?: Prisma.SortOrder os_version?: Prisma.SortOrder - sdk_version?: Prisma.SortOrder - release_number?: Prisma.SortOrder - browser_name?: Prisma.SortOrder - fcm_token?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + brand_id?: Prisma.SortOrder } export type DeviceMinOrderByAggregateInput = { - account_id?: Prisma.SortOrder - app_version?: Prisma.SortOrder - build_number?: Prisma.SortOrder - uuid?: Prisma.SortOrder - platform?: Prisma.SortOrder - brand?: Prisma.SortOrder - model?: Prisma.SortOrder - device?: Prisma.SortOrder + id?: Prisma.SortOrder + name?: Prisma.SortOrder os_version?: Prisma.SortOrder - sdk_version?: Prisma.SortOrder - release_number?: Prisma.SortOrder - browser_name?: Prisma.SortOrder - fcm_token?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + brand_id?: Prisma.SortOrder +} + +export type DeviceCreateNestedOneWithoutPosesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.DeviceCreateOrConnectWithoutPosesInput + connect?: Prisma.DeviceWhereUniqueInput +} + +export type DeviceUpdateOneRequiredWithoutPosesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.DeviceCreateOrConnectWithoutPosesInput + upsert?: Prisma.DeviceUpsertWithoutPosesInput + connect?: Prisma.DeviceWhereUniqueInput + update?: Prisma.XOR, Prisma.DeviceUncheckedUpdateWithoutPosesInput> +} + +export type DeviceCreateNestedManyWithoutBrandInput = { + create?: Prisma.XOR | Prisma.DeviceCreateWithoutBrandInput[] | Prisma.DeviceUncheckedCreateWithoutBrandInput[] + connectOrCreate?: Prisma.DeviceCreateOrConnectWithoutBrandInput | Prisma.DeviceCreateOrConnectWithoutBrandInput[] + createMany?: Prisma.DeviceCreateManyBrandInputEnvelope + connect?: Prisma.DeviceWhereUniqueInput | Prisma.DeviceWhereUniqueInput[] +} + +export type DeviceUncheckedCreateNestedManyWithoutBrandInput = { + create?: Prisma.XOR | Prisma.DeviceCreateWithoutBrandInput[] | Prisma.DeviceUncheckedCreateWithoutBrandInput[] + connectOrCreate?: Prisma.DeviceCreateOrConnectWithoutBrandInput | Prisma.DeviceCreateOrConnectWithoutBrandInput[] + createMany?: Prisma.DeviceCreateManyBrandInputEnvelope + connect?: Prisma.DeviceWhereUniqueInput | Prisma.DeviceWhereUniqueInput[] +} + +export type DeviceUpdateManyWithoutBrandNestedInput = { + create?: Prisma.XOR | Prisma.DeviceCreateWithoutBrandInput[] | Prisma.DeviceUncheckedCreateWithoutBrandInput[] + connectOrCreate?: Prisma.DeviceCreateOrConnectWithoutBrandInput | Prisma.DeviceCreateOrConnectWithoutBrandInput[] + upsert?: Prisma.DeviceUpsertWithWhereUniqueWithoutBrandInput | Prisma.DeviceUpsertWithWhereUniqueWithoutBrandInput[] + createMany?: Prisma.DeviceCreateManyBrandInputEnvelope + set?: Prisma.DeviceWhereUniqueInput | Prisma.DeviceWhereUniqueInput[] + disconnect?: Prisma.DeviceWhereUniqueInput | Prisma.DeviceWhereUniqueInput[] + delete?: Prisma.DeviceWhereUniqueInput | Prisma.DeviceWhereUniqueInput[] + connect?: Prisma.DeviceWhereUniqueInput | Prisma.DeviceWhereUniqueInput[] + update?: Prisma.DeviceUpdateWithWhereUniqueWithoutBrandInput | Prisma.DeviceUpdateWithWhereUniqueWithoutBrandInput[] + updateMany?: Prisma.DeviceUpdateManyWithWhereWithoutBrandInput | Prisma.DeviceUpdateManyWithWhereWithoutBrandInput[] + deleteMany?: Prisma.DeviceScalarWhereInput | Prisma.DeviceScalarWhereInput[] +} + +export type DeviceUncheckedUpdateManyWithoutBrandNestedInput = { + create?: Prisma.XOR | Prisma.DeviceCreateWithoutBrandInput[] | Prisma.DeviceUncheckedCreateWithoutBrandInput[] + connectOrCreate?: Prisma.DeviceCreateOrConnectWithoutBrandInput | Prisma.DeviceCreateOrConnectWithoutBrandInput[] + upsert?: Prisma.DeviceUpsertWithWhereUniqueWithoutBrandInput | Prisma.DeviceUpsertWithWhereUniqueWithoutBrandInput[] + createMany?: Prisma.DeviceCreateManyBrandInputEnvelope + set?: Prisma.DeviceWhereUniqueInput | Prisma.DeviceWhereUniqueInput[] + disconnect?: Prisma.DeviceWhereUniqueInput | Prisma.DeviceWhereUniqueInput[] + delete?: Prisma.DeviceWhereUniqueInput | Prisma.DeviceWhereUniqueInput[] + connect?: Prisma.DeviceWhereUniqueInput | Prisma.DeviceWhereUniqueInput[] + update?: Prisma.DeviceUpdateWithWhereUniqueWithoutBrandInput | Prisma.DeviceUpdateWithWhereUniqueWithoutBrandInput[] + updateMany?: Prisma.DeviceUpdateManyWithWhereWithoutBrandInput | Prisma.DeviceUpdateManyWithWhereWithoutBrandInput[] + deleteMany?: Prisma.DeviceScalarWhereInput | Prisma.DeviceScalarWhereInput[] +} + +export type DeviceCreateWithoutPosesInput = { + id?: string + name: string + os_version?: string | null + created_at?: Date | string + updated_at?: Date | string + brand: Prisma.DeviceBrandCreateNestedOneWithoutDevicesInput +} + +export type DeviceUncheckedCreateWithoutPosesInput = { + id?: string + name: string + os_version?: string | null + created_at?: Date | string + updated_at?: Date | string + brand_id: string +} + +export type DeviceCreateOrConnectWithoutPosesInput = { + where: Prisma.DeviceWhereUniqueInput + create: Prisma.XOR +} + +export type DeviceUpsertWithoutPosesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.DeviceWhereInput +} + +export type DeviceUpdateToOneWithWhereWithoutPosesInput = { + where?: Prisma.DeviceWhereInput + data: Prisma.XOR +} + +export type DeviceUpdateWithoutPosesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + brand?: Prisma.DeviceBrandUpdateOneRequiredWithoutDevicesNestedInput +} + +export type DeviceUncheckedUpdateWithoutPosesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + brand_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type DeviceCreateWithoutBrandInput = { + id?: string + name: string + os_version?: string | null + created_at?: Date | string + updated_at?: Date | string + poses?: Prisma.PosCreateNestedManyWithoutDeviceInput +} + +export type DeviceUncheckedCreateWithoutBrandInput = { + id?: string + name: string + os_version?: string | null + created_at?: Date | string + updated_at?: Date | string + poses?: Prisma.PosUncheckedCreateNestedManyWithoutDeviceInput +} + +export type DeviceCreateOrConnectWithoutBrandInput = { + where: Prisma.DeviceWhereUniqueInput + create: Prisma.XOR +} + +export type DeviceCreateManyBrandInputEnvelope = { + data: Prisma.DeviceCreateManyBrandInput | Prisma.DeviceCreateManyBrandInput[] + skipDuplicates?: boolean +} + +export type DeviceUpsertWithWhereUniqueWithoutBrandInput = { + where: Prisma.DeviceWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type DeviceUpdateWithWhereUniqueWithoutBrandInput = { + where: Prisma.DeviceWhereUniqueInput + data: Prisma.XOR +} + +export type DeviceUpdateManyWithWhereWithoutBrandInput = { + where: Prisma.DeviceScalarWhereInput + data: Prisma.XOR +} + +export type DeviceScalarWhereInput = { + AND?: Prisma.DeviceScalarWhereInput | Prisma.DeviceScalarWhereInput[] + OR?: Prisma.DeviceScalarWhereInput[] + NOT?: Prisma.DeviceScalarWhereInput | Prisma.DeviceScalarWhereInput[] + id?: Prisma.StringFilter<"Device"> | string + name?: Prisma.StringFilter<"Device"> | string + os_version?: Prisma.StringNullableFilter<"Device"> | string | null + created_at?: Prisma.DateTimeFilter<"Device"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Device"> | Date | string + brand_id?: Prisma.StringFilter<"Device"> | string +} + +export type DeviceCreateManyBrandInput = { + id?: string + name: string + os_version?: string | null + created_at?: Date | string + updated_at?: Date | string +} + +export type DeviceUpdateWithoutBrandInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + poses?: Prisma.PosUpdateManyWithoutDeviceNestedInput +} + +export type DeviceUncheckedUpdateWithoutBrandInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + poses?: Prisma.PosUncheckedUpdateManyWithoutDeviceNestedInput +} + +export type DeviceUncheckedUpdateManyWithoutBrandInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } +/** + * Count Type DeviceCountOutputType + */ + +export type DeviceCountOutputType = { + poses: number +} + +export type DeviceCountOutputTypeSelect = { + poses?: boolean | DeviceCountOutputTypeCountPosesArgs +} + +/** + * DeviceCountOutputType without action + */ +export type DeviceCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the DeviceCountOutputType + */ + select?: Prisma.DeviceCountOutputTypeSelect | null +} + +/** + * DeviceCountOutputType without action + */ +export type DeviceCountOutputTypeCountPosesArgs = { + where?: Prisma.PosWhereInput +} + export type DeviceSelect = runtime.Types.Extensions.GetSelect<{ - account_id?: boolean - app_version?: boolean - build_number?: boolean - uuid?: boolean - platform?: boolean - brand?: boolean - model?: boolean - device?: boolean + id?: boolean + name?: boolean os_version?: boolean - sdk_version?: boolean - release_number?: boolean - browser_name?: boolean - fcm_token?: boolean + created_at?: boolean + updated_at?: boolean + brand_id?: boolean + brand?: boolean | Prisma.DeviceBrandDefaultArgs + poses?: boolean | Prisma.Device$posesArgs + _count?: boolean | Prisma.DeviceCountOutputTypeDefaultArgs }, ExtArgs["result"]["device"]> export type DeviceSelectScalar = { - account_id?: boolean - app_version?: boolean - build_number?: boolean - uuid?: boolean - platform?: boolean - brand?: boolean - model?: boolean - device?: boolean + id?: boolean + name?: boolean os_version?: boolean - sdk_version?: boolean - release_number?: boolean - browser_name?: boolean - fcm_token?: boolean + created_at?: boolean + updated_at?: boolean + brand_id?: boolean } -export type DeviceOmit = runtime.Types.Extensions.GetOmit<"account_id" | "app_version" | "build_number" | "uuid" | "platform" | "brand" | "model" | "device" | "os_version" | "sdk_version" | "release_number" | "browser_name" | "fcm_token", ExtArgs["result"]["device"]> +export type DeviceOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "os_version" | "created_at" | "updated_at" | "brand_id", ExtArgs["result"]["device"]> +export type DeviceInclude = { + brand?: boolean | Prisma.DeviceBrandDefaultArgs + poses?: boolean | Prisma.Device$posesArgs + _count?: boolean | Prisma.DeviceCountOutputTypeDefaultArgs +} export type $DevicePayload = { name: "Device" - objects: {} + objects: { + brand: Prisma.$DeviceBrandPayload + poses: Prisma.$PosPayload[] + } scalars: runtime.Types.Extensions.GetPayloadResult<{ - account_id: string | null - app_version: string - build_number: string - uuid: string - platform: string - brand: string - model: string - device: string - os_version: string - sdk_version: string - release_number: string - browser_name: string | null - fcm_token: string | null + id: string + name: string + os_version: string | null + created_at: Date + updated_at: Date + brand_id: string }, ExtArgs["result"]["device"]> composites: {} } @@ -626,8 +713,8 @@ export interface DeviceDelegate(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> @@ -883,6 +970,8 @@ readonly fields: DeviceFieldRefs; */ export interface Prisma__DeviceClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" + brand = {}>(args?: Prisma.Subset>): Prisma.Prisma__DeviceBrandClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + poses = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -912,19 +1001,12 @@ export interface Prisma__DeviceClient - readonly app_version: Prisma.FieldRef<"Device", 'String'> - readonly build_number: Prisma.FieldRef<"Device", 'String'> - readonly uuid: Prisma.FieldRef<"Device", 'String'> - readonly platform: Prisma.FieldRef<"Device", 'String'> - readonly brand: Prisma.FieldRef<"Device", 'String'> - readonly model: Prisma.FieldRef<"Device", 'String'> - readonly device: Prisma.FieldRef<"Device", 'String'> + readonly id: Prisma.FieldRef<"Device", 'String'> + readonly name: Prisma.FieldRef<"Device", 'String'> readonly os_version: Prisma.FieldRef<"Device", 'String'> - readonly sdk_version: Prisma.FieldRef<"Device", 'String'> - readonly release_number: Prisma.FieldRef<"Device", 'String'> - readonly browser_name: Prisma.FieldRef<"Device", 'String'> - readonly fcm_token: Prisma.FieldRef<"Device", 'String'> + readonly created_at: Prisma.FieldRef<"Device", 'DateTime'> + readonly updated_at: Prisma.FieldRef<"Device", 'DateTime'> + readonly brand_id: Prisma.FieldRef<"Device", 'String'> } @@ -941,6 +1023,10 @@ export type DeviceFindUniqueArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null /** * Filter, which Device to fetch. */ @@ -959,6 +1045,10 @@ export type DeviceFindUniqueOrThrowArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null /** * Filter, which Device to fetch. */ @@ -977,6 +1067,10 @@ export type DeviceFindFirstArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null /** * Filter, which Device to fetch. */ @@ -1025,6 +1119,10 @@ export type DeviceFindFirstOrThrowArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null /** * Filter, which Device to fetch. */ @@ -1073,6 +1171,10 @@ export type DeviceFindManyArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null /** * Filter, which Devices to fetch. */ @@ -1116,6 +1218,10 @@ export type DeviceCreateArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null /** * The data needed to create a Device. */ @@ -1145,6 +1251,10 @@ export type DeviceUpdateArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null /** * The data needed to update a Device. */ @@ -1185,6 +1295,10 @@ export type DeviceUpsertArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null /** * The filter to search for the Device to update in case it exists. */ @@ -1211,6 +1325,10 @@ export type DeviceDeleteArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null /** * Filter which Device to delete. */ @@ -1231,6 +1349,30 @@ export type DeviceDeleteManyArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + where?: Prisma.PosWhereInput + orderBy?: Prisma.PosOrderByWithRelationInput | Prisma.PosOrderByWithRelationInput[] + cursor?: Prisma.PosWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PosScalarFieldEnum | Prisma.PosScalarFieldEnum[] +} + /** * Device without action */ @@ -1243,4 +1385,8 @@ export type DeviceDefaultArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null } diff --git a/src/generated/prisma/models/DeviceBrand.ts b/src/generated/prisma/models/DeviceBrand.ts new file mode 100644 index 0000000..b73194a --- /dev/null +++ b/src/generated/prisma/models/DeviceBrand.ts @@ -0,0 +1,1184 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `DeviceBrand` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model DeviceBrand + * + */ +export type DeviceBrandModel = runtime.Types.Result.DefaultSelection + +export type AggregateDeviceBrand = { + _count: DeviceBrandCountAggregateOutputType | null + _min: DeviceBrandMinAggregateOutputType | null + _max: DeviceBrandMaxAggregateOutputType | null +} + +export type DeviceBrandMinAggregateOutputType = { + id: string | null + name: string | null + created_at: Date | null + updated_at: Date | null +} + +export type DeviceBrandMaxAggregateOutputType = { + id: string | null + name: string | null + created_at: Date | null + updated_at: Date | null +} + +export type DeviceBrandCountAggregateOutputType = { + id: number + name: number + created_at: number + updated_at: number + _all: number +} + + +export type DeviceBrandMinAggregateInputType = { + id?: true + name?: true + created_at?: true + updated_at?: true +} + +export type DeviceBrandMaxAggregateInputType = { + id?: true + name?: true + created_at?: true + updated_at?: true +} + +export type DeviceBrandCountAggregateInputType = { + id?: true + name?: true + created_at?: true + updated_at?: true + _all?: true +} + +export type DeviceBrandAggregateArgs = { + /** + * Filter which DeviceBrand to aggregate. + */ + where?: Prisma.DeviceBrandWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DeviceBrands to fetch. + */ + orderBy?: Prisma.DeviceBrandOrderByWithRelationInput | Prisma.DeviceBrandOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.DeviceBrandWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DeviceBrands from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DeviceBrands. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned DeviceBrands + **/ + _count?: true | DeviceBrandCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: DeviceBrandMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: DeviceBrandMaxAggregateInputType +} + +export type GetDeviceBrandAggregateType = { + [P in keyof T & keyof AggregateDeviceBrand]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type DeviceBrandGroupByArgs = { + where?: Prisma.DeviceBrandWhereInput + orderBy?: Prisma.DeviceBrandOrderByWithAggregationInput | Prisma.DeviceBrandOrderByWithAggregationInput[] + by: Prisma.DeviceBrandScalarFieldEnum[] | Prisma.DeviceBrandScalarFieldEnum + having?: Prisma.DeviceBrandScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: DeviceBrandCountAggregateInputType | true + _min?: DeviceBrandMinAggregateInputType + _max?: DeviceBrandMaxAggregateInputType +} + +export type DeviceBrandGroupByOutputType = { + id: string + name: string + created_at: Date + updated_at: Date + _count: DeviceBrandCountAggregateOutputType | null + _min: DeviceBrandMinAggregateOutputType | null + _max: DeviceBrandMaxAggregateOutputType | null +} + +type GetDeviceBrandGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof DeviceBrandGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type DeviceBrandWhereInput = { + AND?: Prisma.DeviceBrandWhereInput | Prisma.DeviceBrandWhereInput[] + OR?: Prisma.DeviceBrandWhereInput[] + NOT?: Prisma.DeviceBrandWhereInput | Prisma.DeviceBrandWhereInput[] + id?: Prisma.StringFilter<"DeviceBrand"> | string + name?: Prisma.StringFilter<"DeviceBrand"> | string + created_at?: Prisma.DateTimeFilter<"DeviceBrand"> | Date | string + updated_at?: Prisma.DateTimeFilter<"DeviceBrand"> | Date | string + devices?: Prisma.DeviceListRelationFilter +} + +export type DeviceBrandOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + devices?: Prisma.DeviceOrderByRelationAggregateInput + _relevance?: Prisma.DeviceBrandOrderByRelevanceInput +} + +export type DeviceBrandWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.DeviceBrandWhereInput | Prisma.DeviceBrandWhereInput[] + OR?: Prisma.DeviceBrandWhereInput[] + NOT?: Prisma.DeviceBrandWhereInput | Prisma.DeviceBrandWhereInput[] + name?: Prisma.StringFilter<"DeviceBrand"> | string + created_at?: Prisma.DateTimeFilter<"DeviceBrand"> | Date | string + updated_at?: Prisma.DateTimeFilter<"DeviceBrand"> | Date | string + devices?: Prisma.DeviceListRelationFilter +}, "id"> + +export type DeviceBrandOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + _count?: Prisma.DeviceBrandCountOrderByAggregateInput + _max?: Prisma.DeviceBrandMaxOrderByAggregateInput + _min?: Prisma.DeviceBrandMinOrderByAggregateInput +} + +export type DeviceBrandScalarWhereWithAggregatesInput = { + AND?: Prisma.DeviceBrandScalarWhereWithAggregatesInput | Prisma.DeviceBrandScalarWhereWithAggregatesInput[] + OR?: Prisma.DeviceBrandScalarWhereWithAggregatesInput[] + NOT?: Prisma.DeviceBrandScalarWhereWithAggregatesInput | Prisma.DeviceBrandScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"DeviceBrand"> | string + name?: Prisma.StringWithAggregatesFilter<"DeviceBrand"> | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"DeviceBrand"> | Date | string + updated_at?: Prisma.DateTimeWithAggregatesFilter<"DeviceBrand"> | Date | string +} + +export type DeviceBrandCreateInput = { + id?: string + name: string + created_at?: Date | string + updated_at?: Date | string + devices?: Prisma.DeviceCreateNestedManyWithoutBrandInput +} + +export type DeviceBrandUncheckedCreateInput = { + id?: string + name: string + created_at?: Date | string + updated_at?: Date | string + devices?: Prisma.DeviceUncheckedCreateNestedManyWithoutBrandInput +} + +export type DeviceBrandUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + devices?: Prisma.DeviceUpdateManyWithoutBrandNestedInput +} + +export type DeviceBrandUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + devices?: Prisma.DeviceUncheckedUpdateManyWithoutBrandNestedInput +} + +export type DeviceBrandCreateManyInput = { + id?: string + name: string + created_at?: Date | string + updated_at?: Date | string +} + +export type DeviceBrandUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type DeviceBrandUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type DeviceBrandOrderByRelevanceInput = { + fields: Prisma.DeviceBrandOrderByRelevanceFieldEnum | Prisma.DeviceBrandOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type DeviceBrandCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder +} + +export type DeviceBrandMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder +} + +export type DeviceBrandMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder +} + +export type DeviceBrandScalarRelationFilter = { + is?: Prisma.DeviceBrandWhereInput + isNot?: Prisma.DeviceBrandWhereInput +} + +export type DeviceBrandCreateNestedOneWithoutDevicesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.DeviceBrandCreateOrConnectWithoutDevicesInput + connect?: Prisma.DeviceBrandWhereUniqueInput +} + +export type DeviceBrandUpdateOneRequiredWithoutDevicesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.DeviceBrandCreateOrConnectWithoutDevicesInput + upsert?: Prisma.DeviceBrandUpsertWithoutDevicesInput + connect?: Prisma.DeviceBrandWhereUniqueInput + update?: Prisma.XOR, Prisma.DeviceBrandUncheckedUpdateWithoutDevicesInput> +} + +export type DeviceBrandCreateWithoutDevicesInput = { + id?: string + name: string + created_at?: Date | string + updated_at?: Date | string +} + +export type DeviceBrandUncheckedCreateWithoutDevicesInput = { + id?: string + name: string + created_at?: Date | string + updated_at?: Date | string +} + +export type DeviceBrandCreateOrConnectWithoutDevicesInput = { + where: Prisma.DeviceBrandWhereUniqueInput + create: Prisma.XOR +} + +export type DeviceBrandUpsertWithoutDevicesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.DeviceBrandWhereInput +} + +export type DeviceBrandUpdateToOneWithWhereWithoutDevicesInput = { + where?: Prisma.DeviceBrandWhereInput + data: Prisma.XOR +} + +export type DeviceBrandUpdateWithoutDevicesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type DeviceBrandUncheckedUpdateWithoutDevicesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + +/** + * Count Type DeviceBrandCountOutputType + */ + +export type DeviceBrandCountOutputType = { + devices: number +} + +export type DeviceBrandCountOutputTypeSelect = { + devices?: boolean | DeviceBrandCountOutputTypeCountDevicesArgs +} + +/** + * DeviceBrandCountOutputType without action + */ +export type DeviceBrandCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the DeviceBrandCountOutputType + */ + select?: Prisma.DeviceBrandCountOutputTypeSelect | null +} + +/** + * DeviceBrandCountOutputType without action + */ +export type DeviceBrandCountOutputTypeCountDevicesArgs = { + where?: Prisma.DeviceWhereInput +} + + +export type DeviceBrandSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + created_at?: boolean + updated_at?: boolean + devices?: boolean | Prisma.DeviceBrand$devicesArgs + _count?: boolean | Prisma.DeviceBrandCountOutputTypeDefaultArgs +}, ExtArgs["result"]["deviceBrand"]> + + + +export type DeviceBrandSelectScalar = { + id?: boolean + name?: boolean + created_at?: boolean + updated_at?: boolean +} + +export type DeviceBrandOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "created_at" | "updated_at", ExtArgs["result"]["deviceBrand"]> +export type DeviceBrandInclude = { + devices?: boolean | Prisma.DeviceBrand$devicesArgs + _count?: boolean | Prisma.DeviceBrandCountOutputTypeDefaultArgs +} + +export type $DeviceBrandPayload = { + name: "DeviceBrand" + objects: { + devices: Prisma.$DevicePayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + created_at: Date + updated_at: Date + }, ExtArgs["result"]["deviceBrand"]> + composites: {} +} + +export type DeviceBrandGetPayload = runtime.Types.Result.GetResult + +export type DeviceBrandCountArgs = + Omit & { + select?: DeviceBrandCountAggregateInputType | true + } + +export interface DeviceBrandDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['DeviceBrand'], meta: { name: 'DeviceBrand' } } + /** + * Find zero or one DeviceBrand that matches the filter. + * @param {DeviceBrandFindUniqueArgs} args - Arguments to find a DeviceBrand + * @example + * // Get one DeviceBrand + * const deviceBrand = await prisma.deviceBrand.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceBrandClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one DeviceBrand that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {DeviceBrandFindUniqueOrThrowArgs} args - Arguments to find a DeviceBrand + * @example + * // Get one DeviceBrand + * const deviceBrand = await prisma.deviceBrand.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceBrandClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first DeviceBrand that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceBrandFindFirstArgs} args - Arguments to find a DeviceBrand + * @example + * // Get one DeviceBrand + * const deviceBrand = await prisma.deviceBrand.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__DeviceBrandClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first DeviceBrand that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceBrandFindFirstOrThrowArgs} args - Arguments to find a DeviceBrand + * @example + * // Get one DeviceBrand + * const deviceBrand = await prisma.deviceBrand.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__DeviceBrandClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more DeviceBrands that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceBrandFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all DeviceBrands + * const deviceBrands = await prisma.deviceBrand.findMany() + * + * // Get first 10 DeviceBrands + * const deviceBrands = await prisma.deviceBrand.findMany({ take: 10 }) + * + * // Only select the `id` + * const deviceBrandWithIdOnly = await prisma.deviceBrand.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a DeviceBrand. + * @param {DeviceBrandCreateArgs} args - Arguments to create a DeviceBrand. + * @example + * // Create one DeviceBrand + * const DeviceBrand = await prisma.deviceBrand.create({ + * data: { + * // ... data to create a DeviceBrand + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceBrandClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many DeviceBrands. + * @param {DeviceBrandCreateManyArgs} args - Arguments to create many DeviceBrands. + * @example + * // Create many DeviceBrands + * const deviceBrand = await prisma.deviceBrand.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a DeviceBrand. + * @param {DeviceBrandDeleteArgs} args - Arguments to delete one DeviceBrand. + * @example + * // Delete one DeviceBrand + * const DeviceBrand = await prisma.deviceBrand.delete({ + * where: { + * // ... filter to delete one DeviceBrand + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceBrandClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one DeviceBrand. + * @param {DeviceBrandUpdateArgs} args - Arguments to update one DeviceBrand. + * @example + * // Update one DeviceBrand + * const deviceBrand = await prisma.deviceBrand.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceBrandClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more DeviceBrands. + * @param {DeviceBrandDeleteManyArgs} args - Arguments to filter DeviceBrands to delete. + * @example + * // Delete a few DeviceBrands + * const { count } = await prisma.deviceBrand.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more DeviceBrands. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceBrandUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many DeviceBrands + * const deviceBrand = await prisma.deviceBrand.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one DeviceBrand. + * @param {DeviceBrandUpsertArgs} args - Arguments to update or create a DeviceBrand. + * @example + * // Update or create a DeviceBrand + * const deviceBrand = await prisma.deviceBrand.upsert({ + * create: { + * // ... data to create a DeviceBrand + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the DeviceBrand we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__DeviceBrandClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of DeviceBrands. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceBrandCountArgs} args - Arguments to filter DeviceBrands to count. + * @example + * // Count the number of DeviceBrands + * const count = await prisma.deviceBrand.count({ + * where: { + * // ... the filter for the DeviceBrands we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a DeviceBrand. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceBrandAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by DeviceBrand. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DeviceBrandGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends DeviceBrandGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: DeviceBrandGroupByArgs['orderBy'] } + : { orderBy?: DeviceBrandGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetDeviceBrandGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the DeviceBrand model + */ +readonly fields: DeviceBrandFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for DeviceBrand. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__DeviceBrandClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + devices = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the DeviceBrand model + */ +export interface DeviceBrandFieldRefs { + readonly id: Prisma.FieldRef<"DeviceBrand", 'String'> + readonly name: Prisma.FieldRef<"DeviceBrand", 'String'> + readonly created_at: Prisma.FieldRef<"DeviceBrand", 'DateTime'> + readonly updated_at: Prisma.FieldRef<"DeviceBrand", 'DateTime'> +} + + +// Custom InputTypes +/** + * DeviceBrand findUnique + */ +export type DeviceBrandFindUniqueArgs = { + /** + * Select specific fields to fetch from the DeviceBrand + */ + select?: Prisma.DeviceBrandSelect | null + /** + * Omit specific fields from the DeviceBrand + */ + omit?: Prisma.DeviceBrandOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceBrandInclude | null + /** + * Filter, which DeviceBrand to fetch. + */ + where: Prisma.DeviceBrandWhereUniqueInput +} + +/** + * DeviceBrand findUniqueOrThrow + */ +export type DeviceBrandFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the DeviceBrand + */ + select?: Prisma.DeviceBrandSelect | null + /** + * Omit specific fields from the DeviceBrand + */ + omit?: Prisma.DeviceBrandOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceBrandInclude | null + /** + * Filter, which DeviceBrand to fetch. + */ + where: Prisma.DeviceBrandWhereUniqueInput +} + +/** + * DeviceBrand findFirst + */ +export type DeviceBrandFindFirstArgs = { + /** + * Select specific fields to fetch from the DeviceBrand + */ + select?: Prisma.DeviceBrandSelect | null + /** + * Omit specific fields from the DeviceBrand + */ + omit?: Prisma.DeviceBrandOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceBrandInclude | null + /** + * Filter, which DeviceBrand to fetch. + */ + where?: Prisma.DeviceBrandWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DeviceBrands to fetch. + */ + orderBy?: Prisma.DeviceBrandOrderByWithRelationInput | Prisma.DeviceBrandOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for DeviceBrands. + */ + cursor?: Prisma.DeviceBrandWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DeviceBrands from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DeviceBrands. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of DeviceBrands. + */ + distinct?: Prisma.DeviceBrandScalarFieldEnum | Prisma.DeviceBrandScalarFieldEnum[] +} + +/** + * DeviceBrand findFirstOrThrow + */ +export type DeviceBrandFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the DeviceBrand + */ + select?: Prisma.DeviceBrandSelect | null + /** + * Omit specific fields from the DeviceBrand + */ + omit?: Prisma.DeviceBrandOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceBrandInclude | null + /** + * Filter, which DeviceBrand to fetch. + */ + where?: Prisma.DeviceBrandWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DeviceBrands to fetch. + */ + orderBy?: Prisma.DeviceBrandOrderByWithRelationInput | Prisma.DeviceBrandOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for DeviceBrands. + */ + cursor?: Prisma.DeviceBrandWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DeviceBrands from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DeviceBrands. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of DeviceBrands. + */ + distinct?: Prisma.DeviceBrandScalarFieldEnum | Prisma.DeviceBrandScalarFieldEnum[] +} + +/** + * DeviceBrand findMany + */ +export type DeviceBrandFindManyArgs = { + /** + * Select specific fields to fetch from the DeviceBrand + */ + select?: Prisma.DeviceBrandSelect | null + /** + * Omit specific fields from the DeviceBrand + */ + omit?: Prisma.DeviceBrandOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceBrandInclude | null + /** + * Filter, which DeviceBrands to fetch. + */ + where?: Prisma.DeviceBrandWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of DeviceBrands to fetch. + */ + orderBy?: Prisma.DeviceBrandOrderByWithRelationInput | Prisma.DeviceBrandOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing DeviceBrands. + */ + cursor?: Prisma.DeviceBrandWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` DeviceBrands from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` DeviceBrands. + */ + skip?: number + distinct?: Prisma.DeviceBrandScalarFieldEnum | Prisma.DeviceBrandScalarFieldEnum[] +} + +/** + * DeviceBrand create + */ +export type DeviceBrandCreateArgs = { + /** + * Select specific fields to fetch from the DeviceBrand + */ + select?: Prisma.DeviceBrandSelect | null + /** + * Omit specific fields from the DeviceBrand + */ + omit?: Prisma.DeviceBrandOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceBrandInclude | null + /** + * The data needed to create a DeviceBrand. + */ + data: Prisma.XOR +} + +/** + * DeviceBrand createMany + */ +export type DeviceBrandCreateManyArgs = { + /** + * The data used to create many DeviceBrands. + */ + data: Prisma.DeviceBrandCreateManyInput | Prisma.DeviceBrandCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * DeviceBrand update + */ +export type DeviceBrandUpdateArgs = { + /** + * Select specific fields to fetch from the DeviceBrand + */ + select?: Prisma.DeviceBrandSelect | null + /** + * Omit specific fields from the DeviceBrand + */ + omit?: Prisma.DeviceBrandOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceBrandInclude | null + /** + * The data needed to update a DeviceBrand. + */ + data: Prisma.XOR + /** + * Choose, which DeviceBrand to update. + */ + where: Prisma.DeviceBrandWhereUniqueInput +} + +/** + * DeviceBrand updateMany + */ +export type DeviceBrandUpdateManyArgs = { + /** + * The data used to update DeviceBrands. + */ + data: Prisma.XOR + /** + * Filter which DeviceBrands to update + */ + where?: Prisma.DeviceBrandWhereInput + /** + * Limit how many DeviceBrands to update. + */ + limit?: number +} + +/** + * DeviceBrand upsert + */ +export type DeviceBrandUpsertArgs = { + /** + * Select specific fields to fetch from the DeviceBrand + */ + select?: Prisma.DeviceBrandSelect | null + /** + * Omit specific fields from the DeviceBrand + */ + omit?: Prisma.DeviceBrandOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceBrandInclude | null + /** + * The filter to search for the DeviceBrand to update in case it exists. + */ + where: Prisma.DeviceBrandWhereUniqueInput + /** + * In case the DeviceBrand found by the `where` argument doesn't exist, create a new DeviceBrand with this data. + */ + create: Prisma.XOR + /** + * In case the DeviceBrand was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * DeviceBrand delete + */ +export type DeviceBrandDeleteArgs = { + /** + * Select specific fields to fetch from the DeviceBrand + */ + select?: Prisma.DeviceBrandSelect | null + /** + * Omit specific fields from the DeviceBrand + */ + omit?: Prisma.DeviceBrandOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceBrandInclude | null + /** + * Filter which DeviceBrand to delete. + */ + where: Prisma.DeviceBrandWhereUniqueInput +} + +/** + * DeviceBrand deleteMany + */ +export type DeviceBrandDeleteManyArgs = { + /** + * Filter which DeviceBrands to delete + */ + where?: Prisma.DeviceBrandWhereInput + /** + * Limit how many DeviceBrands to delete. + */ + limit?: number +} + +/** + * DeviceBrand.devices + */ +export type DeviceBrand$devicesArgs = { + /** + * Select specific fields to fetch from the Device + */ + select?: Prisma.DeviceSelect | null + /** + * Omit specific fields from the Device + */ + omit?: Prisma.DeviceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceInclude | null + where?: Prisma.DeviceWhereInput + orderBy?: Prisma.DeviceOrderByWithRelationInput | Prisma.DeviceOrderByWithRelationInput[] + cursor?: Prisma.DeviceWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.DeviceScalarFieldEnum | Prisma.DeviceScalarFieldEnum[] +} + +/** + * DeviceBrand without action + */ +export type DeviceBrandDefaultArgs = { + /** + * Select specific fields to fetch from the DeviceBrand + */ + select?: Prisma.DeviceBrandSelect | null + /** + * Omit specific fields from the DeviceBrand + */ + omit?: Prisma.DeviceBrandOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.DeviceBrandInclude | null +} diff --git a/src/generated/prisma/models/Good.ts b/src/generated/prisma/models/Good.ts index a6c12fd..3688ba8 100644 --- a/src/generated/prisma/models/Good.ts +++ b/src/generated/prisma/models/Good.ts @@ -41,13 +41,14 @@ export type GoodMinAggregateOutputType = { sku: string | null local_sku: string | null barcode: string | null + base_sale_price: runtime.Decimal | null + is_default_guild_good: boolean | null created_at: Date | null updated_at: Date | null deleted_at: Date | null - category_id: string | null - base_sale_price: runtime.Decimal | null - account_id: string | null complex_id: string | null + category_id: string | null + guild_id: string | null } export type GoodMaxAggregateOutputType = { @@ -57,13 +58,14 @@ export type GoodMaxAggregateOutputType = { sku: string | null local_sku: string | null barcode: string | null + base_sale_price: runtime.Decimal | null + is_default_guild_good: boolean | null created_at: Date | null updated_at: Date | null deleted_at: Date | null - category_id: string | null - base_sale_price: runtime.Decimal | null - account_id: string | null complex_id: string | null + category_id: string | null + guild_id: string | null } export type GoodCountAggregateOutputType = { @@ -73,13 +75,14 @@ export type GoodCountAggregateOutputType = { sku: number local_sku: number barcode: number + base_sale_price: number + is_default_guild_good: number created_at: number updated_at: number deleted_at: number - category_id: number - base_sale_price: number - account_id: number complex_id: number + category_id: number + guild_id: number _all: number } @@ -99,13 +102,14 @@ export type GoodMinAggregateInputType = { sku?: true local_sku?: true barcode?: true + base_sale_price?: true + is_default_guild_good?: true created_at?: true updated_at?: true deleted_at?: true - category_id?: true - base_sale_price?: true - account_id?: true complex_id?: true + category_id?: true + guild_id?: true } export type GoodMaxAggregateInputType = { @@ -115,13 +119,14 @@ export type GoodMaxAggregateInputType = { sku?: true local_sku?: true barcode?: true + base_sale_price?: true + is_default_guild_good?: true created_at?: true updated_at?: true deleted_at?: true - category_id?: true - base_sale_price?: true - account_id?: true complex_id?: true + category_id?: true + guild_id?: true } export type GoodCountAggregateInputType = { @@ -131,13 +136,14 @@ export type GoodCountAggregateInputType = { sku?: true local_sku?: true barcode?: true + base_sale_price?: true + is_default_guild_good?: true created_at?: true updated_at?: true deleted_at?: true - category_id?: true - base_sale_price?: true - account_id?: true complex_id?: true + category_id?: true + guild_id?: true _all?: true } @@ -234,13 +240,14 @@ export type GoodGroupByOutputType = { sku: string local_sku: string | null barcode: string | null + base_sale_price: runtime.Decimal | null + is_default_guild_good: boolean created_at: Date updated_at: Date deleted_at: Date | null + complex_id: string | null category_id: string | null - base_sale_price: runtime.Decimal - account_id: string - complex_id: string + guild_id: string | null _count: GoodCountAggregateOutputType | null _avg: GoodAvgAggregateOutputType | null _sum: GoodSumAggregateOutputType | null @@ -273,14 +280,17 @@ export type GoodWhereInput = { sku?: Prisma.StringFilter<"Good"> | string local_sku?: Prisma.StringNullableFilter<"Good"> | string | null barcode?: Prisma.StringNullableFilter<"Good"> | string | null + base_sale_price?: Prisma.DecimalNullableFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFilter<"Good"> | boolean created_at?: Prisma.DateTimeFilter<"Good"> | Date | string updated_at?: Prisma.DateTimeFilter<"Good"> | Date | string deleted_at?: Prisma.DateTimeNullableFilter<"Good"> | Date | string | null + complex_id?: Prisma.StringNullableFilter<"Good"> | string | null category_id?: Prisma.StringNullableFilter<"Good"> | string | null - base_sale_price?: Prisma.DecimalFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFilter<"Good"> | string - complex_id?: Prisma.StringFilter<"Good"> | string + guild_id?: Prisma.StringNullableFilter<"Good"> | string | null category?: Prisma.XOR | null + complex?: Prisma.XOR | null + guild?: Prisma.XOR | null sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter } @@ -291,14 +301,17 @@ export type GoodOrderByWithRelationInput = { sku?: Prisma.SortOrder local_sku?: Prisma.SortOrderInput | Prisma.SortOrder barcode?: Prisma.SortOrderInput | Prisma.SortOrder + base_sale_price?: Prisma.SortOrderInput | Prisma.SortOrder + is_default_guild_good?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder + complex_id?: Prisma.SortOrderInput | Prisma.SortOrder category_id?: Prisma.SortOrderInput | Prisma.SortOrder - base_sale_price?: Prisma.SortOrder - account_id?: Prisma.SortOrder - complex_id?: Prisma.SortOrder + guild_id?: Prisma.SortOrderInput | Prisma.SortOrder category?: Prisma.GoodCategoryOrderByWithRelationInput + complex?: Prisma.ComplexOrderByWithRelationInput + guild?: Prisma.GuildOrderByWithRelationInput sales_invoice_items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput _relevance?: Prisma.GoodOrderByRelevanceInput } @@ -313,14 +326,17 @@ export type GoodWhereUniqueInput = Prisma.AtLeast<{ name?: Prisma.StringFilter<"Good"> | string description?: Prisma.StringNullableFilter<"Good"> | string | null sku?: Prisma.StringFilter<"Good"> | string + base_sale_price?: Prisma.DecimalNullableFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFilter<"Good"> | boolean created_at?: Prisma.DateTimeFilter<"Good"> | Date | string updated_at?: Prisma.DateTimeFilter<"Good"> | Date | string deleted_at?: Prisma.DateTimeNullableFilter<"Good"> | Date | string | null + complex_id?: Prisma.StringNullableFilter<"Good"> | string | null category_id?: Prisma.StringNullableFilter<"Good"> | string | null - base_sale_price?: Prisma.DecimalFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFilter<"Good"> | string - complex_id?: Prisma.StringFilter<"Good"> | string + guild_id?: Prisma.StringNullableFilter<"Good"> | string | null category?: Prisma.XOR | null + complex?: Prisma.XOR | null + guild?: Prisma.XOR | null sales_invoice_items?: Prisma.SalesInvoiceItemListRelationFilter }, "id" | "local_sku" | "barcode"> @@ -331,13 +347,14 @@ export type GoodOrderByWithAggregationInput = { sku?: Prisma.SortOrder local_sku?: Prisma.SortOrderInput | Prisma.SortOrder barcode?: Prisma.SortOrderInput | Prisma.SortOrder + base_sale_price?: Prisma.SortOrderInput | Prisma.SortOrder + is_default_guild_good?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder + complex_id?: Prisma.SortOrderInput | Prisma.SortOrder category_id?: Prisma.SortOrderInput | Prisma.SortOrder - base_sale_price?: Prisma.SortOrder - account_id?: Prisma.SortOrder - complex_id?: Prisma.SortOrder + guild_id?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.GoodCountOrderByAggregateInput _avg?: Prisma.GoodAvgOrderByAggregateInput _max?: Prisma.GoodMaxOrderByAggregateInput @@ -355,13 +372,14 @@ export type GoodScalarWhereWithAggregatesInput = { sku?: Prisma.StringWithAggregatesFilter<"Good"> | string local_sku?: Prisma.StringNullableWithAggregatesFilter<"Good"> | string | null barcode?: Prisma.StringNullableWithAggregatesFilter<"Good"> | string | null + base_sale_price?: Prisma.DecimalNullableWithAggregatesFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolWithAggregatesFilter<"Good"> | boolean created_at?: Prisma.DateTimeWithAggregatesFilter<"Good"> | Date | string updated_at?: Prisma.DateTimeWithAggregatesFilter<"Good"> | Date | string deleted_at?: Prisma.DateTimeNullableWithAggregatesFilter<"Good"> | Date | string | null + complex_id?: Prisma.StringNullableWithAggregatesFilter<"Good"> | string | null category_id?: Prisma.StringNullableWithAggregatesFilter<"Good"> | string | null - base_sale_price?: Prisma.DecimalWithAggregatesFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringWithAggregatesFilter<"Good"> | string - complex_id?: Prisma.StringWithAggregatesFilter<"Good"> | string + guild_id?: Prisma.StringNullableWithAggregatesFilter<"Good"> | string | null } export type GoodCreateInput = { @@ -371,13 +389,14 @@ export type GoodCreateInput = { sku: string local_sku?: string | null barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string - account_id: string - complex_id: string category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput + complex?: Prisma.ComplexCreateNestedOneWithoutGoodsInput + guild?: Prisma.GuildCreateNestedOneWithoutGoodsInput sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput } @@ -388,13 +407,14 @@ export type GoodUncheckedCreateInput = { sku: string local_sku?: string | null barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null + complex_id?: string | null category_id?: string | null - base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string - account_id: string - complex_id: string + guild_id?: string | null sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput } @@ -405,13 +425,14 @@ export type GoodUpdateInput = { sku?: Prisma.StringFieldUpdateOperationsInput | string local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput + complex?: Prisma.ComplexUpdateOneWithoutGoodsNestedInput + guild?: Prisma.GuildUpdateOneWithoutGoodsNestedInput sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput } @@ -422,13 +443,14 @@ export type GoodUncheckedUpdateInput = { sku?: Prisma.StringFieldUpdateOperationsInput | string local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput } @@ -439,13 +461,14 @@ export type GoodCreateManyInput = { sku: string local_sku?: string | null barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null + complex_id?: string | null category_id?: string | null - base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string - account_id: string - complex_id: string + guild_id?: string | null } export type GoodUpdateManyMutationInput = { @@ -455,12 +478,11 @@ export type GoodUpdateManyMutationInput = { sku?: Prisma.StringFieldUpdateOperationsInput | string local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string } export type GoodUncheckedUpdateManyInput = { @@ -470,13 +492,24 @@ export type GoodUncheckedUpdateManyInput = { sku?: Prisma.StringFieldUpdateOperationsInput | string local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type GoodListRelationFilter = { + every?: Prisma.GoodWhereInput + some?: Prisma.GoodWhereInput + none?: Prisma.GoodWhereInput +} + +export type GoodOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder } export type GoodOrderByRelevanceInput = { @@ -492,13 +525,14 @@ export type GoodCountOrderByAggregateInput = { sku?: Prisma.SortOrder local_sku?: Prisma.SortOrder barcode?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + is_default_guild_good?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrder - category_id?: Prisma.SortOrder - base_sale_price?: Prisma.SortOrder - account_id?: Prisma.SortOrder complex_id?: Prisma.SortOrder + category_id?: Prisma.SortOrder + guild_id?: Prisma.SortOrder } export type GoodAvgOrderByAggregateInput = { @@ -512,13 +546,14 @@ export type GoodMaxOrderByAggregateInput = { sku?: Prisma.SortOrder local_sku?: Prisma.SortOrder barcode?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + is_default_guild_good?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrder - category_id?: Prisma.SortOrder - base_sale_price?: Prisma.SortOrder - account_id?: Prisma.SortOrder complex_id?: Prisma.SortOrder + category_id?: Prisma.SortOrder + guild_id?: Prisma.SortOrder } export type GoodMinOrderByAggregateInput = { @@ -528,36 +563,111 @@ export type GoodMinOrderByAggregateInput = { sku?: Prisma.SortOrder local_sku?: Prisma.SortOrder barcode?: Prisma.SortOrder + base_sale_price?: Prisma.SortOrder + is_default_guild_good?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrder - category_id?: Prisma.SortOrder - base_sale_price?: Prisma.SortOrder - account_id?: Prisma.SortOrder complex_id?: Prisma.SortOrder + category_id?: Prisma.SortOrder + guild_id?: Prisma.SortOrder } export type GoodSumOrderByAggregateInput = { base_sale_price?: Prisma.SortOrder } -export type GoodListRelationFilter = { - every?: Prisma.GoodWhereInput - some?: Prisma.GoodWhereInput - none?: Prisma.GoodWhereInput -} - -export type GoodOrderByRelationAggregateInput = { - _count?: Prisma.SortOrder -} - export type GoodNullableScalarRelationFilter = { is?: Prisma.GoodWhereInput | null isNot?: Prisma.GoodWhereInput | null } -export type DecimalFieldUpdateOperationsInput = { - set?: runtime.Decimal | runtime.DecimalJsLike | number | string +export type GoodCreateNestedManyWithoutGuildInput = { + create?: Prisma.XOR | Prisma.GoodCreateWithoutGuildInput[] | Prisma.GoodUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.GoodCreateOrConnectWithoutGuildInput | Prisma.GoodCreateOrConnectWithoutGuildInput[] + createMany?: Prisma.GoodCreateManyGuildInputEnvelope + connect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] +} + +export type GoodUncheckedCreateNestedManyWithoutGuildInput = { + create?: Prisma.XOR | Prisma.GoodCreateWithoutGuildInput[] | Prisma.GoodUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.GoodCreateOrConnectWithoutGuildInput | Prisma.GoodCreateOrConnectWithoutGuildInput[] + createMany?: Prisma.GoodCreateManyGuildInputEnvelope + connect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] +} + +export type GoodUpdateManyWithoutGuildNestedInput = { + create?: Prisma.XOR | Prisma.GoodCreateWithoutGuildInput[] | Prisma.GoodUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.GoodCreateOrConnectWithoutGuildInput | Prisma.GoodCreateOrConnectWithoutGuildInput[] + upsert?: Prisma.GoodUpsertWithWhereUniqueWithoutGuildInput | Prisma.GoodUpsertWithWhereUniqueWithoutGuildInput[] + createMany?: Prisma.GoodCreateManyGuildInputEnvelope + set?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + disconnect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + delete?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + connect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + update?: Prisma.GoodUpdateWithWhereUniqueWithoutGuildInput | Prisma.GoodUpdateWithWhereUniqueWithoutGuildInput[] + updateMany?: Prisma.GoodUpdateManyWithWhereWithoutGuildInput | Prisma.GoodUpdateManyWithWhereWithoutGuildInput[] + deleteMany?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] +} + +export type GoodUncheckedUpdateManyWithoutGuildNestedInput = { + create?: Prisma.XOR | Prisma.GoodCreateWithoutGuildInput[] | Prisma.GoodUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.GoodCreateOrConnectWithoutGuildInput | Prisma.GoodCreateOrConnectWithoutGuildInput[] + upsert?: Prisma.GoodUpsertWithWhereUniqueWithoutGuildInput | Prisma.GoodUpsertWithWhereUniqueWithoutGuildInput[] + createMany?: Prisma.GoodCreateManyGuildInputEnvelope + set?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + disconnect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + delete?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + connect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + update?: Prisma.GoodUpdateWithWhereUniqueWithoutGuildInput | Prisma.GoodUpdateWithWhereUniqueWithoutGuildInput[] + updateMany?: Prisma.GoodUpdateManyWithWhereWithoutGuildInput | Prisma.GoodUpdateManyWithWhereWithoutGuildInput[] + deleteMany?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] +} + +export type GoodCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.GoodCreateWithoutComplexInput[] | Prisma.GoodUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.GoodCreateOrConnectWithoutComplexInput | Prisma.GoodCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.GoodCreateManyComplexInputEnvelope + connect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] +} + +export type GoodUncheckedCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.GoodCreateWithoutComplexInput[] | Prisma.GoodUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.GoodCreateOrConnectWithoutComplexInput | Prisma.GoodCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.GoodCreateManyComplexInputEnvelope + connect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] +} + +export type GoodUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.GoodCreateWithoutComplexInput[] | Prisma.GoodUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.GoodCreateOrConnectWithoutComplexInput | Prisma.GoodCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.GoodUpsertWithWhereUniqueWithoutComplexInput | Prisma.GoodUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.GoodCreateManyComplexInputEnvelope + set?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + disconnect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + delete?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + connect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + update?: Prisma.GoodUpdateWithWhereUniqueWithoutComplexInput | Prisma.GoodUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.GoodUpdateManyWithWhereWithoutComplexInput | Prisma.GoodUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] +} + +export type GoodUncheckedUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.GoodCreateWithoutComplexInput[] | Prisma.GoodUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.GoodCreateOrConnectWithoutComplexInput | Prisma.GoodCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.GoodUpsertWithWhereUniqueWithoutComplexInput | Prisma.GoodUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.GoodCreateManyComplexInputEnvelope + set?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + disconnect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + delete?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + connect?: Prisma.GoodWhereUniqueInput | Prisma.GoodWhereUniqueInput[] + update?: Prisma.GoodUpdateWithWhereUniqueWithoutComplexInput | Prisma.GoodUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.GoodUpdateManyWithWhereWithoutComplexInput | Prisma.GoodUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] +} + +export type NullableDecimalFieldUpdateOperationsInput = { + set?: runtime.Decimal | runtime.DecimalJsLike | number | string | null increment?: runtime.Decimal | runtime.DecimalJsLike | number | string decrement?: runtime.Decimal | runtime.DecimalJsLike | number | string multiply?: runtime.Decimal | runtime.DecimalJsLike | number | string @@ -622,6 +732,146 @@ export type GoodUpdateOneWithoutSales_invoice_itemsNestedInput = { update?: Prisma.XOR, Prisma.GoodUncheckedUpdateWithoutSales_invoice_itemsInput> } +export type GoodCreateWithoutGuildInput = { + id?: string + name: string + description?: string | null + sku: string + local_sku?: string | null + barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput + complex?: Prisma.ComplexCreateNestedOneWithoutGoodsInput + sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput +} + +export type GoodUncheckedCreateWithoutGuildInput = { + id?: string + name: string + description?: string | null + sku: string + local_sku?: string | null + barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + complex_id?: string | null + category_id?: string | null + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput +} + +export type GoodCreateOrConnectWithoutGuildInput = { + where: Prisma.GoodWhereUniqueInput + create: Prisma.XOR +} + +export type GoodCreateManyGuildInputEnvelope = { + data: Prisma.GoodCreateManyGuildInput | Prisma.GoodCreateManyGuildInput[] + skipDuplicates?: boolean +} + +export type GoodUpsertWithWhereUniqueWithoutGuildInput = { + where: Prisma.GoodWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type GoodUpdateWithWhereUniqueWithoutGuildInput = { + where: Prisma.GoodWhereUniqueInput + data: Prisma.XOR +} + +export type GoodUpdateManyWithWhereWithoutGuildInput = { + where: Prisma.GoodScalarWhereInput + data: Prisma.XOR +} + +export type GoodScalarWhereInput = { + AND?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] + OR?: Prisma.GoodScalarWhereInput[] + NOT?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] + id?: Prisma.StringFilter<"Good"> | string + name?: Prisma.StringFilter<"Good"> | string + description?: Prisma.StringNullableFilter<"Good"> | string | null + sku?: Prisma.StringFilter<"Good"> | string + local_sku?: Prisma.StringNullableFilter<"Good"> | string | null + barcode?: Prisma.StringNullableFilter<"Good"> | string | null + base_sale_price?: Prisma.DecimalNullableFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFilter<"Good"> | boolean + created_at?: Prisma.DateTimeFilter<"Good"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Good"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"Good"> | Date | string | null + complex_id?: Prisma.StringNullableFilter<"Good"> | string | null + category_id?: Prisma.StringNullableFilter<"Good"> | string | null + guild_id?: Prisma.StringNullableFilter<"Good"> | string | null +} + +export type GoodCreateWithoutComplexInput = { + id?: string + name: string + description?: string | null + sku: string + local_sku?: string | null + barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput + guild?: Prisma.GuildCreateNestedOneWithoutGoodsInput + sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput +} + +export type GoodUncheckedCreateWithoutComplexInput = { + id?: string + name: string + description?: string | null + sku: string + local_sku?: string | null + barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + category_id?: string | null + guild_id?: string | null + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput +} + +export type GoodCreateOrConnectWithoutComplexInput = { + where: Prisma.GoodWhereUniqueInput + create: Prisma.XOR +} + +export type GoodCreateManyComplexInputEnvelope = { + data: Prisma.GoodCreateManyComplexInput | Prisma.GoodCreateManyComplexInput[] + skipDuplicates?: boolean +} + +export type GoodUpsertWithWhereUniqueWithoutComplexInput = { + where: Prisma.GoodWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type GoodUpdateWithWhereUniqueWithoutComplexInput = { + where: Prisma.GoodWhereUniqueInput + data: Prisma.XOR +} + +export type GoodUpdateManyWithWhereWithoutComplexInput = { + where: Prisma.GoodScalarWhereInput + data: Prisma.XOR +} + export type GoodCreateWithoutCategoryInput = { id?: string name: string @@ -629,12 +879,13 @@ export type GoodCreateWithoutCategoryInput = { sku: string local_sku?: string | null barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string - account_id: string - complex_id: string + complex?: Prisma.ComplexCreateNestedOneWithoutGoodsInput + guild?: Prisma.GuildCreateNestedOneWithoutGoodsInput sales_invoice_items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutGoodInput } @@ -645,12 +896,13 @@ export type GoodUncheckedCreateWithoutCategoryInput = { sku: string local_sku?: string | null barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string - account_id: string - complex_id: string + complex_id?: string | null + guild_id?: string | null sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutGoodInput } @@ -680,25 +932,6 @@ export type GoodUpdateManyWithWhereWithoutCategoryInput = { data: Prisma.XOR } -export type GoodScalarWhereInput = { - AND?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] - OR?: Prisma.GoodScalarWhereInput[] - NOT?: Prisma.GoodScalarWhereInput | Prisma.GoodScalarWhereInput[] - id?: Prisma.StringFilter<"Good"> | string - name?: Prisma.StringFilter<"Good"> | string - description?: Prisma.StringNullableFilter<"Good"> | string | null - sku?: Prisma.StringFilter<"Good"> | string - local_sku?: Prisma.StringNullableFilter<"Good"> | string | null - barcode?: Prisma.StringNullableFilter<"Good"> | string | null - created_at?: Prisma.DateTimeFilter<"Good"> | Date | string - updated_at?: Prisma.DateTimeFilter<"Good"> | Date | string - deleted_at?: Prisma.DateTimeNullableFilter<"Good"> | Date | string | null - category_id?: Prisma.StringNullableFilter<"Good"> | string | null - base_sale_price?: Prisma.DecimalFilter<"Good"> | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFilter<"Good"> | string - complex_id?: Prisma.StringFilter<"Good"> | string -} - export type GoodCreateWithoutSales_invoice_itemsInput = { id?: string name: string @@ -706,13 +939,14 @@ export type GoodCreateWithoutSales_invoice_itemsInput = { sku: string local_sku?: string | null barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string - account_id: string - complex_id: string category?: Prisma.GoodCategoryCreateNestedOneWithoutGoodsInput + complex?: Prisma.ComplexCreateNestedOneWithoutGoodsInput + guild?: Prisma.GuildCreateNestedOneWithoutGoodsInput } export type GoodUncheckedCreateWithoutSales_invoice_itemsInput = { @@ -722,13 +956,14 @@ export type GoodUncheckedCreateWithoutSales_invoice_itemsInput = { sku: string local_sku?: string | null barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null + complex_id?: string | null category_id?: string | null - base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string - account_id: string - complex_id: string + guild_id?: string | null } export type GoodCreateOrConnectWithoutSales_invoice_itemsInput = { @@ -754,13 +989,14 @@ export type GoodUpdateWithoutSales_invoice_itemsInput = { sku?: Prisma.StringFieldUpdateOperationsInput | string local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput + complex?: Prisma.ComplexUpdateOneWithoutGoodsNestedInput + guild?: Prisma.GuildUpdateOneWithoutGoodsNestedInput } export type GoodUncheckedUpdateWithoutSales_invoice_itemsInput = { @@ -770,13 +1006,146 @@ export type GoodUncheckedUpdateWithoutSales_invoice_itemsInput = { sku?: Prisma.StringFieldUpdateOperationsInput | string local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type GoodCreateManyGuildInput = { + id?: string + name: string + description?: string | null + sku: string + local_sku?: string | null + barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + complex_id?: string | null + category_id?: string | null +} + +export type GoodUpdateWithoutGuildInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput + complex?: Prisma.ComplexUpdateOneWithoutGoodsNestedInput + sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput +} + +export type GoodUncheckedUpdateWithoutGuildInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput +} + +export type GoodUncheckedUpdateManyWithoutGuildInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type GoodCreateManyComplexInput = { + id?: string + name: string + description?: string | null + sku: string + local_sku?: string | null + barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + category_id?: string | null + guild_id?: string | null +} + +export type GoodUpdateWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + category?: Prisma.GoodCategoryUpdateOneWithoutGoodsNestedInput + guild?: Prisma.GuildUpdateOneWithoutGoodsNestedInput + sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput +} + +export type GoodUncheckedUpdateWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput +} + +export type GoodUncheckedUpdateManyWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.StringFieldUpdateOperationsInput | string + local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + category_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null } export type GoodCreateManyCategoryInput = { @@ -786,12 +1155,13 @@ export type GoodCreateManyCategoryInput = { sku: string local_sku?: string | null barcode?: string | null + base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: boolean created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null - base_sale_price?: runtime.Decimal | runtime.DecimalJsLike | number | string - account_id: string - complex_id: string + complex_id?: string | null + guild_id?: string | null } export type GoodUpdateWithoutCategoryInput = { @@ -801,12 +1171,13 @@ export type GoodUpdateWithoutCategoryInput = { sku?: Prisma.StringFieldUpdateOperationsInput | string local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + complex?: Prisma.ComplexUpdateOneWithoutGoodsNestedInput + guild?: Prisma.GuildUpdateOneWithoutGoodsNestedInput sales_invoice_items?: Prisma.SalesInvoiceItemUpdateManyWithoutGoodNestedInput } @@ -817,12 +1188,13 @@ export type GoodUncheckedUpdateWithoutCategoryInput = { sku?: Prisma.StringFieldUpdateOperationsInput | string local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null sales_invoice_items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutGoodNestedInput } @@ -833,12 +1205,13 @@ export type GoodUncheckedUpdateManyWithoutCategoryInput = { sku?: Prisma.StringFieldUpdateOperationsInput | string local_sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + base_sale_price?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - base_sale_price?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null } @@ -879,14 +1252,17 @@ export type GoodSelect + complex?: boolean | Prisma.Good$complexArgs + guild?: boolean | Prisma.Good$guildArgs sales_invoice_items?: boolean | Prisma.Good$sales_invoice_itemsArgs _count?: boolean | Prisma.GoodCountOutputTypeDefaultArgs }, ExtArgs["result"]["good"]> @@ -900,18 +1276,21 @@ export type GoodSelectScalar = { sku?: boolean local_sku?: boolean barcode?: boolean + base_sale_price?: boolean + is_default_guild_good?: boolean created_at?: boolean updated_at?: boolean deleted_at?: boolean - category_id?: boolean - base_sale_price?: boolean - account_id?: boolean complex_id?: boolean + category_id?: boolean + guild_id?: boolean } -export type GoodOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "sku" | "local_sku" | "barcode" | "created_at" | "updated_at" | "deleted_at" | "category_id" | "base_sale_price" | "account_id" | "complex_id", ExtArgs["result"]["good"]> +export type GoodOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "sku" | "local_sku" | "barcode" | "base_sale_price" | "is_default_guild_good" | "created_at" | "updated_at" | "deleted_at" | "complex_id" | "category_id" | "guild_id", ExtArgs["result"]["good"]> export type GoodInclude = { category?: boolean | Prisma.Good$categoryArgs + complex?: boolean | Prisma.Good$complexArgs + guild?: boolean | Prisma.Good$guildArgs sales_invoice_items?: boolean | Prisma.Good$sales_invoice_itemsArgs _count?: boolean | Prisma.GoodCountOutputTypeDefaultArgs } @@ -920,6 +1299,8 @@ export type $GoodPayload | null + complex: Prisma.$ComplexPayload | null + guild: Prisma.$GuildPayload | null sales_invoice_items: Prisma.$SalesInvoiceItemPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ @@ -929,13 +1310,14 @@ export type $GoodPayload composites: {} } @@ -1277,6 +1659,8 @@ readonly fields: GoodFieldRefs; export interface Prisma__GoodClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" category = {}>(args?: Prisma.Subset>): Prisma.Prisma__GoodCategoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + complex = {}>(args?: Prisma.Subset>): Prisma.Prisma__ComplexClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + guild = {}>(args?: Prisma.Subset>): Prisma.Prisma__GuildClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> sales_invoice_items = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. @@ -1313,13 +1697,14 @@ export interface GoodFieldRefs { readonly sku: Prisma.FieldRef<"Good", 'String'> readonly local_sku: Prisma.FieldRef<"Good", 'String'> readonly barcode: Prisma.FieldRef<"Good", 'String'> + readonly base_sale_price: Prisma.FieldRef<"Good", 'Decimal'> + readonly is_default_guild_good: Prisma.FieldRef<"Good", 'Boolean'> readonly created_at: Prisma.FieldRef<"Good", 'DateTime'> readonly updated_at: Prisma.FieldRef<"Good", 'DateTime'> readonly deleted_at: Prisma.FieldRef<"Good", 'DateTime'> - readonly category_id: Prisma.FieldRef<"Good", 'String'> - readonly base_sale_price: Prisma.FieldRef<"Good", 'Decimal'> - readonly account_id: Prisma.FieldRef<"Good", 'String'> readonly complex_id: Prisma.FieldRef<"Good", 'String'> + readonly category_id: Prisma.FieldRef<"Good", 'String'> + readonly guild_id: Prisma.FieldRef<"Good", 'String'> } @@ -1681,6 +2066,44 @@ export type Good$categoryArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + where?: Prisma.ComplexWhereInput +} + +/** + * Good.guild + */ +export type Good$guildArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + where?: Prisma.GuildWhereInput +} + /** * Good.sales_invoice_items */ diff --git a/src/generated/prisma/models/GoodCategory.ts b/src/generated/prisma/models/GoodCategory.ts index e89b208..1024c8d 100644 --- a/src/generated/prisma/models/GoodCategory.ts +++ b/src/generated/prisma/models/GoodCategory.ts @@ -29,8 +29,9 @@ export type GoodCategoryMinAggregateOutputType = { name: string | null description: string | null image_url: string | null - account_id: string | null complex_id: string | null + is_default_guild_good: boolean | null + guild_id: string | null created_at: Date | null updated_at: Date | null deleted_at: Date | null @@ -41,8 +42,9 @@ export type GoodCategoryMaxAggregateOutputType = { name: string | null description: string | null image_url: string | null - account_id: string | null complex_id: string | null + is_default_guild_good: boolean | null + guild_id: string | null created_at: Date | null updated_at: Date | null deleted_at: Date | null @@ -53,8 +55,9 @@ export type GoodCategoryCountAggregateOutputType = { name: number description: number image_url: number - account_id: number complex_id: number + is_default_guild_good: number + guild_id: number created_at: number updated_at: number deleted_at: number @@ -67,8 +70,9 @@ export type GoodCategoryMinAggregateInputType = { name?: true description?: true image_url?: true - account_id?: true complex_id?: true + is_default_guild_good?: true + guild_id?: true created_at?: true updated_at?: true deleted_at?: true @@ -79,8 +83,9 @@ export type GoodCategoryMaxAggregateInputType = { name?: true description?: true image_url?: true - account_id?: true complex_id?: true + is_default_guild_good?: true + guild_id?: true created_at?: true updated_at?: true deleted_at?: true @@ -91,8 +96,9 @@ export type GoodCategoryCountAggregateInputType = { name?: true description?: true image_url?: true - account_id?: true complex_id?: true + is_default_guild_good?: true + guild_id?: true created_at?: true updated_at?: true deleted_at?: true @@ -176,8 +182,9 @@ export type GoodCategoryGroupByOutputType = { name: string description: string | null image_url: string | null - account_id: string - complex_id: string + complex_id: string | null + is_default_guild_good: boolean + guild_id: string | null created_at: Date updated_at: Date deleted_at: Date | null @@ -209,12 +216,15 @@ export type GoodCategoryWhereInput = { name?: Prisma.StringFilter<"GoodCategory"> | string description?: Prisma.StringNullableFilter<"GoodCategory"> | string | null image_url?: Prisma.StringNullableFilter<"GoodCategory"> | string | null - account_id?: Prisma.StringFilter<"GoodCategory"> | string - complex_id?: Prisma.StringFilter<"GoodCategory"> | string + complex_id?: Prisma.StringNullableFilter<"GoodCategory"> | string | null + is_default_guild_good?: Prisma.BoolFilter<"GoodCategory"> | boolean + guild_id?: Prisma.StringNullableFilter<"GoodCategory"> | string | null created_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string updated_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string deleted_at?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null goods?: Prisma.GoodListRelationFilter + guild?: Prisma.XOR | null + complex?: Prisma.XOR | null } export type GoodCategoryOrderByWithRelationInput = { @@ -222,12 +232,15 @@ export type GoodCategoryOrderByWithRelationInput = { name?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder image_url?: Prisma.SortOrderInput | Prisma.SortOrder - account_id?: Prisma.SortOrder - complex_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrderInput | Prisma.SortOrder + is_default_guild_good?: Prisma.SortOrder + guild_id?: Prisma.SortOrderInput | Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder goods?: Prisma.GoodOrderByRelationAggregateInput + guild?: Prisma.GuildOrderByWithRelationInput + complex?: Prisma.ComplexOrderByWithRelationInput _relevance?: Prisma.GoodCategoryOrderByRelevanceInput } @@ -239,12 +252,15 @@ export type GoodCategoryWhereUniqueInput = Prisma.AtLeast<{ name?: Prisma.StringFilter<"GoodCategory"> | string description?: Prisma.StringNullableFilter<"GoodCategory"> | string | null image_url?: Prisma.StringNullableFilter<"GoodCategory"> | string | null - account_id?: Prisma.StringFilter<"GoodCategory"> | string - complex_id?: Prisma.StringFilter<"GoodCategory"> | string + complex_id?: Prisma.StringNullableFilter<"GoodCategory"> | string | null + is_default_guild_good?: Prisma.BoolFilter<"GoodCategory"> | boolean + guild_id?: Prisma.StringNullableFilter<"GoodCategory"> | string | null created_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string updated_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string deleted_at?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null goods?: Prisma.GoodListRelationFilter + guild?: Prisma.XOR | null + complex?: Prisma.XOR | null }, "id"> export type GoodCategoryOrderByWithAggregationInput = { @@ -252,8 +268,9 @@ export type GoodCategoryOrderByWithAggregationInput = { name?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder image_url?: Prisma.SortOrderInput | Prisma.SortOrder - account_id?: Prisma.SortOrder - complex_id?: Prisma.SortOrder + complex_id?: Prisma.SortOrderInput | Prisma.SortOrder + is_default_guild_good?: Prisma.SortOrder + guild_id?: Prisma.SortOrderInput | Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrderInput | Prisma.SortOrder @@ -270,8 +287,9 @@ export type GoodCategoryScalarWhereWithAggregatesInput = { name?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string description?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null image_url?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null - account_id?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string - complex_id?: Prisma.StringWithAggregatesFilter<"GoodCategory"> | string + complex_id?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null + is_default_guild_good?: Prisma.BoolWithAggregatesFilter<"GoodCategory"> | boolean + guild_id?: Prisma.StringNullableWithAggregatesFilter<"GoodCategory"> | string | null created_at?: Prisma.DateTimeWithAggregatesFilter<"GoodCategory"> | Date | string updated_at?: Prisma.DateTimeWithAggregatesFilter<"GoodCategory"> | Date | string deleted_at?: Prisma.DateTimeNullableWithAggregatesFilter<"GoodCategory"> | Date | string | null @@ -282,12 +300,13 @@ export type GoodCategoryCreateInput = { name: string description?: string | null image_url?: string | null - account_id: string - complex_id: string + is_default_guild_good?: boolean created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput + guild?: Prisma.GuildCreateNestedOneWithoutGood_categoriesInput + complex?: Prisma.ComplexCreateNestedOneWithoutGood_categoriesInput } export type GoodCategoryUncheckedCreateInput = { @@ -295,8 +314,9 @@ export type GoodCategoryUncheckedCreateInput = { name: string description?: string | null image_url?: string | null - account_id: string - complex_id: string + complex_id?: string | null + is_default_guild_good?: boolean + guild_id?: string | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null @@ -308,12 +328,13 @@ export type GoodCategoryUpdateInput = { name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput + guild?: Prisma.GuildUpdateOneWithoutGood_categoriesNestedInput + complex?: Prisma.ComplexUpdateOneWithoutGood_categoriesNestedInput } export type GoodCategoryUncheckedUpdateInput = { @@ -321,8 +342,9 @@ export type GoodCategoryUncheckedUpdateInput = { name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null @@ -334,8 +356,9 @@ export type GoodCategoryCreateManyInput = { name: string description?: string | null image_url?: string | null - account_id: string - complex_id: string + complex_id?: string | null + is_default_guild_good?: boolean + guild_id?: string | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null @@ -346,8 +369,7 @@ export type GoodCategoryUpdateManyMutationInput = { name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null @@ -358,13 +380,24 @@ export type GoodCategoryUncheckedUpdateManyInput = { name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } +export type GoodCategoryListRelationFilter = { + every?: Prisma.GoodCategoryWhereInput + some?: Prisma.GoodCategoryWhereInput + none?: Prisma.GoodCategoryWhereInput +} + +export type GoodCategoryOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + export type GoodCategoryNullableScalarRelationFilter = { is?: Prisma.GoodCategoryWhereInput | null isNot?: Prisma.GoodCategoryWhereInput | null @@ -381,8 +414,9 @@ export type GoodCategoryCountOrderByAggregateInput = { name?: Prisma.SortOrder description?: Prisma.SortOrder image_url?: Prisma.SortOrder - account_id?: Prisma.SortOrder complex_id?: Prisma.SortOrder + is_default_guild_good?: Prisma.SortOrder + guild_id?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrder @@ -393,8 +427,9 @@ export type GoodCategoryMaxOrderByAggregateInput = { name?: Prisma.SortOrder description?: Prisma.SortOrder image_url?: Prisma.SortOrder - account_id?: Prisma.SortOrder complex_id?: Prisma.SortOrder + is_default_guild_good?: Prisma.SortOrder + guild_id?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrder @@ -405,13 +440,98 @@ export type GoodCategoryMinOrderByAggregateInput = { name?: Prisma.SortOrder description?: Prisma.SortOrder image_url?: Prisma.SortOrder - account_id?: Prisma.SortOrder complex_id?: Prisma.SortOrder + is_default_guild_good?: Prisma.SortOrder + guild_id?: Prisma.SortOrder created_at?: Prisma.SortOrder updated_at?: Prisma.SortOrder deleted_at?: Prisma.SortOrder } +export type GoodCategoryCreateNestedManyWithoutGuildInput = { + create?: Prisma.XOR | Prisma.GoodCategoryCreateWithoutGuildInput[] | Prisma.GoodCategoryUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.GoodCategoryCreateOrConnectWithoutGuildInput | Prisma.GoodCategoryCreateOrConnectWithoutGuildInput[] + createMany?: Prisma.GoodCategoryCreateManyGuildInputEnvelope + connect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] +} + +export type GoodCategoryUncheckedCreateNestedManyWithoutGuildInput = { + create?: Prisma.XOR | Prisma.GoodCategoryCreateWithoutGuildInput[] | Prisma.GoodCategoryUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.GoodCategoryCreateOrConnectWithoutGuildInput | Prisma.GoodCategoryCreateOrConnectWithoutGuildInput[] + createMany?: Prisma.GoodCategoryCreateManyGuildInputEnvelope + connect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] +} + +export type GoodCategoryUpdateManyWithoutGuildNestedInput = { + create?: Prisma.XOR | Prisma.GoodCategoryCreateWithoutGuildInput[] | Prisma.GoodCategoryUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.GoodCategoryCreateOrConnectWithoutGuildInput | Prisma.GoodCategoryCreateOrConnectWithoutGuildInput[] + upsert?: Prisma.GoodCategoryUpsertWithWhereUniqueWithoutGuildInput | Prisma.GoodCategoryUpsertWithWhereUniqueWithoutGuildInput[] + createMany?: Prisma.GoodCategoryCreateManyGuildInputEnvelope + set?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + disconnect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + delete?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + connect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + update?: Prisma.GoodCategoryUpdateWithWhereUniqueWithoutGuildInput | Prisma.GoodCategoryUpdateWithWhereUniqueWithoutGuildInput[] + updateMany?: Prisma.GoodCategoryUpdateManyWithWhereWithoutGuildInput | Prisma.GoodCategoryUpdateManyWithWhereWithoutGuildInput[] + deleteMany?: Prisma.GoodCategoryScalarWhereInput | Prisma.GoodCategoryScalarWhereInput[] +} + +export type GoodCategoryUncheckedUpdateManyWithoutGuildNestedInput = { + create?: Prisma.XOR | Prisma.GoodCategoryCreateWithoutGuildInput[] | Prisma.GoodCategoryUncheckedCreateWithoutGuildInput[] + connectOrCreate?: Prisma.GoodCategoryCreateOrConnectWithoutGuildInput | Prisma.GoodCategoryCreateOrConnectWithoutGuildInput[] + upsert?: Prisma.GoodCategoryUpsertWithWhereUniqueWithoutGuildInput | Prisma.GoodCategoryUpsertWithWhereUniqueWithoutGuildInput[] + createMany?: Prisma.GoodCategoryCreateManyGuildInputEnvelope + set?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + disconnect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + delete?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + connect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + update?: Prisma.GoodCategoryUpdateWithWhereUniqueWithoutGuildInput | Prisma.GoodCategoryUpdateWithWhereUniqueWithoutGuildInput[] + updateMany?: Prisma.GoodCategoryUpdateManyWithWhereWithoutGuildInput | Prisma.GoodCategoryUpdateManyWithWhereWithoutGuildInput[] + deleteMany?: Prisma.GoodCategoryScalarWhereInput | Prisma.GoodCategoryScalarWhereInput[] +} + +export type GoodCategoryCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.GoodCategoryCreateWithoutComplexInput[] | Prisma.GoodCategoryUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.GoodCategoryCreateOrConnectWithoutComplexInput | Prisma.GoodCategoryCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.GoodCategoryCreateManyComplexInputEnvelope + connect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] +} + +export type GoodCategoryUncheckedCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.GoodCategoryCreateWithoutComplexInput[] | Prisma.GoodCategoryUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.GoodCategoryCreateOrConnectWithoutComplexInput | Prisma.GoodCategoryCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.GoodCategoryCreateManyComplexInputEnvelope + connect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] +} + +export type GoodCategoryUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.GoodCategoryCreateWithoutComplexInput[] | Prisma.GoodCategoryUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.GoodCategoryCreateOrConnectWithoutComplexInput | Prisma.GoodCategoryCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.GoodCategoryUpsertWithWhereUniqueWithoutComplexInput | Prisma.GoodCategoryUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.GoodCategoryCreateManyComplexInputEnvelope + set?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + disconnect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + delete?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + connect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + update?: Prisma.GoodCategoryUpdateWithWhereUniqueWithoutComplexInput | Prisma.GoodCategoryUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.GoodCategoryUpdateManyWithWhereWithoutComplexInput | Prisma.GoodCategoryUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.GoodCategoryScalarWhereInput | Prisma.GoodCategoryScalarWhereInput[] +} + +export type GoodCategoryUncheckedUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.GoodCategoryCreateWithoutComplexInput[] | Prisma.GoodCategoryUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.GoodCategoryCreateOrConnectWithoutComplexInput | Prisma.GoodCategoryCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.GoodCategoryUpsertWithWhereUniqueWithoutComplexInput | Prisma.GoodCategoryUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.GoodCategoryCreateManyComplexInputEnvelope + set?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + disconnect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + delete?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + connect?: Prisma.GoodCategoryWhereUniqueInput | Prisma.GoodCategoryWhereUniqueInput[] + update?: Prisma.GoodCategoryUpdateWithWhereUniqueWithoutComplexInput | Prisma.GoodCategoryUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.GoodCategoryUpdateManyWithWhereWithoutComplexInput | Prisma.GoodCategoryUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.GoodCategoryScalarWhereInput | Prisma.GoodCategoryScalarWhereInput[] +} + export type GoodCategoryCreateNestedOneWithoutGoodsInput = { create?: Prisma.XOR connectOrCreate?: Prisma.GoodCategoryCreateOrConnectWithoutGoodsInput @@ -428,16 +548,137 @@ export type GoodCategoryUpdateOneWithoutGoodsNestedInput = { update?: Prisma.XOR, Prisma.GoodCategoryUncheckedUpdateWithoutGoodsInput> } +export type GoodCategoryCreateWithoutGuildInput = { + id?: string + name: string + description?: string | null + image_url?: string | null + is_default_guild_good?: boolean + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput + complex?: Prisma.ComplexCreateNestedOneWithoutGood_categoriesInput +} + +export type GoodCategoryUncheckedCreateWithoutGuildInput = { + id?: string + name: string + description?: string | null + image_url?: string | null + complex_id?: string | null + is_default_guild_good?: boolean + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutCategoryInput +} + +export type GoodCategoryCreateOrConnectWithoutGuildInput = { + where: Prisma.GoodCategoryWhereUniqueInput + create: Prisma.XOR +} + +export type GoodCategoryCreateManyGuildInputEnvelope = { + data: Prisma.GoodCategoryCreateManyGuildInput | Prisma.GoodCategoryCreateManyGuildInput[] + skipDuplicates?: boolean +} + +export type GoodCategoryUpsertWithWhereUniqueWithoutGuildInput = { + where: Prisma.GoodCategoryWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type GoodCategoryUpdateWithWhereUniqueWithoutGuildInput = { + where: Prisma.GoodCategoryWhereUniqueInput + data: Prisma.XOR +} + +export type GoodCategoryUpdateManyWithWhereWithoutGuildInput = { + where: Prisma.GoodCategoryScalarWhereInput + data: Prisma.XOR +} + +export type GoodCategoryScalarWhereInput = { + AND?: Prisma.GoodCategoryScalarWhereInput | Prisma.GoodCategoryScalarWhereInput[] + OR?: Prisma.GoodCategoryScalarWhereInput[] + NOT?: Prisma.GoodCategoryScalarWhereInput | Prisma.GoodCategoryScalarWhereInput[] + id?: Prisma.StringFilter<"GoodCategory"> | string + name?: Prisma.StringFilter<"GoodCategory"> | string + description?: Prisma.StringNullableFilter<"GoodCategory"> | string | null + image_url?: Prisma.StringNullableFilter<"GoodCategory"> | string | null + complex_id?: Prisma.StringNullableFilter<"GoodCategory"> | string | null + is_default_guild_good?: Prisma.BoolFilter<"GoodCategory"> | boolean + guild_id?: Prisma.StringNullableFilter<"GoodCategory"> | string | null + created_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string + updated_at?: Prisma.DateTimeFilter<"GoodCategory"> | Date | string + deleted_at?: Prisma.DateTimeNullableFilter<"GoodCategory"> | Date | string | null +} + +export type GoodCategoryCreateWithoutComplexInput = { + id?: string + name: string + description?: string | null + image_url?: string | null + is_default_guild_good?: boolean + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + goods?: Prisma.GoodCreateNestedManyWithoutCategoryInput + guild?: Prisma.GuildCreateNestedOneWithoutGood_categoriesInput +} + +export type GoodCategoryUncheckedCreateWithoutComplexInput = { + id?: string + name: string + description?: string | null + image_url?: string | null + is_default_guild_good?: boolean + guild_id?: string | null + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutCategoryInput +} + +export type GoodCategoryCreateOrConnectWithoutComplexInput = { + where: Prisma.GoodCategoryWhereUniqueInput + create: Prisma.XOR +} + +export type GoodCategoryCreateManyComplexInputEnvelope = { + data: Prisma.GoodCategoryCreateManyComplexInput | Prisma.GoodCategoryCreateManyComplexInput[] + skipDuplicates?: boolean +} + +export type GoodCategoryUpsertWithWhereUniqueWithoutComplexInput = { + where: Prisma.GoodCategoryWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type GoodCategoryUpdateWithWhereUniqueWithoutComplexInput = { + where: Prisma.GoodCategoryWhereUniqueInput + data: Prisma.XOR +} + +export type GoodCategoryUpdateManyWithWhereWithoutComplexInput = { + where: Prisma.GoodCategoryScalarWhereInput + data: Prisma.XOR +} + export type GoodCategoryCreateWithoutGoodsInput = { id?: string name: string description?: string | null image_url?: string | null - account_id: string - complex_id: string + is_default_guild_good?: boolean created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null + guild?: Prisma.GuildCreateNestedOneWithoutGood_categoriesInput + complex?: Prisma.ComplexCreateNestedOneWithoutGood_categoriesInput } export type GoodCategoryUncheckedCreateWithoutGoodsInput = { @@ -445,8 +686,9 @@ export type GoodCategoryUncheckedCreateWithoutGoodsInput = { name: string description?: string | null image_url?: string | null - account_id: string - complex_id: string + complex_id?: string | null + is_default_guild_good?: boolean + guild_id?: string | null created_at?: Date | string updated_at?: Date | string deleted_at?: Date | string | null @@ -473,11 +715,12 @@ export type GoodCategoryUpdateWithoutGoodsInput = { name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + guild?: Prisma.GuildUpdateOneWithoutGood_categoriesNestedInput + complex?: Prisma.ComplexUpdateOneWithoutGood_categoriesNestedInput } export type GoodCategoryUncheckedUpdateWithoutGoodsInput = { @@ -485,8 +728,109 @@ export type GoodCategoryUncheckedUpdateWithoutGoodsInput = { name?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - account_id?: Prisma.StringFieldUpdateOperationsInput | string - complex_id?: Prisma.StringFieldUpdateOperationsInput | string + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + +export type GoodCategoryCreateManyGuildInput = { + id?: string + name: string + description?: string | null + image_url?: string | null + complex_id?: string | null + is_default_guild_good?: boolean + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null +} + +export type GoodCategoryUpdateWithoutGuildInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput + complex?: Prisma.ComplexUpdateOneWithoutGood_categoriesNestedInput +} + +export type GoodCategoryUncheckedUpdateWithoutGuildInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + goods?: Prisma.GoodUncheckedUpdateManyWithoutCategoryNestedInput +} + +export type GoodCategoryUncheckedUpdateManyWithoutGuildInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + complex_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + +export type GoodCategoryCreateManyComplexInput = { + id?: string + name: string + description?: string | null + image_url?: string | null + is_default_guild_good?: boolean + guild_id?: string | null + created_at?: Date | string + updated_at?: Date | string + deleted_at?: Date | string | null +} + +export type GoodCategoryUpdateWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + goods?: Prisma.GoodUpdateManyWithoutCategoryNestedInput + guild?: Prisma.GuildUpdateOneWithoutGood_categoriesNestedInput +} + +export type GoodCategoryUncheckedUpdateWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + goods?: Prisma.GoodUncheckedUpdateManyWithoutCategoryNestedInput +} + +export type GoodCategoryUncheckedUpdateManyWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + image_url?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + is_default_guild_good?: Prisma.BoolFieldUpdateOperationsInput | boolean + guild_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deleted_at?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null @@ -528,12 +872,15 @@ export type GoodCategorySelect + guild?: boolean | Prisma.GoodCategory$guildArgs + complex?: boolean | Prisma.GoodCategory$complexArgs _count?: boolean | Prisma.GoodCategoryCountOutputTypeDefaultArgs }, ExtArgs["result"]["goodCategory"]> @@ -544,16 +891,19 @@ export type GoodCategorySelectScalar = { name?: boolean description?: boolean image_url?: boolean - account_id?: boolean complex_id?: boolean + is_default_guild_good?: boolean + guild_id?: boolean created_at?: boolean updated_at?: boolean deleted_at?: boolean } -export type GoodCategoryOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "image_url" | "account_id" | "complex_id" | "created_at" | "updated_at" | "deleted_at", ExtArgs["result"]["goodCategory"]> +export type GoodCategoryOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "image_url" | "complex_id" | "is_default_guild_good" | "guild_id" | "created_at" | "updated_at" | "deleted_at", ExtArgs["result"]["goodCategory"]> export type GoodCategoryInclude = { goods?: boolean | Prisma.GoodCategory$goodsArgs + guild?: boolean | Prisma.GoodCategory$guildArgs + complex?: boolean | Prisma.GoodCategory$complexArgs _count?: boolean | Prisma.GoodCategoryCountOutputTypeDefaultArgs } @@ -561,14 +911,17 @@ export type $GoodCategoryPayload[] + guild: Prisma.$GuildPayload | null + complex: Prisma.$ComplexPayload | null } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: string name: string description: string | null image_url: string | null - account_id: string - complex_id: string + complex_id: string | null + is_default_guild_good: boolean + guild_id: string | null created_at: Date updated_at: Date deleted_at: Date | null @@ -913,6 +1266,8 @@ readonly fields: GoodCategoryFieldRefs; export interface Prisma__GoodCategoryClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" goods = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + guild = {}>(args?: Prisma.Subset>): Prisma.Prisma__GuildClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + complex = {}>(args?: Prisma.Subset>): Prisma.Prisma__ComplexClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -946,8 +1301,9 @@ export interface GoodCategoryFieldRefs { readonly name: Prisma.FieldRef<"GoodCategory", 'String'> readonly description: Prisma.FieldRef<"GoodCategory", 'String'> readonly image_url: Prisma.FieldRef<"GoodCategory", 'String'> - readonly account_id: Prisma.FieldRef<"GoodCategory", 'String'> readonly complex_id: Prisma.FieldRef<"GoodCategory", 'String'> + readonly is_default_guild_good: Prisma.FieldRef<"GoodCategory", 'Boolean'> + readonly guild_id: Prisma.FieldRef<"GoodCategory", 'String'> readonly created_at: Prisma.FieldRef<"GoodCategory", 'DateTime'> readonly updated_at: Prisma.FieldRef<"GoodCategory", 'DateTime'> readonly deleted_at: Prisma.FieldRef<"GoodCategory", 'DateTime'> @@ -1317,6 +1673,44 @@ export type GoodCategory$goodsArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + where?: Prisma.GuildWhereInput +} + +/** + * GoodCategory.complex + */ +export type GoodCategory$complexArgs = { + /** + * Select specific fields to fetch from the Complex + */ + select?: Prisma.ComplexSelect | null + /** + * Omit specific fields from the Complex + */ + omit?: Prisma.ComplexOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ComplexInclude | null + where?: Prisma.ComplexWhereInput +} + /** * GoodCategory without action */ diff --git a/src/generated/prisma/models/Guild.ts b/src/generated/prisma/models/Guild.ts new file mode 100644 index 0000000..f26cedc --- /dev/null +++ b/src/generated/prisma/models/Guild.ts @@ -0,0 +1,1387 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Guild` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Guild + * + */ +export type GuildModel = runtime.Types.Result.DefaultSelection + +export type AggregateGuild = { + _count: GuildCountAggregateOutputType | null + _min: GuildMinAggregateOutputType | null + _max: GuildMaxAggregateOutputType | null +} + +export type GuildMinAggregateOutputType = { + id: string | null + name: string | null + code: string | null +} + +export type GuildMaxAggregateOutputType = { + id: string | null + name: string | null + code: string | null +} + +export type GuildCountAggregateOutputType = { + id: number + name: number + code: number + _all: number +} + + +export type GuildMinAggregateInputType = { + id?: true + name?: true + code?: true +} + +export type GuildMaxAggregateInputType = { + id?: true + name?: true + code?: true +} + +export type GuildCountAggregateInputType = { + id?: true + name?: true + code?: true + _all?: true +} + +export type GuildAggregateArgs = { + /** + * Filter which Guild to aggregate. + */ + where?: Prisma.GuildWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Guilds to fetch. + */ + orderBy?: Prisma.GuildOrderByWithRelationInput | Prisma.GuildOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.GuildWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Guilds from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Guilds. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Guilds + **/ + _count?: true | GuildCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: GuildMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: GuildMaxAggregateInputType +} + +export type GetGuildAggregateType = { + [P in keyof T & keyof AggregateGuild]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type GuildGroupByArgs = { + where?: Prisma.GuildWhereInput + orderBy?: Prisma.GuildOrderByWithAggregationInput | Prisma.GuildOrderByWithAggregationInput[] + by: Prisma.GuildScalarFieldEnum[] | Prisma.GuildScalarFieldEnum + having?: Prisma.GuildScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: GuildCountAggregateInputType | true + _min?: GuildMinAggregateInputType + _max?: GuildMaxAggregateInputType +} + +export type GuildGroupByOutputType = { + id: string + name: string + code: string | null + _count: GuildCountAggregateOutputType | null + _min: GuildMinAggregateOutputType | null + _max: GuildMaxAggregateOutputType | null +} + +type GetGuildGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof GuildGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type GuildWhereInput = { + AND?: Prisma.GuildWhereInput | Prisma.GuildWhereInput[] + OR?: Prisma.GuildWhereInput[] + NOT?: Prisma.GuildWhereInput | Prisma.GuildWhereInput[] + id?: Prisma.StringFilter<"Guild"> | string + name?: Prisma.StringFilter<"Guild"> | string + code?: Prisma.StringNullableFilter<"Guild"> | string | null + business_activities?: Prisma.BusinessActivityListRelationFilter + goods?: Prisma.GoodListRelationFilter + good_categories?: Prisma.GoodCategoryListRelationFilter +} + +export type GuildOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrderInput | Prisma.SortOrder + business_activities?: Prisma.BusinessActivityOrderByRelationAggregateInput + goods?: Prisma.GoodOrderByRelationAggregateInput + good_categories?: Prisma.GoodCategoryOrderByRelationAggregateInput + _relevance?: Prisma.GuildOrderByRelevanceInput +} + +export type GuildWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.GuildWhereInput | Prisma.GuildWhereInput[] + OR?: Prisma.GuildWhereInput[] + NOT?: Prisma.GuildWhereInput | Prisma.GuildWhereInput[] + name?: Prisma.StringFilter<"Guild"> | string + code?: Prisma.StringNullableFilter<"Guild"> | string | null + business_activities?: Prisma.BusinessActivityListRelationFilter + goods?: Prisma.GoodListRelationFilter + good_categories?: Prisma.GoodCategoryListRelationFilter +}, "id"> + +export type GuildOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.GuildCountOrderByAggregateInput + _max?: Prisma.GuildMaxOrderByAggregateInput + _min?: Prisma.GuildMinOrderByAggregateInput +} + +export type GuildScalarWhereWithAggregatesInput = { + AND?: Prisma.GuildScalarWhereWithAggregatesInput | Prisma.GuildScalarWhereWithAggregatesInput[] + OR?: Prisma.GuildScalarWhereWithAggregatesInput[] + NOT?: Prisma.GuildScalarWhereWithAggregatesInput | Prisma.GuildScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Guild"> | string + name?: Prisma.StringWithAggregatesFilter<"Guild"> | string + code?: Prisma.StringNullableWithAggregatesFilter<"Guild"> | string | null +} + +export type GuildCreateInput = { + id?: string + name: string + code?: string | null + business_activities?: Prisma.BusinessActivityCreateNestedManyWithoutGuildInput + goods?: Prisma.GoodCreateNestedManyWithoutGuildInput + good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutGuildInput +} + +export type GuildUncheckedCreateInput = { + id?: string + name: string + code?: string | null + business_activities?: Prisma.BusinessActivityUncheckedCreateNestedManyWithoutGuildInput + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutGuildInput + good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutGuildInput +} + +export type GuildUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activities?: Prisma.BusinessActivityUpdateManyWithoutGuildNestedInput + goods?: Prisma.GoodUpdateManyWithoutGuildNestedInput + good_categories?: Prisma.GoodCategoryUpdateManyWithoutGuildNestedInput +} + +export type GuildUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activities?: Prisma.BusinessActivityUncheckedUpdateManyWithoutGuildNestedInput + goods?: Prisma.GoodUncheckedUpdateManyWithoutGuildNestedInput + good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutGuildNestedInput +} + +export type GuildCreateManyInput = { + id?: string + name: string + code?: string | null +} + +export type GuildUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type GuildUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type GuildOrderByRelevanceInput = { + fields: Prisma.GuildOrderByRelevanceFieldEnum | Prisma.GuildOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type GuildCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrder +} + +export type GuildMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrder +} + +export type GuildMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrder +} + +export type GuildScalarRelationFilter = { + is?: Prisma.GuildWhereInput + isNot?: Prisma.GuildWhereInput +} + +export type GuildNullableScalarRelationFilter = { + is?: Prisma.GuildWhereInput | null + isNot?: Prisma.GuildWhereInput | null +} + +export type NullableStringFieldUpdateOperationsInput = { + set?: string | null +} + +export type GuildCreateNestedOneWithoutBusiness_activitiesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.GuildCreateOrConnectWithoutBusiness_activitiesInput + connect?: Prisma.GuildWhereUniqueInput +} + +export type GuildUpdateOneRequiredWithoutBusiness_activitiesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.GuildCreateOrConnectWithoutBusiness_activitiesInput + upsert?: Prisma.GuildUpsertWithoutBusiness_activitiesInput + connect?: Prisma.GuildWhereUniqueInput + update?: Prisma.XOR, Prisma.GuildUncheckedUpdateWithoutBusiness_activitiesInput> +} + +export type GuildCreateNestedOneWithoutGoodsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.GuildCreateOrConnectWithoutGoodsInput + connect?: Prisma.GuildWhereUniqueInput +} + +export type GuildUpdateOneWithoutGoodsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.GuildCreateOrConnectWithoutGoodsInput + upsert?: Prisma.GuildUpsertWithoutGoodsInput + disconnect?: Prisma.GuildWhereInput | boolean + delete?: Prisma.GuildWhereInput | boolean + connect?: Prisma.GuildWhereUniqueInput + update?: Prisma.XOR, Prisma.GuildUncheckedUpdateWithoutGoodsInput> +} + +export type GuildCreateNestedOneWithoutGood_categoriesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.GuildCreateOrConnectWithoutGood_categoriesInput + connect?: Prisma.GuildWhereUniqueInput +} + +export type GuildUpdateOneWithoutGood_categoriesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.GuildCreateOrConnectWithoutGood_categoriesInput + upsert?: Prisma.GuildUpsertWithoutGood_categoriesInput + disconnect?: Prisma.GuildWhereInput | boolean + delete?: Prisma.GuildWhereInput | boolean + connect?: Prisma.GuildWhereUniqueInput + update?: Prisma.XOR, Prisma.GuildUncheckedUpdateWithoutGood_categoriesInput> +} + +export type GuildCreateWithoutBusiness_activitiesInput = { + id?: string + name: string + code?: string | null + goods?: Prisma.GoodCreateNestedManyWithoutGuildInput + good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutGuildInput +} + +export type GuildUncheckedCreateWithoutBusiness_activitiesInput = { + id?: string + name: string + code?: string | null + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutGuildInput + good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutGuildInput +} + +export type GuildCreateOrConnectWithoutBusiness_activitiesInput = { + where: Prisma.GuildWhereUniqueInput + create: Prisma.XOR +} + +export type GuildUpsertWithoutBusiness_activitiesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.GuildWhereInput +} + +export type GuildUpdateToOneWithWhereWithoutBusiness_activitiesInput = { + where?: Prisma.GuildWhereInput + data: Prisma.XOR +} + +export type GuildUpdateWithoutBusiness_activitiesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + goods?: Prisma.GoodUpdateManyWithoutGuildNestedInput + good_categories?: Prisma.GoodCategoryUpdateManyWithoutGuildNestedInput +} + +export type GuildUncheckedUpdateWithoutBusiness_activitiesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + goods?: Prisma.GoodUncheckedUpdateManyWithoutGuildNestedInput + good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutGuildNestedInput +} + +export type GuildCreateWithoutGoodsInput = { + id?: string + name: string + code?: string | null + business_activities?: Prisma.BusinessActivityCreateNestedManyWithoutGuildInput + good_categories?: Prisma.GoodCategoryCreateNestedManyWithoutGuildInput +} + +export type GuildUncheckedCreateWithoutGoodsInput = { + id?: string + name: string + code?: string | null + business_activities?: Prisma.BusinessActivityUncheckedCreateNestedManyWithoutGuildInput + good_categories?: Prisma.GoodCategoryUncheckedCreateNestedManyWithoutGuildInput +} + +export type GuildCreateOrConnectWithoutGoodsInput = { + where: Prisma.GuildWhereUniqueInput + create: Prisma.XOR +} + +export type GuildUpsertWithoutGoodsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.GuildWhereInput +} + +export type GuildUpdateToOneWithWhereWithoutGoodsInput = { + where?: Prisma.GuildWhereInput + data: Prisma.XOR +} + +export type GuildUpdateWithoutGoodsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activities?: Prisma.BusinessActivityUpdateManyWithoutGuildNestedInput + good_categories?: Prisma.GoodCategoryUpdateManyWithoutGuildNestedInput +} + +export type GuildUncheckedUpdateWithoutGoodsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activities?: Prisma.BusinessActivityUncheckedUpdateManyWithoutGuildNestedInput + good_categories?: Prisma.GoodCategoryUncheckedUpdateManyWithoutGuildNestedInput +} + +export type GuildCreateWithoutGood_categoriesInput = { + id?: string + name: string + code?: string | null + business_activities?: Prisma.BusinessActivityCreateNestedManyWithoutGuildInput + goods?: Prisma.GoodCreateNestedManyWithoutGuildInput +} + +export type GuildUncheckedCreateWithoutGood_categoriesInput = { + id?: string + name: string + code?: string | null + business_activities?: Prisma.BusinessActivityUncheckedCreateNestedManyWithoutGuildInput + goods?: Prisma.GoodUncheckedCreateNestedManyWithoutGuildInput +} + +export type GuildCreateOrConnectWithoutGood_categoriesInput = { + where: Prisma.GuildWhereUniqueInput + create: Prisma.XOR +} + +export type GuildUpsertWithoutGood_categoriesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.GuildWhereInput +} + +export type GuildUpdateToOneWithWhereWithoutGood_categoriesInput = { + where?: Prisma.GuildWhereInput + data: Prisma.XOR +} + +export type GuildUpdateWithoutGood_categoriesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activities?: Prisma.BusinessActivityUpdateManyWithoutGuildNestedInput + goods?: Prisma.GoodUpdateManyWithoutGuildNestedInput +} + +export type GuildUncheckedUpdateWithoutGood_categoriesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + business_activities?: Prisma.BusinessActivityUncheckedUpdateManyWithoutGuildNestedInput + goods?: Prisma.GoodUncheckedUpdateManyWithoutGuildNestedInput +} + + +/** + * Count Type GuildCountOutputType + */ + +export type GuildCountOutputType = { + business_activities: number + goods: number + good_categories: number +} + +export type GuildCountOutputTypeSelect = { + business_activities?: boolean | GuildCountOutputTypeCountBusiness_activitiesArgs + goods?: boolean | GuildCountOutputTypeCountGoodsArgs + good_categories?: boolean | GuildCountOutputTypeCountGood_categoriesArgs +} + +/** + * GuildCountOutputType without action + */ +export type GuildCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the GuildCountOutputType + */ + select?: Prisma.GuildCountOutputTypeSelect | null +} + +/** + * GuildCountOutputType without action + */ +export type GuildCountOutputTypeCountBusiness_activitiesArgs = { + where?: Prisma.BusinessActivityWhereInput +} + +/** + * GuildCountOutputType without action + */ +export type GuildCountOutputTypeCountGoodsArgs = { + where?: Prisma.GoodWhereInput +} + +/** + * GuildCountOutputType without action + */ +export type GuildCountOutputTypeCountGood_categoriesArgs = { + where?: Prisma.GoodCategoryWhereInput +} + + +export type GuildSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + code?: boolean + business_activities?: boolean | Prisma.Guild$business_activitiesArgs + goods?: boolean | Prisma.Guild$goodsArgs + good_categories?: boolean | Prisma.Guild$good_categoriesArgs + _count?: boolean | Prisma.GuildCountOutputTypeDefaultArgs +}, ExtArgs["result"]["guild"]> + + + +export type GuildSelectScalar = { + id?: boolean + name?: boolean + code?: boolean +} + +export type GuildOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "code", ExtArgs["result"]["guild"]> +export type GuildInclude = { + business_activities?: boolean | Prisma.Guild$business_activitiesArgs + goods?: boolean | Prisma.Guild$goodsArgs + good_categories?: boolean | Prisma.Guild$good_categoriesArgs + _count?: boolean | Prisma.GuildCountOutputTypeDefaultArgs +} + +export type $GuildPayload = { + name: "Guild" + objects: { + business_activities: Prisma.$BusinessActivityPayload[] + goods: Prisma.$GoodPayload[] + good_categories: Prisma.$GoodCategoryPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + code: string | null + }, ExtArgs["result"]["guild"]> + composites: {} +} + +export type GuildGetPayload = runtime.Types.Result.GetResult + +export type GuildCountArgs = + Omit & { + select?: GuildCountAggregateInputType | true + } + +export interface GuildDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Guild'], meta: { name: 'Guild' } } + /** + * Find zero or one Guild that matches the filter. + * @param {GuildFindUniqueArgs} args - Arguments to find a Guild + * @example + * // Get one Guild + * const guild = await prisma.guild.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__GuildClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Guild that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {GuildFindUniqueOrThrowArgs} args - Arguments to find a Guild + * @example + * // Get one Guild + * const guild = await prisma.guild.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__GuildClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Guild that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildFindFirstArgs} args - Arguments to find a Guild + * @example + * // Get one Guild + * const guild = await prisma.guild.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__GuildClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Guild that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildFindFirstOrThrowArgs} args - Arguments to find a Guild + * @example + * // Get one Guild + * const guild = await prisma.guild.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__GuildClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Guilds that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Guilds + * const guilds = await prisma.guild.findMany() + * + * // Get first 10 Guilds + * const guilds = await prisma.guild.findMany({ take: 10 }) + * + * // Only select the `id` + * const guildWithIdOnly = await prisma.guild.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Guild. + * @param {GuildCreateArgs} args - Arguments to create a Guild. + * @example + * // Create one Guild + * const Guild = await prisma.guild.create({ + * data: { + * // ... data to create a Guild + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__GuildClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Guilds. + * @param {GuildCreateManyArgs} args - Arguments to create many Guilds. + * @example + * // Create many Guilds + * const guild = await prisma.guild.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a Guild. + * @param {GuildDeleteArgs} args - Arguments to delete one Guild. + * @example + * // Delete one Guild + * const Guild = await prisma.guild.delete({ + * where: { + * // ... filter to delete one Guild + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__GuildClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Guild. + * @param {GuildUpdateArgs} args - Arguments to update one Guild. + * @example + * // Update one Guild + * const guild = await prisma.guild.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__GuildClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Guilds. + * @param {GuildDeleteManyArgs} args - Arguments to filter Guilds to delete. + * @example + * // Delete a few Guilds + * const { count } = await prisma.guild.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Guilds. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Guilds + * const guild = await prisma.guild.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Guild. + * @param {GuildUpsertArgs} args - Arguments to update or create a Guild. + * @example + * // Update or create a Guild + * const guild = await prisma.guild.upsert({ + * create: { + * // ... data to create a Guild + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Guild we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__GuildClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Guilds. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildCountArgs} args - Arguments to filter Guilds to count. + * @example + * // Count the number of Guilds + * const count = await prisma.guild.count({ + * where: { + * // ... the filter for the Guilds we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Guild. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Guild. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {GuildGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends GuildGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: GuildGroupByArgs['orderBy'] } + : { orderBy?: GuildGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetGuildGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Guild model + */ +readonly fields: GuildFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Guild. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__GuildClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + business_activities = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + goods = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + good_categories = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Guild model + */ +export interface GuildFieldRefs { + readonly id: Prisma.FieldRef<"Guild", 'String'> + readonly name: Prisma.FieldRef<"Guild", 'String'> + readonly code: Prisma.FieldRef<"Guild", 'String'> +} + + +// Custom InputTypes +/** + * Guild findUnique + */ +export type GuildFindUniqueArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + /** + * Filter, which Guild to fetch. + */ + where: Prisma.GuildWhereUniqueInput +} + +/** + * Guild findUniqueOrThrow + */ +export type GuildFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + /** + * Filter, which Guild to fetch. + */ + where: Prisma.GuildWhereUniqueInput +} + +/** + * Guild findFirst + */ +export type GuildFindFirstArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + /** + * Filter, which Guild to fetch. + */ + where?: Prisma.GuildWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Guilds to fetch. + */ + orderBy?: Prisma.GuildOrderByWithRelationInput | Prisma.GuildOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Guilds. + */ + cursor?: Prisma.GuildWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Guilds from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Guilds. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Guilds. + */ + distinct?: Prisma.GuildScalarFieldEnum | Prisma.GuildScalarFieldEnum[] +} + +/** + * Guild findFirstOrThrow + */ +export type GuildFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + /** + * Filter, which Guild to fetch. + */ + where?: Prisma.GuildWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Guilds to fetch. + */ + orderBy?: Prisma.GuildOrderByWithRelationInput | Prisma.GuildOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Guilds. + */ + cursor?: Prisma.GuildWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Guilds from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Guilds. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Guilds. + */ + distinct?: Prisma.GuildScalarFieldEnum | Prisma.GuildScalarFieldEnum[] +} + +/** + * Guild findMany + */ +export type GuildFindManyArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + /** + * Filter, which Guilds to fetch. + */ + where?: Prisma.GuildWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Guilds to fetch. + */ + orderBy?: Prisma.GuildOrderByWithRelationInput | Prisma.GuildOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Guilds. + */ + cursor?: Prisma.GuildWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Guilds from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Guilds. + */ + skip?: number + distinct?: Prisma.GuildScalarFieldEnum | Prisma.GuildScalarFieldEnum[] +} + +/** + * Guild create + */ +export type GuildCreateArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + /** + * The data needed to create a Guild. + */ + data: Prisma.XOR +} + +/** + * Guild createMany + */ +export type GuildCreateManyArgs = { + /** + * The data used to create many Guilds. + */ + data: Prisma.GuildCreateManyInput | Prisma.GuildCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Guild update + */ +export type GuildUpdateArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + /** + * The data needed to update a Guild. + */ + data: Prisma.XOR + /** + * Choose, which Guild to update. + */ + where: Prisma.GuildWhereUniqueInput +} + +/** + * Guild updateMany + */ +export type GuildUpdateManyArgs = { + /** + * The data used to update Guilds. + */ + data: Prisma.XOR + /** + * Filter which Guilds to update + */ + where?: Prisma.GuildWhereInput + /** + * Limit how many Guilds to update. + */ + limit?: number +} + +/** + * Guild upsert + */ +export type GuildUpsertArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + /** + * The filter to search for the Guild to update in case it exists. + */ + where: Prisma.GuildWhereUniqueInput + /** + * In case the Guild found by the `where` argument doesn't exist, create a new Guild with this data. + */ + create: Prisma.XOR + /** + * In case the Guild was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Guild delete + */ +export type GuildDeleteArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null + /** + * Filter which Guild to delete. + */ + where: Prisma.GuildWhereUniqueInput +} + +/** + * Guild deleteMany + */ +export type GuildDeleteManyArgs = { + /** + * Filter which Guilds to delete + */ + where?: Prisma.GuildWhereInput + /** + * Limit how many Guilds to delete. + */ + limit?: number +} + +/** + * Guild.business_activities + */ +export type Guild$business_activitiesArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + where?: Prisma.BusinessActivityWhereInput + orderBy?: Prisma.BusinessActivityOrderByWithRelationInput | Prisma.BusinessActivityOrderByWithRelationInput[] + cursor?: Prisma.BusinessActivityWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.BusinessActivityScalarFieldEnum | Prisma.BusinessActivityScalarFieldEnum[] +} + +/** + * Guild.goods + */ +export type Guild$goodsArgs = { + /** + * Select specific fields to fetch from the Good + */ + select?: Prisma.GoodSelect | null + /** + * Omit specific fields from the Good + */ + omit?: Prisma.GoodOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GoodInclude | null + where?: Prisma.GoodWhereInput + orderBy?: Prisma.GoodOrderByWithRelationInput | Prisma.GoodOrderByWithRelationInput[] + cursor?: Prisma.GoodWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.GoodScalarFieldEnum | Prisma.GoodScalarFieldEnum[] +} + +/** + * Guild.good_categories + */ +export type Guild$good_categoriesArgs = { + /** + * Select specific fields to fetch from the GoodCategory + */ + select?: Prisma.GoodCategorySelect | null + /** + * Omit specific fields from the GoodCategory + */ + omit?: Prisma.GoodCategoryOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GoodCategoryInclude | null + where?: Prisma.GoodCategoryWhereInput + orderBy?: Prisma.GoodCategoryOrderByWithRelationInput | Prisma.GoodCategoryOrderByWithRelationInput[] + cursor?: Prisma.GoodCategoryWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.GoodCategoryScalarFieldEnum | Prisma.GoodCategoryScalarFieldEnum[] +} + +/** + * Guild without action + */ +export type GuildDefaultArgs = { + /** + * Select specific fields to fetch from the Guild + */ + select?: Prisma.GuildSelect | null + /** + * Omit specific fields from the Guild + */ + omit?: Prisma.GuildOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.GuildInclude | null +} diff --git a/src/generated/prisma/models/License.ts b/src/generated/prisma/models/License.ts new file mode 100644 index 0000000..7564517 --- /dev/null +++ b/src/generated/prisma/models/License.ts @@ -0,0 +1,1377 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `License` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model License + * + */ +export type LicenseModel = runtime.Types.Result.DefaultSelection + +export type AggregateLicense = { + _count: LicenseCountAggregateOutputType | null + _min: LicenseMinAggregateOutputType | null + _max: LicenseMaxAggregateOutputType | null +} + +export type LicenseMinAggregateOutputType = { + id: string | null + starts_at: Date | null + expires_at: Date | null + status: $Enums.LicenseStatus | null + pos_id: string | null + partner_id: string | null +} + +export type LicenseMaxAggregateOutputType = { + id: string | null + starts_at: Date | null + expires_at: Date | null + status: $Enums.LicenseStatus | null + pos_id: string | null + partner_id: string | null +} + +export type LicenseCountAggregateOutputType = { + id: number + starts_at: number + expires_at: number + status: number + pos_id: number + partner_id: number + _all: number +} + + +export type LicenseMinAggregateInputType = { + id?: true + starts_at?: true + expires_at?: true + status?: true + pos_id?: true + partner_id?: true +} + +export type LicenseMaxAggregateInputType = { + id?: true + starts_at?: true + expires_at?: true + status?: true + pos_id?: true + partner_id?: true +} + +export type LicenseCountAggregateInputType = { + id?: true + starts_at?: true + expires_at?: true + status?: true + pos_id?: true + partner_id?: true + _all?: true +} + +export type LicenseAggregateArgs = { + /** + * Filter which License to aggregate. + */ + where?: Prisma.LicenseWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Licenses to fetch. + */ + orderBy?: Prisma.LicenseOrderByWithRelationInput | Prisma.LicenseOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.LicenseWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Licenses from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Licenses. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Licenses + **/ + _count?: true | LicenseCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: LicenseMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: LicenseMaxAggregateInputType +} + +export type GetLicenseAggregateType = { + [P in keyof T & keyof AggregateLicense]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type LicenseGroupByArgs = { + where?: Prisma.LicenseWhereInput + orderBy?: Prisma.LicenseOrderByWithAggregationInput | Prisma.LicenseOrderByWithAggregationInput[] + by: Prisma.LicenseScalarFieldEnum[] | Prisma.LicenseScalarFieldEnum + having?: Prisma.LicenseScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: LicenseCountAggregateInputType | true + _min?: LicenseMinAggregateInputType + _max?: LicenseMaxAggregateInputType +} + +export type LicenseGroupByOutputType = { + id: string + starts_at: Date + expires_at: Date + status: $Enums.LicenseStatus + pos_id: string + partner_id: string + _count: LicenseCountAggregateOutputType | null + _min: LicenseMinAggregateOutputType | null + _max: LicenseMaxAggregateOutputType | null +} + +type GetLicenseGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof LicenseGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type LicenseWhereInput = { + AND?: Prisma.LicenseWhereInput | Prisma.LicenseWhereInput[] + OR?: Prisma.LicenseWhereInput[] + NOT?: Prisma.LicenseWhereInput | Prisma.LicenseWhereInput[] + id?: Prisma.StringFilter<"License"> | string + starts_at?: Prisma.DateTimeFilter<"License"> | Date | string + expires_at?: Prisma.DateTimeFilter<"License"> | Date | string + status?: Prisma.EnumLicenseStatusFilter<"License"> | $Enums.LicenseStatus + pos_id?: Prisma.StringFilter<"License"> | string + partner_id?: Prisma.StringFilter<"License"> | string + pos?: Prisma.XOR + partner?: Prisma.XOR +} + +export type LicenseOrderByWithRelationInput = { + id?: Prisma.SortOrder + starts_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + status?: Prisma.SortOrder + pos_id?: Prisma.SortOrder + partner_id?: Prisma.SortOrder + pos?: Prisma.PosOrderByWithRelationInput + partner?: Prisma.PartnerOrderByWithRelationInput + _relevance?: Prisma.LicenseOrderByRelevanceInput +} + +export type LicenseWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.LicenseWhereInput | Prisma.LicenseWhereInput[] + OR?: Prisma.LicenseWhereInput[] + NOT?: Prisma.LicenseWhereInput | Prisma.LicenseWhereInput[] + starts_at?: Prisma.DateTimeFilter<"License"> | Date | string + expires_at?: Prisma.DateTimeFilter<"License"> | Date | string + status?: Prisma.EnumLicenseStatusFilter<"License"> | $Enums.LicenseStatus + pos_id?: Prisma.StringFilter<"License"> | string + partner_id?: Prisma.StringFilter<"License"> | string + pos?: Prisma.XOR + partner?: Prisma.XOR +}, "id"> + +export type LicenseOrderByWithAggregationInput = { + id?: Prisma.SortOrder + starts_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + status?: Prisma.SortOrder + pos_id?: Prisma.SortOrder + partner_id?: Prisma.SortOrder + _count?: Prisma.LicenseCountOrderByAggregateInput + _max?: Prisma.LicenseMaxOrderByAggregateInput + _min?: Prisma.LicenseMinOrderByAggregateInput +} + +export type LicenseScalarWhereWithAggregatesInput = { + AND?: Prisma.LicenseScalarWhereWithAggregatesInput | Prisma.LicenseScalarWhereWithAggregatesInput[] + OR?: Prisma.LicenseScalarWhereWithAggregatesInput[] + NOT?: Prisma.LicenseScalarWhereWithAggregatesInput | Prisma.LicenseScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"License"> | string + starts_at?: Prisma.DateTimeWithAggregatesFilter<"License"> | Date | string + expires_at?: Prisma.DateTimeWithAggregatesFilter<"License"> | Date | string + status?: Prisma.EnumLicenseStatusWithAggregatesFilter<"License"> | $Enums.LicenseStatus + pos_id?: Prisma.StringWithAggregatesFilter<"License"> | string + partner_id?: Prisma.StringWithAggregatesFilter<"License"> | string +} + +export type LicenseCreateInput = { + id?: string + starts_at: Date | string + expires_at: Date | string + status: $Enums.LicenseStatus + pos: Prisma.PosCreateNestedOneWithoutLicensesInput + partner: Prisma.PartnerCreateNestedOneWithoutLicensesInput +} + +export type LicenseUncheckedCreateInput = { + id?: string + starts_at: Date | string + expires_at: Date | string + status: $Enums.LicenseStatus + pos_id: string + partner_id: string +} + +export type LicenseUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus + pos?: Prisma.PosUpdateOneRequiredWithoutLicensesNestedInput + partner?: Prisma.PartnerUpdateOneRequiredWithoutLicensesNestedInput +} + +export type LicenseUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus + pos_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type LicenseCreateManyInput = { + id?: string + starts_at: Date | string + expires_at: Date | string + status: $Enums.LicenseStatus + pos_id: string + partner_id: string +} + +export type LicenseUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus +} + +export type LicenseUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus + pos_id?: Prisma.StringFieldUpdateOperationsInput | string + partner_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type LicenseListRelationFilter = { + every?: Prisma.LicenseWhereInput + some?: Prisma.LicenseWhereInput + none?: Prisma.LicenseWhereInput +} + +export type LicenseOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type LicenseOrderByRelevanceInput = { + fields: Prisma.LicenseOrderByRelevanceFieldEnum | Prisma.LicenseOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type LicenseCountOrderByAggregateInput = { + id?: Prisma.SortOrder + starts_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + status?: Prisma.SortOrder + pos_id?: Prisma.SortOrder + partner_id?: Prisma.SortOrder +} + +export type LicenseMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + starts_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + status?: Prisma.SortOrder + pos_id?: Prisma.SortOrder + partner_id?: Prisma.SortOrder +} + +export type LicenseMinOrderByAggregateInput = { + id?: Prisma.SortOrder + starts_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + status?: Prisma.SortOrder + pos_id?: Prisma.SortOrder + partner_id?: Prisma.SortOrder +} + +export type LicenseCreateNestedManyWithoutPosInput = { + create?: Prisma.XOR | Prisma.LicenseCreateWithoutPosInput[] | Prisma.LicenseUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPosInput | Prisma.LicenseCreateOrConnectWithoutPosInput[] + createMany?: Prisma.LicenseCreateManyPosInputEnvelope + connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] +} + +export type LicenseUncheckedCreateNestedManyWithoutPosInput = { + create?: Prisma.XOR | Prisma.LicenseCreateWithoutPosInput[] | Prisma.LicenseUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPosInput | Prisma.LicenseCreateOrConnectWithoutPosInput[] + createMany?: Prisma.LicenseCreateManyPosInputEnvelope + connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] +} + +export type LicenseUpdateManyWithoutPosNestedInput = { + create?: Prisma.XOR | Prisma.LicenseCreateWithoutPosInput[] | Prisma.LicenseUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPosInput | Prisma.LicenseCreateOrConnectWithoutPosInput[] + upsert?: Prisma.LicenseUpsertWithWhereUniqueWithoutPosInput | Prisma.LicenseUpsertWithWhereUniqueWithoutPosInput[] + createMany?: Prisma.LicenseCreateManyPosInputEnvelope + set?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + disconnect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + delete?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + update?: Prisma.LicenseUpdateWithWhereUniqueWithoutPosInput | Prisma.LicenseUpdateWithWhereUniqueWithoutPosInput[] + updateMany?: Prisma.LicenseUpdateManyWithWhereWithoutPosInput | Prisma.LicenseUpdateManyWithWhereWithoutPosInput[] + deleteMany?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[] +} + +export type LicenseUncheckedUpdateManyWithoutPosNestedInput = { + create?: Prisma.XOR | Prisma.LicenseCreateWithoutPosInput[] | Prisma.LicenseUncheckedCreateWithoutPosInput[] + connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPosInput | Prisma.LicenseCreateOrConnectWithoutPosInput[] + upsert?: Prisma.LicenseUpsertWithWhereUniqueWithoutPosInput | Prisma.LicenseUpsertWithWhereUniqueWithoutPosInput[] + createMany?: Prisma.LicenseCreateManyPosInputEnvelope + set?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + disconnect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + delete?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + update?: Prisma.LicenseUpdateWithWhereUniqueWithoutPosInput | Prisma.LicenseUpdateWithWhereUniqueWithoutPosInput[] + updateMany?: Prisma.LicenseUpdateManyWithWhereWithoutPosInput | Prisma.LicenseUpdateManyWithWhereWithoutPosInput[] + deleteMany?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[] +} + +export type EnumLicenseStatusFieldUpdateOperationsInput = { + set?: $Enums.LicenseStatus +} + +export type LicenseCreateNestedManyWithoutPartnerInput = { + create?: Prisma.XOR | Prisma.LicenseCreateWithoutPartnerInput[] | Prisma.LicenseUncheckedCreateWithoutPartnerInput[] + connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPartnerInput | Prisma.LicenseCreateOrConnectWithoutPartnerInput[] + createMany?: Prisma.LicenseCreateManyPartnerInputEnvelope + connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] +} + +export type LicenseUncheckedCreateNestedManyWithoutPartnerInput = { + create?: Prisma.XOR | Prisma.LicenseCreateWithoutPartnerInput[] | Prisma.LicenseUncheckedCreateWithoutPartnerInput[] + connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPartnerInput | Prisma.LicenseCreateOrConnectWithoutPartnerInput[] + createMany?: Prisma.LicenseCreateManyPartnerInputEnvelope + connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] +} + +export type LicenseUpdateManyWithoutPartnerNestedInput = { + create?: Prisma.XOR | Prisma.LicenseCreateWithoutPartnerInput[] | Prisma.LicenseUncheckedCreateWithoutPartnerInput[] + connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPartnerInput | Prisma.LicenseCreateOrConnectWithoutPartnerInput[] + upsert?: Prisma.LicenseUpsertWithWhereUniqueWithoutPartnerInput | Prisma.LicenseUpsertWithWhereUniqueWithoutPartnerInput[] + createMany?: Prisma.LicenseCreateManyPartnerInputEnvelope + set?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + disconnect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + delete?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + update?: Prisma.LicenseUpdateWithWhereUniqueWithoutPartnerInput | Prisma.LicenseUpdateWithWhereUniqueWithoutPartnerInput[] + updateMany?: Prisma.LicenseUpdateManyWithWhereWithoutPartnerInput | Prisma.LicenseUpdateManyWithWhereWithoutPartnerInput[] + deleteMany?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[] +} + +export type LicenseUncheckedUpdateManyWithoutPartnerNestedInput = { + create?: Prisma.XOR | Prisma.LicenseCreateWithoutPartnerInput[] | Prisma.LicenseUncheckedCreateWithoutPartnerInput[] + connectOrCreate?: Prisma.LicenseCreateOrConnectWithoutPartnerInput | Prisma.LicenseCreateOrConnectWithoutPartnerInput[] + upsert?: Prisma.LicenseUpsertWithWhereUniqueWithoutPartnerInput | Prisma.LicenseUpsertWithWhereUniqueWithoutPartnerInput[] + createMany?: Prisma.LicenseCreateManyPartnerInputEnvelope + set?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + disconnect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + delete?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + connect?: Prisma.LicenseWhereUniqueInput | Prisma.LicenseWhereUniqueInput[] + update?: Prisma.LicenseUpdateWithWhereUniqueWithoutPartnerInput | Prisma.LicenseUpdateWithWhereUniqueWithoutPartnerInput[] + updateMany?: Prisma.LicenseUpdateManyWithWhereWithoutPartnerInput | Prisma.LicenseUpdateManyWithWhereWithoutPartnerInput[] + deleteMany?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[] +} + +export type LicenseCreateWithoutPosInput = { + id?: string + starts_at: Date | string + expires_at: Date | string + status: $Enums.LicenseStatus + partner: Prisma.PartnerCreateNestedOneWithoutLicensesInput +} + +export type LicenseUncheckedCreateWithoutPosInput = { + id?: string + starts_at: Date | string + expires_at: Date | string + status: $Enums.LicenseStatus + partner_id: string +} + +export type LicenseCreateOrConnectWithoutPosInput = { + where: Prisma.LicenseWhereUniqueInput + create: Prisma.XOR +} + +export type LicenseCreateManyPosInputEnvelope = { + data: Prisma.LicenseCreateManyPosInput | Prisma.LicenseCreateManyPosInput[] + skipDuplicates?: boolean +} + +export type LicenseUpsertWithWhereUniqueWithoutPosInput = { + where: Prisma.LicenseWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type LicenseUpdateWithWhereUniqueWithoutPosInput = { + where: Prisma.LicenseWhereUniqueInput + data: Prisma.XOR +} + +export type LicenseUpdateManyWithWhereWithoutPosInput = { + where: Prisma.LicenseScalarWhereInput + data: Prisma.XOR +} + +export type LicenseScalarWhereInput = { + AND?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[] + OR?: Prisma.LicenseScalarWhereInput[] + NOT?: Prisma.LicenseScalarWhereInput | Prisma.LicenseScalarWhereInput[] + id?: Prisma.StringFilter<"License"> | string + starts_at?: Prisma.DateTimeFilter<"License"> | Date | string + expires_at?: Prisma.DateTimeFilter<"License"> | Date | string + status?: Prisma.EnumLicenseStatusFilter<"License"> | $Enums.LicenseStatus + pos_id?: Prisma.StringFilter<"License"> | string + partner_id?: Prisma.StringFilter<"License"> | string +} + +export type LicenseCreateWithoutPartnerInput = { + id?: string + starts_at: Date | string + expires_at: Date | string + status: $Enums.LicenseStatus + pos: Prisma.PosCreateNestedOneWithoutLicensesInput +} + +export type LicenseUncheckedCreateWithoutPartnerInput = { + id?: string + starts_at: Date | string + expires_at: Date | string + status: $Enums.LicenseStatus + pos_id: string +} + +export type LicenseCreateOrConnectWithoutPartnerInput = { + where: Prisma.LicenseWhereUniqueInput + create: Prisma.XOR +} + +export type LicenseCreateManyPartnerInputEnvelope = { + data: Prisma.LicenseCreateManyPartnerInput | Prisma.LicenseCreateManyPartnerInput[] + skipDuplicates?: boolean +} + +export type LicenseUpsertWithWhereUniqueWithoutPartnerInput = { + where: Prisma.LicenseWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type LicenseUpdateWithWhereUniqueWithoutPartnerInput = { + where: Prisma.LicenseWhereUniqueInput + data: Prisma.XOR +} + +export type LicenseUpdateManyWithWhereWithoutPartnerInput = { + where: Prisma.LicenseScalarWhereInput + data: Prisma.XOR +} + +export type LicenseCreateManyPosInput = { + id?: string + starts_at: Date | string + expires_at: Date | string + status: $Enums.LicenseStatus + partner_id: string +} + +export type LicenseUpdateWithoutPosInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus + partner?: Prisma.PartnerUpdateOneRequiredWithoutLicensesNestedInput +} + +export type LicenseUncheckedUpdateWithoutPosInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus + partner_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type LicenseUncheckedUpdateManyWithoutPosInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus + partner_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type LicenseCreateManyPartnerInput = { + id?: string + starts_at: Date | string + expires_at: Date | string + status: $Enums.LicenseStatus + pos_id: string +} + +export type LicenseUpdateWithoutPartnerInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus + pos?: Prisma.PosUpdateOneRequiredWithoutLicensesNestedInput +} + +export type LicenseUncheckedUpdateWithoutPartnerInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus + pos_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type LicenseUncheckedUpdateManyWithoutPartnerInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + starts_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumLicenseStatusFieldUpdateOperationsInput | $Enums.LicenseStatus + pos_id?: Prisma.StringFieldUpdateOperationsInput | string +} + + + +export type LicenseSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + starts_at?: boolean + expires_at?: boolean + status?: boolean + pos_id?: boolean + partner_id?: boolean + pos?: boolean | Prisma.PosDefaultArgs + partner?: boolean | Prisma.PartnerDefaultArgs +}, ExtArgs["result"]["license"]> + + + +export type LicenseSelectScalar = { + id?: boolean + starts_at?: boolean + expires_at?: boolean + status?: boolean + pos_id?: boolean + partner_id?: boolean +} + +export type LicenseOmit = runtime.Types.Extensions.GetOmit<"id" | "starts_at" | "expires_at" | "status" | "pos_id" | "partner_id", ExtArgs["result"]["license"]> +export type LicenseInclude = { + pos?: boolean | Prisma.PosDefaultArgs + partner?: boolean | Prisma.PartnerDefaultArgs +} + +export type $LicensePayload = { + name: "License" + objects: { + pos: Prisma.$PosPayload + partner: Prisma.$PartnerPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + starts_at: Date + expires_at: Date + status: $Enums.LicenseStatus + pos_id: string + partner_id: string + }, ExtArgs["result"]["license"]> + composites: {} +} + +export type LicenseGetPayload = runtime.Types.Result.GetResult + +export type LicenseCountArgs = + Omit & { + select?: LicenseCountAggregateInputType | true + } + +export interface LicenseDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['License'], meta: { name: 'License' } } + /** + * Find zero or one License that matches the filter. + * @param {LicenseFindUniqueArgs} args - Arguments to find a License + * @example + * // Get one License + * const license = await prisma.license.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__LicenseClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one License that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {LicenseFindUniqueOrThrowArgs} args - Arguments to find a License + * @example + * // Get one License + * const license = await prisma.license.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__LicenseClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first License that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LicenseFindFirstArgs} args - Arguments to find a License + * @example + * // Get one License + * const license = await prisma.license.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__LicenseClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first License that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LicenseFindFirstOrThrowArgs} args - Arguments to find a License + * @example + * // Get one License + * const license = await prisma.license.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__LicenseClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Licenses that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LicenseFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Licenses + * const licenses = await prisma.license.findMany() + * + * // Get first 10 Licenses + * const licenses = await prisma.license.findMany({ take: 10 }) + * + * // Only select the `id` + * const licenseWithIdOnly = await prisma.license.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a License. + * @param {LicenseCreateArgs} args - Arguments to create a License. + * @example + * // Create one License + * const License = await prisma.license.create({ + * data: { + * // ... data to create a License + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__LicenseClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Licenses. + * @param {LicenseCreateManyArgs} args - Arguments to create many Licenses. + * @example + * // Create many Licenses + * const license = await prisma.license.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a License. + * @param {LicenseDeleteArgs} args - Arguments to delete one License. + * @example + * // Delete one License + * const License = await prisma.license.delete({ + * where: { + * // ... filter to delete one License + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__LicenseClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one License. + * @param {LicenseUpdateArgs} args - Arguments to update one License. + * @example + * // Update one License + * const license = await prisma.license.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__LicenseClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Licenses. + * @param {LicenseDeleteManyArgs} args - Arguments to filter Licenses to delete. + * @example + * // Delete a few Licenses + * const { count } = await prisma.license.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Licenses. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LicenseUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Licenses + * const license = await prisma.license.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one License. + * @param {LicenseUpsertArgs} args - Arguments to update or create a License. + * @example + * // Update or create a License + * const license = await prisma.license.upsert({ + * create: { + * // ... data to create a License + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the License we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__LicenseClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Licenses. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LicenseCountArgs} args - Arguments to filter Licenses to count. + * @example + * // Count the number of Licenses + * const count = await prisma.license.count({ + * where: { + * // ... the filter for the Licenses we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a License. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LicenseAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by License. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {LicenseGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends LicenseGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: LicenseGroupByArgs['orderBy'] } + : { orderBy?: LicenseGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetLicenseGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the License model + */ +readonly fields: LicenseFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for License. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__LicenseClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + pos = {}>(args?: Prisma.Subset>): Prisma.Prisma__PosClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + partner = {}>(args?: Prisma.Subset>): Prisma.Prisma__PartnerClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the License model + */ +export interface LicenseFieldRefs { + readonly id: Prisma.FieldRef<"License", 'String'> + readonly starts_at: Prisma.FieldRef<"License", 'DateTime'> + readonly expires_at: Prisma.FieldRef<"License", 'DateTime'> + readonly status: Prisma.FieldRef<"License", 'LicenseStatus'> + readonly pos_id: Prisma.FieldRef<"License", 'String'> + readonly partner_id: Prisma.FieldRef<"License", 'String'> +} + + +// Custom InputTypes +/** + * License findUnique + */ +export type LicenseFindUniqueArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + /** + * Filter, which License to fetch. + */ + where: Prisma.LicenseWhereUniqueInput +} + +/** + * License findUniqueOrThrow + */ +export type LicenseFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + /** + * Filter, which License to fetch. + */ + where: Prisma.LicenseWhereUniqueInput +} + +/** + * License findFirst + */ +export type LicenseFindFirstArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + /** + * Filter, which License to fetch. + */ + where?: Prisma.LicenseWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Licenses to fetch. + */ + orderBy?: Prisma.LicenseOrderByWithRelationInput | Prisma.LicenseOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Licenses. + */ + cursor?: Prisma.LicenseWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Licenses from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Licenses. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Licenses. + */ + distinct?: Prisma.LicenseScalarFieldEnum | Prisma.LicenseScalarFieldEnum[] +} + +/** + * License findFirstOrThrow + */ +export type LicenseFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + /** + * Filter, which License to fetch. + */ + where?: Prisma.LicenseWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Licenses to fetch. + */ + orderBy?: Prisma.LicenseOrderByWithRelationInput | Prisma.LicenseOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Licenses. + */ + cursor?: Prisma.LicenseWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Licenses from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Licenses. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Licenses. + */ + distinct?: Prisma.LicenseScalarFieldEnum | Prisma.LicenseScalarFieldEnum[] +} + +/** + * License findMany + */ +export type LicenseFindManyArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + /** + * Filter, which Licenses to fetch. + */ + where?: Prisma.LicenseWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Licenses to fetch. + */ + orderBy?: Prisma.LicenseOrderByWithRelationInput | Prisma.LicenseOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Licenses. + */ + cursor?: Prisma.LicenseWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Licenses from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Licenses. + */ + skip?: number + distinct?: Prisma.LicenseScalarFieldEnum | Prisma.LicenseScalarFieldEnum[] +} + +/** + * License create + */ +export type LicenseCreateArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + /** + * The data needed to create a License. + */ + data: Prisma.XOR +} + +/** + * License createMany + */ +export type LicenseCreateManyArgs = { + /** + * The data used to create many Licenses. + */ + data: Prisma.LicenseCreateManyInput | Prisma.LicenseCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * License update + */ +export type LicenseUpdateArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + /** + * The data needed to update a License. + */ + data: Prisma.XOR + /** + * Choose, which License to update. + */ + where: Prisma.LicenseWhereUniqueInput +} + +/** + * License updateMany + */ +export type LicenseUpdateManyArgs = { + /** + * The data used to update Licenses. + */ + data: Prisma.XOR + /** + * Filter which Licenses to update + */ + where?: Prisma.LicenseWhereInput + /** + * Limit how many Licenses to update. + */ + limit?: number +} + +/** + * License upsert + */ +export type LicenseUpsertArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + /** + * The filter to search for the License to update in case it exists. + */ + where: Prisma.LicenseWhereUniqueInput + /** + * In case the License found by the `where` argument doesn't exist, create a new License with this data. + */ + create: Prisma.XOR + /** + * In case the License was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * License delete + */ +export type LicenseDeleteArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + /** + * Filter which License to delete. + */ + where: Prisma.LicenseWhereUniqueInput +} + +/** + * License deleteMany + */ +export type LicenseDeleteManyArgs = { + /** + * Filter which Licenses to delete + */ + where?: Prisma.LicenseWhereInput + /** + * Limit how many Licenses to delete. + */ + limit?: number +} + +/** + * License without action + */ +export type LicenseDefaultArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null +} diff --git a/src/generated/prisma/models/Partner.ts b/src/generated/prisma/models/Partner.ts new file mode 100644 index 0000000..77602f5 --- /dev/null +++ b/src/generated/prisma/models/Partner.ts @@ -0,0 +1,1267 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Partner` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Partner + * + */ +export type PartnerModel = runtime.Types.Result.DefaultSelection + +export type AggregatePartner = { + _count: PartnerCountAggregateOutputType | null + _min: PartnerMinAggregateOutputType | null + _max: PartnerMaxAggregateOutputType | null +} + +export type PartnerMinAggregateOutputType = { + id: string | null + name: string | null + code: string | null +} + +export type PartnerMaxAggregateOutputType = { + id: string | null + name: string | null + code: string | null +} + +export type PartnerCountAggregateOutputType = { + id: number + name: number + code: number + _all: number +} + + +export type PartnerMinAggregateInputType = { + id?: true + name?: true + code?: true +} + +export type PartnerMaxAggregateInputType = { + id?: true + name?: true + code?: true +} + +export type PartnerCountAggregateInputType = { + id?: true + name?: true + code?: true + _all?: true +} + +export type PartnerAggregateArgs = { + /** + * Filter which Partner to aggregate. + */ + where?: Prisma.PartnerWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Partners to fetch. + */ + orderBy?: Prisma.PartnerOrderByWithRelationInput | Prisma.PartnerOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.PartnerWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Partners from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Partners. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Partners + **/ + _count?: true | PartnerCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PartnerMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PartnerMaxAggregateInputType +} + +export type GetPartnerAggregateType = { + [P in keyof T & keyof AggregatePartner]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type PartnerGroupByArgs = { + where?: Prisma.PartnerWhereInput + orderBy?: Prisma.PartnerOrderByWithAggregationInput | Prisma.PartnerOrderByWithAggregationInput[] + by: Prisma.PartnerScalarFieldEnum[] | Prisma.PartnerScalarFieldEnum + having?: Prisma.PartnerScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PartnerCountAggregateInputType | true + _min?: PartnerMinAggregateInputType + _max?: PartnerMaxAggregateInputType +} + +export type PartnerGroupByOutputType = { + id: string + name: string + code: string | null + _count: PartnerCountAggregateOutputType | null + _min: PartnerMinAggregateOutputType | null + _max: PartnerMaxAggregateOutputType | null +} + +type GetPartnerGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof PartnerGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type PartnerWhereInput = { + AND?: Prisma.PartnerWhereInput | Prisma.PartnerWhereInput[] + OR?: Prisma.PartnerWhereInput[] + NOT?: Prisma.PartnerWhereInput | Prisma.PartnerWhereInput[] + id?: Prisma.StringFilter<"Partner"> | string + name?: Prisma.StringFilter<"Partner"> | string + code?: Prisma.StringNullableFilter<"Partner"> | string | null + licenses?: Prisma.LicenseListRelationFilter + account?: Prisma.AccountListRelationFilter +} + +export type PartnerOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrderInput | Prisma.SortOrder + licenses?: Prisma.LicenseOrderByRelationAggregateInput + account?: Prisma.AccountOrderByRelationAggregateInput + _relevance?: Prisma.PartnerOrderByRelevanceInput +} + +export type PartnerWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.PartnerWhereInput | Prisma.PartnerWhereInput[] + OR?: Prisma.PartnerWhereInput[] + NOT?: Prisma.PartnerWhereInput | Prisma.PartnerWhereInput[] + name?: Prisma.StringFilter<"Partner"> | string + code?: Prisma.StringNullableFilter<"Partner"> | string | null + licenses?: Prisma.LicenseListRelationFilter + account?: Prisma.AccountListRelationFilter +}, "id"> + +export type PartnerOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.PartnerCountOrderByAggregateInput + _max?: Prisma.PartnerMaxOrderByAggregateInput + _min?: Prisma.PartnerMinOrderByAggregateInput +} + +export type PartnerScalarWhereWithAggregatesInput = { + AND?: Prisma.PartnerScalarWhereWithAggregatesInput | Prisma.PartnerScalarWhereWithAggregatesInput[] + OR?: Prisma.PartnerScalarWhereWithAggregatesInput[] + NOT?: Prisma.PartnerScalarWhereWithAggregatesInput | Prisma.PartnerScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Partner"> | string + name?: Prisma.StringWithAggregatesFilter<"Partner"> | string + code?: Prisma.StringNullableWithAggregatesFilter<"Partner"> | string | null +} + +export type PartnerCreateInput = { + id?: string + name: string + code?: string | null + licenses?: Prisma.LicenseCreateNestedManyWithoutPartnerInput + account?: Prisma.AccountCreateNestedManyWithoutPartnerInput +} + +export type PartnerUncheckedCreateInput = { + id?: string + name: string + code?: string | null + licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPartnerInput + account?: Prisma.AccountUncheckedCreateNestedManyWithoutPartnerInput +} + +export type PartnerUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + licenses?: Prisma.LicenseUpdateManyWithoutPartnerNestedInput + account?: Prisma.AccountUpdateManyWithoutPartnerNestedInput +} + +export type PartnerUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPartnerNestedInput + account?: Prisma.AccountUncheckedUpdateManyWithoutPartnerNestedInput +} + +export type PartnerCreateManyInput = { + id?: string + name: string + code?: string | null +} + +export type PartnerUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type PartnerUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type PartnerScalarRelationFilter = { + is?: Prisma.PartnerWhereInput + isNot?: Prisma.PartnerWhereInput +} + +export type PartnerOrderByRelevanceInput = { + fields: Prisma.PartnerOrderByRelevanceFieldEnum | Prisma.PartnerOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type PartnerCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrder +} + +export type PartnerMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrder +} + +export type PartnerMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrder +} + +export type PartnerNullableScalarRelationFilter = { + is?: Prisma.PartnerWhereInput | null + isNot?: Prisma.PartnerWhereInput | null +} + +export type PartnerCreateNestedOneWithoutLicensesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PartnerCreateOrConnectWithoutLicensesInput + connect?: Prisma.PartnerWhereUniqueInput +} + +export type PartnerUpdateOneRequiredWithoutLicensesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PartnerCreateOrConnectWithoutLicensesInput + upsert?: Prisma.PartnerUpsertWithoutLicensesInput + connect?: Prisma.PartnerWhereUniqueInput + update?: Prisma.XOR, Prisma.PartnerUncheckedUpdateWithoutLicensesInput> +} + +export type PartnerCreateNestedOneWithoutAccountInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PartnerCreateOrConnectWithoutAccountInput + connect?: Prisma.PartnerWhereUniqueInput +} + +export type PartnerUpdateOneWithoutAccountNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PartnerCreateOrConnectWithoutAccountInput + upsert?: Prisma.PartnerUpsertWithoutAccountInput + disconnect?: Prisma.PartnerWhereInput | boolean + delete?: Prisma.PartnerWhereInput | boolean + connect?: Prisma.PartnerWhereUniqueInput + update?: Prisma.XOR, Prisma.PartnerUncheckedUpdateWithoutAccountInput> +} + +export type PartnerCreateWithoutLicensesInput = { + id?: string + name: string + code?: string | null + account?: Prisma.AccountCreateNestedManyWithoutPartnerInput +} + +export type PartnerUncheckedCreateWithoutLicensesInput = { + id?: string + name: string + code?: string | null + account?: Prisma.AccountUncheckedCreateNestedManyWithoutPartnerInput +} + +export type PartnerCreateOrConnectWithoutLicensesInput = { + where: Prisma.PartnerWhereUniqueInput + create: Prisma.XOR +} + +export type PartnerUpsertWithoutLicensesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.PartnerWhereInput +} + +export type PartnerUpdateToOneWithWhereWithoutLicensesInput = { + where?: Prisma.PartnerWhereInput + data: Prisma.XOR +} + +export type PartnerUpdateWithoutLicensesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account?: Prisma.AccountUpdateManyWithoutPartnerNestedInput +} + +export type PartnerUncheckedUpdateWithoutLicensesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + account?: Prisma.AccountUncheckedUpdateManyWithoutPartnerNestedInput +} + +export type PartnerCreateWithoutAccountInput = { + id?: string + name: string + code?: string | null + licenses?: Prisma.LicenseCreateNestedManyWithoutPartnerInput +} + +export type PartnerUncheckedCreateWithoutAccountInput = { + id?: string + name: string + code?: string | null + licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPartnerInput +} + +export type PartnerCreateOrConnectWithoutAccountInput = { + where: Prisma.PartnerWhereUniqueInput + create: Prisma.XOR +} + +export type PartnerUpsertWithoutAccountInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.PartnerWhereInput +} + +export type PartnerUpdateToOneWithWhereWithoutAccountInput = { + where?: Prisma.PartnerWhereInput + data: Prisma.XOR +} + +export type PartnerUpdateWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + licenses?: Prisma.LicenseUpdateManyWithoutPartnerNestedInput +} + +export type PartnerUncheckedUpdateWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPartnerNestedInput +} + + +/** + * Count Type PartnerCountOutputType + */ + +export type PartnerCountOutputType = { + licenses: number + account: number +} + +export type PartnerCountOutputTypeSelect = { + licenses?: boolean | PartnerCountOutputTypeCountLicensesArgs + account?: boolean | PartnerCountOutputTypeCountAccountArgs +} + +/** + * PartnerCountOutputType without action + */ +export type PartnerCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the PartnerCountOutputType + */ + select?: Prisma.PartnerCountOutputTypeSelect | null +} + +/** + * PartnerCountOutputType without action + */ +export type PartnerCountOutputTypeCountLicensesArgs = { + where?: Prisma.LicenseWhereInput +} + +/** + * PartnerCountOutputType without action + */ +export type PartnerCountOutputTypeCountAccountArgs = { + where?: Prisma.AccountWhereInput +} + + +export type PartnerSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + code?: boolean + licenses?: boolean | Prisma.Partner$licensesArgs + account?: boolean | Prisma.Partner$accountArgs + _count?: boolean | Prisma.PartnerCountOutputTypeDefaultArgs +}, ExtArgs["result"]["partner"]> + + + +export type PartnerSelectScalar = { + id?: boolean + name?: boolean + code?: boolean +} + +export type PartnerOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "code", ExtArgs["result"]["partner"]> +export type PartnerInclude = { + licenses?: boolean | Prisma.Partner$licensesArgs + account?: boolean | Prisma.Partner$accountArgs + _count?: boolean | Prisma.PartnerCountOutputTypeDefaultArgs +} + +export type $PartnerPayload = { + name: "Partner" + objects: { + licenses: Prisma.$LicensePayload[] + account: Prisma.$AccountPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + code: string | null + }, ExtArgs["result"]["partner"]> + composites: {} +} + +export type PartnerGetPayload = runtime.Types.Result.GetResult + +export type PartnerCountArgs = + Omit & { + select?: PartnerCountAggregateInputType | true + } + +export interface PartnerDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Partner'], meta: { name: 'Partner' } } + /** + * Find zero or one Partner that matches the filter. + * @param {PartnerFindUniqueArgs} args - Arguments to find a Partner + * @example + * // Get one Partner + * const partner = await prisma.partner.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__PartnerClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Partner that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PartnerFindUniqueOrThrowArgs} args - Arguments to find a Partner + * @example + * // Get one Partner + * const partner = await prisma.partner.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__PartnerClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Partner that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PartnerFindFirstArgs} args - Arguments to find a Partner + * @example + * // Get one Partner + * const partner = await prisma.partner.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__PartnerClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Partner that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PartnerFindFirstOrThrowArgs} args - Arguments to find a Partner + * @example + * // Get one Partner + * const partner = await prisma.partner.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__PartnerClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Partners that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PartnerFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Partners + * const partners = await prisma.partner.findMany() + * + * // Get first 10 Partners + * const partners = await prisma.partner.findMany({ take: 10 }) + * + * // Only select the `id` + * const partnerWithIdOnly = await prisma.partner.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Partner. + * @param {PartnerCreateArgs} args - Arguments to create a Partner. + * @example + * // Create one Partner + * const Partner = await prisma.partner.create({ + * data: { + * // ... data to create a Partner + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__PartnerClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Partners. + * @param {PartnerCreateManyArgs} args - Arguments to create many Partners. + * @example + * // Create many Partners + * const partner = await prisma.partner.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a Partner. + * @param {PartnerDeleteArgs} args - Arguments to delete one Partner. + * @example + * // Delete one Partner + * const Partner = await prisma.partner.delete({ + * where: { + * // ... filter to delete one Partner + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__PartnerClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Partner. + * @param {PartnerUpdateArgs} args - Arguments to update one Partner. + * @example + * // Update one Partner + * const partner = await prisma.partner.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__PartnerClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Partners. + * @param {PartnerDeleteManyArgs} args - Arguments to filter Partners to delete. + * @example + * // Delete a few Partners + * const { count } = await prisma.partner.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Partners. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PartnerUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Partners + * const partner = await prisma.partner.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Partner. + * @param {PartnerUpsertArgs} args - Arguments to update or create a Partner. + * @example + * // Update or create a Partner + * const partner = await prisma.partner.upsert({ + * create: { + * // ... data to create a Partner + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Partner we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__PartnerClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Partners. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PartnerCountArgs} args - Arguments to filter Partners to count. + * @example + * // Count the number of Partners + * const count = await prisma.partner.count({ + * where: { + * // ... the filter for the Partners we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Partner. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PartnerAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Partner. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PartnerGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends PartnerGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: PartnerGroupByArgs['orderBy'] } + : { orderBy?: PartnerGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetPartnerGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Partner model + */ +readonly fields: PartnerFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Partner. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__PartnerClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + licenses = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + account = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Partner model + */ +export interface PartnerFieldRefs { + readonly id: Prisma.FieldRef<"Partner", 'String'> + readonly name: Prisma.FieldRef<"Partner", 'String'> + readonly code: Prisma.FieldRef<"Partner", 'String'> +} + + +// Custom InputTypes +/** + * Partner findUnique + */ +export type PartnerFindUniqueArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null + /** + * Filter, which Partner to fetch. + */ + where: Prisma.PartnerWhereUniqueInput +} + +/** + * Partner findUniqueOrThrow + */ +export type PartnerFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null + /** + * Filter, which Partner to fetch. + */ + where: Prisma.PartnerWhereUniqueInput +} + +/** + * Partner findFirst + */ +export type PartnerFindFirstArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null + /** + * Filter, which Partner to fetch. + */ + where?: Prisma.PartnerWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Partners to fetch. + */ + orderBy?: Prisma.PartnerOrderByWithRelationInput | Prisma.PartnerOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Partners. + */ + cursor?: Prisma.PartnerWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Partners from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Partners. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Partners. + */ + distinct?: Prisma.PartnerScalarFieldEnum | Prisma.PartnerScalarFieldEnum[] +} + +/** + * Partner findFirstOrThrow + */ +export type PartnerFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null + /** + * Filter, which Partner to fetch. + */ + where?: Prisma.PartnerWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Partners to fetch. + */ + orderBy?: Prisma.PartnerOrderByWithRelationInput | Prisma.PartnerOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Partners. + */ + cursor?: Prisma.PartnerWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Partners from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Partners. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Partners. + */ + distinct?: Prisma.PartnerScalarFieldEnum | Prisma.PartnerScalarFieldEnum[] +} + +/** + * Partner findMany + */ +export type PartnerFindManyArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null + /** + * Filter, which Partners to fetch. + */ + where?: Prisma.PartnerWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Partners to fetch. + */ + orderBy?: Prisma.PartnerOrderByWithRelationInput | Prisma.PartnerOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Partners. + */ + cursor?: Prisma.PartnerWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Partners from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Partners. + */ + skip?: number + distinct?: Prisma.PartnerScalarFieldEnum | Prisma.PartnerScalarFieldEnum[] +} + +/** + * Partner create + */ +export type PartnerCreateArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null + /** + * The data needed to create a Partner. + */ + data: Prisma.XOR +} + +/** + * Partner createMany + */ +export type PartnerCreateManyArgs = { + /** + * The data used to create many Partners. + */ + data: Prisma.PartnerCreateManyInput | Prisma.PartnerCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Partner update + */ +export type PartnerUpdateArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null + /** + * The data needed to update a Partner. + */ + data: Prisma.XOR + /** + * Choose, which Partner to update. + */ + where: Prisma.PartnerWhereUniqueInput +} + +/** + * Partner updateMany + */ +export type PartnerUpdateManyArgs = { + /** + * The data used to update Partners. + */ + data: Prisma.XOR + /** + * Filter which Partners to update + */ + where?: Prisma.PartnerWhereInput + /** + * Limit how many Partners to update. + */ + limit?: number +} + +/** + * Partner upsert + */ +export type PartnerUpsertArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null + /** + * The filter to search for the Partner to update in case it exists. + */ + where: Prisma.PartnerWhereUniqueInput + /** + * In case the Partner found by the `where` argument doesn't exist, create a new Partner with this data. + */ + create: Prisma.XOR + /** + * In case the Partner was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Partner delete + */ +export type PartnerDeleteArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null + /** + * Filter which Partner to delete. + */ + where: Prisma.PartnerWhereUniqueInput +} + +/** + * Partner deleteMany + */ +export type PartnerDeleteManyArgs = { + /** + * Filter which Partners to delete + */ + where?: Prisma.PartnerWhereInput + /** + * Limit how many Partners to delete. + */ + limit?: number +} + +/** + * Partner.licenses + */ +export type Partner$licensesArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + where?: Prisma.LicenseWhereInput + orderBy?: Prisma.LicenseOrderByWithRelationInput | Prisma.LicenseOrderByWithRelationInput[] + cursor?: Prisma.LicenseWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.LicenseScalarFieldEnum | Prisma.LicenseScalarFieldEnum[] +} + +/** + * Partner.account + */ +export type Partner$accountArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + where?: Prisma.AccountWhereInput + orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] + cursor?: Prisma.AccountWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] +} + +/** + * Partner without action + */ +export type PartnerDefaultArgs = { + /** + * Select specific fields to fetch from the Partner + */ + select?: Prisma.PartnerSelect | null + /** + * Omit specific fields from the Partner + */ + omit?: Prisma.PartnerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PartnerInclude | null +} diff --git a/src/generated/prisma/models/Pos.ts b/src/generated/prisma/models/Pos.ts new file mode 100644 index 0000000..c9c9428 --- /dev/null +++ b/src/generated/prisma/models/Pos.ts @@ -0,0 +1,2020 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Pos` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Pos + * + */ +export type PosModel = runtime.Types.Result.DefaultSelection + +export type AggregatePos = { + _count: PosCountAggregateOutputType | null + _min: PosMinAggregateOutputType | null + _max: PosMaxAggregateOutputType | null +} + +export type PosMinAggregateOutputType = { + id: string | null + serial: string | null + model: string | null + status: $Enums.POSStatus | null + pos_type: $Enums.POSType | null + created_at: Date | null + updated_at: Date | null + complex_id: string | null + device_id: string | null + provider_id: string | null +} + +export type PosMaxAggregateOutputType = { + id: string | null + serial: string | null + model: string | null + status: $Enums.POSStatus | null + pos_type: $Enums.POSType | null + created_at: Date | null + updated_at: Date | null + complex_id: string | null + device_id: string | null + provider_id: string | null +} + +export type PosCountAggregateOutputType = { + id: number + serial: number + model: number + status: number + pos_type: number + created_at: number + updated_at: number + complex_id: number + device_id: number + provider_id: number + _all: number +} + + +export type PosMinAggregateInputType = { + id?: true + serial?: true + model?: true + status?: true + pos_type?: true + created_at?: true + updated_at?: true + complex_id?: true + device_id?: true + provider_id?: true +} + +export type PosMaxAggregateInputType = { + id?: true + serial?: true + model?: true + status?: true + pos_type?: true + created_at?: true + updated_at?: true + complex_id?: true + device_id?: true + provider_id?: true +} + +export type PosCountAggregateInputType = { + id?: true + serial?: true + model?: true + status?: true + pos_type?: true + created_at?: true + updated_at?: true + complex_id?: true + device_id?: true + provider_id?: true + _all?: true +} + +export type PosAggregateArgs = { + /** + * Filter which Pos to aggregate. + */ + where?: Prisma.PosWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Pos to fetch. + */ + orderBy?: Prisma.PosOrderByWithRelationInput | Prisma.PosOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.PosWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Pos from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Pos. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Pos + **/ + _count?: true | PosCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PosMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PosMaxAggregateInputType +} + +export type GetPosAggregateType = { + [P in keyof T & keyof AggregatePos]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type PosGroupByArgs = { + where?: Prisma.PosWhereInput + orderBy?: Prisma.PosOrderByWithAggregationInput | Prisma.PosOrderByWithAggregationInput[] + by: Prisma.PosScalarFieldEnum[] | Prisma.PosScalarFieldEnum + having?: Prisma.PosScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PosCountAggregateInputType | true + _min?: PosMinAggregateInputType + _max?: PosMaxAggregateInputType +} + +export type PosGroupByOutputType = { + id: string + serial: string + model: string | null + status: $Enums.POSStatus + pos_type: $Enums.POSType + created_at: Date + updated_at: Date + complex_id: string + device_id: string + provider_id: string | null + _count: PosCountAggregateOutputType | null + _min: PosMinAggregateOutputType | null + _max: PosMaxAggregateOutputType | null +} + +type GetPosGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof PosGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type PosWhereInput = { + AND?: Prisma.PosWhereInput | Prisma.PosWhereInput[] + OR?: Prisma.PosWhereInput[] + NOT?: Prisma.PosWhereInput | Prisma.PosWhereInput[] + id?: Prisma.StringFilter<"Pos"> | string + serial?: Prisma.StringFilter<"Pos"> | string + model?: Prisma.StringNullableFilter<"Pos"> | string | null + status?: Prisma.EnumPOSStatusFilter<"Pos"> | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFilter<"Pos"> | $Enums.POSType + created_at?: Prisma.DateTimeFilter<"Pos"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Pos"> | Date | string + complex_id?: Prisma.StringFilter<"Pos"> | string + device_id?: Prisma.StringFilter<"Pos"> | string + provider_id?: Prisma.StringNullableFilter<"Pos"> | string | null + complex?: Prisma.XOR + device?: Prisma.XOR + provider?: Prisma.XOR | null + licenses?: Prisma.LicenseListRelationFilter + accounts?: Prisma.AccountListRelationFilter +} + +export type PosOrderByWithRelationInput = { + id?: Prisma.SortOrder + serial?: Prisma.SortOrder + model?: Prisma.SortOrderInput | Prisma.SortOrder + status?: Prisma.SortOrder + pos_type?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + device_id?: Prisma.SortOrder + provider_id?: Prisma.SortOrderInput | Prisma.SortOrder + complex?: Prisma.ComplexOrderByWithRelationInput + device?: Prisma.DeviceOrderByWithRelationInput + provider?: Prisma.ProviderOrderByWithRelationInput + licenses?: Prisma.LicenseOrderByRelationAggregateInput + accounts?: Prisma.AccountOrderByRelationAggregateInput + _relevance?: Prisma.PosOrderByRelevanceInput +} + +export type PosWhereUniqueInput = Prisma.AtLeast<{ + id?: string + serial?: string + AND?: Prisma.PosWhereInput | Prisma.PosWhereInput[] + OR?: Prisma.PosWhereInput[] + NOT?: Prisma.PosWhereInput | Prisma.PosWhereInput[] + model?: Prisma.StringNullableFilter<"Pos"> | string | null + status?: Prisma.EnumPOSStatusFilter<"Pos"> | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFilter<"Pos"> | $Enums.POSType + created_at?: Prisma.DateTimeFilter<"Pos"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Pos"> | Date | string + complex_id?: Prisma.StringFilter<"Pos"> | string + device_id?: Prisma.StringFilter<"Pos"> | string + provider_id?: Prisma.StringNullableFilter<"Pos"> | string | null + complex?: Prisma.XOR + device?: Prisma.XOR + provider?: Prisma.XOR | null + licenses?: Prisma.LicenseListRelationFilter + accounts?: Prisma.AccountListRelationFilter +}, "id" | "serial"> + +export type PosOrderByWithAggregationInput = { + id?: Prisma.SortOrder + serial?: Prisma.SortOrder + model?: Prisma.SortOrderInput | Prisma.SortOrder + status?: Prisma.SortOrder + pos_type?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + device_id?: Prisma.SortOrder + provider_id?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.PosCountOrderByAggregateInput + _max?: Prisma.PosMaxOrderByAggregateInput + _min?: Prisma.PosMinOrderByAggregateInput +} + +export type PosScalarWhereWithAggregatesInput = { + AND?: Prisma.PosScalarWhereWithAggregatesInput | Prisma.PosScalarWhereWithAggregatesInput[] + OR?: Prisma.PosScalarWhereWithAggregatesInput[] + NOT?: Prisma.PosScalarWhereWithAggregatesInput | Prisma.PosScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Pos"> | string + serial?: Prisma.StringWithAggregatesFilter<"Pos"> | string + model?: Prisma.StringNullableWithAggregatesFilter<"Pos"> | string | null + status?: Prisma.EnumPOSStatusWithAggregatesFilter<"Pos"> | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeWithAggregatesFilter<"Pos"> | $Enums.POSType + created_at?: Prisma.DateTimeWithAggregatesFilter<"Pos"> | Date | string + updated_at?: Prisma.DateTimeWithAggregatesFilter<"Pos"> | Date | string + complex_id?: Prisma.StringWithAggregatesFilter<"Pos"> | string + device_id?: Prisma.StringWithAggregatesFilter<"Pos"> | string + provider_id?: Prisma.StringNullableWithAggregatesFilter<"Pos"> | string | null +} + +export type PosCreateInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput + device: Prisma.DeviceCreateNestedOneWithoutPosesInput + provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput + licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput + accounts?: Prisma.AccountCreateNestedManyWithoutPosInput +} + +export type PosUncheckedCreateInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex_id: string + device_id: string + provider_id?: string | null + licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutPosInput +} + +export type PosUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput + device?: Prisma.DeviceUpdateOneRequiredWithoutPosesNestedInput + provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput + licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput + accounts?: Prisma.AccountUpdateManyWithoutPosNestedInput +} + +export type PosUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + device_id?: Prisma.StringFieldUpdateOperationsInput | string + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput + accounts?: Prisma.AccountUncheckedUpdateManyWithoutPosNestedInput +} + +export type PosCreateManyInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex_id: string + device_id: string + provider_id?: string | null +} + +export type PosUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type PosUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + device_id?: Prisma.StringFieldUpdateOperationsInput | string + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type PosListRelationFilter = { + every?: Prisma.PosWhereInput + some?: Prisma.PosWhereInput + none?: Prisma.PosWhereInput +} + +export type PosOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type PosOrderByRelevanceInput = { + fields: Prisma.PosOrderByRelevanceFieldEnum | Prisma.PosOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type PosCountOrderByAggregateInput = { + id?: Prisma.SortOrder + serial?: Prisma.SortOrder + model?: Prisma.SortOrder + status?: Prisma.SortOrder + pos_type?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + device_id?: Prisma.SortOrder + provider_id?: Prisma.SortOrder +} + +export type PosMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + serial?: Prisma.SortOrder + model?: Prisma.SortOrder + status?: Prisma.SortOrder + pos_type?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + device_id?: Prisma.SortOrder + provider_id?: Prisma.SortOrder +} + +export type PosMinOrderByAggregateInput = { + id?: Prisma.SortOrder + serial?: Prisma.SortOrder + model?: Prisma.SortOrder + status?: Prisma.SortOrder + pos_type?: Prisma.SortOrder + created_at?: Prisma.SortOrder + updated_at?: Prisma.SortOrder + complex_id?: Prisma.SortOrder + device_id?: Prisma.SortOrder + provider_id?: Prisma.SortOrder +} + +export type PosScalarRelationFilter = { + is?: Prisma.PosWhereInput + isNot?: Prisma.PosWhereInput +} + +export type PosNullableScalarRelationFilter = { + is?: Prisma.PosWhereInput | null + isNot?: Prisma.PosWhereInput | null +} + +export type PosCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutComplexInput[] | Prisma.PosUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutComplexInput | Prisma.PosCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.PosCreateManyComplexInputEnvelope + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] +} + +export type PosUncheckedCreateNestedManyWithoutComplexInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutComplexInput[] | Prisma.PosUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutComplexInput | Prisma.PosCreateOrConnectWithoutComplexInput[] + createMany?: Prisma.PosCreateManyComplexInputEnvelope + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] +} + +export type PosUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutComplexInput[] | Prisma.PosUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutComplexInput | Prisma.PosCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.PosUpsertWithWhereUniqueWithoutComplexInput | Prisma.PosUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.PosCreateManyComplexInputEnvelope + set?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + disconnect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + delete?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + update?: Prisma.PosUpdateWithWhereUniqueWithoutComplexInput | Prisma.PosUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.PosUpdateManyWithWhereWithoutComplexInput | Prisma.PosUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[] +} + +export type PosUncheckedUpdateManyWithoutComplexNestedInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutComplexInput[] | Prisma.PosUncheckedCreateWithoutComplexInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutComplexInput | Prisma.PosCreateOrConnectWithoutComplexInput[] + upsert?: Prisma.PosUpsertWithWhereUniqueWithoutComplexInput | Prisma.PosUpsertWithWhereUniqueWithoutComplexInput[] + createMany?: Prisma.PosCreateManyComplexInputEnvelope + set?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + disconnect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + delete?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + update?: Prisma.PosUpdateWithWhereUniqueWithoutComplexInput | Prisma.PosUpdateWithWhereUniqueWithoutComplexInput[] + updateMany?: Prisma.PosUpdateManyWithWhereWithoutComplexInput | Prisma.PosUpdateManyWithWhereWithoutComplexInput[] + deleteMany?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[] +} + +export type EnumPOSStatusFieldUpdateOperationsInput = { + set?: $Enums.POSStatus +} + +export type EnumPOSTypeFieldUpdateOperationsInput = { + set?: $Enums.POSType +} + +export type PosCreateNestedManyWithoutDeviceInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutDeviceInput[] | Prisma.PosUncheckedCreateWithoutDeviceInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutDeviceInput | Prisma.PosCreateOrConnectWithoutDeviceInput[] + createMany?: Prisma.PosCreateManyDeviceInputEnvelope + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] +} + +export type PosUncheckedCreateNestedManyWithoutDeviceInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutDeviceInput[] | Prisma.PosUncheckedCreateWithoutDeviceInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutDeviceInput | Prisma.PosCreateOrConnectWithoutDeviceInput[] + createMany?: Prisma.PosCreateManyDeviceInputEnvelope + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] +} + +export type PosUpdateManyWithoutDeviceNestedInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutDeviceInput[] | Prisma.PosUncheckedCreateWithoutDeviceInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutDeviceInput | Prisma.PosCreateOrConnectWithoutDeviceInput[] + upsert?: Prisma.PosUpsertWithWhereUniqueWithoutDeviceInput | Prisma.PosUpsertWithWhereUniqueWithoutDeviceInput[] + createMany?: Prisma.PosCreateManyDeviceInputEnvelope + set?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + disconnect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + delete?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + update?: Prisma.PosUpdateWithWhereUniqueWithoutDeviceInput | Prisma.PosUpdateWithWhereUniqueWithoutDeviceInput[] + updateMany?: Prisma.PosUpdateManyWithWhereWithoutDeviceInput | Prisma.PosUpdateManyWithWhereWithoutDeviceInput[] + deleteMany?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[] +} + +export type PosUncheckedUpdateManyWithoutDeviceNestedInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutDeviceInput[] | Prisma.PosUncheckedCreateWithoutDeviceInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutDeviceInput | Prisma.PosCreateOrConnectWithoutDeviceInput[] + upsert?: Prisma.PosUpsertWithWhereUniqueWithoutDeviceInput | Prisma.PosUpsertWithWhereUniqueWithoutDeviceInput[] + createMany?: Prisma.PosCreateManyDeviceInputEnvelope + set?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + disconnect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + delete?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + update?: Prisma.PosUpdateWithWhereUniqueWithoutDeviceInput | Prisma.PosUpdateWithWhereUniqueWithoutDeviceInput[] + updateMany?: Prisma.PosUpdateManyWithWhereWithoutDeviceInput | Prisma.PosUpdateManyWithWhereWithoutDeviceInput[] + deleteMany?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[] +} + +export type PosCreateNestedOneWithoutLicensesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PosCreateOrConnectWithoutLicensesInput + connect?: Prisma.PosWhereUniqueInput +} + +export type PosUpdateOneRequiredWithoutLicensesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PosCreateOrConnectWithoutLicensesInput + upsert?: Prisma.PosUpsertWithoutLicensesInput + connect?: Prisma.PosWhereUniqueInput + update?: Prisma.XOR, Prisma.PosUncheckedUpdateWithoutLicensesInput> +} + +export type PosCreateNestedOneWithoutAccountsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PosCreateOrConnectWithoutAccountsInput + connect?: Prisma.PosWhereUniqueInput +} + +export type PosUpdateOneWithoutAccountsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PosCreateOrConnectWithoutAccountsInput + upsert?: Prisma.PosUpsertWithoutAccountsInput + disconnect?: Prisma.PosWhereInput | boolean + delete?: Prisma.PosWhereInput | boolean + connect?: Prisma.PosWhereUniqueInput + update?: Prisma.XOR, Prisma.PosUncheckedUpdateWithoutAccountsInput> +} + +export type PosCreateNestedManyWithoutProviderInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutProviderInput[] | Prisma.PosUncheckedCreateWithoutProviderInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutProviderInput | Prisma.PosCreateOrConnectWithoutProviderInput[] + createMany?: Prisma.PosCreateManyProviderInputEnvelope + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] +} + +export type PosUncheckedCreateNestedManyWithoutProviderInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutProviderInput[] | Prisma.PosUncheckedCreateWithoutProviderInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutProviderInput | Prisma.PosCreateOrConnectWithoutProviderInput[] + createMany?: Prisma.PosCreateManyProviderInputEnvelope + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] +} + +export type PosUpdateManyWithoutProviderNestedInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutProviderInput[] | Prisma.PosUncheckedCreateWithoutProviderInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutProviderInput | Prisma.PosCreateOrConnectWithoutProviderInput[] + upsert?: Prisma.PosUpsertWithWhereUniqueWithoutProviderInput | Prisma.PosUpsertWithWhereUniqueWithoutProviderInput[] + createMany?: Prisma.PosCreateManyProviderInputEnvelope + set?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + disconnect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + delete?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + update?: Prisma.PosUpdateWithWhereUniqueWithoutProviderInput | Prisma.PosUpdateWithWhereUniqueWithoutProviderInput[] + updateMany?: Prisma.PosUpdateManyWithWhereWithoutProviderInput | Prisma.PosUpdateManyWithWhereWithoutProviderInput[] + deleteMany?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[] +} + +export type PosUncheckedUpdateManyWithoutProviderNestedInput = { + create?: Prisma.XOR | Prisma.PosCreateWithoutProviderInput[] | Prisma.PosUncheckedCreateWithoutProviderInput[] + connectOrCreate?: Prisma.PosCreateOrConnectWithoutProviderInput | Prisma.PosCreateOrConnectWithoutProviderInput[] + upsert?: Prisma.PosUpsertWithWhereUniqueWithoutProviderInput | Prisma.PosUpsertWithWhereUniqueWithoutProviderInput[] + createMany?: Prisma.PosCreateManyProviderInputEnvelope + set?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + disconnect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + delete?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + connect?: Prisma.PosWhereUniqueInput | Prisma.PosWhereUniqueInput[] + update?: Prisma.PosUpdateWithWhereUniqueWithoutProviderInput | Prisma.PosUpdateWithWhereUniqueWithoutProviderInput[] + updateMany?: Prisma.PosUpdateManyWithWhereWithoutProviderInput | Prisma.PosUpdateManyWithWhereWithoutProviderInput[] + deleteMany?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[] +} + +export type PosCreateWithoutComplexInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + device: Prisma.DeviceCreateNestedOneWithoutPosesInput + provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput + licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput + accounts?: Prisma.AccountCreateNestedManyWithoutPosInput +} + +export type PosUncheckedCreateWithoutComplexInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + device_id: string + provider_id?: string | null + licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutPosInput +} + +export type PosCreateOrConnectWithoutComplexInput = { + where: Prisma.PosWhereUniqueInput + create: Prisma.XOR +} + +export type PosCreateManyComplexInputEnvelope = { + data: Prisma.PosCreateManyComplexInput | Prisma.PosCreateManyComplexInput[] + skipDuplicates?: boolean +} + +export type PosUpsertWithWhereUniqueWithoutComplexInput = { + where: Prisma.PosWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PosUpdateWithWhereUniqueWithoutComplexInput = { + where: Prisma.PosWhereUniqueInput + data: Prisma.XOR +} + +export type PosUpdateManyWithWhereWithoutComplexInput = { + where: Prisma.PosScalarWhereInput + data: Prisma.XOR +} + +export type PosScalarWhereInput = { + AND?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[] + OR?: Prisma.PosScalarWhereInput[] + NOT?: Prisma.PosScalarWhereInput | Prisma.PosScalarWhereInput[] + id?: Prisma.StringFilter<"Pos"> | string + serial?: Prisma.StringFilter<"Pos"> | string + model?: Prisma.StringNullableFilter<"Pos"> | string | null + status?: Prisma.EnumPOSStatusFilter<"Pos"> | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFilter<"Pos"> | $Enums.POSType + created_at?: Prisma.DateTimeFilter<"Pos"> | Date | string + updated_at?: Prisma.DateTimeFilter<"Pos"> | Date | string + complex_id?: Prisma.StringFilter<"Pos"> | string + device_id?: Prisma.StringFilter<"Pos"> | string + provider_id?: Prisma.StringNullableFilter<"Pos"> | string | null +} + +export type PosCreateWithoutDeviceInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput + provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput + licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput + accounts?: Prisma.AccountCreateNestedManyWithoutPosInput +} + +export type PosUncheckedCreateWithoutDeviceInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex_id: string + provider_id?: string | null + licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutPosInput +} + +export type PosCreateOrConnectWithoutDeviceInput = { + where: Prisma.PosWhereUniqueInput + create: Prisma.XOR +} + +export type PosCreateManyDeviceInputEnvelope = { + data: Prisma.PosCreateManyDeviceInput | Prisma.PosCreateManyDeviceInput[] + skipDuplicates?: boolean +} + +export type PosUpsertWithWhereUniqueWithoutDeviceInput = { + where: Prisma.PosWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PosUpdateWithWhereUniqueWithoutDeviceInput = { + where: Prisma.PosWhereUniqueInput + data: Prisma.XOR +} + +export type PosUpdateManyWithWhereWithoutDeviceInput = { + where: Prisma.PosScalarWhereInput + data: Prisma.XOR +} + +export type PosCreateWithoutLicensesInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput + device: Prisma.DeviceCreateNestedOneWithoutPosesInput + provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput + accounts?: Prisma.AccountCreateNestedManyWithoutPosInput +} + +export type PosUncheckedCreateWithoutLicensesInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex_id: string + device_id: string + provider_id?: string | null + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutPosInput +} + +export type PosCreateOrConnectWithoutLicensesInput = { + where: Prisma.PosWhereUniqueInput + create: Prisma.XOR +} + +export type PosUpsertWithoutLicensesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.PosWhereInput +} + +export type PosUpdateToOneWithWhereWithoutLicensesInput = { + where?: Prisma.PosWhereInput + data: Prisma.XOR +} + +export type PosUpdateWithoutLicensesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput + device?: Prisma.DeviceUpdateOneRequiredWithoutPosesNestedInput + provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput + accounts?: Prisma.AccountUpdateManyWithoutPosNestedInput +} + +export type PosUncheckedUpdateWithoutLicensesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + device_id?: Prisma.StringFieldUpdateOperationsInput | string + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + accounts?: Prisma.AccountUncheckedUpdateManyWithoutPosNestedInput +} + +export type PosCreateWithoutAccountsInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput + device: Prisma.DeviceCreateNestedOneWithoutPosesInput + provider?: Prisma.ProviderCreateNestedOneWithoutPos_listInput + licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput +} + +export type PosUncheckedCreateWithoutAccountsInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex_id: string + device_id: string + provider_id?: string | null + licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput +} + +export type PosCreateOrConnectWithoutAccountsInput = { + where: Prisma.PosWhereUniqueInput + create: Prisma.XOR +} + +export type PosUpsertWithoutAccountsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.PosWhereInput +} + +export type PosUpdateToOneWithWhereWithoutAccountsInput = { + where?: Prisma.PosWhereInput + data: Prisma.XOR +} + +export type PosUpdateWithoutAccountsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput + device?: Prisma.DeviceUpdateOneRequiredWithoutPosesNestedInput + provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput + licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput +} + +export type PosUncheckedUpdateWithoutAccountsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + device_id?: Prisma.StringFieldUpdateOperationsInput | string + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput +} + +export type PosCreateWithoutProviderInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex: Prisma.ComplexCreateNestedOneWithoutPos_listInput + device: Prisma.DeviceCreateNestedOneWithoutPosesInput + licenses?: Prisma.LicenseCreateNestedManyWithoutPosInput + accounts?: Prisma.AccountCreateNestedManyWithoutPosInput +} + +export type PosUncheckedCreateWithoutProviderInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex_id: string + device_id: string + licenses?: Prisma.LicenseUncheckedCreateNestedManyWithoutPosInput + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutPosInput +} + +export type PosCreateOrConnectWithoutProviderInput = { + where: Prisma.PosWhereUniqueInput + create: Prisma.XOR +} + +export type PosCreateManyProviderInputEnvelope = { + data: Prisma.PosCreateManyProviderInput | Prisma.PosCreateManyProviderInput[] + skipDuplicates?: boolean +} + +export type PosUpsertWithWhereUniqueWithoutProviderInput = { + where: Prisma.PosWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PosUpdateWithWhereUniqueWithoutProviderInput = { + where: Prisma.PosWhereUniqueInput + data: Prisma.XOR +} + +export type PosUpdateManyWithWhereWithoutProviderInput = { + where: Prisma.PosScalarWhereInput + data: Prisma.XOR +} + +export type PosCreateManyComplexInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + device_id: string + provider_id?: string | null +} + +export type PosUpdateWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + device?: Prisma.DeviceUpdateOneRequiredWithoutPosesNestedInput + provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput + licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput + accounts?: Prisma.AccountUpdateManyWithoutPosNestedInput +} + +export type PosUncheckedUpdateWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + device_id?: Prisma.StringFieldUpdateOperationsInput | string + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput + accounts?: Prisma.AccountUncheckedUpdateManyWithoutPosNestedInput +} + +export type PosUncheckedUpdateManyWithoutComplexInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + device_id?: Prisma.StringFieldUpdateOperationsInput | string + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type PosCreateManyDeviceInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex_id: string + provider_id?: string | null +} + +export type PosUpdateWithoutDeviceInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput + provider?: Prisma.ProviderUpdateOneWithoutPos_listNestedInput + licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput + accounts?: Prisma.AccountUpdateManyWithoutPosNestedInput +} + +export type PosUncheckedUpdateWithoutDeviceInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput + accounts?: Prisma.AccountUncheckedUpdateManyWithoutPosNestedInput +} + +export type PosUncheckedUpdateManyWithoutDeviceInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + provider_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type PosCreateManyProviderInput = { + id?: string + serial: string + model?: string | null + status?: $Enums.POSStatus + pos_type: $Enums.POSType + created_at?: Date | string + updated_at?: Date | string + complex_id: string + device_id: string +} + +export type PosUpdateWithoutProviderInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex?: Prisma.ComplexUpdateOneRequiredWithoutPos_listNestedInput + device?: Prisma.DeviceUpdateOneRequiredWithoutPosesNestedInput + licenses?: Prisma.LicenseUpdateManyWithoutPosNestedInput + accounts?: Prisma.AccountUpdateManyWithoutPosNestedInput +} + +export type PosUncheckedUpdateWithoutProviderInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + device_id?: Prisma.StringFieldUpdateOperationsInput | string + licenses?: Prisma.LicenseUncheckedUpdateManyWithoutPosNestedInput + accounts?: Prisma.AccountUncheckedUpdateManyWithoutPosNestedInput +} + +export type PosUncheckedUpdateManyWithoutProviderInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + serial?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + status?: Prisma.EnumPOSStatusFieldUpdateOperationsInput | $Enums.POSStatus + pos_type?: Prisma.EnumPOSTypeFieldUpdateOperationsInput | $Enums.POSType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + complex_id?: Prisma.StringFieldUpdateOperationsInput | string + device_id?: Prisma.StringFieldUpdateOperationsInput | string +} + + +/** + * Count Type PosCountOutputType + */ + +export type PosCountOutputType = { + licenses: number + accounts: number +} + +export type PosCountOutputTypeSelect = { + licenses?: boolean | PosCountOutputTypeCountLicensesArgs + accounts?: boolean | PosCountOutputTypeCountAccountsArgs +} + +/** + * PosCountOutputType without action + */ +export type PosCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the PosCountOutputType + */ + select?: Prisma.PosCountOutputTypeSelect | null +} + +/** + * PosCountOutputType without action + */ +export type PosCountOutputTypeCountLicensesArgs = { + where?: Prisma.LicenseWhereInput +} + +/** + * PosCountOutputType without action + */ +export type PosCountOutputTypeCountAccountsArgs = { + where?: Prisma.AccountWhereInput +} + + +export type PosSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + serial?: boolean + model?: boolean + status?: boolean + pos_type?: boolean + created_at?: boolean + updated_at?: boolean + complex_id?: boolean + device_id?: boolean + provider_id?: boolean + complex?: boolean | Prisma.ComplexDefaultArgs + device?: boolean | Prisma.DeviceDefaultArgs + provider?: boolean | Prisma.Pos$providerArgs + licenses?: boolean | Prisma.Pos$licensesArgs + accounts?: boolean | Prisma.Pos$accountsArgs + _count?: boolean | Prisma.PosCountOutputTypeDefaultArgs +}, ExtArgs["result"]["pos"]> + + + +export type PosSelectScalar = { + id?: boolean + serial?: boolean + model?: boolean + status?: boolean + pos_type?: boolean + created_at?: boolean + updated_at?: boolean + complex_id?: boolean + device_id?: boolean + provider_id?: boolean +} + +export type PosOmit = runtime.Types.Extensions.GetOmit<"id" | "serial" | "model" | "status" | "pos_type" | "created_at" | "updated_at" | "complex_id" | "device_id" | "provider_id", ExtArgs["result"]["pos"]> +export type PosInclude = { + complex?: boolean | Prisma.ComplexDefaultArgs + device?: boolean | Prisma.DeviceDefaultArgs + provider?: boolean | Prisma.Pos$providerArgs + licenses?: boolean | Prisma.Pos$licensesArgs + accounts?: boolean | Prisma.Pos$accountsArgs + _count?: boolean | Prisma.PosCountOutputTypeDefaultArgs +} + +export type $PosPayload = { + name: "Pos" + objects: { + complex: Prisma.$ComplexPayload + device: Prisma.$DevicePayload + provider: Prisma.$ProviderPayload | null + licenses: Prisma.$LicensePayload[] + accounts: Prisma.$AccountPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + serial: string + model: string | null + status: $Enums.POSStatus + pos_type: $Enums.POSType + created_at: Date + updated_at: Date + complex_id: string + device_id: string + provider_id: string | null + }, ExtArgs["result"]["pos"]> + composites: {} +} + +export type PosGetPayload = runtime.Types.Result.GetResult + +export type PosCountArgs = + Omit & { + select?: PosCountAggregateInputType | true + } + +export interface PosDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Pos'], meta: { name: 'Pos' } } + /** + * Find zero or one Pos that matches the filter. + * @param {PosFindUniqueArgs} args - Arguments to find a Pos + * @example + * // Get one Pos + * const pos = await prisma.pos.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__PosClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Pos that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PosFindUniqueOrThrowArgs} args - Arguments to find a Pos + * @example + * // Get one Pos + * const pos = await prisma.pos.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__PosClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Pos that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PosFindFirstArgs} args - Arguments to find a Pos + * @example + * // Get one Pos + * const pos = await prisma.pos.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__PosClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Pos that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PosFindFirstOrThrowArgs} args - Arguments to find a Pos + * @example + * // Get one Pos + * const pos = await prisma.pos.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__PosClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Pos that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PosFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Pos + * const pos = await prisma.pos.findMany() + * + * // Get first 10 Pos + * const pos = await prisma.pos.findMany({ take: 10 }) + * + * // Only select the `id` + * const posWithIdOnly = await prisma.pos.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Pos. + * @param {PosCreateArgs} args - Arguments to create a Pos. + * @example + * // Create one Pos + * const Pos = await prisma.pos.create({ + * data: { + * // ... data to create a Pos + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__PosClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Pos. + * @param {PosCreateManyArgs} args - Arguments to create many Pos. + * @example + * // Create many Pos + * const pos = await prisma.pos.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a Pos. + * @param {PosDeleteArgs} args - Arguments to delete one Pos. + * @example + * // Delete one Pos + * const Pos = await prisma.pos.delete({ + * where: { + * // ... filter to delete one Pos + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__PosClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Pos. + * @param {PosUpdateArgs} args - Arguments to update one Pos. + * @example + * // Update one Pos + * const pos = await prisma.pos.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__PosClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Pos. + * @param {PosDeleteManyArgs} args - Arguments to filter Pos to delete. + * @example + * // Delete a few Pos + * const { count } = await prisma.pos.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Pos. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PosUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Pos + * const pos = await prisma.pos.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Pos. + * @param {PosUpsertArgs} args - Arguments to update or create a Pos. + * @example + * // Update or create a Pos + * const pos = await prisma.pos.upsert({ + * create: { + * // ... data to create a Pos + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Pos we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__PosClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Pos. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PosCountArgs} args - Arguments to filter Pos to count. + * @example + * // Count the number of Pos + * const count = await prisma.pos.count({ + * where: { + * // ... the filter for the Pos we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Pos. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PosAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Pos. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PosGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends PosGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: PosGroupByArgs['orderBy'] } + : { orderBy?: PosGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetPosGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Pos model + */ +readonly fields: PosFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Pos. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__PosClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + complex = {}>(args?: Prisma.Subset>): Prisma.Prisma__ComplexClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + device = {}>(args?: Prisma.Subset>): Prisma.Prisma__DeviceClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + provider = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProviderClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + licenses = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + accounts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Pos model + */ +export interface PosFieldRefs { + readonly id: Prisma.FieldRef<"Pos", 'String'> + readonly serial: Prisma.FieldRef<"Pos", 'String'> + readonly model: Prisma.FieldRef<"Pos", 'String'> + readonly status: Prisma.FieldRef<"Pos", 'POSStatus'> + readonly pos_type: Prisma.FieldRef<"Pos", 'POSType'> + readonly created_at: Prisma.FieldRef<"Pos", 'DateTime'> + readonly updated_at: Prisma.FieldRef<"Pos", 'DateTime'> + readonly complex_id: Prisma.FieldRef<"Pos", 'String'> + readonly device_id: Prisma.FieldRef<"Pos", 'String'> + readonly provider_id: Prisma.FieldRef<"Pos", 'String'> +} + + +// Custom InputTypes +/** + * Pos findUnique + */ +export type PosFindUniqueArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + /** + * Filter, which Pos to fetch. + */ + where: Prisma.PosWhereUniqueInput +} + +/** + * Pos findUniqueOrThrow + */ +export type PosFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + /** + * Filter, which Pos to fetch. + */ + where: Prisma.PosWhereUniqueInput +} + +/** + * Pos findFirst + */ +export type PosFindFirstArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + /** + * Filter, which Pos to fetch. + */ + where?: Prisma.PosWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Pos to fetch. + */ + orderBy?: Prisma.PosOrderByWithRelationInput | Prisma.PosOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Pos. + */ + cursor?: Prisma.PosWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Pos from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Pos. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Pos. + */ + distinct?: Prisma.PosScalarFieldEnum | Prisma.PosScalarFieldEnum[] +} + +/** + * Pos findFirstOrThrow + */ +export type PosFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + /** + * Filter, which Pos to fetch. + */ + where?: Prisma.PosWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Pos to fetch. + */ + orderBy?: Prisma.PosOrderByWithRelationInput | Prisma.PosOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Pos. + */ + cursor?: Prisma.PosWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Pos from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Pos. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Pos. + */ + distinct?: Prisma.PosScalarFieldEnum | Prisma.PosScalarFieldEnum[] +} + +/** + * Pos findMany + */ +export type PosFindManyArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + /** + * Filter, which Pos to fetch. + */ + where?: Prisma.PosWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Pos to fetch. + */ + orderBy?: Prisma.PosOrderByWithRelationInput | Prisma.PosOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Pos. + */ + cursor?: Prisma.PosWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Pos from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Pos. + */ + skip?: number + distinct?: Prisma.PosScalarFieldEnum | Prisma.PosScalarFieldEnum[] +} + +/** + * Pos create + */ +export type PosCreateArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + /** + * The data needed to create a Pos. + */ + data: Prisma.XOR +} + +/** + * Pos createMany + */ +export type PosCreateManyArgs = { + /** + * The data used to create many Pos. + */ + data: Prisma.PosCreateManyInput | Prisma.PosCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Pos update + */ +export type PosUpdateArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + /** + * The data needed to update a Pos. + */ + data: Prisma.XOR + /** + * Choose, which Pos to update. + */ + where: Prisma.PosWhereUniqueInput +} + +/** + * Pos updateMany + */ +export type PosUpdateManyArgs = { + /** + * The data used to update Pos. + */ + data: Prisma.XOR + /** + * Filter which Pos to update + */ + where?: Prisma.PosWhereInput + /** + * Limit how many Pos to update. + */ + limit?: number +} + +/** + * Pos upsert + */ +export type PosUpsertArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + /** + * The filter to search for the Pos to update in case it exists. + */ + where: Prisma.PosWhereUniqueInput + /** + * In case the Pos found by the `where` argument doesn't exist, create a new Pos with this data. + */ + create: Prisma.XOR + /** + * In case the Pos was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Pos delete + */ +export type PosDeleteArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + /** + * Filter which Pos to delete. + */ + where: Prisma.PosWhereUniqueInput +} + +/** + * Pos deleteMany + */ +export type PosDeleteManyArgs = { + /** + * Filter which Pos to delete + */ + where?: Prisma.PosWhereInput + /** + * Limit how many Pos to delete. + */ + limit?: number +} + +/** + * Pos.provider + */ +export type Pos$providerArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + where?: Prisma.ProviderWhereInput +} + +/** + * Pos.licenses + */ +export type Pos$licensesArgs = { + /** + * Select specific fields to fetch from the License + */ + select?: Prisma.LicenseSelect | null + /** + * Omit specific fields from the License + */ + omit?: Prisma.LicenseOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.LicenseInclude | null + where?: Prisma.LicenseWhereInput + orderBy?: Prisma.LicenseOrderByWithRelationInput | Prisma.LicenseOrderByWithRelationInput[] + cursor?: Prisma.LicenseWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.LicenseScalarFieldEnum | Prisma.LicenseScalarFieldEnum[] +} + +/** + * Pos.accounts + */ +export type Pos$accountsArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + where?: Prisma.AccountWhereInput + orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] + cursor?: Prisma.AccountWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] +} + +/** + * Pos without action + */ +export type PosDefaultArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null +} diff --git a/src/generated/prisma/models/Provider.ts b/src/generated/prisma/models/Provider.ts new file mode 100644 index 0000000..a143fe6 --- /dev/null +++ b/src/generated/prisma/models/Provider.ts @@ -0,0 +1,1264 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Provider` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Provider + * + */ +export type ProviderModel = runtime.Types.Result.DefaultSelection + +export type AggregateProvider = { + _count: ProviderCountAggregateOutputType | null + _min: ProviderMinAggregateOutputType | null + _max: ProviderMaxAggregateOutputType | null +} + +export type ProviderMinAggregateOutputType = { + id: string | null + name: string | null + code: string | null +} + +export type ProviderMaxAggregateOutputType = { + id: string | null + name: string | null + code: string | null +} + +export type ProviderCountAggregateOutputType = { + id: number + name: number + code: number + _all: number +} + + +export type ProviderMinAggregateInputType = { + id?: true + name?: true + code?: true +} + +export type ProviderMaxAggregateInputType = { + id?: true + name?: true + code?: true +} + +export type ProviderCountAggregateInputType = { + id?: true + name?: true + code?: true + _all?: true +} + +export type ProviderAggregateArgs = { + /** + * Filter which Provider to aggregate. + */ + where?: Prisma.ProviderWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Providers to fetch. + */ + orderBy?: Prisma.ProviderOrderByWithRelationInput | Prisma.ProviderOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.ProviderWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Providers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Providers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Providers + **/ + _count?: true | ProviderCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ProviderMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ProviderMaxAggregateInputType +} + +export type GetProviderAggregateType = { + [P in keyof T & keyof AggregateProvider]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type ProviderGroupByArgs = { + where?: Prisma.ProviderWhereInput + orderBy?: Prisma.ProviderOrderByWithAggregationInput | Prisma.ProviderOrderByWithAggregationInput[] + by: Prisma.ProviderScalarFieldEnum[] | Prisma.ProviderScalarFieldEnum + having?: Prisma.ProviderScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ProviderCountAggregateInputType | true + _min?: ProviderMinAggregateInputType + _max?: ProviderMaxAggregateInputType +} + +export type ProviderGroupByOutputType = { + id: string + name: string + code: string | null + _count: ProviderCountAggregateOutputType | null + _min: ProviderMinAggregateOutputType | null + _max: ProviderMaxAggregateOutputType | null +} + +type GetProviderGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof ProviderGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type ProviderWhereInput = { + AND?: Prisma.ProviderWhereInput | Prisma.ProviderWhereInput[] + OR?: Prisma.ProviderWhereInput[] + NOT?: Prisma.ProviderWhereInput | Prisma.ProviderWhereInput[] + id?: Prisma.StringFilter<"Provider"> | string + name?: Prisma.StringFilter<"Provider"> | string + code?: Prisma.StringNullableFilter<"Provider"> | string | null + pos_list?: Prisma.PosListRelationFilter + accounts?: Prisma.AccountListRelationFilter +} + +export type ProviderOrderByWithRelationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrderInput | Prisma.SortOrder + pos_list?: Prisma.PosOrderByRelationAggregateInput + accounts?: Prisma.AccountOrderByRelationAggregateInput + _relevance?: Prisma.ProviderOrderByRelevanceInput +} + +export type ProviderWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.ProviderWhereInput | Prisma.ProviderWhereInput[] + OR?: Prisma.ProviderWhereInput[] + NOT?: Prisma.ProviderWhereInput | Prisma.ProviderWhereInput[] + name?: Prisma.StringFilter<"Provider"> | string + code?: Prisma.StringNullableFilter<"Provider"> | string | null + pos_list?: Prisma.PosListRelationFilter + accounts?: Prisma.AccountListRelationFilter +}, "id"> + +export type ProviderOrderByWithAggregationInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.ProviderCountOrderByAggregateInput + _max?: Prisma.ProviderMaxOrderByAggregateInput + _min?: Prisma.ProviderMinOrderByAggregateInput +} + +export type ProviderScalarWhereWithAggregatesInput = { + AND?: Prisma.ProviderScalarWhereWithAggregatesInput | Prisma.ProviderScalarWhereWithAggregatesInput[] + OR?: Prisma.ProviderScalarWhereWithAggregatesInput[] + NOT?: Prisma.ProviderScalarWhereWithAggregatesInput | Prisma.ProviderScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Provider"> | string + name?: Prisma.StringWithAggregatesFilter<"Provider"> | string + code?: Prisma.StringNullableWithAggregatesFilter<"Provider"> | string | null +} + +export type ProviderCreateInput = { + id?: string + name: string + code?: string | null + pos_list?: Prisma.PosCreateNestedManyWithoutProviderInput + accounts?: Prisma.AccountCreateNestedManyWithoutProviderInput +} + +export type ProviderUncheckedCreateInput = { + id?: string + name: string + code?: string | null + pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutProviderInput + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutProviderInput +} + +export type ProviderUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_list?: Prisma.PosUpdateManyWithoutProviderNestedInput + accounts?: Prisma.AccountUpdateManyWithoutProviderNestedInput +} + +export type ProviderUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_list?: Prisma.PosUncheckedUpdateManyWithoutProviderNestedInput + accounts?: Prisma.AccountUncheckedUpdateManyWithoutProviderNestedInput +} + +export type ProviderCreateManyInput = { + id?: string + name: string + code?: string | null +} + +export type ProviderUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type ProviderUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type ProviderNullableScalarRelationFilter = { + is?: Prisma.ProviderWhereInput | null + isNot?: Prisma.ProviderWhereInput | null +} + +export type ProviderOrderByRelevanceInput = { + fields: Prisma.ProviderOrderByRelevanceFieldEnum | Prisma.ProviderOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type ProviderCountOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrder +} + +export type ProviderMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrder +} + +export type ProviderMinOrderByAggregateInput = { + id?: Prisma.SortOrder + name?: Prisma.SortOrder + code?: Prisma.SortOrder +} + +export type ProviderCreateNestedOneWithoutPos_listInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProviderCreateOrConnectWithoutPos_listInput + connect?: Prisma.ProviderWhereUniqueInput +} + +export type ProviderUpdateOneWithoutPos_listNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProviderCreateOrConnectWithoutPos_listInput + upsert?: Prisma.ProviderUpsertWithoutPos_listInput + disconnect?: Prisma.ProviderWhereInput | boolean + delete?: Prisma.ProviderWhereInput | boolean + connect?: Prisma.ProviderWhereUniqueInput + update?: Prisma.XOR, Prisma.ProviderUncheckedUpdateWithoutPos_listInput> +} + +export type ProviderCreateNestedOneWithoutAccountsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProviderCreateOrConnectWithoutAccountsInput + connect?: Prisma.ProviderWhereUniqueInput +} + +export type ProviderUpdateOneWithoutAccountsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProviderCreateOrConnectWithoutAccountsInput + upsert?: Prisma.ProviderUpsertWithoutAccountsInput + disconnect?: Prisma.ProviderWhereInput | boolean + delete?: Prisma.ProviderWhereInput | boolean + connect?: Prisma.ProviderWhereUniqueInput + update?: Prisma.XOR, Prisma.ProviderUncheckedUpdateWithoutAccountsInput> +} + +export type ProviderCreateWithoutPos_listInput = { + id?: string + name: string + code?: string | null + accounts?: Prisma.AccountCreateNestedManyWithoutProviderInput +} + +export type ProviderUncheckedCreateWithoutPos_listInput = { + id?: string + name: string + code?: string | null + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutProviderInput +} + +export type ProviderCreateOrConnectWithoutPos_listInput = { + where: Prisma.ProviderWhereUniqueInput + create: Prisma.XOR +} + +export type ProviderUpsertWithoutPos_listInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ProviderWhereInput +} + +export type ProviderUpdateToOneWithWhereWithoutPos_listInput = { + where?: Prisma.ProviderWhereInput + data: Prisma.XOR +} + +export type ProviderUpdateWithoutPos_listInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + accounts?: Prisma.AccountUpdateManyWithoutProviderNestedInput +} + +export type ProviderUncheckedUpdateWithoutPos_listInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + accounts?: Prisma.AccountUncheckedUpdateManyWithoutProviderNestedInput +} + +export type ProviderCreateWithoutAccountsInput = { + id?: string + name: string + code?: string | null + pos_list?: Prisma.PosCreateNestedManyWithoutProviderInput +} + +export type ProviderUncheckedCreateWithoutAccountsInput = { + id?: string + name: string + code?: string | null + pos_list?: Prisma.PosUncheckedCreateNestedManyWithoutProviderInput +} + +export type ProviderCreateOrConnectWithoutAccountsInput = { + where: Prisma.ProviderWhereUniqueInput + create: Prisma.XOR +} + +export type ProviderUpsertWithoutAccountsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ProviderWhereInput +} + +export type ProviderUpdateToOneWithWhereWithoutAccountsInput = { + where?: Prisma.ProviderWhereInput + data: Prisma.XOR +} + +export type ProviderUpdateWithoutAccountsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_list?: Prisma.PosUpdateManyWithoutProviderNestedInput +} + +export type ProviderUncheckedUpdateWithoutAccountsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + pos_list?: Prisma.PosUncheckedUpdateManyWithoutProviderNestedInput +} + + +/** + * Count Type ProviderCountOutputType + */ + +export type ProviderCountOutputType = { + pos_list: number + accounts: number +} + +export type ProviderCountOutputTypeSelect = { + pos_list?: boolean | ProviderCountOutputTypeCountPos_listArgs + accounts?: boolean | ProviderCountOutputTypeCountAccountsArgs +} + +/** + * ProviderCountOutputType without action + */ +export type ProviderCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the ProviderCountOutputType + */ + select?: Prisma.ProviderCountOutputTypeSelect | null +} + +/** + * ProviderCountOutputType without action + */ +export type ProviderCountOutputTypeCountPos_listArgs = { + where?: Prisma.PosWhereInput +} + +/** + * ProviderCountOutputType without action + */ +export type ProviderCountOutputTypeCountAccountsArgs = { + where?: Prisma.AccountWhereInput +} + + +export type ProviderSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + name?: boolean + code?: boolean + pos_list?: boolean | Prisma.Provider$pos_listArgs + accounts?: boolean | Prisma.Provider$accountsArgs + _count?: boolean | Prisma.ProviderCountOutputTypeDefaultArgs +}, ExtArgs["result"]["provider"]> + + + +export type ProviderSelectScalar = { + id?: boolean + name?: boolean + code?: boolean +} + +export type ProviderOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "code", ExtArgs["result"]["provider"]> +export type ProviderInclude = { + pos_list?: boolean | Prisma.Provider$pos_listArgs + accounts?: boolean | Prisma.Provider$accountsArgs + _count?: boolean | Prisma.ProviderCountOutputTypeDefaultArgs +} + +export type $ProviderPayload = { + name: "Provider" + objects: { + pos_list: Prisma.$PosPayload[] + accounts: Prisma.$AccountPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + name: string + code: string | null + }, ExtArgs["result"]["provider"]> + composites: {} +} + +export type ProviderGetPayload = runtime.Types.Result.GetResult + +export type ProviderCountArgs = + Omit & { + select?: ProviderCountAggregateInputType | true + } + +export interface ProviderDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Provider'], meta: { name: 'Provider' } } + /** + * Find zero or one Provider that matches the filter. + * @param {ProviderFindUniqueArgs} args - Arguments to find a Provider + * @example + * // Get one Provider + * const provider = await prisma.provider.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__ProviderClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Provider that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ProviderFindUniqueOrThrowArgs} args - Arguments to find a Provider + * @example + * // Get one Provider + * const provider = await prisma.provider.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__ProviderClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Provider that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProviderFindFirstArgs} args - Arguments to find a Provider + * @example + * // Get one Provider + * const provider = await prisma.provider.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__ProviderClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Provider that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProviderFindFirstOrThrowArgs} args - Arguments to find a Provider + * @example + * // Get one Provider + * const provider = await prisma.provider.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__ProviderClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Providers that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProviderFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Providers + * const providers = await prisma.provider.findMany() + * + * // Get first 10 Providers + * const providers = await prisma.provider.findMany({ take: 10 }) + * + * // Only select the `id` + * const providerWithIdOnly = await prisma.provider.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Provider. + * @param {ProviderCreateArgs} args - Arguments to create a Provider. + * @example + * // Create one Provider + * const Provider = await prisma.provider.create({ + * data: { + * // ... data to create a Provider + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__ProviderClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Providers. + * @param {ProviderCreateManyArgs} args - Arguments to create many Providers. + * @example + * // Create many Providers + * const provider = await prisma.provider.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a Provider. + * @param {ProviderDeleteArgs} args - Arguments to delete one Provider. + * @example + * // Delete one Provider + * const Provider = await prisma.provider.delete({ + * where: { + * // ... filter to delete one Provider + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__ProviderClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Provider. + * @param {ProviderUpdateArgs} args - Arguments to update one Provider. + * @example + * // Update one Provider + * const provider = await prisma.provider.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__ProviderClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Providers. + * @param {ProviderDeleteManyArgs} args - Arguments to filter Providers to delete. + * @example + * // Delete a few Providers + * const { count } = await prisma.provider.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Providers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProviderUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Providers + * const provider = await prisma.provider.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Provider. + * @param {ProviderUpsertArgs} args - Arguments to update or create a Provider. + * @example + * // Update or create a Provider + * const provider = await prisma.provider.upsert({ + * create: { + * // ... data to create a Provider + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Provider we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__ProviderClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Providers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProviderCountArgs} args - Arguments to filter Providers to count. + * @example + * // Count the number of Providers + * const count = await prisma.provider.count({ + * where: { + * // ... the filter for the Providers we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Provider. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProviderAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Provider. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProviderGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends ProviderGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: ProviderGroupByArgs['orderBy'] } + : { orderBy?: ProviderGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetProviderGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Provider model + */ +readonly fields: ProviderFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Provider. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__ProviderClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + pos_list = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + accounts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Provider model + */ +export interface ProviderFieldRefs { + readonly id: Prisma.FieldRef<"Provider", 'String'> + readonly name: Prisma.FieldRef<"Provider", 'String'> + readonly code: Prisma.FieldRef<"Provider", 'String'> +} + + +// Custom InputTypes +/** + * Provider findUnique + */ +export type ProviderFindUniqueArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + /** + * Filter, which Provider to fetch. + */ + where: Prisma.ProviderWhereUniqueInput +} + +/** + * Provider findUniqueOrThrow + */ +export type ProviderFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + /** + * Filter, which Provider to fetch. + */ + where: Prisma.ProviderWhereUniqueInput +} + +/** + * Provider findFirst + */ +export type ProviderFindFirstArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + /** + * Filter, which Provider to fetch. + */ + where?: Prisma.ProviderWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Providers to fetch. + */ + orderBy?: Prisma.ProviderOrderByWithRelationInput | Prisma.ProviderOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Providers. + */ + cursor?: Prisma.ProviderWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Providers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Providers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Providers. + */ + distinct?: Prisma.ProviderScalarFieldEnum | Prisma.ProviderScalarFieldEnum[] +} + +/** + * Provider findFirstOrThrow + */ +export type ProviderFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + /** + * Filter, which Provider to fetch. + */ + where?: Prisma.ProviderWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Providers to fetch. + */ + orderBy?: Prisma.ProviderOrderByWithRelationInput | Prisma.ProviderOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Providers. + */ + cursor?: Prisma.ProviderWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Providers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Providers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Providers. + */ + distinct?: Prisma.ProviderScalarFieldEnum | Prisma.ProviderScalarFieldEnum[] +} + +/** + * Provider findMany + */ +export type ProviderFindManyArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + /** + * Filter, which Providers to fetch. + */ + where?: Prisma.ProviderWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Providers to fetch. + */ + orderBy?: Prisma.ProviderOrderByWithRelationInput | Prisma.ProviderOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Providers. + */ + cursor?: Prisma.ProviderWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Providers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Providers. + */ + skip?: number + distinct?: Prisma.ProviderScalarFieldEnum | Prisma.ProviderScalarFieldEnum[] +} + +/** + * Provider create + */ +export type ProviderCreateArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + /** + * The data needed to create a Provider. + */ + data: Prisma.XOR +} + +/** + * Provider createMany + */ +export type ProviderCreateManyArgs = { + /** + * The data used to create many Providers. + */ + data: Prisma.ProviderCreateManyInput | Prisma.ProviderCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Provider update + */ +export type ProviderUpdateArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + /** + * The data needed to update a Provider. + */ + data: Prisma.XOR + /** + * Choose, which Provider to update. + */ + where: Prisma.ProviderWhereUniqueInput +} + +/** + * Provider updateMany + */ +export type ProviderUpdateManyArgs = { + /** + * The data used to update Providers. + */ + data: Prisma.XOR + /** + * Filter which Providers to update + */ + where?: Prisma.ProviderWhereInput + /** + * Limit how many Providers to update. + */ + limit?: number +} + +/** + * Provider upsert + */ +export type ProviderUpsertArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + /** + * The filter to search for the Provider to update in case it exists. + */ + where: Prisma.ProviderWhereUniqueInput + /** + * In case the Provider found by the `where` argument doesn't exist, create a new Provider with this data. + */ + create: Prisma.XOR + /** + * In case the Provider was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Provider delete + */ +export type ProviderDeleteArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null + /** + * Filter which Provider to delete. + */ + where: Prisma.ProviderWhereUniqueInput +} + +/** + * Provider deleteMany + */ +export type ProviderDeleteManyArgs = { + /** + * Filter which Providers to delete + */ + where?: Prisma.ProviderWhereInput + /** + * Limit how many Providers to delete. + */ + limit?: number +} + +/** + * Provider.pos_list + */ +export type Provider$pos_listArgs = { + /** + * Select specific fields to fetch from the Pos + */ + select?: Prisma.PosSelect | null + /** + * Omit specific fields from the Pos + */ + omit?: Prisma.PosOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PosInclude | null + where?: Prisma.PosWhereInput + orderBy?: Prisma.PosOrderByWithRelationInput | Prisma.PosOrderByWithRelationInput[] + cursor?: Prisma.PosWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PosScalarFieldEnum | Prisma.PosScalarFieldEnum[] +} + +/** + * Provider.accounts + */ +export type Provider$accountsArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + where?: Prisma.AccountWhereInput + orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] + cursor?: Prisma.AccountWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] +} + +/** + * Provider without action + */ +export type ProviderDefaultArgs = { + /** + * Select specific fields to fetch from the Provider + */ + select?: Prisma.ProviderSelect | null + /** + * Omit specific fields from the Provider + */ + omit?: Prisma.ProviderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProviderInclude | null +} diff --git a/src/generated/prisma/models/SalesInvoice.ts b/src/generated/prisma/models/SalesInvoice.ts index 1f780ee..f6dea28 100644 --- a/src/generated/prisma/models/SalesInvoice.ts +++ b/src/generated/prisma/models/SalesInvoice.ts @@ -555,6 +555,14 @@ export type SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput = { deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] } +export type DecimalFieldUpdateOperationsInput = { + set?: runtime.Decimal | runtime.DecimalJsLike | number | string + increment?: runtime.Decimal | runtime.DecimalJsLike | number | string + decrement?: runtime.Decimal | runtime.DecimalJsLike | number | string + multiply?: runtime.Decimal | runtime.DecimalJsLike | number | string + divide?: runtime.Decimal | runtime.DecimalJsLike | number | string +} + export type SalesInvoiceCreateNestedOneWithoutItemsInput = { create?: Prisma.XOR connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutItemsInput diff --git a/src/generated/prisma/models/SalesInvoiceItem.ts b/src/generated/prisma/models/SalesInvoiceItem.ts index d7c5687..01ff019 100644 --- a/src/generated/prisma/models/SalesInvoiceItem.ts +++ b/src/generated/prisma/models/SalesInvoiceItem.ts @@ -49,7 +49,6 @@ export type SalesInvoiceItemMinAggregateOutputType = { created_at: Date | null discount: runtime.Decimal | null notes: string | null - pricingModel: $Enums.SalesInvoiceItemPricingModel | null invoice_id: string | null good_id: string | null service_id: string | null @@ -64,7 +63,6 @@ export type SalesInvoiceItemMaxAggregateOutputType = { created_at: Date | null discount: runtime.Decimal | null notes: string | null - pricingModel: $Enums.SalesInvoiceItemPricingModel | null invoice_id: string | null good_id: string | null service_id: string | null @@ -79,7 +77,6 @@ export type SalesInvoiceItemCountAggregateOutputType = { created_at: number discount: number notes: number - pricingModel: number invoice_id: number good_id: number service_id: number @@ -111,7 +108,6 @@ export type SalesInvoiceItemMinAggregateInputType = { created_at?: true discount?: true notes?: true - pricingModel?: true invoice_id?: true good_id?: true service_id?: true @@ -126,7 +122,6 @@ export type SalesInvoiceItemMaxAggregateInputType = { created_at?: true discount?: true notes?: true - pricingModel?: true invoice_id?: true good_id?: true service_id?: true @@ -141,7 +136,6 @@ export type SalesInvoiceItemCountAggregateInputType = { created_at?: true discount?: true notes?: true - pricingModel?: true invoice_id?: true good_id?: true service_id?: true @@ -244,7 +238,6 @@ export type SalesInvoiceItemGroupByOutputType = { created_at: Date discount: runtime.Decimal notes: string | null - pricingModel: $Enums.SalesInvoiceItemPricingModel invoice_id: string good_id: string | null service_id: string | null @@ -283,7 +276,6 @@ export type SalesInvoiceItemWhereInput = { created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string discount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFilter<"SalesInvoiceItem"> | $Enums.SalesInvoiceItemPricingModel invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string good_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null service_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null @@ -302,7 +294,6 @@ export type SalesInvoiceItemOrderByWithRelationInput = { created_at?: Prisma.SortOrder discount?: Prisma.SortOrder notes?: Prisma.SortOrderInput | Prisma.SortOrder - pricingModel?: Prisma.SortOrder invoice_id?: Prisma.SortOrder good_id?: Prisma.SortOrderInput | Prisma.SortOrder service_id?: Prisma.SortOrderInput | Prisma.SortOrder @@ -325,7 +316,6 @@ export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{ created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string discount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFilter<"SalesInvoiceItem"> | $Enums.SalesInvoiceItemPricingModel invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string good_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null service_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null @@ -344,7 +334,6 @@ export type SalesInvoiceItemOrderByWithAggregationInput = { created_at?: Prisma.SortOrder discount?: Prisma.SortOrder notes?: Prisma.SortOrderInput | Prisma.SortOrder - pricingModel?: Prisma.SortOrder invoice_id?: Prisma.SortOrder good_id?: Prisma.SortOrderInput | Prisma.SortOrder service_id?: Prisma.SortOrderInput | Prisma.SortOrder @@ -368,7 +357,6 @@ export type SalesInvoiceItemScalarWhereWithAggregatesInput = { created_at?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoiceItem"> | Date | string discount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoiceItem"> | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelWithAggregatesFilter<"SalesInvoiceItem"> | $Enums.SalesInvoiceItemPricingModel invoice_id?: Prisma.StringWithAggregatesFilter<"SalesInvoiceItem"> | string good_id?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoiceItem"> | string | null service_id?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoiceItem"> | string | null @@ -384,7 +372,6 @@ export type SalesInvoiceItemCreateInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput @@ -400,7 +387,6 @@ export type SalesInvoiceItemUncheckedCreateInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel invoice_id: string good_id?: string | null service_id?: string | null @@ -416,7 +402,6 @@ export type SalesInvoiceItemUpdateInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput @@ -432,7 +417,6 @@ export type SalesInvoiceItemUncheckedUpdateInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel invoice_id?: Prisma.StringFieldUpdateOperationsInput | string good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null @@ -448,7 +432,6 @@ export type SalesInvoiceItemCreateManyInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel invoice_id: string good_id?: string | null service_id?: string | null @@ -464,7 +447,6 @@ export type SalesInvoiceItemUpdateManyMutationInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue } @@ -477,7 +459,6 @@ export type SalesInvoiceItemUncheckedUpdateManyInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel invoice_id?: Prisma.StringFieldUpdateOperationsInput | string good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null @@ -509,7 +490,6 @@ export type SalesInvoiceItemCountOrderByAggregateInput = { created_at?: Prisma.SortOrder discount?: Prisma.SortOrder notes?: Prisma.SortOrder - pricingModel?: Prisma.SortOrder invoice_id?: Prisma.SortOrder good_id?: Prisma.SortOrder service_id?: Prisma.SortOrder @@ -532,7 +512,6 @@ export type SalesInvoiceItemMaxOrderByAggregateInput = { created_at?: Prisma.SortOrder discount?: Prisma.SortOrder notes?: Prisma.SortOrder - pricingModel?: Prisma.SortOrder invoice_id?: Prisma.SortOrder good_id?: Prisma.SortOrder service_id?: Prisma.SortOrder @@ -547,7 +526,6 @@ export type SalesInvoiceItemMinOrderByAggregateInput = { created_at?: Prisma.SortOrder discount?: Prisma.SortOrder notes?: Prisma.SortOrder - pricingModel?: Prisma.SortOrder invoice_id?: Prisma.SortOrder good_id?: Prisma.SortOrder service_id?: Prisma.SortOrder @@ -648,10 +626,6 @@ export type EnumUnitTypeFieldUpdateOperationsInput = { set?: $Enums.UnitType } -export type EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput = { - set?: $Enums.SalesInvoiceItemPricingModel -} - export type SalesInvoiceItemCreateNestedManyWithoutServiceInput = { create?: Prisma.XOR | Prisma.SalesInvoiceItemCreateWithoutServiceInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutServiceInput[] connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutServiceInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutServiceInput[] @@ -703,7 +677,6 @@ export type SalesInvoiceItemCreateWithoutGoodInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput @@ -718,7 +691,6 @@ export type SalesInvoiceItemUncheckedCreateWithoutGoodInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel invoice_id: string service_id?: string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -762,7 +734,6 @@ export type SalesInvoiceItemScalarWhereInput = { created_at?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string discount?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFilter<"SalesInvoiceItem"> | $Enums.SalesInvoiceItemPricingModel invoice_id?: Prisma.StringFilter<"SalesInvoiceItem"> | string good_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null service_id?: Prisma.StringNullableFilter<"SalesInvoiceItem"> | string | null @@ -778,7 +749,6 @@ export type SalesInvoiceItemCreateWithoutInvoiceInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput service?: Prisma.ServiceCreateNestedOneWithoutSales_invoice_itemsInput @@ -793,7 +763,6 @@ export type SalesInvoiceItemUncheckedCreateWithoutInvoiceInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel good_id?: string | null service_id?: string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -834,7 +803,6 @@ export type SalesInvoiceItemCreateWithoutServiceInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput good?: Prisma.GoodCreateNestedOneWithoutSales_invoice_itemsInput @@ -849,7 +817,6 @@ export type SalesInvoiceItemUncheckedCreateWithoutServiceInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel invoice_id: string good_id?: string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -890,7 +857,6 @@ export type SalesInvoiceItemCreateManyGoodInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel invoice_id: string service_id?: string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -905,7 +871,6 @@ export type SalesInvoiceItemUpdateWithoutGoodInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput @@ -920,7 +885,6 @@ export type SalesInvoiceItemUncheckedUpdateWithoutGoodInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel invoice_id?: Prisma.StringFieldUpdateOperationsInput | string service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -935,7 +899,6 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutGoodInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel invoice_id?: Prisma.StringFieldUpdateOperationsInput | string service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -950,7 +913,6 @@ export type SalesInvoiceItemCreateManyInvoiceInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel good_id?: string | null service_id?: string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -965,7 +927,6 @@ export type SalesInvoiceItemUpdateWithoutInvoiceInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput service?: Prisma.ServiceUpdateOneWithoutSales_invoice_itemsNestedInput @@ -980,7 +941,6 @@ export type SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -995,7 +955,6 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null service_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -1010,7 +969,6 @@ export type SalesInvoiceItemCreateManyServiceInput = { created_at?: Date | string discount?: runtime.Decimal | runtime.DecimalJsLike | number | string notes?: string | null - pricingModel?: $Enums.SalesInvoiceItemPricingModel invoice_id: string good_id?: string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -1025,7 +983,6 @@ export type SalesInvoiceItemUpdateWithoutServiceInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput good?: Prisma.GoodUpdateOneWithoutSales_invoice_itemsNestedInput @@ -1040,7 +997,6 @@ export type SalesInvoiceItemUncheckedUpdateWithoutServiceInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel invoice_id?: Prisma.StringFieldUpdateOperationsInput | string good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -1055,7 +1011,6 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutServiceInput = { created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string discount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string notes?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - pricingModel?: Prisma.EnumSalesInvoiceItemPricingModelFieldUpdateOperationsInput | $Enums.SalesInvoiceItemPricingModel invoice_id?: Prisma.StringFieldUpdateOperationsInput | string good_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payload?: Prisma.NullableJsonNullValueInput | runtime.InputJsonValue @@ -1072,7 +1027,6 @@ export type SalesInvoiceItemSelect = runtime.Types.Extensions.GetOmit<"id" | "quantity" | "unit_type" | "unit_price" | "total_amount" | "created_at" | "discount" | "notes" | "pricingModel" | "invoice_id" | "good_id" | "service_id" | "payload", ExtArgs["result"]["salesInvoiceItem"]> +export type SalesInvoiceItemOmit = runtime.Types.Extensions.GetOmit<"id" | "quantity" | "unit_type" | "unit_price" | "total_amount" | "created_at" | "discount" | "notes" | "invoice_id" | "good_id" | "service_id" | "payload", ExtArgs["result"]["salesInvoiceItem"]> export type SalesInvoiceItemInclude = { invoice?: boolean | Prisma.SalesInvoiceDefaultArgs good?: boolean | Prisma.SalesInvoiceItem$goodArgs @@ -1123,7 +1076,6 @@ export type $SalesInvoiceItemPayload readonly discount: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> readonly notes: Prisma.FieldRef<"SalesInvoiceItem", 'String'> - readonly pricingModel: Prisma.FieldRef<"SalesInvoiceItem", 'SalesInvoiceItemPricingModel'> readonly invoice_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'> readonly good_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'> readonly service_id: Prisma.FieldRef<"SalesInvoiceItem", 'String'> diff --git a/src/generated/prisma/models/Token.ts b/src/generated/prisma/models/Token.ts new file mode 100644 index 0000000..c20997f --- /dev/null +++ b/src/generated/prisma/models/Token.ts @@ -0,0 +1,1269 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Token` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Token + * + */ +export type TokenModel = runtime.Types.Result.DefaultSelection + +export type AggregateToken = { + _count: TokenCountAggregateOutputType | null + _min: TokenMinAggregateOutputType | null + _max: TokenMaxAggregateOutputType | null +} + +export type TokenMinAggregateOutputType = { + id: string | null + token: string | null + type: $Enums.TokenType | null + created_at: Date | null + expires_at: Date | null + account_id: string | null +} + +export type TokenMaxAggregateOutputType = { + id: string | null + token: string | null + type: $Enums.TokenType | null + created_at: Date | null + expires_at: Date | null + account_id: string | null +} + +export type TokenCountAggregateOutputType = { + id: number + token: number + type: number + created_at: number + expires_at: number + account_id: number + _all: number +} + + +export type TokenMinAggregateInputType = { + id?: true + token?: true + type?: true + created_at?: true + expires_at?: true + account_id?: true +} + +export type TokenMaxAggregateInputType = { + id?: true + token?: true + type?: true + created_at?: true + expires_at?: true + account_id?: true +} + +export type TokenCountAggregateInputType = { + id?: true + token?: true + type?: true + created_at?: true + expires_at?: true + account_id?: true + _all?: true +} + +export type TokenAggregateArgs = { + /** + * Filter which Token to aggregate. + */ + where?: Prisma.TokenWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Tokens to fetch. + */ + orderBy?: Prisma.TokenOrderByWithRelationInput | Prisma.TokenOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.TokenWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Tokens from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Tokens. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Tokens + **/ + _count?: true | TokenCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: TokenMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: TokenMaxAggregateInputType +} + +export type GetTokenAggregateType = { + [P in keyof T & keyof AggregateToken]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type TokenGroupByArgs = { + where?: Prisma.TokenWhereInput + orderBy?: Prisma.TokenOrderByWithAggregationInput | Prisma.TokenOrderByWithAggregationInput[] + by: Prisma.TokenScalarFieldEnum[] | Prisma.TokenScalarFieldEnum + having?: Prisma.TokenScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: TokenCountAggregateInputType | true + _min?: TokenMinAggregateInputType + _max?: TokenMaxAggregateInputType +} + +export type TokenGroupByOutputType = { + id: string + token: string + type: $Enums.TokenType + created_at: Date + expires_at: Date + account_id: string + _count: TokenCountAggregateOutputType | null + _min: TokenMinAggregateOutputType | null + _max: TokenMaxAggregateOutputType | null +} + +type GetTokenGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof TokenGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type TokenWhereInput = { + AND?: Prisma.TokenWhereInput | Prisma.TokenWhereInput[] + OR?: Prisma.TokenWhereInput[] + NOT?: Prisma.TokenWhereInput | Prisma.TokenWhereInput[] + id?: Prisma.StringFilter<"Token"> | string + token?: Prisma.StringFilter<"Token"> | string + type?: Prisma.EnumTokenTypeFilter<"Token"> | $Enums.TokenType + created_at?: Prisma.DateTimeFilter<"Token"> | Date | string + expires_at?: Prisma.DateTimeFilter<"Token"> | Date | string + account_id?: Prisma.StringFilter<"Token"> | string + account?: Prisma.XOR +} + +export type TokenOrderByWithRelationInput = { + id?: Prisma.SortOrder + token?: Prisma.SortOrder + type?: Prisma.SortOrder + created_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + account_id?: Prisma.SortOrder + account?: Prisma.AccountOrderByWithRelationInput + _relevance?: Prisma.TokenOrderByRelevanceInput +} + +export type TokenWhereUniqueInput = Prisma.AtLeast<{ + id?: string + token?: string + type_account_id?: Prisma.TokenTypeAccount_idCompoundUniqueInput + AND?: Prisma.TokenWhereInput | Prisma.TokenWhereInput[] + OR?: Prisma.TokenWhereInput[] + NOT?: Prisma.TokenWhereInput | Prisma.TokenWhereInput[] + type?: Prisma.EnumTokenTypeFilter<"Token"> | $Enums.TokenType + created_at?: Prisma.DateTimeFilter<"Token"> | Date | string + expires_at?: Prisma.DateTimeFilter<"Token"> | Date | string + account_id?: Prisma.StringFilter<"Token"> | string + account?: Prisma.XOR +}, "id" | "token" | "type_account_id"> + +export type TokenOrderByWithAggregationInput = { + id?: Prisma.SortOrder + token?: Prisma.SortOrder + type?: Prisma.SortOrder + created_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + account_id?: Prisma.SortOrder + _count?: Prisma.TokenCountOrderByAggregateInput + _max?: Prisma.TokenMaxOrderByAggregateInput + _min?: Prisma.TokenMinOrderByAggregateInput +} + +export type TokenScalarWhereWithAggregatesInput = { + AND?: Prisma.TokenScalarWhereWithAggregatesInput | Prisma.TokenScalarWhereWithAggregatesInput[] + OR?: Prisma.TokenScalarWhereWithAggregatesInput[] + NOT?: Prisma.TokenScalarWhereWithAggregatesInput | Prisma.TokenScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Token"> | string + token?: Prisma.StringWithAggregatesFilter<"Token"> | string + type?: Prisma.EnumTokenTypeWithAggregatesFilter<"Token"> | $Enums.TokenType + created_at?: Prisma.DateTimeWithAggregatesFilter<"Token"> | Date | string + expires_at?: Prisma.DateTimeWithAggregatesFilter<"Token"> | Date | string + account_id?: Prisma.StringWithAggregatesFilter<"Token"> | string +} + +export type TokenCreateInput = { + id?: string + token: string + type: $Enums.TokenType + created_at?: Date | string + expires_at: Date | string + account: Prisma.AccountCreateNestedOneWithoutTokensInput +} + +export type TokenUncheckedCreateInput = { + id?: string + token: string + type: $Enums.TokenType + created_at?: Date | string + expires_at: Date | string + account_id: string +} + +export type TokenUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + token?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumTokenTypeFieldUpdateOperationsInput | $Enums.TokenType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account?: Prisma.AccountUpdateOneRequiredWithoutTokensNestedInput +} + +export type TokenUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + token?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumTokenTypeFieldUpdateOperationsInput | $Enums.TokenType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type TokenCreateManyInput = { + id?: string + token: string + type: $Enums.TokenType + created_at?: Date | string + expires_at: Date | string + account_id: string +} + +export type TokenUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + token?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumTokenTypeFieldUpdateOperationsInput | $Enums.TokenType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type TokenUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + token?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumTokenTypeFieldUpdateOperationsInput | $Enums.TokenType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type TokenOrderByRelevanceInput = { + fields: Prisma.TokenOrderByRelevanceFieldEnum | Prisma.TokenOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type TokenTypeAccount_idCompoundUniqueInput = { + type: $Enums.TokenType + account_id: string +} + +export type TokenCountOrderByAggregateInput = { + id?: Prisma.SortOrder + token?: Prisma.SortOrder + type?: Prisma.SortOrder + created_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + account_id?: Prisma.SortOrder +} + +export type TokenMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + token?: Prisma.SortOrder + type?: Prisma.SortOrder + created_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + account_id?: Prisma.SortOrder +} + +export type TokenMinOrderByAggregateInput = { + id?: Prisma.SortOrder + token?: Prisma.SortOrder + type?: Prisma.SortOrder + created_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + account_id?: Prisma.SortOrder +} + +export type TokenListRelationFilter = { + every?: Prisma.TokenWhereInput + some?: Prisma.TokenWhereInput + none?: Prisma.TokenWhereInput +} + +export type TokenOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type EnumTokenTypeFieldUpdateOperationsInput = { + set?: $Enums.TokenType +} + +export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string +} + +export type TokenCreateNestedManyWithoutAccountInput = { + create?: Prisma.XOR | Prisma.TokenCreateWithoutAccountInput[] | Prisma.TokenUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.TokenCreateOrConnectWithoutAccountInput | Prisma.TokenCreateOrConnectWithoutAccountInput[] + createMany?: Prisma.TokenCreateManyAccountInputEnvelope + connect?: Prisma.TokenWhereUniqueInput | Prisma.TokenWhereUniqueInput[] +} + +export type TokenUncheckedCreateNestedManyWithoutAccountInput = { + create?: Prisma.XOR | Prisma.TokenCreateWithoutAccountInput[] | Prisma.TokenUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.TokenCreateOrConnectWithoutAccountInput | Prisma.TokenCreateOrConnectWithoutAccountInput[] + createMany?: Prisma.TokenCreateManyAccountInputEnvelope + connect?: Prisma.TokenWhereUniqueInput | Prisma.TokenWhereUniqueInput[] +} + +export type TokenUpdateManyWithoutAccountNestedInput = { + create?: Prisma.XOR | Prisma.TokenCreateWithoutAccountInput[] | Prisma.TokenUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.TokenCreateOrConnectWithoutAccountInput | Prisma.TokenCreateOrConnectWithoutAccountInput[] + upsert?: Prisma.TokenUpsertWithWhereUniqueWithoutAccountInput | Prisma.TokenUpsertWithWhereUniqueWithoutAccountInput[] + createMany?: Prisma.TokenCreateManyAccountInputEnvelope + set?: Prisma.TokenWhereUniqueInput | Prisma.TokenWhereUniqueInput[] + disconnect?: Prisma.TokenWhereUniqueInput | Prisma.TokenWhereUniqueInput[] + delete?: Prisma.TokenWhereUniqueInput | Prisma.TokenWhereUniqueInput[] + connect?: Prisma.TokenWhereUniqueInput | Prisma.TokenWhereUniqueInput[] + update?: Prisma.TokenUpdateWithWhereUniqueWithoutAccountInput | Prisma.TokenUpdateWithWhereUniqueWithoutAccountInput[] + updateMany?: Prisma.TokenUpdateManyWithWhereWithoutAccountInput | Prisma.TokenUpdateManyWithWhereWithoutAccountInput[] + deleteMany?: Prisma.TokenScalarWhereInput | Prisma.TokenScalarWhereInput[] +} + +export type TokenUncheckedUpdateManyWithoutAccountNestedInput = { + create?: Prisma.XOR | Prisma.TokenCreateWithoutAccountInput[] | Prisma.TokenUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.TokenCreateOrConnectWithoutAccountInput | Prisma.TokenCreateOrConnectWithoutAccountInput[] + upsert?: Prisma.TokenUpsertWithWhereUniqueWithoutAccountInput | Prisma.TokenUpsertWithWhereUniqueWithoutAccountInput[] + createMany?: Prisma.TokenCreateManyAccountInputEnvelope + set?: Prisma.TokenWhereUniqueInput | Prisma.TokenWhereUniqueInput[] + disconnect?: Prisma.TokenWhereUniqueInput | Prisma.TokenWhereUniqueInput[] + delete?: Prisma.TokenWhereUniqueInput | Prisma.TokenWhereUniqueInput[] + connect?: Prisma.TokenWhereUniqueInput | Prisma.TokenWhereUniqueInput[] + update?: Prisma.TokenUpdateWithWhereUniqueWithoutAccountInput | Prisma.TokenUpdateWithWhereUniqueWithoutAccountInput[] + updateMany?: Prisma.TokenUpdateManyWithWhereWithoutAccountInput | Prisma.TokenUpdateManyWithWhereWithoutAccountInput[] + deleteMany?: Prisma.TokenScalarWhereInput | Prisma.TokenScalarWhereInput[] +} + +export type TokenCreateWithoutAccountInput = { + id?: string + token: string + type: $Enums.TokenType + created_at?: Date | string + expires_at: Date | string +} + +export type TokenUncheckedCreateWithoutAccountInput = { + id?: string + token: string + type: $Enums.TokenType + created_at?: Date | string + expires_at: Date | string +} + +export type TokenCreateOrConnectWithoutAccountInput = { + where: Prisma.TokenWhereUniqueInput + create: Prisma.XOR +} + +export type TokenCreateManyAccountInputEnvelope = { + data: Prisma.TokenCreateManyAccountInput | Prisma.TokenCreateManyAccountInput[] + skipDuplicates?: boolean +} + +export type TokenUpsertWithWhereUniqueWithoutAccountInput = { + where: Prisma.TokenWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type TokenUpdateWithWhereUniqueWithoutAccountInput = { + where: Prisma.TokenWhereUniqueInput + data: Prisma.XOR +} + +export type TokenUpdateManyWithWhereWithoutAccountInput = { + where: Prisma.TokenScalarWhereInput + data: Prisma.XOR +} + +export type TokenScalarWhereInput = { + AND?: Prisma.TokenScalarWhereInput | Prisma.TokenScalarWhereInput[] + OR?: Prisma.TokenScalarWhereInput[] + NOT?: Prisma.TokenScalarWhereInput | Prisma.TokenScalarWhereInput[] + id?: Prisma.StringFilter<"Token"> | string + token?: Prisma.StringFilter<"Token"> | string + type?: Prisma.EnumTokenTypeFilter<"Token"> | $Enums.TokenType + created_at?: Prisma.DateTimeFilter<"Token"> | Date | string + expires_at?: Prisma.DateTimeFilter<"Token"> | Date | string + account_id?: Prisma.StringFilter<"Token"> | string +} + +export type TokenCreateManyAccountInput = { + id?: string + token: string + type: $Enums.TokenType + created_at?: Date | string + expires_at: Date | string +} + +export type TokenUpdateWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + token?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumTokenTypeFieldUpdateOperationsInput | $Enums.TokenType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type TokenUncheckedUpdateWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + token?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumTokenTypeFieldUpdateOperationsInput | $Enums.TokenType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type TokenUncheckedUpdateManyWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + token?: Prisma.StringFieldUpdateOperationsInput | string + type?: Prisma.EnumTokenTypeFieldUpdateOperationsInput | $Enums.TokenType + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + + +export type TokenSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + token?: boolean + type?: boolean + created_at?: boolean + expires_at?: boolean + account_id?: boolean + account?: boolean | Prisma.AccountDefaultArgs +}, ExtArgs["result"]["token"]> + + + +export type TokenSelectScalar = { + id?: boolean + token?: boolean + type?: boolean + created_at?: boolean + expires_at?: boolean + account_id?: boolean +} + +export type TokenOmit = runtime.Types.Extensions.GetOmit<"id" | "token" | "type" | "created_at" | "expires_at" | "account_id", ExtArgs["result"]["token"]> +export type TokenInclude = { + account?: boolean | Prisma.AccountDefaultArgs +} + +export type $TokenPayload = { + name: "Token" + objects: { + account: Prisma.$AccountPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + token: string + type: $Enums.TokenType + created_at: Date + expires_at: Date + account_id: string + }, ExtArgs["result"]["token"]> + composites: {} +} + +export type TokenGetPayload = runtime.Types.Result.GetResult + +export type TokenCountArgs = + Omit & { + select?: TokenCountAggregateInputType | true + } + +export interface TokenDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Token'], meta: { name: 'Token' } } + /** + * Find zero or one Token that matches the filter. + * @param {TokenFindUniqueArgs} args - Arguments to find a Token + * @example + * // Get one Token + * const token = await prisma.token.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__TokenClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Token that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {TokenFindUniqueOrThrowArgs} args - Arguments to find a Token + * @example + * // Get one Token + * const token = await prisma.token.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__TokenClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Token that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TokenFindFirstArgs} args - Arguments to find a Token + * @example + * // Get one Token + * const token = await prisma.token.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__TokenClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Token that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TokenFindFirstOrThrowArgs} args - Arguments to find a Token + * @example + * // Get one Token + * const token = await prisma.token.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__TokenClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Tokens that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TokenFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Tokens + * const tokens = await prisma.token.findMany() + * + * // Get first 10 Tokens + * const tokens = await prisma.token.findMany({ take: 10 }) + * + * // Only select the `id` + * const tokenWithIdOnly = await prisma.token.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Token. + * @param {TokenCreateArgs} args - Arguments to create a Token. + * @example + * // Create one Token + * const Token = await prisma.token.create({ + * data: { + * // ... data to create a Token + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__TokenClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Tokens. + * @param {TokenCreateManyArgs} args - Arguments to create many Tokens. + * @example + * // Create many Tokens + * const token = await prisma.token.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a Token. + * @param {TokenDeleteArgs} args - Arguments to delete one Token. + * @example + * // Delete one Token + * const Token = await prisma.token.delete({ + * where: { + * // ... filter to delete one Token + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__TokenClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Token. + * @param {TokenUpdateArgs} args - Arguments to update one Token. + * @example + * // Update one Token + * const token = await prisma.token.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__TokenClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Tokens. + * @param {TokenDeleteManyArgs} args - Arguments to filter Tokens to delete. + * @example + * // Delete a few Tokens + * const { count } = await prisma.token.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Tokens. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TokenUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Tokens + * const token = await prisma.token.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Token. + * @param {TokenUpsertArgs} args - Arguments to update or create a Token. + * @example + * // Update or create a Token + * const token = await prisma.token.upsert({ + * create: { + * // ... data to create a Token + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Token we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__TokenClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Tokens. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TokenCountArgs} args - Arguments to filter Tokens to count. + * @example + * // Count the number of Tokens + * const count = await prisma.token.count({ + * where: { + * // ... the filter for the Tokens we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Token. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TokenAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Token. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TokenGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends TokenGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: TokenGroupByArgs['orderBy'] } + : { orderBy?: TokenGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetTokenGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Token model + */ +readonly fields: TokenFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Token. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__TokenClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + account = {}>(args?: Prisma.Subset>): Prisma.Prisma__AccountClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Token model + */ +export interface TokenFieldRefs { + readonly id: Prisma.FieldRef<"Token", 'String'> + readonly token: Prisma.FieldRef<"Token", 'String'> + readonly type: Prisma.FieldRef<"Token", 'TokenType'> + readonly created_at: Prisma.FieldRef<"Token", 'DateTime'> + readonly expires_at: Prisma.FieldRef<"Token", 'DateTime'> + readonly account_id: Prisma.FieldRef<"Token", 'String'> +} + + +// Custom InputTypes +/** + * Token findUnique + */ +export type TokenFindUniqueArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null + /** + * Filter, which Token to fetch. + */ + where: Prisma.TokenWhereUniqueInput +} + +/** + * Token findUniqueOrThrow + */ +export type TokenFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null + /** + * Filter, which Token to fetch. + */ + where: Prisma.TokenWhereUniqueInput +} + +/** + * Token findFirst + */ +export type TokenFindFirstArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null + /** + * Filter, which Token to fetch. + */ + where?: Prisma.TokenWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Tokens to fetch. + */ + orderBy?: Prisma.TokenOrderByWithRelationInput | Prisma.TokenOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Tokens. + */ + cursor?: Prisma.TokenWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Tokens from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Tokens. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Tokens. + */ + distinct?: Prisma.TokenScalarFieldEnum | Prisma.TokenScalarFieldEnum[] +} + +/** + * Token findFirstOrThrow + */ +export type TokenFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null + /** + * Filter, which Token to fetch. + */ + where?: Prisma.TokenWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Tokens to fetch. + */ + orderBy?: Prisma.TokenOrderByWithRelationInput | Prisma.TokenOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Tokens. + */ + cursor?: Prisma.TokenWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Tokens from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Tokens. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Tokens. + */ + distinct?: Prisma.TokenScalarFieldEnum | Prisma.TokenScalarFieldEnum[] +} + +/** + * Token findMany + */ +export type TokenFindManyArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null + /** + * Filter, which Tokens to fetch. + */ + where?: Prisma.TokenWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Tokens to fetch. + */ + orderBy?: Prisma.TokenOrderByWithRelationInput | Prisma.TokenOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Tokens. + */ + cursor?: Prisma.TokenWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Tokens from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Tokens. + */ + skip?: number + distinct?: Prisma.TokenScalarFieldEnum | Prisma.TokenScalarFieldEnum[] +} + +/** + * Token create + */ +export type TokenCreateArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null + /** + * The data needed to create a Token. + */ + data: Prisma.XOR +} + +/** + * Token createMany + */ +export type TokenCreateManyArgs = { + /** + * The data used to create many Tokens. + */ + data: Prisma.TokenCreateManyInput | Prisma.TokenCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Token update + */ +export type TokenUpdateArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null + /** + * The data needed to update a Token. + */ + data: Prisma.XOR + /** + * Choose, which Token to update. + */ + where: Prisma.TokenWhereUniqueInput +} + +/** + * Token updateMany + */ +export type TokenUpdateManyArgs = { + /** + * The data used to update Tokens. + */ + data: Prisma.XOR + /** + * Filter which Tokens to update + */ + where?: Prisma.TokenWhereInput + /** + * Limit how many Tokens to update. + */ + limit?: number +} + +/** + * Token upsert + */ +export type TokenUpsertArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null + /** + * The filter to search for the Token to update in case it exists. + */ + where: Prisma.TokenWhereUniqueInput + /** + * In case the Token found by the `where` argument doesn't exist, create a new Token with this data. + */ + create: Prisma.XOR + /** + * In case the Token was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Token delete + */ +export type TokenDeleteArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null + /** + * Filter which Token to delete. + */ + where: Prisma.TokenWhereUniqueInput +} + +/** + * Token deleteMany + */ +export type TokenDeleteManyArgs = { + /** + * Filter which Tokens to delete + */ + where?: Prisma.TokenWhereInput + /** + * Limit how many Tokens to delete. + */ + limit?: number +} + +/** + * Token without action + */ +export type TokenDefaultArgs = { + /** + * Select specific fields to fetch from the Token + */ + select?: Prisma.TokenSelect | null + /** + * Omit specific fields from the Token + */ + omit?: Prisma.TokenOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.TokenInclude | null +} diff --git a/src/generated/prisma/models/User.ts b/src/generated/prisma/models/User.ts new file mode 100644 index 0000000..fd46d44 --- /dev/null +++ b/src/generated/prisma/models/User.ts @@ -0,0 +1,1362 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `User` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model User + * + */ +export type UserModel = runtime.Types.Result.DefaultSelection + +export type AggregateUser = { + _count: UserCountAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +export type UserMinAggregateOutputType = { + id: string | null + created_at: Date | null + mobile_number: string | null + national_code: string | null + first_name: string | null + last_name: string | null +} + +export type UserMaxAggregateOutputType = { + id: string | null + created_at: Date | null + mobile_number: string | null + national_code: string | null + first_name: string | null + last_name: string | null +} + +export type UserCountAggregateOutputType = { + id: number + created_at: number + mobile_number: number + national_code: number + first_name: number + last_name: number + _all: number +} + + +export type UserMinAggregateInputType = { + id?: true + created_at?: true + mobile_number?: true + national_code?: true + first_name?: true + last_name?: true +} + +export type UserMaxAggregateInputType = { + id?: true + created_at?: true + mobile_number?: true + national_code?: true + first_name?: true + last_name?: true +} + +export type UserCountAggregateInputType = { + id?: true + created_at?: true + mobile_number?: true + national_code?: true + first_name?: true + last_name?: true + _all?: true +} + +export type UserAggregateArgs = { + /** + * Filter which User to aggregate. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Users + **/ + _count?: true | UserCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UserMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UserMaxAggregateInputType +} + +export type GetUserAggregateType = { + [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type UserGroupByArgs = { + where?: Prisma.UserWhereInput + orderBy?: Prisma.UserOrderByWithAggregationInput | Prisma.UserOrderByWithAggregationInput[] + by: Prisma.UserScalarFieldEnum[] | Prisma.UserScalarFieldEnum + having?: Prisma.UserScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserCountAggregateInputType | true + _min?: UserMinAggregateInputType + _max?: UserMaxAggregateInputType +} + +export type UserGroupByOutputType = { + id: string + created_at: Date + mobile_number: string + national_code: string | null + first_name: string + last_name: string + _count: UserCountAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +type GetUserGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type UserWhereInput = { + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + id?: Prisma.StringFilter<"User"> | string + created_at?: Prisma.DateTimeFilter<"User"> | Date | string + mobile_number?: Prisma.StringFilter<"User"> | string + national_code?: Prisma.StringNullableFilter<"User"> | string | null + first_name?: Prisma.StringFilter<"User"> | string + last_name?: Prisma.StringFilter<"User"> | string + accounts?: Prisma.AccountListRelationFilter + businessActivities?: Prisma.BusinessActivityListRelationFilter +} + +export type UserOrderByWithRelationInput = { + id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + mobile_number?: Prisma.SortOrder + national_code?: Prisma.SortOrderInput | Prisma.SortOrder + first_name?: Prisma.SortOrder + last_name?: Prisma.SortOrder + accounts?: Prisma.AccountOrderByRelationAggregateInput + businessActivities?: Prisma.BusinessActivityOrderByRelationAggregateInput + _relevance?: Prisma.UserOrderByRelevanceInput +} + +export type UserWhereUniqueInput = Prisma.AtLeast<{ + id?: string + mobile_number?: string + national_code?: string + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + created_at?: Prisma.DateTimeFilter<"User"> | Date | string + first_name?: Prisma.StringFilter<"User"> | string + last_name?: Prisma.StringFilter<"User"> | string + accounts?: Prisma.AccountListRelationFilter + businessActivities?: Prisma.BusinessActivityListRelationFilter +}, "id" | "mobile_number" | "national_code"> + +export type UserOrderByWithAggregationInput = { + id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + mobile_number?: Prisma.SortOrder + national_code?: Prisma.SortOrderInput | Prisma.SortOrder + first_name?: Prisma.SortOrder + last_name?: Prisma.SortOrder + _count?: Prisma.UserCountOrderByAggregateInput + _max?: Prisma.UserMaxOrderByAggregateInput + _min?: Prisma.UserMinOrderByAggregateInput +} + +export type UserScalarWhereWithAggregatesInput = { + AND?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + OR?: Prisma.UserScalarWhereWithAggregatesInput[] + NOT?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"User"> | string + created_at?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string + mobile_number?: Prisma.StringWithAggregatesFilter<"User"> | string + national_code?: Prisma.StringNullableWithAggregatesFilter<"User"> | string | null + first_name?: Prisma.StringWithAggregatesFilter<"User"> | string + last_name?: Prisma.StringWithAggregatesFilter<"User"> | string +} + +export type UserCreateInput = { + id?: string + created_at?: Date | string + mobile_number: string + national_code?: string | null + first_name: string + last_name: string + accounts?: Prisma.AccountCreateNestedManyWithoutUserInput + businessActivities?: Prisma.BusinessActivityCreateNestedManyWithoutUserInput +} + +export type UserUncheckedCreateInput = { + id?: string + created_at?: Date | string + mobile_number: string + national_code?: string | null + first_name: string + last_name: string + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutUserInput + businessActivities?: Prisma.BusinessActivityUncheckedCreateNestedManyWithoutUserInput +} + +export type UserUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string + national_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + accounts?: Prisma.AccountUpdateManyWithoutUserNestedInput + businessActivities?: Prisma.BusinessActivityUpdateManyWithoutUserNestedInput +} + +export type UserUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string + national_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + accounts?: Prisma.AccountUncheckedUpdateManyWithoutUserNestedInput + businessActivities?: Prisma.BusinessActivityUncheckedUpdateManyWithoutUserNestedInput +} + +export type UserCreateManyInput = { + id?: string + created_at?: Date | string + mobile_number: string + national_code?: string | null + first_name: string + last_name: string +} + +export type UserUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string + national_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type UserUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string + national_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type UserScalarRelationFilter = { + is?: Prisma.UserWhereInput + isNot?: Prisma.UserWhereInput +} + +export type UserOrderByRelevanceInput = { + fields: Prisma.UserOrderByRelevanceFieldEnum | Prisma.UserOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type UserCountOrderByAggregateInput = { + id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + mobile_number?: Prisma.SortOrder + national_code?: Prisma.SortOrder + first_name?: Prisma.SortOrder + last_name?: Prisma.SortOrder +} + +export type UserMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + mobile_number?: Prisma.SortOrder + national_code?: Prisma.SortOrder + first_name?: Prisma.SortOrder + last_name?: Prisma.SortOrder +} + +export type UserMinOrderByAggregateInput = { + id?: Prisma.SortOrder + created_at?: Prisma.SortOrder + mobile_number?: Prisma.SortOrder + national_code?: Prisma.SortOrder + first_name?: Prisma.SortOrder + last_name?: Prisma.SortOrder +} + +export type UserCreateNestedOneWithoutBusinessActivitiesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutBusinessActivitiesInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneRequiredWithoutBusinessActivitiesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutBusinessActivitiesInput + upsert?: Prisma.UserUpsertWithoutBusinessActivitiesInput + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutBusinessActivitiesInput> +} + +export type UserCreateNestedOneWithoutAccountsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutAccountsInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneRequiredWithoutAccountsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutAccountsInput + upsert?: Prisma.UserUpsertWithoutAccountsInput + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutAccountsInput> +} + +export type UserCreateWithoutBusinessActivitiesInput = { + id?: string + created_at?: Date | string + mobile_number: string + national_code?: string | null + first_name: string + last_name: string + accounts?: Prisma.AccountCreateNestedManyWithoutUserInput +} + +export type UserUncheckedCreateWithoutBusinessActivitiesInput = { + id?: string + created_at?: Date | string + mobile_number: string + national_code?: string | null + first_name: string + last_name: string + accounts?: Prisma.AccountUncheckedCreateNestedManyWithoutUserInput +} + +export type UserCreateOrConnectWithoutBusinessActivitiesInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutBusinessActivitiesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutBusinessActivitiesInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutBusinessActivitiesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string + national_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + accounts?: Prisma.AccountUpdateManyWithoutUserNestedInput +} + +export type UserUncheckedUpdateWithoutBusinessActivitiesInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string + national_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + accounts?: Prisma.AccountUncheckedUpdateManyWithoutUserNestedInput +} + +export type UserCreateWithoutAccountsInput = { + id?: string + created_at?: Date | string + mobile_number: string + national_code?: string | null + first_name: string + last_name: string + businessActivities?: Prisma.BusinessActivityCreateNestedManyWithoutUserInput +} + +export type UserUncheckedCreateWithoutAccountsInput = { + id?: string + created_at?: Date | string + mobile_number: string + national_code?: string | null + first_name: string + last_name: string + businessActivities?: Prisma.BusinessActivityUncheckedCreateNestedManyWithoutUserInput +} + +export type UserCreateOrConnectWithoutAccountsInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutAccountsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutAccountsInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutAccountsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string + national_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + businessActivities?: Prisma.BusinessActivityUpdateManyWithoutUserNestedInput +} + +export type UserUncheckedUpdateWithoutAccountsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + mobile_number?: Prisma.StringFieldUpdateOperationsInput | string + national_code?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + businessActivities?: Prisma.BusinessActivityUncheckedUpdateManyWithoutUserNestedInput +} + + +/** + * Count Type UserCountOutputType + */ + +export type UserCountOutputType = { + accounts: number + businessActivities: number +} + +export type UserCountOutputTypeSelect = { + accounts?: boolean | UserCountOutputTypeCountAccountsArgs + businessActivities?: boolean | UserCountOutputTypeCountBusinessActivitiesArgs +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + */ + select?: Prisma.UserCountOutputTypeSelect | null +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeCountAccountsArgs = { + where?: Prisma.AccountWhereInput +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeCountBusinessActivitiesArgs = { + where?: Prisma.BusinessActivityWhereInput +} + + +export type UserSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + created_at?: boolean + mobile_number?: boolean + national_code?: boolean + first_name?: boolean + last_name?: boolean + accounts?: boolean | Prisma.User$accountsArgs + businessActivities?: boolean | Prisma.User$businessActivitiesArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +}, ExtArgs["result"]["user"]> + + + +export type UserSelectScalar = { + id?: boolean + created_at?: boolean + mobile_number?: boolean + national_code?: boolean + first_name?: boolean + last_name?: boolean +} + +export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "created_at" | "mobile_number" | "national_code" | "first_name" | "last_name", ExtArgs["result"]["user"]> +export type UserInclude = { + accounts?: boolean | Prisma.User$accountsArgs + businessActivities?: boolean | Prisma.User$businessActivitiesArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +} + +export type $UserPayload = { + name: "User" + objects: { + accounts: Prisma.$AccountPayload[] + businessActivities: Prisma.$BusinessActivityPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + created_at: Date + mobile_number: string + national_code: string | null + first_name: string + last_name: string + }, ExtArgs["result"]["user"]> + composites: {} +} + +export type UserGetPayload = runtime.Types.Result.GetResult + +export type UserCountArgs = + Omit & { + select?: UserCountAggregateInputType | true + } + +export interface UserDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } + /** + * Find zero or one User that matches the filter. + * @param {UserFindUniqueArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one User that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserFindFirstArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserFindFirstOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Users that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Users + * const users = await prisma.user.findMany() + * + * // Get first 10 Users + * const users = await prisma.user.findMany({ take: 10 }) + * + * // Only select the `id` + * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a User. + * @param {UserCreateArgs} args - Arguments to create a User. + * @example + * // Create one User + * const User = await prisma.user.create({ + * data: { + * // ... data to create a User + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Users. + * @param {UserCreateManyArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a User. + * @param {UserDeleteArgs} args - Arguments to delete one User. + * @example + * // Delete one User + * const User = await prisma.user.delete({ + * where: { + * // ... filter to delete one User + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one User. + * @param {UserUpdateArgs} args - Arguments to update one User. + * @example + * // Update one User + * const user = await prisma.user.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Users. + * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. + * @example + * // Delete a few Users + * const { count } = await prisma.user.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Users + * const user = await prisma.user.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one User. + * @param {UserUpsertArgs} args - Arguments to update or create a User. + * @example + * // Update or create a User + * const user = await prisma.user.upsert({ + * create: { + * // ... data to create a User + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the User we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserCountArgs} args - Arguments to filter Users to count. + * @example + * // Count the number of Users + * const count = await prisma.user.count({ + * where: { + * // ... the filter for the Users we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends UserGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: UserGroupByArgs['orderBy'] } + : { orderBy?: UserGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetUserGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the User model + */ +readonly fields: UserFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for User. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__UserClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + accounts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + businessActivities = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the User model + */ +export interface UserFieldRefs { + readonly id: Prisma.FieldRef<"User", 'String'> + readonly created_at: Prisma.FieldRef<"User", 'DateTime'> + readonly mobile_number: Prisma.FieldRef<"User", 'String'> + readonly national_code: Prisma.FieldRef<"User", 'String'> + readonly first_name: Prisma.FieldRef<"User", 'String'> + readonly last_name: Prisma.FieldRef<"User", 'String'> +} + + +// Custom InputTypes +/** + * User findUnique + */ +export type UserFindUniqueArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findUniqueOrThrow + */ +export type UserFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findFirst + */ +export type UserFindFirstArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findFirstOrThrow + */ +export type UserFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findMany + */ +export type UserFindManyArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which Users to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Users. + */ + skip?: number + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User create + */ +export type UserCreateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to create a User. + */ + data: Prisma.XOR +} + +/** + * User createMany + */ +export type UserCreateManyArgs = { + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User update + */ +export type UserUpdateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to update a User. + */ + data: Prisma.XOR + /** + * Choose, which User to update. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User updateMany + */ +export type UserUpdateManyArgs = { + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User upsert + */ +export type UserUpsertArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The filter to search for the User to update in case it exists. + */ + where: Prisma.UserWhereUniqueInput + /** + * In case the User found by the `where` argument doesn't exist, create a new User with this data. + */ + create: Prisma.XOR + /** + * In case the User was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * User delete + */ +export type UserDeleteArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter which User to delete. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User deleteMany + */ +export type UserDeleteManyArgs = { + /** + * Filter which Users to delete + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to delete. + */ + limit?: number +} + +/** + * User.accounts + */ +export type User$accountsArgs = { + /** + * Select specific fields to fetch from the Account + */ + select?: Prisma.AccountSelect | null + /** + * Omit specific fields from the Account + */ + omit?: Prisma.AccountOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.AccountInclude | null + where?: Prisma.AccountWhereInput + orderBy?: Prisma.AccountOrderByWithRelationInput | Prisma.AccountOrderByWithRelationInput[] + cursor?: Prisma.AccountWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.AccountScalarFieldEnum | Prisma.AccountScalarFieldEnum[] +} + +/** + * User.businessActivities + */ +export type User$businessActivitiesArgs = { + /** + * Select specific fields to fetch from the BusinessActivity + */ + select?: Prisma.BusinessActivitySelect | null + /** + * Omit specific fields from the BusinessActivity + */ + omit?: Prisma.BusinessActivityOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.BusinessActivityInclude | null + where?: Prisma.BusinessActivityWhereInput + orderBy?: Prisma.BusinessActivityOrderByWithRelationInput | Prisma.BusinessActivityOrderByWithRelationInput[] + cursor?: Prisma.BusinessActivityWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.BusinessActivityScalarFieldEnum | Prisma.BusinessActivityScalarFieldEnum[] +} + +/** + * User without action + */ +export type UserDefaultArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null +} diff --git a/src/generated/prisma/models/UserDevices.ts b/src/generated/prisma/models/UserDevices.ts new file mode 100644 index 0000000..ea1ae59 --- /dev/null +++ b/src/generated/prisma/models/UserDevices.ts @@ -0,0 +1,1246 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `UserDevices` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model UserDevices + * + */ +export type UserDevicesModel = runtime.Types.Result.DefaultSelection + +export type AggregateUserDevices = { + _count: UserDevicesCountAggregateOutputType | null + _min: UserDevicesMinAggregateOutputType | null + _max: UserDevicesMaxAggregateOutputType | null +} + +export type UserDevicesMinAggregateOutputType = { + account_id: string | null + app_version: string | null + build_number: string | null + uuid: string | null + platform: string | null + brand: string | null + model: string | null + device: string | null + os_version: string | null + sdk_version: string | null + release_number: string | null + browser_name: string | null + fcm_token: string | null +} + +export type UserDevicesMaxAggregateOutputType = { + account_id: string | null + app_version: string | null + build_number: string | null + uuid: string | null + platform: string | null + brand: string | null + model: string | null + device: string | null + os_version: string | null + sdk_version: string | null + release_number: string | null + browser_name: string | null + fcm_token: string | null +} + +export type UserDevicesCountAggregateOutputType = { + account_id: number + app_version: number + build_number: number + uuid: number + platform: number + brand: number + model: number + device: number + os_version: number + sdk_version: number + release_number: number + browser_name: number + fcm_token: number + _all: number +} + + +export type UserDevicesMinAggregateInputType = { + account_id?: true + app_version?: true + build_number?: true + uuid?: true + platform?: true + brand?: true + model?: true + device?: true + os_version?: true + sdk_version?: true + release_number?: true + browser_name?: true + fcm_token?: true +} + +export type UserDevicesMaxAggregateInputType = { + account_id?: true + app_version?: true + build_number?: true + uuid?: true + platform?: true + brand?: true + model?: true + device?: true + os_version?: true + sdk_version?: true + release_number?: true + browser_name?: true + fcm_token?: true +} + +export type UserDevicesCountAggregateInputType = { + account_id?: true + app_version?: true + build_number?: true + uuid?: true + platform?: true + brand?: true + model?: true + device?: true + os_version?: true + sdk_version?: true + release_number?: true + browser_name?: true + fcm_token?: true + _all?: true +} + +export type UserDevicesAggregateArgs = { + /** + * Filter which UserDevices to aggregate. + */ + where?: Prisma.UserDevicesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserDevices to fetch. + */ + orderBy?: Prisma.UserDevicesOrderByWithRelationInput | Prisma.UserDevicesOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.UserDevicesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserDevices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` UserDevices. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned UserDevices + **/ + _count?: true | UserDevicesCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UserDevicesMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UserDevicesMaxAggregateInputType +} + +export type GetUserDevicesAggregateType = { + [P in keyof T & keyof AggregateUserDevices]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type UserDevicesGroupByArgs = { + where?: Prisma.UserDevicesWhereInput + orderBy?: Prisma.UserDevicesOrderByWithAggregationInput | Prisma.UserDevicesOrderByWithAggregationInput[] + by: Prisma.UserDevicesScalarFieldEnum[] | Prisma.UserDevicesScalarFieldEnum + having?: Prisma.UserDevicesScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserDevicesCountAggregateInputType | true + _min?: UserDevicesMinAggregateInputType + _max?: UserDevicesMaxAggregateInputType +} + +export type UserDevicesGroupByOutputType = { + account_id: string | null + app_version: string + build_number: string + uuid: string + platform: string + brand: string + model: string + device: string + os_version: string + sdk_version: string + release_number: string + browser_name: string | null + fcm_token: string | null + _count: UserDevicesCountAggregateOutputType | null + _min: UserDevicesMinAggregateOutputType | null + _max: UserDevicesMaxAggregateOutputType | null +} + +type GetUserDevicesGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof UserDevicesGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type UserDevicesWhereInput = { + AND?: Prisma.UserDevicesWhereInput | Prisma.UserDevicesWhereInput[] + OR?: Prisma.UserDevicesWhereInput[] + NOT?: Prisma.UserDevicesWhereInput | Prisma.UserDevicesWhereInput[] + account_id?: Prisma.StringNullableFilter<"UserDevices"> | string | null + app_version?: Prisma.StringFilter<"UserDevices"> | string + build_number?: Prisma.StringFilter<"UserDevices"> | string + uuid?: Prisma.StringFilter<"UserDevices"> | string + platform?: Prisma.StringFilter<"UserDevices"> | string + brand?: Prisma.StringFilter<"UserDevices"> | string + model?: Prisma.StringFilter<"UserDevices"> | string + device?: Prisma.StringFilter<"UserDevices"> | string + os_version?: Prisma.StringFilter<"UserDevices"> | string + sdk_version?: Prisma.StringFilter<"UserDevices"> | string + release_number?: Prisma.StringFilter<"UserDevices"> | string + browser_name?: Prisma.StringNullableFilter<"UserDevices"> | string | null + fcm_token?: Prisma.StringNullableFilter<"UserDevices"> | string | null +} + +export type UserDevicesOrderByWithRelationInput = { + account_id?: Prisma.SortOrderInput | Prisma.SortOrder + app_version?: Prisma.SortOrder + build_number?: Prisma.SortOrder + uuid?: Prisma.SortOrder + platform?: Prisma.SortOrder + brand?: Prisma.SortOrder + model?: Prisma.SortOrder + device?: Prisma.SortOrder + os_version?: Prisma.SortOrder + sdk_version?: Prisma.SortOrder + release_number?: Prisma.SortOrder + browser_name?: Prisma.SortOrderInput | Prisma.SortOrder + fcm_token?: Prisma.SortOrderInput | Prisma.SortOrder + _relevance?: Prisma.UserDevicesOrderByRelevanceInput +} + +export type UserDevicesWhereUniqueInput = Prisma.AtLeast<{ + uuid?: string + AND?: Prisma.UserDevicesWhereInput | Prisma.UserDevicesWhereInput[] + OR?: Prisma.UserDevicesWhereInput[] + NOT?: Prisma.UserDevicesWhereInput | Prisma.UserDevicesWhereInput[] + account_id?: Prisma.StringNullableFilter<"UserDevices"> | string | null + app_version?: Prisma.StringFilter<"UserDevices"> | string + build_number?: Prisma.StringFilter<"UserDevices"> | string + platform?: Prisma.StringFilter<"UserDevices"> | string + brand?: Prisma.StringFilter<"UserDevices"> | string + model?: Prisma.StringFilter<"UserDevices"> | string + device?: Prisma.StringFilter<"UserDevices"> | string + os_version?: Prisma.StringFilter<"UserDevices"> | string + sdk_version?: Prisma.StringFilter<"UserDevices"> | string + release_number?: Prisma.StringFilter<"UserDevices"> | string + browser_name?: Prisma.StringNullableFilter<"UserDevices"> | string | null + fcm_token?: Prisma.StringNullableFilter<"UserDevices"> | string | null +}, "uuid" | "uuid"> + +export type UserDevicesOrderByWithAggregationInput = { + account_id?: Prisma.SortOrderInput | Prisma.SortOrder + app_version?: Prisma.SortOrder + build_number?: Prisma.SortOrder + uuid?: Prisma.SortOrder + platform?: Prisma.SortOrder + brand?: Prisma.SortOrder + model?: Prisma.SortOrder + device?: Prisma.SortOrder + os_version?: Prisma.SortOrder + sdk_version?: Prisma.SortOrder + release_number?: Prisma.SortOrder + browser_name?: Prisma.SortOrderInput | Prisma.SortOrder + fcm_token?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.UserDevicesCountOrderByAggregateInput + _max?: Prisma.UserDevicesMaxOrderByAggregateInput + _min?: Prisma.UserDevicesMinOrderByAggregateInput +} + +export type UserDevicesScalarWhereWithAggregatesInput = { + AND?: Prisma.UserDevicesScalarWhereWithAggregatesInput | Prisma.UserDevicesScalarWhereWithAggregatesInput[] + OR?: Prisma.UserDevicesScalarWhereWithAggregatesInput[] + NOT?: Prisma.UserDevicesScalarWhereWithAggregatesInput | Prisma.UserDevicesScalarWhereWithAggregatesInput[] + account_id?: Prisma.StringNullableWithAggregatesFilter<"UserDevices"> | string | null + app_version?: Prisma.StringWithAggregatesFilter<"UserDevices"> | string + build_number?: Prisma.StringWithAggregatesFilter<"UserDevices"> | string + uuid?: Prisma.StringWithAggregatesFilter<"UserDevices"> | string + platform?: Prisma.StringWithAggregatesFilter<"UserDevices"> | string + brand?: Prisma.StringWithAggregatesFilter<"UserDevices"> | string + model?: Prisma.StringWithAggregatesFilter<"UserDevices"> | string + device?: Prisma.StringWithAggregatesFilter<"UserDevices"> | string + os_version?: Prisma.StringWithAggregatesFilter<"UserDevices"> | string + sdk_version?: Prisma.StringWithAggregatesFilter<"UserDevices"> | string + release_number?: Prisma.StringWithAggregatesFilter<"UserDevices"> | string + browser_name?: Prisma.StringNullableWithAggregatesFilter<"UserDevices"> | string | null + fcm_token?: Prisma.StringNullableWithAggregatesFilter<"UserDevices"> | string | null +} + +export type UserDevicesCreateInput = { + account_id?: string | null + app_version: string + build_number: string + uuid: string + platform: string + brand: string + model: string + device: string + os_version: string + sdk_version: string + release_number: string + browser_name?: string | null + fcm_token?: string | null +} + +export type UserDevicesUncheckedCreateInput = { + account_id?: string | null + app_version: string + build_number: string + uuid: string + platform: string + brand: string + model: string + device: string + os_version: string + sdk_version: string + release_number: string + browser_name?: string | null + fcm_token?: string | null +} + +export type UserDevicesUpdateInput = { + account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + app_version?: Prisma.StringFieldUpdateOperationsInput | string + build_number?: Prisma.StringFieldUpdateOperationsInput | string + uuid?: Prisma.StringFieldUpdateOperationsInput | string + platform?: Prisma.StringFieldUpdateOperationsInput | string + brand?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.StringFieldUpdateOperationsInput | string + device?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.StringFieldUpdateOperationsInput | string + sdk_version?: Prisma.StringFieldUpdateOperationsInput | string + release_number?: Prisma.StringFieldUpdateOperationsInput | string + browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserDevicesUncheckedUpdateInput = { + account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + app_version?: Prisma.StringFieldUpdateOperationsInput | string + build_number?: Prisma.StringFieldUpdateOperationsInput | string + uuid?: Prisma.StringFieldUpdateOperationsInput | string + platform?: Prisma.StringFieldUpdateOperationsInput | string + brand?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.StringFieldUpdateOperationsInput | string + device?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.StringFieldUpdateOperationsInput | string + sdk_version?: Prisma.StringFieldUpdateOperationsInput | string + release_number?: Prisma.StringFieldUpdateOperationsInput | string + browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserDevicesCreateManyInput = { + account_id?: string | null + app_version: string + build_number: string + uuid: string + platform: string + brand: string + model: string + device: string + os_version: string + sdk_version: string + release_number: string + browser_name?: string | null + fcm_token?: string | null +} + +export type UserDevicesUpdateManyMutationInput = { + account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + app_version?: Prisma.StringFieldUpdateOperationsInput | string + build_number?: Prisma.StringFieldUpdateOperationsInput | string + uuid?: Prisma.StringFieldUpdateOperationsInput | string + platform?: Prisma.StringFieldUpdateOperationsInput | string + brand?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.StringFieldUpdateOperationsInput | string + device?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.StringFieldUpdateOperationsInput | string + sdk_version?: Prisma.StringFieldUpdateOperationsInput | string + release_number?: Prisma.StringFieldUpdateOperationsInput | string + browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserDevicesUncheckedUpdateManyInput = { + account_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + app_version?: Prisma.StringFieldUpdateOperationsInput | string + build_number?: Prisma.StringFieldUpdateOperationsInput | string + uuid?: Prisma.StringFieldUpdateOperationsInput | string + platform?: Prisma.StringFieldUpdateOperationsInput | string + brand?: Prisma.StringFieldUpdateOperationsInput | string + model?: Prisma.StringFieldUpdateOperationsInput | string + device?: Prisma.StringFieldUpdateOperationsInput | string + os_version?: Prisma.StringFieldUpdateOperationsInput | string + sdk_version?: Prisma.StringFieldUpdateOperationsInput | string + release_number?: Prisma.StringFieldUpdateOperationsInput | string + browser_name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + fcm_token?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserDevicesOrderByRelevanceInput = { + fields: Prisma.UserDevicesOrderByRelevanceFieldEnum | Prisma.UserDevicesOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type UserDevicesCountOrderByAggregateInput = { + account_id?: Prisma.SortOrder + app_version?: Prisma.SortOrder + build_number?: Prisma.SortOrder + uuid?: Prisma.SortOrder + platform?: Prisma.SortOrder + brand?: Prisma.SortOrder + model?: Prisma.SortOrder + device?: Prisma.SortOrder + os_version?: Prisma.SortOrder + sdk_version?: Prisma.SortOrder + release_number?: Prisma.SortOrder + browser_name?: Prisma.SortOrder + fcm_token?: Prisma.SortOrder +} + +export type UserDevicesMaxOrderByAggregateInput = { + account_id?: Prisma.SortOrder + app_version?: Prisma.SortOrder + build_number?: Prisma.SortOrder + uuid?: Prisma.SortOrder + platform?: Prisma.SortOrder + brand?: Prisma.SortOrder + model?: Prisma.SortOrder + device?: Prisma.SortOrder + os_version?: Prisma.SortOrder + sdk_version?: Prisma.SortOrder + release_number?: Prisma.SortOrder + browser_name?: Prisma.SortOrder + fcm_token?: Prisma.SortOrder +} + +export type UserDevicesMinOrderByAggregateInput = { + account_id?: Prisma.SortOrder + app_version?: Prisma.SortOrder + build_number?: Prisma.SortOrder + uuid?: Prisma.SortOrder + platform?: Prisma.SortOrder + brand?: Prisma.SortOrder + model?: Prisma.SortOrder + device?: Prisma.SortOrder + os_version?: Prisma.SortOrder + sdk_version?: Prisma.SortOrder + release_number?: Prisma.SortOrder + browser_name?: Prisma.SortOrder + fcm_token?: Prisma.SortOrder +} + + + +export type UserDevicesSelect = runtime.Types.Extensions.GetSelect<{ + account_id?: boolean + app_version?: boolean + build_number?: boolean + uuid?: boolean + platform?: boolean + brand?: boolean + model?: boolean + device?: boolean + os_version?: boolean + sdk_version?: boolean + release_number?: boolean + browser_name?: boolean + fcm_token?: boolean +}, ExtArgs["result"]["userDevices"]> + + + +export type UserDevicesSelectScalar = { + account_id?: boolean + app_version?: boolean + build_number?: boolean + uuid?: boolean + platform?: boolean + brand?: boolean + model?: boolean + device?: boolean + os_version?: boolean + sdk_version?: boolean + release_number?: boolean + browser_name?: boolean + fcm_token?: boolean +} + +export type UserDevicesOmit = runtime.Types.Extensions.GetOmit<"account_id" | "app_version" | "build_number" | "uuid" | "platform" | "brand" | "model" | "device" | "os_version" | "sdk_version" | "release_number" | "browser_name" | "fcm_token", ExtArgs["result"]["userDevices"]> + +export type $UserDevicesPayload = { + name: "UserDevices" + objects: {} + scalars: runtime.Types.Extensions.GetPayloadResult<{ + account_id: string | null + app_version: string + build_number: string + uuid: string + platform: string + brand: string + model: string + device: string + os_version: string + sdk_version: string + release_number: string + browser_name: string | null + fcm_token: string | null + }, ExtArgs["result"]["userDevices"]> + composites: {} +} + +export type UserDevicesGetPayload = runtime.Types.Result.GetResult + +export type UserDevicesCountArgs = + Omit & { + select?: UserDevicesCountAggregateInputType | true + } + +export interface UserDevicesDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['UserDevices'], meta: { name: 'UserDevices' } } + /** + * Find zero or one UserDevices that matches the filter. + * @param {UserDevicesFindUniqueArgs} args - Arguments to find a UserDevices + * @example + * // Get one UserDevices + * const userDevices = await prisma.userDevices.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__UserDevicesClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one UserDevices that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UserDevicesFindUniqueOrThrowArgs} args - Arguments to find a UserDevices + * @example + * // Get one UserDevices + * const userDevices = await prisma.userDevices.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__UserDevicesClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first UserDevices that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserDevicesFindFirstArgs} args - Arguments to find a UserDevices + * @example + * // Get one UserDevices + * const userDevices = await prisma.userDevices.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__UserDevicesClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first UserDevices that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserDevicesFindFirstOrThrowArgs} args - Arguments to find a UserDevices + * @example + * // Get one UserDevices + * const userDevices = await prisma.userDevices.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__UserDevicesClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more UserDevices that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserDevicesFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all UserDevices + * const userDevices = await prisma.userDevices.findMany() + * + * // Get first 10 UserDevices + * const userDevices = await prisma.userDevices.findMany({ take: 10 }) + * + * // Only select the `account_id` + * const userDevicesWithAccount_idOnly = await prisma.userDevices.findMany({ select: { account_id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a UserDevices. + * @param {UserDevicesCreateArgs} args - Arguments to create a UserDevices. + * @example + * // Create one UserDevices + * const UserDevices = await prisma.userDevices.create({ + * data: { + * // ... data to create a UserDevices + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__UserDevicesClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many UserDevices. + * @param {UserDevicesCreateManyArgs} args - Arguments to create many UserDevices. + * @example + * // Create many UserDevices + * const userDevices = await prisma.userDevices.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a UserDevices. + * @param {UserDevicesDeleteArgs} args - Arguments to delete one UserDevices. + * @example + * // Delete one UserDevices + * const UserDevices = await prisma.userDevices.delete({ + * where: { + * // ... filter to delete one UserDevices + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__UserDevicesClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one UserDevices. + * @param {UserDevicesUpdateArgs} args - Arguments to update one UserDevices. + * @example + * // Update one UserDevices + * const userDevices = await prisma.userDevices.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__UserDevicesClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more UserDevices. + * @param {UserDevicesDeleteManyArgs} args - Arguments to filter UserDevices to delete. + * @example + * // Delete a few UserDevices + * const { count } = await prisma.userDevices.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more UserDevices. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserDevicesUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many UserDevices + * const userDevices = await prisma.userDevices.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one UserDevices. + * @param {UserDevicesUpsertArgs} args - Arguments to update or create a UserDevices. + * @example + * // Update or create a UserDevices + * const userDevices = await prisma.userDevices.upsert({ + * create: { + * // ... data to create a UserDevices + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the UserDevices we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__UserDevicesClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of UserDevices. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserDevicesCountArgs} args - Arguments to filter UserDevices to count. + * @example + * // Count the number of UserDevices + * const count = await prisma.userDevices.count({ + * where: { + * // ... the filter for the UserDevices we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a UserDevices. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserDevicesAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by UserDevices. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserDevicesGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends UserDevicesGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: UserDevicesGroupByArgs['orderBy'] } + : { orderBy?: UserDevicesGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetUserDevicesGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the UserDevices model + */ +readonly fields: UserDevicesFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for UserDevices. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__UserDevicesClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the UserDevices model + */ +export interface UserDevicesFieldRefs { + readonly account_id: Prisma.FieldRef<"UserDevices", 'String'> + readonly app_version: Prisma.FieldRef<"UserDevices", 'String'> + readonly build_number: Prisma.FieldRef<"UserDevices", 'String'> + readonly uuid: Prisma.FieldRef<"UserDevices", 'String'> + readonly platform: Prisma.FieldRef<"UserDevices", 'String'> + readonly brand: Prisma.FieldRef<"UserDevices", 'String'> + readonly model: Prisma.FieldRef<"UserDevices", 'String'> + readonly device: Prisma.FieldRef<"UserDevices", 'String'> + readonly os_version: Prisma.FieldRef<"UserDevices", 'String'> + readonly sdk_version: Prisma.FieldRef<"UserDevices", 'String'> + readonly release_number: Prisma.FieldRef<"UserDevices", 'String'> + readonly browser_name: Prisma.FieldRef<"UserDevices", 'String'> + readonly fcm_token: Prisma.FieldRef<"UserDevices", 'String'> +} + + +// Custom InputTypes +/** + * UserDevices findUnique + */ +export type UserDevicesFindUniqueArgs = { + /** + * Select specific fields to fetch from the UserDevices + */ + select?: Prisma.UserDevicesSelect | null + /** + * Omit specific fields from the UserDevices + */ + omit?: Prisma.UserDevicesOmit | null + /** + * Filter, which UserDevices to fetch. + */ + where: Prisma.UserDevicesWhereUniqueInput +} + +/** + * UserDevices findUniqueOrThrow + */ +export type UserDevicesFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the UserDevices + */ + select?: Prisma.UserDevicesSelect | null + /** + * Omit specific fields from the UserDevices + */ + omit?: Prisma.UserDevicesOmit | null + /** + * Filter, which UserDevices to fetch. + */ + where: Prisma.UserDevicesWhereUniqueInput +} + +/** + * UserDevices findFirst + */ +export type UserDevicesFindFirstArgs = { + /** + * Select specific fields to fetch from the UserDevices + */ + select?: Prisma.UserDevicesSelect | null + /** + * Omit specific fields from the UserDevices + */ + omit?: Prisma.UserDevicesOmit | null + /** + * Filter, which UserDevices to fetch. + */ + where?: Prisma.UserDevicesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserDevices to fetch. + */ + orderBy?: Prisma.UserDevicesOrderByWithRelationInput | Prisma.UserDevicesOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for UserDevices. + */ + cursor?: Prisma.UserDevicesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserDevices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` UserDevices. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of UserDevices. + */ + distinct?: Prisma.UserDevicesScalarFieldEnum | Prisma.UserDevicesScalarFieldEnum[] +} + +/** + * UserDevices findFirstOrThrow + */ +export type UserDevicesFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the UserDevices + */ + select?: Prisma.UserDevicesSelect | null + /** + * Omit specific fields from the UserDevices + */ + omit?: Prisma.UserDevicesOmit | null + /** + * Filter, which UserDevices to fetch. + */ + where?: Prisma.UserDevicesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserDevices to fetch. + */ + orderBy?: Prisma.UserDevicesOrderByWithRelationInput | Prisma.UserDevicesOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for UserDevices. + */ + cursor?: Prisma.UserDevicesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserDevices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` UserDevices. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of UserDevices. + */ + distinct?: Prisma.UserDevicesScalarFieldEnum | Prisma.UserDevicesScalarFieldEnum[] +} + +/** + * UserDevices findMany + */ +export type UserDevicesFindManyArgs = { + /** + * Select specific fields to fetch from the UserDevices + */ + select?: Prisma.UserDevicesSelect | null + /** + * Omit specific fields from the UserDevices + */ + omit?: Prisma.UserDevicesOmit | null + /** + * Filter, which UserDevices to fetch. + */ + where?: Prisma.UserDevicesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserDevices to fetch. + */ + orderBy?: Prisma.UserDevicesOrderByWithRelationInput | Prisma.UserDevicesOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing UserDevices. + */ + cursor?: Prisma.UserDevicesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserDevices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` UserDevices. + */ + skip?: number + distinct?: Prisma.UserDevicesScalarFieldEnum | Prisma.UserDevicesScalarFieldEnum[] +} + +/** + * UserDevices create + */ +export type UserDevicesCreateArgs = { + /** + * Select specific fields to fetch from the UserDevices + */ + select?: Prisma.UserDevicesSelect | null + /** + * Omit specific fields from the UserDevices + */ + omit?: Prisma.UserDevicesOmit | null + /** + * The data needed to create a UserDevices. + */ + data: Prisma.XOR +} + +/** + * UserDevices createMany + */ +export type UserDevicesCreateManyArgs = { + /** + * The data used to create many UserDevices. + */ + data: Prisma.UserDevicesCreateManyInput | Prisma.UserDevicesCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * UserDevices update + */ +export type UserDevicesUpdateArgs = { + /** + * Select specific fields to fetch from the UserDevices + */ + select?: Prisma.UserDevicesSelect | null + /** + * Omit specific fields from the UserDevices + */ + omit?: Prisma.UserDevicesOmit | null + /** + * The data needed to update a UserDevices. + */ + data: Prisma.XOR + /** + * Choose, which UserDevices to update. + */ + where: Prisma.UserDevicesWhereUniqueInput +} + +/** + * UserDevices updateMany + */ +export type UserDevicesUpdateManyArgs = { + /** + * The data used to update UserDevices. + */ + data: Prisma.XOR + /** + * Filter which UserDevices to update + */ + where?: Prisma.UserDevicesWhereInput + /** + * Limit how many UserDevices to update. + */ + limit?: number +} + +/** + * UserDevices upsert + */ +export type UserDevicesUpsertArgs = { + /** + * Select specific fields to fetch from the UserDevices + */ + select?: Prisma.UserDevicesSelect | null + /** + * Omit specific fields from the UserDevices + */ + omit?: Prisma.UserDevicesOmit | null + /** + * The filter to search for the UserDevices to update in case it exists. + */ + where: Prisma.UserDevicesWhereUniqueInput + /** + * In case the UserDevices found by the `where` argument doesn't exist, create a new UserDevices with this data. + */ + create: Prisma.XOR + /** + * In case the UserDevices was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * UserDevices delete + */ +export type UserDevicesDeleteArgs = { + /** + * Select specific fields to fetch from the UserDevices + */ + select?: Prisma.UserDevicesSelect | null + /** + * Omit specific fields from the UserDevices + */ + omit?: Prisma.UserDevicesOmit | null + /** + * Filter which UserDevices to delete. + */ + where: Prisma.UserDevicesWhereUniqueInput +} + +/** + * UserDevices deleteMany + */ +export type UserDevicesDeleteManyArgs = { + /** + * Filter which UserDevices to delete + */ + where?: Prisma.UserDevicesWhereInput + /** + * Limit how many UserDevices to delete. + */ + limit?: number +} + +/** + * UserDevices without action + */ +export type UserDevicesDefaultArgs = { + /** + * Select specific fields to fetch from the UserDevices + */ + select?: Prisma.UserDevicesSelect | null + /** + * Omit specific fields from the UserDevices + */ + omit?: Prisma.UserDevicesOmit | null +} diff --git a/src/generated/prisma/models/VerificationCode.ts b/src/generated/prisma/models/VerificationCode.ts new file mode 100644 index 0000000..dbe9338 --- /dev/null +++ b/src/generated/prisma/models/VerificationCode.ts @@ -0,0 +1,1255 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `VerificationCode` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model VerificationCode + * + */ +export type VerificationCodeModel = runtime.Types.Result.DefaultSelection + +export type AggregateVerificationCode = { + _count: VerificationCodeCountAggregateOutputType | null + _min: VerificationCodeMinAggregateOutputType | null + _max: VerificationCodeMaxAggregateOutputType | null +} + +export type VerificationCodeMinAggregateOutputType = { + id: string | null + code: string | null + is_used: boolean | null + created_at: Date | null + expires_at: Date | null + account_id: string | null +} + +export type VerificationCodeMaxAggregateOutputType = { + id: string | null + code: string | null + is_used: boolean | null + created_at: Date | null + expires_at: Date | null + account_id: string | null +} + +export type VerificationCodeCountAggregateOutputType = { + id: number + code: number + is_used: number + created_at: number + expires_at: number + account_id: number + _all: number +} + + +export type VerificationCodeMinAggregateInputType = { + id?: true + code?: true + is_used?: true + created_at?: true + expires_at?: true + account_id?: true +} + +export type VerificationCodeMaxAggregateInputType = { + id?: true + code?: true + is_used?: true + created_at?: true + expires_at?: true + account_id?: true +} + +export type VerificationCodeCountAggregateInputType = { + id?: true + code?: true + is_used?: true + created_at?: true + expires_at?: true + account_id?: true + _all?: true +} + +export type VerificationCodeAggregateArgs = { + /** + * Filter which VerificationCode to aggregate. + */ + where?: Prisma.VerificationCodeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of VerificationCodes to fetch. + */ + orderBy?: Prisma.VerificationCodeOrderByWithRelationInput | Prisma.VerificationCodeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.VerificationCodeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` VerificationCodes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` VerificationCodes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned VerificationCodes + **/ + _count?: true | VerificationCodeCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: VerificationCodeMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: VerificationCodeMaxAggregateInputType +} + +export type GetVerificationCodeAggregateType = { + [P in keyof T & keyof AggregateVerificationCode]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type VerificationCodeGroupByArgs = { + where?: Prisma.VerificationCodeWhereInput + orderBy?: Prisma.VerificationCodeOrderByWithAggregationInput | Prisma.VerificationCodeOrderByWithAggregationInput[] + by: Prisma.VerificationCodeScalarFieldEnum[] | Prisma.VerificationCodeScalarFieldEnum + having?: Prisma.VerificationCodeScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: VerificationCodeCountAggregateInputType | true + _min?: VerificationCodeMinAggregateInputType + _max?: VerificationCodeMaxAggregateInputType +} + +export type VerificationCodeGroupByOutputType = { + id: string + code: string + is_used: boolean + created_at: Date + expires_at: Date + account_id: string + _count: VerificationCodeCountAggregateOutputType | null + _min: VerificationCodeMinAggregateOutputType | null + _max: VerificationCodeMaxAggregateOutputType | null +} + +type GetVerificationCodeGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof VerificationCodeGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type VerificationCodeWhereInput = { + AND?: Prisma.VerificationCodeWhereInput | Prisma.VerificationCodeWhereInput[] + OR?: Prisma.VerificationCodeWhereInput[] + NOT?: Prisma.VerificationCodeWhereInput | Prisma.VerificationCodeWhereInput[] + id?: Prisma.StringFilter<"VerificationCode"> | string + code?: Prisma.StringFilter<"VerificationCode"> | string + is_used?: Prisma.BoolFilter<"VerificationCode"> | boolean + created_at?: Prisma.DateTimeFilter<"VerificationCode"> | Date | string + expires_at?: Prisma.DateTimeFilter<"VerificationCode"> | Date | string + account_id?: Prisma.StringFilter<"VerificationCode"> | string + account?: Prisma.XOR +} + +export type VerificationCodeOrderByWithRelationInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + is_used?: Prisma.SortOrder + created_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + account_id?: Prisma.SortOrder + account?: Prisma.AccountOrderByWithRelationInput + _relevance?: Prisma.VerificationCodeOrderByRelevanceInput +} + +export type VerificationCodeWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.VerificationCodeWhereInput | Prisma.VerificationCodeWhereInput[] + OR?: Prisma.VerificationCodeWhereInput[] + NOT?: Prisma.VerificationCodeWhereInput | Prisma.VerificationCodeWhereInput[] + code?: Prisma.StringFilter<"VerificationCode"> | string + is_used?: Prisma.BoolFilter<"VerificationCode"> | boolean + created_at?: Prisma.DateTimeFilter<"VerificationCode"> | Date | string + expires_at?: Prisma.DateTimeFilter<"VerificationCode"> | Date | string + account_id?: Prisma.StringFilter<"VerificationCode"> | string + account?: Prisma.XOR +}, "id"> + +export type VerificationCodeOrderByWithAggregationInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + is_used?: Prisma.SortOrder + created_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + account_id?: Prisma.SortOrder + _count?: Prisma.VerificationCodeCountOrderByAggregateInput + _max?: Prisma.VerificationCodeMaxOrderByAggregateInput + _min?: Prisma.VerificationCodeMinOrderByAggregateInput +} + +export type VerificationCodeScalarWhereWithAggregatesInput = { + AND?: Prisma.VerificationCodeScalarWhereWithAggregatesInput | Prisma.VerificationCodeScalarWhereWithAggregatesInput[] + OR?: Prisma.VerificationCodeScalarWhereWithAggregatesInput[] + NOT?: Prisma.VerificationCodeScalarWhereWithAggregatesInput | Prisma.VerificationCodeScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"VerificationCode"> | string + code?: Prisma.StringWithAggregatesFilter<"VerificationCode"> | string + is_used?: Prisma.BoolWithAggregatesFilter<"VerificationCode"> | boolean + created_at?: Prisma.DateTimeWithAggregatesFilter<"VerificationCode"> | Date | string + expires_at?: Prisma.DateTimeWithAggregatesFilter<"VerificationCode"> | Date | string + account_id?: Prisma.StringWithAggregatesFilter<"VerificationCode"> | string +} + +export type VerificationCodeCreateInput = { + id?: string + code: string + is_used?: boolean + created_at?: Date | string + expires_at: Date | string + account: Prisma.AccountCreateNestedOneWithoutVerification_codesInput +} + +export type VerificationCodeUncheckedCreateInput = { + id?: string + code: string + is_used?: boolean + created_at?: Date | string + expires_at: Date | string + account_id: string +} + +export type VerificationCodeUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + is_used?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account?: Prisma.AccountUpdateOneRequiredWithoutVerification_codesNestedInput +} + +export type VerificationCodeUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + is_used?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type VerificationCodeCreateManyInput = { + id?: string + code: string + is_used?: boolean + created_at?: Date | string + expires_at: Date | string + account_id: string +} + +export type VerificationCodeUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + is_used?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type VerificationCodeUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + is_used?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + account_id?: Prisma.StringFieldUpdateOperationsInput | string +} + +export type VerificationCodeOrderByRelevanceInput = { + fields: Prisma.VerificationCodeOrderByRelevanceFieldEnum | Prisma.VerificationCodeOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type VerificationCodeCountOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + is_used?: Prisma.SortOrder + created_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + account_id?: Prisma.SortOrder +} + +export type VerificationCodeMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + is_used?: Prisma.SortOrder + created_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + account_id?: Prisma.SortOrder +} + +export type VerificationCodeMinOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + is_used?: Prisma.SortOrder + created_at?: Prisma.SortOrder + expires_at?: Prisma.SortOrder + account_id?: Prisma.SortOrder +} + +export type VerificationCodeListRelationFilter = { + every?: Prisma.VerificationCodeWhereInput + some?: Prisma.VerificationCodeWhereInput + none?: Prisma.VerificationCodeWhereInput +} + +export type VerificationCodeOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type BoolFieldUpdateOperationsInput = { + set?: boolean +} + +export type VerificationCodeCreateNestedManyWithoutAccountInput = { + create?: Prisma.XOR | Prisma.VerificationCodeCreateWithoutAccountInput[] | Prisma.VerificationCodeUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.VerificationCodeCreateOrConnectWithoutAccountInput | Prisma.VerificationCodeCreateOrConnectWithoutAccountInput[] + createMany?: Prisma.VerificationCodeCreateManyAccountInputEnvelope + connect?: Prisma.VerificationCodeWhereUniqueInput | Prisma.VerificationCodeWhereUniqueInput[] +} + +export type VerificationCodeUncheckedCreateNestedManyWithoutAccountInput = { + create?: Prisma.XOR | Prisma.VerificationCodeCreateWithoutAccountInput[] | Prisma.VerificationCodeUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.VerificationCodeCreateOrConnectWithoutAccountInput | Prisma.VerificationCodeCreateOrConnectWithoutAccountInput[] + createMany?: Prisma.VerificationCodeCreateManyAccountInputEnvelope + connect?: Prisma.VerificationCodeWhereUniqueInput | Prisma.VerificationCodeWhereUniqueInput[] +} + +export type VerificationCodeUpdateManyWithoutAccountNestedInput = { + create?: Prisma.XOR | Prisma.VerificationCodeCreateWithoutAccountInput[] | Prisma.VerificationCodeUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.VerificationCodeCreateOrConnectWithoutAccountInput | Prisma.VerificationCodeCreateOrConnectWithoutAccountInput[] + upsert?: Prisma.VerificationCodeUpsertWithWhereUniqueWithoutAccountInput | Prisma.VerificationCodeUpsertWithWhereUniqueWithoutAccountInput[] + createMany?: Prisma.VerificationCodeCreateManyAccountInputEnvelope + set?: Prisma.VerificationCodeWhereUniqueInput | Prisma.VerificationCodeWhereUniqueInput[] + disconnect?: Prisma.VerificationCodeWhereUniqueInput | Prisma.VerificationCodeWhereUniqueInput[] + delete?: Prisma.VerificationCodeWhereUniqueInput | Prisma.VerificationCodeWhereUniqueInput[] + connect?: Prisma.VerificationCodeWhereUniqueInput | Prisma.VerificationCodeWhereUniqueInput[] + update?: Prisma.VerificationCodeUpdateWithWhereUniqueWithoutAccountInput | Prisma.VerificationCodeUpdateWithWhereUniqueWithoutAccountInput[] + updateMany?: Prisma.VerificationCodeUpdateManyWithWhereWithoutAccountInput | Prisma.VerificationCodeUpdateManyWithWhereWithoutAccountInput[] + deleteMany?: Prisma.VerificationCodeScalarWhereInput | Prisma.VerificationCodeScalarWhereInput[] +} + +export type VerificationCodeUncheckedUpdateManyWithoutAccountNestedInput = { + create?: Prisma.XOR | Prisma.VerificationCodeCreateWithoutAccountInput[] | Prisma.VerificationCodeUncheckedCreateWithoutAccountInput[] + connectOrCreate?: Prisma.VerificationCodeCreateOrConnectWithoutAccountInput | Prisma.VerificationCodeCreateOrConnectWithoutAccountInput[] + upsert?: Prisma.VerificationCodeUpsertWithWhereUniqueWithoutAccountInput | Prisma.VerificationCodeUpsertWithWhereUniqueWithoutAccountInput[] + createMany?: Prisma.VerificationCodeCreateManyAccountInputEnvelope + set?: Prisma.VerificationCodeWhereUniqueInput | Prisma.VerificationCodeWhereUniqueInput[] + disconnect?: Prisma.VerificationCodeWhereUniqueInput | Prisma.VerificationCodeWhereUniqueInput[] + delete?: Prisma.VerificationCodeWhereUniqueInput | Prisma.VerificationCodeWhereUniqueInput[] + connect?: Prisma.VerificationCodeWhereUniqueInput | Prisma.VerificationCodeWhereUniqueInput[] + update?: Prisma.VerificationCodeUpdateWithWhereUniqueWithoutAccountInput | Prisma.VerificationCodeUpdateWithWhereUniqueWithoutAccountInput[] + updateMany?: Prisma.VerificationCodeUpdateManyWithWhereWithoutAccountInput | Prisma.VerificationCodeUpdateManyWithWhereWithoutAccountInput[] + deleteMany?: Prisma.VerificationCodeScalarWhereInput | Prisma.VerificationCodeScalarWhereInput[] +} + +export type VerificationCodeCreateWithoutAccountInput = { + id?: string + code: string + is_used?: boolean + created_at?: Date | string + expires_at: Date | string +} + +export type VerificationCodeUncheckedCreateWithoutAccountInput = { + id?: string + code: string + is_used?: boolean + created_at?: Date | string + expires_at: Date | string +} + +export type VerificationCodeCreateOrConnectWithoutAccountInput = { + where: Prisma.VerificationCodeWhereUniqueInput + create: Prisma.XOR +} + +export type VerificationCodeCreateManyAccountInputEnvelope = { + data: Prisma.VerificationCodeCreateManyAccountInput | Prisma.VerificationCodeCreateManyAccountInput[] + skipDuplicates?: boolean +} + +export type VerificationCodeUpsertWithWhereUniqueWithoutAccountInput = { + where: Prisma.VerificationCodeWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type VerificationCodeUpdateWithWhereUniqueWithoutAccountInput = { + where: Prisma.VerificationCodeWhereUniqueInput + data: Prisma.XOR +} + +export type VerificationCodeUpdateManyWithWhereWithoutAccountInput = { + where: Prisma.VerificationCodeScalarWhereInput + data: Prisma.XOR +} + +export type VerificationCodeScalarWhereInput = { + AND?: Prisma.VerificationCodeScalarWhereInput | Prisma.VerificationCodeScalarWhereInput[] + OR?: Prisma.VerificationCodeScalarWhereInput[] + NOT?: Prisma.VerificationCodeScalarWhereInput | Prisma.VerificationCodeScalarWhereInput[] + id?: Prisma.StringFilter<"VerificationCode"> | string + code?: Prisma.StringFilter<"VerificationCode"> | string + is_used?: Prisma.BoolFilter<"VerificationCode"> | boolean + created_at?: Prisma.DateTimeFilter<"VerificationCode"> | Date | string + expires_at?: Prisma.DateTimeFilter<"VerificationCode"> | Date | string + account_id?: Prisma.StringFilter<"VerificationCode"> | string +} + +export type VerificationCodeCreateManyAccountInput = { + id?: string + code: string + is_used?: boolean + created_at?: Date | string + expires_at: Date | string +} + +export type VerificationCodeUpdateWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + is_used?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type VerificationCodeUncheckedUpdateWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + is_used?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type VerificationCodeUncheckedUpdateManyWithoutAccountInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + code?: Prisma.StringFieldUpdateOperationsInput | string + is_used?: Prisma.BoolFieldUpdateOperationsInput | boolean + created_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + expires_at?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + + +export type VerificationCodeSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + code?: boolean + is_used?: boolean + created_at?: boolean + expires_at?: boolean + account_id?: boolean + account?: boolean | Prisma.AccountDefaultArgs +}, ExtArgs["result"]["verificationCode"]> + + + +export type VerificationCodeSelectScalar = { + id?: boolean + code?: boolean + is_used?: boolean + created_at?: boolean + expires_at?: boolean + account_id?: boolean +} + +export type VerificationCodeOmit = runtime.Types.Extensions.GetOmit<"id" | "code" | "is_used" | "created_at" | "expires_at" | "account_id", ExtArgs["result"]["verificationCode"]> +export type VerificationCodeInclude = { + account?: boolean | Prisma.AccountDefaultArgs +} + +export type $VerificationCodePayload = { + name: "VerificationCode" + objects: { + account: Prisma.$AccountPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + code: string + is_used: boolean + created_at: Date + expires_at: Date + account_id: string + }, ExtArgs["result"]["verificationCode"]> + composites: {} +} + +export type VerificationCodeGetPayload = runtime.Types.Result.GetResult + +export type VerificationCodeCountArgs = + Omit & { + select?: VerificationCodeCountAggregateInputType | true + } + +export interface VerificationCodeDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['VerificationCode'], meta: { name: 'VerificationCode' } } + /** + * Find zero or one VerificationCode that matches the filter. + * @param {VerificationCodeFindUniqueArgs} args - Arguments to find a VerificationCode + * @example + * // Get one VerificationCode + * const verificationCode = await prisma.verificationCode.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationCodeClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one VerificationCode that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {VerificationCodeFindUniqueOrThrowArgs} args - Arguments to find a VerificationCode + * @example + * // Get one VerificationCode + * const verificationCode = await prisma.verificationCode.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationCodeClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first VerificationCode that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationCodeFindFirstArgs} args - Arguments to find a VerificationCode + * @example + * // Get one VerificationCode + * const verificationCode = await prisma.verificationCode.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__VerificationCodeClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first VerificationCode that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationCodeFindFirstOrThrowArgs} args - Arguments to find a VerificationCode + * @example + * // Get one VerificationCode + * const verificationCode = await prisma.verificationCode.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__VerificationCodeClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more VerificationCodes that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationCodeFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all VerificationCodes + * const verificationCodes = await prisma.verificationCode.findMany() + * + * // Get first 10 VerificationCodes + * const verificationCodes = await prisma.verificationCode.findMany({ take: 10 }) + * + * // Only select the `id` + * const verificationCodeWithIdOnly = await prisma.verificationCode.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a VerificationCode. + * @param {VerificationCodeCreateArgs} args - Arguments to create a VerificationCode. + * @example + * // Create one VerificationCode + * const VerificationCode = await prisma.verificationCode.create({ + * data: { + * // ... data to create a VerificationCode + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationCodeClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many VerificationCodes. + * @param {VerificationCodeCreateManyArgs} args - Arguments to create many VerificationCodes. + * @example + * // Create many VerificationCodes + * const verificationCode = await prisma.verificationCode.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a VerificationCode. + * @param {VerificationCodeDeleteArgs} args - Arguments to delete one VerificationCode. + * @example + * // Delete one VerificationCode + * const VerificationCode = await prisma.verificationCode.delete({ + * where: { + * // ... filter to delete one VerificationCode + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationCodeClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one VerificationCode. + * @param {VerificationCodeUpdateArgs} args - Arguments to update one VerificationCode. + * @example + * // Update one VerificationCode + * const verificationCode = await prisma.verificationCode.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationCodeClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more VerificationCodes. + * @param {VerificationCodeDeleteManyArgs} args - Arguments to filter VerificationCodes to delete. + * @example + * // Delete a few VerificationCodes + * const { count } = await prisma.verificationCode.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more VerificationCodes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationCodeUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many VerificationCodes + * const verificationCode = await prisma.verificationCode.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one VerificationCode. + * @param {VerificationCodeUpsertArgs} args - Arguments to update or create a VerificationCode. + * @example + * // Update or create a VerificationCode + * const verificationCode = await prisma.verificationCode.upsert({ + * create: { + * // ... data to create a VerificationCode + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the VerificationCode we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__VerificationCodeClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of VerificationCodes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationCodeCountArgs} args - Arguments to filter VerificationCodes to count. + * @example + * // Count the number of VerificationCodes + * const count = await prisma.verificationCode.count({ + * where: { + * // ... the filter for the VerificationCodes we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a VerificationCode. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationCodeAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by VerificationCode. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {VerificationCodeGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends VerificationCodeGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: VerificationCodeGroupByArgs['orderBy'] } + : { orderBy?: VerificationCodeGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetVerificationCodeGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the VerificationCode model + */ +readonly fields: VerificationCodeFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for VerificationCode. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__VerificationCodeClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + account = {}>(args?: Prisma.Subset>): Prisma.Prisma__AccountClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the VerificationCode model + */ +export interface VerificationCodeFieldRefs { + readonly id: Prisma.FieldRef<"VerificationCode", 'String'> + readonly code: Prisma.FieldRef<"VerificationCode", 'String'> + readonly is_used: Prisma.FieldRef<"VerificationCode", 'Boolean'> + readonly created_at: Prisma.FieldRef<"VerificationCode", 'DateTime'> + readonly expires_at: Prisma.FieldRef<"VerificationCode", 'DateTime'> + readonly account_id: Prisma.FieldRef<"VerificationCode", 'String'> +} + + +// Custom InputTypes +/** + * VerificationCode findUnique + */ +export type VerificationCodeFindUniqueArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null + /** + * Filter, which VerificationCode to fetch. + */ + where: Prisma.VerificationCodeWhereUniqueInput +} + +/** + * VerificationCode findUniqueOrThrow + */ +export type VerificationCodeFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null + /** + * Filter, which VerificationCode to fetch. + */ + where: Prisma.VerificationCodeWhereUniqueInput +} + +/** + * VerificationCode findFirst + */ +export type VerificationCodeFindFirstArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null + /** + * Filter, which VerificationCode to fetch. + */ + where?: Prisma.VerificationCodeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of VerificationCodes to fetch. + */ + orderBy?: Prisma.VerificationCodeOrderByWithRelationInput | Prisma.VerificationCodeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for VerificationCodes. + */ + cursor?: Prisma.VerificationCodeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` VerificationCodes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` VerificationCodes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of VerificationCodes. + */ + distinct?: Prisma.VerificationCodeScalarFieldEnum | Prisma.VerificationCodeScalarFieldEnum[] +} + +/** + * VerificationCode findFirstOrThrow + */ +export type VerificationCodeFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null + /** + * Filter, which VerificationCode to fetch. + */ + where?: Prisma.VerificationCodeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of VerificationCodes to fetch. + */ + orderBy?: Prisma.VerificationCodeOrderByWithRelationInput | Prisma.VerificationCodeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for VerificationCodes. + */ + cursor?: Prisma.VerificationCodeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` VerificationCodes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` VerificationCodes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of VerificationCodes. + */ + distinct?: Prisma.VerificationCodeScalarFieldEnum | Prisma.VerificationCodeScalarFieldEnum[] +} + +/** + * VerificationCode findMany + */ +export type VerificationCodeFindManyArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null + /** + * Filter, which VerificationCodes to fetch. + */ + where?: Prisma.VerificationCodeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of VerificationCodes to fetch. + */ + orderBy?: Prisma.VerificationCodeOrderByWithRelationInput | Prisma.VerificationCodeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing VerificationCodes. + */ + cursor?: Prisma.VerificationCodeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` VerificationCodes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` VerificationCodes. + */ + skip?: number + distinct?: Prisma.VerificationCodeScalarFieldEnum | Prisma.VerificationCodeScalarFieldEnum[] +} + +/** + * VerificationCode create + */ +export type VerificationCodeCreateArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null + /** + * The data needed to create a VerificationCode. + */ + data: Prisma.XOR +} + +/** + * VerificationCode createMany + */ +export type VerificationCodeCreateManyArgs = { + /** + * The data used to create many VerificationCodes. + */ + data: Prisma.VerificationCodeCreateManyInput | Prisma.VerificationCodeCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * VerificationCode update + */ +export type VerificationCodeUpdateArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null + /** + * The data needed to update a VerificationCode. + */ + data: Prisma.XOR + /** + * Choose, which VerificationCode to update. + */ + where: Prisma.VerificationCodeWhereUniqueInput +} + +/** + * VerificationCode updateMany + */ +export type VerificationCodeUpdateManyArgs = { + /** + * The data used to update VerificationCodes. + */ + data: Prisma.XOR + /** + * Filter which VerificationCodes to update + */ + where?: Prisma.VerificationCodeWhereInput + /** + * Limit how many VerificationCodes to update. + */ + limit?: number +} + +/** + * VerificationCode upsert + */ +export type VerificationCodeUpsertArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null + /** + * The filter to search for the VerificationCode to update in case it exists. + */ + where: Prisma.VerificationCodeWhereUniqueInput + /** + * In case the VerificationCode found by the `where` argument doesn't exist, create a new VerificationCode with this data. + */ + create: Prisma.XOR + /** + * In case the VerificationCode was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * VerificationCode delete + */ +export type VerificationCodeDeleteArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null + /** + * Filter which VerificationCode to delete. + */ + where: Prisma.VerificationCodeWhereUniqueInput +} + +/** + * VerificationCode deleteMany + */ +export type VerificationCodeDeleteManyArgs = { + /** + * Filter which VerificationCodes to delete + */ + where?: Prisma.VerificationCodeWhereInput + /** + * Limit how many VerificationCodes to delete. + */ + limit?: number +} + +/** + * VerificationCode without action + */ +export type VerificationCodeDefaultArgs = { + /** + * Select specific fields to fetch from the VerificationCode + */ + select?: Prisma.VerificationCodeSelect | null + /** + * Omit specific fields from the VerificationCode + */ + omit?: Prisma.VerificationCodeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.VerificationCodeInclude | null +} diff --git a/src/main.ts b/src/main.ts index af6fa6b..5d0cc0c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -5,9 +5,9 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger' import { AppModule } from './app.module' import { PrismaExceptionFilter } from './common/filters/prisma-exception.filter' import { ValidationExceptionFilter } from './common/filters/validation-exception.filter' +import { JwtAuthGuard } from './common/guards/jwt-auth.guard' import { LoggingInterceptor } from './common/interceptors/logging.interceptor' import { ResponseMappingInterceptor } from './common/interceptors/response-mapping.interceptor' -import { JwtAuthGuard } from './modules/auth/jwt-auth.guard' async function bootstrap() { const app = await NestFactory.create(AppModule) diff --git a/src/modules/admin/admin.controller.ts b/src/modules/admin/admin.controller.ts new file mode 100644 index 0000000..9e464bb --- /dev/null +++ b/src/modules/admin/admin.controller.ts @@ -0,0 +1,6 @@ +import { Controller } from '@nestjs/common' +import { ApiTags } from '@nestjs/swagger' + +@ApiTags('Admin') +@Controller('admin') +export class AdminController {} diff --git a/src/modules/admin/admin.guard.ts b/src/modules/admin/admin.guard.ts new file mode 100644 index 0000000..3f395f0 --- /dev/null +++ b/src/modules/admin/admin.guard.ts @@ -0,0 +1,14 @@ +// import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common' +// import { Observable } from 'rxjs' + +// @Injectable() +// export class AdminGuard implements CanActivate { +// canActivate( +// _context: ExecutionContext, +// ): boolean | Promise | Observable { +// // Replace with real auth/permission checks (e.g., check JWT claims) +// const request = _context.switchToHttp().getRequest() +// const isAdminHeader = request.headers['x-admin'] +// return isAdminHeader === 'true' || request.isAdminRequest === true +// } +// } diff --git a/src/modules/admin/admin.middleware.ts b/src/modules/admin/admin.middleware.ts new file mode 100644 index 0000000..f21c9b0 --- /dev/null +++ b/src/modules/admin/admin.middleware.ts @@ -0,0 +1,24 @@ +import { Injectable, NestMiddleware, UnauthorizedException } from '@nestjs/common' +import { NextFunction, Request, Response } from 'express' + +@Injectable() +export class AdminMiddleware implements NestMiddleware { + use(req: Request, _res: Response, next: NextFunction) { + console.log('first') + // @ts-ignore + console.log(req.dataPayload) + // const a = reqTokenPayload() + // console.log(a) + + // Middleware-based admin check (replace with real auth logic) + const isAdminHeader = req.headers['x-admin'] + + if (isAdminHeader === 'true') { + // mark request if needed downstream + req['isAdminRequest'] = true + } + return next() + + throw new UnauthorizedException('Admin access required') + } +} diff --git a/src/modules/admin/admin.module.ts b/src/modules/admin/admin.module.ts new file mode 100644 index 0000000..36f8ce0 --- /dev/null +++ b/src/modules/admin/admin.module.ts @@ -0,0 +1,38 @@ +import { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common' +import { AdminController } from './admin.controller' +import { AdminMiddleware } from './admin.middleware' +import { AdminDeviceBrandsModule } from './device-brands/device-brands.module' +import { AdminDevicesModule } from './devices/devices.module' +import { AdminGuildsModule } from './guilds/guilds.module' +import { AdminLicensesModule } from './licenses/licenses.module' +import { AdminPartnersModule } from './partners/partners.module' +import { AdminProvidersModule } from './providers/providers.module' +import { AdminTranslateModule } from './translate/translate.module' +import { AdminUserAccountsModule } from './users/accounts/accounts.module' +import { AdminUsersModule } from './users/users.module' + +@Module({ + controllers: [AdminController], + imports: [ + AdminUsersModule, + AdminUserAccountsModule, + AdminTranslateModule, + AdminProvidersModule, + AdminPartnersModule, + AdminPartnersModule, + AdminGuildsModule, + AdminDeviceBrandsModule, + AdminDevicesModule, + AdminLicensesModule, + ], +}) +export class AdminModule implements NestModule { + configure(consumer: MiddlewareConsumer) { + // apply middleware to all routes within this module (scoped under /admin) + consumer.apply(AdminMiddleware).forRoutes({ + path: '/admin*path', + method: RequestMethod.ALL, + version: '1', + }) + } +} diff --git a/src/modules/admin/device-brands/device-brands.controller.ts b/src/modules/admin/device-brands/device-brands.controller.ts new file mode 100644 index 0000000..6cfc773 --- /dev/null +++ b/src/modules/admin/device-brands/device-brands.controller.ts @@ -0,0 +1,34 @@ +import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common' +import { DeviceBrandsService } from './device-brands.service' +import { CreateDeviceBrandDto } from './dto/create-device-brand.dto' +import { UpdateDeviceBrandDto } from './dto/update-device-brand.dto' + +@Controller('admin/device_brands') +export class DeviceBrandsController { + constructor(private readonly deviceBrandsService: DeviceBrandsService) {} + + @Get() + async findAll() { + return this.deviceBrandsService.findAll() + } + + @Get(':id') + async findOne(@Param('id') id: string) { + return this.deviceBrandsService.findOne(id) + } + + @Post() + async create(@Body() data: CreateDeviceBrandDto) { + return this.deviceBrandsService.create(data) + } + + @Put(':id') + async update(@Param('id') id: string, @Body() data: UpdateDeviceBrandDto) { + return this.deviceBrandsService.update(id, data) + } + + @Delete(':id') + async delete(@Param('id') id: string) { + return this.deviceBrandsService.delete(id) + } +} diff --git a/src/modules/admin/device-brands/device-brands.module.ts b/src/modules/admin/device-brands/device-brands.module.ts new file mode 100644 index 0000000..f9b0fb1 --- /dev/null +++ b/src/modules/admin/device-brands/device-brands.module.ts @@ -0,0 +1,11 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' +import { DeviceBrandsController } from './device-brands.controller' +import { DeviceBrandsService } from './device-brands.service' + +@Module({ + imports: [PrismaModule], + controllers: [DeviceBrandsController], + providers: [DeviceBrandsService], +}) +export class AdminDeviceBrandsModule {} diff --git a/src/modules/admin/device-brands/device-brands.service.ts b/src/modules/admin/device-brands/device-brands.service.ts new file mode 100644 index 0000000..2a0dd57 --- /dev/null +++ b/src/modules/admin/device-brands/device-brands.service.ts @@ -0,0 +1,35 @@ +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' + +@Injectable() +export class DeviceBrandsService { + constructor(private readonly prisma: PrismaService) {} + + async findAll() { + const brands = await this.prisma.deviceBrand.findMany() + return ResponseMapper.list(brands) + } + + async findOne(id: string) { + const brand = await this.prisma.deviceBrand.findUnique({ + where: { id }, + }) + return ResponseMapper.single(brand) + } + + async create(data: any) { + const device = await this.prisma.deviceBrand.create({ data }) + return ResponseMapper.create(device) + } + + async update(id: string, data: any) { + const device = await this.prisma.deviceBrand.update({ where: { id }, data }) + return ResponseMapper.update(device) + } + + async delete(id: string) { + await this.prisma.deviceBrand.delete({ where: { id } }) + return ResponseMapper.delete() + } +} diff --git a/src/modules/admin/device-brands/dto/create-device-brand.dto.ts b/src/modules/admin/device-brands/dto/create-device-brand.dto.ts new file mode 100644 index 0000000..167ad01 --- /dev/null +++ b/src/modules/admin/device-brands/dto/create-device-brand.dto.ts @@ -0,0 +1,6 @@ +import { IsString } from 'class-validator' + +export class CreateDeviceBrandDto { + @IsString() + name: string +} diff --git a/src/modules/admin/device-brands/dto/update-device-brand.dto.ts b/src/modules/admin/device-brands/dto/update-device-brand.dto.ts new file mode 100644 index 0000000..2913bf1 --- /dev/null +++ b/src/modules/admin/device-brands/dto/update-device-brand.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/swagger' +import { CreateDeviceBrandDto } from './create-device-brand.dto' + +export class UpdateDeviceBrandDto extends PartialType(CreateDeviceBrandDto) {} diff --git a/src/modules/admin/devices/devices.controller.ts b/src/modules/admin/devices/devices.controller.ts new file mode 100644 index 0000000..dd468dd --- /dev/null +++ b/src/modules/admin/devices/devices.controller.ts @@ -0,0 +1,33 @@ +import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common' +import { DevicesService } from './devices.service' +import { CreateDeviceDto, UpdateDeviceDto } from './dto/device.dto' + +@Controller('admin/devices') +export class DevicesController { + constructor(private readonly devicesService: DevicesService) {} + + @Get() + async findAll() { + return this.devicesService.findAll() + } + + @Get(':id') + async findOne(@Param('id') id: string) { + return this.devicesService.findOne(id) + } + + @Post() + async create(@Body() data: CreateDeviceDto) { + return this.devicesService.create(data) + } + + @Put(':id') + async update(@Param('id') id: string, @Body() data: UpdateDeviceDto) { + return this.devicesService.update(id, data) + } + + @Delete(':id') + async delete(@Param('id') id: string) { + return this.devicesService.delete(id) + } +} diff --git a/src/modules/admin/devices/devices.module.ts b/src/modules/admin/devices/devices.module.ts new file mode 100644 index 0000000..8894441 --- /dev/null +++ b/src/modules/admin/devices/devices.module.ts @@ -0,0 +1,11 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' +import { DevicesController } from './devices.controller' +import { DevicesService } from './devices.service' + +@Module({ + imports: [PrismaModule], + controllers: [DevicesController], + providers: [DevicesService], +}) +export class AdminDevicesModule {} diff --git a/src/modules/admin/devices/devices.service.ts b/src/modules/admin/devices/devices.service.ts new file mode 100644 index 0000000..955adb8 --- /dev/null +++ b/src/modules/admin/devices/devices.service.ts @@ -0,0 +1,52 @@ +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { CreateDeviceDto, UpdateDeviceDto } from './dto/device.dto' + +@Injectable() +export class DevicesService { + constructor(private readonly prisma: PrismaService) {} + + async findAll(page = 1, pageSize = 10) { + const [items, count] = await this.prisma.$transaction([ + this.prisma.device.findMany({ + skip: (page - 1) * pageSize, + take: pageSize, + include: { brand: true }, + }), + this.prisma.device.count(), + ]) + return ResponseMapper.paginate(items, { count, page, pageSize }) + } + + async findOne(id: string) { + const item = await this.prisma.device.findUnique({ + where: { id }, + include: { brand: true }, + }) + return ResponseMapper.single(item) + } + + async create(data: CreateDeviceDto) { + const { brand_id, ...rest } = data + + const dataToCreate = { + ...rest, + brand: { connect: { id: brand_id } }, + } + const device = await this.prisma.device.create({ + data: dataToCreate, + }) + return ResponseMapper.create(device) + } + + async update(id: string, data: UpdateDeviceDto) { + const device = await this.prisma.device.update({ where: { id }, data }) + return ResponseMapper.update(device) + } + + async delete(id: string) { + await this.prisma.device.delete({ where: { id } }) + return ResponseMapper.delete() + } +} diff --git a/src/modules/admin/devices/dto/device.dto.ts b/src/modules/admin/devices/dto/device.dto.ts new file mode 100644 index 0000000..d8aac53 --- /dev/null +++ b/src/modules/admin/devices/dto/device.dto.ts @@ -0,0 +1,26 @@ +import { IsOptional, IsString } from 'class-validator' + +export class CreateDeviceDto { + @IsString() + name: string + + @IsOptional() + @IsString() + os_version?: string + + @IsString() + brand_id: string +} + +export class UpdateDeviceDto { + @IsOptional() + @IsString() + name?: string + + @IsOptional() + @IsString() + os_version?: string + + @IsOptional() + brand_id?: string +} diff --git a/src/modules/admin/guilds/dto/create-guild.dto.ts b/src/modules/admin/guilds/dto/create-guild.dto.ts new file mode 100644 index 0000000..b4e9afd --- /dev/null +++ b/src/modules/admin/guilds/dto/create-guild.dto.ts @@ -0,0 +1,10 @@ +import { IsOptional, IsString } from 'class-validator' + +export class CreateGuildDto { + @IsString() + name: string + + @IsOptional() + @IsString() + code?: string +} diff --git a/src/modules/admin/guilds/dto/update-guild.dto.ts b/src/modules/admin/guilds/dto/update-guild.dto.ts new file mode 100644 index 0000000..fd37e71 --- /dev/null +++ b/src/modules/admin/guilds/dto/update-guild.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/swagger' +import { CreateGuildDto } from './create-guild.dto' + +export class UpdateGuildDto extends PartialType(CreateGuildDto) {} diff --git a/src/modules/good-categories/dto/create-good-category.dto.ts b/src/modules/admin/guilds/good-categories/dto/create-good-category.dto.ts similarity index 100% rename from src/modules/good-categories/dto/create-good-category.dto.ts rename to src/modules/admin/guilds/good-categories/dto/create-good-category.dto.ts diff --git a/src/modules/admin/guilds/good-categories/good-categories.controller.ts b/src/modules/admin/guilds/good-categories/good-categories.controller.ts new file mode 100644 index 0000000..0e49f11 --- /dev/null +++ b/src/modules/admin/guilds/good-categories/good-categories.controller.ts @@ -0,0 +1,35 @@ +import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common' +import { + CreateGoodCategoryDto, + UpdateGoodCategoryDto, +} from './dto/create-good-category.dto' +import { GoodCategoriesService } from './good-categories.service' + +@Controller('admin/guilds/:guildId/good_categories') +export class GoodCategoriesController { + constructor(private readonly goodCategoriesService: GoodCategoriesService) {} + + @Get() + findAll(@Param('guildId') guildId: string) { + return this.goodCategoriesService.findAll(guildId) + } + + @Get(':id') + findOne(@Param('guildId') guildId: string, @Param('id') id: string) { + return this.goodCategoriesService.findOne(guildId, id) + } + + @Post() + create(@Param('guildId') guildId: string, @Body() data: CreateGoodCategoryDto) { + return this.goodCategoriesService.create(guildId, data) + } + + @Patch(':id') + update( + @Param('guildId') guildId: string, + @Param('id') id: string, + @Body() data: UpdateGoodCategoryDto, + ) { + return this.goodCategoriesService.update(guildId, id, data) + } +} diff --git a/src/modules/admin/guilds/good-categories/good-categories.module.ts b/src/modules/admin/guilds/good-categories/good-categories.module.ts new file mode 100644 index 0000000..c6432ce --- /dev/null +++ b/src/modules/admin/guilds/good-categories/good-categories.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common' +import { GoodCategoriesController } from './good-categories.controller' +import { GoodCategoriesService } from './good-categories.service' + +@Module({ + controllers: [GoodCategoriesController], + providers: [GoodCategoriesService], +}) +export class GuildGoodCategoriesModule {} diff --git a/src/modules/admin/guilds/good-categories/good-categories.service.ts b/src/modules/admin/guilds/good-categories/good-categories.service.ts new file mode 100644 index 0000000..a9583e6 --- /dev/null +++ b/src/modules/admin/guilds/good-categories/good-categories.service.ts @@ -0,0 +1,121 @@ +import { GoodCategoryOmit } from '@/generated/prisma/models' +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { + CreateGoodCategoryDto, + UpdateGoodCategoryDto, +} from './dto/create-good-category.dto' + +@Injectable() +export class GoodCategoriesService { + constructor(private prisma: PrismaService) {} + + private readonly goodCategoriesOmit = { + complex_id: true, + guild_id: true, + is_default_guild_good: true, + } as GoodCategoryOmit + + async findAll(guild_id: string) { + const categories = await this.prisma.goodCategory.findMany({ + where: { + guild_id, + is_default_guild_good: true, + }, + include: { + _count: { + select: { + goods: true, + }, + }, + }, + omit: this.goodCategoriesOmit, + }) + + return ResponseMapper.list( + categories.map(category => { + const { _count, ...rest } = category + return { + ...rest, + goods_count: Number(_count.goods), + } + }), + ) + } + + async findOne(guild_id: string, categoryId: string) { + const category = await this.prisma.goodCategory.findUnique({ + where: { + guild_id, + id: categoryId, + is_default_guild_good: true, + }, + include: { + _count: { + select: { + goods: true, + }, + }, + }, + omit: this.goodCategoriesOmit, + }) + + return ResponseMapper.single({ + ...category, + goods_count: Number(category?._count.goods), + }) + } + + create(guild_id: string, data: CreateGoodCategoryDto) { + const category = this.prisma.goodCategory.create({ + data: { + guild: { + connect: { + id: guild_id, + }, + }, + name: data.name, + image_url: data.image_url, + description: data.description, + is_default_guild_good: true, + }, + omit: this.goodCategoriesOmit, + }) + + return ResponseMapper.create({ ...category, goods_count: 0 }) + } + + async update(guild_id: string, id: string, data: UpdateGoodCategoryDto) { + const category = await this.prisma.goodCategory.update({ + where: { + guild_id, + id, + }, + data: { + guild: { + connect: { + id: guild_id, + }, + }, + name: data.name, + image_url: data.image_url, + description: data.description, + is_default_guild_good: true, + }, + include: { + _count: { + select: { + goods: true, + }, + }, + }, + omit: this.goodCategoriesOmit, + }) + + return ResponseMapper.update({ + ...category, + goods_count: Number(category?._count.goods), + }) + } +} diff --git a/src/modules/admin/guilds/goods/dto/create-good.dto.ts b/src/modules/admin/guilds/goods/dto/create-good.dto.ts new file mode 100644 index 0000000..b462033 --- /dev/null +++ b/src/modules/admin/guilds/goods/dto/create-good.dto.ts @@ -0,0 +1,39 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsNumber, IsOptional, IsString } from 'class-validator' + +export class CreateGoodDto { + @IsString() + @ApiProperty() + name: string + + @IsString() + @ApiProperty() + sku: string + + @IsOptional() + @IsString() + @ApiProperty({ required: true }) + category_id: string + + @IsString() + @IsOptional() + @ApiProperty({ required: false }) + local_sku?: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + barcode?: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + description?: string + + @IsOptional() + @IsNumber() + @ApiProperty({ required: false }) + base_sale_price?: number +} + +export class UpdateGoodDto extends PartialType(CreateGoodDto) {} diff --git a/src/modules/admin/guilds/goods/goods.controller.ts b/src/modules/admin/guilds/goods/goods.controller.ts new file mode 100644 index 0000000..c3abf47 --- /dev/null +++ b/src/modules/admin/guilds/goods/goods.controller.ts @@ -0,0 +1,23 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common' +import { CreateGoodDto } from './dto/create-good.dto' +import { GoodsService } from './goods.service' + +@Controller('admin/guilds/:guildId/goods') +export class GoodsController { + constructor(private readonly goodsService: GoodsService) {} + + @Get() + findAll(@Param('guildId') guildId: string) { + return this.goodsService.findAll(guildId) + } + + @Get(':id') + findOne(@Param('guildId') guildId: string, @Param('id') goodId: string) { + return this.goodsService.findOne(guildId, goodId) + } + + @Post() + create(@Param('guildId') guildId: string, @Body() data: CreateGoodDto) { + return this.goodsService.create(guildId, data) + } +} diff --git a/src/modules/admin/guilds/goods/goods.module.ts b/src/modules/admin/guilds/goods/goods.module.ts new file mode 100644 index 0000000..7ffaac1 --- /dev/null +++ b/src/modules/admin/guilds/goods/goods.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common' +import { GoodsController } from './goods.controller' +import { GoodsService } from './goods.service' + +@Module({ + controllers: [GoodsController], + providers: [GoodsService], +}) +export class GuildGoodsModule {} diff --git a/src/modules/admin/guilds/goods/goods.service.ts b/src/modules/admin/guilds/goods/goods.service.ts new file mode 100644 index 0000000..d4ef1dd --- /dev/null +++ b/src/modules/admin/guilds/goods/goods.service.ts @@ -0,0 +1,73 @@ +import { GoodOmit } from '@/generated/prisma/models' +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { CreateGoodDto } from './dto/create-good.dto' + +@Injectable() +export class GoodsService { + constructor(private prisma: PrismaService) {} + + private readonly goodOmit = { + complex_id: true, + barcode: true, + base_sale_price: true, + is_default_guild_good: true, + local_sku: true, + guild_id: true, + } as GoodOmit + + async findAll(guildId: string) { + const [goods, count] = await this.prisma.$transaction([ + this.prisma.good.findMany({ + where: { + guild_id: guildId, + is_default_guild_good: true, + }, + omit: this.goodOmit, + }), + this.prisma.good.count(), + ]) + return ResponseMapper.paginate(goods, { + count, + }) + } + + async findOne(guild_id: string, id: string) { + const good = await this.prisma.good.findUnique({ + where: { + guild_id, + id, + is_default_guild_good: true, + }, + + omit: this.goodOmit, + }) + + return ResponseMapper.single(good) + } + + async create(guild_id: string, data: CreateGoodDto) { + const { category_id, ...rest } = data + + const good = await this.prisma.good.create({ + data: { + guild: { + connect: { + id: guild_id, + }, + }, + category: { + connect: { + id: category_id, + }, + }, + ...rest, + is_default_guild_good: true, + }, + omit: this.goodOmit, + }) + + return ResponseMapper.create(good) + } +} diff --git a/src/modules/admin/guilds/guilds.controller.ts b/src/modules/admin/guilds/guilds.controller.ts new file mode 100644 index 0000000..a1d3e9a --- /dev/null +++ b/src/modules/admin/guilds/guilds.controller.ts @@ -0,0 +1,37 @@ +import { Body, Controller, Get, Param, Post, Put } from '@nestjs/common' +import { ApiTags } from '@nestjs/swagger' +import { CreateGuildDto } from './dto/create-guild.dto' +import { UpdateGuildDto } from './dto/update-guild.dto' +import { GuildsService } from './guilds.service' + +@ApiTags('guilds') +@Controller('admin/guilds') +export class GuildsController { + constructor(private readonly guildsService: GuildsService) {} + + @Get() + async findAll() { + return this.guildsService.findAll() + } + + @Get(':id') + async findOne(@Param('id') id: string) { + return this.guildsService.findOne(id) + } + + @Post() + async create(@Body() data: CreateGuildDto) { + return await this.guildsService.create(data) + } + + @Put(':id') + async update(@Param('id') id: string, @Body() data: UpdateGuildDto) { + return await this.guildsService.update(id, data) + } + + // @Delete(':id') + // async delete(@Param('id') id: string) { + // await this.guildsService.delete(id) + // return ResponseMapper.delete() + // } +} diff --git a/src/modules/admin/guilds/guilds.module.ts b/src/modules/admin/guilds/guilds.module.ts new file mode 100644 index 0000000..18827c8 --- /dev/null +++ b/src/modules/admin/guilds/guilds.module.ts @@ -0,0 +1,13 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' +import { GuildGoodCategoriesModule } from './good-categories/good-categories.module' +import { GuildGoodsModule } from './goods/goods.module' +import { GuildsController } from './guilds.controller' +import { GuildsService } from './guilds.service' + +@Module({ + imports: [PrismaModule, GuildGoodsModule, GuildGoodCategoriesModule], + providers: [GuildsService], + controllers: [GuildsController], +}) +export class AdminGuildsModule {} diff --git a/src/modules/admin/guilds/guilds.service.ts b/src/modules/admin/guilds/guilds.service.ts new file mode 100644 index 0000000..3d4e2a7 --- /dev/null +++ b/src/modules/admin/guilds/guilds.service.ts @@ -0,0 +1,66 @@ +import { ResponseMapper } from '@/common/response/response-mapper' +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { CreateGuildDto } from './dto/create-guild.dto' +import { UpdateGuildDto } from './dto/update-guild.dto' + +@Injectable() +export class GuildsService { + constructor(private prisma: PrismaService) {} + + async findAll() { + const [guilds, count] = await this.prisma.$transaction([ + this.prisma.guild.findMany({ + include: { + _count: { + select: { + business_activities: true, + }, + }, + }, + }), + this.prisma.guild.count(), + ]) + + return ResponseMapper.paginate( + guilds.map(guild => { + const { _count, ...rest } = guild + return { + ...rest, + businessActivitiesCount: guild._count.business_activities, + } + }), + { count }, + ) + } + + async findOne(id: string) { + const guild = await this.prisma.guild.findUnique({ + where: { id }, + include: { + business_activities: { + omit: { + guild_id: true, + }, + }, + }, + }) + + return ResponseMapper.single(guild) + } + + async create(data: CreateGuildDto) { + const guild = await this.prisma.guild.create({ data }) + return ResponseMapper.create(guild) + } + + async update(id: string, data: UpdateGuildDto) { + const guild = await this.prisma.guild.update({ where: { id }, data }) + return ResponseMapper.update(guild) + } + + // async delete(id: string) { + // await this.prisma.guild.delete({ where: { id } }) + // return ResponseMapper. + // } +} diff --git a/src/modules/admin/licenses/dto/license.dto.ts b/src/modules/admin/licenses/dto/license.dto.ts new file mode 100644 index 0000000..faa1bab --- /dev/null +++ b/src/modules/admin/licenses/dto/license.dto.ts @@ -0,0 +1,41 @@ +import { ApiProperty } from '@nestjs/swagger' +import { IsDateString, IsEnum, IsOptional, IsString } from 'class-validator' +import { LicenseStatus } from 'generated/prisma/enums' + +export class CreateLicenseDto { + @IsString() + @ApiProperty() + account_id: string + + @IsString() + @ApiProperty() + pos_id: string + + @IsString() + @ApiProperty({ required: true }) + partner_id: string + + @IsDateString() + @IsOptional() + @ApiProperty({ required: false }) + starts_at: string + + @IsDateString() + @IsOptional() + @ApiProperty({ required: false }) + expires_at: string +} + +export class UpdateLicenseDto { + @IsString() + pos_id?: string + + @IsDateString() + starts_at?: string + + @IsDateString() + expires_at?: string + + @IsEnum(LicenseStatus) + status?: LicenseStatus +} diff --git a/src/modules/admin/licenses/licenses.controller.ts b/src/modules/admin/licenses/licenses.controller.ts new file mode 100644 index 0000000..20e7c72 --- /dev/null +++ b/src/modules/admin/licenses/licenses.controller.ts @@ -0,0 +1,33 @@ +import { Body, Controller, Get, Param, Post, Put } from '@nestjs/common' +import { CreateLicenseDto, UpdateLicenseDto } from './dto/license.dto' +import { PartnerLicensesService } from './licenses.service' + +@Controller('admin/licenses') +export class LicensesController { + constructor(private readonly licensesService: PartnerLicensesService) {} + + @Get() + async findAll() { + return this.licensesService.findAll() + } + + @Get(':id') + async findOne(@Param('id') id: string) { + return this.licensesService.findOne(id) + } + + @Post() + async create(@Body() data: CreateLicenseDto) { + return this.licensesService.create(data) + } + + @Put(':id') + async update(@Param('id') id: string, @Body() data: UpdateLicenseDto) { + return this.licensesService.update(id, data) + } + + // @Delete(':id') + // async delete(@Param('id') id: string) { + // return this.licensesService.delete(id) + // } +} diff --git a/src/modules/admin/licenses/licenses.module.ts b/src/modules/admin/licenses/licenses.module.ts new file mode 100644 index 0000000..af79828 --- /dev/null +++ b/src/modules/admin/licenses/licenses.module.ts @@ -0,0 +1,12 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' +import { LicensesController } from './licenses.controller' +import { PartnerLicensesService } from './licenses.service' + +@Module({ + imports: [PrismaModule], + controllers: [LicensesController], + providers: [PartnerLicensesService], + exports: [PartnerLicensesService], +}) +export class AdminLicensesModule {} diff --git a/src/modules/admin/licenses/licenses.service.ts b/src/modules/admin/licenses/licenses.service.ts new file mode 100644 index 0000000..fb0c848 --- /dev/null +++ b/src/modules/admin/licenses/licenses.service.ts @@ -0,0 +1,122 @@ +import { LicenseInclude } from '@/generated/prisma/models' +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { LicenseStatus } from 'generated/prisma/enums' +import { CreateLicenseDto, UpdateLicenseDto } from './dto/license.dto' + +@Injectable() +export class PartnerLicensesService { + constructor(private readonly prisma: PrismaService) {} + + private readonly licenseInclude = { + partner: true, + pos: { + include: { + complex: true, + provider: true, + accounts: { + include: { + user: true, + }, + omit: { + business_id: true, + partner_id: true, + provider_id: true, + pos_id: true, + }, + }, + device: { + include: { + brand: true, + }, + omit: { + brand_id: true, + }, + }, + }, + }, + } as LicenseInclude + + async findAll() { + const [licenses, count] = await this.prisma.$transaction([ + this.prisma.license.findMany({ + include: this.licenseInclude, + omit: { + pos_id: true, + partner_id: true, + }, + }), + this.prisma.license.count(), + ]) + return ResponseMapper.paginate( + licenses.map(license => { + const { pos, ...rest } = license + // @ts-ignore + const { accounts, ...posRest } = pos + return { + account: accounts[0], + pos: posRest, + ...rest, + } + }), + { + count, + }, + ) + } + + async findOne(id: string) { + const license = await this.prisma.license.findFirst({ + where: { id }, + include: this.licenseInclude, + omit: { + pos_id: true, + partner_id: true, + }, + }) + if (license) { + const { pos, ...rest } = license + // @ts-ignore + const { accounts, ...posRest } = pos + return ResponseMapper.single({ + account: accounts[0], + pos: posRest, + ...rest, + }) + } + + return ResponseMapper.single(license) + } + + async create(data: CreateLicenseDto) { + const date = new Date(data.starts_at || '') + const expiresAt = + data.expires_at || new Date(date.setFullYear(date.getFullYear() + 1)) + + const license = await this.prisma.license.create({ + data: { + partner_id: data.partner_id, + pos_id: data.pos_id, + starts_at: date, + expires_at: expiresAt, + status: LicenseStatus.ACTIVE, + }, + }) + + return ResponseMapper.create(license) + } + + async update(id: string, data: UpdateLicenseDto) { + const license = await this.prisma.license.update({ + where: { id }, + data: { ...data }, + }) + return ResponseMapper.update(license) + } + + async delete(id: string) { + await this.prisma.license.delete({ where: { id } }) + return ResponseMapper.delete() + } +} diff --git a/src/modules/admin/partners/dto/partner.dto.ts b/src/modules/admin/partners/dto/partner.dto.ts new file mode 100644 index 0000000..55ee46f --- /dev/null +++ b/src/modules/admin/partners/dto/partner.dto.ts @@ -0,0 +1,20 @@ +import { IsOptional, IsString } from 'class-validator' + +export class CreatePartnerDto { + @IsString() + name: string + + @IsOptional() + @IsString() + code?: string +} + +export class UpdatePartnerDto { + @IsOptional() + @IsString() + name?: string + + @IsOptional() + @IsString() + code?: string +} diff --git a/src/modules/admin/partners/licenses/dto/license.dto.ts b/src/modules/admin/partners/licenses/dto/license.dto.ts new file mode 100644 index 0000000..8476932 --- /dev/null +++ b/src/modules/admin/partners/licenses/dto/license.dto.ts @@ -0,0 +1,71 @@ +import { IsDateString, IsEnum, IsOptional, IsString } from 'class-validator' +import { AccountStatus, LicenseStatus, POSType } from 'generated/prisma/enums' + +export class CreateLicenseDto { + @IsString() + first_name: string + + @IsString() + last_name: string + + @IsString() + mobile_number: string + + @IsString() + national_code: string + + @IsString() + username: string + + @IsString() + password: string + + @IsEnum(AccountStatus) + account_status: AccountStatus + + @IsString() + guild: string + + @IsString() + business_activity_name: string + + @IsString() + tax_id: string + + @IsString() + complex_name: string + + @IsString() + pos_serial: string + + @IsString() + pos_status: string + + @IsEnum(POSType) + pos_type: POSType + + @IsString() + pos_device: string + + @IsDateString() + @IsOptional() + starts_at: string + + @IsDateString() + @IsOptional() + expires_at: string +} + +export class UpdateLicenseDto { + @IsString() + pos_id?: string + + @IsDateString() + starts_at?: string + + @IsDateString() + expires_at?: string + + @IsEnum(LicenseStatus) + status?: LicenseStatus +} diff --git a/src/modules/admin/partners/licenses/licenses.controller.ts b/src/modules/admin/partners/licenses/licenses.controller.ts new file mode 100644 index 0000000..8b53893 --- /dev/null +++ b/src/modules/admin/partners/licenses/licenses.controller.ts @@ -0,0 +1,37 @@ +import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common' +import { CreateLicenseDto, UpdateLicenseDto } from './dto/license.dto' +import { PartnerLicensesService } from './licenses.service' + +@Controller('admin/partners/:partnerId/licenses') +export class PartnerLicensesController { + constructor(private readonly licensesService: PartnerLicensesService) {} + + @Get() + async findAll(@Param('partnerId') partnerId: string) { + return this.licensesService.findAll(partnerId) + } + + @Get(':id') + async findOne(@Param('partnerId') partnerId: string, @Param('id') id: string) { + return this.licensesService.findOne(partnerId, id) + } + + @Post() + async create(@Param('partnerId') partnerId: string, @Body() data: CreateLicenseDto) { + return this.licensesService.create(partnerId, data) + } + + @Put(':id') + async update( + @Param('partnerId') partnerId: string, + @Param('id') id: string, + @Body() data: UpdateLicenseDto, + ) { + return this.licensesService.update(partnerId, id, data) + } + + @Delete(':id') + async delete(@Param('partnerId') partnerId: string, @Param('id') id: string) { + return this.licensesService.delete(partnerId, id) + } +} diff --git a/src/modules/admin/partners/licenses/licenses.module.ts b/src/modules/admin/partners/licenses/licenses.module.ts new file mode 100644 index 0000000..32e1db8 --- /dev/null +++ b/src/modules/admin/partners/licenses/licenses.module.ts @@ -0,0 +1,12 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' +import { PartnerLicensesController } from './licenses.controller' +import { PartnerLicensesService } from './licenses.service' + +@Module({ + imports: [PrismaModule], + controllers: [PartnerLicensesController], + providers: [PartnerLicensesService], + exports: [PartnerLicensesService], +}) +export class AdminPartnerLicensesModule {} diff --git a/src/modules/admin/partners/licenses/licenses.service.ts b/src/modules/admin/partners/licenses/licenses.service.ts new file mode 100644 index 0000000..338906f --- /dev/null +++ b/src/modules/admin/partners/licenses/licenses.service.ts @@ -0,0 +1,197 @@ +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { CreateLicenseDto, UpdateLicenseDto } from './dto/license.dto' + +@Injectable() +export class PartnerLicensesService { + constructor(private readonly prisma: PrismaService) {} + + async findAll(partnerId: string) { + const licenses = await this.prisma.license.findMany({ + where: { partner_id: partnerId }, + include: { + pos: { + include: { + complex: true, + provider: true, + + accounts: { + include: { + user: true, + }, + omit: { + business_id: true, + partner_id: true, + provider_id: true, + pos_id: true, + }, + }, + device: { + include: { + brand: true, + }, + omit: { + brand_id: true, + }, + }, + }, + }, + }, + omit: { + pos_id: true, + partner_id: true, + }, + }) + return ResponseMapper.list( + licenses.map(license => { + const { pos, ...rest } = license + const { accounts, ...posRest } = pos + return { + account: accounts[0], + pos: posRest, + ...rest, + } + }), + ) + } + + async findOne(partnerId: string, id: string) { + const license = await this.prisma.license.findFirst({ + where: { id, partner_id: partnerId }, + include: { + pos: { + include: { + complex: true, + provider: true, + + accounts: { + include: { + user: true, + }, + omit: { + business_id: true, + partner_id: true, + provider_id: true, + pos_id: true, + }, + }, + device: { + include: { + brand: true, + }, + omit: { + brand_id: true, + }, + }, + }, + }, + }, + omit: { + pos_id: true, + partner_id: true, + }, + }) + if (license) { + const { pos, ...rest } = license + const { accounts, ...posRest } = pos + return ResponseMapper.single({ + account: accounts[0], + pos: posRest, + ...rest, + }) + } + + return ResponseMapper.single(license) + } + + async create(partnerId: string, data: CreateLicenseDto) { + // const license = await this.prisma.$transaction(async tx => { + // const user = await tx.user.upsert({ + // where: { + // mobile_number: data.mobile_number, + // }, + // update: {}, + // create: { + // first_name: data.first_name, + // last_name: data.last_name, + // mobile_number: data.mobile_number, + // national_code: data.national_code, + // }, + // }) + + // const business = await tx.businessActivity.create({ + // data: { + // name: data.business_activity_name, + // guild_id: data.guild, + // user: { + // connect: { + // id: user.id, + // }, + // }, + // }, + // }) + + // const complex = await tx.complex.create({ + // data: { + // name: data.complex_name, + // tax_id: data.tax_id, + // business_activity_id: business.id, + // }, + // }) + + // const pos = await tx.pos.create({ + // data: { + // pos_type: data.pos_type, + // serial: data.pos_serial, + // device_id: data.pos_device, + // complex_id: complex.id, + // }, + // }) + + // const date = new Date() + // const expiresAt = new Date(date.setFullYear(date.getFullYear() + 1)) + + // const license = await tx.license.create({ + // data: { + // partner_id: partnerId, + // pos_id: pos.id, + // starts_at: data.starts_at || new Date(), + // expires_at: data.expires_at || expiresAt, + // status: LicenseStatus.ACTIVE, + // }, + // }) + + // const hashedPassword = await PasswordUtil.hash(data.password) + + // const account = await tx.account.create({ + // data: { + // username: data.username, + // password: hashedPassword, + // type: AccountType.POS, + // user_id: user.id, + // pos_id: pos.id, + // status: data.account_status, + // }, + // }) + + // return { + // license, + // } + // }) + return ResponseMapper.create('license') + } + + async update(partnerId: string, id: string, data: UpdateLicenseDto) { + const license = await this.prisma.license.update({ + where: { id }, + data: { ...data, partner_id: partnerId }, + }) + return ResponseMapper.update(license) + } + + async delete(partnerId: string, id: string) { + await this.prisma.license.delete({ where: { id } }) + return ResponseMapper.delete() + } +} diff --git a/src/modules/admin/partners/partnerAccounts/accounts.controller.ts b/src/modules/admin/partners/partnerAccounts/accounts.controller.ts new file mode 100644 index 0000000..67b0edf --- /dev/null +++ b/src/modules/admin/partners/partnerAccounts/accounts.controller.ts @@ -0,0 +1,33 @@ +import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common' +import { AccountsService } from './accounts.service' +import { CreateAccountDto, UpdateAccountDto } from './dto/account.dto' + +@Controller('admin/partners/:partnerId/accounts') +export class AccountsController { + constructor(private readonly accountsService: AccountsService) {} + + @Get() + async findAll(@Param('partnerId') partnerId: string) { + return this.accountsService.findAll(partnerId) + } + + @Get(':id') + async findOne(@Param('id') id: string) { + return this.accountsService.findOne(id) + } + + @Post() + async create(@Param('partnerId') partnerId: string, @Body() data: CreateAccountDto) { + return this.accountsService.create(partnerId, data) + } + + @Put(':id') + async update(@Param('id') id: string, @Body() data: UpdateAccountDto) { + return this.accountsService.update(id, data) + } + + @Delete(':id') + async delete(@Param('id') id: string) { + return this.accountsService.delete(id) + } +} diff --git a/src/modules/admin/partners/partnerAccounts/accounts.module.ts b/src/modules/admin/partners/partnerAccounts/accounts.module.ts new file mode 100644 index 0000000..9a97fff --- /dev/null +++ b/src/modules/admin/partners/partnerAccounts/accounts.module.ts @@ -0,0 +1,12 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' +import { AccountsController } from './accounts.controller' +import { AccountsService } from './accounts.service' + +@Module({ + imports: [PrismaModule], + controllers: [AccountsController], + providers: [AccountsService], + exports: [AccountsService], +}) +export class AdminPartnerAccountsModule {} diff --git a/src/modules/admin/partners/partnerAccounts/accounts.service.ts b/src/modules/admin/partners/partnerAccounts/accounts.service.ts new file mode 100644 index 0000000..df2cb14 --- /dev/null +++ b/src/modules/admin/partners/partnerAccounts/accounts.service.ts @@ -0,0 +1,82 @@ +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { PasswordUtil } from 'common/utils/password.util' +import { AccountType } from 'generated/prisma/enums' +import { CreateAccountDto, UpdateAccountDto } from './dto/account.dto' + +@Injectable() +export class AccountsService { + constructor(private readonly prisma: PrismaService) {} + + async findAll(partnerId: string) { + const accounts = await this.prisma.account.findMany({ + where: { partner_id: partnerId }, + omit: { + password: true, + user_id: true, + partner_id: true, + type: true, + pos_id: true, + provider_id: true, + business_id: true, + }, + }) + return ResponseMapper.list(accounts) + } + + async findOne(id: string) { + const account = await this.prisma.account.findUnique({ + where: { id }, + omit: { password: true, user_id: true }, + include: { + partner: true, + user: true, + }, + }) + return ResponseMapper.single(account) + } + + async create(partnerId: string, data: CreateAccountDto) { + const { username, status, password, ...userData } = data + + const result = await this.prisma.$transaction(async tx => { + let user = await tx.user.upsert({ + where: { + mobile_number: userData.mobile_number, + }, + update: {}, + create: userData, + }) + + const hashedPassword = await PasswordUtil.hash(password) + + const dataToCreate = { + username, + status, + password: hashedPassword, + user_id: user.id, + type: AccountType.PARTNER, + partner_id: partnerId, // Connect account to partner + } + + const account = await tx.account.create({ + data: dataToCreate, + }) + + return account + }) + + return ResponseMapper.create(result) + } + + async update(id: string, data: UpdateAccountDto) { + const account = await this.prisma.account.update({ where: { id }, data }) + return ResponseMapper.update(account) + } + + async delete(id: string) { + await this.prisma.account.delete({ where: { id } }) + return ResponseMapper.delete() + } +} diff --git a/src/modules/admin/partners/partnerAccounts/dto/account.dto.ts b/src/modules/admin/partners/partnerAccounts/dto/account.dto.ts new file mode 100644 index 0000000..e2a3307 --- /dev/null +++ b/src/modules/admin/partners/partnerAccounts/dto/account.dto.ts @@ -0,0 +1,36 @@ +import { IsEnum, IsOptional, IsString } from 'class-validator' +import { AccountStatus, AccountType } from 'generated/prisma/enums' +import { CreateUserDto } from '../../../users/dto/user.dto' + +export class CreateAccountDto extends CreateUserDto { + @IsString() + username: string + + @IsEnum(AccountStatus) + status: AccountStatus + + @IsString() + password: string +} + +export class UpdateAccountDto { + @IsOptional() + @IsString() + username?: string + + @IsOptional() + @IsEnum(AccountType) + type?: AccountType + + @IsOptional() + @IsEnum(AccountStatus) + status?: AccountStatus + + @IsOptional() + @IsString() + password?: string + + @IsOptional() + @IsString() + user_id?: string +} diff --git a/src/modules/admin/partners/partners.controller.ts b/src/modules/admin/partners/partners.controller.ts new file mode 100644 index 0000000..46f4046 --- /dev/null +++ b/src/modules/admin/partners/partners.controller.ts @@ -0,0 +1,33 @@ +import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common' +import { CreatePartnerDto, UpdatePartnerDto } from './dto/partner.dto' +import { PartnersService } from './partners.service' + +@Controller('admin/partners') +export class PartnersController { + constructor(private readonly partnersService: PartnersService) {} + + @Get() + async findAll() { + return this.partnersService.findAll() + } + + @Get(':id') + async findOne(@Param('id') id: string) { + return this.partnersService.findOne(id) + } + + @Post() + async create(@Body() data: CreatePartnerDto) { + return this.partnersService.create(data) + } + + @Put(':id') + async update(@Param('id') id: string, @Body() data: UpdatePartnerDto) { + return this.partnersService.update(id, data) + } + + @Delete(':id') + async delete(@Param('id') id: string) { + return this.partnersService.delete(id) + } +} diff --git a/src/modules/admin/partners/partners.module.ts b/src/modules/admin/partners/partners.module.ts new file mode 100644 index 0000000..27c7433 --- /dev/null +++ b/src/modules/admin/partners/partners.module.ts @@ -0,0 +1,15 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' + +import { AdminPartnerLicensesModule } from './licenses/licenses.module' +import { AdminPartnerAccountsModule } from './partnerAccounts/accounts.module' +import { PartnersController } from './partners.controller' +import { PartnersService } from './partners.service' + +@Module({ + imports: [PrismaModule, AdminPartnerLicensesModule, AdminPartnerAccountsModule], + controllers: [PartnersController], + providers: [PartnersService], + exports: [PartnersService], +}) +export class AdminPartnersModule {} diff --git a/src/modules/admin/partners/partners.service.ts b/src/modules/admin/partners/partners.service.ts new file mode 100644 index 0000000..239b889 --- /dev/null +++ b/src/modules/admin/partners/partners.service.ts @@ -0,0 +1,36 @@ +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { CreatePartnerDto, UpdatePartnerDto } from './dto/partner.dto' + +@Injectable() +export class PartnersService { + constructor(private readonly prisma: PrismaService) {} + + async findAll() { + const partners = await this.prisma.partner.findMany() + return ResponseMapper.list(partners) + } + + async findOne(id: string) { + const partner = await this.prisma.partner.findUnique({ + where: { id }, + }) + return ResponseMapper.single(partner) + } + + async create(data: CreatePartnerDto) { + const partner = await this.prisma.partner.create({ data }) + return ResponseMapper.create(partner) + } + + async update(id: string, data: UpdatePartnerDto) { + const partner = await this.prisma.partner.update({ where: { id }, data }) + return ResponseMapper.update(partner) + } + + async delete(id: string) { + await this.prisma.partner.delete({ where: { id } }) + return ResponseMapper.delete() + } +} diff --git a/src/modules/admin/providers/dto/provider.dto.ts b/src/modules/admin/providers/dto/provider.dto.ts new file mode 100644 index 0000000..337adf9 --- /dev/null +++ b/src/modules/admin/providers/dto/provider.dto.ts @@ -0,0 +1,20 @@ +import { IsOptional, IsString } from 'class-validator' + +export class CreateProviderDto { + @IsString() + name: string + + @IsOptional() + @IsString() + code?: string +} + +export class UpdateProviderDto { + @IsOptional() + @IsString() + name?: string + + @IsOptional() + @IsString() + code?: string +} diff --git a/src/modules/admin/providers/providers.controller.ts b/src/modules/admin/providers/providers.controller.ts new file mode 100644 index 0000000..613a946 --- /dev/null +++ b/src/modules/admin/providers/providers.controller.ts @@ -0,0 +1,35 @@ +import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common' +import { ApiTags } from '@nestjs/swagger' +import { CreateProviderDto, UpdateProviderDto } from './dto/provider.dto' +import { ProvidersService } from './providers.service' + +@ApiTags('Admin Partners') +@Controller('admin/providers') +export class ProvidersController { + constructor(private readonly providersService: ProvidersService) {} + + @Get() + async findAll() { + return this.providersService.findAll() + } + + @Get(':id') + async findOne(@Param('id') id: string) { + return this.providersService.findOne(id) + } + + @Post() + async create(@Body() data: CreateProviderDto) { + return this.providersService.create(data) + } + + @Put(':id') + async update(@Param('id') id: string, @Body() data: UpdateProviderDto) { + return this.providersService.update(id, data) + } + + @Delete(':id') + async delete(@Param('id') id: string) { + return this.providersService.delete(id) + } +} diff --git a/src/modules/admin/providers/providers.module.ts b/src/modules/admin/providers/providers.module.ts new file mode 100644 index 0000000..1334bde --- /dev/null +++ b/src/modules/admin/providers/providers.module.ts @@ -0,0 +1,12 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' +import { ProvidersController } from './providers.controller' +import { ProvidersService } from './providers.service' + +@Module({ + imports: [PrismaModule], + controllers: [ProvidersController], + providers: [ProvidersService], + exports: [ProvidersService], +}) +export class AdminProvidersModule {} diff --git a/src/modules/admin/providers/providers.service.ts b/src/modules/admin/providers/providers.service.ts new file mode 100644 index 0000000..efbcbd0 --- /dev/null +++ b/src/modules/admin/providers/providers.service.ts @@ -0,0 +1,37 @@ +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { CreateProviderDto, UpdateProviderDto } from './dto/provider.dto' + +@Injectable() +export class ProvidersService { + constructor(private readonly prisma: PrismaService) {} + + async findAll() { + const providers = await this.prisma.provider.findMany() + return ResponseMapper.list(providers) + } + + async findOne(id: string) { + const provider = await this.prisma.provider.findUnique({ + where: { id }, + include: { pos_list: true, accounts: true }, + }) + return ResponseMapper.single(provider) + } + + async create(data: CreateProviderDto) { + const provider = await this.prisma.provider.create({ data }) + return ResponseMapper.create(provider) + } + + async update(id: string, data: UpdateProviderDto) { + const provider = await this.prisma.provider.update({ where: { id }, data }) + return ResponseMapper.update(provider) + } + + async delete(id: string) { + await this.prisma.provider.delete({ where: { id } }) + return ResponseMapper.delete() + } +} diff --git a/src/modules/admin/translate/translate.controller.ts b/src/modules/admin/translate/translate.controller.ts new file mode 100644 index 0000000..c3126d4 --- /dev/null +++ b/src/modules/admin/translate/translate.controller.ts @@ -0,0 +1,12 @@ +import { Controller, Get } from '@nestjs/common' +import { TranslateService } from './translate.service' + +@Controller('admin/translates') +export class TranslateController { + constructor(private readonly translateService: TranslateService) {} + + @Get() + async getTranslations() { + return this.translateService.getTranslations() + } +} diff --git a/src/modules/admin/translate/translate.module.ts b/src/modules/admin/translate/translate.module.ts new file mode 100644 index 0000000..2d04560 --- /dev/null +++ b/src/modules/admin/translate/translate.module.ts @@ -0,0 +1,10 @@ +import { Module } from '@nestjs/common' +import { TranslateController } from './translate.controller' +import { TranslateService } from './translate.service' + +@Module({ + controllers: [TranslateController], + providers: [TranslateService], + exports: [TranslateService], +}) +export class AdminTranslateModule {} diff --git a/src/modules/admin/translate/translate.service.ts b/src/modules/admin/translate/translate.service.ts new file mode 100644 index 0000000..8720b8f --- /dev/null +++ b/src/modules/admin/translate/translate.service.ts @@ -0,0 +1,68 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' + +@Injectable() +export class TranslateService { + getTranslations() { + return ResponseMapper.single({ + attributes: { + id: 'شناسه', + username: 'نام کاربری', + status: 'وضعیت', + created_at: 'تاریخ ایجاد', + updated_at: 'تاریخ بروزرسانی', + actions: 'عملیات', + first_name: 'نام', + last_name: 'نام خانوادگی', + mobile_number: 'تلفن همراه', + national_code: 'کد ملی', + name: 'عنوان', + os_version: 'نسخه سیستم عامل', + code: 'کد شناسایی', + fullname: 'نام کامل', + 'brand.name': 'عنوان برند', + 'pos.name': 'عنوان صنف', + 'pos.complex.name': 'عنوان مجموعه', + 'pos.devices.name': 'عنوان دستگاه', + 'pos.provider.name': 'عنوان ارایه‌دهنده', + goods_count: 'تعداد کالاها', + brand: 'برند', + licenses: 'لایسنس', + business_activity: 'فعالیت‌ اقتصادی', + user: 'کاربر', + }, + singular: { + users: 'کاربر', + devices: 'دستگاه', + device_brands: 'برند', + guilds: 'صنف', + guild_goods: 'کالا', + guild_good_categories: 'دسته‌بندی کالا', + partners: 'شریک تجاری', + partner_accounts: 'حساب', + partner_licenses: 'مجوز', + providers: 'ارائه‌دهنده', + provider_accounts: 'حساب', + accounts: 'حساب کاربری', + licenses: 'لایسنس', + business_activities: 'فعالیت‌ اقتصادی', + }, + plural: { + users: 'کاربران', + devices: 'دستگاه‌ها', + device_brands: 'برندها', + guilds: 'اصناف', + guild_goods: 'کالاها', + guild_good_categories: 'دسته‌بندی کالاها', + partners: 'شرکای تجاری', + partner_accounts: 'حساب‌های شریک تجاری', + partner_licenses: 'مجوزهای داده شده', + providers: 'ارائه‌دهندگان', + provider_accounts: 'حساب‌های ارائه‌دهنده', + accounts: 'حساب‌های کاربری', + licenses: 'لایسنس‌ها', + business_activities: 'فعالیت‌های اقتصادی', + }, + }) + } +} diff --git a/src/modules/admin/users/accounts/accounts.controller.ts b/src/modules/admin/users/accounts/accounts.controller.ts new file mode 100644 index 0000000..90e26ac --- /dev/null +++ b/src/modules/admin/users/accounts/accounts.controller.ts @@ -0,0 +1,35 @@ +import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common' +import { ApiTags } from '@nestjs/swagger' +import { AccountsService } from './accounts.service' +import { CreateAccountDto, UpdateAccountDto } from './dto/account.dto' + +@ApiTags('AdminAccounts') +@Controller('admin/users/:userId/accounts') +export class AccountsController { + constructor(private readonly accountsService: AccountsService) {} + + @Get() + async findAll(@Param('userId') userId: string) { + return this.accountsService.findAll(userId) + } + + @Get(':id') + async findOne(@Param('id') id: string) { + return this.accountsService.findOne(id) + } + + @Post() + async create(@Body() data: CreateAccountDto) { + return this.accountsService.create(data) + } + + @Put(':id') + async update(@Param('id') id: string, @Body() data: UpdateAccountDto) { + return this.accountsService.update(id, data) + } + + @Delete(':id') + async delete(@Param('id') id: string) { + return this.accountsService.delete(id) + } +} diff --git a/src/modules/admin/users/accounts/accounts.module.ts b/src/modules/admin/users/accounts/accounts.module.ts new file mode 100644 index 0000000..87fcf82 --- /dev/null +++ b/src/modules/admin/users/accounts/accounts.module.ts @@ -0,0 +1,12 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' +import { AccountsController } from './accounts.controller' +import { AccountsService } from './accounts.service' + +@Module({ + imports: [PrismaModule], + controllers: [AccountsController], + providers: [AccountsService], + exports: [AccountsService], +}) +export class AdminUserAccountsModule {} diff --git a/src/modules/admin/users/accounts/accounts.service.ts b/src/modules/admin/users/accounts/accounts.service.ts new file mode 100644 index 0000000..a2a66c6 --- /dev/null +++ b/src/modules/admin/users/accounts/accounts.service.ts @@ -0,0 +1,47 @@ +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { CreateAccountDto, UpdateAccountDto } from './dto/account.dto' + +@Injectable() +export class AccountsService { + constructor(private readonly prisma: PrismaService) {} + + async findAll(userId: string) { + const accounts = await this.prisma.account.findMany({ + where: { user_id: userId }, + omit: { password: true, user_id: true }, + }) + return ResponseMapper.list(accounts) + } + + async findOne(id: string) { + const account = await this.prisma.account.findUnique({ + where: { id }, + omit: { password: true, user_id: true }, + include: { + pos: true, + business: true, + provider: true, + partner: true, + }, + }) + return ResponseMapper.single(account) + } + + async create(data: CreateAccountDto) { + // Assuming password hashing is handled elsewhere or add bcrypt here + const account = await this.prisma.account.create({ data }) + return ResponseMapper.create(account) + } + + async update(id: string, data: UpdateAccountDto) { + const account = await this.prisma.account.update({ where: { id }, data }) + return ResponseMapper.update(account) + } + + async delete(id: string) { + await this.prisma.account.delete({ where: { id } }) + return ResponseMapper.delete() + } +} diff --git a/src/modules/admin/users/accounts/dto/account.dto.ts b/src/modules/admin/users/accounts/dto/account.dto.ts new file mode 100644 index 0000000..f7ccdeb --- /dev/null +++ b/src/modules/admin/users/accounts/dto/account.dto.ts @@ -0,0 +1,41 @@ +import { IsEnum, IsOptional, IsString } from 'class-validator' +import { AccountStatus, AccountType } from 'generated/prisma/enums' + +export class CreateAccountDto { + @IsString() + username: string + + @IsEnum(AccountType) + type: AccountType + + @IsEnum(AccountStatus) + status: AccountStatus + + @IsString() + password: string + + @IsString() + user_id: string +} + +export class UpdateAccountDto { + @IsOptional() + @IsString() + username?: string + + @IsOptional() + @IsEnum(AccountType) + type?: AccountType + + @IsOptional() + @IsEnum(AccountStatus) + status?: AccountStatus + + @IsOptional() + @IsString() + password?: string + + @IsOptional() + @IsString() + user_id?: string +} diff --git a/src/modules/admin/users/business-activities/business-activities.controller.ts b/src/modules/admin/users/business-activities/business-activities.controller.ts new file mode 100644 index 0000000..465f34c --- /dev/null +++ b/src/modules/admin/users/business-activities/business-activities.controller.ts @@ -0,0 +1,40 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common' +import { BusinessActivitiesService } from './business-activities.service' +import { CreateBusinessActivitiesDto } from './dto/create-business-activities.dto' + +@Controller('admin/users/:userId/business_activities') +export class BusinessActivitiesController { + constructor(private readonly businessActivitiesService: BusinessActivitiesService) {} + + @Get() + async findAll(@Param('userId') userId: string) { + return this.businessActivitiesService.findAll(userId) + } + + @Get(':id') + async findOne(@Param('userId') userId: string, @Param('id') id: string) { + return this.businessActivitiesService.findOne(userId, id) + } + + @Post() + async create( + @Param('userId') userId: string, + @Body() data: CreateBusinessActivitiesDto, + ) { + return this.businessActivitiesService.create(userId, data) + } + + // @Put(':id') + // async update( + // @Param('userId') userId: string, + // @Param('id') id: string, + // @Body() data: UpdateBusinessActivityDto, + // ) { + // return this.businessActivitiesService.update(userId, id, data) + // } + + // @Delete(':id') + // async delete(@Param('id') id: string) { + // return this.businessActivitiesService.delete(id) + // } +} diff --git a/src/modules/admin/users/business-activities/business-activities.module.ts b/src/modules/admin/users/business-activities/business-activities.module.ts new file mode 100644 index 0000000..ca58823 --- /dev/null +++ b/src/modules/admin/users/business-activities/business-activities.module.ts @@ -0,0 +1,11 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' +import { BusinessActivitiesController } from './business-activities.controller' +import { BusinessActivitiesService } from './business-activities.service' + +@Module({ + imports: [PrismaModule], + controllers: [BusinessActivitiesController], + providers: [BusinessActivitiesService], +}) +export class AdminUserBusinessActivitiesModule {} diff --git a/src/modules/admin/users/business-activities/business-activities.service.ts b/src/modules/admin/users/business-activities/business-activities.service.ts new file mode 100644 index 0000000..7d9f913 --- /dev/null +++ b/src/modules/admin/users/business-activities/business-activities.service.ts @@ -0,0 +1,57 @@ +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { CreateBusinessActivitiesDto } from './dto/create-business-activities.dto' + +@Injectable() +export class BusinessActivitiesService { + constructor(private readonly prisma: PrismaService) {} + + async findAll(userId: string) { + const businessActivities = await this.prisma.businessActivity.findMany({ + where: { + owner_id: userId, + }, + }) + return ResponseMapper.list(businessActivities) + } + + async findOne(userId: string, id: string) { + const businessActivity = await this.prisma.businessActivity.findUnique({ + where: { owner_id: userId, id }, + }) + return ResponseMapper.single(businessActivity) + } + + async create(userId: string, data: CreateBusinessActivitiesDto) { + const businessActivity = await this.prisma.businessActivity.create({ + data: { + name: data.name, + guild: { + connect: { + id: data.guild_id, + }, + }, + user: { + connect: { + id: userId, + }, + }, + }, + }) + return ResponseMapper.create(businessActivity) + } + + async update(id: string, data: any) { + const businessActivity = await this.prisma.businessActivity.update({ + where: { id }, + data, + }) + return ResponseMapper.update(businessActivity) + } + + async delete(id: string) { + await this.prisma.businessActivity.delete({ where: { id } }) + return ResponseMapper.delete() + } +} diff --git a/src/modules/admin/users/business-activities/dto/create-business-activities.dto.ts b/src/modules/admin/users/business-activities/dto/create-business-activities.dto.ts new file mode 100644 index 0000000..bdfab49 --- /dev/null +++ b/src/modules/admin/users/business-activities/dto/create-business-activities.dto.ts @@ -0,0 +1,12 @@ +import { ApiProperty } from '@nestjs/swagger' +import { IsString } from 'class-validator' + +export class CreateBusinessActivitiesDto { + @IsString() + @ApiProperty({}) + name: string + + @IsString() + @ApiProperty({}) + guild_id: string +} diff --git a/src/modules/admin/users/business-activities/dto/update-business-activities.dto.ts b/src/modules/admin/users/business-activities/dto/update-business-activities.dto.ts new file mode 100644 index 0000000..e2c22b3 --- /dev/null +++ b/src/modules/admin/users/business-activities/dto/update-business-activities.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/swagger' +import { CreateBusinessActivitiesDto } from './create-business-activities.dto' + +export class UpdateBusinessActivityDto extends PartialType(CreateBusinessActivitiesDto) {} diff --git a/src/modules/admin/users/dto/user.dto.ts b/src/modules/admin/users/dto/user.dto.ts new file mode 100644 index 0000000..5f39646 --- /dev/null +++ b/src/modules/admin/users/dto/user.dto.ts @@ -0,0 +1,28 @@ +import { IsString } from 'class-validator' + +export class CreateUserDto { + @IsString() + mobile_number: string + + @IsString() + national_code?: string + + @IsString() + first_name: string + + @IsString() + last_name: string +} +export class UpdateUserDto { + @IsString() + mobile_number: string + + @IsString() + national_code?: string + + @IsString() + first_name?: string + + @IsString() + last_name?: string +} diff --git a/src/modules/admin/users/users.controller.ts b/src/modules/admin/users/users.controller.ts new file mode 100644 index 0000000..2f11e68 --- /dev/null +++ b/src/modules/admin/users/users.controller.ts @@ -0,0 +1,33 @@ +import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common' +import { CreateUserDto, UpdateUserDto } from './dto/user.dto' +import { AdminUsersService } from './users.service' + +@Controller('admin/users') +export class AdminUsersController { + constructor(private readonly usersService: AdminUsersService) {} + + @Get() + async findAll() { + return this.usersService.findAll() + } + + @Get(':id') + async findOne(@Param('id') id: string) { + return this.usersService.findOne(id) + } + + @Post() + async create(@Body() data: any) { + return this.usersService.create(data as CreateUserDto) + } + + @Put(':id') + async update(@Param('id') id: string, @Body() data: any) { + return this.usersService.update(id, data as UpdateUserDto) + } + + @Delete(':id') + async delete(@Param('id') id: string) { + return this.usersService.delete(id) + } +} diff --git a/src/modules/admin/users/users.module.ts b/src/modules/admin/users/users.module.ts new file mode 100644 index 0000000..c016dc5 --- /dev/null +++ b/src/modules/admin/users/users.module.ts @@ -0,0 +1,14 @@ +import { PrismaModule } from '@/prisma/prisma.module' +import { Module } from '@nestjs/common' +import { AdminUserAccountsModule } from './accounts/accounts.module' +import { AdminUserBusinessActivitiesModule } from './business-activities/business-activities.module' +import { AdminUsersController } from './users.controller' +import { AdminUsersService } from './users.service' + +@Module({ + imports: [PrismaModule, AdminUserAccountsModule, AdminUserBusinessActivitiesModule], + controllers: [AdminUsersController], + providers: [AdminUsersService], + exports: [AdminUserAccountsModule], +}) +export class AdminUsersModule {} diff --git a/src/modules/admin/users/users.service.ts b/src/modules/admin/users/users.service.ts new file mode 100644 index 0000000..fe7d1f7 --- /dev/null +++ b/src/modules/admin/users/users.service.ts @@ -0,0 +1,42 @@ +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from 'common/response/response-mapper' +import { CreateUserDto, UpdateUserDto } from './dto/user.dto' + +@Injectable() +export class AdminUsersService { + constructor(private readonly prisma: PrismaService) {} + + async findAll() { + const [users, count] = await this.prisma.$transaction([ + this.prisma.user.findMany(), + this.prisma.user.count(), + ]) + return ResponseMapper.paginate( + users.map(user => ({ ...user, fullname: `${user.first_name} ${user.last_name}` })), + { count }, + ) + } + + async findOne(id: string) { + const user = await this.prisma.user.findUnique({ + where: { id }, + }) + return ResponseMapper.single({ + ...user, + fullname: `${user?.first_name} ${user?.last_name}`, + }) + } + + async create(data: CreateUserDto) { + return this.prisma.user.create({ data }) + } + + async update(id: string, data: UpdateUserDto) { + return this.prisma.user.update({ where: { id }, data: data as UpdateUserDto }) + } + + async delete(id: string) { + return this.prisma.user.delete({ where: { id } }) + } +} diff --git a/src/modules/auth/auth.controller.ts b/src/modules/auth/auth.controller.ts index 08a586c..c6c3838 100644 --- a/src/modules/auth/auth.controller.ts +++ b/src/modules/auth/auth.controller.ts @@ -1,46 +1,31 @@ -import { Controller, Get } from '@nestjs/common' +import { Public } from '@/common/decorators/public.decorator' +import { Body, Controller, Get, Post, Res } from '@nestjs/common' import { ApiTags } from '@nestjs/swagger' import { AuthService } from './auth.service' import { reqTokenPayload } from './current-user.decorator' +import { LoginDto } from './dto/login.dto' @ApiTags('auth') @Controller('auth') export class AuthController { constructor(private readonly auth: AuthService) {} - // @Public() - // @Post('send_code') - // async sendCode(@Body() dto: SendCodeDto) { - // return this.auth.sendCode(dto) - // } - - // @Public() - // @Post('login') - // async login(@Body() dto: VerifyCodeDto, @Res({ passthrough: true }) res) { - // const result = await this.auth.loginWithCode(dto) - // // Set accessToken as httpOnly cookie - // // @ts-ignore - // if (result?.data?.accessToken) { - // // @ts-ignore - // res.cookie('accessToken', result.data.accessToken, { - // httpOnly: true, - // secure: process.env.NODE_ENV === 'production', - // sameSite: 'lax', - // maxAge: 1000 * 60 * 60 * 24 * 7, // 7 days - // }) - // } - // return result - // } - - // @Post('refresh') - // async refresh(@Body() dto: RefreshTokenDto) { - // return this.auth.refreshToken(dto) - // } - - // @Post('logout') - // async logout(@Body() dto: RefreshTokenDto) { - // return this.auth.logout(dto.refreshToken) - // } + @Public() + @Post('login') + async login(@Body() dto: LoginDto, @Res({ passthrough: true }) res): Promise { + const result = await this.auth.login(dto) + // @ts-ignore + if (result?.data?.accessToken) { + // @ts-ignore + res.cookie('accessToken', result.data.accessToken, { + httpOnly: true, + secure: process.env.NODE_ENV === 'production', + sameSite: 'lax', + maxAge: 1000 * 60 * 60 * 24 * 7, // 7 days + }) + } + return result + } @Get('me') async me(@reqTokenPayload() user: any) { diff --git a/src/modules/auth/auth.module.ts b/src/modules/auth/auth.module.ts index ef7a5d9..0441235 100644 --- a/src/modules/auth/auth.module.ts +++ b/src/modules/auth/auth.module.ts @@ -1,8 +1,8 @@ +import { PrismaModule } from '@/prisma/prisma.module' import { Module } from '@nestjs/common' import { JwtModule } from '@nestjs/jwt' import 'dotenv/config' import { env } from 'prisma/config' -import { PrismaModule } from '../../prisma/prisma.module' import { AuthController } from './auth.controller' import { AuthService } from './auth.service' diff --git a/src/modules/auth/auth.service.ts b/src/modules/auth/auth.service.ts index ee5fbf6..5e95a5b 100644 --- a/src/modules/auth/auth.service.ts +++ b/src/modules/auth/auth.service.ts @@ -1,163 +1,115 @@ -import { Injectable } from '@nestjs/common' +import { PasswordUtil } from '@/common/utils/password.util' +import { Account, Complex, License, User } from '@/generated/prisma/client' +import { TokenType } from '@/generated/prisma/enums' +import { PrismaService } from '@/prisma/prisma.service' +import { Injectable, NotFoundException } from '@nestjs/common' import { JwtService } from '@nestjs/jwt' +import { ResponseMapper } from 'common/response/response-mapper' +import { createHash, randomBytes } from 'crypto' import 'dotenv/config' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' +import { env } from 'prisma/config' +import { LoginDto } from './dto/login.dto' +import { AccessTokenPayload } from './models' + +interface IGenerateLoginResponse extends Account { + user: User +} + +interface IPosAccountResponse extends Partial { + complex?: Complex + license?: Partial +} @Injectable() export class AuthService { - // private readonly OTP_TTL_MINUTES = 2 - // private readonly ACCESS_TOKEN_EXP = Number(env('JWT_EXPIRES_IN')) || '150m' - // private readonly REFRESH_TOKEN_EXP_DAYS = 30 + private readonly OTP_TTL_MINUTES = 2 + private readonly ACCESS_TOKEN_EXP = Number(env('JWT_EXPIRES_IN')) || '12h' + private readonly REFRESH_TOKEN_EXP_DAYS = 30 constructor( private prisma: PrismaService, private jwt: JwtService, ) {} - // private generateCode() { - // // For development you may want fixed code via env, otherwise random 5-digit - // const staticCode = process.env.OTP_STATIC_CODE - // if (staticCode) return staticCode - // return Math.floor(10000 + Math.random() * 90000).toString() - // } + private async generateLoginResponse(account: IGenerateLoginResponse) { + const { password, ...accountData } = account + const preparedAccount = { ...accountData } as IPosAccountResponse - // // @TODO: we must detect context of request to verify user need to logged in as which role (admin, user, etc) and generate token with that role. - // async sendCode(dto: SendCodeDto) { - // const { mobile_number } = dto - // const account = await this.prisma.account.findFirst({ - // where: { - // user: { - // mobile_number, - // }, - // }, - // }) - // console.log(mobile_number) + const signTokenData = { + user_id: account.user.id, + mobile_number: account.user.mobile_number, + type: account.type, + username: account.username, + account_id: account.id, + } as AccessTokenPayload - // if (!account) { - // throw new NotFoundException('کاربری با این شماره تماس یافت نشد') - // } + if (account.pos_id) { + const pos = await this.prisma.pos.findUnique({ + where: { id: account.pos_id }, + include: { complex: true, licenses: true }, + }) - // const existingCode = await this.prisma.verificationCode.findFirst({ - // where: { account_id: account.id, expires_at: { gt: new Date() } }, - // }) - // if (existingCode) { - // throw new BadRequestException('کد برای شما ارسال شده است') - // } + if (!pos) throw new NotFoundException('متاسفانه کاربر شما یافت نشد') + Object.assign(signTokenData, { + pos_id: pos.id, + pos_name: pos.serial, + complex_id: pos.complex_id, + license_id: pos.licenses[0].id, + license_expired_at: pos.licenses[0].expires_at, + }) - // const code = this.generateCode() - // const expires_at = new Date(Date.now() + this.OTP_TTL_MINUTES * 60 * 1000) + const { partner_id, pos_id, ...license } = pos.licenses[0] + preparedAccount.license = license + preparedAccount.complex = pos.complex + } - // await this.prisma.verificationCode.create({ - // data: { - // account_id: account.id, - // code, - // expires_at, - // }, - // }) + const accessToken = this.jwt.sign(signTokenData, { expiresIn: this.ACCESS_TOKEN_EXP }) + const refreshTokenPlain = randomBytes(48).toString('hex') + const tokenHash = createHash('sha256').update(refreshTokenPlain).digest('hex') + const expires_at = new Date( + Date.now() + this.REFRESH_TOKEN_EXP_DAYS * 24 * 60 * 60 * 1000, + ) - // // TODO: integrate SMS provider. For now return the code for dev. - // return { - // ok: true, - // } - // } + await this.prisma.token.upsert({ + where: { type_account_id: { type: TokenType.ACCESS, account_id: account.id } }, + update: { token: tokenHash, expires_at }, + create: { + token: tokenHash, + account_id: account.id, + expires_at, + type: TokenType.ACCESS, + }, + }) - // async loginWithCode(dto: VerifyCodeDto) { - // const { mobile_number, code } = dto - // const account = await this.prisma.account.findFirst({ - // where: { user: { mobile_number } }, - // include: { - // user: true, - // }, - // }) - // if (!account) { - // throw new NotFoundException('کاربری با این شماره تماس یافت نشد') - // } - // const otp = await this.prisma.verificationCode.findFirst({ - // where: { account_id: account.id }, - // }) - // if (!otp) throw new BadRequestException('اطلاعات ورودی درست نیست') - // // if (otp.expires_at) throw new BadRequestException('کد قبلن استفاده شده است') - // if (otp.expires_at.getTime() < Date.now()) - // throw new BadRequestException('کد وارد شده منقضی شده است') - // if (otp.code !== code) throw new BadRequestException('کد وارد شده اشتباه است') - // // mark used + return ResponseMapper.single({ + accessToken, + refreshToken: refreshTokenPlain, + account: preparedAccount, + }) + } - // const signTokenData = { - // sub: account.user.id, - // mobile_number: account.user.mobile_number, - // type: account.type, - // username: account.username, - // } + async login(dto: LoginDto) { + const { username, password } = dto - // if (account.pos_id) { - // const pos = await this.prisma.pos.findUnique({ - // where: { id: account.pos_id }, - // include: { - // complex: true, - // licenses: true, - // }, - // }) - // if (!pos) { - // throw new NotFoundException('متاسفانه کاربر شما یافت نشد') - // } - // Object.assign(signTokenData, { - // pos_id: pos.id, - // pos_name: pos.serial, - // complex: pos.complex, - // license: pos.licenses[0], - // }) - // } - // console.log(signTokenData) + const account = await this.prisma.account.findUnique({ + where: { username }, + include: { + user: true, + }, + }) - // const accessToken = this.jwt.sign(signTokenData, { expiresIn: this.ACCESS_TOKEN_EXP }) - // const refreshTokenPlain = randomBytes(48).toString('hex') - // const tokenHash = createHash('sha256').update(refreshTokenPlain).digest('hex') - // const expires_at = new Date( - // Date.now() + this.REFRESH_TOKEN_EXP_DAYS * 24 * 60 * 60 * 1000, - // ) - // await this.prisma.token.upsert({ - // where: { type_account_id: { type: TokenType.ACCESS, account_id: account.id } }, - // update: { token: tokenHash, expires_at }, - // create: { - // token: tokenHash, - // account_id: account.id, - // expires_at, - // type: TokenType.ACCESS, - // }, - // }) - // await this.prisma.verificationCode.delete({ where: { id: otp.id } }) + if (!account) { + throw new NotFoundException('اطلاعات ورودی شما اشتباه است') + } - // return ResponseMapper.single({ - // accessToken, - // refreshToken: refreshTokenPlain, - // account, - // }) - // } + const isMatch = await PasswordUtil.compare(password, account.password) - // // async refreshToken(dto: RefreshTokenDto) { - // // const { refreshToken } = dto - // // const tokenHash = createHash('sha256').update(refreshToken).digest('hex') - // // const record = await this.prisma.refreshToken.findFirst({ where: { tokenHash } }) - // // if (!record || record.revoked || record.expiresAt.getTime() < Date.now()) { - // // throw new UnauthorizedException('Invalid refresh token') - // // } - // // const user = await this.prisma.user.findUnique({ where: { id: record.userId } }) - // // if (!user) throw new UnauthorizedException('User not found') - // // const accessToken = this.jwt.sign( - // // { sub: user.id, mobileNumber: user.mobileNumber }, - // // { expiresIn: this.ACCESS_TOKEN_EXP }, - // // ) - // // return { accessToken } - // // } + if (!isMatch) { + throw new NotFoundException('اطلاعات ورودی شما اشتباه است') + } - // // async logout() { - // // await this.prisma.token.deleteMany({ - // // where: { tokenHash }, - // // data: { revoked: true }, - // // }) - // // return { ok: true } - // // } + return await this.generateLoginResponse(account) + } async me(username: string) { return ResponseMapper.single({ diff --git a/src/modules/auth/current-user.decorator.ts b/src/modules/auth/current-user.decorator.ts index 3ddd75f..82cdbde 100644 --- a/src/modules/auth/current-user.decorator.ts +++ b/src/modules/auth/current-user.decorator.ts @@ -1,5 +1,5 @@ import { createParamDecorator, ExecutionContext } from '@nestjs/common' -import { AccessTokenPayload } from '../../common/models/token-model' +import { AccessTokenPayload } from 'common/models/token-model' export const reqTokenPayload = createParamDecorator( (data: unknown, ctx: ExecutionContext) => { diff --git a/src/modules/auth/dto/login.dto.ts b/src/modules/auth/dto/login.dto.ts index 716b332..585ff88 100644 --- a/src/modules/auth/dto/login.dto.ts +++ b/src/modules/auth/dto/login.dto.ts @@ -4,7 +4,7 @@ import { IsString } from 'class-validator' export class LoginDto { @ApiProperty({ description: 'Mobile number used as username', example: '09120258156' }) @IsString() - mobileNumber: string + username: string @ApiProperty({ description: 'OTP password (one-time password)', example: '11111' }) @IsString() diff --git a/src/modules/auth/models/index.ts b/src/modules/auth/models/index.ts new file mode 100644 index 0000000..1fe1ac3 --- /dev/null +++ b/src/modules/auth/models/index.ts @@ -0,0 +1,19 @@ +import { Request as ExpressRequest } from 'express' +import { AccountType } from '../../../generated/prisma/enums' + +export interface IWithJWTPayloadRequest extends ExpressRequest { + dataPayload?: AccessTokenPayload +} + +export interface AccessTokenPayload { + account_id: string + user_id: string + mobile_number: string + type: AccountType + username: string + pos_id?: number + pos_name?: string + complex_id?: string + license_id?: string + license_expired_at?: string +} diff --git a/src/modules/enums/enums.controller.ts b/src/modules/enums/enums.controller.ts index 83b035a..bf4636c 100644 --- a/src/modules/enums/enums.controller.ts +++ b/src/modules/enums/enums.controller.ts @@ -9,4 +9,84 @@ export class EnumsController { async getGoldKarat() { return this.enumsService.getEnumValues('GoldKarat') } + + @Get('user_status') + async getUserStatus() { + return this.enumsService.getEnumValues('UserStatus') + } + + @Get('account_role') + async getAccountRole() { + return this.enumsService.getEnumValues('AccountRole') + } + + @Get('account_status') + async getAccountStatus() { + return this.enumsService.getEnumValues('AccountStatus') + } + + @Get('pos_status') + async getPOSStatus() { + return this.enumsService.getEnumValues('POSStatus') + } + + @Get('pos_role') + async getPOSRole() { + return this.enumsService.getEnumValues('POSRole') + } + + @Get('license_type') + async getLicenseType() { + return this.enumsService.getEnumValues('LicenseType') + } + + @Get('license_status') + async getLicenseStatus() { + return this.enumsService.getEnumValues('LicenseStatus') + } + + @Get('pos_type') + async getPOSType() { + return this.enumsService.getEnumValues('POSType') + } + + @Get('user_type') + async getUserType() { + return this.enumsService.getEnumValues('UserType') + } + + @Get('account_type') + async getAccountType() { + return this.enumsService.getEnumValues('AccountType') + } + + @Get('partner_role') + async getPartnerRole() { + return this.enumsService.getEnumValues('PartnerRole') + } + + @Get('business_role') + async getBusinessRole() { + return this.enumsService.getEnumValues('BusinessRole') + } + + @Get('provider_role') + async getProviderRole() { + return this.enumsService.getEnumValues('ProviderRole') + } + + @Get('token_type') + async getTokenType() { + return this.enumsService.getEnumValues('TokenType') + } + + @Get('unit_type') + async getUnitType() { + return this.enumsService.getEnumValues('UnitType') + } + + @Get('good_pricing_model') + async getGoodPricingModel() { + return this.enumsService.getEnumValues('GoodPricingModel') + } } diff --git a/src/modules/enums/enums.service.ts b/src/modules/enums/enums.service.ts index 30945cc..aaf1a45 100644 --- a/src/modules/enums/enums.service.ts +++ b/src/modules/enums/enums.service.ts @@ -1,12 +1,54 @@ +import translates from '@/common/constants/translates/translates' +import { + AccountRole, + AccountStatus, + BusinessRole, + GoodPricingModel, + LicenseStatus, + LicenseType, + PartnerRole, + POSRole, + POSStatus, + POSType, + ProviderRole, + UnitType, + UserStatus, + UserType, +} from '@/generated/prisma/enums' import { Injectable } from '@nestjs/common' -import { GoldKarat } from '../../common/enums/enums' -import { ResponseMapper } from '../../common/response/response-mapper' +import { AccountType, GoldKarat, TokenType } from 'common/enums/enums' +import { ResponseMapper } from 'common/response/response-mapper' @Injectable() export class EnumsService { + private prepareData(items: Record) { + console.log(translates.enums[items[0]]) + + return Object.values(items).map(item => ({ + name: translates.enums[item] || item, + value: item, + })) + } + getAllEnums() { return { - GoldKarat: Object.values(GoldKarat).filter(value => typeof value === 'string'), + GoldKarat: this.prepareData(GoldKarat), + UserStatus: this.prepareData(UserStatus), + AccountRole: this.prepareData(AccountRole), + AccountStatus: this.prepareData(AccountStatus), + POSStatus: this.prepareData(POSStatus), + POSRole: this.prepareData(POSRole), + LicenseType: this.prepareData(LicenseType), + LicenseStatus: this.prepareData(LicenseStatus), + POSType: this.prepareData(POSType), + UserType: this.prepareData(UserType), + AccountType: this.prepareData(AccountType), + PartnerRole: this.prepareData(PartnerRole), + BusinessRole: this.prepareData(BusinessRole), + ProviderRole: this.prepareData(ProviderRole), + TokenType: this.prepareData(TokenType), + UnitType: this.prepareData(UnitType), + GoodPricingModel: this.prepareData(GoodPricingModel), } } diff --git a/src/modules/config/config.controller.ts b/src/modules/pos/config/config.controller.ts similarity index 94% rename from src/modules/config/config.controller.ts rename to src/modules/pos/config/config.controller.ts index b16168b..6b41801 100644 --- a/src/modules/config/config.controller.ts +++ b/src/modules/pos/config/config.controller.ts @@ -2,7 +2,7 @@ import { Body, Controller, Get, Param, Post } from '@nestjs/common' import { ConfigService } from './config.service' import { CreateConfigDto } from './dto/create-config.dto' -@Controller('config') +@Controller('pos/config') export class ConfigController { constructor(private readonly configService: ConfigService) {} diff --git a/src/modules/config/config.module.ts b/src/modules/pos/config/config.module.ts similarity index 87% rename from src/modules/config/config.module.ts rename to src/modules/pos/config/config.module.ts index 2f82c29..7597001 100644 --- a/src/modules/config/config.module.ts +++ b/src/modules/pos/config/config.module.ts @@ -6,4 +6,4 @@ import { ConfigService } from './config.service' controllers: [ConfigController], providers: [ConfigService], }) -export class ConfigModule {} +export class PosConfigModule {} diff --git a/src/modules/config/config.service.ts b/src/modules/pos/config/config.service.ts similarity index 65% rename from src/modules/config/config.service.ts rename to src/modules/pos/config/config.service.ts index f9186b3..b5295e2 100644 --- a/src/modules/config/config.service.ts +++ b/src/modules/pos/config/config.service.ts @@ -1,7 +1,7 @@ +import { PrismaService } from '@/prisma/prisma.service' import { Injectable } from '@nestjs/common' -import { Public } from '../../common/decorators/public.decorator' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' +import { Public } from 'common/decorators/public.decorator' +import { ResponseMapper } from 'common/response/response-mapper' import { CreateConfigDto } from './dto/create-config.dto' @Injectable() @@ -10,7 +10,7 @@ export class ConfigService { @Public() async findOne(uuid: string) { - const config = await this.prisma.device.findUnique({ + const config = await this.prisma.userDevices.findUnique({ where: { uuid, }, @@ -21,7 +21,7 @@ export class ConfigService { @Public() async create(data: CreateConfigDto) { - const config = await this.prisma.device.upsert({ + const config = await this.prisma.userDevices.upsert({ where: { uuid: data.uuid, }, diff --git a/src/modules/config/dto/create-config.dto.ts b/src/modules/pos/config/dto/create-config.dto.ts similarity index 100% rename from src/modules/config/dto/create-config.dto.ts rename to src/modules/pos/config/dto/create-config.dto.ts diff --git a/src/modules/customers/customers.controller.ts b/src/modules/pos/customers/customers.controller.ts similarity index 94% rename from src/modules/customers/customers.controller.ts rename to src/modules/pos/customers/customers.controller.ts index 7d45093..3403793 100644 --- a/src/modules/customers/customers.controller.ts +++ b/src/modules/pos/customers/customers.controller.ts @@ -1,7 +1,7 @@ import { Body, Controller, Get, Param, Post } from '@nestjs/common' import { CustomersService } from './customers.service' -@Controller('customers') +@Controller('pos/customers') export class CustomersController { constructor(private readonly customerService: CustomersService) {} diff --git a/src/modules/customers/customers.module.ts b/src/modules/pos/customers/customers.module.ts similarity index 87% rename from src/modules/customers/customers.module.ts rename to src/modules/pos/customers/customers.module.ts index a89355b..735b0c7 100644 --- a/src/modules/customers/customers.module.ts +++ b/src/modules/pos/customers/customers.module.ts @@ -6,4 +6,4 @@ import { CustomersService } from './customers.service' controllers: [CustomersController], providers: [CustomersService], }) -export class CustomersModule {} +export class PosCustomersModule {} diff --git a/src/modules/customers/customers.service.ts b/src/modules/pos/customers/customers.service.ts similarity index 100% rename from src/modules/customers/customers.service.ts rename to src/modules/pos/customers/customers.service.ts diff --git a/src/modules/customers/dto/create-customer-individual.dto.ts b/src/modules/pos/customers/dto/create-customer-individual.dto.ts similarity index 100% rename from src/modules/customers/dto/create-customer-individual.dto.ts rename to src/modules/pos/customers/dto/create-customer-individual.dto.ts diff --git a/src/modules/customers/dto/create-customer-legal.dto.ts b/src/modules/pos/customers/dto/create-customer-legal.dto.ts similarity index 100% rename from src/modules/customers/dto/create-customer-legal.dto.ts rename to src/modules/pos/customers/dto/create-customer-legal.dto.ts diff --git a/src/modules/customers/dto/create-customer.dto.ts b/src/modules/pos/customers/dto/create-customer.dto.ts similarity index 100% rename from src/modules/customers/dto/create-customer.dto.ts rename to src/modules/pos/customers/dto/create-customer.dto.ts diff --git a/src/modules/pos/good-categories/dto/create-good-category.dto.ts b/src/modules/pos/good-categories/dto/create-good-category.dto.ts new file mode 100644 index 0000000..93ab19b --- /dev/null +++ b/src/modules/pos/good-categories/dto/create-good-category.dto.ts @@ -0,0 +1,20 @@ +import { ApiProperty, PartialType } from '@nestjs/swagger' +import { IsOptional, IsString } from 'class-validator' + +export class CreateGoodCategoryDto { + @IsString() + @ApiProperty() + name: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + description?: string + + @IsOptional() + @IsString() + @ApiProperty({ required: false }) + image_url?: string +} + +export class UpdateGoodCategoryDto extends PartialType(CreateGoodCategoryDto) {} diff --git a/src/modules/good-categories/good-categories.controller.ts b/src/modules/pos/good-categories/good-categories.controller.ts similarity index 88% rename from src/modules/good-categories/good-categories.controller.ts rename to src/modules/pos/good-categories/good-categories.controller.ts index 5abbaab..d119f87 100644 --- a/src/modules/good-categories/good-categories.controller.ts +++ b/src/modules/pos/good-categories/good-categories.controller.ts @@ -1,9 +1,9 @@ import { Body, Controller, Get, Param, Post } from '@nestjs/common' -import { reqTokenPayload } from '../auth/current-user.decorator' +import { reqTokenPayload } from '../../auth/current-user.decorator' import { CreateGoodCategoryDto } from './dto/create-good-category.dto' import { GoodCategoriesService } from './good-categories.service' -@Controller('good_categories') +@Controller('pos/good_categories') export class GoodCategoriesController { constructor(private readonly goodCategoriesService: GoodCategoriesService) {} diff --git a/src/modules/good-categories/good-categories.module.ts b/src/modules/pos/good-categories/good-categories.module.ts similarity index 87% rename from src/modules/good-categories/good-categories.module.ts rename to src/modules/pos/good-categories/good-categories.module.ts index deed3f0..57d7ddb 100644 --- a/src/modules/good-categories/good-categories.module.ts +++ b/src/modules/pos/good-categories/good-categories.module.ts @@ -6,4 +6,4 @@ import { GoodCategoriesService } from './good-categories.service' controllers: [GoodCategoriesController], providers: [GoodCategoriesService], }) -export class GoodCategoriesModule {} +export class PosGoodCategoriesModule {} diff --git a/src/modules/good-categories/good-categories.service.ts b/src/modules/pos/good-categories/good-categories.service.ts similarity index 85% rename from src/modules/good-categories/good-categories.service.ts rename to src/modules/pos/good-categories/good-categories.service.ts index ea47243..b8d70ae 100644 --- a/src/modules/good-categories/good-categories.service.ts +++ b/src/modules/pos/good-categories/good-categories.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' +import { ResponseMapper } from '../../../common/response/response-mapper' +import { PrismaService } from '../../../prisma/prisma.service' import { CreateGoodCategoryDto } from './dto/create-good-category.dto' @Injectable() @@ -19,7 +19,6 @@ export class GoodCategoriesService { }, }, omit: { - account_id: true, complex_id: true, }, }) @@ -44,7 +43,6 @@ export class GoodCategoriesService { data: { ...data, complex_id, - account_id: '', }, }) diff --git a/src/modules/goods/dto/create-good.dto.ts b/src/modules/pos/goods/dto/create-good.dto.ts similarity index 100% rename from src/modules/goods/dto/create-good.dto.ts rename to src/modules/pos/goods/dto/create-good.dto.ts diff --git a/src/modules/goods/goods.controller.ts b/src/modules/pos/goods/goods.controller.ts similarity index 87% rename from src/modules/goods/goods.controller.ts rename to src/modules/pos/goods/goods.controller.ts index 040ac86..e00e84f 100644 --- a/src/modules/goods/goods.controller.ts +++ b/src/modules/pos/goods/goods.controller.ts @@ -1,9 +1,9 @@ import { Body, Controller, Get, Param, Post } from '@nestjs/common' -import { reqTokenPayload } from '../auth/current-user.decorator' +import { reqTokenPayload } from '../../auth/current-user.decorator' import { CreateGoodDto } from './dto/create-good.dto' import { GoodsService } from './goods.service' -@Controller('goods') +@Controller('pos/goods') export class GoodsController { constructor(private readonly goodsService: GoodsService) {} diff --git a/src/modules/goods/goods.module.ts b/src/modules/pos/goods/goods.module.ts similarity index 87% rename from src/modules/goods/goods.module.ts rename to src/modules/pos/goods/goods.module.ts index 4e88bbc..a260a05 100644 --- a/src/modules/goods/goods.module.ts +++ b/src/modules/pos/goods/goods.module.ts @@ -6,4 +6,4 @@ import { GoodsService } from './goods.service' controllers: [GoodsController], providers: [GoodsService], }) -export class GoodsModule {} +export class PosGoodsModule {} diff --git a/src/modules/goods/goods.service.ts b/src/modules/pos/goods/goods.service.ts similarity index 74% rename from src/modules/goods/goods.service.ts rename to src/modules/pos/goods/goods.service.ts index 8259741..8edf05e 100644 --- a/src/modules/goods/goods.service.ts +++ b/src/modules/pos/goods/goods.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' +import { ResponseMapper } from '../../../common/response/response-mapper' +import { PrismaService } from '../../../prisma/prisma.service' import { CreateGoodDto } from './dto/create-good.dto' @Injectable() @@ -13,7 +13,6 @@ export class GoodsService { complex_id, }, omit: { - account_id: true, complex_id: true, deleted_at: true, }, @@ -30,7 +29,6 @@ export class GoodsService { }, omit: { - account_id: true, complex_id: true, deleted_at: true, }, @@ -45,18 +43,28 @@ export class GoodsService { const dataToCreate = { ...rest, complex_id, - account_id: '', - category: { - connect: { + connect: { + category: { id: category_id, }, }, } const good = await this.prisma.good.create({ - data: dataToCreate, + data: { + ...rest, + category: { + connect: { + id: category_id, + }, + }, + complex: { + connect: { + id: complex_id, + }, + }, + }, omit: { - account_id: true, complex_id: true, deleted_at: true, }, diff --git a/src/modules/pos/pos.middleware.ts b/src/modules/pos/pos.middleware.ts new file mode 100644 index 0000000..7f02b4d --- /dev/null +++ b/src/modules/pos/pos.middleware.ts @@ -0,0 +1,24 @@ +import { Injectable, NestMiddleware, UnauthorizedException } from '@nestjs/common' +import { NextFunction, Request, Response } from 'express' + +@Injectable() +export class PosMiddleware implements NestMiddleware { + use(req: Request, _res: Response, next: NextFunction) { + console.log('first') + // @ts-ignore + console.log(req.dataPayload) + // const a = reqTokenPayload() + // console.log(a) + + // Middleware-based admin check (replace with real auth logic) + const isAdminHeader = req.headers['x-admin'] + + if (isAdminHeader === 'true') { + // mark request if needed downstream + req['isAdminRequest'] = true + } + return next() + + throw new UnauthorizedException('Admin access required') + } +} diff --git a/src/modules/pos/pos.module.ts b/src/modules/pos/pos.module.ts new file mode 100644 index 0000000..52f92f4 --- /dev/null +++ b/src/modules/pos/pos.module.ts @@ -0,0 +1,27 @@ +import { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common' +import { PosConfigModule } from './config/config.module' +import { PosCustomersModule } from './customers/customers.module' +import { PosGoodCategoriesModule } from './good-categories/good-categories.module' +import { PosGoodsModule } from './goods/goods.module' +import { PosMiddleware } from './pos.middleware' +import { PosSalesInvoicesModule } from './sales-invoices/sales-invoices.module' + +@Module({ + imports: [ + PosConfigModule, + PosCustomersModule, + PosGoodCategoriesModule, + PosGoodsModule, + PosSalesInvoicesModule, + ], +}) +export class PosModule implements NestModule { + configure(consumer: MiddlewareConsumer) { + // apply middleware to all routes within this module (scoped under /admin) + consumer.apply(PosMiddleware).forRoutes({ + path: '/pos*path', + method: RequestMethod.ALL, + version: '1', + }) + } +} diff --git a/src/modules/sales-invoices/dto/create-sales-invoice.dto.ts b/src/modules/pos/sales-invoices/dto/create-sales-invoice.dto.ts similarity index 76% rename from src/modules/sales-invoices/dto/create-sales-invoice.dto.ts rename to src/modules/pos/sales-invoices/dto/create-sales-invoice.dto.ts index 61427b7..3feb6a8 100644 --- a/src/modules/sales-invoices/dto/create-sales-invoice.dto.ts +++ b/src/modules/pos/sales-invoices/dto/create-sales-invoice.dto.ts @@ -8,9 +8,9 @@ import { IsOptional, IsString, } from 'class-validator' -import type { CustomerIndividual, CustomerLegal } from '../../../generated/prisma/client' -import { CustomerType } from '../../../generated/prisma/enums' -import { CreateSalesInvoiceItemDto } from '../../sales-invoice-items/dto/create-sales-invoice-item.dto' +import type { CustomerIndividual, CustomerLegal } from 'generated/prisma/client' +import { CustomerType } from 'generated/prisma/enums' +import { CreateSalesInvoiceItemDto } from '../sales-invoice-items/dto/create-sales-invoice-item.dto' export class CreateSalesInvoiceDto { @IsNumber() @@ -18,7 +18,10 @@ export class CreateSalesInvoiceDto { total_amount: number @ApiProperty({ required: true }) - @IsDateString({ strict: true }, { message: 'invoice_date must be a valid ISO-8601 string' }) + @IsDateString( + { strict: true }, + { message: 'invoice_date must be a valid ISO-8601 string' }, + ) invoice_date: Date @ApiProperty({ required: true }) diff --git a/src/modules/sales-invoice-items/dto/create-sales-invoice-item.dto.ts b/src/modules/pos/sales-invoices/sales-invoice-items/dto/create-sales-invoice-item.dto.ts similarity index 73% rename from src/modules/sales-invoice-items/dto/create-sales-invoice-item.dto.ts rename to src/modules/pos/sales-invoices/sales-invoice-items/dto/create-sales-invoice-item.dto.ts index b0cf942..e7615be 100644 --- a/src/modules/sales-invoice-items/dto/create-sales-invoice-item.dto.ts +++ b/src/modules/pos/sales-invoices/sales-invoice-items/dto/create-sales-invoice-item.dto.ts @@ -1,7 +1,7 @@ import { ApiProperty, PartialType } from '@nestjs/swagger' import { IsEnum, IsNumber, IsObject, IsOptional, IsString } from 'class-validator' -import type { SaleInvoiceStandardPayload } from '../../../common/interfaces/sale-invoice-payload' -import { SalesInvoiceItemPricingModel, UnitType } from '../../../generated/prisma/enums' +import type { SaleInvoiceStandardPayload } from 'common/interfaces/sale-invoice-payload' +import { UnitType } from 'generated/prisma/enums' export class CreateSalesInvoiceItemDto { @IsNumber() @@ -34,10 +34,10 @@ export class CreateSalesInvoiceItemDto { @ApiProperty({ enum: Object.values(UnitType) }) unit_type: UnitType - @IsEnum(SalesInvoiceItemPricingModel) - @ApiProperty({ enum: Object.values(SalesInvoiceItemPricingModel) }) - @IsOptional() - pricingModel: SalesInvoiceItemPricingModel + // @IsEnum(SalesInvoiceItemPricingModel) + // @ApiProperty({ enum: Object.values(SalesInvoiceItemPricingModel) }) + // @IsOptional() + // pricingModel: SalesInvoiceItemPricingModel @IsOptional() @IsObject() diff --git a/src/modules/sales-invoice-items/sales-invoice-items.controller.ts b/src/modules/pos/sales-invoices/sales-invoice-items/sales-invoice-items.controller.ts similarity index 100% rename from src/modules/sales-invoice-items/sales-invoice-items.controller.ts rename to src/modules/pos/sales-invoices/sales-invoice-items/sales-invoice-items.controller.ts diff --git a/src/modules/sales-invoice-items/sales-invoice-items.module.ts b/src/modules/pos/sales-invoices/sales-invoice-items/sales-invoice-items.module.ts similarity index 100% rename from src/modules/sales-invoice-items/sales-invoice-items.module.ts rename to src/modules/pos/sales-invoices/sales-invoice-items/sales-invoice-items.module.ts diff --git a/src/modules/sales-invoice-items/sales-invoice-items.service.ts b/src/modules/pos/sales-invoices/sales-invoice-items/sales-invoice-items.service.ts similarity index 100% rename from src/modules/sales-invoice-items/sales-invoice-items.service.ts rename to src/modules/pos/sales-invoices/sales-invoice-items/sales-invoice-items.service.ts diff --git a/src/modules/sales-invoice-payments/dto/create-sales-invoice-payment.dto.ts b/src/modules/pos/sales-invoices/sales-invoice-payments/dto/create-sales-invoice-payment.dto.ts similarity index 100% rename from src/modules/sales-invoice-payments/dto/create-sales-invoice-payment.dto.ts rename to src/modules/pos/sales-invoices/sales-invoice-payments/dto/create-sales-invoice-payment.dto.ts diff --git a/src/modules/sales-invoice-payments/sales-invoice-payments.controller.ts b/src/modules/pos/sales-invoices/sales-invoice-payments/sales-invoice-payments.controller.ts similarity index 100% rename from src/modules/sales-invoice-payments/sales-invoice-payments.controller.ts rename to src/modules/pos/sales-invoices/sales-invoice-payments/sales-invoice-payments.controller.ts diff --git a/src/modules/sales-invoice-payments/sales-invoice-payments.module.ts b/src/modules/pos/sales-invoices/sales-invoice-payments/sales-invoice-payments.module.ts similarity index 100% rename from src/modules/sales-invoice-payments/sales-invoice-payments.module.ts rename to src/modules/pos/sales-invoices/sales-invoice-payments/sales-invoice-payments.module.ts diff --git a/src/modules/sales-invoice-payments/sales-invoice-payments.service.ts b/src/modules/pos/sales-invoices/sales-invoice-payments/sales-invoice-payments.service.ts similarity index 100% rename from src/modules/sales-invoice-payments/sales-invoice-payments.service.ts rename to src/modules/pos/sales-invoices/sales-invoice-payments/sales-invoice-payments.service.ts diff --git a/src/modules/sales-invoices/sales-invoices.controller.ts b/src/modules/pos/sales-invoices/sales-invoices.controller.ts similarity index 86% rename from src/modules/sales-invoices/sales-invoices.controller.ts rename to src/modules/pos/sales-invoices/sales-invoices.controller.ts index 4e2c8ca..0166f08 100644 --- a/src/modules/sales-invoices/sales-invoices.controller.ts +++ b/src/modules/pos/sales-invoices/sales-invoices.controller.ts @@ -1,9 +1,10 @@ import { Body, Controller, Get, Param, Post } from '@nestjs/common' -import { reqTokenPayload } from '../auth/current-user.decorator' + +import { reqTokenPayload } from '@/modules/auth/current-user.decorator' import { CreateSalesInvoiceDto } from './dto/create-sales-invoice.dto' import { SalesInvoicesService } from './sales-invoices.service' -@Controller('sales_invoices') +@Controller('pos/sales_invoices') export class SalesInvoicesController { constructor(private readonly salesInvoicesService: SalesInvoicesService) {} diff --git a/src/modules/sales-invoices/sales-invoices.module.ts b/src/modules/pos/sales-invoices/sales-invoices.module.ts similarity index 87% rename from src/modules/sales-invoices/sales-invoices.module.ts rename to src/modules/pos/sales-invoices/sales-invoices.module.ts index 7098764..137b699 100644 --- a/src/modules/sales-invoices/sales-invoices.module.ts +++ b/src/modules/pos/sales-invoices/sales-invoices.module.ts @@ -6,4 +6,4 @@ import { SalesInvoicesService } from './sales-invoices.service' controllers: [SalesInvoicesController], providers: [SalesInvoicesService], }) -export class SalesInvoicesModule {} +export class PosSalesInvoicesModule {} diff --git a/src/modules/sales-invoices/sales-invoices.service.ts b/src/modules/pos/sales-invoices/sales-invoices.service.ts similarity index 94% rename from src/modules/sales-invoices/sales-invoices.service.ts rename to src/modules/pos/sales-invoices/sales-invoices.service.ts index 5b0db8d..efcf988 100644 --- a/src/modules/sales-invoices/sales-invoices.service.ts +++ b/src/modules/pos/sales-invoices/sales-invoices.service.ts @@ -1,8 +1,8 @@ +import { PrismaService } from '@/prisma/prisma.service' import { Injectable } from '@nestjs/common' -import { ResponseMapper } from '../../common/response/response-mapper' -import type { CustomerIndividual, CustomerLegal } from '../../generated/prisma/client' -import { CustomerType, PaymentMethodType } from '../../generated/prisma/enums' -import { PrismaService } from '../../prisma/prisma.service' +import { ResponseMapper } from 'common/response/response-mapper' +import type { CustomerIndividual, CustomerLegal } from 'generated/prisma/client' +import { CustomerType, PaymentMethodType } from 'generated/prisma/enums' import { CreateSalesInvoiceDto } from './dto/create-sales-invoice.dto' // Define type guard for CustomerIndividual @@ -175,7 +175,7 @@ export class SalesInvoicesService { total_amount: item.total_amount, payload: item.payload, unit_type: item.unit_type, - pricing_model: item.pricingModel, + // pricing_model: item.pricingModel, })), }, }, diff --git a/src/modules/profile/profile.service.ts b/src/modules/profile/profile.service.ts index 84822b6..7ce6f90 100644 --- a/src/modules/profile/profile.service.ts +++ b/src/modules/profile/profile.service.ts @@ -1,8 +1,8 @@ +import { PrismaService } from '@/prisma/prisma.service' import { Injectable } from '@nestjs/common' -import { Public } from '../../common/decorators/public.decorator' -import type { AccessTokenPayload } from '../../common/models/token-model' -import { ResponseMapper } from '../../common/response/response-mapper' -import { PrismaService } from '../../prisma/prisma.service' +import { Public } from 'common/decorators/public.decorator' +import type { AccessTokenPayload } from 'common/models/token-model' +import { ResponseMapper } from 'common/response/response-mapper' @Injectable() export class ProfileService { diff --git a/tsconfig.json b/tsconfig.json index e034888..d95a0dc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,6 +13,20 @@ "noFallthroughCasesInSwitch": false, "noImplicitAny": false, "outDir": "./dist", + "paths": { + "@/*": [ + "./src/*" + ], + "common/*": [ + "./src/common/*" + ], + "generated/*": [ + "./src/generated/*" + ], + "modules/*": [ + "./src/modules/*" + ] + }, "removeComments": true, "resolvePackageJsonExports": true, "skipLibCheck": true,