From 2b6795d00766faf9f46c144194fe860542ae86c9 Mon Sep 17 00:00:00 2001 From: "s.esmaeili" Date: Mon, 14 Sep 2026 20:56:17 +0330 Subject: [PATCH] api: fix migration runner, serve uploads correctly, add product photos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three real bugs found and fixed while wiring up product images end-to-end: 1. src/prisma/migrate.ts only discovered flat prisma/migrations/.sql files, never Prisma's own folder-per-migration layout (_/migration.sql). Every migration created the normal way (via 'prisma migrate dev') was silently skipped; only a hand-added flat duplicate (prisma/migrations/0001_init.sql, now removed) ever ran. This meant schema.prisma had drifted well ahead of what any real deploy database actually had (missing columns on City, Customer, Branch, Product, several new tables). Fixed to discover both layouts; the drift is closed with a new 20260914165255_sync_schema_drift migration. 2. Neither nginx.conf (production) nor vite.config.ts (dev) proxied /uploads/ to the API — only /api/. UploadedFile/ProductImage URLs (/uploads/, served by main.ts's useStaticAssets OUTSIDE the /api prefix) 404'd through both. Both now proxy /uploads/ the same way /api/ already was. 3. docker-compose.yml's api service had no volume for storage/uploads, so every uploaded file — and by extension every ProductImage row pointing at one — was lost on the next container recreate/redeploy. Added a named volume. Also: main.ts's static file serving now sets Content-Type: image/avif explicitly (serve-static's bundled mime table predates .avif and served it as application/octet-stream; browsers rendered it anyway by sniffing, but a stricter client would not have). Product photos: copied 15 real jewelry photos into the uploads volume, registered them as UploadedFile rows, and assigned each of the 5 existing Product rows a randomly picked one (duplicates allowed, per request), replacing their /img/no-items.png placeholder ProductImage row. Verified end-to-end in a real browser against the real containerized API+DB: logged in, opened the admin product list, confirmed all 5 rows render their photo (naturalWidth/Height populated, network 200s, no console errors). Co-Authored-By: Claude Sonnet 5 --- apps/admin-panel/nginx.conf | 14 + apps/admin-panel/vite.config.ts | 4 + apps/api/prisma/migrations/0001_init.sql | 431 - .../migration.sql | 362 + apps/api/release/app.js | 16246 +++++++++- apps/api/release/migrations/0001_init.sql | 431 - .../migration.sql | 362 + apps/api/release/seed.js | 2035 +- .../api/release/vendor/.prisma/client/edge.js | 227 +- .../vendor/.prisma/client/index-browser.js | 217 +- .../release/vendor/.prisma/client/index.d.ts | 26552 +++++++++++++++- .../release/vendor/.prisma/client/index.js | 227 +- .../vendor/.prisma/client/package.json | 2 +- .../vendor/.prisma/client/schema.prisma | 506 +- .../api/release/vendor/.prisma/client/wasm.js | 217 +- apps/api/src/main.ts | 14 +- apps/api/src/prisma/migrate.ts | 53 +- docker-compose.yml | 7 + 18 files changed, 46398 insertions(+), 1509 deletions(-) delete mode 100644 apps/api/prisma/migrations/0001_init.sql create mode 100644 apps/api/prisma/migrations/20260914165255_sync_schema_drift/migration.sql delete mode 100644 apps/api/release/migrations/0001_init.sql create mode 100644 apps/api/release/migrations/20260914165255_sync_schema_drift/migration.sql diff --git a/apps/admin-panel/nginx.conf b/apps/admin-panel/nginx.conf index fd8e9f0..d7253ed 100644 --- a/apps/admin-panel/nginx.conf +++ b/apps/admin-panel/nginx.conf @@ -20,6 +20,20 @@ server { proxy_set_header X-Forwarded-Proto $scheme; } + # Uploaded files (product images, category icons, ...) are served by the + # API's own static handler (main.ts useStaticAssets), not stored here — + # without this the ProductImage.url values the admin panel renders + # (/uploads/) 404 through this nginx instead of reaching the API. + location /uploads/ { + set $api_upstream http://goldbank-api:3000; + proxy_pass $api_upstream$request_uri; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + location / { try_files $uri $uri/ /index.html; } diff --git a/apps/admin-panel/vite.config.ts b/apps/admin-panel/vite.config.ts index 8134f39..6e156b0 100644 --- a/apps/admin-panel/vite.config.ts +++ b/apps/admin-panel/vite.config.ts @@ -45,6 +45,10 @@ export default defineConfig(({ mode }) => { port: 5174, proxy: { '/api': 'http://localhost:3000', + // Uploaded files (ProductImage.url etc.) are served by the API's own + // static handler, not this dev server — without this they 404 in dev + // even though production nginx (nginx.conf) already proxies them. + '/uploads': 'http://localhost:3000', }, }, }; diff --git a/apps/api/prisma/migrations/0001_init.sql b/apps/api/prisma/migrations/0001_init.sql deleted file mode 100644 index c12ff02..0000000 --- a/apps/api/prisma/migrations/0001_init.sql +++ /dev/null @@ -1,431 +0,0 @@ --- CreateEnum -CREATE TYPE "AdminRole" AS ENUM ('SUPER_ADMIN', 'SYSTEM_APPROVER', 'SALES_EXPERT', 'WORKSHOP_SUPERVISOR', 'ACCOUNTANT'); - --- CreateEnum -CREATE TYPE "VerificationStep" AS ENUM ('UNVERIFIED', 'STEP_ONE_SUBMITTED', 'STEP_TWO_SUBMITTED', 'VERIFIED'); - --- CreateEnum -CREATE TYPE "OrderStatus" AS ENUM ('SUSPENDED', 'PLACED', 'ADMIN_APPROVED', 'SOURCING', 'PREPARING', 'DELIVERED_TO_AGENT', 'DELIVERED_TO_CUSTOMER', 'CANCELLED'); - --- CreateEnum -CREATE TYPE "PreOrderStatus" AS ENUM ('PLACED', 'ADMIN_APPROVED', 'WORKSHOP_APPROVED', 'READY_TO_SHIP', 'DELIVERED', 'CANCELLED'); - --- CreateEnum -CREATE TYPE "LedgerCurrency" AS ENUM ('GOLD_GRAM', 'RIAL'); - --- CreateEnum -CREATE TYPE "LedgerDirection" AS ENUM ('DEBIT', 'CREDIT'); - --- CreateEnum -CREATE TYPE "LedgerSourceType" AS ENUM ('ORDER_STOCK', 'ORDER_PRE_ORDER', 'REPAYMENT_MELTED_GOLD', 'REPAYMENT_TRANSFER', 'REPAYMENT_CHEQUE', 'REPAYMENT_CASH', 'WALLET_BONUS', 'ADJUSTMENT'); - --- CreateTable -CREATE TABLE "City" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "province" TEXT, - - CONSTRAINT "City_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "AdminUser" ( - "id" TEXT NOT NULL, - "fullName" TEXT NOT NULL, - "mobile" TEXT NOT NULL, - "passwordHash" TEXT NOT NULL, - "role" "AdminRole" NOT NULL, - "branchId" TEXT, - "wagePercent" DECIMAL(6,3), - "isActive" BOOLEAN NOT NULL DEFAULT true, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "AdminUser_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Customer" ( - "id" TEXT NOT NULL, - "fullName" TEXT NOT NULL, - "mobile" TEXT NOT NULL, - "nationalCode" TEXT NOT NULL, - "passwordHash" TEXT NOT NULL, - "cityId" TEXT, - "referredByAgentId" TEXT, - "goldCreditLimitGrams" DECIMAL(14,4) NOT NULL DEFAULT 0, - "goldDebtGrams" DECIMAL(14,4) NOT NULL DEFAULT 0, - "fiatDebtRial" DECIMAL(20,2) NOT NULL DEFAULT 0, - "verificationStep" "VerificationStep" NOT NULL DEFAULT 'UNVERIFIED', - "nationalIdImageUrl" TEXT, - "businessLicenseUrl" TEXT, - "shopImageUrl" TEXT, - "isActive" BOOLEAN NOT NULL DEFAULT true, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Customer_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "CustomerAddress" ( - "id" TEXT NOT NULL, - "customerId" TEXT NOT NULL, - "cityId" TEXT, - "addressLine" TEXT NOT NULL, - "isDefault" BOOLEAN NOT NULL DEFAULT false, - - CONSTRAINT "CustomerAddress_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Branch" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "cityId" TEXT, - - CONSTRAINT "Branch_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Workshop" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "isActive" BOOLEAN NOT NULL DEFAULT true, - - CONSTRAINT "Workshop_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Category" ( - "id" TEXT NOT NULL, - "title" TEXT NOT NULL, - "parentId" TEXT, - - CONSTRAINT "Category_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Brand" ( - "id" TEXT NOT NULL, - "title" TEXT NOT NULL, - - CONSTRAINT "Brand_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Collection" ( - "id" TEXT NOT NULL, - "title" TEXT NOT NULL, - "description" TEXT, - "isActive" BOOLEAN NOT NULL DEFAULT true, - - CONSTRAINT "Collection_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "CollectionProduct" ( - "collectionId" TEXT NOT NULL, - "productId" TEXT NOT NULL, - - CONSTRAINT "CollectionProduct_pkey" PRIMARY KEY ("collectionId","productId") -); - --- CreateTable -CREATE TABLE "Product" ( - "id" TEXT NOT NULL, - "title" TEXT NOT NULL, - "description" TEXT, - "categoryId" TEXT, - "brandId" TEXT, - "isActive" BOOLEAN NOT NULL DEFAULT true, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "Product_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "ProductImage" ( - "id" TEXT NOT NULL, - "productId" TEXT NOT NULL, - "url" TEXT NOT NULL, - "sortOrder" INTEGER NOT NULL DEFAULT 0, - - CONSTRAINT "ProductImage_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "ProductVariant" ( - "id" TEXT NOT NULL, - "productId" TEXT NOT NULL, - "title" TEXT NOT NULL, - "sku" TEXT, - "rashWeightGrams" DECIMAL(14,4) NOT NULL, - "defaultWagePercent" DECIMAL(6,3) NOT NULL, - "isActive" BOOLEAN NOT NULL DEFAULT true, - - CONSTRAINT "ProductVariant_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Order" ( - "id" TEXT NOT NULL, - "orderNumber" TEXT NOT NULL, - "customerId" TEXT NOT NULL, - "branchId" TEXT, - "status" "OrderStatus" NOT NULL DEFAULT 'PLACED', - "totalGoldWeightGrams" DECIMAL(14,4) NOT NULL, - "wageWeightGrams" DECIMAL(14,4) NOT NULL, - "flatRialCharge" DECIMAL(20,2) NOT NULL DEFAULT 0, - "isSuspendedOverCreditLimit" BOOLEAN NOT NULL DEFAULT false, - "deliveredAt" TIMESTAMP(3), - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Order_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "OrderItem" ( - "id" TEXT NOT NULL, - "orderId" TEXT NOT NULL, - "productVariantId" TEXT NOT NULL, - "quantity" INTEGER NOT NULL, - "rashWeightGramsSnapshot" DECIMAL(14,4) NOT NULL, - "wagePercentSnapshot" DECIMAL(6,3) NOT NULL, - "discountPercentSnapshot" DECIMAL(6,3) NOT NULL DEFAULT 0, - "computedWeightGrams" DECIMAL(14,4) NOT NULL, - "flatRialCharge" DECIMAL(20,2) NOT NULL DEFAULT 0, - - CONSTRAINT "OrderItem_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "OrderStatusEvent" ( - "id" TEXT NOT NULL, - "orderId" TEXT NOT NULL, - "fromStatus" "OrderStatus", - "toStatus" "OrderStatus" NOT NULL, - "note" TEXT, - "actorAdminUserId" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "OrderStatusEvent_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "PreOrder" ( - "id" TEXT NOT NULL, - "customerId" TEXT NOT NULL, - "cityId" TEXT, - "workshopId" TEXT, - "status" "PreOrderStatus" NOT NULL DEFAULT 'PLACED', - "designImageUrl" TEXT, - "colorName" TEXT, - "sizeSpec" TEXT, - "stoneColor" TEXT, - "minaColor" TEXT, - "estimatedWeightGrams" DECIMAL(14,4), - "estimatedPriceRial" DECIMAL(20,2), - "description" TEXT, - "convertedOrderId" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "PreOrder_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "PreOrderStatusEvent" ( - "id" TEXT NOT NULL, - "preOrderId" TEXT NOT NULL, - "changes" JSONB NOT NULL, - "actorAdminUserId" TEXT, - "ipAddress" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "PreOrderStatusEvent_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "LedgerEntry" ( - "id" TEXT NOT NULL, - "customerId" TEXT NOT NULL, - "currency" "LedgerCurrency" NOT NULL, - "direction" "LedgerDirection" NOT NULL, - "sourceType" "LedgerSourceType" NOT NULL, - "amount" DECIMAL(20,4) NOT NULL, - "karatPerMille" INTEGER, - "pricePerGramRialAtEntry" DECIMAL(20,2), - "orderId" TEXT, - "confirmed" BOOLEAN NOT NULL DEFAULT false, - "confirmedAt" TIMESTAMP(3), - "postedByAdminUserId" TEXT, - "note" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "LedgerEntry_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "GoldPriceQuote" ( - "id" TEXT NOT NULL, - "karatPerMille" INTEGER NOT NULL, - "pricePerGramRial" DECIMAL(20,2) NOT NULL, - "source" TEXT NOT NULL, - "quotedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "GoldPriceQuote_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "WalletBonus" ( - "id" TEXT NOT NULL, - "customerId" TEXT NOT NULL, - "orderId" TEXT, - "goldGrams" DECIMAL(14,4) NOT NULL, - "grantedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "expiresAt" TIMESTAMP(3) NOT NULL, - "consumedAt" TIMESTAMP(3), - "isActive" BOOLEAN NOT NULL DEFAULT true, - - CONSTRAINT "WalletBonus_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE UNIQUE INDEX "AdminUser_mobile_key" ON "AdminUser"("mobile"); - --- CreateIndex -CREATE INDEX "AdminUser_role_idx" ON "AdminUser"("role"); - --- CreateIndex -CREATE UNIQUE INDEX "Customer_mobile_key" ON "Customer"("mobile"); - --- CreateIndex -CREATE UNIQUE INDEX "Customer_nationalCode_key" ON "Customer"("nationalCode"); - --- CreateIndex -CREATE INDEX "Customer_referredByAgentId_idx" ON "Customer"("referredByAgentId"); - --- CreateIndex -CREATE UNIQUE INDEX "ProductVariant_sku_key" ON "ProductVariant"("sku"); - --- CreateIndex -CREATE UNIQUE INDEX "Order_orderNumber_key" ON "Order"("orderNumber"); - --- CreateIndex -CREATE INDEX "Order_customerId_idx" ON "Order"("customerId"); - --- CreateIndex -CREATE INDEX "Order_status_idx" ON "Order"("status"); - --- CreateIndex -CREATE INDEX "OrderStatusEvent_orderId_idx" ON "OrderStatusEvent"("orderId"); - --- CreateIndex -CREATE UNIQUE INDEX "PreOrder_convertedOrderId_key" ON "PreOrder"("convertedOrderId"); - --- CreateIndex -CREATE INDEX "PreOrder_customerId_idx" ON "PreOrder"("customerId"); - --- CreateIndex -CREATE INDEX "PreOrderStatusEvent_preOrderId_idx" ON "PreOrderStatusEvent"("preOrderId"); - --- CreateIndex -CREATE INDEX "LedgerEntry_customerId_currency_idx" ON "LedgerEntry"("customerId", "currency"); - --- CreateIndex -CREATE INDEX "LedgerEntry_orderId_idx" ON "LedgerEntry"("orderId"); - --- CreateIndex -CREATE INDEX "GoldPriceQuote_karatPerMille_quotedAt_idx" ON "GoldPriceQuote"("karatPerMille", "quotedAt"); - --- CreateIndex -CREATE INDEX "WalletBonus_customerId_isActive_idx" ON "WalletBonus"("customerId", "isActive"); - --- AddForeignKey -ALTER TABLE "AdminUser" ADD CONSTRAINT "AdminUser_branchId_fkey" FOREIGN KEY ("branchId") REFERENCES "Branch"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Customer" ADD CONSTRAINT "Customer_cityId_fkey" FOREIGN KEY ("cityId") REFERENCES "City"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Customer" ADD CONSTRAINT "Customer_referredByAgentId_fkey" FOREIGN KEY ("referredByAgentId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "CustomerAddress" ADD CONSTRAINT "CustomerAddress_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "CustomerAddress" ADD CONSTRAINT "CustomerAddress_cityId_fkey" FOREIGN KEY ("cityId") REFERENCES "City"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Branch" ADD CONSTRAINT "Branch_cityId_fkey" FOREIGN KEY ("cityId") REFERENCES "City"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Category" ADD CONSTRAINT "Category_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "Category"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "CollectionProduct" ADD CONSTRAINT "CollectionProduct_collectionId_fkey" FOREIGN KEY ("collectionId") REFERENCES "Collection"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "CollectionProduct" ADD CONSTRAINT "CollectionProduct_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Product" ADD CONSTRAINT "Product_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "Category"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Product" ADD CONSTRAINT "Product_brandId_fkey" FOREIGN KEY ("brandId") REFERENCES "Brand"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "ProductImage" ADD CONSTRAINT "ProductImage_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "ProductVariant" ADD CONSTRAINT "ProductVariant_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Order" ADD CONSTRAINT "Order_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Order" ADD CONSTRAINT "Order_branchId_fkey" FOREIGN KEY ("branchId") REFERENCES "Branch"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "OrderItem" ADD CONSTRAINT "OrderItem_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "OrderItem" ADD CONSTRAINT "OrderItem_productVariantId_fkey" FOREIGN KEY ("productVariantId") REFERENCES "ProductVariant"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "OrderStatusEvent" ADD CONSTRAINT "OrderStatusEvent_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "OrderStatusEvent" ADD CONSTRAINT "OrderStatusEvent_actorAdminUserId_fkey" FOREIGN KEY ("actorAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrder" ADD CONSTRAINT "PreOrder_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrder" ADD CONSTRAINT "PreOrder_cityId_fkey" FOREIGN KEY ("cityId") REFERENCES "City"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrder" ADD CONSTRAINT "PreOrder_workshopId_fkey" FOREIGN KEY ("workshopId") REFERENCES "Workshop"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrder" ADD CONSTRAINT "PreOrder_convertedOrderId_fkey" FOREIGN KEY ("convertedOrderId") REFERENCES "Order"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrderStatusEvent" ADD CONSTRAINT "PreOrderStatusEvent_preOrderId_fkey" FOREIGN KEY ("preOrderId") REFERENCES "PreOrder"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrderStatusEvent" ADD CONSTRAINT "PreOrderStatusEvent_actorAdminUserId_fkey" FOREIGN KEY ("actorAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "LedgerEntry" ADD CONSTRAINT "LedgerEntry_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "LedgerEntry" ADD CONSTRAINT "LedgerEntry_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "LedgerEntry" ADD CONSTRAINT "LedgerEntry_postedByAdminUserId_fkey" FOREIGN KEY ("postedByAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "WalletBonus" ADD CONSTRAINT "WalletBonus_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - diff --git a/apps/api/prisma/migrations/20260914165255_sync_schema_drift/migration.sql b/apps/api/prisma/migrations/20260914165255_sync_schema_drift/migration.sql new file mode 100644 index 0000000..d26a54c --- /dev/null +++ b/apps/api/prisma/migrations/20260914165255_sync_schema_drift/migration.sql @@ -0,0 +1,362 @@ +-- CreateEnum +CREATE TYPE "CustomerKind" AS ENUM ('SALES_AGENT', 'APP_SHOPKEEPER', 'WALK_IN_SHOPKEEPER', 'BANKER', 'WORKSHOP_SUPERVISOR'); + +-- CreateEnum +CREATE TYPE "OrderChannel" AS ENUM ('RETAIL', 'WHOLESALE'); + +-- CreateEnum +CREATE TYPE "CommentStatus" AS ENUM ('PENDING', 'APPROVED', 'REJECTED'); + +-- CreateEnum +CREATE TYPE "PromotionScope" AS ENUM ('PRODUCT', 'CATEGORY', 'CUSTOMER', 'BRAND'); + +-- CreateEnum +CREATE TYPE "PromotionUsage" AS ENUM ('ONCE', 'UNTIL_END_DATE'); + +-- CreateEnum +CREATE TYPE "MessageAudience" AS ENUM ('SINGLE_NUMBER', 'MULTIPLE_NUMBERS', 'ALL_CUSTOMERS', 'WHOLESALE_CUSTOMERS', 'RETAIL_CUSTOMERS', 'SALES_AGENTS'); + +-- AlterTable +ALTER TABLE "AdminUser" ADD COLUMN "userTypeId" INTEGER; + +-- AlterTable +ALTER TABLE "Branch" ADD COLUMN "address" TEXT, +ADD COLUMN "isActive" BOOLEAN NOT NULL DEFAULT true, +ADD COLUMN "phone" TEXT; + +-- AlterTable +ALTER TABLE "Category" ADD COLUMN "description" TEXT, +ADD COLUMN "iconUrl" TEXT, +ADD COLUMN "imageUrl" TEXT, +ADD COLUMN "metaTag" TEXT, +ADD COLUMN "type" INTEGER NOT NULL DEFAULT 1; + +-- AlterTable +ALTER TABLE "City" ADD COLUMN "percent" DECIMAL(6,3), +ADD COLUMN "percentAux" DECIMAL(6,3); + +-- AlterTable +ALTER TABLE "Customer" ADD COLUMN "address" TEXT, +ADD COLUMN "avatarFileId" TEXT, +ADD COLUMN "canPlaceOrders" BOOLEAN NOT NULL DEFAULT true, +ADD COLUMN "isArchived" BOOLEAN NOT NULL DEFAULT false, +ADD COLUMN "kind" "CustomerKind" NOT NULL DEFAULT 'APP_SHOPKEEPER', +ADD COLUMN "memberCode" TEXT, +ADD COLUMN "pasazhName" TEXT, +ADD COLUMN "phone" TEXT, +ADD COLUMN "storeName" TEXT, +ADD COLUMN "zone" TEXT; + +-- AlterTable +ALTER TABLE "LedgerEntry" ADD COLUMN "accountName" TEXT, +ADD COLUMN "bankName" TEXT, +ADD COLUMN "hallmark" TEXT, +ADD COLUMN "labName" TEXT, +ADD COLUMN "originalValue" DECIMAL(14,4), +ADD COLUMN "priceRial" DECIMAL(20,2), +ADD COLUMN "receivedAt" TIMESTAMP(3), +ADD COLUMN "transferTo" TEXT; + +-- AlterTable +ALTER TABLE "Order" ADD COLUMN "channel" "OrderChannel" NOT NULL DEFAULT 'RETAIL'; + +-- AlterTable +ALTER TABLE "Product" ADD COLUMN "productCode" TEXT, +ADD COLUMN "showType" INTEGER NOT NULL DEFAULT 3; + +-- AlterTable +ALTER TABLE "ProductVariant" ADD COLUMN "isPreOrder" BOOLEAN NOT NULL DEFAULT false, +ADD COLUMN "qty" INTEGER NOT NULL DEFAULT 0; + +-- AlterTable +ALTER TABLE "Workshop" ADD COLUMN "address" TEXT, +ADD COLUMN "phone" TEXT, +ADD COLUMN "supervisorId" TEXT; + +-- DropTable +DROP TABLE "_goldbank_migrations"; + +-- CreateTable +CREATE TABLE "user_type" ( + "id" INTEGER NOT NULL, + "title" TEXT NOT NULL, + "isActive" BOOLEAN NOT NULL DEFAULT true, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "user_type_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "permission" ( + "rid" TEXT NOT NULL, + "userTypeId" INTEGER NOT NULL, + + CONSTRAINT "permission_pkey" PRIMARY KEY ("rid","userTypeId") +); + +-- CreateTable +CREATE TABLE "Comment" ( + "id" TEXT NOT NULL, + "productId" TEXT NOT NULL, + "customerId" TEXT NOT NULL, + "body" TEXT NOT NULL, + "status" "CommentStatus" NOT NULL DEFAULT 'PENDING', + "replyToId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Comment_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Setting" ( + "key" TEXT NOT NULL, + "value" JSONB NOT NULL, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Setting_pkey" PRIMARY KEY ("key") +); + +-- CreateTable +CREATE TABLE "Promotion" ( + "id" TEXT NOT NULL, + "title" TEXT NOT NULL, + "description" TEXT, + "scope" "PromotionScope" NOT NULL DEFAULT 'PRODUCT', + "usage" "PromotionUsage" NOT NULL DEFAULT 'ONCE', + "discountPercent" DECIMAL(6,3) NOT NULL, + "isActive" BOOLEAN NOT NULL DEFAULT true, + "platform" INTEGER NOT NULL DEFAULT 3, + "startsAt" TIMESTAMP(3), + "endsAt" TIMESTAMP(3), + "productId" TEXT, + "categoryId" TEXT, + "customerId" TEXT, + "brandId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Promotion_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "PromotionExclusion" ( + "id" TEXT NOT NULL, + "type" INTEGER NOT NULL, + "itemId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "PromotionExclusion_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "BranchAllocation" ( + "id" TEXT NOT NULL, + "branchId" TEXT NOT NULL, + "allocatorAdminUserId" TEXT, + "note" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "BranchAllocation_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "BranchAllocationItem" ( + "id" TEXT NOT NULL, + "allocationId" TEXT NOT NULL, + "productId" TEXT NOT NULL, + "weightGrams" DECIMAL(14,4), + + CONSTRAINT "BranchAllocationItem_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "SmsMessage" ( + "id" TEXT NOT NULL, + "audience" "MessageAudience" NOT NULL, + "recipients" TEXT, + "body" TEXT NOT NULL, + "sentCount" INTEGER NOT NULL DEFAULT 0, + "sentByAdminUserId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "SmsMessage_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Notification" ( + "id" TEXT NOT NULL, + "title" TEXT NOT NULL, + "body" TEXT NOT NULL, + "audience" "MessageAudience" NOT NULL DEFAULT 'ALL_CUSTOMERS', + "sentByAdminUserId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Notification_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "NotificationRecipient" ( + "id" TEXT NOT NULL, + "notificationId" TEXT NOT NULL, + "customerId" TEXT NOT NULL, + "readAt" TIMESTAMP(3), + + CONSTRAINT "NotificationRecipient_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "NewsletterSubscriber" ( + "id" TEXT NOT NULL, + "email" TEXT, + "mobile" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "NewsletterSubscriber_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "CustomerActivityLog" ( + "id" TEXT NOT NULL, + "customerId" TEXT NOT NULL, + "action" TEXT NOT NULL, + "detail" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "CustomerActivityLog_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "UploadedFile" ( + "id" TEXT NOT NULL, + "url" TEXT NOT NULL, + "originalName" TEXT NOT NULL, + "mimeType" TEXT NOT NULL, + "sizeBytes" INTEGER NOT NULL, + "purpose" TEXT, + "uploadedByAdminUserId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "UploadedFile_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE INDEX "permission_userTypeId_idx" ON "permission"("userTypeId"); + +-- CreateIndex +CREATE INDEX "Comment_productId_idx" ON "Comment"("productId"); + +-- CreateIndex +CREATE INDEX "Comment_customerId_idx" ON "Comment"("customerId"); + +-- CreateIndex +CREATE INDEX "Comment_status_idx" ON "Comment"("status"); + +-- CreateIndex +CREATE INDEX "Promotion_scope_isActive_idx" ON "Promotion"("scope", "isActive"); + +-- CreateIndex +CREATE INDEX "PromotionExclusion_type_idx" ON "PromotionExclusion"("type"); + +-- CreateIndex +CREATE UNIQUE INDEX "PromotionExclusion_type_itemId_key" ON "PromotionExclusion"("type", "itemId"); + +-- CreateIndex +CREATE INDEX "BranchAllocation_branchId_idx" ON "BranchAllocation"("branchId"); + +-- CreateIndex +CREATE UNIQUE INDEX "BranchAllocationItem_allocationId_productId_key" ON "BranchAllocationItem"("allocationId", "productId"); + +-- CreateIndex +CREATE INDEX "SmsMessage_createdAt_idx" ON "SmsMessage"("createdAt"); + +-- CreateIndex +CREATE INDEX "Notification_createdAt_idx" ON "Notification"("createdAt"); + +-- CreateIndex +CREATE INDEX "NotificationRecipient_customerId_readAt_idx" ON "NotificationRecipient"("customerId", "readAt"); + +-- CreateIndex +CREATE UNIQUE INDEX "NotificationRecipient_notificationId_customerId_key" ON "NotificationRecipient"("notificationId", "customerId"); + +-- CreateIndex +CREATE UNIQUE INDEX "NewsletterSubscriber_email_key" ON "NewsletterSubscriber"("email"); + +-- CreateIndex +CREATE UNIQUE INDEX "NewsletterSubscriber_mobile_key" ON "NewsletterSubscriber"("mobile"); + +-- CreateIndex +CREATE INDEX "CustomerActivityLog_customerId_createdAt_idx" ON "CustomerActivityLog"("customerId", "createdAt"); + +-- CreateIndex +CREATE INDEX "UploadedFile_purpose_idx" ON "UploadedFile"("purpose"); + +-- CreateIndex +CREATE INDEX "AdminUser_userTypeId_idx" ON "AdminUser"("userTypeId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Product_productCode_key" ON "Product"("productCode"); + +-- AddForeignKey +ALTER TABLE "AdminUser" ADD CONSTRAINT "AdminUser_userTypeId_fkey" FOREIGN KEY ("userTypeId") REFERENCES "user_type"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Customer" ADD CONSTRAINT "Customer_avatarFileId_fkey" FOREIGN KEY ("avatarFileId") REFERENCES "UploadedFile"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Workshop" ADD CONSTRAINT "Workshop_supervisorId_fkey" FOREIGN KEY ("supervisorId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "permission" ADD CONSTRAINT "permission_userTypeId_fkey" FOREIGN KEY ("userTypeId") REFERENCES "user_type"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Comment" ADD CONSTRAINT "Comment_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Comment" ADD CONSTRAINT "Comment_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Comment" ADD CONSTRAINT "Comment_replyToId_fkey" FOREIGN KEY ("replyToId") REFERENCES "Comment"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Promotion" ADD CONSTRAINT "Promotion_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Promotion" ADD CONSTRAINT "Promotion_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "Category"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Promotion" ADD CONSTRAINT "Promotion_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Promotion" ADD CONSTRAINT "Promotion_brandId_fkey" FOREIGN KEY ("brandId") REFERENCES "Brand"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BranchAllocation" ADD CONSTRAINT "BranchAllocation_branchId_fkey" FOREIGN KEY ("branchId") REFERENCES "Branch"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BranchAllocation" ADD CONSTRAINT "BranchAllocation_allocatorAdminUserId_fkey" FOREIGN KEY ("allocatorAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BranchAllocationItem" ADD CONSTRAINT "BranchAllocationItem_allocationId_fkey" FOREIGN KEY ("allocationId") REFERENCES "BranchAllocation"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BranchAllocationItem" ADD CONSTRAINT "BranchAllocationItem_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "SmsMessage" ADD CONSTRAINT "SmsMessage_sentByAdminUserId_fkey" FOREIGN KEY ("sentByAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Notification" ADD CONSTRAINT "Notification_sentByAdminUserId_fkey" FOREIGN KEY ("sentByAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "NotificationRecipient" ADD CONSTRAINT "NotificationRecipient_notificationId_fkey" FOREIGN KEY ("notificationId") REFERENCES "Notification"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "NotificationRecipient" ADD CONSTRAINT "NotificationRecipient_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "CustomerActivityLog" ADD CONSTRAINT "CustomerActivityLog_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "UploadedFile" ADD CONSTRAINT "UploadedFile_uploadedByAdminUserId_fkey" FOREIGN KEY ("uploadedByAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; + diff --git a/apps/api/release/app.js b/apps/api/release/app.js index 2d13f5e..079d4bb 100644 --- a/apps/api/release/app.js +++ b/apps/api/release/app.js @@ -1,7 +1,9 @@ "use strict"; +var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; @@ -21,6 +23,14 @@ var __copyProps = (to, from, except, desc) => { } return to; }; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // ../../node_modules/.pnpm/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js @@ -2098,10 +2108,10 @@ var require_inject_decorator = __commonJS({ "../../node_modules/.pnpm/@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_reflect-metadata@0.2.2_rxjs@7.8.2/node_modules/@nestjs/common/decorators/core/inject.decorator.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Inject = Inject; + exports2.Inject = Inject2; var constants_1 = require_constants2(); var shared_utils_1 = require_shared_utils(); - function Inject(token) { + function Inject2(token) { const injectCallHasArguments = arguments.length > 0; return (target, key, index) => { let type = token || Reflect.getMetadata("design:type", target, key); @@ -2148,11 +2158,11 @@ var require_injectable_decorator = __commonJS({ "../../node_modules/.pnpm/@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_reflect-metadata@0.2.2_rxjs@7.8.2/node_modules/@nestjs/common/decorators/core/injectable.decorator.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Injectable = Injectable; + exports2.Injectable = Injectable2; exports2.mixin = mixin; var uid_1 = require_dist(); var constants_1 = require_constants2(); - function Injectable(options) { + function Injectable2(options) { return (target) => { Reflect.defineMetadata(constants_1.INJECTABLE_WATERMARK, true, target); Reflect.defineMetadata(constants_1.SCOPE_OPTIONS_METADATA, options, target); @@ -2162,7 +2172,7 @@ var require_injectable_decorator = __commonJS({ Object.defineProperty(mixinClass, "name", { value: (0, uid_1.uid)(21) }); - Injectable()(mixinClass); + Injectable2()(mixinClass); return mixinClass; } } @@ -2173,10 +2183,10 @@ var require_optional_decorator = __commonJS({ "../../node_modules/.pnpm/@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_reflect-metadata@0.2.2_rxjs@7.8.2/node_modules/@nestjs/common/decorators/core/optional.decorator.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Optional = Optional; + exports2.Optional = Optional2; var constants_1 = require_constants2(); var shared_utils_1 = require_shared_utils(); - function Optional() { + function Optional2() { return (target, key, index) => { if (!(0, shared_utils_1.isUndefined)(index)) { const args = Reflect.getMetadata(constants_1.OPTIONAL_DEPS_METADATA, target) || []; @@ -2399,9 +2409,9 @@ var require_module_decorator = __commonJS({ "../../node_modules/.pnpm/@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_reflect-metadata@0.2.2_rxjs@7.8.2/node_modules/@nestjs/common/decorators/modules/module.decorator.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Module = Module; + exports2.Module = Module2; var validate_module_keys_util_1 = require_validate_module_keys_util(); - function Module(metadata) { + function Module2(metadata) { const propsKeys = Object.keys(metadata); (0, validate_module_keys_util_1.validateModuleKeys)(propsKeys); return (target) => { @@ -4231,7 +4241,7 @@ var require_logger_service = __commonJS({ day: "2-digit", month: "2-digit" }); - var Logger = Logger_1 = class Logger { + var Logger2 = Logger_1 = class Logger { constructor(context, options = {}) { this.context = context; this.options = options; @@ -4345,10 +4355,10 @@ var require_logger_service = __commonJS({ return this.localInstanceRef; } }; - exports2.Logger = Logger; - Logger.logBuffer = new Array(); - Logger.staticInstanceRef = DEFAULT_LOGGER; - Logger.WrapBuffer = (target, propertyKey, descriptor) => { + exports2.Logger = Logger2; + Logger2.logBuffer = new Array(); + Logger2.staticInstanceRef = DEFAULT_LOGGER; + Logger2.WrapBuffer = (target, propertyKey, descriptor) => { const originalFn = descriptor.value; descriptor.value = function(...args) { if (Logger_1.isBufferAttached) { @@ -4362,83 +4372,83 @@ var require_logger_service = __commonJS({ }; }; tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger.prototype, "error", null); + ], Logger2.prototype, "error", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger.prototype, "log", null); + ], Logger2.prototype, "log", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger.prototype, "warn", null); + ], Logger2.prototype, "warn", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger.prototype, "debug", null); + ], Logger2.prototype, "debug", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger.prototype, "verbose", null); + ], Logger2.prototype, "verbose", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger.prototype, "fatal", null); + ], Logger2.prototype, "fatal", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger, "error", null); + ], Logger2, "error", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger, "log", null); + ], Logger2, "log", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger, "warn", null); + ], Logger2, "warn", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger, "debug", null); + ], Logger2, "debug", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger, "verbose", null); + ], Logger2, "verbose", null); tslib_1.__decorate([ - Logger.WrapBuffer, + Logger2.WrapBuffer, tslib_1.__metadata("design:type", Function), tslib_1.__metadata("design:paramtypes", [Object, Object]), tslib_1.__metadata("design:returntype", void 0) - ], Logger, "fatal", null); - exports2.Logger = Logger = Logger_1 = tslib_1.__decorate([ + ], Logger2, "fatal", null); + exports2.Logger = Logger2 = Logger_1 = tslib_1.__decorate([ (0, core_12.Injectable)(), tslib_1.__param(0, (0, core_12.Optional)()), tslib_1.__param(1, (0, core_12.Optional)()), tslib_1.__metadata("design:paramtypes", [String, Object]) - ], Logger); + ], Logger2); } }); @@ -27252,7 +27262,7 @@ var require_Action = __commonJS({ var Subscription_1 = require_Subscription(); var Action = (function(_super) { __extends2(Action2, _super); - function Action2(scheduler, work) { + function Action2(scheduler2, work) { return _super.call(this) || this; } Action2.prototype.schedule = function(state, delay) { @@ -27346,9 +27356,9 @@ var require_AsyncAction = __commonJS({ var arrRemove_1 = require_arrRemove(); var AsyncAction = (function(_super) { __extends2(AsyncAction2, _super); - function AsyncAction2(scheduler, work) { - var _this = _super.call(this, scheduler, work) || this; - _this.scheduler = scheduler; + function AsyncAction2(scheduler2, work) { + var _this = _super.call(this, scheduler2, work) || this; + _this.scheduler = scheduler2; _this.work = work; _this.pending = false; return _this; @@ -27363,20 +27373,20 @@ var require_AsyncAction = __commonJS({ } this.state = state; var id = this.id; - var scheduler = this.scheduler; + var scheduler2 = this.scheduler; if (id != null) { - this.id = this.recycleAsyncId(scheduler, id, delay); + this.id = this.recycleAsyncId(scheduler2, id, delay); } this.pending = true; this.delay = delay; - this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay); + this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler2, this.id, delay); return this; }; - AsyncAction2.prototype.requestAsyncId = function(scheduler, _id, delay) { + AsyncAction2.prototype.requestAsyncId = function(scheduler2, _id, delay) { if (delay === void 0) { delay = 0; } - return intervalProvider_1.intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay); + return intervalProvider_1.intervalProvider.setInterval(scheduler2.flush.bind(scheduler2, this), delay); }; AsyncAction2.prototype.recycleAsyncId = function(_scheduler, id, delay) { if (delay === void 0) { @@ -27418,13 +27428,13 @@ var require_AsyncAction = __commonJS({ }; AsyncAction2.prototype.unsubscribe = function() { if (!this.closed) { - var _a = this, id = _a.id, scheduler = _a.scheduler; - var actions = scheduler.actions; + var _a = this, id = _a.id, scheduler2 = _a.scheduler; + var actions = scheduler2.actions; this.work = this.state = this.scheduler = null; this.pending = false; arrRemove_1.arrRemove(actions, this); if (id != null) { - this.id = this.recycleAsyncId(scheduler, id, null); + this.id = this.recycleAsyncId(scheduler2, id, null); } this.delay = null; _super.prototype.unsubscribe.call(this); @@ -27593,28 +27603,28 @@ var require_timer = __commonJS({ var async_1 = require_async(); var isScheduler_1 = require_isScheduler(); var isDate_1 = require_isDate2(); - function timer(dueTime, intervalOrScheduler, scheduler) { + function timer(dueTime, intervalOrScheduler, scheduler2) { if (dueTime === void 0) { dueTime = 0; } - if (scheduler === void 0) { - scheduler = async_1.async; + if (scheduler2 === void 0) { + scheduler2 = async_1.async; } var intervalDuration = -1; if (intervalOrScheduler != null) { if (isScheduler_1.isScheduler(intervalOrScheduler)) { - scheduler = intervalOrScheduler; + scheduler2 = intervalOrScheduler; } else { intervalDuration = intervalOrScheduler; } } return new Observable_1.Observable(function(subscriber) { - var due = isDate_1.isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime; + var due = isDate_1.isValidDate(dueTime) ? +dueTime - scheduler2.now() : dueTime; if (due < 0) { due = 0; } var n = 0; - return scheduler.schedule(function() { + return scheduler2.schedule(function() { if (!subscriber.closed) { subscriber.next(n++); if (0 <= intervalDuration) { @@ -27639,12 +27649,12 @@ var require_auditTime = __commonJS({ var async_1 = require_async(); var audit_1 = require_audit(); var timer_1 = require_timer(); - function auditTime(duration, scheduler) { - if (scheduler === void 0) { - scheduler = async_1.asyncScheduler; + function auditTime(duration, scheduler2) { + if (scheduler2 === void 0) { + scheduler2 = async_1.asyncScheduler; } return audit_1.audit(function() { - return timer_1.timer(duration, scheduler); + return timer_1.timer(duration, scheduler2); }); } exports2.auditTime = auditTime; @@ -27811,14 +27821,14 @@ var require_executeSchedule = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.executeSchedule = void 0; - function executeSchedule(parentSubscription, scheduler, work, delay, repeat) { + function executeSchedule(parentSubscription, scheduler2, work, delay, repeat) { if (delay === void 0) { delay = 0; } if (repeat === void 0) { repeat = false; } - var scheduleSubscription = scheduler.schedule(function() { + var scheduleSubscription = scheduler2.schedule(function() { work(); if (repeat) { parentSubscription.add(this.schedule(null, delay)); @@ -27865,7 +27875,7 @@ var require_bufferTime = __commonJS({ for (var _i = 1; _i < arguments.length; _i++) { otherArgs[_i - 1] = arguments[_i]; } - var scheduler = (_a = args_1.popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : async_1.asyncScheduler; + var scheduler2 = (_a = args_1.popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : async_1.asyncScheduler; var bufferCreationInterval = (_b = otherArgs[0]) !== null && _b !== void 0 ? _b : null; var maxBufferSize = otherArgs[1] || Infinity; return lift_1.operate(function(source, subscriber) { @@ -27888,13 +27898,13 @@ var require_bufferTime = __commonJS({ subs }; bufferRecords.push(record_1); - executeSchedule_1.executeSchedule(subs, scheduler, function() { + executeSchedule_1.executeSchedule(subs, scheduler2, function() { return emit(record_1); }, bufferTimeSpan); } }; if (bufferCreationInterval !== null && bufferCreationInterval >= 0) { - executeSchedule_1.executeSchedule(subscriber, scheduler, startBuffer, bufferCreationInterval, true); + executeSchedule_1.executeSchedule(subscriber, scheduler2, startBuffer, bufferCreationInterval, true); } else { restartOnEmit = true; } @@ -28115,21 +28125,21 @@ var require_observeOn = __commonJS({ var executeSchedule_1 = require_executeSchedule(); var lift_1 = require_lift(); var OperatorSubscriber_1 = require_OperatorSubscriber(); - function observeOn(scheduler, delay) { + function observeOn(scheduler2, delay) { if (delay === void 0) { delay = 0; } return lift_1.operate(function(source, subscriber) { source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) { - return executeSchedule_1.executeSchedule(subscriber, scheduler, function() { + return executeSchedule_1.executeSchedule(subscriber, scheduler2, function() { return subscriber.next(value); }, delay); }, function() { - return executeSchedule_1.executeSchedule(subscriber, scheduler, function() { + return executeSchedule_1.executeSchedule(subscriber, scheduler2, function() { return subscriber.complete(); }, delay); }, function(err) { - return executeSchedule_1.executeSchedule(subscriber, scheduler, function() { + return executeSchedule_1.executeSchedule(subscriber, scheduler2, function() { return subscriber.error(err); }, delay); })); @@ -28146,12 +28156,12 @@ var require_subscribeOn = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.subscribeOn = void 0; var lift_1 = require_lift(); - function subscribeOn(scheduler, delay) { + function subscribeOn(scheduler2, delay) { if (delay === void 0) { delay = 0; } return lift_1.operate(function(source, subscriber) { - subscriber.add(scheduler.schedule(function() { + subscriber.add(scheduler2.schedule(function() { return source.subscribe(subscriber); }, delay)); }); @@ -28169,8 +28179,8 @@ var require_scheduleObservable = __commonJS({ var innerFrom_1 = require_innerFrom(); var observeOn_1 = require_observeOn(); var subscribeOn_1 = require_subscribeOn(); - function scheduleObservable(input, scheduler) { - return innerFrom_1.innerFrom(input).pipe(subscribeOn_1.subscribeOn(scheduler), observeOn_1.observeOn(scheduler)); + function scheduleObservable(input, scheduler2) { + return innerFrom_1.innerFrom(input).pipe(subscribeOn_1.subscribeOn(scheduler2), observeOn_1.observeOn(scheduler2)); } exports2.scheduleObservable = scheduleObservable; } @@ -28185,8 +28195,8 @@ var require_schedulePromise = __commonJS({ var innerFrom_1 = require_innerFrom(); var observeOn_1 = require_observeOn(); var subscribeOn_1 = require_subscribeOn(); - function schedulePromise(input, scheduler) { - return innerFrom_1.innerFrom(input).pipe(subscribeOn_1.subscribeOn(scheduler), observeOn_1.observeOn(scheduler)); + function schedulePromise(input, scheduler2) { + return innerFrom_1.innerFrom(input).pipe(subscribeOn_1.subscribeOn(scheduler2), observeOn_1.observeOn(scheduler2)); } exports2.schedulePromise = schedulePromise; } @@ -28199,10 +28209,10 @@ var require_scheduleArray = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.scheduleArray = void 0; var Observable_1 = require_Observable(); - function scheduleArray(input, scheduler) { + function scheduleArray(input, scheduler2) { return new Observable_1.Observable(function(subscriber) { var i = 0; - return scheduler.schedule(function() { + return scheduler2.schedule(function() { if (i === input.length) { subscriber.complete(); } else { @@ -28228,12 +28238,12 @@ var require_scheduleIterable = __commonJS({ var iterator_1 = require_iterator(); var isFunction_1 = require_isFunction(); var executeSchedule_1 = require_executeSchedule(); - function scheduleIterable(input, scheduler) { + function scheduleIterable(input, scheduler2) { return new Observable_1.Observable(function(subscriber) { var iterator; - executeSchedule_1.executeSchedule(subscriber, scheduler, function() { + executeSchedule_1.executeSchedule(subscriber, scheduler2, function() { iterator = input[iterator_1.iterator](); - executeSchedule_1.executeSchedule(subscriber, scheduler, function() { + executeSchedule_1.executeSchedule(subscriber, scheduler2, function() { var _a; var value; var done; @@ -28267,14 +28277,14 @@ var require_scheduleAsyncIterable = __commonJS({ exports2.scheduleAsyncIterable = void 0; var Observable_1 = require_Observable(); var executeSchedule_1 = require_executeSchedule(); - function scheduleAsyncIterable(input, scheduler) { + function scheduleAsyncIterable(input, scheduler2) { if (!input) { throw new Error("Iterable cannot be null"); } return new Observable_1.Observable(function(subscriber) { - executeSchedule_1.executeSchedule(subscriber, scheduler, function() { + executeSchedule_1.executeSchedule(subscriber, scheduler2, function() { var iterator = input[Symbol.asyncIterator](); - executeSchedule_1.executeSchedule(subscriber, scheduler, function() { + executeSchedule_1.executeSchedule(subscriber, scheduler2, function() { iterator.next().then(function(result) { if (result.done) { subscriber.complete(); @@ -28298,8 +28308,8 @@ var require_scheduleReadableStreamLike = __commonJS({ exports2.scheduleReadableStreamLike = void 0; var scheduleAsyncIterable_1 = require_scheduleAsyncIterable(); var isReadableStreamLike_1 = require_isReadableStreamLike(); - function scheduleReadableStreamLike(input, scheduler) { - return scheduleAsyncIterable_1.scheduleAsyncIterable(isReadableStreamLike_1.readableStreamLikeToAsyncGenerator(input), scheduler); + function scheduleReadableStreamLike(input, scheduler2) { + return scheduleAsyncIterable_1.scheduleAsyncIterable(isReadableStreamLike_1.readableStreamLikeToAsyncGenerator(input), scheduler2); } exports2.scheduleReadableStreamLike = scheduleReadableStreamLike; } @@ -28324,25 +28334,25 @@ var require_scheduled = __commonJS({ var throwUnobservableError_1 = require_throwUnobservableError(); var isReadableStreamLike_1 = require_isReadableStreamLike(); var scheduleReadableStreamLike_1 = require_scheduleReadableStreamLike(); - function scheduled(input, scheduler) { + function scheduled(input, scheduler2) { if (input != null) { if (isInteropObservable_1.isInteropObservable(input)) { - return scheduleObservable_1.scheduleObservable(input, scheduler); + return scheduleObservable_1.scheduleObservable(input, scheduler2); } if (isArrayLike_1.isArrayLike(input)) { - return scheduleArray_1.scheduleArray(input, scheduler); + return scheduleArray_1.scheduleArray(input, scheduler2); } if (isPromise_1.isPromise(input)) { - return schedulePromise_1.schedulePromise(input, scheduler); + return schedulePromise_1.schedulePromise(input, scheduler2); } if (isAsyncIterable_1.isAsyncIterable(input)) { - return scheduleAsyncIterable_1.scheduleAsyncIterable(input, scheduler); + return scheduleAsyncIterable_1.scheduleAsyncIterable(input, scheduler2); } if (isIterable_1.isIterable(input)) { - return scheduleIterable_1.scheduleIterable(input, scheduler); + return scheduleIterable_1.scheduleIterable(input, scheduler2); } if (isReadableStreamLike_1.isReadableStreamLike(input)) { - return scheduleReadableStreamLike_1.scheduleReadableStreamLike(input, scheduler); + return scheduleReadableStreamLike_1.scheduleReadableStreamLike(input, scheduler2); } } throw throwUnobservableError_1.createInvalidObservableTypeError(input); @@ -28359,8 +28369,8 @@ var require_from = __commonJS({ exports2.from = void 0; var scheduled_1 = require_scheduled(); var innerFrom_1 = require_innerFrom(); - function from(input, scheduler) { - return scheduler ? scheduled_1.scheduled(input, scheduler) : innerFrom_1.innerFrom(input); + function from(input, scheduler2) { + return scheduler2 ? scheduled_1.scheduled(input, scheduler2) : innerFrom_1.innerFrom(input); } exports2.from = from; } @@ -28463,31 +28473,31 @@ var require_combineLatest = __commonJS({ for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } - var scheduler = args_1.popScheduler(args); + var scheduler2 = args_1.popScheduler(args); var resultSelector = args_1.popResultSelector(args); var _a = argsArgArrayOrObject_1.argsArgArrayOrObject(args), observables = _a.args, keys = _a.keys; if (observables.length === 0) { - return from_1.from([], scheduler); + return from_1.from([], scheduler2); } - var result = new Observable_1.Observable(combineLatestInit(observables, scheduler, keys ? function(values) { + var result = new Observable_1.Observable(combineLatestInit(observables, scheduler2, keys ? function(values) { return createObject_1.createObject(keys, values); } : identity_1.identity)); return resultSelector ? result.pipe(mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector)) : result; } exports2.combineLatest = combineLatest; - function combineLatestInit(observables, scheduler, valueTransform) { + function combineLatestInit(observables, scheduler2, valueTransform) { if (valueTransform === void 0) { valueTransform = identity_1.identity; } return function(subscriber) { - maybeSchedule(scheduler, function() { + maybeSchedule(scheduler2, function() { var length = observables.length; var values = new Array(length); var active = length; var remainingFirstValues = length; var _loop_1 = function(i2) { - maybeSchedule(scheduler, function() { - var source = from_1.from(observables[i2], scheduler); + maybeSchedule(scheduler2, function() { + var source = from_1.from(observables[i2], scheduler2); var hasFirstValue = false; source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) { values[i2] = value; @@ -28512,9 +28522,9 @@ var require_combineLatest = __commonJS({ }; } exports2.combineLatestInit = combineLatestInit; - function maybeSchedule(scheduler, execute, subscription) { - if (scheduler) { - executeSchedule_1.executeSchedule(subscription, scheduler, execute); + function maybeSchedule(scheduler2, execute, subscription) { + if (scheduler2) { + executeSchedule_1.executeSchedule(subscription, scheduler2, execute); } else { execute(); } @@ -28903,9 +28913,9 @@ var require_concat2 = __commonJS({ for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } - var scheduler = args_1.popScheduler(args); + var scheduler2 = args_1.popScheduler(args); return lift_1.operate(function(source, subscriber) { - concatAll_1.concatAll()(from_1.from(__spreadArray2([source], __read2(args)), scheduler)).subscribe(subscriber); + concatAll_1.concatAll()(from_1.from(__spreadArray2([source], __read2(args)), scheduler2)).subscribe(subscriber); }); } exports2.concat = concat; @@ -29316,9 +29326,9 @@ var require_debounceTime = __commonJS({ var async_1 = require_async(); var lift_1 = require_lift(); var OperatorSubscriber_1 = require_OperatorSubscriber(); - function debounceTime(dueTime, scheduler) { - if (scheduler === void 0) { - scheduler = async_1.asyncScheduler; + function debounceTime(dueTime, scheduler2) { + if (scheduler2 === void 0) { + scheduler2 = async_1.asyncScheduler; } return lift_1.operate(function(source, subscriber) { var activeTask = null; @@ -29335,7 +29345,7 @@ var require_debounceTime = __commonJS({ }; function emitWhenIdle() { var targetTime = lastTime + dueTime; - var now = scheduler.now(); + var now = scheduler2.now(); if (now < targetTime) { activeTask = this.schedule(void 0, targetTime - now); subscriber.add(activeTask); @@ -29345,9 +29355,9 @@ var require_debounceTime = __commonJS({ } source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) { lastValue = value; - lastTime = scheduler.now(); + lastTime = scheduler2.now(); if (!activeTask) { - activeTask = scheduler.schedule(emitWhenIdle, dueTime); + activeTask = scheduler2.schedule(emitWhenIdle, dueTime); subscriber.add(activeTask); } }, function() { @@ -29418,13 +29428,13 @@ var require_empty = __commonJS({ exports2.EMPTY = new Observable_1.Observable(function(subscriber) { return subscriber.complete(); }); - function empty(scheduler) { - return scheduler ? emptyScheduled(scheduler) : exports2.EMPTY; + function empty(scheduler2) { + return scheduler2 ? emptyScheduled(scheduler2) : exports2.EMPTY; } exports2.empty = empty; - function emptyScheduled(scheduler) { + function emptyScheduled(scheduler2) { return new Observable_1.Observable(function(subscriber) { - return scheduler.schedule(function() { + return scheduler2.schedule(function() { return subscriber.complete(); }); }); @@ -29529,11 +29539,11 @@ var require_delay = __commonJS({ var async_1 = require_async(); var delayWhen_1 = require_delayWhen(); var timer_1 = require_timer(); - function delay(due, scheduler) { - if (scheduler === void 0) { - scheduler = async_1.asyncScheduler; + function delay(due, scheduler2) { + if (scheduler2 === void 0) { + scheduler2 = async_1.asyncScheduler; } - var duration = timer_1.timer(due, scheduler); + var duration = timer_1.timer(due, scheduler2); return delayWhen_1.delayWhen(function() { return duration; }); @@ -29555,8 +29565,8 @@ var require_of = __commonJS({ for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } - var scheduler = args_1.popScheduler(args); - return from_1.from(args, scheduler); + var scheduler2 = args_1.popScheduler(args); + return from_1.from(args, scheduler2); } exports2.of = of; } @@ -29570,15 +29580,15 @@ var require_throwError = __commonJS({ exports2.throwError = void 0; var Observable_1 = require_Observable(); var isFunction_1 = require_isFunction(); - function throwError(errorOrErrorFactory, scheduler) { + function throwError(errorOrErrorFactory, scheduler2) { var errorFactory = isFunction_1.isFunction(errorOrErrorFactory) ? errorOrErrorFactory : function() { return errorOrErrorFactory; }; var init = function(subscriber) { return subscriber.error(errorFactory()); }; - return new Observable_1.Observable(scheduler ? function(subscriber) { - return scheduler.schedule(init, 0, subscriber); + return new Observable_1.Observable(scheduler2 ? function(subscriber) { + return scheduler2.schedule(init, 0, subscriber); } : init); } exports2.throwError = throwError; @@ -30010,13 +30020,13 @@ var require_expand = __commonJS({ exports2.expand = void 0; var lift_1 = require_lift(); var mergeInternals_1 = require_mergeInternals(); - function expand(project, concurrent, scheduler) { + function expand(project, concurrent, scheduler2) { if (concurrent === void 0) { concurrent = Infinity; } concurrent = (concurrent || 0) < 1 ? Infinity : concurrent; return lift_1.operate(function(source, subscriber) { - return mergeInternals_1.mergeInternals(source, subscriber, project, concurrent, void 0, true, scheduler); + return mergeInternals_1.mergeInternals(source, subscriber, project, concurrent, void 0, true, scheduler2); }); } exports2.expand = expand; @@ -30383,10 +30393,10 @@ var require_merge2 = __commonJS({ for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } - var scheduler = args_1.popScheduler(args); + var scheduler2 = args_1.popScheduler(args); var concurrent = args_1.popNumber(args, Infinity); return lift_1.operate(function(source, subscriber) { - mergeAll_1.mergeAll(concurrent)(from_1.from(__spreadArray2([source], __read2(args)), scheduler)).subscribe(subscriber); + mergeAll_1.mergeAll(concurrent)(from_1.from(__spreadArray2([source], __read2(args)), scheduler2)).subscribe(subscriber); }); } exports2.merge = merge; @@ -31547,17 +31557,17 @@ var require_interval = __commonJS({ exports2.interval = void 0; var async_1 = require_async(); var timer_1 = require_timer(); - function interval(period, scheduler) { + function interval(period, scheduler2) { if (period === void 0) { period = 0; } - if (scheduler === void 0) { - scheduler = async_1.asyncScheduler; + if (scheduler2 === void 0) { + scheduler2 = async_1.asyncScheduler; } if (period < 0) { period = 0; } - return timer_1.timer(period, period, scheduler); + return timer_1.timer(period, period, scheduler2); } exports2.interval = interval; } @@ -31572,11 +31582,11 @@ var require_sampleTime = __commonJS({ var async_1 = require_async(); var sample_1 = require_sample(); var interval_1 = require_interval(); - function sampleTime(period, scheduler) { - if (scheduler === void 0) { - scheduler = async_1.asyncScheduler; + function sampleTime(period, scheduler2) { + if (scheduler2 === void 0) { + scheduler2 = async_1.asyncScheduler; } - return sample_1.sample(interval_1.interval(period, scheduler)); + return sample_1.sample(interval_1.interval(period, scheduler2)); } exports2.sampleTime = sampleTime; } @@ -31777,18 +31787,18 @@ var require_shareReplay = __commonJS({ exports2.shareReplay = void 0; var ReplaySubject_1 = require_ReplaySubject(); var share_1 = require_share(); - function shareReplay(configOrBufferSize, windowTime, scheduler) { + function shareReplay(configOrBufferSize, windowTime, scheduler2) { var _a, _b, _c; var bufferSize; var refCount = false; if (configOrBufferSize && typeof configOrBufferSize === "object") { - _a = configOrBufferSize.bufferSize, bufferSize = _a === void 0 ? Infinity : _a, _b = configOrBufferSize.windowTime, windowTime = _b === void 0 ? Infinity : _b, _c = configOrBufferSize.refCount, refCount = _c === void 0 ? false : _c, scheduler = configOrBufferSize.scheduler; + _a = configOrBufferSize.bufferSize, bufferSize = _a === void 0 ? Infinity : _a, _b = configOrBufferSize.windowTime, windowTime = _b === void 0 ? Infinity : _b, _c = configOrBufferSize.refCount, refCount = _c === void 0 ? false : _c, scheduler2 = configOrBufferSize.scheduler; } else { bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity; } return share_1.share({ connector: function() { - return new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler); + return new ReplaySubject_1.ReplaySubject(bufferSize, windowTime, scheduler2); }, resetOnError: true, resetOnComplete: false, @@ -31982,9 +31992,9 @@ var require_startWith = __commonJS({ for (var _i = 0; _i < arguments.length; _i++) { values[_i] = arguments[_i]; } - var scheduler = args_1.popScheduler(values); + var scheduler2 = args_1.popScheduler(values); return lift_1.operate(function(source, subscriber) { - (scheduler ? concat_1.concat(values, source, scheduler) : concat_1.concat(values, source)).subscribe(subscriber); + (scheduler2 ? concat_1.concat(values, source, scheduler2) : concat_1.concat(values, source)).subscribe(subscriber); }); } exports2.startWith = startWith; @@ -32240,11 +32250,11 @@ var require_throttleTime = __commonJS({ var async_1 = require_async(); var throttle_1 = require_throttle(); var timer_1 = require_timer(); - function throttleTime(duration, scheduler, config) { - if (scheduler === void 0) { - scheduler = async_1.asyncScheduler; + function throttleTime(duration, scheduler2, config) { + if (scheduler2 === void 0) { + scheduler2 = async_1.asyncScheduler; } - var duration$ = timer_1.timer(duration, scheduler); + var duration$ = timer_1.timer(duration, scheduler2); return throttle_1.throttle(function() { return duration$; }, config); @@ -32262,14 +32272,14 @@ var require_timeInterval = __commonJS({ var async_1 = require_async(); var lift_1 = require_lift(); var OperatorSubscriber_1 = require_OperatorSubscriber(); - function timeInterval(scheduler) { - if (scheduler === void 0) { - scheduler = async_1.asyncScheduler; + function timeInterval(scheduler2) { + if (scheduler2 === void 0) { + scheduler2 = async_1.asyncScheduler; } return lift_1.operate(function(source, subscriber) { - var last = scheduler.now(); + var last = scheduler2.now(); source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function(value) { - var now = scheduler.now(); + var now = scheduler2.now(); var interval = now - last; last = now; subscriber.next(new TimeInterval(value, interval)); @@ -32313,7 +32323,7 @@ var require_timeout = __commonJS({ }; }); function timeout(config, schedulerArg) { - var _a = isDate_1.isValidDate(config) ? { first: config } : typeof config === "number" ? { each: config } : config, first = _a.first, each = _a.each, _b = _a.with, _with = _b === void 0 ? timeoutErrorFactory : _b, _c = _a.scheduler, scheduler = _c === void 0 ? schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : async_1.asyncScheduler : _c, _d = _a.meta, meta = _d === void 0 ? null : _d; + var _a = isDate_1.isValidDate(config) ? { first: config } : typeof config === "number" ? { each: config } : config, first = _a.first, each = _a.each, _b = _a.with, _with = _b === void 0 ? timeoutErrorFactory : _b, _c = _a.scheduler, scheduler2 = _c === void 0 ? schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : async_1.asyncScheduler : _c, _d = _a.meta, meta = _d === void 0 ? null : _d; if (first == null && each == null) { throw new TypeError("No timeout provided."); } @@ -32323,7 +32333,7 @@ var require_timeout = __commonJS({ var lastValue = null; var seen = 0; var startTimer = function(delay) { - timerSubscription = executeSchedule_1.executeSchedule(subscriber, scheduler, function() { + timerSubscription = executeSchedule_1.executeSchedule(subscriber, scheduler2, function() { try { originalSourceSubscription.unsubscribe(); innerFrom_1.innerFrom(_with({ @@ -32347,7 +32357,7 @@ var require_timeout = __commonJS({ } lastValue = null; })); - !seen && startTimer(first != null ? typeof first === "number" ? first : +first - scheduler.now() : each); + !seen && startTimer(first != null ? typeof first === "number" ? first : +first - scheduler2.now() : each); }); } exports2.timeout = timeout; @@ -32366,11 +32376,11 @@ var require_timeoutWith = __commonJS({ var async_1 = require_async(); var isDate_1 = require_isDate2(); var timeout_1 = require_timeout(); - function timeoutWith(due, withObservable, scheduler) { + function timeoutWith(due, withObservable, scheduler2) { var first; var each; var _with; - scheduler = scheduler !== null && scheduler !== void 0 ? scheduler : async_1.async; + scheduler2 = scheduler2 !== null && scheduler2 !== void 0 ? scheduler2 : async_1.async; if (isDate_1.isValidDate(due)) { first = due; } else if (typeof due === "number") { @@ -32389,7 +32399,7 @@ var require_timeoutWith = __commonJS({ return timeout_1.timeout({ first, each, - scheduler, + scheduler: scheduler2, with: _with }); } @@ -32551,7 +32561,7 @@ var require_windowTime = __commonJS({ for (var _i = 1; _i < arguments.length; _i++) { otherArgs[_i - 1] = arguments[_i]; } - var scheduler = (_a = args_1.popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : async_1.asyncScheduler; + var scheduler2 = (_a = args_1.popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : async_1.asyncScheduler; var windowCreationInterval = (_b = otherArgs[0]) !== null && _b !== void 0 ? _b : null; var maxWindowSize = otherArgs[1] || Infinity; return lift_1.operate(function(source, subscriber) { @@ -32576,13 +32586,13 @@ var require_windowTime = __commonJS({ }; windowRecords.push(record_1); subscriber.next(window_1.asObservable()); - executeSchedule_1.executeSchedule(subs, scheduler, function() { + executeSchedule_1.executeSchedule(subs, scheduler2, function() { return closeWindow(record_1); }, windowTimeSpan); } }; if (windowCreationInterval !== null && windowCreationInterval >= 0) { - executeSchedule_1.executeSchedule(subscriber, scheduler, startWindow, windowCreationInterval, true); + executeSchedule_1.executeSchedule(subscriber, scheduler2, startWindow, windowCreationInterval, true); } else { restartOnClose = true; } @@ -34213,35 +34223,35 @@ var require_AsapAction = __commonJS({ var immediateProvider_1 = require_immediateProvider(); var AsapAction = (function(_super) { __extends2(AsapAction2, _super); - function AsapAction2(scheduler, work) { - var _this = _super.call(this, scheduler, work) || this; - _this.scheduler = scheduler; + function AsapAction2(scheduler2, work) { + var _this = _super.call(this, scheduler2, work) || this; + _this.scheduler = scheduler2; _this.work = work; return _this; } - AsapAction2.prototype.requestAsyncId = function(scheduler, id, delay) { + AsapAction2.prototype.requestAsyncId = function(scheduler2, id, delay) { if (delay === void 0) { delay = 0; } if (delay !== null && delay > 0) { - return _super.prototype.requestAsyncId.call(this, scheduler, id, delay); + return _super.prototype.requestAsyncId.call(this, scheduler2, id, delay); } - scheduler.actions.push(this); - return scheduler._scheduled || (scheduler._scheduled = immediateProvider_1.immediateProvider.setImmediate(scheduler.flush.bind(scheduler, void 0))); + scheduler2.actions.push(this); + return scheduler2._scheduled || (scheduler2._scheduled = immediateProvider_1.immediateProvider.setImmediate(scheduler2.flush.bind(scheduler2, void 0))); }; - AsapAction2.prototype.recycleAsyncId = function(scheduler, id, delay) { + AsapAction2.prototype.recycleAsyncId = function(scheduler2, id, delay) { var _a; if (delay === void 0) { delay = 0; } if (delay != null ? delay > 0 : this.delay > 0) { - return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay); + return _super.prototype.recycleAsyncId.call(this, scheduler2, id, delay); } - var actions = scheduler.actions; + var actions = scheduler2.actions; if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) { immediateProvider_1.immediateProvider.clearImmediate(id); - if (scheduler._scheduled === id) { - scheduler._scheduled = void 0; + if (scheduler2._scheduled === id) { + scheduler2._scheduled = void 0; } } return void 0; @@ -34350,9 +34360,9 @@ var require_QueueAction = __commonJS({ var AsyncAction_1 = require_AsyncAction(); var QueueAction = (function(_super) { __extends2(QueueAction2, _super); - function QueueAction2(scheduler, work) { - var _this = _super.call(this, scheduler, work) || this; - _this.scheduler = scheduler; + function QueueAction2(scheduler2, work) { + var _this = _super.call(this, scheduler2, work) || this; + _this.scheduler = scheduler2; _this.work = work; return _this; } @@ -34371,14 +34381,14 @@ var require_QueueAction = __commonJS({ QueueAction2.prototype.execute = function(state, delay) { return delay > 0 || this.closed ? _super.prototype.execute.call(this, state, delay) : this._execute(state, delay); }; - QueueAction2.prototype.requestAsyncId = function(scheduler, id, delay) { + QueueAction2.prototype.requestAsyncId = function(scheduler2, id, delay) { if (delay === void 0) { delay = 0; } if (delay != null && delay > 0 || delay == null && this.delay > 0) { - return _super.prototype.requestAsyncId.call(this, scheduler, id, delay); + return _super.prototype.requestAsyncId.call(this, scheduler2, id, delay); } - scheduler.flush(this); + scheduler2.flush(this); return 0; }; return QueueAction2; @@ -34466,36 +34476,36 @@ var require_AnimationFrameAction = __commonJS({ var animationFrameProvider_1 = require_animationFrameProvider(); var AnimationFrameAction = (function(_super) { __extends2(AnimationFrameAction2, _super); - function AnimationFrameAction2(scheduler, work) { - var _this = _super.call(this, scheduler, work) || this; - _this.scheduler = scheduler; + function AnimationFrameAction2(scheduler2, work) { + var _this = _super.call(this, scheduler2, work) || this; + _this.scheduler = scheduler2; _this.work = work; return _this; } - AnimationFrameAction2.prototype.requestAsyncId = function(scheduler, id, delay) { + AnimationFrameAction2.prototype.requestAsyncId = function(scheduler2, id, delay) { if (delay === void 0) { delay = 0; } if (delay !== null && delay > 0) { - return _super.prototype.requestAsyncId.call(this, scheduler, id, delay); + return _super.prototype.requestAsyncId.call(this, scheduler2, id, delay); } - scheduler.actions.push(this); - return scheduler._scheduled || (scheduler._scheduled = animationFrameProvider_1.animationFrameProvider.requestAnimationFrame(function() { - return scheduler.flush(void 0); + scheduler2.actions.push(this); + return scheduler2._scheduled || (scheduler2._scheduled = animationFrameProvider_1.animationFrameProvider.requestAnimationFrame(function() { + return scheduler2.flush(void 0); })); }; - AnimationFrameAction2.prototype.recycleAsyncId = function(scheduler, id, delay) { + AnimationFrameAction2.prototype.recycleAsyncId = function(scheduler2, id, delay) { var _a; if (delay === void 0) { delay = 0; } if (delay != null ? delay > 0 : this.delay > 0) { - return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay); + return _super.prototype.recycleAsyncId.call(this, scheduler2, id, delay); } - var actions = scheduler.actions; - if (id != null && id === scheduler._scheduled && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) { + var actions = scheduler2.actions; + if (id != null && id === scheduler2._scheduled && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) { animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id); - scheduler._scheduled = void 0; + scheduler2._scheduled = void 0; } return void 0; }; @@ -34649,16 +34659,16 @@ var require_VirtualTimeScheduler = __commonJS({ exports2.VirtualTimeScheduler = VirtualTimeScheduler; var VirtualAction = (function(_super) { __extends2(VirtualAction2, _super); - function VirtualAction2(scheduler, work, index) { + function VirtualAction2(scheduler2, work, index) { if (index === void 0) { - index = scheduler.index += 1; + index = scheduler2.index += 1; } - var _this = _super.call(this, scheduler, work) || this; - _this.scheduler = scheduler; + var _this = _super.call(this, scheduler2, work) || this; + _this.scheduler = scheduler2; _this.work = work; _this.index = index; _this.active = true; - _this.index = scheduler.index = index; + _this.index = scheduler2.index = index; return _this; } VirtualAction2.prototype.schedule = function(state, delay) { @@ -34677,17 +34687,17 @@ var require_VirtualTimeScheduler = __commonJS({ return Subscription_1.Subscription.EMPTY; } }; - VirtualAction2.prototype.requestAsyncId = function(scheduler, id, delay) { + VirtualAction2.prototype.requestAsyncId = function(scheduler2, id, delay) { if (delay === void 0) { delay = 0; } - this.delay = scheduler.frame + delay; - var actions = scheduler.actions; + this.delay = scheduler2.frame + delay; + var actions = scheduler2.actions; actions.push(this); actions.sort(VirtualAction2.sortActions); return 1; }; - VirtualAction2.prototype.recycleAsyncId = function(scheduler, id, delay) { + VirtualAction2.prototype.recycleAsyncId = function(scheduler2, id, delay) { if (delay === void 0) { delay = 0; } @@ -34834,27 +34844,27 @@ var require_bindCallbackInternals = __commonJS({ var mapOneOrManyArgs_1 = require_mapOneOrManyArgs(); var observeOn_1 = require_observeOn(); var AsyncSubject_1 = require_AsyncSubject(); - function bindCallbackInternals(isNodeStyle, callbackFunc, resultSelector, scheduler) { + function bindCallbackInternals(isNodeStyle, callbackFunc, resultSelector, scheduler2) { if (resultSelector) { if (isScheduler_1.isScheduler(resultSelector)) { - scheduler = resultSelector; + scheduler2 = resultSelector; } else { return function() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } - return bindCallbackInternals(isNodeStyle, callbackFunc, scheduler).apply(this, args).pipe(mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector)); + return bindCallbackInternals(isNodeStyle, callbackFunc, scheduler2).apply(this, args).pipe(mapOneOrManyArgs_1.mapOneOrManyArgs(resultSelector)); }; } } - if (scheduler) { + if (scheduler2) { return function() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } - return bindCallbackInternals(isNodeStyle, callbackFunc).apply(this, args).pipe(subscribeOn_1.subscribeOn(scheduler), observeOn_1.observeOn(scheduler)); + return bindCallbackInternals(isNodeStyle, callbackFunc).apply(this, args).pipe(subscribeOn_1.subscribeOn(scheduler2), observeOn_1.observeOn(scheduler2)); }; } return function() { @@ -34911,8 +34921,8 @@ var require_bindCallback = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.bindCallback = void 0; var bindCallbackInternals_1 = require_bindCallbackInternals(); - function bindCallback(callbackFunc, resultSelector, scheduler) { - return bindCallbackInternals_1.bindCallbackInternals(false, callbackFunc, resultSelector, scheduler); + function bindCallback(callbackFunc, resultSelector, scheduler2) { + return bindCallbackInternals_1.bindCallbackInternals(false, callbackFunc, resultSelector, scheduler2); } exports2.bindCallback = bindCallback; } @@ -34925,8 +34935,8 @@ var require_bindNodeCallback = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.bindNodeCallback = void 0; var bindCallbackInternals_1 = require_bindCallbackInternals(); - function bindNodeCallback(callbackFunc, resultSelector, scheduler) { - return bindCallbackInternals_1.bindCallbackInternals(true, callbackFunc, resultSelector, scheduler); + function bindNodeCallback(callbackFunc, resultSelector, scheduler2) { + return bindCallbackInternals_1.bindCallbackInternals(true, callbackFunc, resultSelector, scheduler2); } exports2.bindNodeCallback = bindNodeCallback; } @@ -35250,17 +35260,17 @@ var require_generate = __commonJS({ var isScheduler_1 = require_isScheduler(); var defer_1 = require_defer(); var scheduleIterable_1 = require_scheduleIterable(); - function generate(initialStateOrOptions, condition, iterate, resultSelectorOrScheduler, scheduler) { + function generate(initialStateOrOptions, condition, iterate, resultSelectorOrScheduler, scheduler2) { var _a, _b; var resultSelector; var initialState; if (arguments.length === 1) { - _a = initialStateOrOptions, initialState = _a.initialState, condition = _a.condition, iterate = _a.iterate, _b = _a.resultSelector, resultSelector = _b === void 0 ? identity_1.identity : _b, scheduler = _a.scheduler; + _a = initialStateOrOptions, initialState = _a.initialState, condition = _a.condition, iterate = _a.iterate, _b = _a.resultSelector, resultSelector = _b === void 0 ? identity_1.identity : _b, scheduler2 = _a.scheduler; } else { initialState = initialStateOrOptions; if (!resultSelectorOrScheduler || isScheduler_1.isScheduler(resultSelectorOrScheduler)) { resultSelector = identity_1.identity; - scheduler = resultSelectorOrScheduler; + scheduler2 = resultSelectorOrScheduler; } else { resultSelector = resultSelectorOrScheduler; } @@ -35286,8 +35296,8 @@ var require_generate = __commonJS({ } }); } - return defer_1.defer(scheduler ? function() { - return scheduleIterable_1.scheduleIterable(gen(), scheduler); + return defer_1.defer(scheduler2 ? function() { + return scheduleIterable_1.scheduleIterable(gen(), scheduler2); } : gen); } exports2.generate = generate; @@ -35326,10 +35336,10 @@ var require_merge3 = __commonJS({ for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } - var scheduler = args_1.popScheduler(args); + var scheduler2 = args_1.popScheduler(args); var concurrent = args_1.popNumber(args, Infinity); var sources = args; - return !sources.length ? empty_1.EMPTY : sources.length === 1 ? innerFrom_1.innerFrom(sources[0]) : mergeAll_1.mergeAll(concurrent)(from_1.from(sources, scheduler)); + return !sources.length ? empty_1.EMPTY : sources.length === 1 ? innerFrom_1.innerFrom(sources[0]) : mergeAll_1.mergeAll(concurrent)(from_1.from(sources, scheduler2)); } exports2.merge = merge; } @@ -35358,8 +35368,8 @@ var require_pairs = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.pairs = void 0; var from_1 = require_from(); - function pairs(obj, scheduler) { - return from_1.from(Object.entries(obj), scheduler); + function pairs(obj, scheduler2) { + return from_1.from(Object.entries(obj), scheduler2); } exports2.pairs = pairs; } @@ -35389,7 +35399,7 @@ var require_range = __commonJS({ exports2.range = void 0; var Observable_1 = require_Observable(); var empty_1 = require_empty(); - function range(start, count, scheduler) { + function range(start, count, scheduler2) { if (count == null) { count = start; start = 0; @@ -35398,9 +35408,9 @@ var require_range = __commonJS({ return empty_1.EMPTY; } var end = count + start; - return new Observable_1.Observable(scheduler ? function(subscriber) { + return new Observable_1.Observable(scheduler2 ? function(subscriber) { var n = start; - return scheduler.schedule(function() { + return scheduler2.schedule(function() { if (n < end) { subscriber.next(n++); this.schedule(); @@ -39532,7 +39542,7 @@ var require_module = __commonJS({ var constants_2 = require_constants5(); var instance_wrapper_1 = require_instance_wrapper(); var module_ref_1 = require_module_ref(); - var Module = class { + var Module2 = class { constructor(_metatype, container) { this._metatype = _metatype; this.container = container; @@ -39926,7 +39936,7 @@ var require_module = __commonJS({ return (0, get_class_scope_1.getClassScope)(provider) === interfaces_1.Scope.TRANSIENT; } }; - exports2.Module = Module; + exports2.Module = Module2; } }); @@ -76189,7 +76199,7 @@ var require_core3 = __commonJS({ var require_prisma_service = __commonJS({ "dist/prisma/prisma.service.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; @@ -76208,7 +76218,7 @@ var require_prisma_service = __commonJS({ } }; exports2.PrismaService = PrismaService; - exports2.PrismaService = PrismaService = __decorate2([ + exports2.PrismaService = PrismaService = __decorate4([ (0, common_12.Injectable)() ], PrismaService); } @@ -76218,7 +76228,7 @@ var require_prisma_service = __commonJS({ var require_prisma_module = __commonJS({ "dist/prisma/prisma.module.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; @@ -76231,7 +76241,7 @@ var require_prisma_module = __commonJS({ var PrismaModule = class PrismaModule { }; exports2.PrismaModule = PrismaModule; - exports2.PrismaModule = PrismaModule = __decorate2([ + exports2.PrismaModule = PrismaModule = __decorate4([ (0, common_12.Global)(), (0, common_12.Module)({ providers: [prisma_service_1.PrismaService], @@ -76245,13 +76255,13 @@ var require_prisma_module = __commonJS({ var require_catalog_service = __commonJS({ "dist/modules/catalog/catalog.service.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -76284,30 +76294,1156 @@ var require_catalog_service = __commonJS({ } }; exports2.CatalogService = CatalogService; - exports2.CatalogService = CatalogService = __decorate2([ + exports2.CatalogService = CatalogService = __decorate4([ (0, common_12.Injectable)(), - __metadata2("design:paramtypes", [prisma_service_1.PrismaService]) + __metadata3("design:paramtypes", [prisma_service_1.PrismaService]) ], CatalogService); } }); +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/abstract.strategy.js +var require_abstract_strategy = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/abstract.strategy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbstractStrategy = void 0; + var AbstractStrategy = class { + }; + exports2.AbstractStrategy = AbstractStrategy; + } +}); + +// ../../node_modules/.pnpm/pause@0.0.1/node_modules/pause/index.js +var require_pause = __commonJS({ + "../../node_modules/.pnpm/pause@0.0.1/node_modules/pause/index.js"(exports2, module2) { + module2.exports = function(obj) { + var onData, onEnd, events = []; + obj.on("data", onData = function(data, encoding) { + events.push(["data", data, encoding]); + }); + obj.on("end", onEnd = function(data, encoding) { + events.push(["end", data, encoding]); + }); + return { + end: function() { + obj.removeListener("data", onData); + obj.removeListener("end", onEnd); + }, + resume: function() { + this.end(); + for (var i = 0, len = events.length; i < len; ++i) { + obj.emit.apply(obj, events[i]); + } + } + }; + }; + } +}); + +// ../../node_modules/.pnpm/passport-strategy@1.0.0/node_modules/passport-strategy/lib/strategy.js +var require_strategy = __commonJS({ + "../../node_modules/.pnpm/passport-strategy@1.0.0/node_modules/passport-strategy/lib/strategy.js"(exports2, module2) { + function Strategy() { + } + Strategy.prototype.authenticate = function(req, options) { + throw new Error("Strategy#authenticate must be overridden by subclass"); + }; + module2.exports = Strategy; + } +}); + +// ../../node_modules/.pnpm/passport-strategy@1.0.0/node_modules/passport-strategy/lib/index.js +var require_lib6 = __commonJS({ + "../../node_modules/.pnpm/passport-strategy@1.0.0/node_modules/passport-strategy/lib/index.js"(exports2, module2) { + var Strategy = require_strategy(); + exports2 = module2.exports = Strategy; + exports2.Strategy = Strategy; + } +}); + +// ../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/strategies/session.js +var require_session = __commonJS({ + "../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/strategies/session.js"(exports2, module2) { + var pause = require_pause(); + var util2 = require("util"); + var Strategy = require_lib6(); + function SessionStrategy(options, deserializeUser) { + if (typeof options == "function") { + deserializeUser = options; + options = void 0; + } + options = options || {}; + Strategy.call(this); + this.name = "session"; + this._key = options.key || "passport"; + this._deserializeUser = deserializeUser; + } + util2.inherits(SessionStrategy, Strategy); + SessionStrategy.prototype.authenticate = function(req, options) { + if (!req.session) { + return this.error(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?")); + } + options = options || {}; + var self2 = this, su; + if (req.session[this._key]) { + su = req.session[this._key].user; + } + if (su || su === 0) { + var paused = options.pauseStream ? pause(req) : null; + this._deserializeUser(su, req, function(err, user) { + if (err) { + return self2.error(err); + } + if (!user) { + delete req.session[self2._key].user; + } else { + var property = req._userProperty || "user"; + req[property] = user; + } + self2.pass(); + if (paused) { + paused.resume(); + } + }); + } else { + self2.pass(); + } + }; + module2.exports = SessionStrategy; + } +}); + +// ../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/sessionmanager.js +var require_sessionmanager = __commonJS({ + "../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/sessionmanager.js"(exports2, module2) { + var merge = require_utils_merge(); + function SessionManager(options, serializeUser) { + if (typeof options == "function") { + serializeUser = options; + options = void 0; + } + options = options || {}; + this._key = options.key || "passport"; + this._serializeUser = serializeUser; + } + SessionManager.prototype.logIn = function(req, user, options, cb) { + if (typeof options == "function") { + cb = options; + options = {}; + } + options = options || {}; + if (!req.session) { + return cb(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?")); + } + var self2 = this; + var prevSession = req.session; + req.session.regenerate(function(err) { + if (err) { + return cb(err); + } + self2._serializeUser(user, req, function(err2, obj) { + if (err2) { + return cb(err2); + } + if (options.keepSessionInfo) { + merge(req.session, prevSession); + } + if (!req.session[self2._key]) { + req.session[self2._key] = {}; + } + req.session[self2._key].user = obj; + req.session.save(function(err3) { + if (err3) { + return cb(err3); + } + cb(); + }); + }); + }); + }; + SessionManager.prototype.logOut = function(req, options, cb) { + if (typeof options == "function") { + cb = options; + options = {}; + } + options = options || {}; + if (!req.session) { + return cb(new Error("Login sessions require session support. Did you forget to use `express-session` middleware?")); + } + var self2 = this; + if (req.session[this._key]) { + delete req.session[this._key].user; + } + var prevSession = req.session; + req.session.save(function(err) { + if (err) { + return cb(err); + } + req.session.regenerate(function(err2) { + if (err2) { + return cb(err2); + } + if (options.keepSessionInfo) { + merge(req.session, prevSession); + } + cb(); + }); + }); + }; + module2.exports = SessionManager; + } +}); + +// ../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/http/request.js +var require_request3 = __commonJS({ + "../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/http/request.js"(exports2, module2) { + var req = exports2 = module2.exports = {}; + req.login = req.logIn = function(user, options, done) { + if (typeof options == "function") { + done = options; + options = {}; + } + options = options || {}; + var property = this._userProperty || "user"; + var session = options.session === void 0 ? true : options.session; + this[property] = user; + if (session && this._sessionManager) { + if (typeof done != "function") { + throw new Error("req#login requires a callback function"); + } + var self2 = this; + this._sessionManager.logIn(this, user, options, function(err) { + if (err) { + self2[property] = null; + return done(err); + } + done(); + }); + } else { + done && done(); + } + }; + req.logout = req.logOut = function(options, done) { + if (typeof options == "function") { + done = options; + options = {}; + } + options = options || {}; + var property = this._userProperty || "user"; + this[property] = null; + if (this._sessionManager) { + if (typeof done != "function") { + throw new Error("req#logout requires a callback function"); + } + this._sessionManager.logOut(this, options, done); + } else { + done && done(); + } + }; + req.isAuthenticated = function() { + var property = this._userProperty || "user"; + return this[property] ? true : false; + }; + req.isUnauthenticated = function() { + return !this.isAuthenticated(); + }; + } +}); + +// ../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/middleware/initialize.js +var require_initialize = __commonJS({ + "../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/middleware/initialize.js"(exports2, module2) { + var IncomingMessageExt = require_request3(); + module2.exports = function initialize(passport, options) { + options = options || {}; + return function initialize2(req, res, next) { + req.login = req.logIn = req.logIn || IncomingMessageExt.logIn; + req.logout = req.logOut = req.logOut || IncomingMessageExt.logOut; + req.isAuthenticated = req.isAuthenticated || IncomingMessageExt.isAuthenticated; + req.isUnauthenticated = req.isUnauthenticated || IncomingMessageExt.isUnauthenticated; + req._sessionManager = passport._sm; + if (options.userProperty) { + req._userProperty = options.userProperty; + } + var compat = options.compat === void 0 ? true : options.compat; + if (compat) { + passport._userProperty = options.userProperty || "user"; + req._passport = {}; + req._passport.instance = passport; + } + next(); + }; + }; + } +}); + +// ../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/errors/authenticationerror.js +var require_authenticationerror = __commonJS({ + "../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/errors/authenticationerror.js"(exports2, module2) { + function AuthenticationError(message, status) { + Error.call(this); + Error.captureStackTrace(this, arguments.callee); + this.name = "AuthenticationError"; + this.message = message; + this.status = status || 401; + } + AuthenticationError.prototype.__proto__ = Error.prototype; + module2.exports = AuthenticationError; + } +}); + +// ../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/middleware/authenticate.js +var require_authenticate = __commonJS({ + "../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/middleware/authenticate.js"(exports2, module2) { + var http = require("http"); + var IncomingMessageExt = require_request3(); + var AuthenticationError = require_authenticationerror(); + module2.exports = function authenticate(passport, name, options, callback) { + if (typeof options == "function") { + callback = options; + options = {}; + } + options = options || {}; + var multi = true; + if (!Array.isArray(name)) { + name = [name]; + multi = false; + } + return function authenticate2(req, res, next) { + req.login = req.logIn = req.logIn || IncomingMessageExt.logIn; + req.logout = req.logOut = req.logOut || IncomingMessageExt.logOut; + req.isAuthenticated = req.isAuthenticated || IncomingMessageExt.isAuthenticated; + req.isUnauthenticated = req.isUnauthenticated || IncomingMessageExt.isUnauthenticated; + req._sessionManager = passport._sm; + var failures = []; + function allFailed() { + if (callback) { + if (!multi) { + return callback(null, false, failures[0].challenge, failures[0].status); + } else { + var challenges = failures.map(function(f) { + return f.challenge; + }); + var statuses = failures.map(function(f) { + return f.status; + }); + return callback(null, false, challenges, statuses); + } + } + var failure = failures[0] || {}, challenge = failure.challenge || {}, msg; + if (options.failureFlash) { + var flash = options.failureFlash; + if (typeof flash == "string") { + flash = { type: "error", message: flash }; + } + flash.type = flash.type || "error"; + var type = flash.type || challenge.type || "error"; + msg = flash.message || challenge.message || challenge; + if (typeof msg == "string") { + req.flash(type, msg); + } + } + if (options.failureMessage) { + msg = options.failureMessage; + if (typeof msg == "boolean") { + msg = challenge.message || challenge; + } + if (typeof msg == "string") { + req.session.messages = req.session.messages || []; + req.session.messages.push(msg); + } + } + if (options.failureRedirect) { + return res.redirect(options.failureRedirect); + } + var rchallenge = [], rstatus, status; + for (var j = 0, len = failures.length; j < len; j++) { + failure = failures[j]; + challenge = failure.challenge; + status = failure.status; + rstatus = rstatus || status; + if (typeof challenge == "string") { + rchallenge.push(challenge); + } + } + res.statusCode = rstatus || 401; + if (res.statusCode == 401 && rchallenge.length) { + res.setHeader("WWW-Authenticate", rchallenge); + } + if (options.failWithError) { + return next(new AuthenticationError(http.STATUS_CODES[res.statusCode], rstatus)); + } + res.end(http.STATUS_CODES[res.statusCode]); + } + (function attempt(i) { + var layer = name[i]; + if (!layer) { + return allFailed(); + } + var strategy, prototype; + if (typeof layer.authenticate == "function") { + strategy = layer; + } else { + prototype = passport._strategy(layer); + if (!prototype) { + return next(new Error('Unknown authentication strategy "' + layer + '"')); + } + strategy = Object.create(prototype); + } + strategy.success = function(user, info) { + if (callback) { + return callback(null, user, info); + } + info = info || {}; + var msg; + if (options.successFlash) { + var flash = options.successFlash; + if (typeof flash == "string") { + flash = { type: "success", message: flash }; + } + flash.type = flash.type || "success"; + var type = flash.type || info.type || "success"; + msg = flash.message || info.message || info; + if (typeof msg == "string") { + req.flash(type, msg); + } + } + if (options.successMessage) { + msg = options.successMessage; + if (typeof msg == "boolean") { + msg = info.message || info; + } + if (typeof msg == "string") { + req.session.messages = req.session.messages || []; + req.session.messages.push(msg); + } + } + if (options.assignProperty) { + req[options.assignProperty] = user; + if (options.authInfo !== false) { + passport.transformAuthInfo(info, req, function(err, tinfo) { + if (err) { + return next(err); + } + req.authInfo = tinfo; + next(); + }); + } else { + next(); + } + return; + } + req.logIn(user, options, function(err) { + if (err) { + return next(err); + } + function complete() { + if (options.successReturnToOrRedirect) { + var url = options.successReturnToOrRedirect; + if (req.session && req.session.returnTo) { + url = req.session.returnTo; + delete req.session.returnTo; + } + return res.redirect(url); + } + if (options.successRedirect) { + return res.redirect(options.successRedirect); + } + next(); + } + if (options.authInfo !== false) { + passport.transformAuthInfo(info, req, function(err2, tinfo) { + if (err2) { + return next(err2); + } + req.authInfo = tinfo; + complete(); + }); + } else { + complete(); + } + }); + }; + strategy.fail = function(challenge, status) { + if (typeof challenge == "number") { + status = challenge; + challenge = void 0; + } + failures.push({ challenge, status }); + attempt(i + 1); + }; + strategy.redirect = function(url, status) { + res.statusCode = status || 302; + res.setHeader("Location", url); + res.setHeader("Content-Length", "0"); + res.end(); + }; + strategy.pass = function() { + next(); + }; + strategy.error = function(err) { + if (callback) { + return callback(err); + } + next(err); + }; + strategy.authenticate(req, options); + })(0); + }; + }; + } +}); + +// ../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/framework/connect.js +var require_connect2 = __commonJS({ + "../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/framework/connect.js"(exports2, module2) { + var initialize = require_initialize(); + var authenticate = require_authenticate(); + exports2 = module2.exports = function() { + return { + initialize, + authenticate + }; + }; + } +}); + +// ../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/authenticator.js +var require_authenticator = __commonJS({ + "../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/authenticator.js"(exports2, module2) { + var SessionStrategy = require_session(); + var SessionManager = require_sessionmanager(); + function Authenticator() { + this._key = "passport"; + this._strategies = {}; + this._serializers = []; + this._deserializers = []; + this._infoTransformers = []; + this._framework = null; + this.init(); + } + Authenticator.prototype.init = function() { + this.framework(require_connect2()()); + this.use(new SessionStrategy({ key: this._key }, this.deserializeUser.bind(this))); + this._sm = new SessionManager({ key: this._key }, this.serializeUser.bind(this)); + }; + Authenticator.prototype.use = function(name, strategy) { + if (!strategy) { + strategy = name; + name = strategy.name; + } + if (!name) { + throw new Error("Authentication strategies must have a name"); + } + this._strategies[name] = strategy; + return this; + }; + Authenticator.prototype.unuse = function(name) { + delete this._strategies[name]; + return this; + }; + Authenticator.prototype.framework = function(fw) { + this._framework = fw; + return this; + }; + Authenticator.prototype.initialize = function(options) { + options = options || {}; + return this._framework.initialize(this, options); + }; + Authenticator.prototype.authenticate = function(strategy, options, callback) { + return this._framework.authenticate(this, strategy, options, callback); + }; + Authenticator.prototype.authorize = function(strategy, options, callback) { + options = options || {}; + options.assignProperty = "account"; + var fn = this._framework.authorize || this._framework.authenticate; + return fn(this, strategy, options, callback); + }; + Authenticator.prototype.session = function(options) { + return this.authenticate("session", options); + }; + Authenticator.prototype.serializeUser = function(fn, req, done) { + if (typeof fn === "function") { + return this._serializers.push(fn); + } + var user = fn; + if (typeof req === "function") { + done = req; + req = void 0; + } + var stack = this._serializers; + (function pass(i, err, obj) { + if ("pass" === err) { + err = void 0; + } + if (err || obj || obj === 0) { + return done(err, obj); + } + var layer = stack[i]; + if (!layer) { + return done(new Error("Failed to serialize user into session")); + } + function serialized(e, o) { + pass(i + 1, e, o); + } + try { + var arity = layer.length; + if (arity == 3) { + layer(req, user, serialized); + } else { + layer(user, serialized); + } + } catch (e) { + return done(e); + } + })(0); + }; + Authenticator.prototype.deserializeUser = function(fn, req, done) { + if (typeof fn === "function") { + return this._deserializers.push(fn); + } + var obj = fn; + if (typeof req === "function") { + done = req; + req = void 0; + } + var stack = this._deserializers; + (function pass(i, err, user) { + if ("pass" === err) { + err = void 0; + } + if (err || user) { + return done(err, user); + } + if (user === null || user === false) { + return done(null, false); + } + var layer = stack[i]; + if (!layer) { + return done(new Error("Failed to deserialize user out of session")); + } + function deserialized(e, u) { + pass(i + 1, e, u); + } + try { + var arity = layer.length; + if (arity == 3) { + layer(req, obj, deserialized); + } else { + layer(obj, deserialized); + } + } catch (e) { + return done(e); + } + })(0); + }; + Authenticator.prototype.transformAuthInfo = function(fn, req, done) { + if (typeof fn === "function") { + return this._infoTransformers.push(fn); + } + var info = fn; + if (typeof req === "function") { + done = req; + req = void 0; + } + var stack = this._infoTransformers; + (function pass(i, err, tinfo) { + if ("pass" === err) { + err = void 0; + } + if (err || tinfo) { + return done(err, tinfo); + } + var layer = stack[i]; + if (!layer) { + return done(null, info); + } + function transformed(e, t2) { + pass(i + 1, e, t2); + } + try { + var arity = layer.length; + if (arity == 1) { + var t = layer(info); + transformed(null, t); + } else if (arity == 3) { + layer(req, info, transformed); + } else { + layer(info, transformed); + } + } catch (e) { + return done(e); + } + })(0); + }; + Authenticator.prototype._strategy = function(name) { + return this._strategies[name]; + }; + module2.exports = Authenticator; + } +}); + +// ../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/index.js +var require_lib7 = __commonJS({ + "../../node_modules/.pnpm/passport@0.7.0/node_modules/passport/lib/index.js"(exports2, module2) { + var Passport = require_authenticator(); + var SessionStrategy = require_session(); + exports2 = module2.exports = new Passport(); + exports2.Passport = exports2.Authenticator = Passport; + exports2.Strategy = require_lib6(); + exports2.strategies = {}; + exports2.strategies.SessionStrategy = SessionStrategy; + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/interfaces/auth-module.options.js +var require_auth_module_options = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/interfaces/auth-module.options.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuthModuleOptions = void 0; + var AuthModuleOptions = class { + }; + exports2.AuthModuleOptions = AuthModuleOptions; + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/options.js +var require_options = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/options.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.defaultOptions = void 0; + exports2.defaultOptions = { + session: false, + property: "user" + }; + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/utils/memoize.util.js +var require_memoize_util = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/utils/memoize.util.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.memoize = void 0; + var defaultKey = "default"; + function memoize(fn) { + const cache = {}; + return (...args) => { + const n = args[0] || defaultKey; + if (n in cache) { + return cache[n]; + } else { + const result = fn(n === defaultKey ? void 0 : n); + cache[n] = result; + return result; + } + }; + } + exports2.memoize = memoize; + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/auth.guard.js +var require_auth_guard = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/auth.guard.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuthGuard = void 0; + var common_12 = require_common(); + var passport = require_lib7(); + var auth_module_options_1 = require_auth_module_options(); + var options_1 = require_options(); + var memoize_util_1 = require_memoize_util(); + exports2.AuthGuard = (0, memoize_util_1.memoize)(createAuthGuard); + var NO_STRATEGY_ERROR = `In order to use "defaultStrategy", please, ensure to import PassportModule in each place where AuthGuard() is being used. Otherwise, passport won't work correctly.`; + var authLogger = new common_12.Logger("AuthGuard"); + function createAuthGuard(type) { + let MixinAuthGuard = class MixinAuthGuard { + constructor(options) { + this.options = {}; + this.options = options ?? this.options; + if (!type && !this.options.defaultStrategy) { + authLogger.error(NO_STRATEGY_ERROR); + } + } + async canActivate(context) { + const options = { + ...options_1.defaultOptions, + ...this.options, + ...await this.getAuthenticateOptions(context) + }; + const [request, response] = [ + this.getRequest(context), + this.getResponse(context) + ]; + const passportFn = createPassportContext(request, response); + const user = await passportFn(type || this.options.defaultStrategy, options, (err, user2, info, status) => this.handleRequest(err, user2, info, context, status)); + request[options.property || options_1.defaultOptions.property] = user; + return true; + } + getRequest(context) { + return context.switchToHttp().getRequest(); + } + getResponse(context) { + return context.switchToHttp().getResponse(); + } + async logIn(request) { + const user = request[this.options.property || options_1.defaultOptions.property]; + await new Promise((resolve, reject) => request.logIn(user, this.options, (err) => err ? reject(err) : resolve())); + } + handleRequest(err, user, info, context, status) { + if (err || !user) { + throw err || new common_12.UnauthorizedException(); + } + return user; + } + getAuthenticateOptions(context) { + return void 0; + } + }; + __decorate4([ + (0, common_12.Optional)(), + (0, common_12.Inject)(auth_module_options_1.AuthModuleOptions), + __metadata3("design:type", auth_module_options_1.AuthModuleOptions) + ], MixinAuthGuard.prototype, "options", void 0); + MixinAuthGuard = __decorate4([ + __param3(0, (0, common_12.Optional)()), + __metadata3("design:paramtypes", [auth_module_options_1.AuthModuleOptions]) + ], MixinAuthGuard); + const guard = (0, common_12.mixin)(MixinAuthGuard); + return guard; + } + var createPassportContext = (request, response) => (type, options, callback) => new Promise((resolve, reject) => passport.authenticate(type, options, (err, user, info, status) => { + try { + request.authInfo = info; + return resolve(callback(err, user, info, status)); + } catch (err2) { + reject(err2); + } + })(request, response, (err) => err ? reject(err) : resolve())); + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/interfaces/type.interface.js +var require_type_interface2 = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/interfaces/type.interface.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/interfaces/index.js +var require_interfaces7 = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/interfaces/index.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + __exportStar2(require_auth_module_options(), exports2); + __exportStar2(require_type_interface2(), exports2); + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/passport.module.js +var require_passport_module = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/passport.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var PassportModule_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PassportModule = void 0; + var common_12 = require_common(); + var auth_module_options_1 = require_auth_module_options(); + var PassportModule = exports2.PassportModule = PassportModule_1 = class PassportModule { + static register(options) { + return { + module: PassportModule_1, + providers: [{ provide: auth_module_options_1.AuthModuleOptions, useValue: options }], + exports: [auth_module_options_1.AuthModuleOptions] + }; + } + static registerAsync(options) { + return { + module: PassportModule_1, + imports: options.imports || [], + providers: this.createAsyncProviders(options), + exports: [auth_module_options_1.AuthModuleOptions] + }; + } + static createAsyncProviders(options) { + if (options.useExisting || options.useFactory) { + return [this.createAsyncOptionsProvider(options)]; + } + return [ + this.createAsyncOptionsProvider(options), + { + provide: options.useClass, + useClass: options.useClass + } + ]; + } + static createAsyncOptionsProvider(options) { + if (options.useFactory) { + return { + provide: auth_module_options_1.AuthModuleOptions, + useFactory: options.useFactory, + inject: options.inject || [] + }; + } + return { + provide: auth_module_options_1.AuthModuleOptions, + useFactory: async (optionsFactory) => await optionsFactory.createAuthOptions(), + inject: [options.useExisting || options.useClass] + }; + } + }; + exports2.PassportModule = PassportModule = PassportModule_1 = __decorate4([ + (0, common_12.Module)({}) + ], PassportModule); + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/passport/passport.serializer.js +var require_passport_serializer = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/passport/passport.serializer.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PassportSerializer = void 0; + var passport = require_lib7(); + var PassportSerializer = class { + constructor() { + const passportInstance = this.getPassportInstance(); + passportInstance.serializeUser((user, done) => this.serializeUser(user, done)); + passportInstance.deserializeUser((payload, done) => this.deserializeUser(payload, done)); + } + getPassportInstance() { + return passport; + } + }; + exports2.PassportSerializer = PassportSerializer; + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/passport/passport.strategy.js +var require_passport_strategy = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/passport/passport.strategy.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PassportStrategy = void 0; + var passport = require_lib7(); + function PassportStrategy(Strategy, name, callbackArity) { + class MixinStrategy extends Strategy { + constructor(...args) { + const callback = async (...params) => { + const done = params[params.length - 1]; + try { + const validateResult = await this.validate(...params); + if (Array.isArray(validateResult)) { + done(null, ...validateResult); + } else { + done(null, validateResult); + } + } catch (err) { + done(err, null); + } + }; + if (callbackArity !== void 0) { + const validate = new.target?.prototype?.validate; + const arity = callbackArity === true ? validate.length + 1 : callbackArity; + if (validate) { + Object.defineProperty(callback, "length", { + value: arity + }); + } + } + super(...args, callback); + const passportInstance = this.getPassportInstance(); + if (name) { + passportInstance.use(name, this); + } else { + passportInstance.use(this); + } + } + getPassportInstance() { + return passport; + } + } + return MixinStrategy; + } + exports2.PassportStrategy = PassportStrategy; + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/index.js +var require_dist2 = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/dist/index.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __exportStar2 = exports2 && exports2.__exportStar || function(m, exports3) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding2(exports3, m, p); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + __exportStar2(require_abstract_strategy(), exports2); + __exportStar2(require_auth_guard(), exports2); + __exportStar2(require_interfaces7(), exports2); + __exportStar2(require_passport_module(), exports2); + __exportStar2(require_passport_serializer(), exports2); + __exportStar2(require_passport_strategy(), exports2); + } +}); + +// ../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/index.js +var require_passport = __commonJS({ + "../../node_modules/.pnpm/@nestjs+passport@10.0.3_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_ia6i3gv5hfockxefxn2psg2dxa/node_modules/@nestjs/passport/index.js"(exports2) { + "use strict"; + function __export2(m) { + for (var p in m) if (!exports2.hasOwnProperty(p)) exports2[p] = m[p]; + } + exports2.__esModule = true; + __export2(require_dist2()); + } +}); + +// dist/modules/auth/guards.js +var require_guards2 = __commonJS({ + "dist/modules/auth/guards.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.PermissionsGuard = exports2.JwtAuthGuard = exports2.CurrentAdmin = exports2.RequirePermission = exports2.REQUIRED_RID_KEY = exports2.Public = exports2.IS_PUBLIC_KEY = void 0; + var common_12 = require_common(); + var passport_1 = require_passport(); + var core_12 = require_core3(); + exports2.IS_PUBLIC_KEY = "isPublic"; + var Public = () => (0, common_12.SetMetadata)(exports2.IS_PUBLIC_KEY, true); + exports2.Public = Public; + exports2.REQUIRED_RID_KEY = "requiredRid"; + var RequirePermission = (rid) => (0, common_12.SetMetadata)(exports2.REQUIRED_RID_KEY, rid); + exports2.RequirePermission = RequirePermission; + exports2.CurrentAdmin = (0, common_12.createParamDecorator)((_data, ctx) => ctx.switchToHttp().getRequest().user); + var JwtAuthGuard = class JwtAuthGuard extends (0, passport_1.AuthGuard)("jwt") { + reflector; + constructor(reflector) { + super(); + this.reflector = reflector; + } + canActivate(context) { + const isPublic = this.reflector.getAllAndOverride(exports2.IS_PUBLIC_KEY, [ + context.getHandler(), + context.getClass() + ]); + if (isPublic) + return true; + return super.canActivate(context); + } + }; + exports2.JwtAuthGuard = JwtAuthGuard; + exports2.JwtAuthGuard = JwtAuthGuard = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [core_12.Reflector]) + ], JwtAuthGuard); + var PermissionsGuard = class PermissionsGuard { + reflector; + constructor(reflector) { + this.reflector = reflector; + } + canActivate(context) { + const requiredRid = this.reflector.getAllAndOverride(exports2.REQUIRED_RID_KEY, [ + context.getHandler(), + context.getClass() + ]); + if (!requiredRid) + return true; + const user = context.switchToHttp().getRequest().user; + if (!user) + throw new common_12.ForbiddenException(); + if (!user.permissions.includes(requiredRid)) { + throw new common_12.ForbiddenException(`Missing permission: ${requiredRid}`); + } + return true; + } + }; + exports2.PermissionsGuard = PermissionsGuard; + exports2.PermissionsGuard = PermissionsGuard = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [core_12.Reflector]) + ], PermissionsGuard); + } +}); + // dist/modules/catalog/catalog.controller.js var require_catalog_controller = __commonJS({ "dist/modules/catalog/catalog.controller.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CatalogController = void 0; var common_12 = require_common(); var catalog_service_1 = require_catalog_service(); + var guards_1 = require_guards2(); var CatalogController = class CatalogController { catalog; constructor(catalog) { @@ -76318,15 +77454,16 @@ var require_catalog_controller = __commonJS({ } }; exports2.CatalogController = CatalogController; - __decorate2([ + __decorate4([ (0, common_12.Get)(), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", []), - __metadata2("design:returntype", void 0) + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) ], CatalogController.prototype, "list", null); - exports2.CatalogController = CatalogController = __decorate2([ + exports2.CatalogController = CatalogController = __decorate4([ + (0, guards_1.Public)(), (0, common_12.Controller)("catalog/products"), - __metadata2("design:paramtypes", [catalog_service_1.CatalogService]) + __metadata3("design:paramtypes", [catalog_service_1.CatalogService]) ], CatalogController); } }); @@ -76335,7 +77472,7 @@ var require_catalog_controller = __commonJS({ var require_catalog_module = __commonJS({ "dist/modules/catalog/catalog.module.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; @@ -76349,7 +77486,7 @@ var require_catalog_module = __commonJS({ var CatalogModule = class CatalogModule { }; exports2.CatalogModule = CatalogModule; - exports2.CatalogModule = CatalogModule = __decorate2([ + exports2.CatalogModule = CatalogModule = __decorate4([ (0, common_12.Module)({ controllers: [catalog_controller_1.CatalogController], providers: [catalog_service_1.CatalogService], @@ -76363,13 +77500,13 @@ var require_catalog_module = __commonJS({ var require_customers_service = __commonJS({ "dist/modules/customers/customers.service.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -76429,9 +77566,9 @@ var require_customers_service = __commonJS({ } }; exports2.CustomersService = CustomersService; - exports2.CustomersService = CustomersService = __decorate2([ + exports2.CustomersService = CustomersService = __decorate4([ (0, common_12.Injectable)(), - __metadata2("design:paramtypes", [prisma_service_1.PrismaService]) + __metadata3("design:paramtypes", [prisma_service_1.PrismaService]) ], CustomersService); } }); @@ -76440,16 +77577,16 @@ var require_customers_service = __commonJS({ var require_customers_controller = __commonJS({ "dist/modules/customers/customers.controller.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; - var __param2 = exports2 && exports2.__param || function(paramIndex, decorator) { + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; @@ -76458,6 +77595,7 @@ var require_customers_controller = __commonJS({ exports2.CustomersController = void 0; var common_12 = require_common(); var customers_service_1 = require_customers_service(); + var guards_1 = require_guards2(); var CustomersController = class CustomersController { customers; constructor(customers) { @@ -76477,36 +77615,37 @@ var require_customers_controller = __commonJS({ } }; exports2.CustomersController = CustomersController; - __decorate2([ + __decorate4([ (0, common_12.Get)(), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", []), - __metadata2("design:returntype", void 0) + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) ], CustomersController.prototype, "list", null); - __decorate2([ + __decorate4([ (0, common_12.Get)(":id"), - __param2(0, (0, common_12.Param)("id")), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [String]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) ], CustomersController.prototype, "get", null); - __decorate2([ + __decorate4([ (0, common_12.Get)(":id/orders"), - __param2(0, (0, common_12.Param)("id")), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [String]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) ], CustomersController.prototype, "getOrders", null); - __decorate2([ + __decorate4([ (0, common_12.Get)(":id/ledger-entries"), - __param2(0, (0, common_12.Param)("id")), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [String]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) ], CustomersController.prototype, "getLedgerEntries", null); - exports2.CustomersController = CustomersController = __decorate2([ + exports2.CustomersController = CustomersController = __decorate4([ + (0, guards_1.Public)(), (0, common_12.Controller)("customers"), - __metadata2("design:paramtypes", [customers_service_1.CustomersService]) + __metadata3("design:paramtypes", [customers_service_1.CustomersService]) ], CustomersController); } }); @@ -76515,7 +77654,7 @@ var require_customers_controller = __commonJS({ var require_customers_module = __commonJS({ "dist/modules/customers/customers.module.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; @@ -76529,7 +77668,7 @@ var require_customers_module = __commonJS({ var CustomersModule = class CustomersModule { }; exports2.CustomersModule = CustomersModule; - exports2.CustomersModule = CustomersModule = __decorate2([ + exports2.CustomersModule = CustomersModule = __decorate4([ (0, common_12.Module)({ controllers: [customers_controller_1.CustomersController], providers: [customers_service_1.CustomersService], @@ -76540,7 +77679,7 @@ var require_customers_module = __commonJS({ }); // ../../packages/shared-types/dist/index.js -var require_dist2 = __commonJS({ +var require_dist3 = __commonJS({ "../../packages/shared-types/dist/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -76595,20 +77734,20 @@ var require_dist2 = __commonJS({ var require_ledger_service = __commonJS({ "dist/modules/accounting/ledger.service.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.LedgerService = void 0; var common_12 = require_common(); var client_1 = require("@prisma/client"); - var shared_types_1 = require_dist2(); + var shared_types_1 = require_dist3(); var prisma_service_1 = require_prisma_service(); var LedgerService = class LedgerService { prisma; @@ -76832,9 +77971,9 @@ var require_ledger_service = __commonJS({ } }; exports2.LedgerService = LedgerService; - exports2.LedgerService = LedgerService = __decorate2([ + exports2.LedgerService = LedgerService = __decorate4([ (0, common_12.Injectable)(), - __metadata2("design:paramtypes", [prisma_service_1.PrismaService]) + __metadata3("design:paramtypes", [prisma_service_1.PrismaService]) ], LedgerService); } }); @@ -76843,13 +77982,13 @@ var require_ledger_service = __commonJS({ var require_orders_service = __commonJS({ "dist/modules/orders/orders.service.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -76907,6 +78046,7 @@ var require_orders_service = __commonJS({ orderNumber: this.generateOrderNumber(), customerId: dto.customerId, branchId: dto.branchId, + channel: dto.channel ?? client_1.OrderChannel.RETAIL, status: initialStatus, totalGoldWeightGrams, wageWeightGrams, @@ -76965,9 +78105,9 @@ var require_orders_service = __commonJS({ } }; exports2.OrdersService = OrdersService; - exports2.OrdersService = OrdersService = __decorate2([ + exports2.OrdersService = OrdersService = __decorate4([ (0, common_12.Injectable)(), - __metadata2("design:paramtypes", [ + __metadata3("design:paramtypes", [ prisma_service_1.PrismaService, catalog_service_1.CatalogService, ledger_service_1.LedgerService @@ -76980,18 +78120,19 @@ var require_orders_service = __commonJS({ var require_create_order_dto = __commonJS({ "dist/modules/orders/dto/create-order.dto.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CreateOrderDto = exports2.CreateOrderItemInputDto = void 0; var class_transformer_1 = require_cjs2(); + var client_1 = require("@prisma/client"); var class_validator_1 = require_cjs(); var CreateOrderItemInputDto = class { productVariantId; @@ -77003,50 +78144,61 @@ var require_create_order_dto = __commonJS({ flatRialCharge; }; exports2.CreateOrderItemInputDto = CreateOrderItemInputDto; - __decorate2([ + __decorate4([ (0, class_validator_1.IsString)(), - __metadata2("design:type", String) + __metadata3("design:type", String) ], CreateOrderItemInputDto.prototype, "productVariantId", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsInt)(), (0, class_validator_1.Min)(1), - __metadata2("design:type", Number) + __metadata3("design:type", Number) ], CreateOrderItemInputDto.prototype, "quantity", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsNumber)(), - __metadata2("design:type", Number) + __metadata3("design:type", Number) ], CreateOrderItemInputDto.prototype, "wagePercent", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsNumber)(), - __metadata2("design:type", Number) + __metadata3("design:type", Number) ], CreateOrderItemInputDto.prototype, "discountPercent", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsNumber)(), - __metadata2("design:type", Number) + __metadata3("design:type", Number) ], CreateOrderItemInputDto.prototype, "flatRialCharge", void 0); var CreateOrderDto = class { customerId; branchId; + /** + * Which sales channel placed the order. Legacy had no such field because the + * two channels lived in separate tables (orders vs orders_orders); the one + * Order model carries the distinction here. Defaults to RETAIL. + */ + channel; items; }; exports2.CreateOrderDto = CreateOrderDto; - __decorate2([ + __decorate4([ (0, class_validator_1.IsString)(), - __metadata2("design:type", String) + __metadata3("design:type", String) ], CreateOrderDto.prototype, "customerId", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), - __metadata2("design:type", String) + __metadata3("design:type", String) ], CreateOrderDto.prototype, "branchId", void 0); - __decorate2([ + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsEnum)(client_1.OrderChannel), + __metadata3("design:type", String) + ], CreateOrderDto.prototype, "channel", void 0); + __decorate4([ (0, class_validator_1.IsArray)(), (0, class_validator_1.ArrayMinSize)(1), (0, class_validator_1.ValidateNested)({ each: true }), (0, class_transformer_1.Type)(() => CreateOrderItemInputDto), - __metadata2("design:type", Array) + __metadata3("design:type", Array) ], CreateOrderDto.prototype, "items", void 0); } }); @@ -77055,13 +78207,13 @@ var require_create_order_dto = __commonJS({ var require_update_order_status_dto = __commonJS({ "dist/modules/orders/dto/update-order-status.dto.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -77074,19 +78226,19 @@ var require_update_order_status_dto = __commonJS({ actorAdminUserId; }; exports2.UpdateOrderStatusDto = UpdateOrderStatusDto; - __decorate2([ + __decorate4([ (0, class_validator_1.IsEnum)(client_1.OrderStatus), - __metadata2("design:type", String) + __metadata3("design:type", String) ], UpdateOrderStatusDto.prototype, "status", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), - __metadata2("design:type", String) + __metadata3("design:type", String) ], UpdateOrderStatusDto.prototype, "note", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), - __metadata2("design:type", String) + __metadata3("design:type", String) ], UpdateOrderStatusDto.prototype, "actorAdminUserId", void 0); } }); @@ -77095,16 +78247,16 @@ var require_update_order_status_dto = __commonJS({ var require_orders_controller = __commonJS({ "dist/modules/orders/orders.controller.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; - var __param2 = exports2 && exports2.__param || function(paramIndex, decorator) { + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; @@ -77115,6 +78267,7 @@ var require_orders_controller = __commonJS({ var orders_service_1 = require_orders_service(); var create_order_dto_1 = require_create_order_dto(); var update_order_status_dto_1 = require_update_order_status_dto(); + var guards_1 = require_guards2(); var OrdersController = class OrdersController { orders; constructor(orders) { @@ -77131,31 +78284,32 @@ var require_orders_controller = __commonJS({ } }; exports2.OrdersController = OrdersController; - __decorate2([ + __decorate4([ (0, common_12.Post)(), - __param2(0, (0, common_12.Body)()), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [create_order_dto_1.CreateOrderDto]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [create_order_dto_1.CreateOrderDto]), + __metadata3("design:returntype", void 0) ], OrdersController.prototype, "create", null); - __decorate2([ + __decorate4([ (0, common_12.Get)(":id"), - __param2(0, (0, common_12.Param)("id")), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [String]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) ], OrdersController.prototype, "get", null); - __decorate2([ + __decorate4([ (0, common_12.Patch)(":id/status"), - __param2(0, (0, common_12.Param)("id")), - __param2(1, (0, common_12.Body)()), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [String, update_order_status_dto_1.UpdateOrderStatusDto]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, update_order_status_dto_1.UpdateOrderStatusDto]), + __metadata3("design:returntype", void 0) ], OrdersController.prototype, "updateStatus", null); - exports2.OrdersController = OrdersController = __decorate2([ + exports2.OrdersController = OrdersController = __decorate4([ + (0, guards_1.Public)(), (0, common_12.Controller)("orders"), - __metadata2("design:paramtypes", [orders_service_1.OrdersService]) + __metadata3("design:paramtypes", [orders_service_1.OrdersService]) ], OrdersController); } }); @@ -77164,13 +78318,13 @@ var require_orders_controller = __commonJS({ var require_post_gold_repayment_dto = __commonJS({ "dist/modules/accounting/dto/post-gold-repayment.dto.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -77185,34 +78339,34 @@ var require_post_gold_repayment_dto = __commonJS({ note; }; exports2.PostGoldRepaymentDto = PostGoldRepaymentDto; - __decorate2([ + __decorate4([ (0, class_validator_1.IsString)(), - __metadata2("design:type", String) + __metadata3("design:type", String) ], PostGoldRepaymentDto.prototype, "customerId", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsIn)(["MELTED_GOLD", "TRANSFER", "CHEQUE", "CASH"]), - __metadata2("design:type", String) + __metadata3("design:type", String) ], PostGoldRepaymentDto.prototype, "instrument", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsNumber)(), (0, class_validator_1.IsPositive)(), - __metadata2("design:type", Number) + __metadata3("design:type", Number) ], PostGoldRepaymentDto.prototype, "rawValue", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsNumber)(), - __metadata2("design:type", Number) + __metadata3("design:type", Number) ], PostGoldRepaymentDto.prototype, "karatPerMille", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsNumber)(), (0, class_validator_1.IsPositive)(), - __metadata2("design:type", Number) + __metadata3("design:type", Number) ], PostGoldRepaymentDto.prototype, "pricePerGramRial", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), - __metadata2("design:type", String) + __metadata3("design:type", String) ], PostGoldRepaymentDto.prototype, "note", void 0); } }); @@ -77221,13 +78375,13 @@ var require_post_gold_repayment_dto = __commonJS({ var require_post_rial_repayment_dto = __commonJS({ "dist/modules/accounting/dto/post-rial-repayment.dto.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -77239,19 +78393,19 @@ var require_post_rial_repayment_dto = __commonJS({ note; }; exports2.PostRialRepaymentDto = PostRialRepaymentDto; - __decorate2([ + __decorate4([ (0, class_validator_1.IsString)(), - __metadata2("design:type", String) + __metadata3("design:type", String) ], PostRialRepaymentDto.prototype, "customerId", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsNumber)(), (0, class_validator_1.IsPositive)(), - __metadata2("design:type", Number) + __metadata3("design:type", Number) ], PostRialRepaymentDto.prototype, "amount", void 0); - __decorate2([ + __decorate4([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), - __metadata2("design:type", String) + __metadata3("design:type", String) ], PostRialRepaymentDto.prototype, "note", void 0); } }); @@ -77260,16 +78414,16 @@ var require_post_rial_repayment_dto = __commonJS({ var require_accounting_controller = __commonJS({ "dist/modules/accounting/accounting.controller.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; - var __param2 = exports2 && exports2.__param || function(paramIndex, decorator) { + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; @@ -77280,6 +78434,7 @@ var require_accounting_controller = __commonJS({ var ledger_service_1 = require_ledger_service(); var post_gold_repayment_dto_1 = require_post_gold_repayment_dto(); var post_rial_repayment_dto_1 = require_post_rial_repayment_dto(); + var guards_1 = require_guards2(); var AccountingController = class AccountingController { ledger; constructor(ledger) { @@ -77302,44 +78457,45 @@ var require_accounting_controller = __commonJS({ } }; exports2.AccountingController = AccountingController; - __decorate2([ + __decorate4([ (0, common_12.Get)("customers/:customerId/balance"), - __param2(0, (0, common_12.Param)("customerId")), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [String]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Param)("customerId")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) ], AccountingController.prototype, "getBalance", null); - __decorate2([ + __decorate4([ (0, common_12.Post)("customers/:customerId/reconcile"), - __param2(0, (0, common_12.Param)("customerId")), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [String]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Param)("customerId")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) ], AccountingController.prototype, "reconcile", null); - __decorate2([ + __decorate4([ (0, common_12.Post)("repayments/gold"), - __param2(0, (0, common_12.Body)()), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [post_gold_repayment_dto_1.PostGoldRepaymentDto]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [post_gold_repayment_dto_1.PostGoldRepaymentDto]), + __metadata3("design:returntype", void 0) ], AccountingController.prototype, "postGoldRepayment", null); - __decorate2([ + __decorate4([ (0, common_12.Post)("repayments/rial"), - __param2(0, (0, common_12.Body)()), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [post_rial_repayment_dto_1.PostRialRepaymentDto]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [post_rial_repayment_dto_1.PostRialRepaymentDto]), + __metadata3("design:returntype", void 0) ], AccountingController.prototype, "postRialRepayment", null); - __decorate2([ + __decorate4([ (0, common_12.Post)("entries/:entryId/confirm"), - __param2(0, (0, common_12.Param)("entryId")), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [String]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Param)("entryId")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) ], AccountingController.prototype, "confirmEntry", null); - exports2.AccountingController = AccountingController = __decorate2([ + exports2.AccountingController = AccountingController = __decorate4([ + (0, guards_1.Public)(), (0, common_12.Controller)("accounting"), - __metadata2("design:paramtypes", [ledger_service_1.LedgerService]) + __metadata3("design:paramtypes", [ledger_service_1.LedgerService]) ], AccountingController); } }); @@ -77348,7 +78504,7 @@ var require_accounting_controller = __commonJS({ var require_accounting_module = __commonJS({ "dist/modules/accounting/accounting.module.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; @@ -77362,7 +78518,7 @@ var require_accounting_module = __commonJS({ var AccountingModule = class AccountingModule { }; exports2.AccountingModule = AccountingModule; - exports2.AccountingModule = AccountingModule = __decorate2([ + exports2.AccountingModule = AccountingModule = __decorate4([ (0, common_12.Module)({ controllers: [accounting_controller_1.AccountingController], providers: [ledger_service_1.LedgerService], @@ -77376,7 +78532,7 @@ var require_accounting_module = __commonJS({ var require_orders_module = __commonJS({ "dist/modules/orders/orders.module.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; @@ -77392,7 +78548,7 @@ var require_orders_module = __commonJS({ var OrdersModule = class OrdersModule { }; exports2.OrdersModule = OrdersModule; - exports2.OrdersModule = OrdersModule = __decorate2([ + exports2.OrdersModule = OrdersModule = __decorate4([ (0, common_12.Module)({ imports: [catalog_module_1.CatalogModule, accounting_module_1.AccountingModule], controllers: [orders_controller_1.OrdersController], @@ -77407,13 +78563,13 @@ var require_orders_module = __commonJS({ var require_pricing_service = __commonJS({ "dist/modules/pricing/pricing.service.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -77441,9 +78597,9 @@ var require_pricing_service = __commonJS({ } }; exports2.PricingService = PricingService; - exports2.PricingService = PricingService = __decorate2([ + exports2.PricingService = PricingService = __decorate4([ (0, common_12.Injectable)(), - __metadata2("design:paramtypes", [prisma_service_1.PrismaService]) + __metadata3("design:paramtypes", [prisma_service_1.PrismaService]) ], PricingService); } }); @@ -77452,16 +78608,16 @@ var require_pricing_service = __commonJS({ var require_pricing_controller = __commonJS({ "dist/modules/pricing/pricing.controller.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; - var __metadata2 = exports2 && exports2.__metadata || function(k, v) { + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; - var __param2 = exports2 && exports2.__param || function(paramIndex, decorator) { + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { return function(target, key) { decorator(target, key, paramIndex); }; @@ -77470,6 +78626,7 @@ var require_pricing_controller = __commonJS({ exports2.PricingController = void 0; var common_12 = require_common(); var pricing_service_1 = require_pricing_service(); + var guards_1 = require_guards2(); var PricingController = class PricingController { pricing; constructor(pricing) { @@ -77480,16 +78637,17 @@ var require_pricing_controller = __commonJS({ } }; exports2.PricingController = PricingController; - __decorate2([ + __decorate4([ (0, common_12.Get)("latest"), - __param2(0, (0, common_12.Query)("karatPerMille")), - __metadata2("design:type", Function), - __metadata2("design:paramtypes", [String]), - __metadata2("design:returntype", void 0) + __param3(0, (0, common_12.Query)("karatPerMille")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) ], PricingController.prototype, "getLatest", null); - exports2.PricingController = PricingController = __decorate2([ + exports2.PricingController = PricingController = __decorate4([ + (0, guards_1.Public)(), (0, common_12.Controller)("pricing"), - __metadata2("design:paramtypes", [pricing_service_1.PricingService]) + __metadata3("design:paramtypes", [pricing_service_1.PricingService]) ], PricingController); } }); @@ -77498,7 +78656,7 @@ var require_pricing_controller = __commonJS({ var require_pricing_module = __commonJS({ "dist/modules/pricing/pricing.module.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; @@ -77512,7 +78670,7 @@ var require_pricing_module = __commonJS({ var PricingModule = class PricingModule { }; exports2.PricingModule = PricingModule; - exports2.PricingModule = PricingModule = __decorate2([ + exports2.PricingModule = PricingModule = __decorate4([ (0, common_12.Module)({ controllers: [pricing_controller_1.PricingController], providers: [pricing_service_1.PricingService], @@ -77522,11 +78680,14199 @@ var require_pricing_module = __commonJS({ } }); +// ../../node_modules/.pnpm/jws@4.0.1/node_modules/jws/lib/data-stream.js +var require_data_stream = __commonJS({ + "../../node_modules/.pnpm/jws@4.0.1/node_modules/jws/lib/data-stream.js"(exports2, module2) { + var Buffer2 = require_safe_buffer().Buffer; + var Stream = require("stream"); + var util2 = require("util"); + function DataStream(data) { + this.buffer = null; + this.writable = true; + this.readable = true; + if (!data) { + this.buffer = Buffer2.alloc(0); + return this; + } + if (typeof data.pipe === "function") { + this.buffer = Buffer2.alloc(0); + data.pipe(this); + return this; + } + if (data.length || typeof data === "object") { + this.buffer = data; + this.writable = false; + process.nextTick(function() { + this.emit("end", data); + this.readable = false; + this.emit("close"); + }.bind(this)); + return this; + } + throw new TypeError("Unexpected data type (" + typeof data + ")"); + } + util2.inherits(DataStream, Stream); + DataStream.prototype.write = function write(data) { + this.buffer = Buffer2.concat([this.buffer, Buffer2.from(data)]); + this.emit("data", data); + }; + DataStream.prototype.end = function end(data) { + if (data) + this.write(data); + this.emit("end", data); + this.emit("close"); + this.writable = false; + this.readable = false; + }; + module2.exports = DataStream; + } +}); + +// ../../node_modules/.pnpm/ecdsa-sig-formatter@1.0.11/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js +var require_param_bytes_for_alg = __commonJS({ + "../../node_modules/.pnpm/ecdsa-sig-formatter@1.0.11/node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js"(exports2, module2) { + "use strict"; + function getParamSize(keySize) { + var result = (keySize / 8 | 0) + (keySize % 8 === 0 ? 0 : 1); + return result; + } + var paramBytesForAlg = { + ES256: getParamSize(256), + ES384: getParamSize(384), + ES512: getParamSize(521) + }; + function getParamBytesForAlg(alg) { + var paramBytes = paramBytesForAlg[alg]; + if (paramBytes) { + return paramBytes; + } + throw new Error('Unknown algorithm "' + alg + '"'); + } + module2.exports = getParamBytesForAlg; + } +}); + +// ../../node_modules/.pnpm/ecdsa-sig-formatter@1.0.11/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js +var require_ecdsa_sig_formatter = __commonJS({ + "../../node_modules/.pnpm/ecdsa-sig-formatter@1.0.11/node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js"(exports2, module2) { + "use strict"; + var Buffer2 = require_safe_buffer().Buffer; + var getParamBytesForAlg = require_param_bytes_for_alg(); + var MAX_OCTET = 128; + var CLASS_UNIVERSAL = 0; + var PRIMITIVE_BIT = 32; + var TAG_SEQ = 16; + var TAG_INT = 2; + var ENCODED_TAG_SEQ = TAG_SEQ | PRIMITIVE_BIT | CLASS_UNIVERSAL << 6; + var ENCODED_TAG_INT = TAG_INT | CLASS_UNIVERSAL << 6; + function base64Url(base64) { + return base64.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); + } + function signatureAsBuffer(signature) { + if (Buffer2.isBuffer(signature)) { + return signature; + } else if ("string" === typeof signature) { + return Buffer2.from(signature, "base64"); + } + throw new TypeError("ECDSA signature must be a Base64 string or a Buffer"); + } + function derToJose(signature, alg) { + signature = signatureAsBuffer(signature); + var paramBytes = getParamBytesForAlg(alg); + var maxEncodedParamLength = paramBytes + 1; + var inputLength = signature.length; + var offset = 0; + if (signature[offset++] !== ENCODED_TAG_SEQ) { + throw new Error('Could not find expected "seq"'); + } + var seqLength = signature[offset++]; + if (seqLength === (MAX_OCTET | 1)) { + seqLength = signature[offset++]; + } + if (inputLength - offset < seqLength) { + throw new Error('"seq" specified length of "' + seqLength + '", only "' + (inputLength - offset) + '" remaining'); + } + if (signature[offset++] !== ENCODED_TAG_INT) { + throw new Error('Could not find expected "int" for "r"'); + } + var rLength = signature[offset++]; + if (inputLength - offset - 2 < rLength) { + throw new Error('"r" specified length of "' + rLength + '", only "' + (inputLength - offset - 2) + '" available'); + } + if (maxEncodedParamLength < rLength) { + throw new Error('"r" specified length of "' + rLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); + } + var rOffset = offset; + offset += rLength; + if (signature[offset++] !== ENCODED_TAG_INT) { + throw new Error('Could not find expected "int" for "s"'); + } + var sLength = signature[offset++]; + if (inputLength - offset !== sLength) { + throw new Error('"s" specified length of "' + sLength + '", expected "' + (inputLength - offset) + '"'); + } + if (maxEncodedParamLength < sLength) { + throw new Error('"s" specified length of "' + sLength + '", max of "' + maxEncodedParamLength + '" is acceptable'); + } + var sOffset = offset; + offset += sLength; + if (offset !== inputLength) { + throw new Error('Expected to consume entire buffer, but "' + (inputLength - offset) + '" bytes remain'); + } + var rPadding = paramBytes - rLength, sPadding = paramBytes - sLength; + var dst = Buffer2.allocUnsafe(rPadding + rLength + sPadding + sLength); + for (offset = 0; offset < rPadding; ++offset) { + dst[offset] = 0; + } + signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength); + offset = paramBytes; + for (var o = offset; offset < o + sPadding; ++offset) { + dst[offset] = 0; + } + signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength); + dst = dst.toString("base64"); + dst = base64Url(dst); + return dst; + } + function countPadding(buf, start, stop) { + var padding = 0; + while (start + padding < stop && buf[start + padding] === 0) { + ++padding; + } + var needsSign = buf[start + padding] >= MAX_OCTET; + if (needsSign) { + --padding; + } + return padding; + } + function joseToDer(signature, alg) { + signature = signatureAsBuffer(signature); + var paramBytes = getParamBytesForAlg(alg); + var signatureBytes = signature.length; + if (signatureBytes !== paramBytes * 2) { + throw new TypeError('"' + alg + '" signatures must be "' + paramBytes * 2 + '" bytes, saw "' + signatureBytes + '"'); + } + var rPadding = countPadding(signature, 0, paramBytes); + var sPadding = countPadding(signature, paramBytes, signature.length); + var rLength = paramBytes - rPadding; + var sLength = paramBytes - sPadding; + var rsBytes = 1 + 1 + rLength + 1 + 1 + sLength; + var shortLength = rsBytes < MAX_OCTET; + var dst = Buffer2.allocUnsafe((shortLength ? 2 : 3) + rsBytes); + var offset = 0; + dst[offset++] = ENCODED_TAG_SEQ; + if (shortLength) { + dst[offset++] = rsBytes; + } else { + dst[offset++] = MAX_OCTET | 1; + dst[offset++] = rsBytes & 255; + } + dst[offset++] = ENCODED_TAG_INT; + dst[offset++] = rLength; + if (rPadding < 0) { + dst[offset++] = 0; + offset += signature.copy(dst, offset, 0, paramBytes); + } else { + offset += signature.copy(dst, offset, rPadding, paramBytes); + } + dst[offset++] = ENCODED_TAG_INT; + dst[offset++] = sLength; + if (sPadding < 0) { + dst[offset++] = 0; + signature.copy(dst, offset, paramBytes); + } else { + signature.copy(dst, offset, paramBytes + sPadding); + } + return dst; + } + module2.exports = { + derToJose, + joseToDer + }; + } +}); + +// ../../node_modules/.pnpm/buffer-equal-constant-time@1.0.1/node_modules/buffer-equal-constant-time/index.js +var require_buffer_equal_constant_time = __commonJS({ + "../../node_modules/.pnpm/buffer-equal-constant-time@1.0.1/node_modules/buffer-equal-constant-time/index.js"(exports2, module2) { + "use strict"; + var Buffer2 = require("buffer").Buffer; + var SlowBuffer = require("buffer").SlowBuffer; + module2.exports = bufferEq; + function bufferEq(a, b) { + if (!Buffer2.isBuffer(a) || !Buffer2.isBuffer(b)) { + return false; + } + if (a.length !== b.length) { + return false; + } + var c = 0; + for (var i = 0; i < a.length; i++) { + c |= a[i] ^ b[i]; + } + return c === 0; + } + bufferEq.install = function() { + Buffer2.prototype.equal = SlowBuffer.prototype.equal = function equal(that) { + return bufferEq(this, that); + }; + }; + var origBufEqual = Buffer2.prototype.equal; + var origSlowBufEqual = SlowBuffer.prototype.equal; + bufferEq.restore = function() { + Buffer2.prototype.equal = origBufEqual; + SlowBuffer.prototype.equal = origSlowBufEqual; + }; + } +}); + +// ../../node_modules/.pnpm/jwa@2.0.1/node_modules/jwa/index.js +var require_jwa = __commonJS({ + "../../node_modules/.pnpm/jwa@2.0.1/node_modules/jwa/index.js"(exports2, module2) { + var Buffer2 = require_safe_buffer().Buffer; + var crypto2 = require("crypto"); + var formatEcdsa = require_ecdsa_sig_formatter(); + var util2 = require("util"); + var MSG_INVALID_ALGORITHM = '"%s" is not a valid algorithm.\n Supported algorithms are:\n "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".'; + var MSG_INVALID_SECRET = "secret must be a string or buffer"; + var MSG_INVALID_VERIFIER_KEY = "key must be a string or a buffer"; + var MSG_INVALID_SIGNER_KEY = "key must be a string, a buffer or an object"; + var supportsKeyObjects = typeof crypto2.createPublicKey === "function"; + if (supportsKeyObjects) { + MSG_INVALID_VERIFIER_KEY += " or a KeyObject"; + MSG_INVALID_SECRET += "or a KeyObject"; + } + function checkIsPublicKey(key) { + if (Buffer2.isBuffer(key)) { + return; + } + if (typeof key === "string") { + return; + } + if (!supportsKeyObjects) { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + if (typeof key !== "object") { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + if (typeof key.type !== "string") { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + if (typeof key.asymmetricKeyType !== "string") { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + if (typeof key.export !== "function") { + throw typeError(MSG_INVALID_VERIFIER_KEY); + } + } + function checkIsPrivateKey(key) { + if (Buffer2.isBuffer(key)) { + return; + } + if (typeof key === "string") { + return; + } + if (typeof key === "object") { + return; + } + throw typeError(MSG_INVALID_SIGNER_KEY); + } + function checkIsSecretKey(key) { + if (Buffer2.isBuffer(key)) { + return; + } + if (typeof key === "string") { + return key; + } + if (!supportsKeyObjects) { + throw typeError(MSG_INVALID_SECRET); + } + if (typeof key !== "object") { + throw typeError(MSG_INVALID_SECRET); + } + if (key.type !== "secret") { + throw typeError(MSG_INVALID_SECRET); + } + if (typeof key.export !== "function") { + throw typeError(MSG_INVALID_SECRET); + } + } + function fromBase64(base64) { + return base64.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); + } + function toBase64(base64url) { + base64url = base64url.toString(); + var padding = 4 - base64url.length % 4; + if (padding !== 4) { + for (var i = 0; i < padding; ++i) { + base64url += "="; + } + } + return base64url.replace(/\-/g, "+").replace(/_/g, "/"); + } + function typeError(template) { + var args = [].slice.call(arguments, 1); + var errMsg = util2.format.bind(util2, template).apply(null, args); + return new TypeError(errMsg); + } + function bufferOrString(obj) { + return Buffer2.isBuffer(obj) || typeof obj === "string"; + } + function normalizeInput(thing) { + if (!bufferOrString(thing)) + thing = JSON.stringify(thing); + return thing; + } + function createHmacSigner(bits) { + return function sign(thing, secret) { + checkIsSecretKey(secret); + thing = normalizeInput(thing); + var hmac = crypto2.createHmac("sha" + bits, secret); + var sig = (hmac.update(thing), hmac.digest("base64")); + return fromBase64(sig); + }; + } + var bufferEqual; + var timingSafeEqual = "timingSafeEqual" in crypto2 ? function timingSafeEqual2(a, b) { + if (a.byteLength !== b.byteLength) { + return false; + } + return crypto2.timingSafeEqual(a, b); + } : function timingSafeEqual2(a, b) { + if (!bufferEqual) { + bufferEqual = require_buffer_equal_constant_time(); + } + return bufferEqual(a, b); + }; + function createHmacVerifier(bits) { + return function verify(thing, signature, secret) { + var computedSig = createHmacSigner(bits)(thing, secret); + return timingSafeEqual(Buffer2.from(signature), Buffer2.from(computedSig)); + }; + } + function createKeySigner(bits) { + return function sign(thing, privateKey) { + checkIsPrivateKey(privateKey); + thing = normalizeInput(thing); + var signer = crypto2.createSign("RSA-SHA" + bits); + var sig = (signer.update(thing), signer.sign(privateKey, "base64")); + return fromBase64(sig); + }; + } + function createKeyVerifier(bits) { + return function verify(thing, signature, publicKey) { + checkIsPublicKey(publicKey); + thing = normalizeInput(thing); + signature = toBase64(signature); + var verifier = crypto2.createVerify("RSA-SHA" + bits); + verifier.update(thing); + return verifier.verify(publicKey, signature, "base64"); + }; + } + function createPSSKeySigner(bits) { + return function sign(thing, privateKey) { + checkIsPrivateKey(privateKey); + thing = normalizeInput(thing); + var signer = crypto2.createSign("RSA-SHA" + bits); + var sig = (signer.update(thing), signer.sign({ + key: privateKey, + padding: crypto2.constants.RSA_PKCS1_PSS_PADDING, + saltLength: crypto2.constants.RSA_PSS_SALTLEN_DIGEST + }, "base64")); + return fromBase64(sig); + }; + } + function createPSSKeyVerifier(bits) { + return function verify(thing, signature, publicKey) { + checkIsPublicKey(publicKey); + thing = normalizeInput(thing); + signature = toBase64(signature); + var verifier = crypto2.createVerify("RSA-SHA" + bits); + verifier.update(thing); + return verifier.verify({ + key: publicKey, + padding: crypto2.constants.RSA_PKCS1_PSS_PADDING, + saltLength: crypto2.constants.RSA_PSS_SALTLEN_DIGEST + }, signature, "base64"); + }; + } + function createECDSASigner(bits) { + var inner = createKeySigner(bits); + return function sign() { + var signature = inner.apply(null, arguments); + signature = formatEcdsa.derToJose(signature, "ES" + bits); + return signature; + }; + } + function createECDSAVerifer(bits) { + var inner = createKeyVerifier(bits); + return function verify(thing, signature, publicKey) { + signature = formatEcdsa.joseToDer(signature, "ES" + bits).toString("base64"); + var result = inner(thing, signature, publicKey); + return result; + }; + } + function createNoneSigner() { + return function sign() { + return ""; + }; + } + function createNoneVerifier() { + return function verify(thing, signature) { + return signature === ""; + }; + } + module2.exports = function jwa(algorithm) { + var signerFactories = { + hs: createHmacSigner, + rs: createKeySigner, + ps: createPSSKeySigner, + es: createECDSASigner, + none: createNoneSigner + }; + var verifierFactories = { + hs: createHmacVerifier, + rs: createKeyVerifier, + ps: createPSSKeyVerifier, + es: createECDSAVerifer, + none: createNoneVerifier + }; + var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/); + if (!match) + throw typeError(MSG_INVALID_ALGORITHM, algorithm); + var algo = (match[1] || match[3]).toLowerCase(); + var bits = match[2]; + return { + sign: signerFactories[algo](bits), + verify: verifierFactories[algo](bits) + }; + }; + } +}); + +// ../../node_modules/.pnpm/jws@4.0.1/node_modules/jws/lib/tostring.js +var require_tostring = __commonJS({ + "../../node_modules/.pnpm/jws@4.0.1/node_modules/jws/lib/tostring.js"(exports2, module2) { + var Buffer2 = require("buffer").Buffer; + module2.exports = function toString2(obj) { + if (typeof obj === "string") + return obj; + if (typeof obj === "number" || Buffer2.isBuffer(obj)) + return obj.toString(); + return JSON.stringify(obj); + }; + } +}); + +// ../../node_modules/.pnpm/jws@4.0.1/node_modules/jws/lib/sign-stream.js +var require_sign_stream = __commonJS({ + "../../node_modules/.pnpm/jws@4.0.1/node_modules/jws/lib/sign-stream.js"(exports2, module2) { + var Buffer2 = require_safe_buffer().Buffer; + var DataStream = require_data_stream(); + var jwa = require_jwa(); + var Stream = require("stream"); + var toString2 = require_tostring(); + var util2 = require("util"); + function base64url(string, encoding) { + return Buffer2.from(string, encoding).toString("base64").replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_"); + } + function jwsSecuredInput(header, payload, encoding) { + encoding = encoding || "utf8"; + var encodedHeader = base64url(toString2(header), "binary"); + var encodedPayload = base64url(toString2(payload), encoding); + return util2.format("%s.%s", encodedHeader, encodedPayload); + } + function jwsSign(opts) { + var header = opts.header; + var payload = opts.payload; + var secretOrKey = opts.secret || opts.privateKey; + var encoding = opts.encoding; + var algo = jwa(header.alg); + var securedInput = jwsSecuredInput(header, payload, encoding); + var signature = algo.sign(securedInput, secretOrKey); + return util2.format("%s.%s", securedInput, signature); + } + function SignStream(opts) { + var secret = opts.secret; + secret = secret == null ? opts.privateKey : secret; + secret = secret == null ? opts.key : secret; + if (/^hs/i.test(opts.header.alg) === true && secret == null) { + throw new TypeError("secret must be a string or buffer or a KeyObject"); + } + var secretStream = new DataStream(secret); + this.readable = true; + this.header = opts.header; + this.encoding = opts.encoding; + this.secret = this.privateKey = this.key = secretStream; + this.payload = new DataStream(opts.payload); + this.secret.once("close", function() { + if (!this.payload.writable && this.readable) + this.sign(); + }.bind(this)); + this.payload.once("close", function() { + if (!this.secret.writable && this.readable) + this.sign(); + }.bind(this)); + } + util2.inherits(SignStream, Stream); + SignStream.prototype.sign = function sign() { + try { + var signature = jwsSign({ + header: this.header, + payload: this.payload.buffer, + secret: this.secret.buffer, + encoding: this.encoding + }); + this.emit("done", signature); + this.emit("data", signature); + this.emit("end"); + this.readable = false; + return signature; + } catch (e) { + this.readable = false; + this.emit("error", e); + this.emit("close"); + } + }; + SignStream.sign = jwsSign; + module2.exports = SignStream; + } +}); + +// ../../node_modules/.pnpm/jws@4.0.1/node_modules/jws/lib/verify-stream.js +var require_verify_stream = __commonJS({ + "../../node_modules/.pnpm/jws@4.0.1/node_modules/jws/lib/verify-stream.js"(exports2, module2) { + var Buffer2 = require_safe_buffer().Buffer; + var DataStream = require_data_stream(); + var jwa = require_jwa(); + var Stream = require("stream"); + var toString2 = require_tostring(); + var util2 = require("util"); + var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/; + function isObject(thing) { + return Object.prototype.toString.call(thing) === "[object Object]"; + } + function safeJsonParse(thing) { + if (isObject(thing)) + return thing; + try { + return JSON.parse(thing); + } catch (e) { + return void 0; + } + } + function headerFromJWS(jwsSig) { + var encodedHeader = jwsSig.split(".", 1)[0]; + return safeJsonParse(Buffer2.from(encodedHeader, "base64").toString("binary")); + } + function securedInputFromJWS(jwsSig) { + return jwsSig.split(".", 2).join("."); + } + function signatureFromJWS(jwsSig) { + return jwsSig.split(".")[2]; + } + function payloadFromJWS(jwsSig, encoding) { + encoding = encoding || "utf8"; + var payload = jwsSig.split(".")[1]; + return Buffer2.from(payload, "base64").toString(encoding); + } + function isValidJws(string) { + return JWS_REGEX.test(string) && !!headerFromJWS(string); + } + function jwsVerify(jwsSig, algorithm, secretOrKey) { + if (!algorithm) { + var err = new Error("Missing algorithm parameter for jws.verify"); + err.code = "MISSING_ALGORITHM"; + throw err; + } + jwsSig = toString2(jwsSig); + var signature = signatureFromJWS(jwsSig); + var securedInput = securedInputFromJWS(jwsSig); + var algo = jwa(algorithm); + return algo.verify(securedInput, signature, secretOrKey); + } + function jwsDecode(jwsSig, opts) { + opts = opts || {}; + jwsSig = toString2(jwsSig); + if (!isValidJws(jwsSig)) + return null; + var header = headerFromJWS(jwsSig); + if (!header) + return null; + var payload = payloadFromJWS(jwsSig); + if (header.typ === "JWT" || opts.json) + payload = JSON.parse(payload, opts.encoding); + return { + header, + payload, + signature: signatureFromJWS(jwsSig) + }; + } + function VerifyStream(opts) { + opts = opts || {}; + var secretOrKey = opts.secret; + secretOrKey = secretOrKey == null ? opts.publicKey : secretOrKey; + secretOrKey = secretOrKey == null ? opts.key : secretOrKey; + if (/^hs/i.test(opts.algorithm) === true && secretOrKey == null) { + throw new TypeError("secret must be a string or buffer or a KeyObject"); + } + var secretStream = new DataStream(secretOrKey); + this.readable = true; + this.algorithm = opts.algorithm; + this.encoding = opts.encoding; + this.secret = this.publicKey = this.key = secretStream; + this.signature = new DataStream(opts.signature); + this.secret.once("close", function() { + if (!this.signature.writable && this.readable) + this.verify(); + }.bind(this)); + this.signature.once("close", function() { + if (!this.secret.writable && this.readable) + this.verify(); + }.bind(this)); + } + util2.inherits(VerifyStream, Stream); + VerifyStream.prototype.verify = function verify() { + try { + var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer); + var obj = jwsDecode(this.signature.buffer, this.encoding); + this.emit("done", valid, obj); + this.emit("data", valid); + this.emit("end"); + this.readable = false; + return valid; + } catch (e) { + this.readable = false; + this.emit("error", e); + this.emit("close"); + } + }; + VerifyStream.decode = jwsDecode; + VerifyStream.isValid = isValidJws; + VerifyStream.verify = jwsVerify; + module2.exports = VerifyStream; + } +}); + +// ../../node_modules/.pnpm/jws@4.0.1/node_modules/jws/index.js +var require_jws = __commonJS({ + "../../node_modules/.pnpm/jws@4.0.1/node_modules/jws/index.js"(exports2) { + var SignStream = require_sign_stream(); + var VerifyStream = require_verify_stream(); + var ALGORITHMS = [ + "HS256", + "HS384", + "HS512", + "RS256", + "RS384", + "RS512", + "PS256", + "PS384", + "PS512", + "ES256", + "ES384", + "ES512" + ]; + exports2.ALGORITHMS = ALGORITHMS; + exports2.sign = SignStream.sign; + exports2.verify = VerifyStream.verify; + exports2.decode = VerifyStream.decode; + exports2.isValid = VerifyStream.isValid; + exports2.createSign = function createSign(opts) { + return new SignStream(opts); + }; + exports2.createVerify = function createVerify(opts) { + return new VerifyStream(opts); + }; + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/decode.js +var require_decode = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/decode.js"(exports2, module2) { + var jws = require_jws(); + module2.exports = function(jwt, options) { + options = options || {}; + var decoded = jws.decode(jwt, options); + if (!decoded) { + return null; + } + var payload = decoded.payload; + if (typeof payload === "string") { + try { + var obj = JSON.parse(payload); + if (obj !== null && typeof obj === "object") { + payload = obj; + } + } catch (e) { + } + } + if (options.complete === true) { + return { + header: decoded.header, + payload, + signature: decoded.signature + }; + } + return payload; + }; + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/JsonWebTokenError.js +var require_JsonWebTokenError = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/JsonWebTokenError.js"(exports2, module2) { + var JsonWebTokenError2 = function(message, error) { + Error.call(this, message); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + this.name = "JsonWebTokenError"; + this.message = message; + if (error) this.inner = error; + }; + JsonWebTokenError2.prototype = Object.create(Error.prototype); + JsonWebTokenError2.prototype.constructor = JsonWebTokenError2; + module2.exports = JsonWebTokenError2; + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/NotBeforeError.js +var require_NotBeforeError = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/NotBeforeError.js"(exports2, module2) { + var JsonWebTokenError2 = require_JsonWebTokenError(); + var NotBeforeError2 = function(message, date) { + JsonWebTokenError2.call(this, message); + this.name = "NotBeforeError"; + this.date = date; + }; + NotBeforeError2.prototype = Object.create(JsonWebTokenError2.prototype); + NotBeforeError2.prototype.constructor = NotBeforeError2; + module2.exports = NotBeforeError2; + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/TokenExpiredError.js +var require_TokenExpiredError = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/TokenExpiredError.js"(exports2, module2) { + var JsonWebTokenError2 = require_JsonWebTokenError(); + var TokenExpiredError2 = function(message, expiredAt) { + JsonWebTokenError2.call(this, message); + this.name = "TokenExpiredError"; + this.expiredAt = expiredAt; + }; + TokenExpiredError2.prototype = Object.create(JsonWebTokenError2.prototype); + TokenExpiredError2.prototype.constructor = TokenExpiredError2; + module2.exports = TokenExpiredError2; + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/timespan.js +var require_timespan = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/timespan.js"(exports2, module2) { + var ms = require_ms2(); + module2.exports = function(time, iat) { + var timestamp = iat || Math.floor(Date.now() / 1e3); + if (typeof time === "string") { + var milliseconds = ms(time); + if (typeof milliseconds === "undefined") { + return; + } + return Math.floor(timestamp + milliseconds / 1e3); + } else if (typeof time === "number") { + return timestamp + time; + } else { + return; + } + }; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js +var require_constants8 = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports2, module2) { + "use strict"; + var SEMVER_SPEC_VERSION = "2.0.0"; + var MAX_LENGTH = 256; + var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */ + 9007199254740991; + var MAX_SAFE_COMPONENT_LENGTH = 16; + var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6; + var RELEASE_TYPES = [ + "major", + "premajor", + "minor", + "preminor", + "patch", + "prepatch", + "prerelease" + ]; + module2.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 1, + FLAG_LOOSE: 2 + }; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js +var require_debug2 = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports2, module2) { + "use strict"; + var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module2.exports = debug; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js +var require_re = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports2, module2) { + "use strict"; + var { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH + } = require_constants8(); + var debug = require_debug2(); + exports2 = module2.exports = {}; + var re = exports2.re = []; + var safeRe = exports2.safeRe = []; + var src = exports2.src = []; + var safeSrc = exports2.safeSrc = []; + var t = exports2.t = {}; + var R = 0; + var LETTERDASHNUMBER = "[a-zA-Z0-9-]"; + var safeRegexReplacements = [ + ["\\s", 1], + ["\\d", MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH] + ]; + var makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`); + } + return value; + }; + var createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R++; + debug(name, index, value); + t[name] = index; + src[index] = value; + safeSrc[index] = safe; + re[index] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); + }; + createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*"); + createToken("NUMERICIDENTIFIERLOOSE", "\\d+"); + createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`); + createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`); + createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`); + createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`); + createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`); + createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`); + createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`); + createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`); + createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`); + createToken("FULL", `^${src[t.FULLPLAIN]}$`); + createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`); + createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`); + createToken("GTLT", "((?:<|>)?=?)"); + createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`); + createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`); + createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`); + createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`); + createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`); + createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`); + createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`); + createToken("COERCERTL", src[t.COERCE], true); + createToken("COERCERTLFULL", src[t.COERCEFULL], true); + createToken("LONETILDE", "(?:~>?)"); + createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true); + exports2.tildeTrimReplace = "$1~"; + createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`); + createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("LONECARET", "(?:\\^)"); + createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true); + exports2.caretTrimReplace = "$1^"; + createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`); + createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`); + createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`); + createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`); + createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true); + exports2.comparatorTrimReplace = "$1$2$3"; + createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`); + createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`); + createToken("STAR", "(<|>)?=?\\s*\\*"); + createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"); + createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$"); + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js +var require_parse_options = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports2, module2) { + "use strict"; + var looseOption = Object.freeze({ loose: true }); + var emptyOpts = Object.freeze({}); + var parseOptions = (options) => { + if (!options) { + return emptyOpts; + } + if (typeof options !== "object") { + return looseOption; + } + return options; + }; + module2.exports = parseOptions; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js +var require_identifiers = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports2, module2) { + "use strict"; + var numeric = /^[0-9]+$/; + var compareIdentifiers = (a, b) => { + if (typeof a === "number" && typeof b === "number") { + return a === b ? 0 : a < b ? -1 : 1; + } + const anum = numeric.test(a); + const bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; + }; + var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a); + module2.exports = { + compareIdentifiers, + rcompareIdentifiers + }; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js +var require_semver = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports2, module2) { + "use strict"; + var debug = require_debug2(); + var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants8(); + var { safeRe: re, t } = require_re(); + var parseOptions = require_parse_options(); + var { compareIdentifiers } = require_identifiers(); + var isPrereleaseIdentifier = (prerelease, identifier) => { + const identifiers = identifier.split("."); + if (identifiers.length > prerelease.length) { + return false; + } + for (let i = 0; i < identifiers.length; i++) { + if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) { + return false; + } + } + return true; + }; + var SemVer = class _SemVer { + constructor(version, options) { + options = parseOptions(options); + if (version instanceof _SemVer) { + if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) { + return version; + } else { + version = version.version; + } + } else if (typeof version !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`); + } + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ); + } + debug("SemVer", version, options); + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); + if (!m) { + throw new TypeError(`Invalid Version: ${version}`); + } + this.raw = version; + this.major = +m[1]; + this.minor = +m[2]; + this.patch = +m[3]; + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError("Invalid major version"); + } + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); + } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); + } + if (!m[4]) { + this.prerelease = []; + } else { + this.prerelease = m[4].split(".").map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id; + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num; + } + } + return id; + }); + } + this.build = m[5] ? m[5].split(".") : []; + this.format(); + } + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; + } + return this.version; + } + toString() { + return this.version; + } + compare(other) { + debug("SemVer.compare", this.version, this.options, other); + if (!(other instanceof _SemVer)) { + if (typeof other === "string" && other === this.version) { + return 0; + } + other = new _SemVer(other, this.options); + } + if (other.version === this.version) { + return 0; + } + return this.compareMain(other) || this.comparePre(other); + } + compareMain(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + if (this.major < other.major) { + return -1; + } + if (this.major > other.major) { + return 1; + } + if (this.minor < other.minor) { + return -1; + } + if (this.minor > other.minor) { + return 1; + } + if (this.patch < other.patch) { + return -1; + } + if (this.patch > other.patch) { + return 1; + } + return 0; + } + comparePre(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + if (this.prerelease.length && !other.prerelease.length) { + return -1; + } else if (!this.prerelease.length && other.prerelease.length) { + return 1; + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0; + } + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug("prerelease compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + compareBuild(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); + } + let i = 0; + do { + const a = this.build[i]; + const b = other.build[i]; + debug("build compare", i, a, b); + if (a === void 0 && b === void 0) { + return 0; + } else if (b === void 0) { + return 1; + } else if (a === void 0) { + return -1; + } else if (a === b) { + continue; + } else { + return compareIdentifiers(a, b); + } + } while (++i); + } + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc(release, identifier, identifierBase) { + if (release.startsWith("pre")) { + if (!identifier && identifierBase === false) { + throw new Error("invalid increment argument: identifier is empty"); + } + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`); + } + } + } + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier, identifierBase); + break; + case "preminor": + this.prerelease.length = 0; + this.patch = 0; + this.minor++; + this.inc("pre", identifier, identifierBase); + break; + case "prepatch": + this.prerelease.length = 0; + this.inc("patch", identifier, identifierBase); + this.inc("pre", identifier, identifierBase); + break; + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case "prerelease": + if (this.prerelease.length === 0) { + this.inc("patch", identifier, identifierBase); + } + this.inc("pre", identifier, identifierBase); + break; + case "release": + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`); + } + this.prerelease.length = 0; + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; + } + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; + } + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; + } + this.prerelease = []; + break; + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case "pre": { + const base = Number(identifierBase) ? 1 : 0; + if (this.prerelease.length === 0) { + this.prerelease = [base]; + } else { + let i = this.prerelease.length; + while (--i >= 0) { + if (typeof this.prerelease[i] === "number") { + this.prerelease[i]++; + i = -2; + } + } + if (i === -1) { + if (identifier === this.prerelease.join(".") && identifierBase === false) { + throw new Error("invalid increment argument: identifier already exists"); + } + this.prerelease.push(base); + } + } + if (identifier) { + let prerelease = [identifier, base]; + if (identifierBase === false) { + prerelease = [identifier]; + } + if (isPrereleaseIdentifier(this.prerelease, identifier)) { + const prereleaseBase = this.prerelease[identifier.split(".").length]; + if (isNaN(prereleaseBase)) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; + } + default: + throw new Error(`invalid increment argument: ${release}`); + } + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; + } + return this; + } + }; + module2.exports = SemVer; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js +var require_parse3 = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version; + } + try { + return new SemVer(version, options); + } catch (er) { + if (!throwErrors) { + return null; + } + throw er; + } + }; + module2.exports = parse; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js +var require_valid = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports2, module2) { + "use strict"; + var parse = require_parse3(); + var valid = (version, options) => { + const v = parse(version, options); + return v ? v.version : null; + }; + module2.exports = valid; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js +var require_clean = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports2, module2) { + "use strict"; + var parse = require_parse3(); + var clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; + }; + module2.exports = clean; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js +var require_inc = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var inc = (version, release, options, identifier, identifierBase) => { + if (typeof options === "string") { + identifierBase = identifier; + identifier = options; + options = void 0; + } + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version; + } catch (er) { + return null; + } + }; + module2.exports = inc; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js +var require_diff = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports2, module2) { + "use strict"; + var parse = require_parse3(); + var diff = (version1, version2) => { + const v1 = parse(version1, null, true); + const v2 = parse(version2, null, true); + const comparison = v1.compare(v2); + if (comparison === 0) { + return null; + } + const v1Higher = comparison > 0; + const highVersion = v1Higher ? v1 : v2; + const lowVersion = v1Higher ? v2 : v1; + const highHasPre = !!highVersion.prerelease.length; + const lowHasPre = !!lowVersion.prerelease.length; + if (lowHasPre && !highHasPre) { + if (!lowVersion.patch && !lowVersion.minor) { + return "major"; + } + if (lowVersion.compareMain(highVersion) === 0) { + if (lowVersion.minor && !lowVersion.patch) { + return "minor"; + } + return "patch"; + } + } + const prefix = highHasPre ? "pre" : ""; + if (v1.major !== v2.major) { + return prefix + "major"; + } + if (v1.minor !== v2.minor) { + return prefix + "minor"; + } + if (v1.patch !== v2.patch) { + return prefix + "patch"; + } + return "prerelease"; + }; + module2.exports = diff; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js +var require_major = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var major = (a, loose) => new SemVer(a, loose).major; + module2.exports = major; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js +var require_minor = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var minor = (a, loose) => new SemVer(a, loose).minor; + module2.exports = minor; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js +var require_patch = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var patch = (a, loose) => new SemVer(a, loose).patch; + module2.exports = patch; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js +var require_prerelease = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports2, module2) { + "use strict"; + var parse = require_parse3(); + var prerelease = (version, options) => { + const parsed = parse(version, options); + return parsed && parsed.prerelease.length ? parsed.prerelease : null; + }; + module2.exports = prerelease; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js +var require_compare = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); + module2.exports = compare; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js +var require_rcompare = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var rcompare = (a, b, loose) => compare(b, a, loose); + module2.exports = rcompare; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js +var require_compare_loose = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var compareLoose = (a, b) => compare(a, b, true); + module2.exports = compareLoose; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js +var require_compare_build = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose); + const versionB = new SemVer(b, loose); + return versionA.compare(versionB) || versionA.compareBuild(versionB); + }; + module2.exports = compareBuild; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js +var require_sort = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js"(exports2, module2) { + "use strict"; + var compareBuild = require_compare_build(); + var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)); + module2.exports = sort; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js +var require_rsort = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js"(exports2, module2) { + "use strict"; + var compareBuild = require_compare_build(); + var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)); + module2.exports = rsort; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js +var require_gt = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var gt = (a, b, loose) => compare(a, b, loose) > 0; + module2.exports = gt; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js +var require_lt = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lt = (a, b, loose) => compare(a, b, loose) < 0; + module2.exports = lt; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js +var require_eq = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var eq = (a, b, loose) => compare(a, b, loose) === 0; + module2.exports = eq; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js +var require_neq = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var neq = (a, b, loose) => compare(a, b, loose) !== 0; + module2.exports = neq; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js +var require_gte = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var gte = (a, b, loose) => compare(a, b, loose) >= 0; + module2.exports = gte; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js +var require_lte = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lte = (a, b, loose) => compare(a, b, loose) <= 0; + module2.exports = lte; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js +var require_cmp = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js"(exports2, module2) { + "use strict"; + var eq = require_eq(); + var neq = require_neq(); + var gt = require_gt(); + var gte = require_gte(); + var lt = require_lt(); + var lte = require_lte(); + var cmp = (a, op, b, loose) => { + switch (op) { + case "===": + if (typeof a === "object") { + a = a.version; + } + if (typeof b === "object") { + b = b.version; + } + return a === b; + case "!==": + if (typeof a === "object") { + a = a.version; + } + if (typeof b === "object") { + b = b.version; + } + return a !== b; + case "": + case "=": + case "==": + return eq(a, b, loose); + case "!=": + return neq(a, b, loose); + case ">": + return gt(a, b, loose); + case ">=": + return gte(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError(`Invalid operator: ${op}`); + } + }; + module2.exports = cmp; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js +var require_coerce = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var parse = require_parse3(); + var { safeRe: re, t } = require_re(); + var coerce = (version, options) => { + if (version instanceof SemVer) { + return version; + } + if (typeof version === "number") { + version = String(version); + } + if (typeof version !== "string") { + return null; + } + options = options || {}; + let match = null; + if (!options.rtl) { + match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); + } else { + const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; + let next; + while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; + } + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; + } + coerceRtlRegex.lastIndex = -1; + } + if (match === null) { + return null; + } + const major = match[2]; + const minor = match[3] || "0"; + const patch = match[4] || "0"; + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ""; + const build = options.includePrerelease && match[6] ? `+${match[6]}` : ""; + return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options); + }; + module2.exports = coerce; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js +var require_truncate = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports2, module2) { + "use strict"; + var parse = require_parse3(); + var constants = require_constants8(); + var SemVer = require_semver(); + var truncate = (version, truncation, options) => { + if (!constants.RELEASE_TYPES.includes(truncation)) { + return null; + } + const clonedVersion = cloneInputVersion(version, options); + return clonedVersion && doTruncation(clonedVersion, truncation); + }; + var cloneInputVersion = (version, options) => { + const versionStringToParse = version instanceof SemVer ? version.version : version; + return parse(versionStringToParse, options); + }; + var doTruncation = (version, truncation) => { + if (isPrerelease(truncation)) { + return version.version; + } + version.prerelease = []; + switch (truncation) { + case "major": + version.minor = 0; + version.patch = 0; + break; + case "minor": + version.patch = 0; + break; + } + return version.format(); + }; + var isPrerelease = (type) => { + return type.startsWith("pre"); + }; + module2.exports = truncate; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js +var require_lrucache = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js"(exports2, module2) { + "use strict"; + var LRUCache = class { + constructor() { + this.max = 1e3; + this.map = /* @__PURE__ */ new Map(); + } + get(key) { + const value = this.map.get(key); + if (value === void 0) { + return void 0; + } else { + this.map.delete(key); + this.map.set(key, value); + return value; + } + } + delete(key) { + return this.map.delete(key); + } + set(key, value) { + const deleted = this.delete(key); + if (!deleted && value !== void 0) { + if (this.map.size >= this.max) { + const firstKey = this.map.keys().next().value; + this.delete(firstKey); + } + this.map.set(key, value); + } + return this; + } + }; + module2.exports = LRUCache; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js +var require_range3 = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js"(exports2, module2) { + "use strict"; + var SPACE_CHARACTERS = /\s+/g; + var Range = class _Range { + constructor(range, options) { + options = parseOptions(options); + if (range instanceof _Range) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new _Range(range.raw, options); + } + } + if (range instanceof Comparator) { + this.raw = range.value; + this.set = [[range]]; + this.formatted = void 0; + return this; + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().replace(SPACE_CHARACTERS, " "); + this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length); + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`); + } + if (this.set.length > 1) { + const first = this.set[0]; + this.set = this.set.filter((c) => !isNullSet(c[0])); + if (this.set.length === 0) { + this.set = [first]; + } else if (this.set.length > 1) { + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c]; + break; + } + } + } + } + this.formatted = void 0; + } + get range() { + if (this.formatted === void 0) { + this.formatted = ""; + for (let i = 0; i < this.set.length; i++) { + if (i > 0) { + this.formatted += "||"; + } + const comps = this.set[i]; + for (let k = 0; k < comps.length; k++) { + if (k > 0) { + this.formatted += " "; + } + this.formatted += comps[k].toString().trim(); + } + } + } + return this.formatted; + } + format() { + return this.range; + } + toString() { + return this.range; + } + parseRange(range) { + range = range.replace(BUILDSTRIPRE, ""); + const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); + const memoKey = memoOpts + ":" + range; + const cached = cache.get(memoKey); + if (cached) { + return cached; + } + const loose = this.options.loose; + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); + debug("hyphen replace", range); + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); + debug("comparator trim", range); + range = range.replace(re[t.TILDETRIM], tildeTrimReplace); + debug("tilde trim", range); + range = range.replace(re[t.CARETTRIM], caretTrimReplace); + debug("caret trim", range); + let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); + if (loose) { + rangeList = rangeList.filter((comp) => { + debug("loose invalid filter", comp, this.options); + return !!comp.match(re[t.COMPARATORLOOSE]); + }); + } + debug("range list", rangeList); + const rangeMap = /* @__PURE__ */ new Map(); + const comparators = rangeList.map((comp) => new Comparator(comp, this.options)); + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp]; + } + rangeMap.set(comp.value, comp); + } + if (rangeMap.size > 1 && rangeMap.has("")) { + rangeMap.delete(""); + } + const result = [...rangeMap.values()]; + cache.set(memoKey, result); + return result; + } + intersects(range, options) { + if (!(range instanceof _Range)) { + throw new TypeError("a Range is required"); + } + return this.set.some((thisComparators) => { + return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { + return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); + } + // if ANY of the sets match ALL of its comparators, then pass + test(version) { + if (!version) { + return false; + } + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } + } + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true; + } + } + return false; + } + }; + module2.exports = Range; + var LRU = require_lrucache(); + var cache = new LRU(); + var parseOptions = require_parse_options(); + var Comparator = require_comparator(); + var debug = require_debug2(); + var SemVer = require_semver(); + var { + safeRe: re, + src, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace + } = require_re(); + var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants8(); + var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g"); + var isNullSet = (c) => c.value === "<0.0.0-0"; + var isAny = (c) => c.value === ""; + var isSatisfiable = (comparators, options) => { + let result = true; + const remainingComparators = comparators.slice(); + let testComparator = remainingComparators.pop(); + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options); + }); + testComparator = remainingComparators.pop(); + } + return result; + }; + var parseComparator = (comp, options) => { + comp = comp.replace(re[t.BUILD], ""); + debug("comp", comp, options); + comp = replaceCarets(comp, options); + debug("caret", comp); + comp = replaceTildes(comp, options); + debug("tildes", comp); + comp = replaceXRanges(comp, options); + debug("xrange", comp); + comp = replaceStars(comp, options); + debug("stars", comp); + return comp; + }; + var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; + var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p); + var replaceTildes = (comp, options) => { + return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "); + }; + var replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]; + const z = options.includePrerelease ? "-0" : ""; + return comp.replace(r, (_, M, m, p, pr) => { + debug("tilde", comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; + } else if (isX(p)) { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; + } else if (pr) { + debug("replaceTilde pr", pr); + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; + } + debug("tilde return", ret); + return ret; + }); + }; + var replaceCarets = (comp, options) => { + return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); + }; + var replaceCaret = (comp, options) => { + debug("caret", comp, options); + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; + const z = options.includePrerelease ? "-0" : ""; + return comp.replace(r, (_, M, m, p, pr) => { + debug("caret", comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`; + } else if (isX(p)) { + if (M === "0") { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`; + } + } else if (pr) { + debug("replaceCaret pr", pr); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; + } + } else { + debug("no pr"); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; + } + } + debug("caret return", ret); + return ret; + }); + }; + var replaceXRanges = (comp, options) => { + debug("replaceXRanges", comp, options); + return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" "); + }; + var replaceXRange = (comp, options) => { + comp = comp.trim(); + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]; + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug("xRange", comp, ret, gtlt, M, m, p, pr); + if (invalidXRangeOrder(M, m, p)) { + return comp; + } + const xM = isX(M); + const xm = xM || isX(m); + const xp = xm || isX(p); + const anyX = xp; + if (gtlt === "=" && anyX) { + gtlt = ""; + } + pr = options.includePrerelease ? "-0" : ""; + if (xM) { + if (gtlt === ">" || gtlt === "<") { + ret = "<0.0.0-0"; + } else { + ret = "*"; + } + } else if (gtlt && anyX) { + if (xm) { + m = 0; + } + p = 0; + if (gtlt === ">") { + gtlt = ">="; + if (xm) { + M = +M + 1; + m = 0; + p = 0; + } else { + m = +m + 1; + p = 0; + } + } else if (gtlt === "<=") { + gtlt = "<"; + if (xm) { + M = +M + 1; + } else { + m = +m + 1; + } + } + if (gtlt === "<") { + pr = "-0"; + } + ret = `${gtlt + M}.${m}.${p}${pr}`; + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`; + } else if (xp) { + ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`; + } + debug("xRange return", ret); + return ret; + }); + }; + var replaceStars = (comp, options) => { + debug("replaceStars", comp, options); + return comp.trim().replace(re[t.STAR], ""); + }; + var replaceGTE0 = (comp, options) => { + debug("replaceGTE0", comp, options); + return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], ""); + }; + var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => { + if (isX(fM)) { + from = ""; + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? "-0" : ""}`; + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`; + } else if (fpr) { + from = `>=${from}`; + } else { + from = `>=${from}${incPr ? "-0" : ""}`; + } + if (isX(tM)) { + to = ""; + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0`; + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0`; + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}`; + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0`; + } else { + to = `<=${to}`; + } + return `${from} ${to}`.trim(); + }; + var testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (let i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === Comparator.ANY) { + continue; + } + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; + } + } + } + return false; + } + return true; + }; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js +var require_comparator = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js"(exports2, module2) { + "use strict"; + var ANY = Symbol("SemVer ANY"); + var Comparator = class _Comparator { + static get ANY() { + return ANY; + } + constructor(comp, options) { + options = parseOptions(options); + if (comp instanceof _Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; + } + } + comp = comp.trim().split(/\s+/).join(" "); + debug("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; + } else { + this.value = this.operator + this.semver.version; + } + debug("comp", this); + } + parse(comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]; + const m = comp.match(r); + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`); + } + this.operator = m[1] !== void 0 ? m[1] : ""; + if (this.operator === "=") { + this.operator = ""; + } + if (!m[2]) { + this.semver = ANY; + } else { + this.semver = new SemVer(m[2], this.options.loose); + } + } + toString() { + return this.value; + } + test(version) { + debug("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { + return true; + } + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } + } + return cmp(version, this.operator, this.semver, this.options); + } + intersects(comp, options) { + if (!(comp instanceof _Comparator)) { + throw new TypeError("a Comparator is required"); + } + if (this.operator === "") { + if (this.value === "") { + return true; + } + return new Range(comp.value, options).test(this.value); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; + } + return new Range(this.value, options).test(comp.semver); + } + options = parseOptions(options); + if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { + return false; + } + if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { + return false; + } + if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { + return true; + } + if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { + return true; + } + if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { + return true; + } + if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { + return true; + } + if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { + return true; + } + return false; + } + }; + module2.exports = Comparator; + var parseOptions = require_parse_options(); + var { safeRe: re, t } = require_re(); + var cmp = require_cmp(); + var debug = require_debug2(); + var SemVer = require_semver(); + var Range = require_range3(); + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js +var require_satisfies = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js"(exports2, module2) { + "use strict"; + var Range = require_range3(); + var satisfies = (version, range, options) => { + try { + range = new Range(range, options); + } catch (er) { + return false; + } + return range.test(version); + }; + module2.exports = satisfies; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js +var require_to_comparators = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js"(exports2, module2) { + "use strict"; + var Range = require_range3(); + var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")); + module2.exports = toComparators; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js +var require_max_satisfying = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var Range = require_range3(); + var maxSatisfying = (versions, range, options) => { + let max = null; + let maxSV = null; + let rangeObj = null; + try { + rangeObj = new Range(range, options); + } catch (er) { + return null; + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + if (!max || maxSV.compare(v) === -1) { + max = v; + maxSV = new SemVer(max, options); + } + } + }); + return max; + }; + module2.exports = maxSatisfying; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js +var require_min_satisfying = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var Range = require_range3(); + var minSatisfying = (versions, range, options) => { + let min = null; + let minSV = null; + let rangeObj = null; + try { + rangeObj = new Range(range, options); + } catch (er) { + return null; + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + if (!min || minSV.compare(v) === 1) { + min = v; + minSV = new SemVer(min, options); + } + } + }); + return min; + }; + module2.exports = minSatisfying; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js +var require_min_version = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var Range = require_range3(); + var gt = require_gt(); + var minVersion = (range, loose) => { + range = new Range(range, loose); + let minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; + } + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i]; + let setMin = null; + comparators.forEach((comparator) => { + const compver = new SemVer(comparator.semver.version); + switch (comparator.operator) { + case ">": + if (compver.prerelease.length === 0) { + compver.patch++; + } else { + compver.prerelease.push(0); + } + compver.raw = compver.format(); + /* fallthrough */ + case "": + case ">=": + if (!setMin || gt(compver, setMin)) { + setMin = compver; + } + break; + case "<": + case "<=": + break; + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`); + } + }); + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin; + } + } + if (minver && range.test(minver)) { + return minver; + } + return null; + }; + module2.exports = minVersion; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js +var require_valid2 = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js"(exports2, module2) { + "use strict"; + var Range = require_range3(); + var validRange = (range, options) => { + try { + return new Range(range, options).range || "*"; + } catch (er) { + return null; + } + }; + module2.exports = validRange; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js +var require_outside = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js"(exports2, module2) { + "use strict"; + var SemVer = require_semver(); + var Comparator = require_comparator(); + var { ANY } = Comparator; + var Range = require_range3(); + var satisfies = require_satisfies(); + var gt = require_gt(); + var lt = require_lt(); + var lte = require_lte(); + var gte = require_gte(); + var outside = (version, range, hilo, options) => { + version = new SemVer(version, options); + range = new Range(range, options); + let gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies(version, range, options)) { + return false; + } + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i]; + let high = null; + let low = null; + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); + } + high = high || comparator; + low = low || comparator; + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator; + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator; + } + }); + if (high.operator === comp || high.operator === ecomp) { + return false; + } + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; + } + } + return true; + }; + module2.exports = outside; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js +var require_gtr = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js"(exports2, module2) { + "use strict"; + var outside = require_outside(); + var gtr = (version, range, options) => outside(version, range, ">", options); + module2.exports = gtr; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js +var require_ltr = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js"(exports2, module2) { + "use strict"; + var outside = require_outside(); + var ltr = (version, range, options) => outside(version, range, "<", options); + module2.exports = ltr; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js +var require_intersects = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js"(exports2, module2) { + "use strict"; + var Range = require_range3(); + var intersects = (r1, r2, options) => { + r1 = new Range(r1, options); + r2 = new Range(r2, options); + return r1.intersects(r2, options); + }; + module2.exports = intersects; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js +var require_simplify = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js"(exports2, module2) { + "use strict"; + var satisfies = require_satisfies(); + var compare = require_compare(); + module2.exports = (versions, range, options) => { + const set = []; + let first = null; + let prev = null; + const v = versions.sort((a, b) => compare(a, b, options)); + for (const version of v) { + const included = satisfies(version, range, options); + if (included) { + prev = version; + if (!first) { + first = version; + } + } else { + if (prev) { + set.push([first, prev]); + } + prev = null; + first = null; + } + } + if (first) { + set.push([first, null]); + } + const ranges = []; + for (const [min, max] of set) { + if (min === max) { + ranges.push(min); + } else if (!max && min === v[0]) { + ranges.push("*"); + } else if (!max) { + ranges.push(`>=${min}`); + } else if (min === v[0]) { + ranges.push(`<=${max}`); + } else { + ranges.push(`${min} - ${max}`); + } + } + const simplified = ranges.join(" || "); + const original = typeof range.raw === "string" ? range.raw : String(range); + return simplified.length < original.length ? simplified : range; + }; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js +var require_subset = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js"(exports2, module2) { + "use strict"; + var Range = require_range3(); + var Comparator = require_comparator(); + var { ANY } = Comparator; + var satisfies = require_satisfies(); + var compare = require_compare(); + var subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true; + } + sub = new Range(sub, options); + dom = new Range(dom, options); + let sawNonNull = false; + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options); + sawNonNull = sawNonNull || isSub !== null; + if (isSub) { + continue OUTER; + } + } + if (sawNonNull) { + return false; + } + } + return true; + }; + var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; + var minimumVersion = [new Comparator(">=0.0.0")]; + var simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true; + } + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true; + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease; + } else { + sub = minimumVersion; + } + } + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true; + } else { + dom = minimumVersion; + } + } + const eqSet = /* @__PURE__ */ new Set(); + let gt, lt; + for (const c of sub) { + if (c.operator === ">" || c.operator === ">=") { + gt = higherGT(gt, c, options); + } else if (c.operator === "<" || c.operator === "<=") { + lt = lowerLT(lt, c, options); + } else { + eqSet.add(c.semver); + } + } + if (eqSet.size > 1) { + return null; + } + let gtltComp; + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options); + if (gtltComp > 0) { + return null; + } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) { + return null; + } + } + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null; + } + if (lt && !satisfies(eq, String(lt), options)) { + return null; + } + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false; + } + } + return true; + } + let higher, lower; + let hasDomLT, hasDomGT; + let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; + let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false; + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false; + } + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">="; + hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<="; + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false; + } + } + if (c.operator === ">" || c.operator === ">=") { + higher = higherGT(gt, c, options); + if (higher === c && higher !== gt) { + return false; + } + } else if (gt.operator === ">=" && !c.test(gt.semver)) { + return false; + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false; + } + } + if (c.operator === "<" || c.operator === "<=") { + lower = lowerLT(lt, c, options); + if (lower === c && lower !== lt) { + return false; + } + } else if (lt.operator === "<=" && !c.test(lt.semver)) { + return false; + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false; + } + } + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false; + } + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false; + } + if (needDomGTPre || needDomLTPre) { + return false; + } + return true; + }; + var higherGT = (a, b, options) => { + if (!a) { + return b; + } + const comp = compare(a.semver, b.semver, options); + return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a; + }; + var lowerLT = (a, b, options) => { + if (!a) { + return b; + } + const comp = compare(a.semver, b.semver, options); + return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a; + }; + module2.exports = subset; + } +}); + +// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js +var require_semver2 = __commonJS({ + "../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js"(exports2, module2) { + "use strict"; + var internalRe = require_re(); + var constants = require_constants8(); + var SemVer = require_semver(); + var identifiers = require_identifiers(); + var parse = require_parse3(); + var valid = require_valid(); + var clean = require_clean(); + var inc = require_inc(); + var diff = require_diff(); + var major = require_major(); + var minor = require_minor(); + var patch = require_patch(); + var prerelease = require_prerelease(); + var compare = require_compare(); + var rcompare = require_rcompare(); + var compareLoose = require_compare_loose(); + var compareBuild = require_compare_build(); + var sort = require_sort(); + var rsort = require_rsort(); + var gt = require_gt(); + var lt = require_lt(); + var eq = require_eq(); + var neq = require_neq(); + var gte = require_gte(); + var lte = require_lte(); + var cmp = require_cmp(); + var coerce = require_coerce(); + var truncate = require_truncate(); + var Comparator = require_comparator(); + var Range = require_range3(); + var satisfies = require_satisfies(); + var toComparators = require_to_comparators(); + var maxSatisfying = require_max_satisfying(); + var minSatisfying = require_min_satisfying(); + var minVersion = require_min_version(); + var validRange = require_valid2(); + var outside = require_outside(); + var gtr = require_gtr(); + var ltr = require_ltr(); + var intersects = require_intersects(); + var simplifyRange = require_simplify(); + var subset = require_subset(); + module2.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + truncate, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers + }; + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js +var require_asymmetricKeyDetailsSupported = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js"(exports2, module2) { + var semver = require_semver2(); + module2.exports = semver.satisfies(process.version, ">=15.7.0"); + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js +var require_rsaPssKeyDetailsSupported = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js"(exports2, module2) { + var semver = require_semver2(); + module2.exports = semver.satisfies(process.version, ">=16.9.0"); + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js +var require_validateAsymmetricKey = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/validateAsymmetricKey.js"(exports2, module2) { + var ASYMMETRIC_KEY_DETAILS_SUPPORTED = require_asymmetricKeyDetailsSupported(); + var RSA_PSS_KEY_DETAILS_SUPPORTED = require_rsaPssKeyDetailsSupported(); + var allowedAlgorithmsForKeys = { + "ec": ["ES256", "ES384", "ES512"], + "rsa": ["RS256", "PS256", "RS384", "PS384", "RS512", "PS512"], + "rsa-pss": ["PS256", "PS384", "PS512"] + }; + var allowedCurves = { + ES256: "prime256v1", + ES384: "secp384r1", + ES512: "secp521r1" + }; + module2.exports = function(algorithm, key) { + if (!algorithm || !key) return; + const keyType = key.asymmetricKeyType; + if (!keyType) return; + const allowedAlgorithms = allowedAlgorithmsForKeys[keyType]; + if (!allowedAlgorithms) { + throw new Error(`Unknown key type "${keyType}".`); + } + if (!allowedAlgorithms.includes(algorithm)) { + throw new Error(`"alg" parameter for "${keyType}" key type must be one of: ${allowedAlgorithms.join(", ")}.`); + } + if (ASYMMETRIC_KEY_DETAILS_SUPPORTED) { + switch (keyType) { + case "ec": + const keyCurve = key.asymmetricKeyDetails.namedCurve; + const allowedCurve = allowedCurves[algorithm]; + if (keyCurve !== allowedCurve) { + throw new Error(`"alg" parameter "${algorithm}" requires curve "${allowedCurve}".`); + } + break; + case "rsa-pss": + if (RSA_PSS_KEY_DETAILS_SUPPORTED) { + const length = parseInt(algorithm.slice(-3), 10); + const { hashAlgorithm, mgf1HashAlgorithm, saltLength } = key.asymmetricKeyDetails; + if (hashAlgorithm !== `sha${length}` || mgf1HashAlgorithm !== hashAlgorithm) { + throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${algorithm}.`); + } + if (saltLength !== void 0 && saltLength > length >> 3) { + throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${algorithm}.`); + } + } + break; + } + } + }; + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/psSupported.js +var require_psSupported = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/lib/psSupported.js"(exports2, module2) { + var semver = require_semver2(); + module2.exports = semver.satisfies(process.version, "^6.12.0 || >=8.0.0"); + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/verify.js +var require_verify = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/verify.js"(exports2, module2) { + var JsonWebTokenError2 = require_JsonWebTokenError(); + var NotBeforeError2 = require_NotBeforeError(); + var TokenExpiredError2 = require_TokenExpiredError(); + var decode = require_decode(); + var timespan = require_timespan(); + var validateAsymmetricKey = require_validateAsymmetricKey(); + var PS_SUPPORTED = require_psSupported(); + var jws = require_jws(); + var { KeyObject, createSecretKey, createPublicKey } = require("crypto"); + var PUB_KEY_ALGS = ["RS256", "RS384", "RS512"]; + var EC_KEY_ALGS = ["ES256", "ES384", "ES512"]; + var RSA_KEY_ALGS = ["RS256", "RS384", "RS512"]; + var HS_ALGS = ["HS256", "HS384", "HS512"]; + if (PS_SUPPORTED) { + PUB_KEY_ALGS.splice(PUB_KEY_ALGS.length, 0, "PS256", "PS384", "PS512"); + RSA_KEY_ALGS.splice(RSA_KEY_ALGS.length, 0, "PS256", "PS384", "PS512"); + } + module2.exports = function(jwtString, secretOrPublicKey, options, callback) { + if (typeof options === "function" && !callback) { + callback = options; + options = {}; + } + if (!options) { + options = {}; + } + options = Object.assign({}, options); + let done; + if (callback) { + done = callback; + } else { + done = function(err, data) { + if (err) throw err; + return data; + }; + } + if (options.clockTimestamp && typeof options.clockTimestamp !== "number") { + return done(new JsonWebTokenError2("clockTimestamp must be a number")); + } + if (options.nonce !== void 0 && (typeof options.nonce !== "string" || options.nonce.trim() === "")) { + return done(new JsonWebTokenError2("nonce must be a non-empty string")); + } + if (options.allowInvalidAsymmetricKeyTypes !== void 0 && typeof options.allowInvalidAsymmetricKeyTypes !== "boolean") { + return done(new JsonWebTokenError2("allowInvalidAsymmetricKeyTypes must be a boolean")); + } + const clockTimestamp = options.clockTimestamp || Math.floor(Date.now() / 1e3); + if (!jwtString) { + return done(new JsonWebTokenError2("jwt must be provided")); + } + if (typeof jwtString !== "string") { + return done(new JsonWebTokenError2("jwt must be a string")); + } + const parts = jwtString.split("."); + if (parts.length !== 3) { + return done(new JsonWebTokenError2("jwt malformed")); + } + let decodedToken; + try { + decodedToken = decode(jwtString, { complete: true }); + } catch (err) { + return done(err); + } + if (!decodedToken) { + return done(new JsonWebTokenError2("invalid token")); + } + const header = decodedToken.header; + let getSecret; + if (typeof secretOrPublicKey === "function") { + if (!callback) { + return done(new JsonWebTokenError2("verify must be called asynchronous if secret or public key is provided as a callback")); + } + getSecret = secretOrPublicKey; + } else { + getSecret = function(header2, secretCallback) { + return secretCallback(null, secretOrPublicKey); + }; + } + return getSecret(header, function(err, secretOrPublicKey2) { + if (err) { + return done(new JsonWebTokenError2("error in secret or public key callback: " + err.message)); + } + const hasSignature = parts[2].trim() !== ""; + if (!hasSignature && secretOrPublicKey2) { + return done(new JsonWebTokenError2("jwt signature is required")); + } + if (hasSignature && !secretOrPublicKey2) { + return done(new JsonWebTokenError2("secret or public key must be provided")); + } + if (!hasSignature && !options.algorithms) { + return done(new JsonWebTokenError2('please specify "none" in "algorithms" to verify unsigned tokens')); + } + if (secretOrPublicKey2 != null && !(secretOrPublicKey2 instanceof KeyObject)) { + try { + secretOrPublicKey2 = createPublicKey(secretOrPublicKey2); + } catch (_) { + try { + secretOrPublicKey2 = createSecretKey(typeof secretOrPublicKey2 === "string" ? Buffer.from(secretOrPublicKey2) : secretOrPublicKey2); + } catch (_2) { + return done(new JsonWebTokenError2("secretOrPublicKey is not valid key material")); + } + } + } + if (!options.algorithms) { + if (secretOrPublicKey2.type === "secret") { + options.algorithms = HS_ALGS; + } else if (["rsa", "rsa-pss"].includes(secretOrPublicKey2.asymmetricKeyType)) { + options.algorithms = RSA_KEY_ALGS; + } else if (secretOrPublicKey2.asymmetricKeyType === "ec") { + options.algorithms = EC_KEY_ALGS; + } else { + options.algorithms = PUB_KEY_ALGS; + } + } + if (options.algorithms.indexOf(decodedToken.header.alg) === -1) { + return done(new JsonWebTokenError2("invalid algorithm")); + } + if (header.alg.startsWith("HS") && secretOrPublicKey2.type !== "secret") { + return done(new JsonWebTokenError2(`secretOrPublicKey must be a symmetric key when using ${header.alg}`)); + } else if (/^(?:RS|PS|ES)/.test(header.alg) && secretOrPublicKey2.type !== "public") { + return done(new JsonWebTokenError2(`secretOrPublicKey must be an asymmetric key when using ${header.alg}`)); + } + if (!options.allowInvalidAsymmetricKeyTypes) { + try { + validateAsymmetricKey(header.alg, secretOrPublicKey2); + } catch (e) { + return done(e); + } + } + let valid; + try { + valid = jws.verify(jwtString, decodedToken.header.alg, secretOrPublicKey2); + } catch (e) { + return done(e); + } + if (!valid) { + return done(new JsonWebTokenError2("invalid signature")); + } + const payload = decodedToken.payload; + if (typeof payload.nbf !== "undefined" && !options.ignoreNotBefore) { + if (typeof payload.nbf !== "number") { + return done(new JsonWebTokenError2("invalid nbf value")); + } + if (payload.nbf > clockTimestamp + (options.clockTolerance || 0)) { + return done(new NotBeforeError2("jwt not active", new Date(payload.nbf * 1e3))); + } + } + if (typeof payload.exp !== "undefined" && !options.ignoreExpiration) { + if (typeof payload.exp !== "number") { + return done(new JsonWebTokenError2("invalid exp value")); + } + if (clockTimestamp >= payload.exp + (options.clockTolerance || 0)) { + return done(new TokenExpiredError2("jwt expired", new Date(payload.exp * 1e3))); + } + } + if (options.audience) { + const audiences = Array.isArray(options.audience) ? options.audience : [options.audience]; + const target = Array.isArray(payload.aud) ? payload.aud : [payload.aud]; + const match = target.some(function(targetAudience) { + return audiences.some(function(audience) { + return audience instanceof RegExp ? audience.test(targetAudience) : audience === targetAudience; + }); + }); + if (!match) { + return done(new JsonWebTokenError2("jwt audience invalid. expected: " + audiences.join(" or "))); + } + } + if (options.issuer) { + const invalid_issuer = typeof options.issuer === "string" && payload.iss !== options.issuer || Array.isArray(options.issuer) && options.issuer.indexOf(payload.iss) === -1; + if (invalid_issuer) { + return done(new JsonWebTokenError2("jwt issuer invalid. expected: " + options.issuer)); + } + } + if (options.subject) { + if (payload.sub !== options.subject) { + return done(new JsonWebTokenError2("jwt subject invalid. expected: " + options.subject)); + } + } + if (options.jwtid) { + if (payload.jti !== options.jwtid) { + return done(new JsonWebTokenError2("jwt jwtid invalid. expected: " + options.jwtid)); + } + } + if (options.nonce) { + if (payload.nonce !== options.nonce) { + return done(new JsonWebTokenError2("jwt nonce invalid. expected: " + options.nonce)); + } + } + if (options.maxAge) { + if (typeof payload.iat !== "number") { + return done(new JsonWebTokenError2("iat required when maxAge is specified")); + } + const maxAgeTimestamp = timespan(options.maxAge, payload.iat); + if (typeof maxAgeTimestamp === "undefined") { + return done(new JsonWebTokenError2('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); + } + if (clockTimestamp >= maxAgeTimestamp + (options.clockTolerance || 0)) { + return done(new TokenExpiredError2("maxAge exceeded", new Date(maxAgeTimestamp * 1e3))); + } + } + if (options.complete === true) { + const signature = decodedToken.signature; + return done(null, { + header, + payload, + signature + }); + } + return done(null, payload); + }); + }; + } +}); + +// ../../node_modules/.pnpm/lodash.includes@4.3.0/node_modules/lodash.includes/index.js +var require_lodash = __commonJS({ + "../../node_modules/.pnpm/lodash.includes@4.3.0/node_modules/lodash.includes/index.js"(exports2, module2) { + var INFINITY = 1 / 0; + var MAX_SAFE_INTEGER = 9007199254740991; + var MAX_INTEGER = 17976931348623157e292; + var NAN = 0 / 0; + var argsTag = "[object Arguments]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var stringTag = "[object String]"; + var symbolTag = "[object Symbol]"; + var reTrim = /^\s+|\s+$/g; + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + var reIsBinary = /^0b[01]+$/i; + var reIsOctal = /^0o[0-7]+$/i; + var reIsUint = /^(?:0|[1-9]\d*)$/; + var freeParseInt = parseInt; + function arrayMap(array, iteratee) { + var index = -1, length = array ? array.length : 0, result = Array(length); + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, index = fromIndex + (fromRight ? 1 : -1); + while (fromRight ? index-- : ++index < length) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, length = array.length; + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + function baseIsNaN(value) { + return value !== value; + } + function baseTimes(n, iteratee) { + var index = -1, result = Array(n); + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var objectToString = objectProto.toString; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var nativeKeys = overArg(Object.keys, Object); + var nativeMax = Math.max; + function arrayLikeKeys(value, inherited) { + var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; + var length = result.length, skipIndexes = !!length; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { + result.push(key); + } + } + return result; + } + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != "constructor") { + result.push(key); + } + } + return result; + } + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + } + function isPrototype(value) { + var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; + return value === proto; + } + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; + } + function isArguments(value) { + return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); + } + var isArray = Array.isArray; + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + function isFunction(value) { + var tag = isObject(value) ? objectToString.call(value) : ""; + return tag == funcTag || tag == genTag; + } + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + function isObject(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isString(value) { + return typeof value == "string" || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = value < 0 ? -1 : 1; + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + function toInteger(value) { + var result = toFinite(value), remainder = result % 1; + return result === result ? remainder ? result - remainder : result : 0; + } + function toNumber(value) { + if (typeof value == "number") { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == "function" ? value.valueOf() : value; + value = isObject(other) ? other + "" : other; + } + if (typeof value != "string") { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ""); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + } + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + function values(object) { + return object ? baseValues(object, keys(object)) : []; + } + module2.exports = includes; + } +}); + +// ../../node_modules/.pnpm/lodash.isboolean@3.0.3/node_modules/lodash.isboolean/index.js +var require_lodash2 = __commonJS({ + "../../node_modules/.pnpm/lodash.isboolean@3.0.3/node_modules/lodash.isboolean/index.js"(exports2, module2) { + var boolTag = "[object Boolean]"; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + function isBoolean(value) { + return value === true || value === false || isObjectLike(value) && objectToString.call(value) == boolTag; + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + module2.exports = isBoolean; + } +}); + +// ../../node_modules/.pnpm/lodash.isinteger@4.0.4/node_modules/lodash.isinteger/index.js +var require_lodash3 = __commonJS({ + "../../node_modules/.pnpm/lodash.isinteger@4.0.4/node_modules/lodash.isinteger/index.js"(exports2, module2) { + var INFINITY = 1 / 0; + var MAX_INTEGER = 17976931348623157e292; + var NAN = 0 / 0; + var symbolTag = "[object Symbol]"; + var reTrim = /^\s+|\s+$/g; + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + var reIsBinary = /^0b[01]+$/i; + var reIsOctal = /^0o[0-7]+$/i; + var freeParseInt = parseInt; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + function isInteger(value) { + return typeof value == "number" && value == toInteger(value); + } + function isObject(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = value < 0 ? -1 : 1; + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + function toInteger(value) { + var result = toFinite(value), remainder = result % 1; + return result === result ? remainder ? result - remainder : result : 0; + } + function toNumber(value) { + if (typeof value == "number") { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == "function" ? value.valueOf() : value; + value = isObject(other) ? other + "" : other; + } + if (typeof value != "string") { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ""); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + } + module2.exports = isInteger; + } +}); + +// ../../node_modules/.pnpm/lodash.isnumber@3.0.3/node_modules/lodash.isnumber/index.js +var require_lodash4 = __commonJS({ + "../../node_modules/.pnpm/lodash.isnumber@3.0.3/node_modules/lodash.isnumber/index.js"(exports2, module2) { + var numberTag = "[object Number]"; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isNumber(value) { + return typeof value == "number" || isObjectLike(value) && objectToString.call(value) == numberTag; + } + module2.exports = isNumber; + } +}); + +// ../../node_modules/.pnpm/lodash.isplainobject@4.0.6/node_modules/lodash.isplainobject/index.js +var require_lodash5 = __commonJS({ + "../../node_modules/.pnpm/lodash.isplainobject@4.0.6/node_modules/lodash.isplainobject/index.js"(exports2, module2) { + var objectTag = "[object Object]"; + function isHostObject(value) { + var result = false; + if (value != null && typeof value.toString != "function") { + try { + result = !!(value + ""); + } catch (e) { + } + } + return result; + } + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + var funcProto = Function.prototype; + var objectProto = Object.prototype; + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + var objectCtorString = funcToString.call(Object); + var objectToString = objectProto.toString; + var getPrototype = overArg(Object.getPrototypeOf, Object); + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isPlainObject(value) { + if (!isObjectLike(value) || objectToString.call(value) != objectTag || isHostObject(value)) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor; + return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; + } + module2.exports = isPlainObject; + } +}); + +// ../../node_modules/.pnpm/lodash.isstring@4.0.1/node_modules/lodash.isstring/index.js +var require_lodash6 = __commonJS({ + "../../node_modules/.pnpm/lodash.isstring@4.0.1/node_modules/lodash.isstring/index.js"(exports2, module2) { + var stringTag = "[object String]"; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + var isArray = Array.isArray; + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isString(value) { + return typeof value == "string" || !isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag; + } + module2.exports = isString; + } +}); + +// ../../node_modules/.pnpm/lodash.once@4.1.1/node_modules/lodash.once/index.js +var require_lodash7 = __commonJS({ + "../../node_modules/.pnpm/lodash.once@4.1.1/node_modules/lodash.once/index.js"(exports2, module2) { + var FUNC_ERROR_TEXT = "Expected a function"; + var INFINITY = 1 / 0; + var MAX_INTEGER = 17976931348623157e292; + var NAN = 0 / 0; + var symbolTag = "[object Symbol]"; + var reTrim = /^\s+|\s+$/g; + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + var reIsBinary = /^0b[01]+$/i; + var reIsOctal = /^0o[0-7]+$/i; + var freeParseInt = parseInt; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + function before(n, func) { + var result; + if (typeof func != "function") { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = void 0; + } + return result; + }; + } + function once(func) { + return before(2, func); + } + function isObject(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = value < 0 ? -1 : 1; + return sign * MAX_INTEGER; + } + return value === value ? value : 0; + } + function toInteger(value) { + var result = toFinite(value), remainder = result % 1; + return result === result ? remainder ? result - remainder : result : 0; + } + function toNumber(value) { + if (typeof value == "number") { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = typeof value.valueOf == "function" ? value.valueOf() : value; + value = isObject(other) ? other + "" : other; + } + if (typeof value != "string") { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ""); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + } + module2.exports = once; + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/sign.js +var require_sign2 = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/sign.js"(exports2, module2) { + var timespan = require_timespan(); + var PS_SUPPORTED = require_psSupported(); + var validateAsymmetricKey = require_validateAsymmetricKey(); + var jws = require_jws(); + var includes = require_lodash(); + var isBoolean = require_lodash2(); + var isInteger = require_lodash3(); + var isNumber = require_lodash4(); + var isPlainObject = require_lodash5(); + var isString = require_lodash6(); + var once = require_lodash7(); + var { KeyObject, createSecretKey, createPrivateKey } = require("crypto"); + var SUPPORTED_ALGS = ["RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "HS256", "HS384", "HS512", "none"]; + if (PS_SUPPORTED) { + SUPPORTED_ALGS.splice(3, 0, "PS256", "PS384", "PS512"); + } + var sign_options_schema = { + expiresIn: { isValid: function(value) { + return isInteger(value) || isString(value) && value; + }, message: '"expiresIn" should be a number of seconds or string representing a timespan' }, + notBefore: { isValid: function(value) { + return isInteger(value) || isString(value) && value; + }, message: '"notBefore" should be a number of seconds or string representing a timespan' }, + audience: { isValid: function(value) { + return isString(value) || Array.isArray(value); + }, message: '"audience" must be a string or array' }, + algorithm: { isValid: includes.bind(null, SUPPORTED_ALGS), message: '"algorithm" must be a valid string enum value' }, + header: { isValid: isPlainObject, message: '"header" must be an object' }, + encoding: { isValid: isString, message: '"encoding" must be a string' }, + issuer: { isValid: isString, message: '"issuer" must be a string' }, + subject: { isValid: isString, message: '"subject" must be a string' }, + jwtid: { isValid: isString, message: '"jwtid" must be a string' }, + noTimestamp: { isValid: isBoolean, message: '"noTimestamp" must be a boolean' }, + keyid: { isValid: isString, message: '"keyid" must be a string' }, + mutatePayload: { isValid: isBoolean, message: '"mutatePayload" must be a boolean' }, + allowInsecureKeySizes: { isValid: isBoolean, message: '"allowInsecureKeySizes" must be a boolean' }, + allowInvalidAsymmetricKeyTypes: { isValid: isBoolean, message: '"allowInvalidAsymmetricKeyTypes" must be a boolean' } + }; + var registered_claims_schema = { + iat: { isValid: isNumber, message: '"iat" should be a number of seconds' }, + exp: { isValid: isNumber, message: '"exp" should be a number of seconds' }, + nbf: { isValid: isNumber, message: '"nbf" should be a number of seconds' } + }; + function validate(schema, allowUnknown, object, parameterName) { + if (!isPlainObject(object)) { + throw new Error('Expected "' + parameterName + '" to be a plain object.'); + } + Object.keys(object).forEach(function(key) { + const validator = schema[key]; + if (!validator) { + if (!allowUnknown) { + throw new Error('"' + key + '" is not allowed in "' + parameterName + '"'); + } + return; + } + if (!validator.isValid(object[key])) { + throw new Error(validator.message); + } + }); + } + function validateOptions(options) { + return validate(sign_options_schema, false, options, "options"); + } + function validatePayload(payload) { + return validate(registered_claims_schema, true, payload, "payload"); + } + var options_to_payload = { + "audience": "aud", + "issuer": "iss", + "subject": "sub", + "jwtid": "jti" + }; + var options_for_objects = [ + "expiresIn", + "notBefore", + "noTimestamp", + "audience", + "issuer", + "subject", + "jwtid" + ]; + module2.exports = function(payload, secretOrPrivateKey, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } else { + options = options || {}; + } + const isObjectPayload = typeof payload === "object" && !Buffer.isBuffer(payload); + const header = Object.assign({ + alg: options.algorithm || "HS256", + typ: isObjectPayload ? "JWT" : void 0, + kid: options.keyid + }, options.header); + function failure(err) { + if (callback) { + return callback(err); + } + throw err; + } + if (!secretOrPrivateKey && options.algorithm !== "none") { + return failure(new Error("secretOrPrivateKey must have a value")); + } + if (secretOrPrivateKey != null && !(secretOrPrivateKey instanceof KeyObject)) { + try { + secretOrPrivateKey = createPrivateKey(secretOrPrivateKey); + } catch (_) { + try { + secretOrPrivateKey = createSecretKey(typeof secretOrPrivateKey === "string" ? Buffer.from(secretOrPrivateKey) : secretOrPrivateKey); + } catch (_2) { + return failure(new Error("secretOrPrivateKey is not valid key material")); + } + } + } + if (header.alg.startsWith("HS") && secretOrPrivateKey.type !== "secret") { + return failure(new Error(`secretOrPrivateKey must be a symmetric key when using ${header.alg}`)); + } else if (/^(?:RS|PS|ES)/.test(header.alg)) { + if (secretOrPrivateKey.type !== "private") { + return failure(new Error(`secretOrPrivateKey must be an asymmetric key when using ${header.alg}`)); + } + if (!options.allowInsecureKeySizes && !header.alg.startsWith("ES") && secretOrPrivateKey.asymmetricKeyDetails !== void 0 && //KeyObject.asymmetricKeyDetails is supported in Node 15+ + secretOrPrivateKey.asymmetricKeyDetails.modulusLength < 2048) { + return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`)); + } + } + if (typeof payload === "undefined") { + return failure(new Error("payload is required")); + } else if (isObjectPayload) { + try { + validatePayload(payload); + } catch (error) { + return failure(error); + } + if (!options.mutatePayload) { + payload = Object.assign({}, payload); + } + } else { + const invalid_options = options_for_objects.filter(function(opt) { + return typeof options[opt] !== "undefined"; + }); + if (invalid_options.length > 0) { + return failure(new Error("invalid " + invalid_options.join(",") + " option for " + typeof payload + " payload")); + } + } + if (typeof payload.exp !== "undefined" && typeof options.expiresIn !== "undefined") { + return failure(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.')); + } + if (typeof payload.nbf !== "undefined" && typeof options.notBefore !== "undefined") { + return failure(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.')); + } + try { + validateOptions(options); + } catch (error) { + return failure(error); + } + if (!options.allowInvalidAsymmetricKeyTypes) { + try { + validateAsymmetricKey(header.alg, secretOrPrivateKey); + } catch (error) { + return failure(error); + } + } + const timestamp = payload.iat || Math.floor(Date.now() / 1e3); + if (options.noTimestamp) { + delete payload.iat; + } else if (isObjectPayload) { + payload.iat = timestamp; + } + if (typeof options.notBefore !== "undefined") { + try { + payload.nbf = timespan(options.notBefore, timestamp); + } catch (err) { + return failure(err); + } + if (typeof payload.nbf === "undefined") { + return failure(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); + } + } + if (typeof options.expiresIn !== "undefined" && typeof payload === "object") { + try { + payload.exp = timespan(options.expiresIn, timestamp); + } catch (err) { + return failure(err); + } + if (typeof payload.exp === "undefined") { + return failure(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60')); + } + } + Object.keys(options_to_payload).forEach(function(key) { + const claim = options_to_payload[key]; + if (typeof options[key] !== "undefined") { + if (typeof payload[claim] !== "undefined") { + return failure(new Error('Bad "options.' + key + '" option. The payload already has an "' + claim + '" property.')); + } + payload[claim] = options[key]; + } + }); + const encoding = options.encoding || "utf8"; + if (typeof callback === "function") { + callback = callback && once(callback); + jws.createSign({ + header, + privateKey: secretOrPrivateKey, + payload, + encoding + }).once("error", callback).once("done", function(signature) { + if (!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) { + return callback(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`)); + } + callback(null, signature); + }); + } else { + let signature = jws.sign({ header, payload, secret: secretOrPrivateKey, encoding }); + if (!options.allowInsecureKeySizes && /^(?:RS|PS)/.test(header.alg) && signature.length < 256) { + throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`); + } + return signature; + } + }; + } +}); + +// ../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/index.js +var require_jsonwebtoken = __commonJS({ + "../../node_modules/.pnpm/jsonwebtoken@9.0.3/node_modules/jsonwebtoken/index.js"(exports2, module2) { + module2.exports = { + decode: require_decode(), + verify: require_verify(), + sign: require_sign2(), + JsonWebTokenError: require_JsonWebTokenError(), + NotBeforeError: require_NotBeforeError(), + TokenExpiredError: require_TokenExpiredError() + }; + } +}); + +// ../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/interfaces/jwt-module-options.interface.js +var JwtSecretRequestType; +var init_jwt_module_options_interface = __esm({ + "../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/interfaces/jwt-module-options.interface.js"() { + (function(JwtSecretRequestType2) { + JwtSecretRequestType2[JwtSecretRequestType2["SIGN"] = 0] = "SIGN"; + JwtSecretRequestType2[JwtSecretRequestType2["VERIFY"] = 1] = "VERIFY"; + })(JwtSecretRequestType || (JwtSecretRequestType = {})); + } +}); + +// ../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/interfaces/index.js +var init_interfaces = __esm({ + "../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/interfaces/index.js"() { + init_jwt_module_options_interface(); + } +}); + +// ../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/jwt.errors.js +var WrongSecretProviderError; +var init_jwt_errors = __esm({ + "../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/jwt.errors.js"() { + WrongSecretProviderError = class extends Error { + }; + } +}); + +// ../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/jwt.constants.js +var JWT_MODULE_OPTIONS; +var init_jwt_constants = __esm({ + "../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/jwt.constants.js"() { + JWT_MODULE_OPTIONS = "JWT_MODULE_OPTIONS"; + } +}); + +// ../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/jwt.providers.js +function createJwtProvider(options) { + return [{ provide: JWT_MODULE_OPTIONS, useValue: options || {} }]; +} +var init_jwt_providers = __esm({ + "../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/jwt.providers.js"() { + init_jwt_constants(); + } +}); + +// ../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/jwt.service.js +var import_common, import_jsonwebtoken, __decorate2, __metadata2, __param2, JwtService; +var init_jwt_service = __esm({ + "../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/jwt.service.js"() { + import_common = __toESM(require_common(), 1); + import_jsonwebtoken = __toESM(require_jsonwebtoken(), 1); + init_interfaces(); + init_jwt_constants(); + init_jwt_errors(); + __decorate2 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + __metadata2 = function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + __param2 = function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + JwtService = class JwtService2 { + constructor(options = {}) { + this.options = options; + this.logger = new import_common.Logger("JwtService"); + } + sign(payload, options) { + const signOptions = this.mergeJwtOptions({ ...options }, "signOptions"); + const secret = this.getSecretKey(payload, options, "privateKey", JwtSecretRequestType.SIGN); + if (secret instanceof Promise) { + secret.catch(() => { + }); + this.logger.warn('For async version of "secretOrKeyProvider", please use "signAsync".'); + throw new WrongSecretProviderError(); + } + const allowedSignOptKeys = ["secret", "privateKey"]; + const signOptKeys = Object.keys(signOptions); + if (typeof payload === "string" && signOptKeys.some((k) => !allowedSignOptKeys.includes(k))) { + throw new Error("Payload as string is not allowed with the following sign options: " + signOptKeys.join(", ")); + } + return import_jsonwebtoken.default.sign(payload, secret, signOptions); + } + signAsync(payload, options) { + const signOptions = this.mergeJwtOptions({ ...options }, "signOptions"); + const secret = this.getSecretKey(payload, options, "privateKey", JwtSecretRequestType.SIGN); + const allowedSignOptKeys = ["secret", "privateKey"]; + const signOptKeys = Object.keys(signOptions); + if (typeof payload === "string" && signOptKeys.some((k) => !allowedSignOptKeys.includes(k))) { + throw new Error("Payload as string is not allowed with the following sign options: " + signOptKeys.join(", ")); + } + return new Promise((resolve, reject) => Promise.resolve().then(() => secret).then((scrt) => { + import_jsonwebtoken.default.sign(payload, scrt, signOptions, (err, encoded) => err ? reject(err) : resolve(encoded)); + })); + } + verify(token, options) { + const verifyOptions = this.mergeJwtOptions({ ...options }, "verifyOptions"); + const secret = this.getSecretKey(token, options, "publicKey", JwtSecretRequestType.VERIFY); + if (secret instanceof Promise) { + secret.catch(() => { + }); + this.logger.warn('For async version of "secretOrKeyProvider", please use "verifyAsync".'); + throw new WrongSecretProviderError(); + } + return import_jsonwebtoken.default.verify(token, secret, verifyOptions); + } + verifyAsync(token, options) { + const verifyOptions = this.mergeJwtOptions({ ...options }, "verifyOptions"); + const secret = this.getSecretKey(token, options, "publicKey", JwtSecretRequestType.VERIFY); + return new Promise((resolve, reject) => Promise.resolve().then(() => secret).then((scrt) => { + import_jsonwebtoken.default.verify(token, scrt, verifyOptions, (err, decoded) => err ? reject(err) : resolve(decoded)); + }).catch(reject)); + } + decode(token, options) { + return import_jsonwebtoken.default.decode(token, options); + } + mergeJwtOptions(options, key) { + delete options.secret; + if (key === "signOptions") { + delete options.privateKey; + } else { + delete options.publicKey; + } + return options ? { ...this.options[key] || {}, ...options } : this.options[key]; + } + overrideSecretFromOptions(secret) { + if (this.options.secretOrPrivateKey) { + this.logger.warn(`"secretOrPrivateKey" has been deprecated, please use the new explicit "secret" or use "secretOrKeyProvider" or "privateKey"/"publicKey" exclusively.`); + secret = this.options.secretOrPrivateKey; + } + return secret; + } + getSecretKey(token, options, key, secretRequestType) { + const secret = this.options.secretOrKeyProvider ? this.options.secretOrKeyProvider(secretRequestType, token, options) : options?.secret || this.options.secret || (key === "privateKey" ? options?.privateKey || this.options.privateKey : options?.publicKey || this.options.publicKey) || this.options[key]; + return secret instanceof Promise ? secret.then((sec) => this.overrideSecretFromOptions(sec)) : this.overrideSecretFromOptions(secret); + } + }; + JwtService = __decorate2([ + (0, import_common.Injectable)(), + __param2(0, (0, import_common.Optional)()), + __param2(0, (0, import_common.Inject)(JWT_MODULE_OPTIONS)), + __metadata2("design:paramtypes", [Object]) + ], JwtService); + } +}); + +// ../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/jwt.module.js +var import_common2, __decorate3, JwtModule_1, JwtModule; +var init_jwt_module = __esm({ + "../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/jwt.module.js"() { + import_common2 = __toESM(require_common(), 1); + init_jwt_constants(); + init_jwt_providers(); + init_jwt_service(); + __decorate3 = function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + JwtModule = JwtModule_1 = class JwtModule2 { + static register(options) { + return { + module: JwtModule_1, + global: options.global, + providers: createJwtProvider(options) + }; + } + static registerAsync(options) { + return { + module: JwtModule_1, + global: options.global, + imports: options.imports || [], + providers: [ + ...this.createAsyncProviders(options), + ...options.extraProviders ?? [] + ] + }; + } + static createAsyncProviders(options) { + if (options.useExisting || options.useFactory) { + return [this.createAsyncOptionsProvider(options)]; + } + return [ + this.createAsyncOptionsProvider(options), + { + provide: options.useClass, + useClass: options.useClass + } + ]; + } + static createAsyncOptionsProvider(options) { + if (options.useFactory) { + return { + provide: JWT_MODULE_OPTIONS, + useFactory: options.useFactory, + inject: options.inject || [] + }; + } + return { + provide: JWT_MODULE_OPTIONS, + useFactory: async (optionsFactory) => await optionsFactory.createJwtOptions(), + inject: [options.useExisting || options.useClass] + }; + } + }; + JwtModule = JwtModule_1 = __decorate3([ + (0, import_common2.Module)({ + providers: [JwtService], + exports: [JwtService] + }) + ], JwtModule); + } +}); + +// ../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/index.js +var dist_exports = {}; +__export(dist_exports, { + JsonWebTokenError: () => JsonWebTokenError, + JwtModule: () => JwtModule, + JwtSecretRequestType: () => JwtSecretRequestType, + JwtService: () => JwtService, + NotBeforeError: () => NotBeforeError, + TokenExpiredError: () => TokenExpiredError, + WrongSecretProviderError: () => WrongSecretProviderError +}); +var import_jsonwebtoken2, TokenExpiredError, NotBeforeError, JsonWebTokenError; +var init_dist = __esm({ + "../../node_modules/.pnpm/@nestjs+jwt@12.0.1_@nestjs+common@10.4.22_class-transformer@0.5.1_class-validator@0.14.4_refl_zbpccjiygvsshg6zwdywiadlwy/node_modules/@nestjs/jwt/dist/index.js"() { + import_jsonwebtoken2 = __toESM(require_jsonwebtoken(), 1); + init_interfaces(); + init_jwt_errors(); + init_jwt_module(); + init_jwt_service(); + TokenExpiredError = import_jsonwebtoken2.default.TokenExpiredError; + NotBeforeError = import_jsonwebtoken2.default.NotBeforeError; + JsonWebTokenError = import_jsonwebtoken2.default.JsonWebTokenError; + } +}); + +// ../../node_modules/.pnpm/bcryptjs@3.0.3/node_modules/bcryptjs/umd/index.js +var require_umd = __commonJS({ + "../../node_modules/.pnpm/bcryptjs@3.0.3/node_modules/bcryptjs/umd/index.js"(exports2, module2) { + (function(global2, factory) { + function preferDefault(exports3) { + return exports3.default || exports3; + } + if (typeof define === "function" && define.amd) { + define(["crypto"], function(_crypto) { + var exports3 = {}; + factory(exports3, _crypto); + return preferDefault(exports3); + }); + } else if (typeof exports2 === "object") { + factory(exports2, require("crypto")); + if (typeof module2 === "object") module2.exports = preferDefault(exports2); + } else { + (function() { + var exports3 = {}; + factory(exports3, global2.crypto); + global2.bcrypt = preferDefault(exports3); + })(); + } + })( + typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : exports2, + function(_exports, _crypto) { + "use strict"; + Object.defineProperty(_exports, "__esModule", { + value: true + }); + _exports.compare = compare; + _exports.compareSync = compareSync; + _exports.decodeBase64 = decodeBase64; + _exports.default = void 0; + _exports.encodeBase64 = encodeBase64; + _exports.genSalt = genSalt; + _exports.genSaltSync = genSaltSync; + _exports.getRounds = getRounds; + _exports.getSalt = getSalt; + _exports.hash = hash; + _exports.hashSync = hashSync; + _exports.setRandomFallback = setRandomFallback; + _exports.truncates = truncates; + _crypto = _interopRequireDefault(_crypto); + function _interopRequireDefault(e) { + return e && e.__esModule ? e : { default: e }; + } + var randomFallback = null; + function randomBytes(len) { + try { + return crypto.getRandomValues(new Uint8Array(len)); + } catch { + } + try { + return _crypto.default.randomBytes(len); + } catch { + } + if (!randomFallback) { + throw Error( + "Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative" + ); + } + return randomFallback(len); + } + function setRandomFallback(random) { + randomFallback = random; + } + function genSaltSync(rounds, seed_length) { + rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS; + if (typeof rounds !== "number") + throw Error( + "Illegal arguments: " + typeof rounds + ", " + typeof seed_length + ); + if (rounds < 4) rounds = 4; + else if (rounds > 31) rounds = 31; + var salt = []; + salt.push("$2b$"); + if (rounds < 10) salt.push("0"); + salt.push(rounds.toString()); + salt.push("$"); + salt.push(base64_encode(randomBytes(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); + return salt.join(""); + } + function genSalt(rounds, seed_length, callback) { + if (typeof seed_length === "function") + callback = seed_length, seed_length = void 0; + if (typeof rounds === "function") + callback = rounds, rounds = void 0; + if (typeof rounds === "undefined") rounds = GENSALT_DEFAULT_LOG2_ROUNDS; + else if (typeof rounds !== "number") + throw Error("illegal arguments: " + typeof rounds); + function _async(callback2) { + nextTick(function() { + try { + callback2(null, genSaltSync(rounds)); + } catch (err) { + callback2(err); + } + }); + } + if (callback) { + if (typeof callback !== "function") + throw Error("Illegal callback: " + typeof callback); + _async(callback); + } else + return new Promise(function(resolve, reject) { + _async(function(err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); + } + function hashSync(password, salt) { + if (typeof salt === "undefined") salt = GENSALT_DEFAULT_LOG2_ROUNDS; + if (typeof salt === "number") salt = genSaltSync(salt); + if (typeof password !== "string" || typeof salt !== "string") + throw Error( + "Illegal arguments: " + typeof password + ", " + typeof salt + ); + return _hash(password, salt); + } + function hash(password, salt, callback, progressCallback) { + function _async(callback2) { + if (typeof password === "string" && typeof salt === "number") + genSalt(salt, function(err, salt2) { + _hash(password, salt2, callback2, progressCallback); + }); + else if (typeof password === "string" && typeof salt === "string") + _hash(password, salt, callback2, progressCallback); + else + nextTick( + callback2.bind( + this, + Error( + "Illegal arguments: " + typeof password + ", " + typeof salt + ) + ) + ); + } + if (callback) { + if (typeof callback !== "function") + throw Error("Illegal callback: " + typeof callback); + _async(callback); + } else + return new Promise(function(resolve, reject) { + _async(function(err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); + } + function safeStringCompare(known, unknown) { + var diff = known.length ^ unknown.length; + for (var i = 0; i < known.length; ++i) { + diff |= known.charCodeAt(i) ^ unknown.charCodeAt(i); + } + return diff === 0; + } + function compareSync(password, hash2) { + if (typeof password !== "string" || typeof hash2 !== "string") + throw Error( + "Illegal arguments: " + typeof password + ", " + typeof hash2 + ); + if (hash2.length !== 60) return false; + return safeStringCompare( + hashSync(password, hash2.substring(0, hash2.length - 31)), + hash2 + ); + } + function compare(password, hashValue, callback, progressCallback) { + function _async(callback2) { + if (typeof password !== "string" || typeof hashValue !== "string") { + nextTick( + callback2.bind( + this, + Error( + "Illegal arguments: " + typeof password + ", " + typeof hashValue + ) + ) + ); + return; + } + if (hashValue.length !== 60) { + nextTick(callback2.bind(this, null, false)); + return; + } + hash( + password, + hashValue.substring(0, 29), + function(err, comp) { + if (err) callback2(err); + else callback2(null, safeStringCompare(comp, hashValue)); + }, + progressCallback + ); + } + if (callback) { + if (typeof callback !== "function") + throw Error("Illegal callback: " + typeof callback); + _async(callback); + } else + return new Promise(function(resolve, reject) { + _async(function(err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); + } + function getRounds(hash2) { + if (typeof hash2 !== "string") + throw Error("Illegal arguments: " + typeof hash2); + return parseInt(hash2.split("$")[2], 10); + } + function getSalt(hash2) { + if (typeof hash2 !== "string") + throw Error("Illegal arguments: " + typeof hash2); + if (hash2.length !== 60) + throw Error("Illegal hash length: " + hash2.length + " != 60"); + return hash2.substring(0, 29); + } + function truncates(password) { + if (typeof password !== "string") + throw Error("Illegal arguments: " + typeof password); + return utf8Length(password) > 72; + } + var nextTick = typeof setImmediate === "function" ? setImmediate : typeof scheduler === "object" && typeof scheduler.postTask === "function" ? scheduler.postTask.bind(scheduler) : setTimeout; + function utf8Length(string) { + var len = 0, c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ((c & 64512) === 55296 && (string.charCodeAt(i + 1) & 64512) === 56320) { + ++i; + len += 4; + } else len += 3; + } + return len; + } + function utf8Array(string) { + var offset = 0, c1, c2; + var buffer = new Array(utf8Length(string)); + for (var i = 0, k = string.length; i < k; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 64512) === 55296 && ((c2 = string.charCodeAt(i + 1)) & 64512) === 56320) { + c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return buffer; + } + var BASE64_CODE = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split( + "" + ); + var BASE64_INDEX = [ + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 0, + 1, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + -1, + -1, + -1, + -1, + -1, + -1, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + -1, + -1, + -1, + -1, + -1 + ]; + function base64_encode(b, len) { + var off = 0, rs = [], c1, c2; + if (len <= 0 || len > b.length) throw Error("Illegal len: " + len); + while (off < len) { + c1 = b[off++] & 255; + rs.push(BASE64_CODE[c1 >> 2 & 63]); + c1 = (c1 & 3) << 4; + if (off >= len) { + rs.push(BASE64_CODE[c1 & 63]); + break; + } + c2 = b[off++] & 255; + c1 |= c2 >> 4 & 15; + rs.push(BASE64_CODE[c1 & 63]); + c1 = (c2 & 15) << 2; + if (off >= len) { + rs.push(BASE64_CODE[c1 & 63]); + break; + } + c2 = b[off++] & 255; + c1 |= c2 >> 6 & 3; + rs.push(BASE64_CODE[c1 & 63]); + rs.push(BASE64_CODE[c2 & 63]); + } + return rs.join(""); + } + function base64_decode(s, len) { + var off = 0, slen = s.length, olen = 0, rs = [], c1, c2, c3, c4, o, code; + if (len <= 0) throw Error("Illegal len: " + len); + while (off < slen - 1 && olen < len) { + code = s.charCodeAt(off++); + c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + code = s.charCodeAt(off++); + c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + if (c1 == -1 || c2 == -1) break; + o = c1 << 2 >>> 0; + o |= (c2 & 48) >> 4; + rs.push(String.fromCharCode(o)); + if (++olen >= len || off >= slen) break; + code = s.charCodeAt(off++); + c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + if (c3 == -1) break; + o = (c2 & 15) << 4 >>> 0; + o |= (c3 & 60) >> 2; + rs.push(String.fromCharCode(o)); + if (++olen >= len || off >= slen) break; + code = s.charCodeAt(off++); + c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + o = (c3 & 3) << 6 >>> 0; + o |= c4; + rs.push(String.fromCharCode(o)); + ++olen; + } + var res = []; + for (off = 0; off < olen; off++) res.push(rs[off].charCodeAt(0)); + return res; + } + var BCRYPT_SALT_LEN = 16; + var GENSALT_DEFAULT_LOG2_ROUNDS = 10; + var BLOWFISH_NUM_ROUNDS = 16; + var MAX_EXECUTION_TIME = 100; + var P_ORIG = [ + 608135816, + 2242054355, + 320440878, + 57701188, + 2752067618, + 698298832, + 137296536, + 3964562569, + 1160258022, + 953160567, + 3193202383, + 887688300, + 3232508343, + 3380367581, + 1065670069, + 3041331479, + 2450970073, + 2306472731 + ]; + var S_ORIG = [ + 3509652390, + 2564797868, + 805139163, + 3491422135, + 3101798381, + 1780907670, + 3128725573, + 4046225305, + 614570311, + 3012652279, + 134345442, + 2240740374, + 1667834072, + 1901547113, + 2757295779, + 4103290238, + 227898511, + 1921955416, + 1904987480, + 2182433518, + 2069144605, + 3260701109, + 2620446009, + 720527379, + 3318853667, + 677414384, + 3393288472, + 3101374703, + 2390351024, + 1614419982, + 1822297739, + 2954791486, + 3608508353, + 3174124327, + 2024746970, + 1432378464, + 3864339955, + 2857741204, + 1464375394, + 1676153920, + 1439316330, + 715854006, + 3033291828, + 289532110, + 2706671279, + 2087905683, + 3018724369, + 1668267050, + 732546397, + 1947742710, + 3462151702, + 2609353502, + 2950085171, + 1814351708, + 2050118529, + 680887927, + 999245976, + 1800124847, + 3300911131, + 1713906067, + 1641548236, + 4213287313, + 1216130144, + 1575780402, + 4018429277, + 3917837745, + 3693486850, + 3949271944, + 596196993, + 3549867205, + 258830323, + 2213823033, + 772490370, + 2760122372, + 1774776394, + 2652871518, + 566650946, + 4142492826, + 1728879713, + 2882767088, + 1783734482, + 3629395816, + 2517608232, + 2874225571, + 1861159788, + 326777828, + 3124490320, + 2130389656, + 2716951837, + 967770486, + 1724537150, + 2185432712, + 2364442137, + 1164943284, + 2105845187, + 998989502, + 3765401048, + 2244026483, + 1075463327, + 1455516326, + 1322494562, + 910128902, + 469688178, + 1117454909, + 936433444, + 3490320968, + 3675253459, + 1240580251, + 122909385, + 2157517691, + 634681816, + 4142456567, + 3825094682, + 3061402683, + 2540495037, + 79693498, + 3249098678, + 1084186820, + 1583128258, + 426386531, + 1761308591, + 1047286709, + 322548459, + 995290223, + 1845252383, + 2603652396, + 3431023940, + 2942221577, + 3202600964, + 3727903485, + 1712269319, + 422464435, + 3234572375, + 1170764815, + 3523960633, + 3117677531, + 1434042557, + 442511882, + 3600875718, + 1076654713, + 1738483198, + 4213154764, + 2393238008, + 3677496056, + 1014306527, + 4251020053, + 793779912, + 2902807211, + 842905082, + 4246964064, + 1395751752, + 1040244610, + 2656851899, + 3396308128, + 445077038, + 3742853595, + 3577915638, + 679411651, + 2892444358, + 2354009459, + 1767581616, + 3150600392, + 3791627101, + 3102740896, + 284835224, + 4246832056, + 1258075500, + 768725851, + 2589189241, + 3069724005, + 3532540348, + 1274779536, + 3789419226, + 2764799539, + 1660621633, + 3471099624, + 4011903706, + 913787905, + 3497959166, + 737222580, + 2514213453, + 2928710040, + 3937242737, + 1804850592, + 3499020752, + 2949064160, + 2386320175, + 2390070455, + 2415321851, + 4061277028, + 2290661394, + 2416832540, + 1336762016, + 1754252060, + 3520065937, + 3014181293, + 791618072, + 3188594551, + 3933548030, + 2332172193, + 3852520463, + 3043980520, + 413987798, + 3465142937, + 3030929376, + 4245938359, + 2093235073, + 3534596313, + 375366246, + 2157278981, + 2479649556, + 555357303, + 3870105701, + 2008414854, + 3344188149, + 4221384143, + 3956125452, + 2067696032, + 3594591187, + 2921233993, + 2428461, + 544322398, + 577241275, + 1471733935, + 610547355, + 4027169054, + 1432588573, + 1507829418, + 2025931657, + 3646575487, + 545086370, + 48609733, + 2200306550, + 1653985193, + 298326376, + 1316178497, + 3007786442, + 2064951626, + 458293330, + 2589141269, + 3591329599, + 3164325604, + 727753846, + 2179363840, + 146436021, + 1461446943, + 4069977195, + 705550613, + 3059967265, + 3887724982, + 4281599278, + 3313849956, + 1404054877, + 2845806497, + 146425753, + 1854211946, + 1266315497, + 3048417604, + 3681880366, + 3289982499, + 290971e4, + 1235738493, + 2632868024, + 2414719590, + 3970600049, + 1771706367, + 1449415276, + 3266420449, + 422970021, + 1963543593, + 2690192192, + 3826793022, + 1062508698, + 1531092325, + 1804592342, + 2583117782, + 2714934279, + 4024971509, + 1294809318, + 4028980673, + 1289560198, + 2221992742, + 1669523910, + 35572830, + 157838143, + 1052438473, + 1016535060, + 1802137761, + 1753167236, + 1386275462, + 3080475397, + 2857371447, + 1040679964, + 2145300060, + 2390574316, + 1461121720, + 2956646967, + 4031777805, + 4028374788, + 33600511, + 2920084762, + 1018524850, + 629373528, + 3691585981, + 3515945977, + 2091462646, + 2486323059, + 586499841, + 988145025, + 935516892, + 3367335476, + 2599673255, + 2839830854, + 265290510, + 3972581182, + 2759138881, + 3795373465, + 1005194799, + 847297441, + 406762289, + 1314163512, + 1332590856, + 1866599683, + 4127851711, + 750260880, + 613907577, + 1450815602, + 3165620655, + 3734664991, + 3650291728, + 3012275730, + 3704569646, + 1427272223, + 778793252, + 1343938022, + 2676280711, + 2052605720, + 1946737175, + 3164576444, + 3914038668, + 3967478842, + 3682934266, + 1661551462, + 3294938066, + 4011595847, + 840292616, + 3712170807, + 616741398, + 312560963, + 711312465, + 1351876610, + 322626781, + 1910503582, + 271666773, + 2175563734, + 1594956187, + 70604529, + 3617834859, + 1007753275, + 1495573769, + 4069517037, + 2549218298, + 2663038764, + 504708206, + 2263041392, + 3941167025, + 2249088522, + 1514023603, + 1998579484, + 1312622330, + 694541497, + 2582060303, + 2151582166, + 1382467621, + 776784248, + 2618340202, + 3323268794, + 2497899128, + 2784771155, + 503983604, + 4076293799, + 907881277, + 423175695, + 432175456, + 1378068232, + 4145222326, + 3954048622, + 3938656102, + 3820766613, + 2793130115, + 2977904593, + 26017576, + 3274890735, + 3194772133, + 1700274565, + 1756076034, + 4006520079, + 3677328699, + 720338349, + 1533947780, + 354530856, + 688349552, + 3973924725, + 1637815568, + 332179504, + 3949051286, + 53804574, + 2852348879, + 3044236432, + 1282449977, + 3583942155, + 3416972820, + 4006381244, + 1617046695, + 2628476075, + 3002303598, + 1686838959, + 431878346, + 2686675385, + 1700445008, + 1080580658, + 1009431731, + 832498133, + 3223435511, + 2605976345, + 2271191193, + 2516031870, + 1648197032, + 4164389018, + 2548247927, + 300782431, + 375919233, + 238389289, + 3353747414, + 2531188641, + 2019080857, + 1475708069, + 455242339, + 2609103871, + 448939670, + 3451063019, + 1395535956, + 2413381860, + 1841049896, + 1491858159, + 885456874, + 4264095073, + 4001119347, + 1565136089, + 3898914787, + 1108368660, + 540939232, + 1173283510, + 2745871338, + 3681308437, + 4207628240, + 3343053890, + 4016749493, + 1699691293, + 1103962373, + 3625875870, + 2256883143, + 3830138730, + 1031889488, + 3479347698, + 1535977030, + 4236805024, + 3251091107, + 2132092099, + 1774941330, + 1199868427, + 1452454533, + 157007616, + 2904115357, + 342012276, + 595725824, + 1480756522, + 206960106, + 497939518, + 591360097, + 863170706, + 2375253569, + 3596610801, + 1814182875, + 2094937945, + 3421402208, + 1082520231, + 3463918190, + 2785509508, + 435703966, + 3908032597, + 1641649973, + 2842273706, + 3305899714, + 1510255612, + 2148256476, + 2655287854, + 3276092548, + 4258621189, + 236887753, + 3681803219, + 274041037, + 1734335097, + 3815195456, + 3317970021, + 1899903192, + 1026095262, + 4050517792, + 356393447, + 2410691914, + 3873677099, + 3682840055, + 3913112168, + 2491498743, + 4132185628, + 2489919796, + 1091903735, + 1979897079, + 3170134830, + 3567386728, + 3557303409, + 857797738, + 1136121015, + 1342202287, + 507115054, + 2535736646, + 337727348, + 3213592640, + 1301675037, + 2528481711, + 1895095763, + 1721773893, + 3216771564, + 62756741, + 2142006736, + 835421444, + 2531993523, + 1442658625, + 3659876326, + 2882144922, + 676362277, + 1392781812, + 170690266, + 3921047035, + 1759253602, + 3611846912, + 1745797284, + 664899054, + 1329594018, + 3901205900, + 3045908486, + 2062866102, + 2865634940, + 3543621612, + 3464012697, + 1080764994, + 553557557, + 3656615353, + 3996768171, + 991055499, + 499776247, + 1265440854, + 648242737, + 3940784050, + 980351604, + 3713745714, + 1749149687, + 3396870395, + 4211799374, + 3640570775, + 1161844396, + 3125318951, + 1431517754, + 545492359, + 4268468663, + 3499529547, + 1437099964, + 2702547544, + 3433638243, + 2581715763, + 2787789398, + 1060185593, + 1593081372, + 2418618748, + 4260947970, + 69676912, + 2159744348, + 86519011, + 2512459080, + 3838209314, + 1220612927, + 3339683548, + 133810670, + 1090789135, + 1078426020, + 1569222167, + 845107691, + 3583754449, + 4072456591, + 1091646820, + 628848692, + 1613405280, + 3757631651, + 526609435, + 236106946, + 48312990, + 2942717905, + 3402727701, + 1797494240, + 859738849, + 992217954, + 4005476642, + 2243076622, + 3870952857, + 3732016268, + 765654824, + 3490871365, + 2511836413, + 1685915746, + 3888969200, + 1414112111, + 2273134842, + 3281911079, + 4080962846, + 172450625, + 2569994100, + 980381355, + 4109958455, + 2819808352, + 2716589560, + 2568741196, + 3681446669, + 3329971472, + 1835478071, + 660984891, + 3704678404, + 4045999559, + 3422617507, + 3040415634, + 1762651403, + 1719377915, + 3470491036, + 2693910283, + 3642056355, + 3138596744, + 1364962596, + 2073328063, + 1983633131, + 926494387, + 3423689081, + 2150032023, + 4096667949, + 1749200295, + 3328846651, + 309677260, + 2016342300, + 1779581495, + 3079819751, + 111262694, + 1274766160, + 443224088, + 298511866, + 1025883608, + 3806446537, + 1145181785, + 168956806, + 3641502830, + 3584813610, + 1689216846, + 3666258015, + 3200248200, + 1692713982, + 2646376535, + 4042768518, + 1618508792, + 1610833997, + 3523052358, + 4130873264, + 2001055236, + 3610705100, + 2202168115, + 4028541809, + 2961195399, + 1006657119, + 2006996926, + 3186142756, + 1430667929, + 3210227297, + 1314452623, + 4074634658, + 4101304120, + 2273951170, + 1399257539, + 3367210612, + 3027628629, + 1190975929, + 2062231137, + 2333990788, + 2221543033, + 2438960610, + 1181637006, + 548689776, + 2362791313, + 3372408396, + 3104550113, + 3145860560, + 296247880, + 1970579870, + 3078560182, + 3769228297, + 1714227617, + 3291629107, + 3898220290, + 166772364, + 1251581989, + 493813264, + 448347421, + 195405023, + 2709975567, + 677966185, + 3703036547, + 1463355134, + 2715995803, + 1338867538, + 1343315457, + 2802222074, + 2684532164, + 233230375, + 2599980071, + 2000651841, + 3277868038, + 1638401717, + 4028070440, + 3237316320, + 6314154, + 819756386, + 300326615, + 590932579, + 1405279636, + 3267499572, + 3150704214, + 2428286686, + 3959192993, + 3461946742, + 1862657033, + 1266418056, + 963775037, + 2089974820, + 2263052895, + 1917689273, + 448879540, + 3550394620, + 3981727096, + 150775221, + 3627908307, + 1303187396, + 508620638, + 2975983352, + 2726630617, + 1817252668, + 1876281319, + 1457606340, + 908771278, + 3720792119, + 3617206836, + 2455994898, + 1729034894, + 1080033504, + 976866871, + 3556439503, + 2881648439, + 1522871579, + 1555064734, + 1336096578, + 3548522304, + 2579274686, + 3574697629, + 3205460757, + 3593280638, + 3338716283, + 3079412587, + 564236357, + 2993598910, + 1781952180, + 1464380207, + 3163844217, + 3332601554, + 1699332808, + 1393555694, + 1183702653, + 3581086237, + 1288719814, + 691649499, + 2847557200, + 2895455976, + 3193889540, + 2717570544, + 1781354906, + 1676643554, + 2592534050, + 3230253752, + 1126444790, + 2770207658, + 2633158820, + 2210423226, + 2615765581, + 2414155088, + 3127139286, + 673620729, + 2805611233, + 1269405062, + 4015350505, + 3341807571, + 4149409754, + 1057255273, + 2012875353, + 2162469141, + 2276492801, + 2601117357, + 993977747, + 3918593370, + 2654263191, + 753973209, + 36408145, + 2530585658, + 25011837, + 3520020182, + 2088578344, + 530523599, + 2918365339, + 1524020338, + 1518925132, + 3760827505, + 3759777254, + 1202760957, + 3985898139, + 3906192525, + 674977740, + 4174734889, + 2031300136, + 2019492241, + 3983892565, + 4153806404, + 3822280332, + 352677332, + 2297720250, + 60907813, + 90501309, + 3286998549, + 1016092578, + 2535922412, + 2839152426, + 457141659, + 509813237, + 4120667899, + 652014361, + 1966332200, + 2975202805, + 55981186, + 2327461051, + 676427537, + 3255491064, + 2882294119, + 3433927263, + 1307055953, + 942726286, + 933058658, + 2468411793, + 3933900994, + 4215176142, + 1361170020, + 2001714738, + 2830558078, + 3274259782, + 1222529897, + 1679025792, + 2729314320, + 3714953764, + 1770335741, + 151462246, + 3013232138, + 1682292957, + 1483529935, + 471910574, + 1539241949, + 458788160, + 3436315007, + 1807016891, + 3718408830, + 978976581, + 1043663428, + 3165965781, + 1927990952, + 4200891579, + 2372276910, + 3208408903, + 3533431907, + 1412390302, + 2931980059, + 4132332400, + 1947078029, + 3881505623, + 4168226417, + 2941484381, + 1077988104, + 1320477388, + 886195818, + 18198404, + 3786409e3, + 2509781533, + 112762804, + 3463356488, + 1866414978, + 891333506, + 18488651, + 661792760, + 1628790961, + 3885187036, + 3141171499, + 876946877, + 2693282273, + 1372485963, + 791857591, + 2686433993, + 3759982718, + 3167212022, + 3472953795, + 2716379847, + 445679433, + 3561995674, + 3504004811, + 3574258232, + 54117162, + 3331405415, + 2381918588, + 3769707343, + 4154350007, + 1140177722, + 4074052095, + 668550556, + 3214352940, + 367459370, + 261225585, + 2610173221, + 4209349473, + 3468074219, + 3265815641, + 314222801, + 3066103646, + 3808782860, + 282218597, + 3406013506, + 3773591054, + 379116347, + 1285071038, + 846784868, + 2669647154, + 3771962079, + 3550491691, + 2305946142, + 453669953, + 1268987020, + 3317592352, + 3279303384, + 3744833421, + 2610507566, + 3859509063, + 266596637, + 3847019092, + 517658769, + 3462560207, + 3443424879, + 370717030, + 4247526661, + 2224018117, + 4143653529, + 4112773975, + 2788324899, + 2477274417, + 1456262402, + 2901442914, + 1517677493, + 1846949527, + 2295493580, + 3734397586, + 2176403920, + 1280348187, + 1908823572, + 3871786941, + 846861322, + 1172426758, + 3287448474, + 3383383037, + 1655181056, + 3139813346, + 901632758, + 1897031941, + 2986607138, + 3066810236, + 3447102507, + 1393639104, + 373351379, + 950779232, + 625454576, + 3124240540, + 4148612726, + 2007998917, + 544563296, + 2244738638, + 2330496472, + 2058025392, + 1291430526, + 424198748, + 50039436, + 29584100, + 3605783033, + 2429876329, + 2791104160, + 1057563949, + 3255363231, + 3075367218, + 3463963227, + 1469046755, + 985887462 + ]; + var C_ORIG = [ + 1332899944, + 1700884034, + 1701343084, + 1684370003, + 1668446532, + 1869963892 + ]; + function _encipher(lr, off, P, S) { + var n, l = lr[off], r = lr[off + 1]; + l ^= P[0]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[1]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[2]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[3]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[4]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[5]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[6]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[7]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[8]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[9]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[10]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[11]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[12]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[13]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[14]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[15]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[16]; + lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; + lr[off + 1] = l; + return lr; + } + function _streamtoword(data, offp) { + for (var i = 0, word = 0; i < 4; ++i) + word = word << 8 | data[offp] & 255, offp = (offp + 1) % data.length; + return { + key: word, + offp + }; + } + function _key(key, P, S) { + var offset = 0, lr = [0, 0], plen = P.length, slen = S.length, sw; + for (var i = 0; i < plen; i++) + sw = _streamtoword(key, offset), offset = sw.offp, P[i] = P[i] ^ sw.key; + for (i = 0; i < plen; i += 2) + lr = _encipher(lr, 0, P, S), P[i] = lr[0], P[i + 1] = lr[1]; + for (i = 0; i < slen; i += 2) + lr = _encipher(lr, 0, P, S), S[i] = lr[0], S[i + 1] = lr[1]; + } + function _ekskey(data, key, P, S) { + var offp = 0, lr = [0, 0], plen = P.length, slen = S.length, sw; + for (var i = 0; i < plen; i++) + sw = _streamtoword(key, offp), offp = sw.offp, P[i] = P[i] ^ sw.key; + offp = 0; + for (i = 0; i < plen; i += 2) + sw = _streamtoword(data, offp), offp = sw.offp, lr[0] ^= sw.key, sw = _streamtoword(data, offp), offp = sw.offp, lr[1] ^= sw.key, lr = _encipher(lr, 0, P, S), P[i] = lr[0], P[i + 1] = lr[1]; + for (i = 0; i < slen; i += 2) + sw = _streamtoword(data, offp), offp = sw.offp, lr[0] ^= sw.key, sw = _streamtoword(data, offp), offp = sw.offp, lr[1] ^= sw.key, lr = _encipher(lr, 0, P, S), S[i] = lr[0], S[i + 1] = lr[1]; + } + function _crypt(b, salt, rounds, callback, progressCallback) { + var cdata = C_ORIG.slice(), clen = cdata.length, err; + if (rounds < 4 || rounds > 31) { + err = Error("Illegal number of rounds (4-31): " + rounds); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + if (salt.length !== BCRYPT_SALT_LEN) { + err = Error( + "Illegal salt length: " + salt.length + " != " + BCRYPT_SALT_LEN + ); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + rounds = 1 << rounds >>> 0; + var P, S, i = 0, j; + if (typeof Int32Array === "function") { + P = new Int32Array(P_ORIG); + S = new Int32Array(S_ORIG); + } else { + P = P_ORIG.slice(); + S = S_ORIG.slice(); + } + _ekskey(salt, b, P, S); + function next() { + if (progressCallback) progressCallback(i / rounds); + if (i < rounds) { + var start = Date.now(); + for (; i < rounds; ) { + i = i + 1; + _key(b, P, S); + _key(salt, P, S); + if (Date.now() - start > MAX_EXECUTION_TIME) break; + } + } else { + for (i = 0; i < 64; i++) + for (j = 0; j < clen >> 1; j++) _encipher(cdata, j << 1, P, S); + var ret = []; + for (i = 0; i < clen; i++) + ret.push((cdata[i] >> 24 & 255) >>> 0), ret.push((cdata[i] >> 16 & 255) >>> 0), ret.push((cdata[i] >> 8 & 255) >>> 0), ret.push((cdata[i] & 255) >>> 0); + if (callback) { + callback(null, ret); + return; + } else return ret; + } + if (callback) nextTick(next); + } + if (typeof callback !== "undefined") { + next(); + } else { + var res; + while (true) + if (typeof (res = next()) !== "undefined") return res || []; + } + } + function _hash(password, salt, callback, progressCallback) { + var err; + if (typeof password !== "string" || typeof salt !== "string") { + err = Error("Invalid string / salt: Not a string"); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + var minor, offset; + if (salt.charAt(0) !== "$" || salt.charAt(1) !== "2") { + err = Error("Invalid salt version: " + salt.substring(0, 2)); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + if (salt.charAt(2) === "$") + minor = String.fromCharCode(0), offset = 3; + else { + minor = salt.charAt(2); + if (minor !== "a" && minor !== "b" && minor !== "y" || salt.charAt(3) !== "$") { + err = Error("Invalid salt revision: " + salt.substring(2, 4)); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + offset = 4; + } + if (salt.charAt(offset + 2) > "$") { + err = Error("Missing salt rounds"); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), rounds = r1 + r2, real_salt = salt.substring(offset + 3, offset + 25); + password += minor >= "a" ? "\0" : ""; + var passwordb = utf8Array(password), saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); + function finish(bytes) { + var res = []; + res.push("$2"); + if (minor >= "a") res.push(minor); + res.push("$"); + if (rounds < 10) res.push("0"); + res.push(rounds.toString()); + res.push("$"); + res.push(base64_encode(saltb, saltb.length)); + res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); + return res.join(""); + } + if (typeof callback == "undefined") + return finish(_crypt(passwordb, saltb, rounds)); + else { + _crypt( + passwordb, + saltb, + rounds, + function(err2, bytes) { + if (err2) callback(err2, null); + else callback(null, finish(bytes)); + }, + progressCallback + ); + } + } + function encodeBase64(bytes, length) { + return base64_encode(bytes, length); + } + function decodeBase64(string, length) { + return base64_decode(string, length); + } + var _default = _exports.default = { + setRandomFallback, + genSaltSync, + genSalt, + hashSync, + hash, + compareSync, + compare, + getRounds, + getSalt, + truncates, + encodeBase64, + decodeBase64 + }; + } + ); + } +}); + +// dist/modules/auth/auth.service.js +var require_auth_service = __commonJS({ + "dist/modules/auth/auth.service.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { + var ownKeys2 = function(o) { + ownKeys2 = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys2(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); + } + __setModuleDefault2(result, mod); + return result; + }; + })(); + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuthService = void 0; + var common_12 = require_common(); + var jwt_1 = (init_dist(), __toCommonJS(dist_exports)); + var bcrypt = __importStar2(require_umd()); + var prisma_service_1 = require_prisma_service(); + var AuthService = class AuthService { + prisma; + jwt; + constructor(prisma, jwt) { + this.prisma = prisma; + this.jwt = jwt; + } + /** + * Port of legacy AdminController::login (henza_server). + * + * Legacy issued a random 60-char string as `api_token` and persisted it on the + * user row; this issues a signed JWT instead. The response keeps the legacy + * shape the admin panel's auth store reads: + * - `api_token` -> stored in localStorage under token/branch_token + * - `roles` -> [{ rid }], mapped to rids by the frontend then expanded + * through checkParent() + * + * Deliberate deviation from legacy: a bad phone and a bad password both return + * 401 here. Legacy returned 404 (firstOrFail) for an unknown phone and 422 for + * a wrong password, which let anyone enumerate valid admin phone numbers. + */ + async login(dto) { + const user = await this.prisma.adminUser.findUnique({ + where: { mobile: dto.phone }, + include: { userType: { include: { permissions: true } } } + }); + if (!user || !user.isActive) { + throw new common_12.UnauthorizedException("\u0646\u0627\u0645 \u06A9\u0627\u0631\u0628\u0631\u06CC \u06CC\u0627 \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0627\u0634\u062A\u0628\u0627\u0647 \u0627\u0633\u062A"); + } + const passwordOk = await bcrypt.compare(dto.password, user.passwordHash); + if (!passwordOk) { + throw new common_12.UnauthorizedException("\u0646\u0627\u0645 \u06A9\u0627\u0631\u0628\u0631\u06CC \u06CC\u0627 \u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0627\u0634\u062A\u0628\u0627\u0647 \u0627\u0633\u062A"); + } + const apiToken = await this.jwt.signAsync({ sub: user.id, mobile: user.mobile }); + return { + id: user.id, + name: user.fullName, + fullName: user.fullName, + mobile: user.mobile, + role: user.role, + ut: user.userTypeId, + branch_id: user.branchId, + api_token: apiToken, + roles: (user.userType?.permissions ?? []).map((p) => ({ rid: p.rid })) + }; + } + /** + * Port of legacy UserController::showData, which the router guard calls on every + * cold load to refresh the permission list: + * + * $user['permission'] = Permission::where('ut',$user->ut)->select('rid')->get()->pluck('rid'); + * + * Returns raw (unexpanded) rids — the frontend runs checkParent() on them, as in + * legacy. The guard's own checks use the pre-expanded list from JwtStrategy. + */ + async showData(adminId) { + const user = await this.prisma.adminUser.findUnique({ + where: { id: adminId }, + include: { userType: { include: { permissions: true } } } + }); + if (!user) { + throw new common_12.UnauthorizedException(); + } + return { + id: user.id, + name: user.fullName, + fullName: user.fullName, + mobile: user.mobile, + role: user.role, + ut: user.userTypeId, + branch_id: user.branchId, + user_type: user.userType ? { id: user.userType.id, title: user.userType.title } : null, + permission: (user.userType?.permissions ?? []).map((p) => p.rid) + }; + } + }; + exports2.AuthService = AuthService; + exports2.AuthService = AuthService = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + jwt_1.JwtService + ]) + ], AuthService); + } +}); + +// dist/modules/auth/dto/login.dto.js +var require_login_dto = __commonJS({ + "dist/modules/auth/dto/login.dto.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.LoginDto = void 0; + var class_validator_1 = require_cjs(); + var LoginDto = class { + phone; + password; + }; + exports2.LoginDto = LoginDto; + __decorate4([ + (0, class_validator_1.IsString)(), + (0, class_validator_1.IsNotEmpty)(), + __metadata3("design:type", String) + ], LoginDto.prototype, "phone", void 0); + __decorate4([ + (0, class_validator_1.IsString)(), + (0, class_validator_1.IsNotEmpty)(), + __metadata3("design:type", String) + ], LoginDto.prototype, "password", void 0); + } +}); + +// dist/modules/auth/auth.controller.js +var require_auth_controller = __commonJS({ + "dist/modules/auth/auth.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuthController = void 0; + var common_12 = require_common(); + var auth_service_1 = require_auth_service(); + var login_dto_1 = require_login_dto(); + var guards_1 = require_guards2(); + var AuthController = class AuthController { + authService; + constructor(authService) { + this.authService = authService; + } + login(dto) { + return this.authService.login(dto); + } + /** Legacy `users/show` — the router guard's permission refresh. */ + me(admin) { + return this.authService.showData(admin.id); + } + }; + exports2.AuthController = AuthController; + __decorate4([ + (0, guards_1.Public)(), + (0, common_12.Post)("login"), + (0, common_12.HttpCode)(200), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [login_dto_1.LoginDto]), + __metadata3("design:returntype", void 0) + ], AuthController.prototype, "login", null); + __decorate4([ + (0, common_12.Get)("me"), + __param3(0, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AuthController.prototype, "me", null); + exports2.AuthController = AuthController = __decorate4([ + (0, common_12.Controller)("admin/auth"), + __metadata3("design:paramtypes", [auth_service_1.AuthService]) + ], AuthController); + } +}); + +// ../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/auth_header.js +var require_auth_header = __commonJS({ + "../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/auth_header.js"(exports2, module2) { + "use strict"; + var re = /(\S+)\s+(\S+)/; + function parseAuthHeader(hdrValue) { + if (typeof hdrValue !== "string") { + return null; + } + var matches = hdrValue.match(re); + return matches && { scheme: matches[1], value: matches[2] }; + } + module2.exports = { + parse: parseAuthHeader + }; + } +}); + +// ../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/helpers/assign.js +var require_assign = __commonJS({ + "../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/helpers/assign.js"(exports2, module2) { + module2.exports = function(target, varArgs) { + if (target == null) { + throw new TypeError("Cannot convert undefined or null to object"); + } + var to = Object(target); + for (var index = 1; index < arguments.length; index++) { + var nextSource = arguments[index]; + if (nextSource != null) { + for (var nextKey in nextSource) { + if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { + to[nextKey] = nextSource[nextKey]; + } + } + } + } + return to; + }; + } +}); + +// ../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/verify_jwt.js +var require_verify_jwt = __commonJS({ + "../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/verify_jwt.js"(exports2, module2) { + var jwt = require_jsonwebtoken(); + module2.exports = function(token, secretOrKey, options, callback) { + return jwt.verify(token, secretOrKey, options, callback); + }; + } +}); + +// ../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/strategy.js +var require_strategy2 = __commonJS({ + "../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/strategy.js"(exports2, module2) { + var passport = require_lib6(); + var auth_hdr = require_auth_header(); + var util2 = require("util"); + var url = require("url"); + var assign = require_assign(); + function JwtStrategy(options, verify) { + passport.Strategy.call(this); + this.name = "jwt"; + this._secretOrKeyProvider = options.secretOrKeyProvider; + if (options.secretOrKey) { + if (this._secretOrKeyProvider) { + throw new TypeError("JwtStrategy has been given both a secretOrKey and a secretOrKeyProvider"); + } + this._secretOrKeyProvider = function(request, rawJwtToken, done) { + done(null, options.secretOrKey); + }; + } + if (!this._secretOrKeyProvider) { + throw new TypeError("JwtStrategy requires a secret or key"); + } + this._verify = verify; + if (!this._verify) { + throw new TypeError("JwtStrategy requires a verify callback"); + } + this._jwtFromRequest = options.jwtFromRequest; + if (!this._jwtFromRequest) { + throw new TypeError("JwtStrategy requires a function to retrieve jwt from requests (see option jwtFromRequest)"); + } + this._passReqToCallback = options.passReqToCallback; + var jsonWebTokenOptions = options.jsonWebTokenOptions || {}; + this._verifOpts = assign({}, jsonWebTokenOptions, { + audience: options.audience, + issuer: options.issuer, + algorithms: options.algorithms, + ignoreExpiration: !!options.ignoreExpiration + }); + } + util2.inherits(JwtStrategy, passport.Strategy); + JwtStrategy.JwtVerifier = require_verify_jwt(); + JwtStrategy.prototype.authenticate = function(req, options) { + var self2 = this; + var token = self2._jwtFromRequest(req); + if (!token) { + return self2.fail(new Error("No auth token")); + } + this._secretOrKeyProvider(req, token, function(secretOrKeyError, secretOrKey) { + if (secretOrKeyError) { + self2.fail(secretOrKeyError); + } else { + JwtStrategy.JwtVerifier(token, secretOrKey, self2._verifOpts, function(jwt_err, payload) { + if (jwt_err) { + return self2.fail(jwt_err); + } else { + var verified = function(err, user, info) { + if (err) { + return self2.error(err); + } else if (!user) { + return self2.fail(info); + } else { + return self2.success(user, info); + } + }; + try { + if (self2._passReqToCallback) { + self2._verify(req, payload, verified); + } else { + self2._verify(payload, verified); + } + } catch (ex) { + self2.error(ex); + } + } + }); + } + }); + }; + module2.exports = JwtStrategy; + } +}); + +// ../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/extract_jwt.js +var require_extract_jwt = __commonJS({ + "../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/extract_jwt.js"(exports2, module2) { + "use strict"; + var url = require("url"); + var auth_hdr = require_auth_header(); + var AUTH_HEADER = "authorization"; + var LEGACY_AUTH_SCHEME = "JWT"; + var BEARER_AUTH_SCHEME = "bearer"; + var extractors = {}; + extractors.fromHeader = function(header_name) { + return function(request) { + var token = null; + if (request.headers[header_name]) { + token = request.headers[header_name]; + } + return token; + }; + }; + extractors.fromBodyField = function(field_name) { + return function(request) { + var token = null; + if (request.body && Object.prototype.hasOwnProperty.call(request.body, field_name)) { + token = request.body[field_name]; + } + return token; + }; + }; + extractors.fromUrlQueryParameter = function(param_name) { + return function(request) { + var token = null, parsed_url = url.parse(request.url, true); + if (parsed_url.query && Object.prototype.hasOwnProperty.call(parsed_url.query, param_name)) { + token = parsed_url.query[param_name]; + } + return token; + }; + }; + extractors.fromAuthHeaderWithScheme = function(auth_scheme) { + var auth_scheme_lower = auth_scheme.toLowerCase(); + return function(request) { + var token = null; + if (request.headers[AUTH_HEADER]) { + var auth_params = auth_hdr.parse(request.headers[AUTH_HEADER]); + if (auth_params && auth_scheme_lower === auth_params.scheme.toLowerCase()) { + token = auth_params.value; + } + } + return token; + }; + }; + extractors.fromAuthHeaderAsBearerToken = function() { + return extractors.fromAuthHeaderWithScheme(BEARER_AUTH_SCHEME); + }; + extractors.fromExtractors = function(extractors2) { + if (!Array.isArray(extractors2)) { + throw new TypeError("extractors.fromExtractors expects an array"); + } + return function(request) { + var token = null; + var index = 0; + while (!token && index < extractors2.length) { + token = extractors2[index].call(this, request); + index++; + } + return token; + }; + }; + extractors.versionOneCompatibility = function(options) { + var authScheme = options.authScheme || LEGACY_AUTH_SCHEME, bodyField = options.tokenBodyField || "auth_token", queryParam = options.tokenQueryParameterName || "auth_token"; + return function(request) { + var authHeaderExtractor = extractors.fromAuthHeaderWithScheme(authScheme); + var token = authHeaderExtractor(request); + if (!token) { + var bodyExtractor = extractors.fromBodyField(bodyField); + token = bodyExtractor(request); + } + if (!token) { + var queryExtractor = extractors.fromUrlQueryParameter(queryParam); + token = queryExtractor(request); + } + return token; + }; + }; + module2.exports = extractors; + } +}); + +// ../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/index.js +var require_lib8 = __commonJS({ + "../../node_modules/.pnpm/passport-jwt@4.0.1/node_modules/passport-jwt/lib/index.js"(exports2, module2) { + "use strict"; + var Strategy = require_strategy2(); + var ExtractJwt = require_extract_jwt(); + module2.exports = { + Strategy, + ExtractJwt + }; + } +}); + +// dist/modules/auth/acl.constants.js +var require_acl_constants = __commonJS({ + "dist/modules/auth/acl.constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ALL_RIDS = void 0; + exports2.expandWithParents = expandWithParents; + exports2.ALL_RIDS = [ + "branch.create", + "branch.list", + "buy.order.list", + "cities.create", + "cities.list", + "cities.list.remove", + "cities.list.view", + "cities.list.view.edit", + "collection.create", + "collection.list", + "collection.list.edit", + "collection.list.remove", + "comment", + "comment.remove", + "comment.state", + "comment.view", + "comment.view.edit", + "config.report", + "config.statics", + "config.statics.brand", + "config.statics.brand.create", + "config.statics.brand.edit", + "config.statics.brand.remove", + "config.statics.tags", + "config.statics.tags.create", + "config.statics.tags.edit", + "config.statics.tags.remove", + "config.wallet", + "custom.config.statics.slider", + "custom.config.statics.tags.banner.ids", + "dashboard.omde", + "dashboard.tak", + "document.create", + "document.list", + "document.list.confirm", + "document.list.deny", + "document.list.edit", + "document.list.get", + "document.list.remove", + "invoice.create", + "invoice.list", + "newsletters", + "notify.create", + "notify.me", + "offers.autopromotion", + "offers.create", + "offers.create.tak", + "offers.list", + "offers.list.edit", + "offers.list.remove", + "offers.list.tak.edit", + "offers.list.tak.remove", + "offersIgnore", + "order.create", + "order.list", + "order.list.pdf", + "order.list.sts", + "order.list.sts.remove", + "order.list.sts.submit", + "order.list.view", + "order.list.view.edit", + "order.makeOrder", + "order.makeOrder.get", + "order.makeOrder.remove", + "order.makeOrder.state", + "order.makeOrder.state.remove", + "order.makeOrder.state.submit", + "order.makeOrder.view", + "order.makeOrder.view.edit", + "order.omde", + "order.omde.get", + "order.omde.remove", + "order.omde.state", + "order.omde.state.remove", + "order.omde.state.submit", + "order.omde.view", + "order.omde.view.edit", + "order.omde.view.remove", + "order.tamin", + "order.tamin.state", + "order.tamin.state.remove", + "order.tamin.state.submit", + "order.tamin.view", + "order.tamin.view.edit", + "persons.create", + "persons.create.client", + "persons.create.customer.tak", + "persons.create.seller", + "persons.list.client.omde", + "persons.list.client.omde.able", + "persons.list.client.omde.able.order", + "persons.list.client.omde.edit", + "persons.list.client.omde.unable", + "persons.list.client.omde.unable.order", + "persons.list.client.omde.view", + "persons.list.client.omde.view.documents", + "persons.list.client.omde.view.orders", + "persons.list.client.single", + "persons.list.client.single.edit", + "persons.list.client.single.view", + "persons.list.sellers", + "persons.list.sellers.able", + "persons.list.sellers.able.order", + "persons.list.sellers.edit", + "persons.list.sellers.unable", + "persons.list.sellers.unable.order", + "persons.list.sellers.view", + "persons.list.sellers.view.documents", + "persons.list.sellers.view.orders", + "product.create", + "product.list", + "product.list.edit", + "product.list.group.edit", + "product.list.remove", + "product.list.variants", + "product.list.variants.add", + "product.list.variants.edit", + "product.list.variants.remove", + "product.list.view", + "product.percent", + "report.order.item", + "report.product", + "sms.create", + "sms.create.all", + "sms.create.multiple", + "sms.create.omde", + "sms.create.reagent", + "sms.create.single", + "sms.list", + "statics", + "user.create", + "user.list", + "user.list.create", + "user.list.edit", + "user.list.remove", + "user.permission", + "user.permission.create", + "user.permission.edit", + "wallet", + "wallet.charge", + "wallet.list", + "wallet.percent", + "workshop.create", + "workshop.list" + ]; + function getParents(keys) { + const work = [...keys]; + const parents = []; + while (work.length > 1) { + work.pop(); + parents.push(work.join(".")); + } + return parents; + } + function expandWithParents(values) { + let rid = [...values]; + for (const x of values) { + const keys = x.split("."); + if (keys.length > 1) { + rid = [.../* @__PURE__ */ new Set([...rid, ...getParents(keys)])]; + } + } + return rid; + } + } +}); + +// dist/modules/auth/jwt.strategy.js +var require_jwt_strategy = __commonJS({ + "dist/modules/auth/jwt.strategy.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.JwtStrategy = void 0; + var common_12 = require_common(); + var passport_1 = require_passport(); + var passport_jwt_1 = require_lib8(); + var prisma_service_1 = require_prisma_service(); + var acl_constants_1 = require_acl_constants(); + var JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(passport_jwt_1.Strategy, "jwt") { + prisma; + constructor(prisma) { + super({ + jwtFromRequest: passport_jwt_1.ExtractJwt.fromAuthHeaderAsBearerToken(), + ignoreExpiration: false, + secretOrKey: process.env.JWT_SECRET ?? "dev-only-insecure-secret" + }); + this.prisma = prisma; + } + async validate(payload) { + const user = await this.prisma.adminUser.findUnique({ + where: { id: payload.sub }, + include: { userType: { include: { permissions: true } } } + }); + if (!user || !user.isActive) { + throw new common_12.UnauthorizedException(); + } + const rids = user.userType?.permissions.map((p) => p.rid) ?? []; + return { + id: user.id, + fullName: user.fullName, + mobile: user.mobile, + role: user.role, + userTypeId: user.userTypeId, + branchId: user.branchId, + permissions: (0, acl_constants_1.expandWithParents)(rids) + }; + } + }; + exports2.JwtStrategy = JwtStrategy; + exports2.JwtStrategy = JwtStrategy = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [prisma_service_1.PrismaService]) + ], JwtStrategy); + } +}); + +// dist/modules/auth/auth.module.js +var require_auth_module = __commonJS({ + "dist/modules/auth/auth.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AuthModule = void 0; + var common_12 = require_common(); + var core_12 = require_core3(); + var jwt_1 = (init_dist(), __toCommonJS(dist_exports)); + var passport_1 = require_passport(); + var prisma_module_1 = require_prisma_module(); + var auth_controller_1 = require_auth_controller(); + var auth_service_1 = require_auth_service(); + var jwt_strategy_1 = require_jwt_strategy(); + var guards_1 = require_guards2(); + var AuthModule = class AuthModule { + }; + exports2.AuthModule = AuthModule; + exports2.AuthModule = AuthModule = __decorate4([ + (0, common_12.Module)({ + imports: [ + prisma_module_1.PrismaModule, + passport_1.PassportModule, + jwt_1.JwtModule.register({ + secret: process.env.JWT_SECRET ?? "dev-only-insecure-secret", + // jsonwebtoken types expiresIn as a template-literal union, which a plain + // `string` from process.env does not satisfy; the cast is the documented escape. + signOptions: { + expiresIn: process.env.JWT_EXPIRES_IN ?? "12h" + } + }) + ], + controllers: [auth_controller_1.AuthController], + providers: [ + auth_service_1.AuthService, + jwt_strategy_1.JwtStrategy, + // Global: authenticate first, then check the rid. Routes opt out with @Public(). + { provide: core_12.APP_GUARD, useClass: guards_1.JwtAuthGuard }, + { provide: core_12.APP_GUARD, useClass: guards_1.PermissionsGuard } + ], + exports: [auth_service_1.AuthService] + }) + ], AuthModule); + } +}); + +// dist/modules/admin-table/table.service.js +var require_table_service = __commonJS({ + "dist/modules/admin-table/table.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.TableService = void 0; + var common_12 = require_common(); + var TableService = class TableService { + /** + * Turns a dotted path into a nested Prisma object: + * 'customer.fullName', 'x' -> { customer: { fullName: 'x' } } + */ + nest(path, leaf) { + const parts = path.split("."); + return parts.reduceRight((acc, key, i) => { + return i === parts.length - 1 ? { [key]: leaf } : { [key]: acc }; + }, leaf); + } + assertAllowed(field, allowed) { + if (allowed && !allowed.includes(field)) { + throw new common_12.BadRequestException(`Field not filterable: ${field}`); + } + } + /** Maps one legacy filter row to a Prisma condition. */ + toCondition(f, allowed) { + if (!f.field || !f.op) + return null; + this.assertAllowed(f.field, allowed); + const v = f.value; + switch (f.op) { + case "=": + return this.nest(f.field, { equals: v }); + case "!=": + return this.nest(f.field, { not: v }); + case ">": + return this.nest(f.field, { gt: v }); + case ">=": + return this.nest(f.field, { gte: v }); + case "<": + return this.nest(f.field, { lt: v }); + case "<=": + return this.nest(f.field, { lte: v }); + case "like": + return this.nest(f.field, { + contains: String(v ?? "").replace(/^%|%$/g, ""), + mode: "insensitive" + }); + case "in": + return this.nest(f.field, { in: Array.isArray(v) ? v : [v] }); + case "between": + return this.nest(f.field, { gte: v, lte: f.value2 }); + case "null": + return this.nest(f.field, { equals: null }); + case "notnull": + return this.nest(f.field, { not: null }); + default: + return null; + } + } + /** Builds `where`, `orderBy`, `skip` and `take` from an XTable request. */ + build(query, opts = {}) { + const page = query.page && query.page > 0 ? query.page : 1; + const limit = query.limit && query.limit > 0 ? query.limit : 10; + const and = []; + for (const f of query.filters ?? []) { + const cond = this.toCondition(f, opts.allowed); + if (cond) + and.push(cond); + } + const search = query.search?.trim(); + if (search && opts.searchable?.length) { + and.push({ + OR: opts.searchable.map((field) => this.nest(field, { contains: search, mode: "insensitive" })) + }); + } + let orderBy = opts.defaultOrderBy ?? { createdAt: "desc" }; + if (query.order) { + const dir = query.order.startsWith("-") ? "desc" : "asc"; + const field = query.order.replace(/^[+-]/, ""); + if (field) { + this.assertAllowed(field, opts.allowed); + orderBy = this.nest(field, dir); + } + } + return { + where: and.length ? { AND: and } : {}, + orderBy, + skip: (page - 1) * limit, + take: limit, + page, + limit + }; + } + /** Wraps rows + count into the exact envelope XTable expects. */ + respond(rows, total, query, page, limit) { + return { + rows, + query: { + search: query.search, + filters: query.filters ?? [], + total, + limit, + page + } + }; + } + /** Exports are not implemented; fail loudly instead of returning a dead url. */ + assertNotExport(query) { + if (query.op) { + throw new common_12.BadRequestException(`Export ('${query.op}') is not implemented yet in the new backend.`); + } + } + }; + exports2.TableService = TableService; + exports2.TableService = TableService = __decorate4([ + (0, common_12.Injectable)() + ], TableService); + } +}); + +// dist/modules/admin-table/admin-table.module.js +var require_admin_table_module = __commonJS({ + "dist/modules/admin-table/admin-table.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminTableModule = void 0; + var common_12 = require_common(); + var table_service_1 = require_table_service(); + var AdminTableModule = class AdminTableModule { + }; + exports2.AdminTableModule = AdminTableModule; + exports2.AdminTableModule = AdminTableModule = __decorate4([ + (0, common_12.Global)(), + (0, common_12.Module)({ + providers: [table_service_1.TableService], + exports: [table_service_1.TableService] + }) + ], AdminTableModule); + } +}); + +// dist/modules/admin-orders/admin-orders.service.js +var require_admin_orders_service = __commonJS({ + "dist/modules/admin-orders/admin-orders.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminOrdersService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminOrdersService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var orders_service_1 = require_orders_service(); + var STATUS_LABELS = { + SUSPENDED: "\u0645\u0639\u0644\u0642 (\u0633\u0642\u0641 \u0627\u0639\u062A\u0628\u0627\u0631)", + PLACED: "\u062B\u0628\u062A \u0634\u062F\u0647", + ADMIN_APPROVED: "\u062A\u0627\u06CC\u06CC\u062F \u0645\u062F\u06CC\u0631", + SOURCING: "\u062F\u0631 \u062D\u0627\u0644 \u062A\u0627\u0645\u06CC\u0646", + PREPARING: "\u062F\u0631 \u062D\u0627\u0644 \u0622\u0645\u0627\u062F\u0647\u200C\u0633\u0627\u0632\u06CC", + DELIVERED_TO_AGENT: "\u062A\u062D\u0648\u06CC\u0644 \u0628\u0647 \u0646\u0645\u0627\u06CC\u0646\u062F\u0647", + DELIVERED_TO_CUSTOMER: "\u062A\u062D\u0648\u06CC\u0644 \u0628\u0647 \u0645\u0634\u062A\u0631\u06CC", + CANCELLED: "\u0644\u063A\u0648 \u0634\u062F\u0647" + }; + var STATUS_FLOW = [ + client_1.OrderStatus.PLACED, + client_1.OrderStatus.ADMIN_APPROVED, + client_1.OrderStatus.SOURCING, + client_1.OrderStatus.PREPARING, + client_1.OrderStatus.DELIVERED_TO_AGENT, + client_1.OrderStatus.DELIVERED_TO_CUSTOMER + ]; + var AdminOrdersService = class AdminOrdersService { + static { + AdminOrdersService_1 = this; + } + prisma; + table; + orders; + constructor(prisma, table, orders) { + this.prisma = prisma; + this.table = table; + this.orders = orders; + } + /** Fields the XTable filter bar and sorter may reference. */ + static ALLOWED = [ + "id", + "orderNumber", + "status", + "createdAt", + "updatedAt", + "totalGoldWeightGrams", + "flatRialCharge", + "isSuspendedOverCreditLimit", + "customer.fullName", + "customer.mobile", + "branch.name" + ]; + /** + * Legacy `POST single-order` — the order list grid. + * + * `branchId` narrows the result to one branch, which is how the branch-mode + * build of the panel scopes its list. + */ + async list(query, branchId, channel = client_1.OrderChannel.RETAIL) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["orderNumber", "customer.fullName", "customer.mobile"], + allowed: AdminOrdersService_1.ALLOWED, + defaultOrderBy: { createdAt: "desc" } + }); + const scoped = { + AND: [ + where, + { channel }, + ...branchId ? [{ branchId }] : [] + ] + }; + const [rows, total] = await Promise.all([ + this.prisma.order.findMany({ + where: scoped, + orderBy, + skip, + take, + include: { + customer: true, + branch: true, + items: { include: { productVariant: { include: { product: true } } } } + } + }), + this.prisma.order.count({ where: scoped }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + /** + * Shapes a row the way the ported list view reads it. + * + * Legacy field names are preserved (`sts_str`, `caj`, `total_price`, `items`) + * so the ported template bindings keep working unchanged. + */ + toRow(o) { + return { + id: o.id, + orderNumber: o.orderNumber, + status: o.status, + sts_str: STATUS_LABELS[o.status], + caj: o.createdAt, + uaj: o.updatedAt, + total_price: o.flatRialCharge, + totalGoldWeightGrams: o.totalGoldWeightGrams, + wageWeightGrams: o.wageWeightGrams, + isSuspendedOverCreditLimit: o.isSuspendedOverCreditLimit, + deliveredAt: o.deliveredAt, + branch_id: o.branchId, + branch: o.branch ? { id: o.branch.id, name: o.branch.name } : null, + customer: { + id: o.customer.id, + // Legacy split names into fname/lname; the new schema has one fullName. + // Both are exposed so ported templates binding either keep working. + fname: o.customer.fullName, + lname: "", + fullName: o.customer.fullName, + phone: o.customer.mobile + }, + items: o.items.map((it) => ({ + id: it.id, + title: it.productVariant.product.title, + variant_title: it.productVariant.title, + qty: it.quantity, + grams: it.computedWeightGrams, + rash: it.rashWeightGramsSnapshot + })) + }; + } + /** + * Legacy `POST major/order/table` — the wholesale (عمده) order grid. + * + * Legacy kept the two sales channels in SEPARATE tables: `orders_orders` + * (SingleCustomerOrders, served by AdminController::getSingleOrders) and + * `orders` (Order, served by MajorOrderController::index). Neither controller + * applied a type filter because the table itself was the discriminator, so the + * two lists never overlapped. + * + * The redesigned schema has one Order model, so `Order.channel` carries that + * distinction instead and each list filters on it. + */ + async listWholesale(query, branchId) { + return this.list(query, branchId, client_1.OrderChannel.WHOLESALE); + } + /** + * Legacy `POST order-tamin` — MajorOrderController::getTaminOrders. + * + * Legacy narrowed to orders whose activity contained Order::$STS[3], i.e. those + * that have reached the sourcing stage. The equivalent here is a status event + * recording a transition into SOURCING. + */ + async listTamin(query, branchId) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["orderNumber", "customer.fullName", "customer.mobile"], + allowed: AdminOrdersService_1.ALLOWED, + defaultOrderBy: { createdAt: "desc" } + }); + const conditions = [ + where, + { statusEvents: { some: { toStatus: client_1.OrderStatus.SOURCING } } } + ]; + if (branchId) + conditions.push({ branchId }); + const scoped = { AND: conditions }; + const [rows, total] = await Promise.all([ + this.prisma.order.findMany({ + where: scoped, + orderBy, + skip, + take, + include: { + customer: true, + branch: true, + items: { include: { productVariant: { include: { product: true } } } } + } + }), + this.prisma.order.count({ where: scoped }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + /** Legacy `POST delete-order` — remove a wholesale order. */ + async remove(id) { + const order = await this.prisma.order.findUnique({ + where: { id }, + include: { ledgerEntries: true } + }); + if (!order) + throw new common_12.NotFoundException("\u0633\u0641\u0627\u0631\u0634 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (order.ledgerEntries.length > 0) { + throw new common_12.BadRequestException("\u062D\u0630\u0641 \u0627\u06CC\u0646 \u0633\u0641\u0627\u0631\u0634 \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A\u060C \u0686\u0648\u0646 \u0628\u0631\u0627\u06CC \u0622\u0646 \u0633\u0646\u062F \u062D\u0633\u0627\u0628\u062F\u0627\u0631\u06CC \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A."); + } + await this.prisma.$transaction([ + this.prisma.orderStatusEvent.deleteMany({ where: { orderId: id } }), + this.prisma.orderItem.deleteMany({ where: { orderId: id } }), + this.prisma.order.delete({ where: { id } }) + ]); + return { success: true }; + } + /** Legacy `GET order/:id` detail, including the status timeline. */ + async findOne(id) { + const order = await this.prisma.order.findUnique({ + where: { id }, + include: { + customer: true, + branch: true, + items: { include: { productVariant: { include: { product: true } } } }, + statusEvents: { include: { actorAdminUser: true }, orderBy: { createdAt: "asc" } } + } + }); + if (!order) + throw new common_12.NotFoundException("\u0633\u0641\u0627\u0631\u0634 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const reached = new Set(order.statusEvents.map((e) => e.toStatus)); + return { + ...this.toRow(order), + // legacy `activity`: one entry per step, `proceed` marking those reached + activity: STATUS_FLOW.map((s) => { + const event = order.statusEvents.find((e) => e.toStatus === s); + return { + status: s, + title: STATUS_LABELS[s], + proceed: reached.has(s), + uaj: event?.createdAt ?? null, + note: event?.note ?? "" + }; + }) + }; + } + /** Farsi labels for the status dropdowns. */ + statusOptions() { + return Object.entries(STATUS_LABELS).map(([value, title]) => ({ value, title })); + } + /** + * Legacy `GET order/type` — the "نوع فروش" dropdown. + * Legacy Order::$TYPES = [1 => 'ثبت سفارش توسط مسئول فروش', 2 => 'ثبت مشتری']. + */ + typeOptions() { + return { 1: "\u062B\u0628\u062A \u0633\u0641\u0627\u0631\u0634 \u062A\u0648\u0633\u0637 \u0645\u0633\u0626\u0648\u0644 \u0641\u0631\u0648\u0634", 2: "\u062B\u0628\u062A \u0645\u0634\u062A\u0631\u06CC" }; + } + /** + * Legacy `POST /order` from views/order/create.vue — the admin order builder. + * + * Delegates to OrdersService.createOrder, which owns the weight formula + * w = rash * (1 + (wagePercent - discountPercent)/100) + * and the credit-limit gate that suspends rather than rejects an over-limit + * order. Reimplementing either here would let the two paths drift. + * + * Legacy also posted total_price / total_weight / gold_price_original computed + * in the BROWSER. Those are ignored: the server recomputes them from the + * variant snapshots, so a tampered or stale client total cannot alter a debt. + */ + async createFromAdmin(payload, actorAdminUserId) { + if (!payload.customer_id) + throw new common_12.BadRequestException("\u0645\u0634\u062A\u0631\u06CC \u0627\u0646\u062A\u062E\u0627\u0628 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + if (!Array.isArray(payload.order_items) || payload.order_items.length === 0) { + throw new common_12.BadRequestException("\u0633\u0628\u062F \u0633\u0641\u0627\u0631\u0634 \u062E\u0627\u0644\u06CC \u0627\u0633\u062A"); + } + const items = await Promise.all(payload.order_items.map(async (it) => { + const variant = await this.prisma.productVariant.findUnique({ where: { id: it.vid } }); + if (!variant) + throw new common_12.NotFoundException(`\u062A\u0646\u0648\u0639 \u0645\u062D\u0635\u0648\u0644 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F: ${it.vid}`); + return { + productVariantId: it.vid, + quantity: Number(it.qty) || 1, + // Fall back to the variant's own default wage when the builder did not + // negotiate a different one. + wagePercent: Number(it.percent ?? variant.defaultWagePercent), + discountPercent: Number(it.discount ?? 0), + flatRialCharge: Number(it.rial_input ?? 0) + }; + })); + const order = await this.orders.createOrder({ + customerId: payload.customer_id, + items, + // The admin builder serves the omde (major/*) flow, so orders it creates + // belong to the wholesale channel — legacy wrote them to the `orders` + // table, which MajorOrderController::index listed. + channel: client_1.OrderChannel.WHOLESALE + }); + const target = this.statusFromLegacyCode(payload.sts); + if (target && target !== client_1.OrderStatus.PLACED) { + await this.orders.updateStatus(order.id, target, actorAdminUserId, payload.note); + } + return this.findOne(order.id); + } + /** + * Legacy delivery-status codes from create.vue's `sts` map: + * 1 ثبت سفارش | 2 تایید مدیر سیستم | 3 در حال تامین + * 4 در حال آماده سازی | 5 ارسال | 6 تحویل مشتری + */ + statusFromLegacyCode(code) { + const map = { + 1: client_1.OrderStatus.PLACED, + 2: client_1.OrderStatus.ADMIN_APPROVED, + 3: client_1.OrderStatus.SOURCING, + 4: client_1.OrderStatus.PREPARING, + 5: client_1.OrderStatus.DELIVERED_TO_AGENT, + 6: client_1.OrderStatus.DELIVERED_TO_CUSTOMER + }; + return code === void 0 ? void 0 : map[Number(code)]; + } + /** + * Legacy `POST single/order-sts/edit` — advance or remove a status. + * + * Setting a status delegates to OrdersService.updateStatus rather than writing + * the row here, because that method also posts the gold debt to the ledger at + * DELIVERED_TO_AGENT. Duplicating the update would silently skip that. + */ + async setStatus(dto, actorAdminUserId) { + if (dto.remove) { + return this.removeStatusEvent(dto.orderId, dto.status); + } + return this.orders.updateStatus(dto.orderId, dto.status, actorAdminUserId, dto.note); + } + /** + * Legacy's `remove: true` branch: drop a recorded status event. + * + * Deliberately refuses to remove DELIVERED_TO_AGENT. In legacy, deleting that + * row left the posted debt ledger entries behind, so the customer stayed in + * debt for an order no longer marked delivered. Rather than reproduce a + * data-corrupting path, this rejects and explains — recorded in + * docs/ADMIN-PORT-PLAN.md. + */ + async removeStatusEvent(orderId, status) { + if (status === client_1.OrderStatus.DELIVERED_TO_AGENT) { + throw new common_12.BadRequestException("\u062D\u0630\u0641 \u0648\u0636\u0639\u06CC\u062A \xAB\u062A\u062D\u0648\u06CC\u0644 \u0628\u0647 \u0646\u0645\u0627\u06CC\u0646\u062F\u0647\xBB \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A\u060C \u0686\u0648\u0646 \u0628\u062F\u0647\u06CC \u0637\u0644\u0627 \u062F\u0631 \u0647\u0645\u06CC\u0646 \u0645\u0631\u062D\u0644\u0647 \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A."); + } + const event = await this.prisma.orderStatusEvent.findFirst({ + where: { orderId, toStatus: status }, + orderBy: { createdAt: "desc" } + }); + if (!event) + throw new common_12.NotFoundException("\u0648\u0636\u0639\u06CC\u062A \u0645\u0648\u0631\u062F \u0646\u0638\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + await this.prisma.orderStatusEvent.delete({ where: { id: event.id } }); + const latest = await this.prisma.orderStatusEvent.findFirst({ + where: { orderId }, + orderBy: { createdAt: "desc" } + }); + return this.prisma.order.update({ + where: { id: orderId }, + data: { status: latest?.toStatus ?? client_1.OrderStatus.PLACED } + }); + } + }; + exports2.AdminOrdersService = AdminOrdersService; + exports2.AdminOrdersService = AdminOrdersService = AdminOrdersService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService, + orders_service_1.OrdersService + ]) + ], AdminOrdersService); + } +}); + +// dist/modules/admin-table/table-query.dto.js +var require_table_query_dto = __commonJS({ + "dist/modules/admin-table/table-query.dto.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.TableQueryDto = exports2.TableFilterDto = void 0; + var class_transformer_1 = require_cjs2(); + var class_validator_1 = require_cjs(); + var TableFilterDto = class { + id; + field; + /** + * Legacy operators, kept verbatim. `between` uses value + value2 and is what + * the date-range filter emits. + */ + op; + value; + value2; + }; + exports2.TableFilterDto = TableFilterDto; + __decorate4([ + (0, class_validator_1.IsOptional)(), + __metadata3("design:type", Object) + ], TableFilterDto.prototype, "id", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsString)(), + __metadata3("design:type", String) + ], TableFilterDto.prototype, "field", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsIn)(["=", "!=", ">", ">=", "<", "<=", "like", "in", "between", "null", "notnull"]), + __metadata3("design:type", String) + ], TableFilterDto.prototype, "op", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + __metadata3("design:type", Object) + ], TableFilterDto.prototype, "value", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + __metadata3("design:type", Object) + ], TableFilterDto.prototype, "value2", void 0); + var TableQueryDto = class { + search; + filters; + page; + limit; + /** Sort spec: '+field' ascending, '-field' descending (legacy `order`). */ + order; + /** Columns currently visible; drives the export payload. */ + select; + /** key -> Farsi column heading, used for export headers. */ + titles; + report_title; + /** + * Export mode. Legacy expected `{ url }` back and did `window.open(data.url)`. + * Exports are not implemented yet; the controller rejects these explicitly + * rather than returning a broken url. + */ + op; + /** Echoed back inside `query`; the client owns this value. */ + total; + }; + exports2.TableQueryDto = TableQueryDto; + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsString)(), + __metadata3("design:type", String) + ], TableQueryDto.prototype, "search", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsArray)(), + (0, class_validator_1.ValidateNested)({ each: true }), + (0, class_transformer_1.Type)(() => TableFilterDto), + __metadata3("design:type", Array) + ], TableQueryDto.prototype, "filters", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_transformer_1.Type)(() => Number), + (0, class_validator_1.IsInt)(), + (0, class_validator_1.Min)(1), + __metadata3("design:type", Number) + ], TableQueryDto.prototype, "page", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_transformer_1.Type)(() => Number), + (0, class_validator_1.IsInt)(), + (0, class_validator_1.Min)(1), + (0, class_validator_1.Max)(500), + __metadata3("design:type", Number) + ], TableQueryDto.prototype, "limit", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsString)(), + __metadata3("design:type", String) + ], TableQueryDto.prototype, "order", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsArray)(), + __metadata3("design:type", Array) + ], TableQueryDto.prototype, "select", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + __metadata3("design:type", Object) + ], TableQueryDto.prototype, "titles", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsString)(), + __metadata3("design:type", String) + ], TableQueryDto.prototype, "report_title", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsIn)(["excel", "json", "print"]), + __metadata3("design:type", String) + ], TableQueryDto.prototype, "op", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + __metadata3("design:type", Number) + ], TableQueryDto.prototype, "total", void 0); + } +}); + +// dist/modules/admin-orders/update-status.dto.js +var require_update_status_dto = __commonJS({ + "dist/modules/admin-orders/update-status.dto.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.UpdateOrderStatusDto = void 0; + var class_validator_1 = require_cjs(); + var client_1 = require("@prisma/client"); + var UpdateOrderStatusDto = class { + orderId; + status; + note; + /** legacy: row.remove = true -> delete this status event rather than add one */ + remove; + }; + exports2.UpdateOrderStatusDto = UpdateOrderStatusDto; + __decorate4([ + (0, class_validator_1.IsString)(), + __metadata3("design:type", String) + ], UpdateOrderStatusDto.prototype, "orderId", void 0); + __decorate4([ + (0, class_validator_1.IsEnum)(client_1.OrderStatus), + __metadata3("design:type", String) + ], UpdateOrderStatusDto.prototype, "status", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsString)(), + __metadata3("design:type", String) + ], UpdateOrderStatusDto.prototype, "note", void 0); + __decorate4([ + (0, class_validator_1.IsOptional)(), + (0, class_validator_1.IsBoolean)(), + __metadata3("design:type", Boolean) + ], UpdateOrderStatusDto.prototype, "remove", void 0); + } +}); + +// dist/modules/admin-orders/admin-orders.controller.js +var require_admin_orders_controller = __commonJS({ + "dist/modules/admin-orders/admin-orders.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminOrdersController = void 0; + var common_12 = require_common(); + var admin_orders_service_1 = require_admin_orders_service(); + var table_query_dto_1 = require_table_query_dto(); + var update_status_dto_1 = require_update_status_dto(); + var guards_1 = require_guards2(); + var AdminOrdersController = class AdminOrdersController { + orders; + constructor(orders) { + this.orders = orders; + } + /** Legacy POST single-order. POST, not GET, because XTable posts its filters. */ + list(query, admin) { + return this.orders.list(query, admin.branchId ?? void 0); + } + /** Legacy POST major/order/table — the wholesale grid. */ + listWholesale(query, admin) { + return this.orders.listWholesale(query, admin.branchId ?? void 0); + } + /** Legacy POST order-tamin — orders that reached the sourcing stage. */ + listTamin(query, admin) { + return this.orders.listTamin(query, admin.branchId ?? void 0); + } + /** Legacy POST delete-order. */ + remove(body) { + return this.orders.remove(body.id); + } + /** Legacy POST /order from the admin order builder (views/order/create.vue). */ + createFromAdmin(body, admin) { + return this.orders.createFromAdmin(body, admin.id); + } + /** Legacy GET order/type. */ + typeOptions() { + return this.orders.typeOptions(); + } + statusOptions() { + return this.orders.statusOptions(); + } + /** Legacy POST single/order-sts/edit. */ + setStatus(dto, admin) { + return this.orders.setStatus(dto, admin.id); + } + findOne(id) { + return this.orders.findOne(id); + } + }; + exports2.AdminOrdersController = AdminOrdersController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("order.list"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto, Object]), + __metadata3("design:returntype", void 0) + ], AdminOrdersController.prototype, "list", null); + __decorate4([ + (0, common_12.Post)("wholesale/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("order.omde"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto, Object]), + __metadata3("design:returntype", void 0) + ], AdminOrdersController.prototype, "listWholesale", null); + __decorate4([ + (0, common_12.Post)("tamin/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("order.tamin"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto, Object]), + __metadata3("design:returntype", void 0) + ], AdminOrdersController.prototype, "listTamin", null); + __decorate4([ + (0, common_12.Post)("delete"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("order.omde"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminOrdersController.prototype, "remove", null); + __decorate4([ + (0, common_12.Post)("create"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("order.create"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object, Object]), + __metadata3("design:returntype", void 0) + ], AdminOrdersController.prototype, "createFromAdmin", null); + __decorate4([ + (0, common_12.Get)("type-options"), + (0, guards_1.RequirePermission)("order.create"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminOrdersController.prototype, "typeOptions", null); + __decorate4([ + (0, common_12.Get)("status-options"), + (0, guards_1.RequirePermission)("order.list"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminOrdersController.prototype, "statusOptions", null); + __decorate4([ + (0, common_12.Post)("status"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("order.list"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [update_status_dto_1.UpdateOrderStatusDto, Object]), + __metadata3("design:returntype", void 0) + ], AdminOrdersController.prototype, "setStatus", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("order.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminOrdersController.prototype, "findOne", null); + exports2.AdminOrdersController = AdminOrdersController = __decorate4([ + (0, common_12.Controller)("admin/orders"), + __metadata3("design:paramtypes", [admin_orders_service_1.AdminOrdersService]) + ], AdminOrdersController); + } +}); + +// dist/modules/admin-orders/admin-orders.module.js +var require_admin_orders_module = __commonJS({ + "dist/modules/admin-orders/admin-orders.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminOrdersModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var orders_module_1 = require_orders_module(); + var admin_orders_controller_1 = require_admin_orders_controller(); + var admin_orders_service_1 = require_admin_orders_service(); + var AdminOrdersModule = class AdminOrdersModule { + }; + exports2.AdminOrdersModule = AdminOrdersModule; + exports2.AdminOrdersModule = AdminOrdersModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule, orders_module_1.OrdersModule], + controllers: [admin_orders_controller_1.AdminOrdersController], + providers: [admin_orders_service_1.AdminOrdersService] + }) + ], AdminOrdersModule); + } +}); + +// dist/modules/admin-cities/admin-cities.controller.js +var require_admin_cities_controller = __commonJS({ + "dist/modules/admin-cities/admin-cities.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCitiesController = void 0; + var common_12 = require_common(); + var prisma_service_1 = require_prisma_service(); + var AdminCitiesController = class AdminCitiesController { + prisma; + constructor(prisma) { + this.prisma = prisma; + } + async list() { + const cities = await this.prisma.city.findMany({ orderBy: { name: "asc" } }); + return { rows: cities.map((c) => ({ id: c.id, title: c.name, province: c.province })) }; + } + }; + exports2.AdminCitiesController = AdminCitiesController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", Promise) + ], AdminCitiesController.prototype, "list", null); + exports2.AdminCitiesController = AdminCitiesController = __decorate4([ + (0, common_12.Controller)("admin/cities"), + __metadata3("design:paramtypes", [prisma_service_1.PrismaService]) + ], AdminCitiesController); + } +}); + +// dist/modules/admin-cities/admin-cities.module.js +var require_admin_cities_module = __commonJS({ + "dist/modules/admin-cities/admin-cities.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCitiesModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_cities_controller_1 = require_admin_cities_controller(); + var AdminCitiesModule = class AdminCitiesModule { + }; + exports2.AdminCitiesModule = AdminCitiesModule; + exports2.AdminCitiesModule = AdminCitiesModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_cities_controller_1.AdminCitiesController] + }) + ], AdminCitiesModule); + } +}); + +// dist/modules/admin-preorders/admin-preorders.service.js +var require_admin_preorders_service = __commonJS({ + "dist/modules/admin-preorders/admin-preorders.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminPreOrdersService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminPreOrdersService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var PREORDER_STATUS_LABELS = { + PLACED: "\u062B\u0628\u062A \u0634\u062F\u0647", + ADMIN_APPROVED: "\u062A\u0627\u06CC\u06CC\u062F \u0645\u062F\u06CC\u0631", + WORKSHOP_APPROVED: "\u062A\u0627\u06CC\u06CC\u062F \u06A9\u0627\u0631\u06AF\u0627\u0647", + READY_TO_SHIP: "\u0622\u0645\u0627\u062F\u0647 \u0627\u0631\u0633\u0627\u0644", + DELIVERED: "\u062A\u062D\u0648\u06CC\u0644 \u0634\u062F\u0647", + CANCELLED: "\u0644\u063A\u0648 \u0634\u062F\u0647" + }; + var AdminPreOrdersService = class AdminPreOrdersService { + static { + AdminPreOrdersService_1 = this; + } + prisma; + table; + constructor(prisma, table) { + this.prisma = prisma; + this.table = table; + } + static ALLOWED = [ + "id", + "status", + "createdAt", + "updatedAt", + "colorName", + "sizeSpec", + "stoneColor", + "minaColor", + "estimatedWeightGrams", + "estimatedPriceRial", + "customer.fullName", + "customer.mobile" + ]; + /** Legacy `POST get-custom-orders`. */ + async list(query) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["customer.fullName", "customer.mobile"], + allowed: AdminPreOrdersService_1.ALLOWED, + defaultOrderBy: { createdAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.preOrder.findMany({ + where, + orderBy, + skip, + take, + include: { customer: true, city: true, workshop: true } + }), + this.prisma.preOrder.count({ where }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + /** Legacy field names (color, size, color_mina, color_stone, ...) preserved. */ + toRow(p) { + return { + id: p.id, + status: p.status, + sts_str_fa: PREORDER_STATUS_LABELS[p.status], + color: p.colorName, + size: p.sizeSpec, + color_mina: p.minaColor, + color_stone: p.stoneColor, + // legacy 'sum' (quantity); a PreOrder models a single design request + sum: 1, + description: p.description, + designImageUrl: p.designImageUrl, + estimatedWeightGrams: p.estimatedWeightGrams, + estimatedPriceRial: p.estimatedPriceRial, + time_creat_fa: p.createdAt, + time_update_fa: p.updatedAt, + convertedOrderId: p.convertedOrderId, + city: p.city ? { id: p.city.id, title: p.city.name } : null, + workshop: p.workshop ? { id: p.workshop.id, name: p.workshop.name } : null, + customer: { + id: p.customer.id, + fname: p.customer.fullName, + lname: "", + name: p.customer.fullName, + fullName: p.customer.fullName, + mobile: p.customer.mobile + } + }; + } + async findOne(id) { + const p = await this.prisma.preOrder.findUnique({ + where: { id }, + include: { customer: true, city: true, workshop: true } + }); + if (!p) + throw new common_12.NotFoundException("\u0633\u0641\u0627\u0631\u0634 \u0633\u0627\u062E\u062A\u0646\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.toRow(p); + } + /** Legacy `PUT custom-order/{id}`. */ + async update(id, data) { + const existing = await this.prisma.preOrder.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u0633\u0641\u0627\u0631\u0634 \u0633\u0627\u062E\u062A\u0646\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const patch = {}; + if (data.status !== void 0) + patch.status = data.status; + if (data.color !== void 0) + patch.colorName = data.color; + if (data.size !== void 0) + patch.sizeSpec = data.size; + if (data.color_mina !== void 0) + patch.minaColor = data.color_mina; + if (data.color_stone !== void 0) + patch.stoneColor = data.color_stone; + if (data.description !== void 0) + patch.description = data.description; + if (data.estimatedWeightGrams !== void 0) { + patch.estimatedWeightGrams = new client_1.Prisma.Decimal(data.estimatedWeightGrams); + } + if (data.estimatedPriceRial !== void 0) { + patch.estimatedPriceRial = new client_1.Prisma.Decimal(data.estimatedPriceRial); + } + return this.prisma.preOrder.update({ where: { id }, data: patch }); + } + /** Legacy `DELETE custom-order/{id}`. */ + async remove(id) { + const p = await this.prisma.preOrder.findUnique({ where: { id } }); + if (!p) + throw new common_12.NotFoundException("\u0633\u0641\u0627\u0631\u0634 \u0633\u0627\u062E\u062A\u0646\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (p.convertedOrderId) { + throw new common_12.BadRequestException("\u062D\u0630\u0641 \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A: \u0627\u06CC\u0646 \u0633\u0641\u0627\u0631\u0634 \u0633\u0627\u062E\u062A\u0646\u06CC \u0642\u0628\u0644\u0627\u064B \u0628\u0647 \u0633\u0641\u0627\u0631\u0634 \u0642\u0637\u0639\u06CC \u062A\u0628\u062F\u06CC\u0644 \u0634\u062F\u0647 \u0627\u0633\u062A."); + } + await this.prisma.$transaction([ + this.prisma.preOrderStatusEvent.deleteMany({ where: { preOrderId: id } }), + this.prisma.preOrder.delete({ where: { id } }) + ]); + return { success: true }; + } + statusOptions() { + return Object.entries(PREORDER_STATUS_LABELS).map(([value, title]) => ({ value, title })); + } + }; + exports2.AdminPreOrdersService = AdminPreOrdersService; + exports2.AdminPreOrdersService = AdminPreOrdersService = AdminPreOrdersService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService + ]) + ], AdminPreOrdersService); + } +}); + +// dist/modules/admin-preorders/admin-preorders.controller.js +var require_admin_preorders_controller = __commonJS({ + "dist/modules/admin-preorders/admin-preorders.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminPreOrdersController = void 0; + var common_12 = require_common(); + var admin_preorders_service_1 = require_admin_preorders_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminPreOrdersController = class AdminPreOrdersController { + preOrders; + constructor(preOrders) { + this.preOrders = preOrders; + } + list(query) { + return this.preOrders.list(query); + } + statusOptions() { + return this.preOrders.statusOptions(); + } + findOne(id) { + return this.preOrders.findOne(id); + } + update(id, data) { + return this.preOrders.update(id, data); + } + remove(id) { + return this.preOrders.remove(id); + } + }; + exports2.AdminPreOrdersController = AdminPreOrdersController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("order.makeOrder"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminPreOrdersController.prototype, "list", null); + __decorate4([ + (0, common_12.Get)("status-options"), + (0, guards_1.RequirePermission)("order.makeOrder"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminPreOrdersController.prototype, "statusOptions", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("order.makeOrder"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminPreOrdersController.prototype, "findOne", null); + __decorate4([ + (0, common_12.Put)(":id"), + (0, guards_1.RequirePermission)("order.makeOrder"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminPreOrdersController.prototype, "update", null); + __decorate4([ + (0, common_12.Delete)(":id"), + (0, guards_1.RequirePermission)("order.makeOrder"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminPreOrdersController.prototype, "remove", null); + exports2.AdminPreOrdersController = AdminPreOrdersController = __decorate4([ + (0, common_12.Controller)("admin/pre-orders"), + __metadata3("design:paramtypes", [admin_preorders_service_1.AdminPreOrdersService]) + ], AdminPreOrdersController); + } +}); + +// dist/modules/admin-preorders/admin-preorders.module.js +var require_admin_preorders_module = __commonJS({ + "dist/modules/admin-preorders/admin-preorders.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminPreOrdersModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_preorders_controller_1 = require_admin_preorders_controller(); + var admin_preorders_service_1 = require_admin_preorders_service(); + var AdminPreOrdersModule = class AdminPreOrdersModule { + }; + exports2.AdminPreOrdersModule = AdminPreOrdersModule; + exports2.AdminPreOrdersModule = AdminPreOrdersModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_preorders_controller_1.AdminPreOrdersController], + providers: [admin_preorders_service_1.AdminPreOrdersService] + }) + ], AdminPreOrdersModule); + } +}); + +// dist/modules/admin-branches/admin-branches.service.js +var require_admin_branches_service = __commonJS({ + "dist/modules/admin-branches/admin-branches.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminBranchesService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var AdminBranchesService = class AdminBranchesService { + prisma; + table; + constructor(prisma, table) { + this.prisma = prisma; + this.table = table; + } + // ── Branches ─────────────────────────────────────────────────────── + /** Legacy `POST branch/table`. */ + async listBranches(query) { + this.table.assertNotExport(query); + const aliases = { "user.name": "adminUsers.some.fullName" }; + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["name", "address", "phone"], + allowed: ["id", "name", "address", "phone", "isActive", "cityId", "city.name"], + defaultOrderBy: { name: "asc" } + }); + void aliases; + const [rows, total] = await Promise.all([ + this.prisma.branch.findMany({ + where, + orderBy, + skip, + take, + include: { + city: true, + adminUsers: { where: { isActive: true }, take: 1 }, + _count: { select: { adminUsers: true, orders: true } } + } + }), + this.prisma.branch.count({ where }) + ]); + return this.table.respond(rows.map((b) => ({ + id: b.id, + name: b.name, + address: b.address, + phone: b.phone, + active: b.isActive ? 1 : 0, + is_active: b.isActive, + city_id: b.cityId, + city: b.city ? { id: b.city.id, title: b.city.name } : null, + // legacy column key is `user.name` — the branch manager + user: b.adminUsers[0] ? { id: b.adminUsers[0].id, name: b.adminUsers[0].fullName } : null, + users_count: b._count.adminUsers, + orders_count: b._count.orders + })), total, query, page, limit); + } + async findBranch(id) { + const b = await this.prisma.branch.findUnique({ + where: { id }, + include: { city: true, adminUsers: { where: { isActive: true }, take: 1 } } + }); + if (!b) + throw new common_12.NotFoundException("\u0634\u0639\u0628\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return { + id: b.id, + name: b.name, + address: b.address, + phone: b.phone, + is_active: b.isActive, + city_id: b.cityId, + user_id: b.adminUsers[0]?.id ?? null, + user: b.adminUsers[0] ? { id: b.adminUsers[0].id, name: b.adminUsers[0].fullName } : null + }; + } + /** Legacy `POST branch` — the manager is an EXISTING admin picked by id. */ + async createBranch(data) { + const name = String(data.name ?? "").trim(); + if (!name) + throw new common_12.BadRequestException("\u0646\u0627\u0645 \u0634\u0639\u0628\u0647 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + const branch = await this.prisma.branch.create({ + data: { + name, + address: data.address || null, + phone: data.phone || null, + cityId: data.city_id || null + } + }); + if (data.user_id) { + await this.assignBranchManager(branch.id, String(data.user_id)); + } + return this.findBranch(branch.id); + } + /** Legacy `PUT branch/{id}`. */ + async updateBranch(id, data) { + const existing = await this.prisma.branch.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u0634\u0639\u0628\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const patch = {}; + if (data.name !== void 0) + patch.name = String(data.name); + if (data.address !== void 0) + patch.address = data.address || null; + if (data.phone !== void 0) + patch.phone = data.phone || null; + if (data.city_id !== void 0) { + patch.city = data.city_id ? { connect: { id: String(data.city_id) } } : { disconnect: true }; + } + await this.prisma.branch.update({ where: { id }, data: patch }); + if (data.user_id !== void 0) { + await this.assignBranchManager(id, data.user_id || null); + } + return this.findBranch(id); + } + /** + * Moves the named admin onto this branch and clears whoever was on it before, + * so a branch keeps exactly one manager. Legacy did the same through its + * `->update(['branch_id' => null])` / `->update(['branch_id' => $id])` pair. + */ + async assignBranchManager(branchId, userId) { + await this.prisma.$transaction(async (tx) => { + await tx.adminUser.updateMany({ where: { branchId }, data: { branchId: null } }); + if (userId) { + const user = await tx.adminUser.findUnique({ where: { id: userId } }); + if (!user) + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u0627\u0646\u062A\u062E\u0627\u0628\u200C\u0634\u062F\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + await tx.adminUser.update({ where: { id: userId }, data: { branchId } }); + } + }); + } + /** Legacy `GET branch/active/{id}` — a toggle. */ + async toggleBranchActive(id) { + const b = await this.prisma.branch.findUnique({ where: { id } }); + if (!b) + throw new common_12.NotFoundException("\u0634\u0639\u0628\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.prisma.branch.update({ + where: { id }, + data: { isActive: !b.isActive } + }); + } + // ── Workshops ────────────────────────────────────────────────────── + /** Legacy `POST workshop/table`. */ + async listWorkshops(query) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["name", "address", "phone"], + allowed: ["id", "name", "address", "phone", "isActive"], + defaultOrderBy: { name: "asc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.workshop.findMany({ + where, + orderBy, + skip, + take, + include: { supervisor: true, _count: { select: { preOrders: true } } } + }), + this.prisma.workshop.count({ where }) + ]); + return this.table.respond(rows.map((w) => this.workshopRow(w)), total, query, page, limit); + } + workshopRow(w) { + return { + id: w.id, + name: w.name, + address: w.address, + phone: w.phone, + active: w.isActive ? 1 : 0, + is_active: w.isActive, + user: w.supervisor ? { id: w.supervisor.id, name: w.supervisor.fullName } : null, + user_id: w.supervisorId, + preorders_count: w._count.preOrders + }; + } + async findWorkshop(id) { + const w = await this.prisma.workshop.findUnique({ + where: { id }, + include: { supervisor: true, _count: { select: { preOrders: true } } } + }); + if (!w) + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u06AF\u0627\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const row = this.workshopRow(w); + const parts = String(w.supervisor?.fullName ?? "").trim().split(" "); + return { + ...row, + workshop_name: w.name, + workshop_address: w.address, + workshop_phone: w.phone, + user_fname: parts[0] ?? "", + user_lname: parts.slice(1).join(" "), + user_phone: w.supervisor?.mobile ?? "" + }; + } + /** + * Legacy `POST workshop` — creates the workshop AND its supervisor together, + * from user_fname / user_lname / user_phone. + */ + async createWorkshop(data) { + const name = String(data.workshop_name ?? data.name ?? "").trim(); + if (!name) + throw new common_12.BadRequestException("\u0646\u0627\u0645 \u06A9\u0627\u0631\u06AF\u0627\u0647 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + const supervisorId = await this.upsertSupervisor(data, null); + const w = await this.prisma.workshop.create({ + data: { + name, + address: data.workshop_address || data.address || null, + phone: data.workshop_phone || data.phone || null, + supervisorId + } + }); + return this.findWorkshop(w.id); + } + /** Legacy `PUT workshop/{id}`. */ + async updateWorkshop(id, data) { + const existing = await this.prisma.workshop.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u06AF\u0627\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const patch = {}; + if (data.workshop_name !== void 0 || data.name !== void 0) { + patch.name = String(data.workshop_name ?? data.name); + } + if (data.workshop_address !== void 0 || data.address !== void 0) { + patch.address = (data.workshop_address ?? data.address) || null; + } + if (data.workshop_phone !== void 0 || data.phone !== void 0) { + patch.phone = (data.workshop_phone ?? data.phone) || null; + } + const supervisorId = await this.upsertSupervisor(data, existing.supervisorId); + if (supervisorId !== void 0) { + patch.supervisor = supervisorId ? { connect: { id: supervisorId } } : { disconnect: true }; + } + await this.prisma.workshop.update({ where: { id }, data: patch }); + return this.findWorkshop(id); + } + /** + * Creates or updates the workshop's supervisor from the inline fields. + * Returns the id to link, or `undefined` when the form sent no supervisor data + * at all (so an update leaves the existing link alone). + */ + async upsertSupervisor(data, currentId) { + const fname = String(data.user_fname ?? "").trim(); + const lname = String(data.user_lname ?? "").trim(); + const phone = String(data.user_phone ?? "").trim(); + if (!fname && !lname && !phone) + return void 0; + if (!phone) + throw new common_12.BadRequestException("\u0645\u0648\u0628\u0627\u06CC\u0644 \u0633\u0631\u067E\u0631\u0633\u062A \u06A9\u0627\u0631\u06AF\u0627\u0647 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + const fullName = `${fname} ${lname}`.trim(); + if (currentId) { + const current = await this.prisma.adminUser.findUnique({ where: { id: currentId } }); + if (current) { + if (phone !== current.mobile) { + const clash = await this.prisma.adminUser.findUnique({ where: { mobile: phone } }); + if (clash && clash.id !== currentId) { + throw new common_12.BadRequestException("\u0627\u06CC\u0646 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0642\u0628\u0644\u0627\u064B \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A"); + } + } + await this.prisma.adminUser.update({ + where: { id: currentId }, + data: { fullName, mobile: phone } + }); + return currentId; + } + } + const existing = await this.prisma.adminUser.findUnique({ where: { mobile: phone } }); + if (existing) + return existing.id; + const created = await this.prisma.adminUser.create({ + data: { + fullName, + mobile: phone, + // No password is set: the supervisor cannot sign in until one is issued. + passwordHash: "", + role: client_1.AdminRole.WORKSHOP_SUPERVISOR + } + }); + return created.id; + } + /** Legacy `GET workshop/active/{id}` — a toggle. */ + async toggleWorkshopActive(id) { + const w = await this.prisma.workshop.findUnique({ where: { id } }); + if (!w) + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u06AF\u0627\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.prisma.workshop.update({ + where: { id }, + data: { isActive: !w.isActive } + }); + } + /** The admin picker the branch form uses — legacy `GET user/list`. */ + async userList() { + const rows = await this.prisma.adminUser.findMany({ + where: { isActive: true }, + orderBy: { fullName: "asc" }, + select: { id: true, fullName: true, mobile: true, branchId: true } + }); + return rows.map((u) => ({ + id: u.id, + name: u.fullName, + mobile: u.mobile, + branch_id: u.branchId + })); + } + }; + exports2.AdminBranchesService = AdminBranchesService; + exports2.AdminBranchesService = AdminBranchesService = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService + ]) + ], AdminBranchesService); + } +}); + +// dist/modules/admin-branches/admin-branches.controller.js +var require_admin_branches_controller = __commonJS({ + "dist/modules/admin-branches/admin-branches.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminBranchesController = void 0; + var common_12 = require_common(); + var admin_branches_service_1 = require_admin_branches_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminBranchesController = class AdminBranchesController { + branches; + constructor(branches) { + this.branches = branches; + } + // ── branches ────────────────────────────────────────────────────── + listBranches(query) { + return this.branches.listBranches(query); + } + userList() { + return this.branches.userList(); + } + createBranch(data) { + return this.branches.createBranch(data); + } + toggleBranchActive(id) { + return this.branches.toggleBranchActive(id); + } + findBranch(id) { + return this.branches.findBranch(id); + } + updateBranch(id, data) { + return this.branches.updateBranch(id, data); + } + }; + exports2.AdminBranchesController = AdminBranchesController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("branch.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminBranchesController.prototype, "listBranches", null); + __decorate4([ + (0, common_12.Get)("user-list"), + (0, guards_1.RequirePermission)("branch.create"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminBranchesController.prototype, "userList", null); + __decorate4([ + (0, common_12.Post)(), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("branch.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminBranchesController.prototype, "createBranch", null); + __decorate4([ + (0, common_12.Get)("active/:id"), + (0, guards_1.RequirePermission)("branch.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminBranchesController.prototype, "toggleBranchActive", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("branch.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminBranchesController.prototype, "findBranch", null); + __decorate4([ + (0, common_12.Put)(":id"), + (0, guards_1.RequirePermission)("branch.list"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminBranchesController.prototype, "updateBranch", null); + exports2.AdminBranchesController = AdminBranchesController = __decorate4([ + (0, common_12.Controller)("admin/branches"), + __metadata3("design:paramtypes", [admin_branches_service_1.AdminBranchesService]) + ], AdminBranchesController); + } +}); + +// dist/modules/admin-branches/admin-branches.module.js +var require_admin_branches_module = __commonJS({ + "dist/modules/admin-branches/admin-branches.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminBranchesModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_branches_controller_1 = require_admin_branches_controller(); + var admin_branches_service_1 = require_admin_branches_service(); + var AdminBranchesModule = class AdminBranchesModule { + }; + exports2.AdminBranchesModule = AdminBranchesModule; + exports2.AdminBranchesModule = AdminBranchesModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_branches_controller_1.AdminBranchesController], + providers: [admin_branches_service_1.AdminBranchesService], + // The workshops module reuses this service — branches and workshops are + // near-identical screens and share their logic. + exports: [admin_branches_service_1.AdminBranchesService] + }) + ], AdminBranchesModule); + } +}); + +// dist/modules/admin-workshops/admin-workshops.controller.js +var require_admin_workshops_controller = __commonJS({ + "dist/modules/admin-workshops/admin-workshops.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminWorkshopsController = void 0; + var common_12 = require_common(); + var admin_branches_service_1 = require_admin_branches_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminWorkshopsController = class AdminWorkshopsController { + branches; + constructor(branches) { + this.branches = branches; + } + list(query) { + return this.branches.listWorkshops(query); + } + create(data) { + return this.branches.createWorkshop(data); + } + toggleActive(id) { + return this.branches.toggleWorkshopActive(id); + } + findOne(id) { + return this.branches.findWorkshop(id); + } + update(id, data) { + return this.branches.updateWorkshop(id, data); + } + }; + exports2.AdminWorkshopsController = AdminWorkshopsController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminWorkshopsController.prototype, "list", null); + __decorate4([ + (0, common_12.Post)(), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("workshop.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminWorkshopsController.prototype, "create", null); + __decorate4([ + (0, common_12.Get)("active/:id"), + (0, guards_1.RequirePermission)("workshop.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminWorkshopsController.prototype, "toggleActive", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("workshop.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminWorkshopsController.prototype, "findOne", null); + __decorate4([ + (0, common_12.Put)(":id"), + (0, guards_1.RequirePermission)("workshop.list"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminWorkshopsController.prototype, "update", null); + exports2.AdminWorkshopsController = AdminWorkshopsController = __decorate4([ + (0, common_12.Controller)("admin/workshops"), + __metadata3("design:paramtypes", [admin_branches_service_1.AdminBranchesService]) + ], AdminWorkshopsController); + } +}); + +// dist/modules/admin-workshops/admin-workshops.module.js +var require_admin_workshops_module = __commonJS({ + "dist/modules/admin-workshops/admin-workshops.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminWorkshopsModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_branches_module_1 = require_admin_branches_module(); + var admin_workshops_controller_1 = require_admin_workshops_controller(); + var AdminWorkshopsModule = class AdminWorkshopsModule { + }; + exports2.AdminWorkshopsModule = AdminWorkshopsModule; + exports2.AdminWorkshopsModule = AdminWorkshopsModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule, admin_branches_module_1.AdminBranchesModule], + controllers: [admin_workshops_controller_1.AdminWorkshopsController] + }) + ], AdminWorkshopsModule); + } +}); + +// dist/modules/admin-customers/admin-customers.service.js +var require_admin_customers_service = __commonJS({ + "dist/modules/admin-customers/admin-customers.service.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { + var ownKeys2 = function(o) { + ownKeys2 = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys2(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); + } + __setModuleDefault2(result, mod); + return result; + }; + })(); + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminCustomersService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCustomersService = exports2.kindToLegacyType = exports2.legacyTypeToKind = exports2.CUSTOMER_TYPE_STR = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var bcrypt = __importStar2(require_umd()); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + exports2.CUSTOMER_TYPE_STR = { + SALES_AGENT: " \u06A9\u0627\u0631\u0634\u0646\u0627\u0633 \u0641\u0631\u0648\u0634", + APP_SHOPKEEPER: "\u0645\u063A\u0627\u0632\u0647 \u062F\u0627\u0631 \u0627\u067E\u0644\u06CC\u06A9\u06CC\u0634\u0646", + WALK_IN_SHOPKEEPER: " \u0645\u063A\u0627\u0632\u0647 \u062F\u0627\u0631 \u062D\u0636\u0648\u0631\u06CC", + BANKER: "\u0628\u0646\u06A9\u062F\u0627\u0631", + WORKSHOP_SUPERVISOR: "\u0633\u0631\u067E\u0631\u0633\u062A \u06A9\u0627\u0631\u06AF\u0627\u0647" + }; + var LEGACY_TYPE_ID = { + SALES_AGENT: 1, + APP_SHOPKEEPER: 2, + WALK_IN_SHOPKEEPER: 3, + BANKER: 4, + WORKSHOP_SUPERVISOR: 5 + }; + var legacyTypeToKind = (t) => Object.keys(LEGACY_TYPE_ID).find((k) => LEGACY_TYPE_ID[k] === Number(t)); + exports2.legacyTypeToKind = legacyTypeToKind; + var kindToLegacyType = (k) => LEGACY_TYPE_ID[k]; + exports2.kindToLegacyType = kindToLegacyType; + function verifyStepOne(step) { + switch (step) { + case client_1.VerificationStep.UNVERIFIED: + return 3; + // rejected / not yet submitted + case client_1.VerificationStep.STEP_ONE_SUBMITTED: + return 1; + // pending review + default: + return 2; + } + } + function verifyStepTwo(step) { + switch (step) { + case client_1.VerificationStep.STEP_TWO_SUBMITTED: + return 1; + // pending review + case client_1.VerificationStep.VERIFIED: + return 2; + // accepted + default: + return 3; + } + } + var AdminCustomersService = class AdminCustomersService { + static { + AdminCustomersService_1 = this; + } + prisma; + table; + constructor(prisma, table) { + this.prisma = prisma; + this.table = table; + } + static ALLOWED = [ + "id", + "fullName", + "mobile", + "nationalCode", + "cityId", + "isActive", + "createdAt", + "updatedAt", + "verificationStep", + "goldCreditLimitGrams", + "goldDebtGrams", + "fiatDebtRial", + "referredByAgent.fullName", + // legacy filter keys, accepted so the ported table models work unchanged + "name", + "city_id", + "active", + "gram_level", + "remain", + "rial_remain" + ]; + /** Translates legacy filter field names onto real schema paths. */ + static FIELD_ALIASES = { + name: "fullName", + fname: "fullName", + lname: "fullName", + city_id: "cityId", + active: "isActive", + gram_level: "goldCreditLimitGrams", + remain: "goldDebtGrams", + rial_remain: "fiatDebtRial", + caj: "createdAt", + uaj: "updatedAt", + "reagent.name": "referredByAgent.fullName" + }; + applyAliases(query) { + const mapField = (f) => f ? AdminCustomersService_1.FIELD_ALIASES[f] ?? f : f; + return { + ...query, + filters: (query.filters ?? []).map((f) => { + const mapped = { ...f, field: mapField(f.field) }; + if (mapped.field === "isActive" && mapped.value !== void 0) { + mapped.value = String(mapped.value) === "1"; + } + return mapped; + }), + order: query.order ? `${query.order.startsWith("-") ? "-" : "+"}${mapField(query.order.replace(/^[+-]/, ""))}` : void 0 + }; + } + /** The per-scope WHERE clause, one per legacy endpoint. */ + /** + * Verified against the legacy server (henza_server), not inferred from the + * views — AdminController::getBanker / getShopkeeper / getCustomer and + * MajorCustomerController::indexArchive / indexVerify: + * + * customer -> type=2 AND is_archive=0 (مغازه دار اپلیکیشن) + * banker -> type=4 AND is_archive=0 (بنکدار) + * shopkeeper -> type=3 AND is_archive=0 (مغازه دار حضوری) + * major/verify/table -> is_archive=0 AND (step_one=1 OR step_two=1) + * major/archive/table -> is_archive=1 (no type filter) + * + * NOTE every non-archive list also excludes archived rows, so archiving a + * customer removes them from ALL type lists at once. + */ + scopeWhere(scope) { + switch (scope) { + case "banker": + return { kind: client_1.CustomerKind.BANKER, isArchived: false }; + case "shopkeeper": + return { kind: client_1.CustomerKind.WALK_IN_SHOPKEEPER, isArchived: false }; + case "non_verified": + return { + isArchived: false, + verificationStep: { + in: [client_1.VerificationStep.STEP_ONE_SUBMITTED, client_1.VerificationStep.STEP_TWO_SUBMITTED] + } + }; + case "archived": + return { isArchived: true }; + case "all": + default: + return { kind: client_1.CustomerKind.APP_SHOPKEEPER, isArchived: false }; + } + } + async list(query, scope = "all") { + this.table.assertNotExport(query); + const aliased = this.applyAliases(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(aliased, { + searchable: ["fullName", "mobile", "nationalCode"], + allowed: AdminCustomersService_1.ALLOWED, + defaultOrderBy: { createdAt: "desc" } + }); + const scoped = { + AND: [where, this.scopeWhere(scope)] + }; + const [rows, total] = await Promise.all([ + this.prisma.customer.findMany({ + where: scoped, + orderBy, + skip, + take, + include: { city: true, referredByAgent: true, avatarFile: true } + }), + this.prisma.customer.count({ where: scoped }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + /** Legacy field names preserved so the ported table models bind unchanged. */ + toRow(c) { + return { + id: c.id, + // Legacy stored fname/lname separately; the new schema has one fullName. + name: c.fullName, + fname: c.fullName, + lname: "", + mobile: c.mobile, + national_code: c.nationalCode, + city_id: c.cityId, + city: c.city ? { id: c.city.id, title: c.city.name } : null, + reagent: c.referredByAgent ? { id: c.referredByAgent.id, name: c.referredByAgent.fullName } : null, + gram_level: c.goldCreditLimitGrams, + remain: c.goldDebtGrams, + rial_remain: c.fiatDebtRial, + // legacy `percent` came from the referring agent's commission rate + percent: c.referredByAgent?.wagePercent ?? null, + // legacy kept these as two INDEPENDENT switches — see toggleSts/toggleActive + active: c.isActive ? 1 : -1, + sts: c.canPlaceOrders ? 1 : -1, + sts_str: c.canPlaceOrders ? "\u0645\u062C\u0627\u0632" : "\u063A\u06CC\u0631 \u0645\u062C\u0627\u0632", + type: (0, exports2.kindToLegacyType)(c.kind), + type_str: exports2.CUSTOMER_TYPE_STR[c.kind], + is_archive: c.isArchived ? 1 : 0, + sts_verify_step_one: verifyStepOne(c.verificationStep), + sts_verify_step_two: verifyStepTwo(c.verificationStep), + verificationStep: c.verificationStep, + national_id_image: c.nationalIdImageUrl, + business_license: c.businessLicenseUrl, + shop_image: c.shopImageUrl, + caj: c.createdAt, + uaj: c.updatedAt, + // Legacy returned the avatar as a nested object and the form read + // `data.image.image` for the preview URL — kept in that exact shape. + image_id: c.avatarFileId, + image: c.avatarFile ? { id: c.avatarFile.id, image: c.avatarFile.url } : null, + phone: c.phone, + address: c.address, + store_name: c.storeName, + zone: c.zone, + pasazh_name: c.pasazhName, + mcode: c.memberCode + }; + } + async findOne(id) { + const c = await this.prisma.customer.findUnique({ + where: { id }, + include: { + city: true, + referredByAgent: true, + avatarFile: true, + addresses: { include: { city: true } } + } + }); + if (!c) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return { + ...this.toRow(c), + addresses: c.addresses.map((a) => ({ + id: a.id, + city: a.city ? { id: a.city.id, title: a.city.name } : null + })) + }; + } + /** + * Legacy `POST reagent` — the sales-expert ("کارشناس فروش") list. + * + * In legacy these lived in the same `customer` table under `type=1`, which is + * why the view reuses the customer column set. The redesigned schema models a + * sales expert as an AdminUser with role SALES_EXPERT, so this reads from there + * and maps onto the same legacy field names the ported table expects. + */ + async listReagents(query) { + this.table.assertNotExport(query); + const aliases = { + name: "fullName", + lname: "fullName", + caj: "createdAt", + active: "isActive", + percent: "wagePercent" + }; + const mapField = (f) => f ? aliases[f] ?? f : f; + const aliased = { + ...query, + filters: (query.filters ?? []).map((f) => { + const mapped2 = { ...f, field: mapField(f.field) }; + if (mapped2.field === "isActive" && mapped2.value !== void 0) { + mapped2.value = String(mapped2.value) === "1"; + } + return mapped2; + }), + order: query.order ? `${query.order.startsWith("-") ? "-" : "+"}${mapField(query.order.replace(/^[+-]/, ""))}` : void 0 + }; + const { where, orderBy, skip, take, page, limit } = this.table.build(aliased, { + searchable: ["fullName", "mobile"], + allowed: ["id", "fullName", "mobile", "isActive", "createdAt", "wagePercent", "role"], + defaultOrderBy: { createdAt: "desc" } + }); + const scoped = { + AND: [where, { role: "SALES_EXPERT" }] + }; + const [rows, total] = await Promise.all([ + this.prisma.adminUser.findMany({ + where: scoped, + orderBy, + skip, + take, + include: { branch: true, _count: { select: { referredCustomers: true } } } + }), + this.prisma.adminUser.count({ where: scoped }) + ]); + const mapped = await Promise.all(rows.map(async (r) => { + const agg = await this.prisma.order.aggregate({ + where: { customer: { referredByAgentId: r.id } }, + _sum: { totalGoldWeightGrams: true } + }); + return { + id: r.id, + name: r.fullName, + fname: r.fullName, + lname: "", + mobile: r.mobile, + city_id: null, + city: null, + percent: r.wagePercent, + grams_sell: agg._sum.totalGoldWeightGrams ?? 0, + child: r._count.referredCustomers, + active: r.isActive ? 1 : -1, + sts: r.isActive ? 1 : -1, + sts_str: r.isActive ? "\u0645\u062C\u0627\u0632" : "\u063A\u06CC\u0631 \u0645\u062C\u0627\u0632", + caj: r.createdAt, + uaj: r.createdAt, + branch: r.branch ? { id: r.branch.id, name: r.branch.name } : null, + // Legacy columns an AdminUser has no counterpart for. + gram_level: null, + remain: null, + rial_remain: null, + phone: null, + address: null + }; + })); + return this.table.respond(mapped, total, query, page, limit); + } + /** + * Legacy `POST single-customer` — the retail ("تک") customer list. + * + * Legacy read this from a different table than the wholesale list + * (`orders_orders`-era SingleCustomerOrders lived alongside a separate customer + * record). The redesigned schema has one Customer model, so both lists read the + * same rows; only the column set and actions differ, exactly as the two legacy + * table models did. Same gap noted for orders in docs/ADMIN-PORT-PLAN.md. + */ + async listSingle(query, branchId) { + this.table.assertNotExport(query); + const aliased = this.applyAliases(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(aliased, { + searchable: ["fullName", "mobile"], + allowed: [...AdminCustomersService_1.ALLOWED, "branch.name"], + defaultOrderBy: { createdAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.customer.findMany({ + where, + orderBy, + skip, + take, + include: { + city: true, + avatarFile: true, + referredByAgent: { include: { branch: true } } + } + }), + this.prisma.customer.count({ where }) + ]); + return this.table.respond(rows.map((r) => ({ + ...this.toRow(r), + // legacy single-customer columns: fname/lname/phone/email/branch.name + email: null, + branch: r.referredByAgent?.branch ? { id: r.referredByAgent.branch.id, name: r.referredByAgent.branch.name } : null + })), total, query, page, limit); + } + /** Legacy `POST customer/create` (omdeSave) and `POST/PUT user/profile`. */ + async create(data) { + const fullName = String(data.name ?? data.fname ?? "").trim(); + const mobile = String(data.mobile ?? "").trim(); + const nationalCode = String(data.national_code ?? data.nationalCode ?? "").trim(); + if (!fullName || !mobile) { + throw new common_12.BadRequestException("\u0646\u0627\u0645 \u0648 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + } + return this.prisma.customer.create({ + data: { + fullName, + mobile, + nationalCode: nationalCode || mobile, + // schema requires it and it is unique + // The form collects a password (bulkCustomer.vue / ReagentCustomer.vue). + // It used to be discarded and '' stored, so the operator typed a password + // that silently did nothing. Hashed here when supplied; '' still means + // "no password yet", which no bcrypt hash can ever match. + passwordHash: data.password ? await bcrypt.hash(String(data.password), 10) : "", + cityId: data.city_id ?? null, + goldCreditLimitGrams: data.gram_level ? new client_1.Prisma.Decimal(String(data.gram_level)) : new client_1.Prisma.Decimal(0), + // legacy `type` — defaults to 2 (مغازه دار اپلیکیشن), matching the + // main omde list, when the form omits it. + kind: (0, exports2.legacyTypeToKind)(data.type) ?? client_1.CustomerKind.APP_SHOPKEEPER, + phone: data.phone ?? null, + address: data.address ?? null, + storeName: data.store_name ?? null, + pasazhName: data.pasazh_name ?? null, + zone: data.zone ?? null, + memberCode: data.mcode ?? null, + // legacy `image_id` from MyUpload's `ok` payload + avatarFileId: data.image_id || null, + // The sales agent who introduced this customer. The form's dropdown was + // populated from a working endpoint and the selection then thrown away. + referredByAgentId: data.reagent_id || null + } + }); + } + async update(id, data) { + const existing = await this.prisma.customer.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const patch = {}; + if (data.name !== void 0) + patch.fullName = String(data.name); + if (data.mobile !== void 0) + patch.mobile = String(data.mobile); + if (data.national_code !== void 0) + patch.nationalCode = String(data.national_code); + if (data.city_id !== void 0) { + patch.city = data.city_id ? { connect: { id: String(data.city_id) } } : { disconnect: true }; + } + if (data.gram_level !== void 0) { + patch.goldCreditLimitGrams = new client_1.Prisma.Decimal(String(data.gram_level)); + } + if (data.type !== void 0) { + const kind = (0, exports2.legacyTypeToKind)(data.type); + if (!kind) + throw new common_12.BadRequestException("\u0646\u0648\u0639 \u0645\u0634\u062A\u0631\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A"); + patch.kind = kind; + } + if (data.phone !== void 0) + patch.phone = String(data.phone); + if (data.address !== void 0) + patch.address = String(data.address); + if (data.store_name !== void 0) + patch.storeName = String(data.store_name); + if (data.pasazh_name !== void 0) + patch.pasazhName = String(data.pasazh_name); + if (data.zone !== void 0) + patch.zone = String(data.zone); + if (data.mcode !== void 0) + patch.memberCode = String(data.mcode); + if (data.reagent_id !== void 0) { + patch.referredByAgent = data.reagent_id ? { connect: { id: String(data.reagent_id) } } : { disconnect: true }; + } + if (data.password) { + patch.passwordHash = await bcrypt.hash(String(data.password), 10); + } + if (data.image_id !== void 0) { + patch.avatarFile = data.image_id ? { connect: { id: String(data.image_id) } } : { disconnect: true }; + } + return this.prisma.customer.update({ where: { id }, data: patch }); + } + /** + * The three per-customer panels the "مشاهده اطلاعات" screens show, ported from + * legacy `single/order/{id}`, `single/report/{id}` and `single/wallet/{id}`. + */ + async customerOrders(customerId) { + const rows = await this.prisma.order.findMany({ + where: { customerId }, + orderBy: { createdAt: "desc" }, + include: { items: true, branch: true } + }); + return rows.map((o) => ({ + id: o.id, + name: o.orderNumber, + w: o.totalGoldWeightGrams, + status: o.status, + items_count: o.items.length, + branch: o.branch?.name ?? null, + caj: o.createdAt + })); + } + async customerDocuments(customerId) { + const rows = await this.prisma.ledgerEntry.findMany({ + where: { customerId }, + orderBy: { createdAt: "desc" } + }); + return rows.map((e) => ({ + id: e.id, + type: e.sourceType, + currency: e.currency, + direction: e.direction, + value: e.amount, + confirmed: e.confirmed ? 1 : 0, + note: e.note, + caj: e.createdAt + })); + } + async customerWallet(customerId) { + const rows = await this.prisma.walletBonus.findMany({ + where: { customerId }, + orderBy: { grantedAt: "desc" } + }); + return rows.map((w) => ({ + id: w.id, + value: w.goldGrams, + is_active: w.isActive, + consumed: Boolean(w.consumedAt), + caj: w.grantedAt, + expires_at: w.expiresAt + })); + } + /** Legacy `GET query/reagent` — sales experts, for the customer form's picker. */ + async queryReagents() { + const rows = await this.prisma.adminUser.findMany({ + where: { role: "SALES_EXPERT", isActive: true }, + orderBy: { fullName: "asc" }, + select: { id: true, fullName: true } + }); + return rows.map((r) => ({ id: r.id, name: r.fullName })); + } + /** + * Legacy `POST wallet/charge` — grant a wallet bonus to a customer. + * + * Legacy posted `{ customer_id, value }`. The redesigned schema models a + * wallet grant as a WalletBonus in GOLD GRAMS with an expiry, so `value` is + * read as grams. Legacy had no expiry column; a one-year window is applied + * here because `expiresAt` is required — flagged in docs/ADMIN-PORT-PLAN.md. + */ + async chargeWallet(data) { + const customer = await this.prisma.customer.findUnique({ where: { id: data.customer_id } }); + if (!customer) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const grams = new client_1.Prisma.Decimal(String(data.value ?? 0)); + if (grams.lte(0)) { + throw new common_12.BadRequestException("\u0645\u06CC\u0632\u0627\u0646 \u0634\u0627\u0631\u0698 \u0628\u0627\u06CC\u062F \u0628\u0632\u0631\u06AF\u062A\u0631 \u0627\u0632 \u0635\u0641\u0631 \u0628\u0627\u0634\u062F"); + } + const expiresAt = /* @__PURE__ */ new Date(); + expiresAt.setFullYear(expiresAt.getFullYear() + 1); + return this.prisma.walletBonus.create({ + data: { customerId: data.customer_id, goldGrams: grams, expiresAt } + }); + } + /** + * Legacy `POST customer/toggle-active` — the ACCOUNT switch + * (AdminController::customerToggleActive). + * + * Legacy also nulled `api_token` (force-logout) and, when reactivating, sent + * the customer an SMS. The SMS is deliberately NOT fired inline here — it + * belongs to the notification module — and is noted in docs/ADMIN-PORT-PLAN.md. + */ + async toggleActive(id) { + const c = await this.prisma.customer.findUnique({ where: { id } }); + if (!c) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.prisma.customer.update({ + where: { id }, + data: { isActive: !c.isActive } + }); + } + /** + * Legacy `POST customer/toggle-sts` — the ORDERING switch + * ("معلق کردن سفارش" / "فعال کردن سفارش"), AdminController::customerToggleSts. + * Independent of the account switch above. + */ + async toggleSts(id) { + const c = await this.prisma.customer.findUnique({ where: { id } }); + if (!c) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.prisma.customer.update({ + where: { id }, + data: { canPlaceOrders: !c.canPlaceOrders } + }); + } + /** + * Legacy `POST major/verify`. + * + * Legacy's payload is `{ customer_id, sts_verify_step_one }` or + * `{ customer_id, sts_verify_step_two }`, where the value is 2 (accept) or + * 3 (reject) — see OmdeList.vue acceptStepOne/rejectStepOne. Accepted here in + * exactly that shape so the ported view posts unchanged. + */ + async verify(payload) { + const id = payload.customer_id; + const c = await this.prisma.customer.findUnique({ where: { id } }); + if (!c) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + let next; + if (payload.sts_verify_step_one !== void 0) { + next = payload.sts_verify_step_one === 2 ? client_1.VerificationStep.STEP_TWO_SUBMITTED : client_1.VerificationStep.UNVERIFIED; + } else if (payload.sts_verify_step_two !== void 0) { + next = payload.sts_verify_step_two === 2 ? client_1.VerificationStep.VERIFIED : client_1.VerificationStep.STEP_ONE_SUBMITTED; + } else { + throw new common_12.BadRequestException("\u0645\u0631\u062D\u0644\u0647\u200C\u06CC \u062A\u0627\u06CC\u06CC\u062F \u0645\u0634\u062E\u0635 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + } + return this.prisma.customer.update({ where: { id }, data: { verificationStep: next } }); + } + /** Legacy `GET major/archive/{id}` — MajorCustomerController::archive. */ + async toggleArchive(id) { + const c = await this.prisma.customer.findUnique({ where: { id } }); + if (!c) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.prisma.customer.update({ + where: { id }, + data: { isArchived: !c.isArchived } + }); + } + /** Legacy `GET major/dashboard/{id}` — the per-customer summary panel. */ + async dashboard(id) { + const c = await this.prisma.customer.findUnique({ where: { id } }); + if (!c) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const [orderCount, openOrders, ledgerCount] = await Promise.all([ + this.prisma.order.count({ where: { customerId: id } }), + this.prisma.order.count({ + where: { customerId: id, deliveredAt: null, status: { not: "CANCELLED" } } + }), + this.prisma.ledgerEntry.count({ where: { customerId: id } }) + ]); + return { + total_order: orderCount, + open_order: openOrders, + ledger_entries: ledgerCount, + gram_level: c.goldCreditLimitGrams, + remain: c.goldDebtGrams, + rial_remain: c.fiatDebtRial + }; + } + /** Legacy `PATCH` of the credit level / commission from the list row menu. */ + async updateCredit(id, data) { + const c = await this.prisma.customer.findUnique({ where: { id } }); + if (!c) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (data.gram_level === void 0) { + throw new common_12.BadRequestException("\u0645\u0642\u062F\u0627\u0631 \u0633\u0637\u062D \u0627\u0639\u062A\u0628\u0627\u0631 \u0627\u0631\u0633\u0627\u0644 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + } + return this.prisma.customer.update({ + where: { id }, + data: { goldCreditLimitGrams: new client_1.Prisma.Decimal(data.gram_level) } + }); + } + }; + exports2.AdminCustomersService = AdminCustomersService; + exports2.AdminCustomersService = AdminCustomersService = AdminCustomersService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService + ]) + ], AdminCustomersService); + } +}); + +// dist/modules/admin-customers/admin-customers.controller.js +var require_admin_customers_controller = __commonJS({ + "dist/modules/admin-customers/admin-customers.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCustomersController = void 0; + var common_12 = require_common(); + var admin_customers_service_1 = require_admin_customers_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminCustomersController = class AdminCustomersController { + customers; + constructor(customers) { + this.customers = customers; + } + list(query, scope) { + return this.customers.list(query, scope); + } + listAll(query) { + return this.list(query, "all"); + } + listBanker(query) { + return this.list(query, "banker"); + } + listShopkeeper(query) { + return this.list(query, "shopkeeper"); + } + listNonVerified(query) { + return this.list(query, "non_verified"); + } + listArchived(query) { + return this.list(query, "archived"); + } + /** Legacy POST single-customer — the retail customer list. */ + listSingle(query, admin) { + return this.customers.listSingle(query, admin.branchId ?? void 0); + } + /** + * Legacy `GET query/reagent` — the sales-expert picker used by the customer + * form. Returns a plain array of {id, name}, as legacy did. + */ + queryReagents() { + return this.customers.queryReagents(); + } + /** Legacy POST wallet/charge. */ + chargeWallet(body) { + return this.customers.chargeWallet(body); + } + create(data) { + return this.customers.create(data); + } + update(id, data) { + return this.customers.update(id, data); + } + /** Legacy POST reagent — the sales-expert list. */ + listReagents(query) { + return this.customers.listReagents(query); + } + /** Legacy `GET single/order/{id}` — that customer's orders. */ + customerOrders(id) { + return this.customers.customerOrders(id); + } + /** Legacy `GET single/report/{id}` — that customer's ledger documents. */ + customerDocuments(id) { + return this.customers.customerDocuments(id); + } + /** Legacy `GET single/wallet/{id}` — that customer's wallet bonuses. */ + customerWallet(id) { + return this.customers.customerWallet(id); + } + dashboard(id) { + return this.customers.dashboard(id); + } + toggleArchive(id) { + return this.customers.toggleArchive(id); + } + toggleActive(body) { + return this.customers.toggleActive(body.id); + } + toggleSts(body) { + return this.customers.toggleSts(body.id); + } + verify(body) { + return this.customers.verify(body); + } + updateCredit(body) { + return this.customers.updateCredit(body.id, body); + } + findOne(id) { + return this.customers.findOne(id); + } + }; + exports2.AdminCustomersController = AdminCustomersController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.client.omde"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "listAll", null); + __decorate4([ + (0, common_12.Post)("banker/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.client.omde"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "listBanker", null); + __decorate4([ + (0, common_12.Post)("shopkeeper/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.client.omde"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "listShopkeeper", null); + __decorate4([ + (0, common_12.Post)("non-verified/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.client.omde"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "listNonVerified", null); + __decorate4([ + (0, common_12.Post)("archived/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.client.omde"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "listArchived", null); + __decorate4([ + (0, common_12.Post)("single/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.client.single"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto, Object]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "listSingle", null); + __decorate4([ + (0, common_12.Get)("query/reagent"), + (0, guards_1.RequirePermission)("persons.create"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "queryReagents", null); + __decorate4([ + (0, common_12.Post)("wallet/charge"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("wallet"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "chargeWallet", null); + __decorate4([ + (0, common_12.Post)("create"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "create", null); + __decorate4([ + (0, common_12.Put)(":id"), + (0, guards_1.RequirePermission)("persons.list.client.omde.edit"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "update", null); + __decorate4([ + (0, common_12.Post)("reagent/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.sellers"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "listReagents", null); + __decorate4([ + (0, common_12.Get)(":id/orders"), + (0, guards_1.RequirePermission)("persons.list.client.omde.view.orders"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "customerOrders", null); + __decorate4([ + (0, common_12.Get)(":id/documents"), + (0, guards_1.RequirePermission)("persons.list.client.omde.view.documents"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "customerDocuments", null); + __decorate4([ + (0, common_12.Get)(":id/wallet"), + (0, guards_1.RequirePermission)("wallet"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "customerWallet", null); + __decorate4([ + (0, common_12.Get)("dashboard/:id"), + (0, guards_1.RequirePermission)("persons.list.client.omde.view"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "dashboard", null); + __decorate4([ + (0, common_12.Get)("archive/:id"), + (0, guards_1.RequirePermission)("persons.list.client.omde.edit"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "toggleArchive", null); + __decorate4([ + (0, common_12.Post)("toggle-active"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.client.omde.edit"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "toggleActive", null); + __decorate4([ + (0, common_12.Post)("toggle-sts"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.client.omde.edit"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "toggleSts", null); + __decorate4([ + (0, common_12.Post)("verify"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.client.omde.edit"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "verify", null); + __decorate4([ + (0, common_12.Post)("credit"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("persons.list.client.omde.edit"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "updateCredit", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("persons.list.client.omde.view"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCustomersController.prototype, "findOne", null); + exports2.AdminCustomersController = AdminCustomersController = __decorate4([ + (0, common_12.Controller)("admin/customers-omde"), + __metadata3("design:paramtypes", [admin_customers_service_1.AdminCustomersService]) + ], AdminCustomersController); + } +}); + +// dist/modules/admin-customers/admin-customers.module.js +var require_admin_customers_module = __commonJS({ + "dist/modules/admin-customers/admin-customers.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCustomersModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_customers_controller_1 = require_admin_customers_controller(); + var admin_customers_service_1 = require_admin_customers_service(); + var AdminCustomersModule = class AdminCustomersModule { + }; + exports2.AdminCustomersModule = AdminCustomersModule; + exports2.AdminCustomersModule = AdminCustomersModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_customers_controller_1.AdminCustomersController], + providers: [admin_customers_service_1.AdminCustomersService], + exports: [admin_customers_service_1.AdminCustomersService] + }) + ], AdminCustomersModule); + } +}); + +// dist/modules/admin-comments/admin-comments.service.js +var require_admin_comments_service = __commonJS({ + "dist/modules/admin-comments/admin-comments.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminCommentsService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCommentsService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var STATUS_BY_CODE = { + 1: client_1.CommentStatus.PENDING, + 2: client_1.CommentStatus.APPROVED, + 3: client_1.CommentStatus.REJECTED + }; + var CODE_BY_STATUS = { + PENDING: 1, + APPROVED: 2, + REJECTED: 3 + }; + var STATUS_LABELS = { + PENDING: "\u062F\u0631 \u0627\u0646\u062A\u0638\u0627\u0631 \u062A\u0627\u06CC\u06CC\u062F", + APPROVED: "\u062A\u0627\u06CC\u06CC\u062F \u0634\u062F\u0647", + REJECTED: "\u0631\u062F \u0634\u062F\u0647" + }; + var AdminCommentsService = class AdminCommentsService { + static { + AdminCommentsService_1 = this; + } + prisma; + table; + constructor(prisma, table) { + this.prisma = prisma; + this.table = table; + } + static ALLOWED = [ + "id", + "status", + "createdAt", + "updatedAt", + "body", + "customer.fullName", + "customer.mobile", + "product.title", + // legacy filter keys + "sts", + "comment", + "caj" + ]; + static FIELD_ALIASES = { + sts: "status", + comment: "body", + caj: "createdAt", + uaj: "updatedAt", + "customer.name": "customer.fullName", + "product.name": "product.title" + }; + /** Legacy `POST comment/table`. */ + async list(query) { + this.table.assertNotExport(query); + const mapField = (f) => f ? AdminCommentsService_1.FIELD_ALIASES[f] ?? f : f; + const aliased = { + ...query, + filters: (query.filters ?? []).map((f) => { + const mapped = { ...f, field: mapField(f.field) }; + if (mapped.field === "status" && mapped.value !== void 0) { + mapped.value = STATUS_BY_CODE[Number(mapped.value)] ?? mapped.value; + } + return mapped; + }), + order: query.order ? `${query.order.startsWith("-") ? "-" : "+"}${mapField(query.order.replace(/^[+-]/, ""))}` : void 0 + }; + const { where, orderBy, skip, take, page, limit } = this.table.build(aliased, { + searchable: ["body", "customer.fullName", "product.title"], + allowed: AdminCommentsService_1.ALLOWED, + defaultOrderBy: { createdAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.comment.findMany({ + where, + orderBy, + skip, + take, + include: { customer: true, product: true, replyTo: true, replies: true } + }), + this.prisma.comment.count({ where }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + toRow(c) { + return { + id: c.id, + comment: c.body, + body: c.body, + sts: CODE_BY_STATUS[c.status], + sts_str: STATUS_LABELS[c.status], + status: c.status, + reply_to: c.replyToId, + // legacy view reads: text.length > 0 && text[0].comment !== null + reply: (c.replies ?? []).map((r) => ({ id: r.id, comment: r.body })), + product_id: c.productId, + customer_id: c.customerId, + product: { id: c.product.id, title: c.product.title, name: c.product.title }, + customer: { + id: c.customer.id, + name: c.customer.fullName, + fname: c.customer.fullName, + lname: "", + mobile: c.customer.mobile + }, + caj: c.createdAt, + uaj: c.updatedAt + }; + } + async findOne(id) { + const c = await this.prisma.comment.findUnique({ + where: { id }, + include: { customer: true, product: true, replyTo: true, replies: true } + }); + if (!c) + throw new common_12.NotFoundException("\u062F\u06CC\u062F\u06AF\u0627\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.toRow(c); + } + /** + * Legacy `POST comment/sts` — moderate a comment. + * Payload is `{ id, sts }` where sts is 1/2/3. + */ + async changeStatus(id, sts) { + const c = await this.prisma.comment.findUnique({ where: { id } }); + if (!c) + throw new common_12.NotFoundException("\u062F\u06CC\u062F\u06AF\u0627\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const status = STATUS_BY_CODE[Number(sts)]; + if (!status) { + throw new common_12.NotFoundException("\u0648\u0636\u0639\u06CC\u062A \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A"); + } + return this.prisma.comment.update({ where: { id }, data: { status } }); + } + /** Legacy `POST comment` — post a staff reply to a comment. */ + async create(data) { + return this.prisma.comment.create({ + data: { + productId: data.product_id, + customerId: data.customer_id, + body: data.comment, + replyToId: data.reply_to ?? null, + // A staff reply is visible immediately; legacy did the same. + status: client_1.CommentStatus.APPROVED + } + }); + } + /** Legacy `DELETE comment/{id}`. */ + async remove(id) { + const c = await this.prisma.comment.findUnique({ + where: { id }, + include: { replies: true } + }); + if (!c) + throw new common_12.NotFoundException("\u062F\u06CC\u062F\u06AF\u0627\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + await this.prisma.$transaction([ + this.prisma.comment.deleteMany({ where: { replyToId: id } }), + this.prisma.comment.delete({ where: { id } }) + ]); + return { success: true }; + } + /** Farsi labels for the status dropdown, keyed by legacy's numeric codes. */ + statusOptions() { + return Object.entries(STATUS_LABELS).map(([status, title]) => ({ + value: CODE_BY_STATUS[status], + title + })); + } + }; + exports2.AdminCommentsService = AdminCommentsService; + exports2.AdminCommentsService = AdminCommentsService = AdminCommentsService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService + ]) + ], AdminCommentsService); + } +}); + +// dist/modules/admin-comments/admin-comments.controller.js +var require_admin_comments_controller = __commonJS({ + "dist/modules/admin-comments/admin-comments.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCommentsController = void 0; + var common_12 = require_common(); + var admin_comments_service_1 = require_admin_comments_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminCommentsController = class AdminCommentsController { + comments; + constructor(comments) { + this.comments = comments; + } + list(query) { + return this.comments.list(query); + } + statusOptions() { + return this.comments.statusOptions(); + } + changeStatus(body) { + return this.comments.changeStatus(body.id, body.sts); + } + create(body) { + return this.comments.create(body); + } + findOne(id) { + return this.comments.findOne(id); + } + remove(id) { + return this.comments.remove(id); + } + }; + exports2.AdminCommentsController = AdminCommentsController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("comment"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminCommentsController.prototype, "list", null); + __decorate4([ + (0, common_12.Get)("status-options"), + (0, guards_1.RequirePermission)("comment"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminCommentsController.prototype, "statusOptions", null); + __decorate4([ + (0, common_12.Post)("sts"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("comment"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminCommentsController.prototype, "changeStatus", null); + __decorate4([ + (0, common_12.Post)(), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("comment"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminCommentsController.prototype, "create", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("comment"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCommentsController.prototype, "findOne", null); + __decorate4([ + (0, common_12.Delete)(":id"), + (0, guards_1.RequirePermission)("comment"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCommentsController.prototype, "remove", null); + exports2.AdminCommentsController = AdminCommentsController = __decorate4([ + (0, common_12.Controller)("admin/comments"), + __metadata3("design:paramtypes", [admin_comments_service_1.AdminCommentsService]) + ], AdminCommentsController); + } +}); + +// dist/modules/admin-comments/admin-comments.module.js +var require_admin_comments_module = __commonJS({ + "dist/modules/admin-comments/admin-comments.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCommentsModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_comments_controller_1 = require_admin_comments_controller(); + var admin_comments_service_1 = require_admin_comments_service(); + var AdminCommentsModule = class AdminCommentsModule { + }; + exports2.AdminCommentsModule = AdminCommentsModule; + exports2.AdminCommentsModule = AdminCommentsModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_comments_controller_1.AdminCommentsController], + providers: [admin_comments_service_1.AdminCommentsService] + }) + ], AdminCommentsModule); + } +}); + +// dist/modules/admin-products/admin-products.service.js +var require_admin_products_service = __commonJS({ + "dist/modules/admin-products/admin-products.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminProductsService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminProductsService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var SHOW_TYPE_LABELS = { + 1: "\u0633\u0627\u06CC\u062A", + 2: "\u06AF\u0648\u0634\u06CC", + 3: "\u0633\u0627\u06CC\u062A \u0648 \u06AF\u0648\u0634\u06CC" + }; + var AdminProductsService = class AdminProductsService { + static { + AdminProductsService_1 = this; + } + prisma; + table; + constructor(prisma, table) { + this.prisma = prisma; + this.table = table; + } + static ALLOWED = [ + "id", + "title", + "productCode", + "showType", + "isActive", + "createdAt", + "brand.title", + "category.title", + // legacy filter keys + "product_code", + "show_type" + ]; + static FIELD_ALIASES = { + product_code: "productCode", + show_type: "showType", + "category.collection.title": "category.title", + caj: "createdAt" + }; + applyAliases(query) { + const mapField = (f) => f ? AdminProductsService_1.FIELD_ALIASES[f] ?? f : f; + return { + ...query, + filters: (query.filters ?? []).map((f) => { + const mapped = { ...f, field: mapField(f.field) }; + if (mapped.field === "showType" && mapped.value !== void 0) { + mapped.value = Number(mapped.value); + } + return mapped; + }), + order: query.order ? `${query.order.startsWith("-") ? "-" : "+"}${mapField(query.order.replace(/^[+-]/, ""))}` : void 0 + }; + } + /** Legacy `POST products` — the product grid. */ + async list(query) { + this.table.assertNotExport(query); + const aliased = this.applyAliases(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(aliased, { + searchable: ["title", "productCode"], + allowed: AdminProductsService_1.ALLOWED, + defaultOrderBy: { createdAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.product.findMany({ + where, + orderBy, + skip, + take, + include: { + brand: true, + category: true, + images: { orderBy: { sortOrder: "asc" } }, + variants: true + } + }), + this.prisma.product.count({ where }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + /** Legacy field names preserved so ported table models bind unchanged. */ + toRow(p) { + return { + id: p.id, + title: p.title, + product_code: p.productCode, + show_type: p.showType, + show_type_str: SHOW_TYPE_LABELS[p.showType] ?? "-", + is_active: p.isActive, + description: p.description, + brand: p.brand ? { id: p.brand.id, title: p.brand.title } : null, + // Legacy nested this as category.collection.title in the grid model. + category: p.category ? { id: p.category.id, title: p.category.title, collection: { title: p.category.title } } : null, + // legacy grid slot reads `ProductImage` + ProductImage: p.images.map((i) => ({ id: i.id, image: i.url, full: i.url, url: i.url })), + images: p.images.map((i) => ({ id: i.id, url: i.url, sortOrder: i.sortOrder })), + // The order builder's grid reads `thumb.full` and `variants_all` directly + // off each row, so both travel with the list as they did in legacy. + thumb: p.images[0] ? { full: p.images[0].url } : null, + variants_all: p.variants.map((v) => this.variantRow(v)), + variants_count: p.variants.length, + // legacy min_gram / max_gram: the product's lightest and heaviest variant, + // shown by the storefront and by the branch-allocation picker. + min_gram: p.variants.length ? p.variants.reduce((min, v) => v.rashWeightGrams.lt(min) ? v.rashWeightGrams : min, p.variants[0].rashWeightGrams) : null, + max_gram: p.variants.length ? p.variants.reduce((max, v) => v.rashWeightGrams.gt(max) ? v.rashWeightGrams : max, p.variants[0].rashWeightGrams) : null, + caj: p.createdAt + }; + } + /** Legacy `GET product/show/{id}`. */ + async findOne(id) { + const p = await this.prisma.product.findUnique({ + where: { id }, + include: { + brand: true, + category: true, + images: { orderBy: { sortOrder: "asc" } }, + variants: true, + collections: { include: { collection: true } } + } + }); + if (!p) + throw new common_12.NotFoundException("\u0645\u062D\u0635\u0648\u0644 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return { + ...this.toRow(p), + body_html: p.description, + brand_id: p.brandId, + cats: p.categoryId ? [p.categoryId] : [], + ciny_ids: p.collections.map((c) => c.collectionId), + variants_all: p.variants.map((v) => this.variantRow(v)) + }; + } + variantRow(v) { + return { + id: v.id, + product_id_id: v.productId, + title: v.title, + sku: v.sku, + grams: v.rashWeightGrams, + percentage_pay: v.defaultWagePercent, + qty: v.qty, + is_pre_order: v.isPreOrder, + is_active: v.isActive, + // Legacy had a separate rial making-charge column; the schema models wage + // as a percentage only. Returned as null rather than faked. + rial_pay: null, + color_str: null + }; + } + /** Legacy `POST get/variants` — a POST that reads, per legacy's own routing. */ + async listVariants(query) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["title", "sku"], + allowed: ["id", "title", "sku", "qty", "rashWeightGrams", "isActive", "product.title"], + defaultOrderBy: { title: "asc" } + }); + const scoped = query.product_id ? { AND: [where, { productId: query.product_id }] } : where; + const [rows, total] = await Promise.all([ + this.prisma.productVariant.findMany({ + where: scoped, + orderBy, + skip, + take, + include: { product: true } + }), + this.prisma.productVariant.count({ where: scoped }) + ]); + return this.table.respond(rows.map((v) => ({ ...this.variantRow(v), product: { id: v.product.id, title: v.product.title } })), total, query, page, limit); + } + /** + * Legacy `POST product/variant` — used by the cart to refresh the products it + * holds. Returns each product with `variants_all` attached, the shape + * stores/cart.ts reads. + */ + async byIds(ids) { + if (!ids.length) + return []; + const rows = await this.prisma.product.findMany({ + where: { id: { in: ids } }, + include: { + brand: true, + category: true, + images: { orderBy: { sortOrder: "asc" } }, + variants: true + } + }); + return rows.map((p) => ({ + ...this.toRow(p), + variants_all: p.variants.map((v) => this.variantRow(v)), + // The cart reads `promotion.id`; there is no Promotion model yet (Batch 9). + promotion: null, + thumb: p.images[0] ? { full: p.images[0].url } : null + })); + } + /** + * Legacy `POST add/variant` — the order builder's inline weight editor creates + * a bespoke variant rather than mutating the shared catalog one, so other + * orders keep the weight they were placed with. + */ + async createVariant(body) { + if (!body.product_id) + throw new common_12.BadRequestException("\u0645\u062D\u0635\u0648\u0644 \u0645\u0634\u062E\u0635 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + const product = await this.prisma.product.findUnique({ + where: { id: body.product_id }, + include: { variants: { take: 1 } } + }); + if (!product) + throw new common_12.NotFoundException("\u0645\u062D\u0635\u0648\u0644 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.prisma.productVariant.create({ + data: { + productId: body.product_id, + title: body.title, + rashWeightGrams: new client_1.Prisma.Decimal(String(body.grams ?? 0)), + // Inherit the product's existing wage rate so the bespoke weight prices + // the same way as its siblings. + defaultWagePercent: product.variants[0]?.defaultWagePercent ?? new client_1.Prisma.Decimal(0), + qty: 1 + } + }); + } + /** Legacy `GET product/{id}/variant`. */ + async variantsOf(productId) { + const rows = await this.prisma.productVariant.findMany({ where: { productId } }); + return rows.map((v) => this.variantRow(v)); + } + /** Shape of one inline variant row posted by the product form. */ + variantCreateData(v) { + return { + title: String(v.title ?? ""), + rashWeightGrams: new client_1.Prisma.Decimal(String(v.grams ?? 0)), + defaultWagePercent: new client_1.Prisma.Decimal(String(v.percentage_pay ?? 0)), + qty: Number(v.qty ?? 0), + isPreOrder: Boolean(v.is_pre_order), + isActive: v.is_active !== void 0 ? Boolean(v.is_active) : true + }; + } + /** Legacy `POST product/create`. */ + async create(data) { + const title = String(data.title ?? "").trim(); + if (!title) + throw new common_12.BadRequestException("\u0639\u0646\u0648\u0627\u0646 \u0645\u062D\u0635\u0648\u0644 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + const cats = Array.isArray(data.cats) ? data.cats : []; + const cinyIds = Array.isArray(data.ciny_ids) ? data.ciny_ids : []; + const variants = Array.isArray(data.variants) ? data.variants : []; + return this.prisma.product.create({ + data: { + title, + description: data.body_html ?? data.description ?? null, + productCode: data.product_code || null, + showType: data.show_type !== void 0 ? Number(data.show_type) : 3, + isActive: data.is_active !== void 0 ? Boolean(data.is_active) : true, + brandId: data.brand_id || null, + categoryId: cats[0] ?? null, + collections: cinyIds.length ? { create: cinyIds.map((collectionId) => ({ collectionId })) } : void 0, + variants: variants.length ? { create: variants.map((v) => this.variantCreateData(v)) } : void 0 + }, + include: { variants: true } + }); + } + /** Legacy `PUT product/update/{id}`. */ + async update(id, data) { + const existing = await this.prisma.product.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u0645\u062D\u0635\u0648\u0644 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const patch = {}; + if (data.title !== void 0) + patch.title = String(data.title); + if (data.body_html !== void 0) + patch.description = String(data.body_html); + if (data.product_code !== void 0) + patch.productCode = data.product_code || null; + if (data.show_type !== void 0) + patch.showType = Number(data.show_type); + if (data.is_active !== void 0) + patch.isActive = Boolean(data.is_active); + if (data.brand_id !== void 0) { + patch.brand = data.brand_id ? { connect: { id: String(data.brand_id) } } : { disconnect: true }; + } + if (Array.isArray(data.cats)) { + const catId = data.cats[0]; + patch.category = catId ? { connect: { id: catId } } : { disconnect: true }; + } + await this.prisma.product.update({ where: { id }, data: patch }); + if (Array.isArray(data.variants)) { + const posted = data.variants; + const keptIds = []; + for (const v of posted) { + const payload = this.variantCreateData(v); + if (v.id) { + await this.prisma.productVariant.update({ + where: { id: String(v.id) }, + data: payload + }); + keptIds.push(String(v.id)); + } else { + const created = await this.prisma.productVariant.create({ + data: { ...payload, productId: id } + }); + keptIds.push(created.id); + } + } + await this.prisma.productVariant.updateMany({ + where: { productId: id, id: { notIn: keptIds.length ? keptIds : ["__none__"] } }, + data: { isActive: false } + }); + } + return this.findOne(id); + } + /** + * Legacy `POST delete/product/{id}` — a DELETE expressed as POST. + * + * Refuses when the product has ever been ordered: its variants are referenced + * by OrderItem snapshots, and removing them would break order history. + * Legacy had no such guard. Deactivation is offered instead. + */ + async remove(id) { + const product = await this.prisma.product.findUnique({ + where: { id }, + include: { variants: { include: { orderItems: { take: 1 } } } } + }); + if (!product) + throw new common_12.NotFoundException("\u0645\u062D\u0635\u0648\u0644 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const hasOrders = product.variants.some((v) => v.orderItems.length > 0); + if (hasOrders) { + throw new common_12.BadRequestException("\u062D\u0630\u0641 \u0627\u06CC\u0646 \u0645\u062D\u0635\u0648\u0644 \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A\u060C \u0686\u0648\u0646 \u062F\u0631 \u0633\u0641\u0627\u0631\u0634\u200C\u0647\u0627\u06CC \u062B\u0628\u062A\u200C\u0634\u062F\u0647 \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0634\u062F\u0647 \u0627\u0633\u062A. \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u0622\u0646 \u0631\u0627 \u063A\u06CC\u0631\u0641\u0639\u0627\u0644 \u06A9\u0646\u06CC\u062F."); + } + await this.prisma.$transaction([ + this.prisma.collectionProduct.deleteMany({ where: { productId: id } }), + this.prisma.comment.deleteMany({ where: { productId: id } }), + this.prisma.productImage.deleteMany({ where: { productId: id } }), + this.prisma.productVariant.deleteMany({ where: { productId: id } }), + this.prisma.product.delete({ where: { id } }) + ]); + return { success: true }; + } + /** + * Legacy `POST change/percent/count` — how many variants a bulk wage-percent + * change would affect, used by ChangePercent.vue before applying. + */ + async changePercentCount(filter) { + const where = { + product: { + ...filter.brand_id ? { brandId: filter.brand_id } : {}, + ...filter.category_id ? { categoryId: filter.category_id } : {} + } + }; + return { count: await this.prisma.productVariant.count({ where }) }; + } + /** Legacy `POST change/all` — apply a bulk wage-percent change. */ + async changePercent(data) { + if (data.percent === void 0 || Number.isNaN(Number(data.percent))) { + throw new common_12.BadRequestException("\u062F\u0631\u0635\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A"); + } + const where = { + product: { + ...data.brand_id ? { brandId: data.brand_id } : {}, + ...data.category_id ? { categoryId: data.category_id } : {} + } + }; + const result = await this.prisma.productVariant.updateMany({ + where, + data: { defaultWagePercent: new client_1.Prisma.Decimal(String(data.percent)) } + }); + return { updated: result.count }; + } + /** Legacy `GET brand` and `POST category` — pickers for the product form. */ + async brands() { + return this.prisma.brand.findMany({ orderBy: { title: "asc" } }); + } + /** Brands in the XTable envelope, for the promotion-exclusion picker. */ + async brandsTable(query) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["title"], + allowed: ["id", "title"], + defaultOrderBy: { title: "asc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.brand.findMany({ + where, + orderBy, + skip, + take + }), + this.prisma.brand.count({ where }) + ]); + return this.table.respond(rows, total, query, page, limit); + } + async collections() { + return this.prisma.collection.findMany({ + where: { isActive: true }, + orderBy: { title: "asc" } + }); + } + showTypeOptions() { + return Object.entries(SHOW_TYPE_LABELS).map(([value, title]) => ({ + value: Number(value), + title + })); + } + }; + exports2.AdminProductsService = AdminProductsService; + exports2.AdminProductsService = AdminProductsService = AdminProductsService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService + ]) + ], AdminProductsService); + } +}); + +// dist/modules/admin-products/admin-products.controller.js +var require_admin_products_controller = __commonJS({ + "dist/modules/admin-products/admin-products.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminProductsController = void 0; + var common_12 = require_common(); + var admin_products_service_1 = require_admin_products_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminProductsController = class AdminProductsController { + products; + constructor(products) { + this.products = products; + } + list(query) { + return this.products.list(query); + } + listVariants(query) { + return this.products.listVariants(query); + } + /** + * Legacy `POST product/variant` — the cart's rehydrate call. Given a list of + * product ids it returns each product with `variants_all`, so the basket can + * refresh prices/stock and drop anything that went out of stock. + */ + byIds(body) { + return this.products.byIds(body.products_id ?? []); + } + /** + * Legacy `POST add/variant` — creates a bespoke weight variant from the order + * builder's inline weight editor. + */ + createVariant(body) { + return this.products.createVariant(body); + } + showTypeOptions() { + return this.products.showTypeOptions(); + } + brands() { + return this.products.brands(); + } + /** Brands as an XTable grid — the exclusion picker needs a selectable table. */ + brandsTable(query) { + return this.products.brandsTable(query); + } + collections() { + return this.products.collections(); + } + changePercentCount(body) { + return this.products.changePercentCount(body); + } + changePercent(body) { + return this.products.changePercent(body); + } + create(data) { + return this.products.create(data); + } + remove(id) { + return this.products.remove(id); + } + variantsOf(id) { + return this.products.variantsOf(id); + } + findOne(id) { + return this.products.findOne(id); + } + update(id, data) { + return this.products.update(id, data); + } + }; + exports2.AdminProductsController = AdminProductsController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("product.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "list", null); + __decorate4([ + (0, common_12.Post)("variants/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("product.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "listVariants", null); + __decorate4([ + (0, common_12.Post)("by-ids"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("product.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "byIds", null); + __decorate4([ + (0, common_12.Post)("variants/create"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("order.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "createVariant", null); + __decorate4([ + (0, common_12.Get)("show-type-options"), + (0, guards_1.RequirePermission)("product.list"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "showTypeOptions", null); + __decorate4([ + (0, common_12.Get)("brands"), + (0, guards_1.RequirePermission)("product.list"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "brands", null); + __decorate4([ + (0, common_12.Post)("brands-table"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("product.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "brandsTable", null); + __decorate4([ + (0, common_12.Get)("collections"), + (0, guards_1.RequirePermission)("product.list"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "collections", null); + __decorate4([ + (0, common_12.Post)("change-percent/count"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("product.percent"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "changePercentCount", null); + __decorate4([ + (0, common_12.Post)("change-percent/apply"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("product.percent"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "changePercent", null); + __decorate4([ + (0, common_12.Post)("create"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("product.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "create", null); + __decorate4([ + (0, common_12.Post)("delete/:id"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("product.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "remove", null); + __decorate4([ + (0, common_12.Get)(":id/variants"), + (0, guards_1.RequirePermission)("product.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "variantsOf", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("product.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "findOne", null); + __decorate4([ + (0, common_12.Put)(":id"), + (0, guards_1.RequirePermission)("product.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminProductsController.prototype, "update", null); + exports2.AdminProductsController = AdminProductsController = __decorate4([ + (0, common_12.Controller)("admin/products"), + __metadata3("design:paramtypes", [admin_products_service_1.AdminProductsService]) + ], AdminProductsController); + } +}); + +// dist/modules/admin-products/admin-products.module.js +var require_admin_products_module = __commonJS({ + "dist/modules/admin-products/admin-products.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminProductsModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_products_controller_1 = require_admin_products_controller(); + var admin_products_service_1 = require_admin_products_service(); + var AdminProductsModule = class AdminProductsModule { + }; + exports2.AdminProductsModule = AdminProductsModule; + exports2.AdminProductsModule = AdminProductsModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_products_controller_1.AdminProductsController], + providers: [admin_products_service_1.AdminProductsService] + }) + ], AdminProductsModule); + } +}); + +// dist/modules/admin-categories/admin-categories.service.js +var require_admin_categories_service = __commonJS({ + "dist/modules/admin-categories/admin-categories.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminCategoriesService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCategoriesService = void 0; + var common_12 = require_common(); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var TYPE_LABELS = { + 1: "\u0633\u0627\u06CC\u062A", + 2: "\u0627\u067E\u0644\u06CC\u06A9\u0634\u0646 \u0645\u0648\u0628\u0627\u06CC\u0644" + }; + var AdminCategoriesService = class AdminCategoriesService { + static { + AdminCategoriesService_1 = this; + } + prisma; + table; + constructor(prisma, table) { + this.prisma = prisma; + this.table = table; + } + static ALLOWED = [ + "id", + "title", + "type", + "parentId", + "parent.title", + // legacy filter keys + "type_str" + ]; + /** Legacy `POST category` — the category grid. */ + async list(query) { + this.table.assertNotExport(query); + const aliased = { + ...query, + filters: (query.filters ?? []).map((f) => f.field === "type_str" ? { ...f, field: "type", value: Number(f.value) } : f) + }; + const { where, orderBy, skip, take, page, limit } = this.table.build(aliased, { + searchable: ["title"], + allowed: AdminCategoriesService_1.ALLOWED, + defaultOrderBy: { title: "asc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.category.findMany({ + where, + orderBy, + skip, + take, + include: { parent: true, _count: { select: { products: true, children: true } } } + }), + this.prisma.category.count({ where }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + toRow(c) { + return { + id: c.id, + title: c.title, + type: c.type, + type_str: TYPE_LABELS[c.type] ?? "-", + image: c.imageUrl, + icon: c.iconUrl, + meta: c.metaTag, + body_html: c.description, + parent_id_id: c.parentId, + parent: c.parent ? { id: c.parent.id, title: c.parent.title } : null, + products_count: c._count.products, + children_count: c._count.children + }; + } + async findOne(id) { + const c = await this.prisma.category.findUnique({ + where: { id }, + include: { parent: true, _count: { select: { products: true, children: true } } } + }); + if (!c) + throw new common_12.NotFoundException("\u062F\u0633\u062A\u0647 \u0628\u0646\u062F\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.toRow(c); + } + /** The parent picker — legacy loaded the full list and built a tree client-side. */ + async tree(type) { + const rows = await this.prisma.category.findMany({ + where: type ? { type } : {}, + orderBy: { title: "asc" }, + include: { parent: true } + }); + return rows.map((c) => ({ + id: c.id, + title: c.title, + type: c.type, + parent_id_id: c.parentId + })); + } + /** Legacy `POST category/`. */ + async create(data) { + const title = String(data.title ?? "").trim(); + if (!title) + throw new common_12.BadRequestException("\u0639\u0646\u0648\u0627\u0646 \u062F\u0633\u062A\u0647 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + return this.prisma.category.create({ + data: { + title, + type: data.type !== void 0 ? Number(data.type) : 1, + imageUrl: data.image || null, + iconUrl: data.icon || null, + metaTag: data.meta || null, + description: data.body_html || null, + parentId: data.parent_id_id || null + } + }); + } + /** Legacy `PUT category/{id}`. */ + async update(id, data) { + const existing = await this.prisma.category.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u062F\u0633\u062A\u0647 \u0628\u0646\u062F\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const newParent = data.parent_id_id; + if (newParent) { + if (newParent === id) { + throw new common_12.BadRequestException("\u06CC\u06A9 \u062F\u0633\u062A\u0647 \u0646\u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u062F \u067E\u062F\u0631 \u062E\u0648\u062F\u0634 \u0628\u0627\u0634\u062F"); + } + if (await this.isDescendant(newParent, id)) { + throw new common_12.BadRequestException("\u062F\u0633\u062A\u0647\u200C\u06CC \u0627\u0646\u062A\u062E\u0627\u0628\u200C\u0634\u062F\u0647 \u0632\u06CC\u0631\u0645\u062C\u0645\u0648\u0639\u0647\u200C\u06CC \u0647\u0645\u06CC\u0646 \u062F\u0633\u062A\u0647 \u0627\u0633\u062A"); + } + } + const patch = {}; + if (data.title !== void 0) + patch.title = String(data.title); + if (data.type !== void 0) + patch.type = Number(data.type); + if (data.image !== void 0) + patch.imageUrl = data.image || null; + if (data.icon !== void 0) + patch.iconUrl = data.icon || null; + if (data.meta !== void 0) + patch.metaTag = data.meta || null; + if (data.body_html !== void 0) + patch.description = data.body_html || null; + if (data.parent_id_id !== void 0) { + patch.parent = newParent ? { connect: { id: newParent } } : { disconnect: true }; + } + return this.prisma.category.update({ where: { id }, data: patch }); + } + /** Walks up from `candidate` to see whether `ancestorId` is above it. */ + async isDescendant(candidate, ancestorId) { + let cursor = candidate; + const seen = /* @__PURE__ */ new Set(); + while (cursor && !seen.has(cursor)) { + seen.add(cursor); + const row = await this.prisma.category.findUnique({ + where: { id: cursor }, + select: { parentId: true } + }); + if (!row?.parentId) + return false; + if (row.parentId === ancestorId) + return true; + cursor = row.parentId; + } + return false; + } + /** Legacy `DELETE category/{id}`. */ + async remove(id) { + const c = await this.prisma.category.findUnique({ + where: { id }, + include: { _count: { select: { products: true, children: true } } } + }); + if (!c) + throw new common_12.NotFoundException("\u062F\u0633\u062A\u0647 \u0628\u0646\u062F\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (c._count.products > 0) { + throw new common_12.BadRequestException(`\u062D\u0630\u0641 \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A: ${c._count.products} \u0645\u062D\u0635\u0648\u0644 \u062F\u0631 \u0627\u06CC\u0646 \u062F\u0633\u062A\u0647 \u0642\u0631\u0627\u0631 \u062F\u0627\u0631\u062F.`); + } + if (c._count.children > 0) { + throw new common_12.BadRequestException(`\u062D\u0630\u0641 \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A: \u0627\u06CC\u0646 \u062F\u0633\u062A\u0647 ${c._count.children} \u0632\u06CC\u0631\u062F\u0633\u062A\u0647 \u062F\u0627\u0631\u062F.`); + } + await this.prisma.category.delete({ where: { id } }); + return { success: true }; + } + typeOptions() { + return Object.entries(TYPE_LABELS).map(([value, title]) => ({ value: Number(value), title })); + } + // ── Collections ("سینی") ─────────────────────────────────────────── + /** Legacy `GET ciny` / the collection grid. */ + async listCollections(query) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["title"], + allowed: ["id", "title", "isActive"], + defaultOrderBy: { title: "asc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.collection.findMany({ + where, + orderBy, + skip, + take, + include: { _count: { select: { products: true } } } + }), + this.prisma.collection.count({ where }) + ]); + return this.table.respond(rows.map((c) => ({ + id: c.id, + title: c.title, + description: c.description, + is_active: c.isActive, + products_count: c._count.products + })), total, query, page, limit); + } + async createCollection(data) { + if (!data.title?.trim()) + throw new common_12.BadRequestException("\u0639\u0646\u0648\u0627\u0646 \u0633\u06CC\u0646\u06CC \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + return this.prisma.collection.create({ + data: { + title: data.title.trim(), + description: data.description ?? null, + isActive: data.is_active ?? true + } + }); + } + async updateCollection(id, data) { + const existing = await this.prisma.collection.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u0633\u06CC\u0646\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.prisma.collection.update({ + where: { id }, + data: { + ...data.title !== void 0 ? { title: data.title } : {}, + ...data.description !== void 0 ? { description: data.description } : {}, + ...data.is_active !== void 0 ? { isActive: data.is_active } : {} + } + }); + } + async removeCollection(id) { + const c = await this.prisma.collection.findUnique({ where: { id } }); + if (!c) + throw new common_12.NotFoundException("\u0633\u06CC\u0646\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + await this.prisma.$transaction([ + this.prisma.collectionProduct.deleteMany({ where: { collectionId: id } }), + this.prisma.collection.delete({ where: { id } }) + ]); + return { success: true }; + } + }; + exports2.AdminCategoriesService = AdminCategoriesService; + exports2.AdminCategoriesService = AdminCategoriesService = AdminCategoriesService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService + ]) + ], AdminCategoriesService); + } +}); + +// dist/modules/admin-categories/admin-categories.controller.js +var require_admin_categories_controller = __commonJS({ + "dist/modules/admin-categories/admin-categories.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCategoriesController = void 0; + var common_12 = require_common(); + var admin_categories_service_1 = require_admin_categories_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminCategoriesController = class AdminCategoriesController { + categories; + constructor(categories) { + this.categories = categories; + } + list(query) { + return this.categories.list(query); + } + tree(type) { + return this.categories.tree(type ? Number(type) : void 0); + } + typeOptions() { + return this.categories.typeOptions(); + } + // ── collections ("سینی") ───────────────────────────────────────── + listCollections(query) { + return this.categories.listCollections(query); + } + createCollection(body) { + return this.categories.createCollection(body); + } + updateCollection(id, body) { + return this.categories.updateCollection(id, body); + } + removeCollection(id) { + return this.categories.removeCollection(id); + } + // ── categories ──────────────────────────────────────────────────── + create(data) { + return this.categories.create(data); + } + findOne(id) { + return this.categories.findOne(id); + } + update(id, data) { + return this.categories.update(id, data); + } + remove(id) { + return this.categories.remove(id); + } + }; + exports2.AdminCategoriesController = AdminCategoriesController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("collection.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "list", null); + __decorate4([ + (0, common_12.Get)("tree"), + (0, guards_1.RequirePermission)("collection.list"), + __param3(0, (0, common_12.Query)("type")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "tree", null); + __decorate4([ + (0, common_12.Get)("type-options"), + (0, guards_1.RequirePermission)("collection.list"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "typeOptions", null); + __decorate4([ + (0, common_12.Post)("collections/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("collection.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "listCollections", null); + __decorate4([ + (0, common_12.Post)("collections"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("collection.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "createCollection", null); + __decorate4([ + (0, common_12.Put)("collections/:id"), + (0, guards_1.RequirePermission)("collection.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "updateCollection", null); + __decorate4([ + (0, common_12.Delete)("collections/:id"), + (0, guards_1.RequirePermission)("collection.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "removeCollection", null); + __decorate4([ + (0, common_12.Post)(), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("collection.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "create", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("collection.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "findOne", null); + __decorate4([ + (0, common_12.Put)(":id"), + (0, guards_1.RequirePermission)("collection.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "update", null); + __decorate4([ + (0, common_12.Delete)(":id"), + (0, guards_1.RequirePermission)("collection.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminCategoriesController.prototype, "remove", null); + exports2.AdminCategoriesController = AdminCategoriesController = __decorate4([ + (0, common_12.Controller)("admin/categories"), + __metadata3("design:paramtypes", [admin_categories_service_1.AdminCategoriesService]) + ], AdminCategoriesController); + } +}); + +// dist/modules/admin-categories/admin-categories.module.js +var require_admin_categories_module = __commonJS({ + "dist/modules/admin-categories/admin-categories.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminCategoriesModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_categories_controller_1 = require_admin_categories_controller(); + var admin_categories_service_1 = require_admin_categories_service(); + var AdminCategoriesModule = class AdminCategoriesModule { + }; + exports2.AdminCategoriesModule = AdminCategoriesModule; + exports2.AdminCategoriesModule = AdminCategoriesModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_categories_controller_1.AdminCategoriesController], + providers: [admin_categories_service_1.AdminCategoriesService] + }) + ], AdminCategoriesModule); + } +}); + +// dist/modules/admin-documents/admin-documents.service.js +var require_admin_documents_service = __commonJS({ + "dist/modules/admin-documents/admin-documents.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminDocumentsService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminDocumentsService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var ledger_service_1 = require_ledger_service(); + var TYPE_BY_CODE = { + 1: client_1.LedgerSourceType.REPAYMENT_MELTED_GOLD, + 2: client_1.LedgerSourceType.REPAYMENT_TRANSFER, + 3: client_1.LedgerSourceType.REPAYMENT_CHEQUE, + 4: client_1.LedgerSourceType.REPAYMENT_CASH + }; + var INSTRUMENT_BY_TYPE = { + REPAYMENT_MELTED_GOLD: "MELTED_GOLD", + REPAYMENT_TRANSFER: "TRANSFER", + REPAYMENT_CHEQUE: "CHEQUE", + REPAYMENT_CASH: "CASH" + }; + var CODE_BY_TYPE = { + REPAYMENT_MELTED_GOLD: 1, + REPAYMENT_TRANSFER: 2, + REPAYMENT_CHEQUE: 3, + REPAYMENT_CASH: 4 + }; + var TYPE_LABELS = { + ORDER_STOCK: "\u0633\u0641\u0627\u0631\u0634", + ORDER_PRE_ORDER: "\u0633\u0641\u0627\u0631\u0634 \u0633\u0627\u062E\u062A\u0646\u06CC", + REPAYMENT_MELTED_GOLD: "\u0622\u0628 \u0634\u062F\u0647", + REPAYMENT_TRANSFER: "\u062D\u0648\u0627\u0644\u0647", + REPAYMENT_CHEQUE: "\u0686\u06A9", + REPAYMENT_CASH: "\u067E\u0648\u0644\u06CC", + WALLET_BONUS: "\u0647\u062F\u06CC\u0647 \u06A9\u06CC\u0641 \u067E\u0648\u0644", + ADJUSTMENT: "\u0627\u0635\u0644\u0627\u062D" + }; + var AdminDocumentsService = class AdminDocumentsService { + static { + AdminDocumentsService_1 = this; + } + prisma; + table; + ledger; + constructor(prisma, table, ledger) { + this.prisma = prisma; + this.table = table; + this.ledger = ledger; + } + static ALLOWED = [ + "id", + "sourceType", + "currency", + "direction", + "amount", + "confirmed", + "createdAt", + "karatPerMille", + "labName", + "customer.fullName", + // legacy filter keys + "type_str", + "ayar", + "lab", + "caj" + ]; + static FIELD_ALIASES = { + type_str: "sourceType", + ayar: "karatPerMille", + lab: "labName", + caj: "createdAt", + uaj: "createdAt", + "customer.name": "customer.fullName", + value: "amount", + price: "priceRial", + original_value: "originalValue", + account_name: "accountName", + bank_name: "bankName", + to: "transferTo", + recive_date: "receivedAt", + price_per_gram: "pricePerGramRialAtEntry", + ang: "hallmark" + }; + /** Legacy `POST cash/table` — the documents grid. */ + async list(query) { + this.table.assertNotExport(query); + const mapField = (f) => f ? AdminDocumentsService_1.FIELD_ALIASES[f] ?? f : f; + const aliased = { + ...query, + filters: (query.filters ?? []).map((f) => { + const mapped = { ...f, field: mapField(f.field) }; + if (mapped.field === "sourceType" && mapped.value !== void 0) { + mapped.value = TYPE_BY_CODE[Number(mapped.value)] ?? mapped.value; + } + if (mapped.field === "confirmed" && mapped.value !== void 0) { + mapped.value = String(mapped.value) === "1"; + } + return mapped; + }), + order: query.order ? `${query.order.startsWith("-") ? "-" : "+"}${mapField(query.order.replace(/^[+-]/, ""))}` : void 0 + }; + const { where, orderBy, skip, take, page, limit } = this.table.build(aliased, { + searchable: ["note", "customer.fullName", "labName"], + allowed: AdminDocumentsService_1.ALLOWED, + defaultOrderBy: { createdAt: "desc" } + }); + const scoped = { + AND: [ + where, + { sourceType: { in: Object.values(TYPE_BY_CODE) } } + ] + }; + const [rows, total] = await Promise.all([ + this.prisma.ledgerEntry.findMany({ + where: scoped, + orderBy, + skip, + take, + include: { customer: true, postedByAdminUser: true } + }), + this.prisma.ledgerEntry.count({ where: scoped }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + /** Legacy field names preserved so the ported table model binds unchanged. */ + toRow(e) { + return { + id: e.id, + type: CODE_BY_TYPE[e.sourceType] ?? null, + type_str: TYPE_LABELS[e.sourceType], + sourceType: e.sourceType, + currency: e.currency, + direction: e.direction, + // legacy `value` is the normalized final weight, `original_value` the raw one + value: e.amount, + original_value: e.originalValue, + price: e.priceRial, + price_per_gram: e.pricePerGramRialAtEntry, + ayar: e.karatPerMille, + lab: e.labName, + ang: e.hallmark, + account_name: e.accountName, + bank_name: e.bankName, + to: e.transferTo, + recive_date: e.receivedAt, + note: e.note, + // legacy grid renders `confirmed` through a slot using 0/1 + confirmed: e.confirmed ? 1 : 0, + confirmedAt: e.confirmedAt, + customer: { + id: e.customer.id, + name: e.customer.fullName, + fname: e.customer.fullName, + lname: "", + mobile: e.customer.mobile + }, + posted_by: e.postedByAdminUser ? e.postedByAdminUser.fullName : null, + caj: e.createdAt, + uaj: e.createdAt + }; + } + /** Legacy `GET cash/{id}`. */ + async findOne(id) { + const e = await this.prisma.ledgerEntry.findUnique({ + where: { id }, + include: { customer: true, postedByAdminUser: true } + }); + if (!e) + throw new common_12.NotFoundException("\u0633\u0646\u062F \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.toRow(e); + } + /** + * Legacy `POST cash` — file a repayment document. + * + * The gram/karat/price conversions are LedgerService's job; this method only + * translates the legacy form shape and attaches the instrument metadata. + */ + async create(data, actorAdminUserId) { + const typeCode = Number(data.type ?? 2); + const sourceType = TYPE_BY_CODE[typeCode]; + if (!sourceType) + throw new common_12.BadRequestException("\u0646\u0648\u0639 \u0633\u0646\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A"); + const customerId = String(data.customer_id ?? ""); + if (!customerId) + throw new common_12.BadRequestException("\u0645\u0634\u062A\u0631\u06CC \u0627\u0646\u062A\u062E\u0627\u0628 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + const instrument = INSTRUMENT_BY_TYPE[sourceType]; + const rawValue = instrument === "CASH" ? String(data.price ?? 0) : instrument === "MELTED_GOLD" ? String(data.original_value ?? data.value ?? 0) : String(data.value ?? 0); + const entry = await this.ledger.postGoldRepayment({ + customerId, + instrument, + rawValue, + karatPerMille: data.ayar ? Number(data.ayar) : void 0, + pricePerGramRial: data.price_per_gram ? String(data.price_per_gram) : void 0, + note: data.note ?? void 0, + postedByAdminUserId: actorAdminUserId + }); + await this.prisma.ledgerEntry.update({ + where: { id: entry.id }, + data: this.metadataPatch(data) + }); + return this.findOne(entry.id); + } + metadataPatch(data) { + const patch = {}; + if (data.lab !== void 0) + patch.labName = data.lab || null; + if (data.ang !== void 0) + patch.hallmark = data.ang || null; + if (data.account_name !== void 0) + patch.accountName = data.account_name || null; + if (data.bank_name !== void 0) + patch.bankName = data.bank_name || null; + if (data.to !== void 0) + patch.transferTo = data.to || null; + if (data.original_value !== void 0 && data.original_value !== null) { + patch.originalValue = new client_1.Prisma.Decimal(String(data.original_value)); + } + if (data.price !== void 0 && data.price !== null) { + patch.priceRial = new client_1.Prisma.Decimal(String(data.price)); + } + if (data.recive_date) + patch.receivedAt = new Date(String(data.recive_date)); + return patch; + } + /** + * Legacy `PUT cash/{id}` — edit a document. + * + * Only metadata and the note are editable. Changing the AMOUNT of a confirmed + * entry would silently rewrite a customer's debt, so that is refused: the + * correct accounting action is a reversing adjustment, not an edit. Legacy + * allowed it. Recorded in docs/ADMIN-PORT-PLAN.md. + */ + async update(id, data) { + const existing = await this.prisma.ledgerEntry.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u0633\u0646\u062F \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const amountChanged = data.value !== void 0 && !new client_1.Prisma.Decimal(String(data.value)).equals(existing.amount); + if (existing.confirmed && amountChanged) { + throw new common_12.BadRequestException("\u0645\u0628\u0644\u063A \u0633\u0646\u062F \u062A\u0627\u06CC\u06CC\u062F\u0634\u062F\u0647 \u0642\u0627\u0628\u0644 \u0648\u06CC\u0631\u0627\u06CC\u0634 \u0646\u06CC\u0633\u062A\u060C \u0686\u0648\u0646 \u0628\u062F\u0647\u06CC \u0645\u0634\u062A\u0631\u06CC \u0628\u0631 \u0627\u0633\u0627\u0633 \u0622\u0646 \u0645\u062D\u0627\u0633\u0628\u0647 \u0634\u062F\u0647 \u0627\u0633\u062A. \u0628\u0631\u0627\u06CC \u0627\u0635\u0644\u0627\u062D\u060C \u0633\u0646\u062F \u062C\u062F\u06CC\u062F \u062B\u0628\u062A \u06A9\u0646\u06CC\u062F."); + } + const patch = this.metadataPatch(data); + if (data.note !== void 0) + patch.note = data.note || null; + if (!existing.confirmed && amountChanged) { + patch.amount = new client_1.Prisma.Decimal(String(data.value)); + } + await this.prisma.ledgerEntry.update({ where: { id }, data: patch }); + return this.findOne(id); + } + /** + * Legacy `POST cash/confirem/{id}` (legacy's own spelling) — a TOGGLE: the grid + * shows a tick on an unconfirmed row and a cross on a confirmed one, both + * calling this same endpoint. + * + * Confirming delegates to LedgerService so the customer balance moves through + * the one code path that owns it. Un-confirming reverses that same amount + * rather than editing the balance directly, so the two stay consistent. + */ + async toggleConfirm(id, adminUserId) { + const e = await this.prisma.ledgerEntry.findUnique({ where: { id } }); + if (!e) + throw new common_12.NotFoundException("\u0633\u0646\u062F \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (!e.confirmed) { + await this.ledger.confirmEntry(id, adminUserId); + return this.findOne(id); + } + await this.prisma.$transaction(async (tx) => { + const delta = e.direction === client_1.LedgerDirection.CREDIT ? e.amount : e.amount.negated(); + const field = e.currency === client_1.LedgerCurrency.GOLD_GRAM ? "goldDebtGrams" : "fiatDebtRial"; + await tx.customer.update({ + where: { id: e.customerId }, + data: { [field]: { increment: delta } } + }); + await tx.ledgerEntry.update({ + where: { id }, + data: { confirmed: false, confirmedAt: null } + }); + }); + return this.findOne(id); + } + /** + * Legacy `DELETE cash/{id}`. + * + * A confirmed entry has already moved the customer's balance; deleting it + * would leave that balance overstated with no trace. Refused — legacy allowed + * it. Unconfirmed entries never touched a balance, so they delete cleanly. + */ + async remove(id) { + const e = await this.prisma.ledgerEntry.findUnique({ where: { id } }); + if (!e) + throw new common_12.NotFoundException("\u0633\u0646\u062F \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (e.confirmed) { + throw new common_12.BadRequestException("\u062D\u0630\u0641 \u0633\u0646\u062F \u062A\u0627\u06CC\u06CC\u062F\u0634\u062F\u0647 \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A\u060C \u0686\u0648\u0646 \u062F\u0631 \u062A\u0631\u0627\u0632 \u0645\u0634\u062A\u0631\u06CC \u0627\u0639\u0645\u0627\u0644 \u0634\u062F\u0647 \u0627\u0633\u062A."); + } + await this.prisma.ledgerEntry.delete({ where: { id } }); + return { success: true }; + } + typeOptions() { + return Object.entries(TYPE_BY_CODE).map(([code, sourceType]) => ({ + value: Number(code), + title: TYPE_LABELS[sourceType] + })); + } + // ── Wallet ───────────────────────────────────────────────────────── + /** Legacy `POST wallet` grid — the list of granted wallet bonuses. */ + async listWallet(query) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["customer.fullName"], + allowed: ["id", "goldGrams", "grantedAt", "expiresAt", "isActive", "customer.fullName"], + defaultOrderBy: { grantedAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.walletBonus.findMany({ + where, + orderBy, + skip, + take, + include: { customer: true } + }), + this.prisma.walletBonus.count({ where }) + ]); + return this.table.respond(rows.map((w) => ({ + id: w.id, + value: w.goldGrams, + grams: w.goldGrams, + is_active: w.isActive, + consumed: Boolean(w.consumedAt), + caj: w.grantedAt, + expires_at: w.expiresAt, + customer: { + id: w.customer.id, + name: w.customer.fullName, + mobile: w.customer.mobile + } + })), total, query, page, limit); + } + /** + * Legacy `GET /wallet/config` and `/wallet/birthday/config`, plus their POST + * counterparts — the wallet settings screen (views/manage/wallet.vue). + * Stored in the Setting key/value table that replaces legacy `config_static`. + */ + async getSetting(key) { + const row = await this.prisma.setting.findUnique({ where: { key } }); + return row?.value ?? {}; + } + async setSetting(key, value) { + const row = await this.prisma.setting.upsert({ + where: { key }, + update: { value }, + create: { key, value } + }); + return row.value; + } + /** The customer picker used by the document form — legacy `GET query/customer`. */ + async queryCustomers() { + const rows = await this.prisma.customer.findMany({ + where: { isActive: true }, + orderBy: { fullName: "asc" }, + select: { id: true, fullName: true, mobile: true } + }); + return rows.map((c) => ({ id: c.id, name: c.fullName, fname: c.fullName, lname: "", mobile: c.mobile })); + } + }; + exports2.AdminDocumentsService = AdminDocumentsService; + exports2.AdminDocumentsService = AdminDocumentsService = AdminDocumentsService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService, + ledger_service_1.LedgerService + ]) + ], AdminDocumentsService); + } +}); + +// dist/modules/admin-documents/admin-documents.controller.js +var require_admin_documents_controller = __commonJS({ + "dist/modules/admin-documents/admin-documents.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminDocumentsController = void 0; + var common_12 = require_common(); + var admin_documents_service_1 = require_admin_documents_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminDocumentsController = class AdminDocumentsController { + documents; + constructor(documents) { + this.documents = documents; + } + list(query) { + return this.documents.list(query); + } + typeOptions() { + return this.documents.typeOptions(); + } + queryCustomers() { + return this.documents.queryCustomers(); + } + listWallet(query) { + return this.documents.listWallet(query); + } + // ── wallet settings (views/manage/wallet.vue) ──────────────────── + getWalletConfig() { + return this.documents.getSetting("wallet.config"); + } + setWalletConfig(body) { + return this.documents.setSetting("wallet.config", body); + } + getBirthdayConfig() { + return this.documents.getSetting("wallet.birthday"); + } + setBirthdayConfig(body) { + return this.documents.setSetting("wallet.birthday", body); + } + create(data, admin) { + return this.documents.create(data, admin.id); + } + /** Legacy POST cash/confirem/{id} — a toggle, not a one-way confirm. */ + toggleConfirm(id, admin) { + return this.documents.toggleConfirm(id, admin.id); + } + findOne(id) { + return this.documents.findOne(id); + } + update(id, data) { + return this.documents.update(id, data); + } + remove(id) { + return this.documents.remove(id); + } + }; + exports2.AdminDocumentsController = AdminDocumentsController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("document.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "list", null); + __decorate4([ + (0, common_12.Get)("type-options"), + (0, guards_1.RequirePermission)("document.list"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "typeOptions", null); + __decorate4([ + (0, common_12.Get)("query/customer"), + (0, guards_1.RequirePermission)("document.create"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "queryCustomers", null); + __decorate4([ + (0, common_12.Post)("wallet/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("wallet"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "listWallet", null); + __decorate4([ + (0, common_12.Get)("wallet/config"), + (0, guards_1.RequirePermission)("config.wallet"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "getWalletConfig", null); + __decorate4([ + (0, common_12.Post)("wallet/config"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("config.wallet"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "setWalletConfig", null); + __decorate4([ + (0, common_12.Get)("wallet/birthday/config"), + (0, guards_1.RequirePermission)("config.wallet"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "getBirthdayConfig", null); + __decorate4([ + (0, common_12.Post)("wallet/birthday/config"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("config.wallet"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "setBirthdayConfig", null); + __decorate4([ + (0, common_12.Post)(), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("document.create"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object, Object]), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "create", null); + __decorate4([ + (0, common_12.Post)(":id/confirm"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("document.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "toggleConfirm", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("document.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "findOne", null); + __decorate4([ + (0, common_12.Put)(":id"), + (0, guards_1.RequirePermission)("document.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "update", null); + __decorate4([ + (0, common_12.Delete)(":id"), + (0, guards_1.RequirePermission)("document.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminDocumentsController.prototype, "remove", null); + exports2.AdminDocumentsController = AdminDocumentsController = __decorate4([ + (0, common_12.Controller)("admin/documents"), + __metadata3("design:paramtypes", [admin_documents_service_1.AdminDocumentsService]) + ], AdminDocumentsController); + } +}); + +// dist/modules/admin-documents/admin-documents.module.js +var require_admin_documents_module = __commonJS({ + "dist/modules/admin-documents/admin-documents.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminDocumentsModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var accounting_module_1 = require_accounting_module(); + var admin_documents_controller_1 = require_admin_documents_controller(); + var admin_documents_service_1 = require_admin_documents_service(); + var AdminDocumentsModule = class AdminDocumentsModule { + }; + exports2.AdminDocumentsModule = AdminDocumentsModule; + exports2.AdminDocumentsModule = AdminDocumentsModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule, accounting_module_1.AccountingModule], + controllers: [admin_documents_controller_1.AdminDocumentsController], + providers: [admin_documents_service_1.AdminDocumentsService] + }) + ], AdminDocumentsModule); + } +}); + +// dist/modules/admin-promotions/admin-promotions.service.js +var require_admin_promotions_service = __commonJS({ + "dist/modules/admin-promotions/admin-promotions.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminPromotionsService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminPromotionsService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var SCOPE_BY_CODE = { + 1: client_1.PromotionScope.PRODUCT, + 2: client_1.PromotionScope.CATEGORY, + 3: client_1.PromotionScope.CUSTOMER, + 4: client_1.PromotionScope.BRAND + }; + var CODE_BY_SCOPE = { + PRODUCT: 1, + CATEGORY: 2, + CUSTOMER: 3, + BRAND: 4 + }; + var SCOPE_LABELS = { + PRODUCT: "\u0645\u062D\u0635\u0648\u0644\u0627\u062A", + CATEGORY: "\u062F\u0633\u062A\u0647 \u0628\u0646\u062F\u06CC", + CUSTOMER: "\u0645\u0634\u062A\u0631\u06CC", + BRAND: "\u0628\u0631\u0646\u062F" + }; + var USAGE_BY_CODE = { + 1: client_1.PromotionUsage.ONCE, + 2: client_1.PromotionUsage.UNTIL_END_DATE + }; + var CODE_BY_USAGE = { + ONCE: 1, + UNTIL_END_DATE: 2 + }; + var AdminPromotionsService = class AdminPromotionsService { + static { + AdminPromotionsService_1 = this; + } + prisma; + table; + constructor(prisma, table) { + this.prisma = prisma; + this.table = table; + } + static ALLOWED = [ + "id", + "title", + "scope", + "usage", + "discountPercent", + "isActive", + "platform", + "startsAt", + "endsAt", + "createdAt", + // legacy filter keys + "promotion_type_str", + "status", + "start", + "end", + "discount_percent" + ]; + static FIELD_ALIASES = { + promotion_type_str: "scope", + type: "scope", + use_only: "usage", + status: "isActive", + start: "startsAt", + end: "endsAt", + discount_percent: "discountPercent", + caj: "createdAt" + }; + /** Legacy `GET product/variant/promotion` — the promotions grid. */ + async list(query) { + this.table.assertNotExport(query); + const mapField = (f) => f ? AdminPromotionsService_1.FIELD_ALIASES[f] ?? f : f; + const aliased = { + ...query, + filters: (query.filters ?? []).map((f) => { + const mapped = { ...f, field: mapField(f.field) }; + if (mapped.field === "scope" && mapped.value !== void 0) { + mapped.value = SCOPE_BY_CODE[Number(mapped.value)] ?? mapped.value; + } + if (mapped.field === "isActive" && mapped.value !== void 0) { + mapped.value = String(mapped.value) === "1"; + } + return mapped; + }), + order: query.order ? `${query.order.startsWith("-") ? "-" : "+"}${mapField(query.order.replace(/^[+-]/, ""))}` : void 0 + }; + const { where, orderBy, skip, take, page, limit } = this.table.build(aliased, { + searchable: ["title", "description"], + allowed: AdminPromotionsService_1.ALLOWED, + defaultOrderBy: { createdAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.promotion.findMany({ + where, + orderBy, + skip, + take, + include: { product: true, category: true, customer: true, brand: true } + }), + this.prisma.promotion.count({ where }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + toRow(p) { + return { + id: p.id, + title: p.title, + description: p.description, + type: CODE_BY_SCOPE[p.scope], + promotion_type_str: SCOPE_LABELS[p.scope], + use_only: CODE_BY_USAGE[p.usage], + discount_percent: p.discountPercent, + // legacy grid renders `status` through a slot + status: p.isActive ? 1 : 0, + is_active: p.isActive, + /** + * Legacy `type_customer`: 1 = تک (retail), 2 = عمده (wholesale). The grid + * uses it BOTH to pick which permission gates the row's edit/delete icons + * AND to choose which edit route opens. A customer-scoped promotion is the + * retail ("tak") kind; everything else is the wholesale kind. + */ + type_customer: p.scope === client_1.PromotionScope.CUSTOMER ? 1 : 2, + platform: p.platform, + start: p.startsAt, + end: p.endsAt, + product_id: p.productId, + category_id: p.categoryId, + customer_id: p.customerId, + brand_id: p.brandId, + product: p.product ? { id: p.product.id, title: p.product.title } : null, + category: p.category ? { id: p.category.id, title: p.category.title } : null, + customer: p.customer ? { id: p.customer.id, name: p.customer.fullName } : null, + brand: p.brand ? { id: p.brand.id, title: p.brand.title } : null, + caj: p.createdAt + }; + } + async findOne(id) { + const p = await this.prisma.promotion.findUnique({ + where: { id }, + include: { product: true, category: true, customer: true, brand: true } + }); + if (!p) + throw new common_12.NotFoundException("\u062A\u062E\u0641\u06CC\u0641 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.toRow(p); + } + /** + * Maps the legacy form payload onto the model, attaching the ONE target that + * matches the chosen scope and clearing the others — so a promotion can never + * carry, say, both a product and a customer. + */ + buildData(data) { + const scope = SCOPE_BY_CODE[Number(data.type ?? 1)]; + if (!scope) + throw new common_12.BadRequestException("\u0646\u0648\u0639 \u062A\u062E\u0641\u06CC\u0641 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u0627\u0633\u062A"); + const usage = USAGE_BY_CODE[Number(data.use_only ?? 1)] ?? client_1.PromotionUsage.ONCE; + const percent = new client_1.Prisma.Decimal(String(data.discount_percent ?? 0)); + if (percent.lt(0) || percent.gt(100)) { + throw new common_12.BadRequestException("\u062F\u0631\u0635\u062F \u062A\u062E\u0641\u06CC\u0641 \u0628\u0627\u06CC\u062F \u0628\u06CC\u0646 \u06F0 \u062A\u0627 \u06F1\u06F0\u06F0 \u0628\u0627\u0634\u062F"); + } + const startsAt = data.start ? new Date(String(data.start)) : null; + const endsAt = data.end ? new Date(String(data.end)) : null; + if (startsAt && endsAt && endsAt < startsAt) { + throw new common_12.BadRequestException("\u062A\u0627\u0631\u06CC\u062E \u067E\u0627\u06CC\u0627\u0646 \u0646\u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u062F \u0642\u0628\u0644 \u0627\u0632 \u062A\u0627\u0631\u06CC\u062E \u0634\u0631\u0648\u0639 \u0628\u0627\u0634\u062F"); + } + return { + title: String(data.title ?? "").trim(), + description: data.description || null, + scope, + usage, + discountPercent: percent, + isActive: data.is_active !== void 0 ? Boolean(data.is_active) : true, + platform: data.platform !== void 0 ? Number(data.platform) : 3, + startsAt, + endsAt, + productId: scope === client_1.PromotionScope.PRODUCT ? data.product_id ?? null : null, + categoryId: scope === client_1.PromotionScope.CATEGORY ? data.category_id ?? null : null, + customerId: scope === client_1.PromotionScope.CUSTOMER ? data.customer_id ?? null : null, + brandId: scope === client_1.PromotionScope.BRAND ? data.brand_id ?? null : null + }; + } + /** Legacy `POST product/variant/promotion`. */ + async create(data) { + const payload = this.buildData(data); + if (!payload.title) + throw new common_12.BadRequestException("\u0639\u0646\u0648\u0627\u0646 \u062A\u062E\u0641\u06CC\u0641 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + return this.prisma.promotion.create({ data: payload }); + } + /** Legacy `PUT product/variant/promotion/{id}`. */ + async update(id, data) { + const existing = await this.prisma.promotion.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u062A\u062E\u0641\u06CC\u0641 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const payload = this.buildData({ ...data, type: CODE_BY_SCOPE[existing.scope] }); + return this.prisma.promotion.update({ where: { id }, data: payload }); + } + /** Legacy `DELETE product/variant/promotion/{id}`. */ + async remove(id) { + const p = await this.prisma.promotion.findUnique({ where: { id } }); + if (!p) + throw new common_12.NotFoundException("\u062A\u062E\u0641\u06CC\u0641 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + await this.prisma.promotion.delete({ where: { id } }); + return { success: true }; + } + scopeOptions() { + return Object.entries(SCOPE_BY_CODE).map(([code, scope]) => ({ + value: Number(code), + title: SCOPE_LABELS[scope] + })); + } + usageOptions() { + return [ + { value: 1, title: " \u0641\u0642\u0637 \u06CC\u06A9\u0628\u0627\u0631" }, + { value: 2, title: "\u062A\u0627 \u062A\u0627\u0631\u06CC\u062E \u067E\u0627\u06CC\u0627\u0646" } + ]; + } + /** + * Legacy `GET /autopromotion` and its POST counterpart — the settings screen + * for "تخفیف اتوماتیک یکبار مصرف ویژه مشتریان جدید": a one-shot welcome + * discount for new customers, configured as an on/off state plus a percentage. + * + * Stored in the Setting key/value table, like the other config screens. + */ + async getAutoPromotion() { + const row = await this.prisma.setting.findUnique({ where: { key: "promotion.auto" } }); + return row?.value ?? { state: false, discount_percent: null }; + } + async setAutoPromotion(data) { + const percent = Number(data.discount_percent ?? 0); + if (Number.isNaN(percent) || percent < 0 || percent > 100) { + throw new common_12.BadRequestException("\u062F\u0631\u0635\u062F \u062A\u062E\u0641\u06CC\u0641 \u0628\u0627\u06CC\u062F \u0628\u06CC\u0646 \u06F0 \u062A\u0627 \u06F1\u06F0\u06F0 \u0628\u0627\u0634\u062F"); + } + const value = { state: Boolean(data.state), discount_percent: percent }; + const row = await this.prisma.setting.upsert({ + where: { key: "promotion.auto" }, + update: { value }, + create: { key: "promotion.auto", value } + }); + return row.value; + } + // ── Exclusions (views/offersIgnore) ──────────────────────────────── + /** + * Legacy `GET /ignore` — the full exclusion list. + * + * The view reads it as a flat array and filters client-side: + * items_id(type) { return this.ignoreList.filter(i => i.type == type).map(x => x.item_id) } + * so the flat shape with `item_id` is preserved. + */ + async listExclusions() { + const rows = await this.prisma.promotionExclusion.findMany({ + orderBy: [{ type: "asc" }, { createdAt: "asc" }] + }); + return rows.map((e) => ({ id: e.id, type: e.type, item_id: e.itemId })); + } + /** + * Legacy `POST /ignore` with `{ type, item_id: [...] }`. + * + * The posted array is the COMPLETE selection for that type — the view binds it + * to a checkbox table — so this replaces that type's rows rather than adding + * to them. Anything unchecked is therefore removed. + */ + async createExclusion(data) { + const type = Number(data.type); + if (!type) + throw new common_12.BadRequestException("\u0646\u0648\u0639 \u0627\u0633\u062A\u062B\u0646\u0627\u0621 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + const itemIds = Array.isArray(data.item_id) ? data.item_id.map((x) => String(x)).filter(Boolean) : []; + await this.prisma.$transaction([ + this.prisma.promotionExclusion.deleteMany({ where: { type } }), + this.prisma.promotionExclusion.createMany({ + data: itemIds.map((itemId) => ({ type, itemId })), + skipDuplicates: true + }) + ]); + return this.listExclusions(); + } + /** + * Legacy `DELETE /ignore/{id}` — the view's "حذف نوع استثناء" card removes a + * whole TYPE, so a numeric id is treated as a type and a cuid as one row. + */ + async removeExclusion(id) { + if (/^\d+$/.test(id)) { + const type = Number(id); + const { count } = await this.prisma.promotionExclusion.deleteMany({ where: { type } }); + if (count === 0) + throw new common_12.NotFoundException("\u0627\u0633\u062A\u062B\u0646\u0627\u06CC\u06CC \u0628\u0631\u0627\u06CC \u0627\u06CC\u0646 \u0646\u0648\u0639 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return { success: true, removed: count }; + } + const e = await this.prisma.promotionExclusion.findUnique({ where: { id } }); + if (!e) + throw new common_12.NotFoundException("\u0627\u0633\u062A\u062B\u0646\u0627\u0621 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + await this.prisma.promotionExclusion.delete({ where: { id } }); + return { success: true, removed: 1 }; + } + }; + exports2.AdminPromotionsService = AdminPromotionsService; + exports2.AdminPromotionsService = AdminPromotionsService = AdminPromotionsService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService + ]) + ], AdminPromotionsService); + } +}); + +// dist/modules/admin-promotions/admin-promotions.controller.js +var require_admin_promotions_controller = __commonJS({ + "dist/modules/admin-promotions/admin-promotions.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminPromotionsController = void 0; + var common_12 = require_common(); + var admin_promotions_service_1 = require_admin_promotions_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminPromotionsController = class AdminPromotionsController { + promotions; + constructor(promotions) { + this.promotions = promotions; + } + list(query) { + return this.promotions.list(query); + } + scopeOptions() { + return this.promotions.scopeOptions(); + } + usageOptions() { + return this.promotions.usageOptions(); + } + getAutoPromotion() { + return this.promotions.getAutoPromotion(); + } + setAutoPromotion(body) { + return this.promotions.setAutoPromotion(body); + } + // ── exclusions ──────────────────────────────────────────────────── + listExclusions() { + return this.promotions.listExclusions(); + } + createExclusion(body) { + return this.promotions.createExclusion(body); + } + removeExclusion(id) { + return this.promotions.removeExclusion(id); + } + // ── promotions ──────────────────────────────────────────────────── + create(data) { + return this.promotions.create(data); + } + findOne(id) { + return this.promotions.findOne(id); + } + update(id, data) { + return this.promotions.update(id, data); + } + remove(id) { + return this.promotions.remove(id); + } + }; + exports2.AdminPromotionsController = AdminPromotionsController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("offers.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "list", null); + __decorate4([ + (0, common_12.Get)("scope-options"), + (0, guards_1.RequirePermission)("offers.list"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "scopeOptions", null); + __decorate4([ + (0, common_12.Get)("usage-options"), + (0, guards_1.RequirePermission)("offers.list"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "usageOptions", null); + __decorate4([ + (0, common_12.Get)("auto"), + (0, guards_1.RequirePermission)("offers.autopromotion"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "getAutoPromotion", null); + __decorate4([ + (0, common_12.Post)("auto"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("offers.autopromotion"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "setAutoPromotion", null); + __decorate4([ + (0, common_12.Get)("exclusions"), + (0, guards_1.RequirePermission)("offersIgnore"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "listExclusions", null); + __decorate4([ + (0, common_12.Post)("exclusions"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("offersIgnore"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "createExclusion", null); + __decorate4([ + (0, common_12.Delete)("exclusions/:id"), + (0, guards_1.RequirePermission)("offersIgnore"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "removeExclusion", null); + __decorate4([ + (0, common_12.Post)(), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("offers.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "create", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("offers.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "findOne", null); + __decorate4([ + (0, common_12.Put)(":id"), + (0, guards_1.RequirePermission)("offers.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "update", null); + __decorate4([ + (0, common_12.Delete)(":id"), + (0, guards_1.RequirePermission)("offers.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminPromotionsController.prototype, "remove", null); + exports2.AdminPromotionsController = AdminPromotionsController = __decorate4([ + (0, common_12.Controller)("admin/promotions"), + __metadata3("design:paramtypes", [admin_promotions_service_1.AdminPromotionsService]) + ], AdminPromotionsController); + } +}); + +// dist/modules/admin-promotions/admin-promotions.module.js +var require_admin_promotions_module = __commonJS({ + "dist/modules/admin-promotions/admin-promotions.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminPromotionsModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_promotions_controller_1 = require_admin_promotions_controller(); + var admin_promotions_service_1 = require_admin_promotions_service(); + var AdminPromotionsModule = class AdminPromotionsModule { + }; + exports2.AdminPromotionsModule = AdminPromotionsModule; + exports2.AdminPromotionsModule = AdminPromotionsModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_promotions_controller_1.AdminPromotionsController], + providers: [admin_promotions_service_1.AdminPromotionsService] + }) + ], AdminPromotionsModule); + } +}); + +// dist/modules/admin-users/admin-users.service.js +var require_admin_users_service = __commonJS({ + "dist/modules/admin-users/admin-users.service.js"(exports2) { + "use strict"; + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m[k]; + } }; + } + Object.defineProperty(o, k2, desc); + }) : (function(o, m, k, k2) { + if (k2 === void 0) k2 = k; + o[k2] = m[k]; + })); + var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + }) : function(o, v) { + o["default"] = v; + }); + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __importStar2 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { + var ownKeys2 = function(o) { + ownKeys2 = Object.getOwnPropertyNames || function(o2) { + var ar = []; + for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k; + return ar; + }; + return ownKeys2(o); + }; + return function(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) { + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); + } + __setModuleDefault2(result, mod); + return result; + }; + })(); + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminUsersService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminUsersService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var bcrypt = __importStar2(require_umd()); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var AdminUsersService = class AdminUsersService { + static { + AdminUsersService_1 = this; + } + prisma; + table; + constructor(prisma, table) { + this.prisma = prisma; + this.table = table; + } + static ALLOWED = [ + "id", + "fullName", + "mobile", + "role", + "isActive", + "createdAt", + "userTypeId", + "userType.title", + "branch.name", + // legacy filter keys + "name", + "ut" + ]; + static FIELD_ALIASES = { + name: "fullName", + ut: "userTypeId", + caj: "createdAt", + active: "isActive" + }; + /** Legacy `GET users` — the admin user grid. */ + async list(query) { + this.table.assertNotExport(query); + const mapField = (f) => f ? AdminUsersService_1.FIELD_ALIASES[f] ?? f : f; + const aliased = { + ...query, + filters: (query.filters ?? []).map((f) => { + const mapped = { ...f, field: mapField(f.field) }; + if (mapped.field === "isActive" && mapped.value !== void 0) { + mapped.value = String(mapped.value) === "1"; + } + if (mapped.field === "userTypeId" && mapped.value !== void 0) { + mapped.value = Number(mapped.value); + } + return mapped; + }), + order: query.order ? `${query.order.startsWith("-") ? "-" : "+"}${mapField(query.order.replace(/^[+-]/, ""))}` : void 0 + }; + const { where, orderBy, skip, take, page, limit } = this.table.build(aliased, { + searchable: ["fullName", "mobile"], + allowed: AdminUsersService_1.ALLOWED, + defaultOrderBy: { createdAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.adminUser.findMany({ + where, + orderBy, + skip, + take, + include: { userType: true, branch: true } + }), + this.prisma.adminUser.count({ where }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + /** Legacy field names preserved; the password hash is never exposed. */ + toRow(u) { + return { + id: u.id, + name: u.fullName, + fname: u.fullName, + lname: "", + mobile: u.mobile, + role: u.role, + ut: u.userTypeId, + user_type: u.userType ? { id: u.userType.id, title: u.userType.title } : null, + branch_id: u.branchId, + branch: u.branch ? { id: u.branch.id, name: u.branch.name } : null, + percent: u.wagePercent, + active: u.isActive ? 1 : -1, + is_active: u.isActive, + caj: u.createdAt + }; + } + async findOne(id) { + const u = await this.prisma.adminUser.findUnique({ + where: { id }, + include: { userType: true, branch: true } + }); + if (!u) + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.toRow(u); + } + /** Legacy `POST users`. */ + async create(data) { + const fullName = String(data.name ?? data.fname ?? "").trim(); + const mobile = String(data.mobile ?? "").trim(); + const password = String(data.password ?? ""); + if (!fullName) + throw new common_12.BadRequestException("\u0646\u0627\u0645 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + if (!mobile) + throw new common_12.BadRequestException("\u0645\u0648\u0628\u0627\u06CC\u0644 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + if (!password) + throw new common_12.BadRequestException("\u0631\u0645\u0632 \u0639\u0628\u0648\u0631 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + const existing = await this.prisma.adminUser.findUnique({ where: { mobile } }); + if (existing) + throw new common_12.BadRequestException("\u0627\u06CC\u0646 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0642\u0628\u0644\u0627\u064B \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A"); + return this.prisma.adminUser.create({ + data: { + fullName, + mobile, + passwordHash: await bcrypt.hash(password, 10), + role: data.role ?? client_1.AdminRole.SALES_EXPERT, + userTypeId: data.ut !== void 0 && data.ut !== null ? Number(data.ut) : null, + branchId: data.branch_id || null, + wagePercent: data.percent !== void 0 && data.percent !== null ? new client_1.Prisma.Decimal(String(data.percent)) : null, + isActive: data.is_active !== void 0 ? Boolean(data.is_active) : true + }, + include: { userType: true, branch: true } + }); + } + /** Legacy `PUT users/{id}`. */ + async update(id, data) { + const existing = await this.prisma.adminUser.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const patch = {}; + if (data.name !== void 0) + patch.fullName = String(data.name); + if (data.mobile !== void 0) { + const mobile = String(data.mobile); + if (mobile !== existing.mobile) { + const clash = await this.prisma.adminUser.findUnique({ where: { mobile } }); + if (clash) + throw new common_12.BadRequestException("\u0627\u06CC\u0646 \u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0642\u0628\u0644\u0627\u064B \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A"); + } + patch.mobile = mobile; + } + if (data.password) + patch.passwordHash = await bcrypt.hash(String(data.password), 10); + if (data.role !== void 0) + patch.role = data.role; + if (data.ut !== void 0) { + patch.userType = data.ut ? { connect: { id: Number(data.ut) } } : { disconnect: true }; + } + if (data.branch_id !== void 0) { + patch.branch = data.branch_id ? { connect: { id: String(data.branch_id) } } : { disconnect: true }; + } + if (data.percent !== void 0) { + patch.wagePercent = data.percent === null ? null : new client_1.Prisma.Decimal(String(data.percent)); + } + if (data.is_active !== void 0) + patch.isActive = Boolean(data.is_active); + return this.prisma.adminUser.update({ + where: { id }, + data: patch, + include: { userType: true, branch: true } + }); + } + /** + * Legacy `DELETE users/{id}`. + * + * Refuses to delete an admin who has posted ledger entries or changed order + * statuses — those rows reference them, and losing the actor would erase the + * audit trail. Deactivation is offered instead. Legacy deleted regardless. + */ + async remove(id, actorId) { + const u = await this.prisma.adminUser.findUnique({ + where: { id }, + include: { + _count: { select: { postedLedgerEntries: true, orderStatusEvents: true } } + } + }); + if (!u) + throw new common_12.NotFoundException("\u06A9\u0627\u0631\u0628\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (id === actorId) { + throw new common_12.BadRequestException("\u0646\u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u062D\u0633\u0627\u0628 \u06A9\u0627\u0631\u0628\u0631\u06CC \u062E\u0648\u062F\u062A\u0627\u0646 \u0631\u0627 \u062D\u0630\u0641 \u06A9\u0646\u06CC\u062F"); + } + const refs = u._count.postedLedgerEntries + u._count.orderStatusEvents; + if (refs > 0) { + throw new common_12.BadRequestException(`\u062D\u0630\u0641 \u0627\u06CC\u0646 \u06A9\u0627\u0631\u0628\u0631 \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A\u060C \u0686\u0648\u0646 ${refs} \u0633\u0646\u062F \u06CC\u0627 \u062A\u063A\u06CC\u06CC\u0631 \u0648\u0636\u0639\u06CC\u062A \u0628\u0647 \u0646\u0627\u0645 \u0627\u0648 \u062B\u0628\u062A \u0634\u062F\u0647 \u0627\u0633\u062A. \u0645\u06CC\u200C\u062A\u0648\u0627\u0646\u06CC\u062F \u063A\u06CC\u0631\u0641\u0639\u0627\u0644\u0634 \u06A9\u0646\u06CC\u062F.`); + } + await this.prisma.adminUser.delete({ where: { id } }); + return { success: true }; + } + // ── User types + the permission matrix ───────────────────────────── + /** Legacy `GET const/__list__ut` — the access-level picker. */ + async listUserTypes() { + const rows = await this.prisma.userType.findMany({ + orderBy: { id: "asc" }, + include: { _count: { select: { adminUsers: true, permissions: true } } } + }); + return rows.map((t) => ({ + id: t.id, + title: t.title, + users_count: t._count.adminUsers, + permissions_count: t._count.permissions + })); + } + /** + * Legacy `POST const` with `{key: "__list__ut", val: ""}` — creates a + * new access level. Legacy's `config_static` used an auto-increment id; here + * the next free integer is taken explicitly since UserType.id is not generated. + */ + async createUserType(title) { + if (!title?.trim()) + throw new common_12.BadRequestException("\u0646\u0627\u0645 \u0633\u0637\u062D \u062F\u0633\u062A\u0631\u0633\u06CC \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + const last = await this.prisma.userType.findFirst({ orderBy: { id: "desc" } }); + const nextId = (last?.id ?? 84) + 1; + return this.prisma.userType.create({ + data: { id: nextId, title: title.trim() } + }); + } + /** Legacy `GET roles/{ut}` — the rids granted to one access level. */ + async getRoles(userTypeId) { + const type = await this.prisma.userType.findUnique({ + where: { id: userTypeId }, + include: { permissions: true } + }); + if (!type) + throw new common_12.NotFoundException("\u0633\u0637\u062D \u062F\u0633\u062A\u0631\u0633\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return type.permissions.map((p) => p.rid); + } + /** + * Legacy `POST roles/create` with `{ut, roles: [...]}`. + * + * The posted array is the complete tick-state of the permission tree, so it + * REPLACES that type's rows — which is what legacy's live code does too: it + * posts the whole `this.rid` array and nothing else. + * + * (Legacy also carries a COMMENTED-OUT block that diffed the old and new sets + * and fired one DELETE per removed rid on a 500ms setTimeout. That path is + * dead in legacy and is not revived here; the transaction below achieves the + * same end atomically.) + */ + async setRoles(userTypeId, rids) { + const type = await this.prisma.userType.findUnique({ where: { id: userTypeId } }); + if (!type) + throw new common_12.NotFoundException("\u0633\u0637\u062D \u062F\u0633\u062A\u0631\u0633\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const clean = [...new Set((rids ?? []).map((r) => String(r)).filter(Boolean))]; + await this.prisma.$transaction([ + this.prisma.permission.deleteMany({ where: { userTypeId } }), + this.prisma.permission.createMany({ + data: clean.map((rid) => ({ rid, userTypeId })), + skipDuplicates: true + }) + ]); + return this.getRoles(userTypeId); + } + /** Legacy `DELETE roles/{ut}/{rid}` — revoke a single rid. */ + async revokeRole(userTypeId, rid) { + const existing = await this.prisma.permission.findUnique({ + where: { rid_userTypeId: { rid, userTypeId } } + }); + if (!existing) + throw new common_12.NotFoundException("\u0627\u06CC\u0646 \u062F\u0633\u062A\u0631\u0633\u06CC \u0648\u062C\u0648\u062F \u0646\u062F\u0627\u0631\u062F"); + await this.prisma.permission.delete({ + where: { rid_userTypeId: { rid, userTypeId } } + }); + return { success: true }; + } + /** Legacy `GET users/show` equivalent for the "اطلاعات من" screen. */ + async myData(adminId) { + return this.findOne(adminId); + } + /** The AdminRole picker for the user form. */ + roleOptions() { + return [ + { value: client_1.AdminRole.SUPER_ADMIN, title: "\u0645\u062F\u06CC\u0631 \u0627\u0631\u0634\u062F" }, + { value: client_1.AdminRole.SYSTEM_APPROVER, title: "\u062A\u0627\u06CC\u06CC\u062F \u0645\u062F\u06CC\u0631 \u0633\u06CC\u0633\u062A\u0645" }, + { value: client_1.AdminRole.SALES_EXPERT, title: "\u06A9\u0627\u0631\u0634\u0646\u0627\u0633 \u0641\u0631\u0648\u0634" }, + { value: client_1.AdminRole.WORKSHOP_SUPERVISOR, title: "\u0633\u0631\u067E\u0631\u0633\u062A \u06A9\u0627\u0631\u06AF\u0627\u0647" }, + { value: client_1.AdminRole.ACCOUNTANT, title: "\u062D\u0633\u0627\u0628\u062F\u0627\u0631" } + ]; + } + }; + exports2.AdminUsersService = AdminUsersService; + exports2.AdminUsersService = AdminUsersService = AdminUsersService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService + ]) + ], AdminUsersService); + } +}); + +// dist/modules/admin-users/admin-users.controller.js +var require_admin_users_controller = __commonJS({ + "dist/modules/admin-users/admin-users.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminUsersController = void 0; + var common_12 = require_common(); + var admin_users_service_1 = require_admin_users_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminUsersController = class AdminUsersController { + users; + constructor(users) { + this.users = users; + } + list(query) { + return this.users.list(query); + } + roleOptions() { + return this.users.roleOptions(); + } + /** Legacy GET const/__list__ut. */ + listUserTypes() { + return this.users.listUserTypes(); + } + /** Legacy POST const {key:"__list__ut", val:"<title>"}. */ + createUserType(body) { + return this.users.createUserType(body.val ?? body.title ?? ""); + } + /** Legacy GET roles/{ut}. */ + getRoles(ut) { + return this.users.getRoles(Number(ut)); + } + /** Legacy POST roles/create {ut, roles}. */ + setRoles(body) { + return this.users.setRoles(Number(body.ut), body.roles ?? []); + } + /** Legacy DELETE roles/{ut}/{rid}. */ + revokeRole(ut, rid) { + return this.users.revokeRole(Number(ut), rid); + } + /** The "اطلاعات من" screen. */ + myData(admin) { + return this.users.myData(admin.id); + } + create(data) { + return this.users.create(data); + } + findOne(id) { + return this.users.findOne(id); + } + update(id, data) { + return this.users.update(id, data); + } + remove(id, admin) { + return this.users.remove(id, admin.id); + } + }; + exports2.AdminUsersController = AdminUsersController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("user.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "list", null); + __decorate4([ + (0, common_12.Get)("role-options"), + (0, guards_1.RequirePermission)("user.list"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "roleOptions", null); + __decorate4([ + (0, common_12.Get)("types"), + (0, guards_1.RequirePermission)("user.list"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "listUserTypes", null); + __decorate4([ + (0, common_12.Post)("types"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("user.permission.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "createUserType", null); + __decorate4([ + (0, common_12.Get)("types/:ut/roles"), + (0, guards_1.RequirePermission)("user.permission"), + __param3(0, (0, common_12.Param)("ut")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "getRoles", null); + __decorate4([ + (0, common_12.Post)("roles"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("user.permission.edit"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "setRoles", null); + __decorate4([ + (0, common_12.Delete)("types/:ut/roles/:rid"), + (0, guards_1.RequirePermission)("user.permission.edit"), + __param3(0, (0, common_12.Param)("ut")), + __param3(1, (0, common_12.Param)("rid")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, String]), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "revokeRole", null); + __decorate4([ + (0, common_12.Get)("me"), + __param3(0, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "myData", null); + __decorate4([ + (0, common_12.Post)(), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("user.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "create", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("user.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "findOne", null); + __decorate4([ + (0, common_12.Put)(":id"), + (0, guards_1.RequirePermission)("user.list.edit"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "update", null); + __decorate4([ + (0, common_12.Delete)(":id"), + (0, guards_1.RequirePermission)("user.list.remove"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminUsersController.prototype, "remove", null); + exports2.AdminUsersController = AdminUsersController = __decorate4([ + (0, common_12.Controller)("admin/users"), + __metadata3("design:paramtypes", [admin_users_service_1.AdminUsersService]) + ], AdminUsersController); + } +}); + +// dist/modules/admin-users/admin-users.module.js +var require_admin_users_module = __commonJS({ + "dist/modules/admin-users/admin-users.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminUsersModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_users_controller_1 = require_admin_users_controller(); + var admin_users_service_1 = require_admin_users_service(); + var AdminUsersModule = class AdminUsersModule { + }; + exports2.AdminUsersModule = AdminUsersModule; + exports2.AdminUsersModule = AdminUsersModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_users_controller_1.AdminUsersController], + providers: [admin_users_service_1.AdminUsersService] + }) + ], AdminUsersModule); + } +}); + +// dist/modules/admin-invoices/admin-invoices.service.js +var require_admin_invoices_service = __commonJS({ + "dist/modules/admin-invoices/admin-invoices.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminInvoicesService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminInvoicesService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var AdminInvoicesService = class AdminInvoicesService { + static { + AdminInvoicesService_1 = this; + } + prisma; + table; + constructor(prisma, table) { + this.prisma = prisma; + this.table = table; + } + static ALLOWED = [ + "id", + "note", + "createdAt", + "branchId", + "branch.name", + "allocatorAdminUser.fullName", + // legacy filter keys + "name", + "caj" + ]; + static FIELD_ALIASES = { + name: "branch.name", + caj: "createdAt", + "allocator_user.name": "allocatorAdminUser.fullName" + }; + /** Legacy `POST branch/product/table`. */ + async list(query) { + this.table.assertNotExport(query); + const mapField = (f) => f ? AdminInvoicesService_1.FIELD_ALIASES[f] ?? f : f; + const aliased = { + ...query, + filters: (query.filters ?? []).map((f) => ({ ...f, field: mapField(f.field) })), + order: query.order ? `${query.order.startsWith("-") ? "-" : "+"}${mapField(query.order.replace(/^[+-]/, ""))}` : void 0 + }; + const { where, orderBy, skip, take, page, limit } = this.table.build(aliased, { + searchable: ["note", "branch.name"], + allowed: AdminInvoicesService_1.ALLOWED, + defaultOrderBy: { createdAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.branchAllocation.findMany({ + where, + orderBy, + skip, + take, + include: { + branch: true, + allocatorAdminUser: true, + items: { include: { product: true } } + } + }), + this.prisma.branchAllocation.count({ where }) + ]); + return this.table.respond(rows.map((r) => this.toRow(r)), total, query, page, limit); + } + toRow(a) { + const sumWeight = a.items.reduce((sum, it) => sum.add(it.weightGrams ?? new client_1.Prisma.Decimal(0)), new client_1.Prisma.Decimal(0)); + return { + id: a.id, + // legacy column key is `name` — the receiving branch + name: a.branch.name, + branch_id: a.branchId, + branch: { id: a.branch.id, name: a.branch.name }, + sum_weight: sumWeight, + count_item: a.items.length, + note: a.note, + allocator_user: a.allocatorAdminUser ? { id: a.allocatorAdminUser.id, name: a.allocatorAdminUser.fullName } : null, + caj: a.createdAt, + products: a.items.map((it) => ({ + id: it.productId, + pid: it.productId, + title: it.product.title, + product_code: it.product.productCode, + grams: it.weightGrams + })) + }; + } + /** Legacy `GET branch/product/{id}`. */ + async findOne(id) { + const a = await this.prisma.branchAllocation.findUnique({ + where: { id }, + include: { + branch: true, + allocatorAdminUser: true, + items: { include: { product: true } } + } + }); + if (!a) + throw new common_12.NotFoundException("\u0641\u0627\u06A9\u062A\u0648\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.toRow(a); + } + /** + * Legacy `POST branch/product` with `{ branch_id, products: [id...] }`. + * + * Each product's current lightest variant weight is snapshotted, so a later + * catalog edit does not silently rewrite what this document says was moved. + */ + async create(data, actorId) { + const branchId = String(data.branch_id ?? ""); + if (!branchId) + throw new common_12.BadRequestException("\u0634\u0639\u0628\u0647 \u0627\u0646\u062A\u062E\u0627\u0628 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + const branch = await this.prisma.branch.findUnique({ where: { id: branchId } }); + if (!branch) + throw new common_12.NotFoundException("\u0634\u0639\u0628\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const productIds = [...new Set((data.products ?? []).map((p) => String(p)).filter(Boolean))]; + if (productIds.length === 0) + throw new common_12.BadRequestException("\u0647\u06CC\u0686 \u0645\u062D\u0635\u0648\u0644\u06CC \u0627\u0646\u062A\u062E\u0627\u0628 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + const products = await this.prisma.product.findMany({ + where: { id: { in: productIds } }, + include: { variants: { where: { isActive: true } } } + }); + if (products.length !== productIds.length) { + throw new common_12.BadRequestException("\u0628\u0631\u062E\u06CC \u0627\u0632 \u0645\u062D\u0635\u0648\u0644\u0627\u062A \u0627\u0646\u062A\u062E\u0627\u0628\u200C\u0634\u062F\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F\u0646\u062F"); + } + const allocation = await this.prisma.branchAllocation.create({ + data: { + branchId, + allocatorAdminUserId: actorId, + note: data.note ?? null, + items: { + create: products.map((p) => ({ + productId: p.id, + weightGrams: p.variants.length ? p.variants.reduce((min, v) => v.rashWeightGrams.lt(min) ? v.rashWeightGrams : min, p.variants[0].rashWeightGrams) : null + })) + } + } + }); + return this.findOne(allocation.id); + } + /** Legacy `PUT branch/product/{id}` — the edit screen replaces the product set. */ + async update(id, data) { + const existing = await this.prisma.branchAllocation.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u0641\u0627\u06A9\u062A\u0648\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (data.branch_id) { + const branch = await this.prisma.branch.findUnique({ + where: { id: String(data.branch_id) } + }); + if (!branch) + throw new common_12.NotFoundException("\u0634\u0639\u0628\u0647 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + } + if (Array.isArray(data.products)) { + const productIds = [...new Set(data.products.map((p) => String(p)).filter(Boolean))]; + if (productIds.length === 0) { + throw new common_12.BadRequestException("\u0647\u06CC\u0686 \u0645\u062D\u0635\u0648\u0644\u06CC \u0627\u0646\u062A\u062E\u0627\u0628 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + } + const products = await this.prisma.product.findMany({ + where: { id: { in: productIds } }, + include: { variants: { where: { isActive: true } } } + }); + await this.prisma.$transaction([ + this.prisma.branchAllocationItem.deleteMany({ where: { allocationId: id } }), + this.prisma.branchAllocationItem.createMany({ + data: products.map((p) => ({ + allocationId: id, + productId: p.id, + weightGrams: p.variants.length ? p.variants.reduce((min, v) => v.rashWeightGrams.lt(min) ? v.rashWeightGrams : min, p.variants[0].rashWeightGrams) : null + })), + skipDuplicates: true + }) + ]); + } + await this.prisma.branchAllocation.update({ + where: { id }, + data: { + ...data.branch_id ? { branchId: String(data.branch_id) } : {}, + ...data.note !== void 0 ? { note: data.note } : {} + } + }); + return this.findOne(id); + } + /** Legacy `DELETE branch/product/{id}`. Items cascade. */ + async remove(id) { + const a = await this.prisma.branchAllocation.findUnique({ where: { id } }); + if (!a) + throw new common_12.NotFoundException("\u0641\u0627\u06A9\u062A\u0648\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + await this.prisma.branchAllocation.delete({ where: { id } }); + return { success: true }; + } + /** Legacy `GET branch/list` — the branch picker for the invoice form. */ + async branchList() { + const rows = await this.prisma.branch.findMany({ + where: { isActive: true }, + orderBy: { name: "asc" }, + select: { id: true, name: true } + }); + return rows; + } + }; + exports2.AdminInvoicesService = AdminInvoicesService; + exports2.AdminInvoicesService = AdminInvoicesService = AdminInvoicesService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService + ]) + ], AdminInvoicesService); + } +}); + +// dist/modules/admin-invoices/admin-invoices.controller.js +var require_admin_invoices_controller = __commonJS({ + "dist/modules/admin-invoices/admin-invoices.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminInvoicesController = void 0; + var common_12 = require_common(); + var admin_invoices_service_1 = require_admin_invoices_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminInvoicesController = class AdminInvoicesController { + invoices; + constructor(invoices) { + this.invoices = invoices; + } + list(query) { + return this.invoices.list(query); + } + branchList() { + return this.invoices.branchList(); + } + create(data, admin) { + return this.invoices.create(data, admin.id); + } + findOne(id) { + return this.invoices.findOne(id); + } + update(id, data) { + return this.invoices.update(id, data); + } + remove(id) { + return this.invoices.remove(id); + } + }; + exports2.AdminInvoicesController = AdminInvoicesController; + __decorate4([ + (0, common_12.Post)("list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("invoice.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminInvoicesController.prototype, "list", null); + __decorate4([ + (0, common_12.Get)("branch-list"), + (0, guards_1.RequirePermission)("invoice.create"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminInvoicesController.prototype, "branchList", null); + __decorate4([ + (0, common_12.Post)(), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("invoice.create"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object, Object]), + __metadata3("design:returntype", void 0) + ], AdminInvoicesController.prototype, "create", null); + __decorate4([ + (0, common_12.Get)(":id"), + (0, guards_1.RequirePermission)("invoice.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminInvoicesController.prototype, "findOne", null); + __decorate4([ + (0, common_12.Put)(":id"), + (0, guards_1.RequirePermission)("invoice.list"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminInvoicesController.prototype, "update", null); + __decorate4([ + (0, common_12.Delete)(":id"), + (0, guards_1.RequirePermission)("invoice.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminInvoicesController.prototype, "remove", null); + exports2.AdminInvoicesController = AdminInvoicesController = __decorate4([ + (0, common_12.Controller)("admin/invoices"), + __metadata3("design:paramtypes", [admin_invoices_service_1.AdminInvoicesService]) + ], AdminInvoicesController); + } +}); + +// dist/modules/admin-invoices/admin-invoices.module.js +var require_admin_invoices_module = __commonJS({ + "dist/modules/admin-invoices/admin-invoices.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminInvoicesModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_invoices_controller_1 = require_admin_invoices_controller(); + var admin_invoices_service_1 = require_admin_invoices_service(); + var AdminInvoicesModule = class AdminInvoicesModule { + }; + exports2.AdminInvoicesModule = AdminInvoicesModule; + exports2.AdminInvoicesModule = AdminInvoicesModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_invoices_controller_1.AdminInvoicesController], + providers: [admin_invoices_service_1.AdminInvoicesService] + }) + ], AdminInvoicesModule); + } +}); + +// dist/modules/admin-misc/admin-misc.service.js +var require_admin_misc_service = __commonJS({ + "dist/modules/admin-misc/admin-misc.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminMiscService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var prisma_service_1 = require_prisma_service(); + var table_service_1 = require_table_service(); + var AdminMiscService = class AdminMiscService { + prisma; + table; + constructor(prisma, table) { + this.prisma = prisma; + this.table = table; + } + // ── Cities ───────────────────────────────────────────────────────── + /** Legacy `POST cities/list` grid. */ + async listCities(query) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["name", "province"], + allowed: ["id", "name", "province", "percent", "percentAux"], + defaultOrderBy: { name: "asc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.city.findMany({ + where, + orderBy, + skip, + take, + include: { _count: { select: { customers: true, branches: true } } } + }), + this.prisma.city.count({ where }) + ]); + return this.table.respond(rows.map((c) => ({ + id: c.id, + title: c.name, + name: c.name, + province: c.province, + percent: c.percent, + percent_aux: c.percentAux, + customers_count: c._count.customers, + branches_count: c._count.branches + })), total, query, page, limit); + } + /** Legacy `POST cities`. */ + async createCity(data) { + const name = String(data.title ?? data.name ?? "").trim(); + if (!name) + throw new common_12.BadRequestException("\u0646\u0627\u0645 \u0634\u0647\u0631 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + return this.prisma.city.create({ data: { name, province: data.province ?? null } }); + } + /** Legacy `PUT cities/{id}` — the grid's inline edit also sets the percents. */ + async updateCity(id, data) { + const existing = await this.prisma.city.findUnique({ where: { id } }); + if (!existing) + throw new common_12.NotFoundException("\u0634\u0647\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const patch = {}; + if (data.title !== void 0 || data.name !== void 0) { + patch.name = String(data.title ?? data.name); + } + if (data.province !== void 0) + patch.province = data.province ?? null; + if (data.percent !== void 0) { + patch.percent = data.percent === null ? null : new client_1.Prisma.Decimal(String(data.percent)); + } + if (data.percent_aux !== void 0) { + patch.percentAux = data.percent_aux === null ? null : new client_1.Prisma.Decimal(String(data.percent_aux)); + } + return this.prisma.city.update({ where: { id }, data: patch }); + } + /** + * Legacy `DELETE cities/{id}`. + * + * Refuses while customers or branches still point at the city — legacy deleted + * regardless, orphaning those rows. + */ + async removeCity(id) { + const c = await this.prisma.city.findUnique({ + where: { id }, + include: { _count: { select: { customers: true, branches: true, addresses: true } } } + }); + if (!c) + throw new common_12.NotFoundException("\u0634\u0647\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const refs = c._count.customers + c._count.branches + c._count.addresses; + if (refs > 0) { + throw new common_12.BadRequestException(`\u062D\u0630\u0641 \u0627\u06CC\u0646 \u0634\u0647\u0631 \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A\u060C \u0686\u0648\u0646 ${refs} \u0645\u0634\u062A\u0631\u06CC\u060C \u0634\u0639\u0628\u0647 \u06CC\u0627 \u0622\u062F\u0631\u0633 \u0628\u0647 \u0622\u0646 \u0627\u0631\u062C\u0627\u0639 \u062F\u0627\u0631\u062F.`); + } + await this.prisma.city.delete({ where: { id } }); + return { success: true }; + } + /** Legacy `GET cities/get-percent/{id}` — returns the bare number. */ + async getCityPercent(id, aux) { + const c = await this.prisma.city.findUnique({ where: { id } }); + if (!c) + throw new common_12.NotFoundException("\u0634\u0647\u0631 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return aux ? c.percentAux : c.percent; + } + // ── SMS ──────────────────────────────────────────────────────────── + /** Legacy `POST sms/table` — the sent-message log. */ + async listSms(query) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["body", "recipients"], + allowed: ["id", "audience", "body", "createdAt", "sentCount"], + defaultOrderBy: { createdAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.smsMessage.findMany({ + where, + orderBy, + skip, + take, + include: { sentByAdminUser: true } + }), + this.prisma.smsMessage.count({ where }) + ]); + return this.table.respond(rows.map((s) => ({ + id: s.id, + type: s.audience, + text: s.body, + mobile: s.recipients, + sent_count: s.sentCount, + sender: s.sentByAdminUser?.fullName ?? null, + caj: s.createdAt + })), total, query, page, limit); + } + /** + * Legacy `POST sms` — records the send. + * + * NOTE no SMS gateway is wired up: legacy handed the message to an external + * provider, and this port has no credentials for one. The message is stored + * with the audience it resolved to, so the log is accurate, but nothing is + * actually transmitted. Flagged in docs/ADMIN-PORT-PLAN.md. + */ + async sendSms(data, actorId) { + const body = String(data.text ?? "").trim(); + if (!body) + throw new common_12.BadRequestException("\u0645\u062A\u0646 \u067E\u06CC\u0627\u0645\u06A9 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + const audience = this.resolveAudience(data.type); + const recipients = await this.resolveRecipients(audience, data.mobile); + return this.prisma.smsMessage.create({ + data: { + audience, + recipients: recipients.join(","), + body, + sentCount: recipients.length, + sentByAdminUserId: actorId + } + }); + } + /** + * Legacy's numeric audience codes, read off views/sms/create.vue where each + * option is gated by its own rid: + * -1 sms.create.single | 0 sms.create.all | 1 sms.create.reagent + * 2 sms.create.omde | 9 sms.create.multiple + * (there is no option for sms.create.single-customer "tak" in the legacy + * markup even though the rid exists — preserved as unreachable.) + */ + resolveAudience(type) { + const byCode = { + "-1": client_1.MessageAudience.SINGLE_NUMBER, + "0": client_1.MessageAudience.ALL_CUSTOMERS, + "1": client_1.MessageAudience.SALES_AGENTS, + "2": client_1.MessageAudience.WHOLESALE_CUSTOMERS, + "9": client_1.MessageAudience.MULTIPLE_NUMBERS + }; + const byName = { + single: client_1.MessageAudience.SINGLE_NUMBER, + multiple: client_1.MessageAudience.MULTIPLE_NUMBERS, + all: client_1.MessageAudience.ALL_CUSTOMERS, + omde: client_1.MessageAudience.WHOLESALE_CUSTOMERS, + tak: client_1.MessageAudience.RETAIL_CUSTOMERS, + reagent: client_1.MessageAudience.SALES_AGENTS + }; + const key = String(type ?? ""); + return byCode[key] ?? byName[key] ?? client_1.MessageAudience.SINGLE_NUMBER; + } + /** Expands an audience into the actual phone numbers it covers. */ + async resolveRecipients(audience, explicit) { + if (audience === client_1.MessageAudience.SINGLE_NUMBER || audience === client_1.MessageAudience.MULTIPLE_NUMBERS) { + const list = String(explicit ?? "").split(/[,\s\n]+/).map((x) => x.trim()).filter(Boolean); + if (list.length === 0) + throw new common_12.BadRequestException("\u0634\u0645\u0627\u0631\u0647 \u0645\u0648\u0628\u0627\u06CC\u0644 \u0648\u0627\u0631\u062F \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + return list; + } + if (audience === client_1.MessageAudience.SALES_AGENTS) { + const rows2 = await this.prisma.adminUser.findMany({ + where: { role: "SALES_EXPERT", isActive: true }, + select: { mobile: true } + }); + return rows2.map((r) => r.mobile); + } + const rows = await this.prisma.customer.findMany({ + where: { isActive: true }, + select: { mobile: true } + }); + return rows.map((r) => r.mobile); + } + // ── Notifications ────────────────────────────────────────────────── + /** Legacy `POST notify` — broadcast to an audience. */ + async createNotification(data, actorId) { + const title = String(data.title ?? "").trim(); + const body = String(data.body ?? data.text ?? "").trim(); + if (!title) + throw new common_12.BadRequestException("\u0639\u0646\u0648\u0627\u0646 \u0646\u0648\u062A\u06CC\u0641\u06CC\u06A9\u06CC\u0634\u0646 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + if (!body) + throw new common_12.BadRequestException("\u0645\u062A\u0646 \u0646\u0648\u062A\u06CC\u0641\u06CC\u06A9\u06CC\u0634\u0646 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + const audience = this.resolveAudience(data.type); + const customers = await this.prisma.customer.findMany({ + where: { isActive: true }, + select: { id: true } + }); + return this.prisma.notification.create({ + data: { + title, + body, + audience, + sentByAdminUserId: actorId, + recipients: { create: customers.map((c) => ({ customerId: c.id })) } + }, + include: { _count: { select: { recipients: true } } } + }); + } + /** Legacy `POST notify/customer` — send to one named customer. */ + async notifyCustomer(data, actorId) { + const customerId = String(data.customer_id ?? ""); + if (!customerId) + throw new common_12.BadRequestException("\u0645\u0634\u062A\u0631\u06CC \u0627\u0646\u062A\u062E\u0627\u0628 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + const customer = await this.prisma.customer.findUnique({ where: { id: customerId } }); + if (!customer) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const title = String(data.title ?? "").trim(); + const body = String(data.body ?? data.text ?? "").trim(); + if (!title || !body) + throw new common_12.BadRequestException("\u0639\u0646\u0648\u0627\u0646 \u0648 \u0645\u062A\u0646 \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + return this.prisma.notification.create({ + data: { + title, + body, + audience: client_1.MessageAudience.SINGLE_NUMBER, + sentByAdminUserId: actorId, + recipients: { create: [{ customerId }] } + } + }); + } + /** Legacy `GET notify/{id}` — one notification with its delivery state. */ + async findNotification(id) { + const n = await this.prisma.notification.findUnique({ + where: { id }, + include: { + sentByAdminUser: true, + recipients: { include: { customer: true } } + } + }); + if (!n) + throw new common_12.NotFoundException("\u0646\u0648\u062A\u06CC\u0641\u06CC\u06A9\u06CC\u0634\u0646 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return { + id: n.id, + title: n.title, + body: n.body, + text: n.body, + audience: n.audience, + sender: n.sentByAdminUser?.fullName ?? null, + caj: n.createdAt, + recipients: n.recipients.map((r) => ({ + id: r.id, + customer: { id: r.customer.id, name: r.customer.fullName, mobile: r.customer.mobile }, + read_at: r.readAt, + is_read: Boolean(r.readAt) + })), + read_count: n.recipients.filter((r) => r.readAt).length, + total_count: n.recipients.length + }; + } + /** Legacy `POST notify/list` — the notification log. */ + async listNotifications(query) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["title", "body"], + allowed: ["id", "title", "body", "audience", "createdAt"], + defaultOrderBy: { createdAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.notification.findMany({ + where, + orderBy, + skip, + take, + include: { + sentByAdminUser: true, + _count: { select: { recipients: true } } + } + }), + this.prisma.notification.count({ where }) + ]); + return this.table.respond(rows.map((n) => ({ + id: n.id, + title: n.title, + text: n.body, + audience: n.audience, + sender: n.sentByAdminUser?.fullName ?? null, + total_count: n._count.recipients, + caj: n.createdAt + })), total, query, page, limit); + } + /** Legacy `GET notify/read/{id}` — mark one recipient row read. */ + async markNotificationRead(recipientId) { + const r = await this.prisma.notificationRecipient.findUnique({ where: { id: recipientId } }); + if (!r) + throw new common_12.NotFoundException("\u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (r.readAt) + return r; + return this.prisma.notificationRecipient.update({ + where: { id: recipientId }, + data: { readAt: /* @__PURE__ */ new Date() } + }); + } + // ── Newsletter ───────────────────────────────────────────────────── + /** Legacy `POST ddf` — the newsletter signup list (legacy's own endpoint name). */ + async listNewsletter(query) { + this.table.assertNotExport(query); + const { where, orderBy, skip, take, page, limit } = this.table.build(query, { + searchable: ["email", "mobile"], + allowed: ["id", "email", "mobile", "createdAt"], + defaultOrderBy: { createdAt: "desc" } + }); + const [rows, total] = await Promise.all([ + this.prisma.newsletterSubscriber.findMany({ + where, + orderBy, + skip, + take + }), + this.prisma.newsletterSubscriber.count({ + where + }) + ]); + return this.table.respond(rows.map((n) => ({ id: n.id, email: n.email, mobile: n.mobile, caj: n.createdAt })), total, query, page, limit); + } + // ── Activity log ("آمار") ───────────────────────────────────────── + /** Legacy `GET log/list/customer` — customers that have any activity. */ + async logCustomers() { + const rows = await this.prisma.customer.findMany({ + where: { activityLogs: { some: {} } }, + orderBy: { fullName: "asc" }, + select: { id: true, fullName: true, mobile: true } + }); + return rows.map((c) => ({ id: c.id, name: c.fullName, mobile: c.mobile })); + } + /** Legacy `GET log/ago/{customerId}` — that customer's recent activity. */ + async customerLog(customerId) { + const customer = await this.prisma.customer.findUnique({ where: { id: customerId } }); + if (!customer) + throw new common_12.NotFoundException("\u0645\u0634\u062A\u0631\u06CC \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + const rows = await this.prisma.customerActivityLog.findMany({ + where: { customerId }, + orderBy: { createdAt: "desc" }, + take: 200 + }); + return rows.map((l) => ({ + id: l.id, + action: l.action, + detail: l.detail, + caj: l.createdAt + })); + } + // ── Settings ("مدیریت ثابت ها") ─────────────────────────────────── + /** Legacy `GET const/{key}`. */ + async getConst(key) { + const row = await this.prisma.setting.findUnique({ where: { key } }); + return row?.value ?? null; + } + /** Legacy `POST const` / `PUT const/{key}`. */ + async setConst(key, value) { + const row = await this.prisma.setting.upsert({ + where: { key }, + update: { value }, + create: { key, value } + }); + return row.value; + } + async listConsts() { + const rows = await this.prisma.setting.findMany({ orderBy: { key: "asc" } }); + return rows.map((r) => ({ key: r.key, value: r.value, updated_at: r.updatedAt })); + } + async removeConst(key) { + const row = await this.prisma.setting.findUnique({ where: { key } }); + if (!row) + throw new common_12.NotFoundException("\u062A\u0646\u0638\u06CC\u0645 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + await this.prisma.setting.delete({ where: { key } }); + return { success: true }; + } + // ── Brands (managed from the same "ثابت ها" screen) ─────────────── + async createBrand(title) { + if (!title?.trim()) + throw new common_12.BadRequestException("\u0639\u0646\u0648\u0627\u0646 \u0628\u0631\u0646\u062F \u0627\u0644\u0632\u0627\u0645\u06CC \u0627\u0633\u062A"); + return this.prisma.brand.create({ data: { title: title.trim() } }); + } + async updateBrand(id, title) { + const b = await this.prisma.brand.findUnique({ where: { id } }); + if (!b) + throw new common_12.NotFoundException("\u0628\u0631\u0646\u062F \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return this.prisma.brand.update({ where: { id }, data: { title } }); + } + async removeBrand(id) { + const b = await this.prisma.brand.findUnique({ + where: { id }, + include: { _count: { select: { products: true } } } + }); + if (!b) + throw new common_12.NotFoundException("\u0628\u0631\u0646\u062F \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + if (b._count.products > 0) { + throw new common_12.BadRequestException(`\u062D\u0630\u0641 \u0627\u06CC\u0646 \u0628\u0631\u0646\u062F \u0645\u0645\u06A9\u0646 \u0646\u06CC\u0633\u062A\u060C \u0686\u0648\u0646 ${b._count.products} \u0645\u062D\u0635\u0648\u0644 \u0628\u0647 \u0622\u0646 \u0627\u0631\u062C\u0627\u0639 \u062F\u0627\u0631\u062F.`); + } + await this.prisma.brand.delete({ where: { id } }); + return { success: true }; + } + /** Legacy `GET dashboard/link` — the report shortcuts on views/manage/report. */ + async dashboardLinks() { + const row = await this.prisma.setting.findUnique({ where: { key: "dashboard.links" } }); + return row?.value ?? []; + } + }; + exports2.AdminMiscService = AdminMiscService; + exports2.AdminMiscService = AdminMiscService = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [ + prisma_service_1.PrismaService, + table_service_1.TableService + ]) + ], AdminMiscService); + } +}); + +// dist/modules/admin-misc/admin-misc.controller.js +var require_admin_misc_controller = __commonJS({ + "dist/modules/admin-misc/admin-misc.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminMiscController = void 0; + var common_12 = require_common(); + var admin_misc_service_1 = require_admin_misc_service(); + var table_query_dto_1 = require_table_query_dto(); + var guards_1 = require_guards2(); + var AdminMiscController = class AdminMiscController { + misc; + constructor(misc) { + this.misc = misc; + } + // ── cities ──────────────────────────────────────────────────────── + listCities(query) { + return this.misc.listCities(query); + } + createCity(data) { + return this.misc.createCity(data); + } + getCityPercent(id) { + return this.misc.getCityPercent(id, false); + } + getCityPercentAux(id) { + return this.misc.getCityPercent(id, true); + } + updateCity(id, data) { + return this.misc.updateCity(id, data); + } + removeCity(id) { + return this.misc.removeCity(id); + } + // ── sms ─────────────────────────────────────────────────────────── + listSms(query) { + return this.misc.listSms(query); + } + sendSms(data, admin) { + return this.misc.sendSms(data, admin.id); + } + // ── notifications ───────────────────────────────────────────────── + listNotifications(query) { + return this.misc.listNotifications(query); + } + createNotification(data, admin) { + return this.misc.createNotification(data, admin.id); + } + notifyCustomer(data, admin) { + return this.misc.notifyCustomer(data, admin.id); + } + markRead(id) { + return this.misc.markNotificationRead(id); + } + findNotification(id) { + return this.misc.findNotification(id); + } + // ── newsletter ──────────────────────────────────────────────────── + listNewsletter(query) { + return this.misc.listNewsletter(query); + } + // ── activity log ────────────────────────────────────────────────── + logCustomers() { + return this.misc.logCustomers(); + } + customerLog(id) { + return this.misc.customerLog(id); + } + // ── settings + brands ("مدیریت ثابت ها") ───────────────────────── + dashboardLinks() { + return this.misc.dashboardLinks(); + } + listConsts() { + return this.misc.listConsts(); + } + createBrand(body) { + return this.misc.createBrand(body.title); + } + updateBrand(id, body) { + return this.misc.updateBrand(id, body.title); + } + removeBrand(id) { + return this.misc.removeBrand(id); + } + getConst(key) { + return this.misc.getConst(key); + } + setConst(key, body) { + return this.misc.setConst(key, body.val !== void 0 ? body.val : body); + } + removeConst(key) { + return this.misc.removeConst(key); + } + }; + exports2.AdminMiscController = AdminMiscController; + __decorate4([ + (0, common_12.Post)("cities/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("cities.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "listCities", null); + __decorate4([ + (0, common_12.Post)("cities"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("cities.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "createCity", null); + __decorate4([ + (0, common_12.Get)("cities/percent/:id"), + (0, guards_1.RequirePermission)("cities.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "getCityPercent", null); + __decorate4([ + (0, common_12.Get)("cities/percent-aux/:id"), + (0, guards_1.RequirePermission)("cities.list"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "getCityPercentAux", null); + __decorate4([ + (0, common_12.Put)("cities/:id"), + (0, guards_1.RequirePermission)("cities.list.view.edit"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "updateCity", null); + __decorate4([ + (0, common_12.Delete)("cities/:id"), + (0, guards_1.RequirePermission)("cities.list.remove"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "removeCity", null); + __decorate4([ + (0, common_12.Post)("sms/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("sms.list"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "listSms", null); + __decorate4([ + (0, common_12.Post)("sms"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("sms.create"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object, Object]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "sendSms", null); + __decorate4([ + (0, common_12.Post)("notify/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("notify.me"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "listNotifications", null); + __decorate4([ + (0, common_12.Post)("notify"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("notify.create"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object, Object]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "createNotification", null); + __decorate4([ + (0, common_12.Post)("notify/customer"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("notify.create"), + __param3(0, (0, common_12.Body)()), + __param3(1, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object, Object]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "notifyCustomer", null); + __decorate4([ + (0, common_12.Get)("notify/read/:id"), + (0, guards_1.RequirePermission)("notify.me"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "markRead", null); + __decorate4([ + (0, common_12.Get)("notify/:id"), + (0, guards_1.RequirePermission)("notify.me"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "findNotification", null); + __decorate4([ + (0, common_12.Post)("newsletter/list"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("newsletters"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [table_query_dto_1.TableQueryDto]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "listNewsletter", null); + __decorate4([ + (0, common_12.Get)("log/customers"), + (0, guards_1.RequirePermission)("statics"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "logCustomers", null); + __decorate4([ + (0, common_12.Get)("log/customer/:id"), + (0, guards_1.RequirePermission)("statics"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "customerLog", null); + __decorate4([ + (0, common_12.Get)("dashboard-links"), + (0, guards_1.RequirePermission)("config.report"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "dashboardLinks", null); + __decorate4([ + (0, common_12.Get)("const"), + (0, guards_1.RequirePermission)("config.statics"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "listConsts", null); + __decorate4([ + (0, common_12.Post)("brands"), + (0, common_12.HttpCode)(200), + (0, guards_1.RequirePermission)("config.statics.brand.create"), + __param3(0, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "createBrand", null); + __decorate4([ + (0, common_12.Put)("brands/:id"), + (0, guards_1.RequirePermission)("config.statics.brand.edit"), + __param3(0, (0, common_12.Param)("id")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "updateBrand", null); + __decorate4([ + (0, common_12.Delete)("brands/:id"), + (0, guards_1.RequirePermission)("config.statics.brand.remove"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "removeBrand", null); + __decorate4([ + (0, common_12.Get)("const/:key"), + (0, guards_1.RequirePermission)("config.statics"), + __param3(0, (0, common_12.Param)("key")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "getConst", null); + __decorate4([ + (0, common_12.Put)("const/:key"), + (0, guards_1.RequirePermission)("config.statics"), + __param3(0, (0, common_12.Param)("key")), + __param3(1, (0, common_12.Body)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, Object]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "setConst", null); + __decorate4([ + (0, common_12.Delete)("const/:key"), + (0, guards_1.RequirePermission)("config.statics"), + __param3(0, (0, common_12.Param)("key")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminMiscController.prototype, "removeConst", null); + exports2.AdminMiscController = AdminMiscController = __decorate4([ + (0, common_12.Controller)("admin/misc"), + __metadata3("design:paramtypes", [admin_misc_service_1.AdminMiscService]) + ], AdminMiscController); + } +}); + +// dist/modules/admin-misc/admin-misc.module.js +var require_admin_misc_module = __commonJS({ + "dist/modules/admin-misc/admin-misc.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminMiscModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_misc_controller_1 = require_admin_misc_controller(); + var admin_misc_service_1 = require_admin_misc_service(); + var AdminMiscModule = class AdminMiscModule { + }; + exports2.AdminMiscModule = AdminMiscModule; + exports2.AdminMiscModule = AdminMiscModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_misc_controller_1.AdminMiscController], + providers: [admin_misc_service_1.AdminMiscService] + }) + ], AdminMiscModule); + } +}); + +// dist/modules/admin-uploads/admin-uploads.service.js +var require_admin_uploads_service = __commonJS({ + "dist/modules/admin-uploads/admin-uploads.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminUploadsService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminUploadsService = void 0; + var common_12 = require_common(); + var node_crypto_1 = require("node:crypto"); + var promises_1 = require("node:fs/promises"); + var node_path_12 = require("node:path"); + var prisma_service_1 = require_prisma_service(); + var AdminUploadsService = class AdminUploadsService { + static { + AdminUploadsService_1 = this; + } + prisma; + /** Matches legacy's flat public/storage directory. */ + dir = process.env.UPLOAD_DIR ?? (0, node_path_12.join)(process.cwd(), "storage", "uploads"); + /** Mirrors legacy's `type` field: 1 = image, 2 = any other document. */ + static IMAGE_MIME = /^image\/(jpeg|png|gif|webp|svg\+xml)$/; + static ALLOWED = /^(image\/(jpeg|png|gif|webp|svg\+xml)|application\/pdf)$/; + /** 8 MB. Legacy relied on PHP's upload_max_filesize; this makes it explicit. */ + static MAX_BYTES = 8 * 1024 * 1024; + constructor(prisma) { + this.prisma = prisma; + } + async store(file2, purpose, actorAdminUserId) { + if (!file2) + throw new common_12.BadRequestException("\u0641\u0627\u06CC\u0644\u06CC \u0627\u0631\u0633\u0627\u0644 \u0646\u0634\u062F\u0647 \u0627\u0633\u062A"); + if (file2.size > AdminUploadsService_1.MAX_BYTES) { + throw new common_12.BadRequestException("\u062D\u062C\u0645 \u0641\u0627\u06CC\u0644 \u0628\u06CC\u0634 \u0627\u0632 \u062D\u062F \u0645\u062C\u0627\u0632 \u0627\u0633\u062A (\u06F8 \u0645\u06AF\u0627\u0628\u0627\u06CC\u062A)"); + } + if (!AdminUploadsService_1.ALLOWED.test(file2.mimetype)) { + throw new common_12.BadRequestException("\u0646\u0648\u0639 \u0641\u0627\u06CC\u0644 \u0645\u062C\u0627\u0632 \u0646\u06CC\u0633\u062A"); + } + const ext = (0, node_path_12.extname)(file2.originalname).toLowerCase(); + const stored = (0, node_crypto_1.createHash)("md5").update(`${Date.now()}${file2.originalname}${(0, node_crypto_1.randomUUID)()}`).digest("hex") + ext; + await (0, promises_1.mkdir)(this.dir, { recursive: true }); + await (0, promises_1.writeFile)((0, node_path_12.join)(this.dir, stored), file2.buffer); + return this.prisma.uploadedFile.create({ + data: { + url: `/uploads/${stored}`, + originalName: file2.originalname, + mimeType: file2.mimetype, + sizeBytes: file2.size, + purpose: purpose ?? null, + uploadedByAdminUserId: actorAdminUserId + } + }); + } + async findOne(id) { + const f = await this.prisma.uploadedFile.findUnique({ where: { id } }); + if (!f) + throw new common_12.NotFoundException("\u0641\u0627\u06CC\u0644 \u06CC\u0627\u0641\u062A \u0646\u0634\u062F"); + return f; + } + /** True when the stored file is an image, for callers that care. */ + static isImage(mime) { + return AdminUploadsService_1.IMAGE_MIME.test(mime); + } + }; + exports2.AdminUploadsService = AdminUploadsService; + exports2.AdminUploadsService = AdminUploadsService = AdminUploadsService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [prisma_service_1.PrismaService]) + ], AdminUploadsService); + } +}); + +// dist/modules/admin-uploads/admin-uploads.controller.js +var require_admin_uploads_controller = __commonJS({ + "dist/modules/admin-uploads/admin-uploads.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminUploadsController = void 0; + var common_12 = require_common(); + var platform_express_1 = require_platform_express(); + var admin_uploads_service_1 = require_admin_uploads_service(); + var guards_1 = require_guards2(); + var common_2 = require_common(); + var AdminUploadsController = class AdminUploadsController { + uploads; + constructor(uploads) { + this.uploads = uploads; + } + create(file2, purpose, admin) { + return this.uploads.store(file2, purpose, admin.id ?? null); + } + findOne(id) { + return this.uploads.findOne(id); + } + }; + exports2.AdminUploadsController = AdminUploadsController; + __decorate4([ + (0, common_12.Post)("create"), + (0, common_12.HttpCode)(200), + (0, common_12.UseInterceptors)((0, platform_express_1.FileInterceptor)("file")), + __param3(0, (0, common_12.UploadedFile)()), + __param3(1, (0, common_2.Body)("purpose")), + __param3(2, (0, guards_1.CurrentAdmin)()), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [Object, Object, Object]), + __metadata3("design:returntype", void 0) + ], AdminUploadsController.prototype, "create", null); + __decorate4([ + (0, common_12.Get)(":id"), + __param3(0, (0, common_12.Param)("id")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String]), + __metadata3("design:returntype", void 0) + ], AdminUploadsController.prototype, "findOne", null); + exports2.AdminUploadsController = AdminUploadsController = __decorate4([ + (0, common_12.Controller)("admin/files"), + __metadata3("design:paramtypes", [admin_uploads_service_1.AdminUploadsService]) + ], AdminUploadsController); + } +}); + +// dist/modules/admin-uploads/admin-uploads.module.js +var require_admin_uploads_module = __commonJS({ + "dist/modules/admin-uploads/admin-uploads.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminUploadsModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_uploads_controller_1 = require_admin_uploads_controller(); + var admin_uploads_service_1 = require_admin_uploads_service(); + var AdminUploadsModule = class AdminUploadsModule { + }; + exports2.AdminUploadsModule = AdminUploadsModule; + exports2.AdminUploadsModule = AdminUploadsModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_uploads_controller_1.AdminUploadsController], + providers: [admin_uploads_service_1.AdminUploadsService], + exports: [admin_uploads_service_1.AdminUploadsService] + }) + ], AdminUploadsModule); + } +}); + +// dist/modules/admin-dashboard/admin-dashboard.service.js +var require_admin_dashboard_service = __commonJS({ + "dist/modules/admin-dashboard/admin-dashboard.service.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var AdminDashboardService_1; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminDashboardService = void 0; + var common_12 = require_common(); + var client_1 = require("@prisma/client"); + var prisma_service_1 = require_prisma_service(); + var AdminDashboardService = class AdminDashboardService { + static { + AdminDashboardService_1 = this; + } + prisma; + constructor(prisma) { + this.prisma = prisma; + } + daysAgo(n) { + const d = /* @__PURE__ */ new Date(); + d.setDate(d.getDate() - n); + return d; + } + /** Orders that have reached the debt-recognition point count as "sold". */ + static SOLD = { + status: { in: [client_1.OrderStatus.DELIVERED_TO_AGENT, client_1.OrderStatus.DELIVERED_TO_CUSTOMER] } + }; + /** Legacy `GET get-analytics` — the wholesale dashboard. */ + async omdeAnalytics() { + const since30 = this.daysAgo(30); + const since7 = this.daysAgo(7); + const [customerCount, gramsAgg, orderCount, lastOrderRows, agents, monthAgg] = await Promise.all([ + // تعداد مشتریان ثبت نامی در 30 روز گذشته + this.prisma.customer.count({ where: { createdAt: { gte: since30 } } }), + // طلای فروش رفته در 30 روز گذشته + this.prisma.order.aggregate({ + where: { AND: [AdminDashboardService_1.SOLD, { createdAt: { gte: since30 } }] }, + _sum: { totalGoldWeightGrams: true } + }), + // تعداد سفارشات 30 روز گذشته + this.prisma.order.count({ where: { createdAt: { gte: since30 } } }), + // سفارشات هفته جاری + this.prisma.order.findMany({ + where: { createdAt: { gte: since7 } }, + orderBy: { createdAt: "desc" }, + take: 50, + include: { customer: true, branch: true } + }), + // عملکرد کارشناسان فروش + this.prisma.adminUser.findMany({ + where: { role: "SALES_EXPERT", isActive: true }, + select: { id: true, fullName: true } + }), + // میزان فروش (same 30-day window, kept separate for clarity) + this.prisma.order.aggregate({ + where: { AND: [AdminDashboardService_1.SOLD, { createdAt: { gte: since30 } }] }, + _sum: { totalGoldWeightGrams: true }, + _count: true + }) + ]); + const reagent = await Promise.all(agents.map(async (a) => { + const agg = await this.prisma.order.aggregate({ + where: { + AND: [ + AdminDashboardService_1.SOLD, + { customer: { referredByAgentId: a.id } }, + { createdAt: { gte: since30 } } + ] + }, + _sum: { totalGoldWeightGrams: true }, + _count: true + }); + return { + id: a.id, + name: a.fullName, + grams_sell: agg._sum.totalGoldWeightGrams ?? new client_1.Prisma.Decimal(0), + order_count: agg._count + }; + })); + return { + customerCount, + allgram: gramsAgg._sum.totalGoldWeightGrams ?? 0, + ordercount: orderCount, + reagent, + lastOrder: lastOrderRows.map((o) => this.orderRow(o)), + sumLastOrder: monthAgg._count, + sumLastOrderMonth: monthAgg._sum.totalGoldWeightGrams ?? 0 + }; + } + /** Legacy `GET get-analytics-tak` — the retail dashboard. */ + async takAnalytics() { + const since7 = this.daysAgo(7); + const rows = await this.prisma.order.findMany({ + where: { createdAt: { gte: since7 } }, + orderBy: { createdAt: "desc" }, + take: 50, + include: { customer: true, branch: true } + }); + return { lastOrder: rows.map((o) => this.orderRow(o)) }; + } + /** + * Legacy `report/order_item` — "گزارش تجمیعی سفارشات و اسناد مالی": order + * lines aggregated over a date range. + */ + async orderItemReport(from, to) { + const where = this.dateWhere(from, to); + const orders = await this.prisma.order.findMany({ + where, + include: { + customer: true, + items: { include: { productVariant: { include: { product: true } } } } + }, + orderBy: { createdAt: "desc" } + }); + const rows = orders.flatMap((o) => o.items.map((it) => ({ + order_id: o.id, + order_number: o.orderNumber, + customer: o.customer.fullName, + product: it.productVariant.product.title, + variant: it.productVariant.title, + qty: it.quantity, + w: it.computedWeightGrams, + total_w: it.computedWeightGrams.mul(it.quantity), + caj: o.createdAt + }))); + const totalWeight = rows.reduce((s, r) => s.add(r.total_w), new client_1.Prisma.Decimal(0)); + return { + rows, + summary: { + order_count: orders.length, + item_count: rows.length, + total_weight: totalWeight + } + }; + } + /** Legacy `report/product` — per-product sales over a date range. */ + async productReport(from, to) { + const where = this.dateWhere(from, to); + const orders = await this.prisma.order.findMany({ + where, + include: { items: { include: { productVariant: { include: { product: true } } } } } + }); + const byProduct = /* @__PURE__ */ new Map(); + for (const o of orders) { + for (const it of o.items) { + const p = it.productVariant.product; + const row = byProduct.get(p.id) ?? { + id: p.id, + title: p.title, + qty: 0, + weight: new client_1.Prisma.Decimal(0), + orders: /* @__PURE__ */ new Set() + }; + row.qty += it.quantity; + row.weight = row.weight.add(it.computedWeightGrams.mul(it.quantity)); + row.orders.add(o.id); + byProduct.set(p.id, row); + } + } + const rows = [...byProduct.values()].map((r) => ({ + id: r.id, + title: r.title, + total: r.qty, + w: r.weight, + order_count: r.orders.size + })).sort((a, b) => Number(b.w) - Number(a.w)); + return { rows, summary: { product_count: rows.length } }; + } + /** Shared date filter for both reports; an open end stays open. */ + dateWhere(from, to) { + if (!from && !to) + return {}; + const createdAt = {}; + if (from) + createdAt.gte = new Date(from); + if (to) { + const end = new Date(to); + end.setHours(23, 59, 59, 999); + createdAt.lte = end; + } + return { createdAt }; + } + /** The row shape both dashboards' tables read. */ + orderRow(o) { + const labels = { + SUSPENDED: "\u0645\u0639\u0644\u0642 (\u0633\u0642\u0641 \u0627\u0639\u062A\u0628\u0627\u0631)", + PLACED: "\u062B\u0628\u062A \u0634\u062F\u0647", + ADMIN_APPROVED: "\u062A\u0627\u06CC\u06CC\u062F \u0645\u062F\u06CC\u0631", + SOURCING: "\u062F\u0631 \u062D\u0627\u0644 \u062A\u0627\u0645\u06CC\u0646", + PREPARING: "\u062F\u0631 \u062D\u0627\u0644 \u0622\u0645\u0627\u062F\u0647\u200C\u0633\u0627\u0632\u06CC", + DELIVERED_TO_AGENT: "\u062A\u062D\u0648\u06CC\u0644 \u0628\u0647 \u0646\u0645\u0627\u06CC\u0646\u062F\u0647", + DELIVERED_TO_CUSTOMER: "\u062A\u062D\u0648\u06CC\u0644 \u0628\u0647 \u0645\u0634\u062A\u0631\u06CC", + CANCELLED: "\u0644\u063A\u0648 \u0634\u062F\u0647" + }; + const colors = { + SUSPENDED: "warning", + PLACED: "primary", + ADMIN_APPROVED: "primary", + SOURCING: "warning", + PREPARING: "warning", + DELIVERED_TO_AGENT: "success", + DELIVERED_TO_CUSTOMER: "success", + CANCELLED: "danger" + }; + return { + id: o.id, + name: o.orderNumber, + customer: o.customer.fullName, + w: o.totalGoldWeightGrams, + sts_str: labels[o.status], + statusColor: colors[o.status], + caj: o.createdAt, + // legacy rendered a parent/children tree for split orders; the redesigned + // schema has no such relation, so both are empty rather than faked. + parent: null, + children: [] + }; + } + }; + exports2.AdminDashboardService = AdminDashboardService; + exports2.AdminDashboardService = AdminDashboardService = AdminDashboardService_1 = __decorate4([ + (0, common_12.Injectable)(), + __metadata3("design:paramtypes", [prisma_service_1.PrismaService]) + ], AdminDashboardService); + } +}); + +// dist/modules/admin-dashboard/admin-dashboard.controller.js +var require_admin_dashboard_controller = __commonJS({ + "dist/modules/admin-dashboard/admin-dashboard.controller.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + var __metadata3 = exports2 && exports2.__metadata || function(k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); + }; + var __param3 = exports2 && exports2.__param || function(paramIndex, decorator) { + return function(target, key) { + decorator(target, key, paramIndex); + }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminDashboardController = void 0; + var common_12 = require_common(); + var admin_dashboard_service_1 = require_admin_dashboard_service(); + var guards_1 = require_guards2(); + var AdminDashboardController = class AdminDashboardController { + dashboard; + constructor(dashboard) { + this.dashboard = dashboard; + } + omde() { + return this.dashboard.omdeAnalytics(); + } + tak() { + return this.dashboard.takAnalytics(); + } + /** Legacy views/report/order_item.vue. */ + orderItemReport(from, to) { + return this.dashboard.orderItemReport(from, to); + } + /** Legacy views/report/product.vue. */ + productReport(from, to) { + return this.dashboard.productReport(from, to); + } + }; + exports2.AdminDashboardController = AdminDashboardController; + __decorate4([ + (0, common_12.Get)("omde"), + (0, guards_1.RequirePermission)("dashboard.omde"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminDashboardController.prototype, "omde", null); + __decorate4([ + (0, common_12.Get)("tak"), + (0, guards_1.RequirePermission)("dashboard.tak"), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", []), + __metadata3("design:returntype", void 0) + ], AdminDashboardController.prototype, "tak", null); + __decorate4([ + (0, common_12.Get)("report/order-item"), + (0, guards_1.RequirePermission)("report.order.item"), + __param3(0, (0, common_12.Query)("start_date")), + __param3(1, (0, common_12.Query)("end_date")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, String]), + __metadata3("design:returntype", void 0) + ], AdminDashboardController.prototype, "orderItemReport", null); + __decorate4([ + (0, common_12.Get)("report/product"), + (0, guards_1.RequirePermission)("report.product"), + __param3(0, (0, common_12.Query)("start_date")), + __param3(1, (0, common_12.Query)("end_date")), + __metadata3("design:type", Function), + __metadata3("design:paramtypes", [String, String]), + __metadata3("design:returntype", void 0) + ], AdminDashboardController.prototype, "productReport", null); + exports2.AdminDashboardController = AdminDashboardController = __decorate4([ + (0, common_12.Controller)("admin/dashboard"), + __metadata3("design:paramtypes", [admin_dashboard_service_1.AdminDashboardService]) + ], AdminDashboardController); + } +}); + +// dist/modules/admin-dashboard/admin-dashboard.module.js +var require_admin_dashboard_module = __commonJS({ + "dist/modules/admin-dashboard/admin-dashboard.module.js"(exports2) { + "use strict"; + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AdminDashboardModule = void 0; + var common_12 = require_common(); + var prisma_module_1 = require_prisma_module(); + var admin_dashboard_controller_1 = require_admin_dashboard_controller(); + var admin_dashboard_service_1 = require_admin_dashboard_service(); + var AdminDashboardModule = class AdminDashboardModule { + }; + exports2.AdminDashboardModule = AdminDashboardModule; + exports2.AdminDashboardModule = AdminDashboardModule = __decorate4([ + (0, common_12.Module)({ + imports: [prisma_module_1.PrismaModule], + controllers: [admin_dashboard_controller_1.AdminDashboardController], + providers: [admin_dashboard_service_1.AdminDashboardService] + }) + ], AdminDashboardModule); + } +}); + // dist/app.module.js var require_app_module = __commonJS({ "dist/app.module.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; @@ -77541,12 +92887,55 @@ var require_app_module = __commonJS({ var orders_module_1 = require_orders_module(); var accounting_module_1 = require_accounting_module(); var pricing_module_1 = require_pricing_module(); + var auth_module_1 = require_auth_module(); + var admin_table_module_1 = require_admin_table_module(); + var admin_orders_module_1 = require_admin_orders_module(); + var admin_cities_module_1 = require_admin_cities_module(); + var admin_preorders_module_1 = require_admin_preorders_module(); + var admin_workshops_module_1 = require_admin_workshops_module(); + var admin_customers_module_1 = require_admin_customers_module(); + var admin_comments_module_1 = require_admin_comments_module(); + var admin_products_module_1 = require_admin_products_module(); + var admin_categories_module_1 = require_admin_categories_module(); + var admin_documents_module_1 = require_admin_documents_module(); + var admin_promotions_module_1 = require_admin_promotions_module(); + var admin_users_module_1 = require_admin_users_module(); + var admin_branches_module_1 = require_admin_branches_module(); + var admin_invoices_module_1 = require_admin_invoices_module(); + var admin_misc_module_1 = require_admin_misc_module(); + var admin_uploads_module_1 = require_admin_uploads_module(); + var admin_dashboard_module_1 = require_admin_dashboard_module(); var AppModule = class AppModule { }; exports2.AppModule = AppModule; - exports2.AppModule = AppModule = __decorate2([ + exports2.AppModule = AppModule = __decorate4([ (0, common_12.Module)({ - imports: [prisma_module_1.PrismaModule, catalog_module_1.CatalogModule, customers_module_1.CustomersModule, orders_module_1.OrdersModule, accounting_module_1.AccountingModule, pricing_module_1.PricingModule] + imports: [ + prisma_module_1.PrismaModule, + auth_module_1.AuthModule, + admin_table_module_1.AdminTableModule, + admin_orders_module_1.AdminOrdersModule, + admin_cities_module_1.AdminCitiesModule, + admin_preorders_module_1.AdminPreOrdersModule, + admin_workshops_module_1.AdminWorkshopsModule, + admin_customers_module_1.AdminCustomersModule, + admin_comments_module_1.AdminCommentsModule, + admin_products_module_1.AdminProductsModule, + admin_categories_module_1.AdminCategoriesModule, + admin_documents_module_1.AdminDocumentsModule, + admin_promotions_module_1.AdminPromotionsModule, + admin_users_module_1.AdminUsersModule, + admin_branches_module_1.AdminBranchesModule, + admin_invoices_module_1.AdminInvoicesModule, + admin_misc_module_1.AdminMiscModule, + admin_uploads_module_1.AdminUploadsModule, + admin_dashboard_module_1.AdminDashboardModule, + catalog_module_1.CatalogModule, + customers_module_1.CustomersModule, + orders_module_1.OrdersModule, + accounting_module_1.AccountingModule, + pricing_module_1.PricingModule + ] }) ], AppModule); } @@ -77636,9 +93025,28 @@ var require_migrate = __commonJS({ statements.push(current.trim()); return statements; } + function discoverMigrationFiles(dir) { + const entries = (0, fs_1.readdirSync)(dir); + const files = []; + for (const entry of entries) { + const full = (0, path_1.join)(dir, entry); + const stat = (0, fs_1.statSync)(full); + if (stat.isFile() && entry.endsWith(".sql")) { + files.push({ name: entry, path: full }); + continue; + } + if (stat.isDirectory()) { + const sqlPath = (0, path_1.join)(full, "migration.sql"); + if ((0, fs_1.existsSync)(sqlPath)) { + files.push({ name: entry, path: sqlPath }); + } + } + } + return files.sort((a, b) => a.name.localeCompare(b.name)); + } async function runMigrations(prisma) { const dir = resolveMigrationsDir(); - const files = (0, fs_1.readdirSync)(dir).filter((name) => name.endsWith(".sql")).sort(); + const files = discoverMigrationFiles(dir); const trackingExisted = await prisma.$queryRawUnsafe(`SELECT EXISTS ( SELECT 1 FROM information_schema.tables WHERE table_schema = current_schema() AND table_name = $1 @@ -77652,21 +93060,21 @@ var require_migrate = __commonJS({ const appliedNames = new Set(alreadyApplied.map((row) => row.name)); const applied = []; for (const file2 of files) { - if (appliedNames.has(file2)) + if (appliedNames.has(file2.name)) continue; - const statements = splitSqlStatements((0, fs_1.readFileSync)((0, path_1.join)(dir, file2), "utf8")); + const statements = splitSqlStatements((0, fs_1.readFileSync)(file2.path, "utf8")); await prisma.$transaction( async (tx) => { for (const statement of statements) { await tx.$executeRawUnsafe(statement); } - await tx.$executeRawUnsafe(`INSERT INTO "${TRACKING_TABLE}" (name) VALUES ($1)`, file2); + await tx.$executeRawUnsafe(`INSERT INTO "${TRACKING_TABLE}" (name) VALUES ($1)`, file2.name); }, // The baseline migration is hundreds of DDL statements; the 5s default is // not enough, especially against a remote database. { maxWait: 6e4, timeout: 6e5 } ); - applied.push(file2); + applied.push(file2.name); } return { freshDatabase, applied }; } @@ -77740,7 +93148,7 @@ var require_bootstrap = __commonJS({ var require_prisma_exception_filter = __commonJS({ "dist/prisma/prisma-exception.filter.js"(exports2) { "use strict"; - var __decorate2 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { + var __decorate4 = exports2 && exports2.__decorate || function(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; @@ -77798,7 +93206,7 @@ var require_prisma_exception_filter = __commonJS({ } }; exports2.PrismaExceptionFilter = PrismaExceptionFilter; - exports2.PrismaExceptionFilter = PrismaExceptionFilter = __decorate2([ + exports2.PrismaExceptionFilter = PrismaExceptionFilter = __decorate4([ (0, common_12.Catch)(client_1.Prisma.PrismaClientKnownRequestError, client_1.Prisma.PrismaClientValidationError) ], PrismaExceptionFilter); } @@ -77809,9 +93217,13 @@ Object.defineProperty(exports, "__esModule", { value: true }); require_Reflect(); var core_1 = require_core3(); var common_1 = require_common(); +var node_path_1 = require("node:path"); var app_module_1 = require_app_module(); var bootstrap_1 = require_bootstrap(); var prisma_exception_filter_1 = require_prisma_exception_filter(); +var EXTRA_MIME_TYPES = { + ".avif": "image/avif" +}; async function bootstrap() { await (0, bootstrap_1.prepareDatabase)(); const app = await core_1.NestFactory.create(app_module_1.AppModule); @@ -77819,6 +93231,16 @@ async function bootstrap() { app.useGlobalPipes(new common_1.ValidationPipe({ whitelist: true, transform: true })); app.useGlobalFilters(new prisma_exception_filter_1.PrismaExceptionFilter()); app.enableCors(); + app.useStaticAssets(process.env.UPLOAD_DIR ?? (0, node_path_1.join)(process.cwd(), "storage", "uploads"), { + prefix: "/uploads/", + index: false, + dotfiles: "deny", + setHeaders: (res, path) => { + const mime = EXTRA_MIME_TYPES[(0, node_path_1.extname)(path).toLowerCase()]; + if (mime) + res.setHeader("Content-Type", mime); + } + }); await app.listen(process.env.PORT ?? 3e3, "0.0.0.0"); } bootstrap(); diff --git a/apps/api/release/migrations/0001_init.sql b/apps/api/release/migrations/0001_init.sql deleted file mode 100644 index c12ff02..0000000 --- a/apps/api/release/migrations/0001_init.sql +++ /dev/null @@ -1,431 +0,0 @@ --- CreateEnum -CREATE TYPE "AdminRole" AS ENUM ('SUPER_ADMIN', 'SYSTEM_APPROVER', 'SALES_EXPERT', 'WORKSHOP_SUPERVISOR', 'ACCOUNTANT'); - --- CreateEnum -CREATE TYPE "VerificationStep" AS ENUM ('UNVERIFIED', 'STEP_ONE_SUBMITTED', 'STEP_TWO_SUBMITTED', 'VERIFIED'); - --- CreateEnum -CREATE TYPE "OrderStatus" AS ENUM ('SUSPENDED', 'PLACED', 'ADMIN_APPROVED', 'SOURCING', 'PREPARING', 'DELIVERED_TO_AGENT', 'DELIVERED_TO_CUSTOMER', 'CANCELLED'); - --- CreateEnum -CREATE TYPE "PreOrderStatus" AS ENUM ('PLACED', 'ADMIN_APPROVED', 'WORKSHOP_APPROVED', 'READY_TO_SHIP', 'DELIVERED', 'CANCELLED'); - --- CreateEnum -CREATE TYPE "LedgerCurrency" AS ENUM ('GOLD_GRAM', 'RIAL'); - --- CreateEnum -CREATE TYPE "LedgerDirection" AS ENUM ('DEBIT', 'CREDIT'); - --- CreateEnum -CREATE TYPE "LedgerSourceType" AS ENUM ('ORDER_STOCK', 'ORDER_PRE_ORDER', 'REPAYMENT_MELTED_GOLD', 'REPAYMENT_TRANSFER', 'REPAYMENT_CHEQUE', 'REPAYMENT_CASH', 'WALLET_BONUS', 'ADJUSTMENT'); - --- CreateTable -CREATE TABLE "City" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "province" TEXT, - - CONSTRAINT "City_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "AdminUser" ( - "id" TEXT NOT NULL, - "fullName" TEXT NOT NULL, - "mobile" TEXT NOT NULL, - "passwordHash" TEXT NOT NULL, - "role" "AdminRole" NOT NULL, - "branchId" TEXT, - "wagePercent" DECIMAL(6,3), - "isActive" BOOLEAN NOT NULL DEFAULT true, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "AdminUser_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Customer" ( - "id" TEXT NOT NULL, - "fullName" TEXT NOT NULL, - "mobile" TEXT NOT NULL, - "nationalCode" TEXT NOT NULL, - "passwordHash" TEXT NOT NULL, - "cityId" TEXT, - "referredByAgentId" TEXT, - "goldCreditLimitGrams" DECIMAL(14,4) NOT NULL DEFAULT 0, - "goldDebtGrams" DECIMAL(14,4) NOT NULL DEFAULT 0, - "fiatDebtRial" DECIMAL(20,2) NOT NULL DEFAULT 0, - "verificationStep" "VerificationStep" NOT NULL DEFAULT 'UNVERIFIED', - "nationalIdImageUrl" TEXT, - "businessLicenseUrl" TEXT, - "shopImageUrl" TEXT, - "isActive" BOOLEAN NOT NULL DEFAULT true, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Customer_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "CustomerAddress" ( - "id" TEXT NOT NULL, - "customerId" TEXT NOT NULL, - "cityId" TEXT, - "addressLine" TEXT NOT NULL, - "isDefault" BOOLEAN NOT NULL DEFAULT false, - - CONSTRAINT "CustomerAddress_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Branch" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "cityId" TEXT, - - CONSTRAINT "Branch_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Workshop" ( - "id" TEXT NOT NULL, - "name" TEXT NOT NULL, - "isActive" BOOLEAN NOT NULL DEFAULT true, - - CONSTRAINT "Workshop_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Category" ( - "id" TEXT NOT NULL, - "title" TEXT NOT NULL, - "parentId" TEXT, - - CONSTRAINT "Category_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Brand" ( - "id" TEXT NOT NULL, - "title" TEXT NOT NULL, - - CONSTRAINT "Brand_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Collection" ( - "id" TEXT NOT NULL, - "title" TEXT NOT NULL, - "description" TEXT, - "isActive" BOOLEAN NOT NULL DEFAULT true, - - CONSTRAINT "Collection_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "CollectionProduct" ( - "collectionId" TEXT NOT NULL, - "productId" TEXT NOT NULL, - - CONSTRAINT "CollectionProduct_pkey" PRIMARY KEY ("collectionId","productId") -); - --- CreateTable -CREATE TABLE "Product" ( - "id" TEXT NOT NULL, - "title" TEXT NOT NULL, - "description" TEXT, - "categoryId" TEXT, - "brandId" TEXT, - "isActive" BOOLEAN NOT NULL DEFAULT true, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "Product_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "ProductImage" ( - "id" TEXT NOT NULL, - "productId" TEXT NOT NULL, - "url" TEXT NOT NULL, - "sortOrder" INTEGER NOT NULL DEFAULT 0, - - CONSTRAINT "ProductImage_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "ProductVariant" ( - "id" TEXT NOT NULL, - "productId" TEXT NOT NULL, - "title" TEXT NOT NULL, - "sku" TEXT, - "rashWeightGrams" DECIMAL(14,4) NOT NULL, - "defaultWagePercent" DECIMAL(6,3) NOT NULL, - "isActive" BOOLEAN NOT NULL DEFAULT true, - - CONSTRAINT "ProductVariant_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "Order" ( - "id" TEXT NOT NULL, - "orderNumber" TEXT NOT NULL, - "customerId" TEXT NOT NULL, - "branchId" TEXT, - "status" "OrderStatus" NOT NULL DEFAULT 'PLACED', - "totalGoldWeightGrams" DECIMAL(14,4) NOT NULL, - "wageWeightGrams" DECIMAL(14,4) NOT NULL, - "flatRialCharge" DECIMAL(20,2) NOT NULL DEFAULT 0, - "isSuspendedOverCreditLimit" BOOLEAN NOT NULL DEFAULT false, - "deliveredAt" TIMESTAMP(3), - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "Order_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "OrderItem" ( - "id" TEXT NOT NULL, - "orderId" TEXT NOT NULL, - "productVariantId" TEXT NOT NULL, - "quantity" INTEGER NOT NULL, - "rashWeightGramsSnapshot" DECIMAL(14,4) NOT NULL, - "wagePercentSnapshot" DECIMAL(6,3) NOT NULL, - "discountPercentSnapshot" DECIMAL(6,3) NOT NULL DEFAULT 0, - "computedWeightGrams" DECIMAL(14,4) NOT NULL, - "flatRialCharge" DECIMAL(20,2) NOT NULL DEFAULT 0, - - CONSTRAINT "OrderItem_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "OrderStatusEvent" ( - "id" TEXT NOT NULL, - "orderId" TEXT NOT NULL, - "fromStatus" "OrderStatus", - "toStatus" "OrderStatus" NOT NULL, - "note" TEXT, - "actorAdminUserId" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "OrderStatusEvent_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "PreOrder" ( - "id" TEXT NOT NULL, - "customerId" TEXT NOT NULL, - "cityId" TEXT, - "workshopId" TEXT, - "status" "PreOrderStatus" NOT NULL DEFAULT 'PLACED', - "designImageUrl" TEXT, - "colorName" TEXT, - "sizeSpec" TEXT, - "stoneColor" TEXT, - "minaColor" TEXT, - "estimatedWeightGrams" DECIMAL(14,4), - "estimatedPriceRial" DECIMAL(20,2), - "description" TEXT, - "convertedOrderId" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "updatedAt" TIMESTAMP(3) NOT NULL, - - CONSTRAINT "PreOrder_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "PreOrderStatusEvent" ( - "id" TEXT NOT NULL, - "preOrderId" TEXT NOT NULL, - "changes" JSONB NOT NULL, - "actorAdminUserId" TEXT, - "ipAddress" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "PreOrderStatusEvent_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "LedgerEntry" ( - "id" TEXT NOT NULL, - "customerId" TEXT NOT NULL, - "currency" "LedgerCurrency" NOT NULL, - "direction" "LedgerDirection" NOT NULL, - "sourceType" "LedgerSourceType" NOT NULL, - "amount" DECIMAL(20,4) NOT NULL, - "karatPerMille" INTEGER, - "pricePerGramRialAtEntry" DECIMAL(20,2), - "orderId" TEXT, - "confirmed" BOOLEAN NOT NULL DEFAULT false, - "confirmedAt" TIMESTAMP(3), - "postedByAdminUserId" TEXT, - "note" TEXT, - "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "LedgerEntry_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "GoldPriceQuote" ( - "id" TEXT NOT NULL, - "karatPerMille" INTEGER NOT NULL, - "pricePerGramRial" DECIMAL(20,2) NOT NULL, - "source" TEXT NOT NULL, - "quotedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - - CONSTRAINT "GoldPriceQuote_pkey" PRIMARY KEY ("id") -); - --- CreateTable -CREATE TABLE "WalletBonus" ( - "id" TEXT NOT NULL, - "customerId" TEXT NOT NULL, - "orderId" TEXT, - "goldGrams" DECIMAL(14,4) NOT NULL, - "grantedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, - "expiresAt" TIMESTAMP(3) NOT NULL, - "consumedAt" TIMESTAMP(3), - "isActive" BOOLEAN NOT NULL DEFAULT true, - - CONSTRAINT "WalletBonus_pkey" PRIMARY KEY ("id") -); - --- CreateIndex -CREATE UNIQUE INDEX "AdminUser_mobile_key" ON "AdminUser"("mobile"); - --- CreateIndex -CREATE INDEX "AdminUser_role_idx" ON "AdminUser"("role"); - --- CreateIndex -CREATE UNIQUE INDEX "Customer_mobile_key" ON "Customer"("mobile"); - --- CreateIndex -CREATE UNIQUE INDEX "Customer_nationalCode_key" ON "Customer"("nationalCode"); - --- CreateIndex -CREATE INDEX "Customer_referredByAgentId_idx" ON "Customer"("referredByAgentId"); - --- CreateIndex -CREATE UNIQUE INDEX "ProductVariant_sku_key" ON "ProductVariant"("sku"); - --- CreateIndex -CREATE UNIQUE INDEX "Order_orderNumber_key" ON "Order"("orderNumber"); - --- CreateIndex -CREATE INDEX "Order_customerId_idx" ON "Order"("customerId"); - --- CreateIndex -CREATE INDEX "Order_status_idx" ON "Order"("status"); - --- CreateIndex -CREATE INDEX "OrderStatusEvent_orderId_idx" ON "OrderStatusEvent"("orderId"); - --- CreateIndex -CREATE UNIQUE INDEX "PreOrder_convertedOrderId_key" ON "PreOrder"("convertedOrderId"); - --- CreateIndex -CREATE INDEX "PreOrder_customerId_idx" ON "PreOrder"("customerId"); - --- CreateIndex -CREATE INDEX "PreOrderStatusEvent_preOrderId_idx" ON "PreOrderStatusEvent"("preOrderId"); - --- CreateIndex -CREATE INDEX "LedgerEntry_customerId_currency_idx" ON "LedgerEntry"("customerId", "currency"); - --- CreateIndex -CREATE INDEX "LedgerEntry_orderId_idx" ON "LedgerEntry"("orderId"); - --- CreateIndex -CREATE INDEX "GoldPriceQuote_karatPerMille_quotedAt_idx" ON "GoldPriceQuote"("karatPerMille", "quotedAt"); - --- CreateIndex -CREATE INDEX "WalletBonus_customerId_isActive_idx" ON "WalletBonus"("customerId", "isActive"); - --- AddForeignKey -ALTER TABLE "AdminUser" ADD CONSTRAINT "AdminUser_branchId_fkey" FOREIGN KEY ("branchId") REFERENCES "Branch"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Customer" ADD CONSTRAINT "Customer_cityId_fkey" FOREIGN KEY ("cityId") REFERENCES "City"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Customer" ADD CONSTRAINT "Customer_referredByAgentId_fkey" FOREIGN KEY ("referredByAgentId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "CustomerAddress" ADD CONSTRAINT "CustomerAddress_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "CustomerAddress" ADD CONSTRAINT "CustomerAddress_cityId_fkey" FOREIGN KEY ("cityId") REFERENCES "City"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Branch" ADD CONSTRAINT "Branch_cityId_fkey" FOREIGN KEY ("cityId") REFERENCES "City"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Category" ADD CONSTRAINT "Category_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "Category"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "CollectionProduct" ADD CONSTRAINT "CollectionProduct_collectionId_fkey" FOREIGN KEY ("collectionId") REFERENCES "Collection"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "CollectionProduct" ADD CONSTRAINT "CollectionProduct_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Product" ADD CONSTRAINT "Product_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "Category"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Product" ADD CONSTRAINT "Product_brandId_fkey" FOREIGN KEY ("brandId") REFERENCES "Brand"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "ProductImage" ADD CONSTRAINT "ProductImage_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "ProductVariant" ADD CONSTRAINT "ProductVariant_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Order" ADD CONSTRAINT "Order_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "Order" ADD CONSTRAINT "Order_branchId_fkey" FOREIGN KEY ("branchId") REFERENCES "Branch"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "OrderItem" ADD CONSTRAINT "OrderItem_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "OrderItem" ADD CONSTRAINT "OrderItem_productVariantId_fkey" FOREIGN KEY ("productVariantId") REFERENCES "ProductVariant"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "OrderStatusEvent" ADD CONSTRAINT "OrderStatusEvent_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "OrderStatusEvent" ADD CONSTRAINT "OrderStatusEvent_actorAdminUserId_fkey" FOREIGN KEY ("actorAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrder" ADD CONSTRAINT "PreOrder_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrder" ADD CONSTRAINT "PreOrder_cityId_fkey" FOREIGN KEY ("cityId") REFERENCES "City"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrder" ADD CONSTRAINT "PreOrder_workshopId_fkey" FOREIGN KEY ("workshopId") REFERENCES "Workshop"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrder" ADD CONSTRAINT "PreOrder_convertedOrderId_fkey" FOREIGN KEY ("convertedOrderId") REFERENCES "Order"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrderStatusEvent" ADD CONSTRAINT "PreOrderStatusEvent_preOrderId_fkey" FOREIGN KEY ("preOrderId") REFERENCES "PreOrder"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "PreOrderStatusEvent" ADD CONSTRAINT "PreOrderStatusEvent_actorAdminUserId_fkey" FOREIGN KEY ("actorAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "LedgerEntry" ADD CONSTRAINT "LedgerEntry_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "LedgerEntry" ADD CONSTRAINT "LedgerEntry_orderId_fkey" FOREIGN KEY ("orderId") REFERENCES "Order"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "LedgerEntry" ADD CONSTRAINT "LedgerEntry_postedByAdminUserId_fkey" FOREIGN KEY ("postedByAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; - --- AddForeignKey -ALTER TABLE "WalletBonus" ADD CONSTRAINT "WalletBonus_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; - diff --git a/apps/api/release/migrations/20260914165255_sync_schema_drift/migration.sql b/apps/api/release/migrations/20260914165255_sync_schema_drift/migration.sql new file mode 100644 index 0000000..d26a54c --- /dev/null +++ b/apps/api/release/migrations/20260914165255_sync_schema_drift/migration.sql @@ -0,0 +1,362 @@ +-- CreateEnum +CREATE TYPE "CustomerKind" AS ENUM ('SALES_AGENT', 'APP_SHOPKEEPER', 'WALK_IN_SHOPKEEPER', 'BANKER', 'WORKSHOP_SUPERVISOR'); + +-- CreateEnum +CREATE TYPE "OrderChannel" AS ENUM ('RETAIL', 'WHOLESALE'); + +-- CreateEnum +CREATE TYPE "CommentStatus" AS ENUM ('PENDING', 'APPROVED', 'REJECTED'); + +-- CreateEnum +CREATE TYPE "PromotionScope" AS ENUM ('PRODUCT', 'CATEGORY', 'CUSTOMER', 'BRAND'); + +-- CreateEnum +CREATE TYPE "PromotionUsage" AS ENUM ('ONCE', 'UNTIL_END_DATE'); + +-- CreateEnum +CREATE TYPE "MessageAudience" AS ENUM ('SINGLE_NUMBER', 'MULTIPLE_NUMBERS', 'ALL_CUSTOMERS', 'WHOLESALE_CUSTOMERS', 'RETAIL_CUSTOMERS', 'SALES_AGENTS'); + +-- AlterTable +ALTER TABLE "AdminUser" ADD COLUMN "userTypeId" INTEGER; + +-- AlterTable +ALTER TABLE "Branch" ADD COLUMN "address" TEXT, +ADD COLUMN "isActive" BOOLEAN NOT NULL DEFAULT true, +ADD COLUMN "phone" TEXT; + +-- AlterTable +ALTER TABLE "Category" ADD COLUMN "description" TEXT, +ADD COLUMN "iconUrl" TEXT, +ADD COLUMN "imageUrl" TEXT, +ADD COLUMN "metaTag" TEXT, +ADD COLUMN "type" INTEGER NOT NULL DEFAULT 1; + +-- AlterTable +ALTER TABLE "City" ADD COLUMN "percent" DECIMAL(6,3), +ADD COLUMN "percentAux" DECIMAL(6,3); + +-- AlterTable +ALTER TABLE "Customer" ADD COLUMN "address" TEXT, +ADD COLUMN "avatarFileId" TEXT, +ADD COLUMN "canPlaceOrders" BOOLEAN NOT NULL DEFAULT true, +ADD COLUMN "isArchived" BOOLEAN NOT NULL DEFAULT false, +ADD COLUMN "kind" "CustomerKind" NOT NULL DEFAULT 'APP_SHOPKEEPER', +ADD COLUMN "memberCode" TEXT, +ADD COLUMN "pasazhName" TEXT, +ADD COLUMN "phone" TEXT, +ADD COLUMN "storeName" TEXT, +ADD COLUMN "zone" TEXT; + +-- AlterTable +ALTER TABLE "LedgerEntry" ADD COLUMN "accountName" TEXT, +ADD COLUMN "bankName" TEXT, +ADD COLUMN "hallmark" TEXT, +ADD COLUMN "labName" TEXT, +ADD COLUMN "originalValue" DECIMAL(14,4), +ADD COLUMN "priceRial" DECIMAL(20,2), +ADD COLUMN "receivedAt" TIMESTAMP(3), +ADD COLUMN "transferTo" TEXT; + +-- AlterTable +ALTER TABLE "Order" ADD COLUMN "channel" "OrderChannel" NOT NULL DEFAULT 'RETAIL'; + +-- AlterTable +ALTER TABLE "Product" ADD COLUMN "productCode" TEXT, +ADD COLUMN "showType" INTEGER NOT NULL DEFAULT 3; + +-- AlterTable +ALTER TABLE "ProductVariant" ADD COLUMN "isPreOrder" BOOLEAN NOT NULL DEFAULT false, +ADD COLUMN "qty" INTEGER NOT NULL DEFAULT 0; + +-- AlterTable +ALTER TABLE "Workshop" ADD COLUMN "address" TEXT, +ADD COLUMN "phone" TEXT, +ADD COLUMN "supervisorId" TEXT; + +-- DropTable +DROP TABLE "_goldbank_migrations"; + +-- CreateTable +CREATE TABLE "user_type" ( + "id" INTEGER NOT NULL, + "title" TEXT NOT NULL, + "isActive" BOOLEAN NOT NULL DEFAULT true, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "user_type_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "permission" ( + "rid" TEXT NOT NULL, + "userTypeId" INTEGER NOT NULL, + + CONSTRAINT "permission_pkey" PRIMARY KEY ("rid","userTypeId") +); + +-- CreateTable +CREATE TABLE "Comment" ( + "id" TEXT NOT NULL, + "productId" TEXT NOT NULL, + "customerId" TEXT NOT NULL, + "body" TEXT NOT NULL, + "status" "CommentStatus" NOT NULL DEFAULT 'PENDING', + "replyToId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Comment_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Setting" ( + "key" TEXT NOT NULL, + "value" JSONB NOT NULL, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Setting_pkey" PRIMARY KEY ("key") +); + +-- CreateTable +CREATE TABLE "Promotion" ( + "id" TEXT NOT NULL, + "title" TEXT NOT NULL, + "description" TEXT, + "scope" "PromotionScope" NOT NULL DEFAULT 'PRODUCT', + "usage" "PromotionUsage" NOT NULL DEFAULT 'ONCE', + "discountPercent" DECIMAL(6,3) NOT NULL, + "isActive" BOOLEAN NOT NULL DEFAULT true, + "platform" INTEGER NOT NULL DEFAULT 3, + "startsAt" TIMESTAMP(3), + "endsAt" TIMESTAMP(3), + "productId" TEXT, + "categoryId" TEXT, + "customerId" TEXT, + "brandId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL, + + CONSTRAINT "Promotion_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "PromotionExclusion" ( + "id" TEXT NOT NULL, + "type" INTEGER NOT NULL, + "itemId" TEXT NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "PromotionExclusion_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "BranchAllocation" ( + "id" TEXT NOT NULL, + "branchId" TEXT NOT NULL, + "allocatorAdminUserId" TEXT, + "note" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "BranchAllocation_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "BranchAllocationItem" ( + "id" TEXT NOT NULL, + "allocationId" TEXT NOT NULL, + "productId" TEXT NOT NULL, + "weightGrams" DECIMAL(14,4), + + CONSTRAINT "BranchAllocationItem_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "SmsMessage" ( + "id" TEXT NOT NULL, + "audience" "MessageAudience" NOT NULL, + "recipients" TEXT, + "body" TEXT NOT NULL, + "sentCount" INTEGER NOT NULL DEFAULT 0, + "sentByAdminUserId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "SmsMessage_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "Notification" ( + "id" TEXT NOT NULL, + "title" TEXT NOT NULL, + "body" TEXT NOT NULL, + "audience" "MessageAudience" NOT NULL DEFAULT 'ALL_CUSTOMERS', + "sentByAdminUserId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "Notification_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "NotificationRecipient" ( + "id" TEXT NOT NULL, + "notificationId" TEXT NOT NULL, + "customerId" TEXT NOT NULL, + "readAt" TIMESTAMP(3), + + CONSTRAINT "NotificationRecipient_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "NewsletterSubscriber" ( + "id" TEXT NOT NULL, + "email" TEXT, + "mobile" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "NewsletterSubscriber_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "CustomerActivityLog" ( + "id" TEXT NOT NULL, + "customerId" TEXT NOT NULL, + "action" TEXT NOT NULL, + "detail" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "CustomerActivityLog_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "UploadedFile" ( + "id" TEXT NOT NULL, + "url" TEXT NOT NULL, + "originalName" TEXT NOT NULL, + "mimeType" TEXT NOT NULL, + "sizeBytes" INTEGER NOT NULL, + "purpose" TEXT, + "uploadedByAdminUserId" TEXT, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + + CONSTRAINT "UploadedFile_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE INDEX "permission_userTypeId_idx" ON "permission"("userTypeId"); + +-- CreateIndex +CREATE INDEX "Comment_productId_idx" ON "Comment"("productId"); + +-- CreateIndex +CREATE INDEX "Comment_customerId_idx" ON "Comment"("customerId"); + +-- CreateIndex +CREATE INDEX "Comment_status_idx" ON "Comment"("status"); + +-- CreateIndex +CREATE INDEX "Promotion_scope_isActive_idx" ON "Promotion"("scope", "isActive"); + +-- CreateIndex +CREATE INDEX "PromotionExclusion_type_idx" ON "PromotionExclusion"("type"); + +-- CreateIndex +CREATE UNIQUE INDEX "PromotionExclusion_type_itemId_key" ON "PromotionExclusion"("type", "itemId"); + +-- CreateIndex +CREATE INDEX "BranchAllocation_branchId_idx" ON "BranchAllocation"("branchId"); + +-- CreateIndex +CREATE UNIQUE INDEX "BranchAllocationItem_allocationId_productId_key" ON "BranchAllocationItem"("allocationId", "productId"); + +-- CreateIndex +CREATE INDEX "SmsMessage_createdAt_idx" ON "SmsMessage"("createdAt"); + +-- CreateIndex +CREATE INDEX "Notification_createdAt_idx" ON "Notification"("createdAt"); + +-- CreateIndex +CREATE INDEX "NotificationRecipient_customerId_readAt_idx" ON "NotificationRecipient"("customerId", "readAt"); + +-- CreateIndex +CREATE UNIQUE INDEX "NotificationRecipient_notificationId_customerId_key" ON "NotificationRecipient"("notificationId", "customerId"); + +-- CreateIndex +CREATE UNIQUE INDEX "NewsletterSubscriber_email_key" ON "NewsletterSubscriber"("email"); + +-- CreateIndex +CREATE UNIQUE INDEX "NewsletterSubscriber_mobile_key" ON "NewsletterSubscriber"("mobile"); + +-- CreateIndex +CREATE INDEX "CustomerActivityLog_customerId_createdAt_idx" ON "CustomerActivityLog"("customerId", "createdAt"); + +-- CreateIndex +CREATE INDEX "UploadedFile_purpose_idx" ON "UploadedFile"("purpose"); + +-- CreateIndex +CREATE INDEX "AdminUser_userTypeId_idx" ON "AdminUser"("userTypeId"); + +-- CreateIndex +CREATE UNIQUE INDEX "Product_productCode_key" ON "Product"("productCode"); + +-- AddForeignKey +ALTER TABLE "AdminUser" ADD CONSTRAINT "AdminUser_userTypeId_fkey" FOREIGN KEY ("userTypeId") REFERENCES "user_type"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Customer" ADD CONSTRAINT "Customer_avatarFileId_fkey" FOREIGN KEY ("avatarFileId") REFERENCES "UploadedFile"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Workshop" ADD CONSTRAINT "Workshop_supervisorId_fkey" FOREIGN KEY ("supervisorId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "permission" ADD CONSTRAINT "permission_userTypeId_fkey" FOREIGN KEY ("userTypeId") REFERENCES "user_type"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Comment" ADD CONSTRAINT "Comment_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Comment" ADD CONSTRAINT "Comment_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Comment" ADD CONSTRAINT "Comment_replyToId_fkey" FOREIGN KEY ("replyToId") REFERENCES "Comment"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Promotion" ADD CONSTRAINT "Promotion_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Promotion" ADD CONSTRAINT "Promotion_categoryId_fkey" FOREIGN KEY ("categoryId") REFERENCES "Category"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Promotion" ADD CONSTRAINT "Promotion_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Promotion" ADD CONSTRAINT "Promotion_brandId_fkey" FOREIGN KEY ("brandId") REFERENCES "Brand"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BranchAllocation" ADD CONSTRAINT "BranchAllocation_branchId_fkey" FOREIGN KEY ("branchId") REFERENCES "Branch"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BranchAllocation" ADD CONSTRAINT "BranchAllocation_allocatorAdminUserId_fkey" FOREIGN KEY ("allocatorAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BranchAllocationItem" ADD CONSTRAINT "BranchAllocationItem_allocationId_fkey" FOREIGN KEY ("allocationId") REFERENCES "BranchAllocation"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "BranchAllocationItem" ADD CONSTRAINT "BranchAllocationItem_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "SmsMessage" ADD CONSTRAINT "SmsMessage_sentByAdminUserId_fkey" FOREIGN KEY ("sentByAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "Notification" ADD CONSTRAINT "Notification_sentByAdminUserId_fkey" FOREIGN KEY ("sentByAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "NotificationRecipient" ADD CONSTRAINT "NotificationRecipient_notificationId_fkey" FOREIGN KEY ("notificationId") REFERENCES "Notification"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "NotificationRecipient" ADD CONSTRAINT "NotificationRecipient_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "CustomerActivityLog" ADD CONSTRAINT "CustomerActivityLog_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "Customer"("id") ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "UploadedFile" ADD CONSTRAINT "UploadedFile_uploadedByAdminUserId_fkey" FOREIGN KEY ("uploadedByAdminUserId") REFERENCES "AdminUser"("id") ON DELETE SET NULL ON UPDATE CASCADE; + diff --git a/apps/api/release/seed.js b/apps/api/release/seed.js index 9bd9f26..8f0fc51 100644 --- a/apps/api/release/seed.js +++ b/apps/api/release/seed.js @@ -1,9 +1,1747 @@ "use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); // prisma/seed.ts var import_client = require("@prisma/client"); + +// ../../node_modules/.pnpm/bcryptjs@3.0.3/node_modules/bcryptjs/index.js +var import_crypto = __toESM(require("crypto"), 1); +var randomFallback = null; +function randomBytes(len) { + try { + return crypto.getRandomValues(new Uint8Array(len)); + } catch { + } + try { + return import_crypto.default.randomBytes(len); + } catch { + } + if (!randomFallback) { + throw Error( + "Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative" + ); + } + return randomFallback(len); +} +function genSaltSync(rounds, seed_length) { + rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS; + if (typeof rounds !== "number") + throw Error( + "Illegal arguments: " + typeof rounds + ", " + typeof seed_length + ); + if (rounds < 4) rounds = 4; + else if (rounds > 31) rounds = 31; + var salt = []; + salt.push("$2b$"); + if (rounds < 10) salt.push("0"); + salt.push(rounds.toString()); + salt.push("$"); + salt.push(base64_encode(randomBytes(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); + return salt.join(""); +} +function hashSync(password, salt) { + if (typeof salt === "undefined") salt = GENSALT_DEFAULT_LOG2_ROUNDS; + if (typeof salt === "number") salt = genSaltSync(salt); + if (typeof password !== "string" || typeof salt !== "string") + throw Error("Illegal arguments: " + typeof password + ", " + typeof salt); + return _hash(password, salt); +} +var nextTick = typeof setImmediate === "function" ? setImmediate : typeof scheduler === "object" && typeof scheduler.postTask === "function" ? scheduler.postTask.bind(scheduler) : setTimeout; +function utf8Length(string) { + var len = 0, c = 0; + for (var i = 0; i < string.length; ++i) { + c = string.charCodeAt(i); + if (c < 128) len += 1; + else if (c < 2048) len += 2; + else if ((c & 64512) === 55296 && (string.charCodeAt(i + 1) & 64512) === 56320) { + ++i; + len += 4; + } else len += 3; + } + return len; +} +function utf8Array(string) { + var offset = 0, c1, c2; + var buffer = new Array(utf8Length(string)); + for (var i = 0, k = string.length; i < k; ++i) { + c1 = string.charCodeAt(i); + if (c1 < 128) { + buffer[offset++] = c1; + } else if (c1 < 2048) { + buffer[offset++] = c1 >> 6 | 192; + buffer[offset++] = c1 & 63 | 128; + } else if ((c1 & 64512) === 55296 && ((c2 = string.charCodeAt(i + 1)) & 64512) === 56320) { + c1 = 65536 + ((c1 & 1023) << 10) + (c2 & 1023); + ++i; + buffer[offset++] = c1 >> 18 | 240; + buffer[offset++] = c1 >> 12 & 63 | 128; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } else { + buffer[offset++] = c1 >> 12 | 224; + buffer[offset++] = c1 >> 6 & 63 | 128; + buffer[offset++] = c1 & 63 | 128; + } + } + return buffer; +} +var BASE64_CODE = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""); +var BASE64_INDEX = [ + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 0, + 1, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + -1, + -1, + -1, + -1, + -1, + -1, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + -1, + -1, + -1, + -1, + -1 +]; +function base64_encode(b, len) { + var off = 0, rs = [], c1, c2; + if (len <= 0 || len > b.length) throw Error("Illegal len: " + len); + while (off < len) { + c1 = b[off++] & 255; + rs.push(BASE64_CODE[c1 >> 2 & 63]); + c1 = (c1 & 3) << 4; + if (off >= len) { + rs.push(BASE64_CODE[c1 & 63]); + break; + } + c2 = b[off++] & 255; + c1 |= c2 >> 4 & 15; + rs.push(BASE64_CODE[c1 & 63]); + c1 = (c2 & 15) << 2; + if (off >= len) { + rs.push(BASE64_CODE[c1 & 63]); + break; + } + c2 = b[off++] & 255; + c1 |= c2 >> 6 & 3; + rs.push(BASE64_CODE[c1 & 63]); + rs.push(BASE64_CODE[c2 & 63]); + } + return rs.join(""); +} +function base64_decode(s, len) { + var off = 0, slen = s.length, olen = 0, rs = [], c1, c2, c3, c4, o, code; + if (len <= 0) throw Error("Illegal len: " + len); + while (off < slen - 1 && olen < len) { + code = s.charCodeAt(off++); + c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + code = s.charCodeAt(off++); + c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + if (c1 == -1 || c2 == -1) break; + o = c1 << 2 >>> 0; + o |= (c2 & 48) >> 4; + rs.push(String.fromCharCode(o)); + if (++olen >= len || off >= slen) break; + code = s.charCodeAt(off++); + c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + if (c3 == -1) break; + o = (c2 & 15) << 4 >>> 0; + o |= (c3 & 60) >> 2; + rs.push(String.fromCharCode(o)); + if (++olen >= len || off >= slen) break; + code = s.charCodeAt(off++); + c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + o = (c3 & 3) << 6 >>> 0; + o |= c4; + rs.push(String.fromCharCode(o)); + ++olen; + } + var res = []; + for (off = 0; off < olen; off++) res.push(rs[off].charCodeAt(0)); + return res; +} +var BCRYPT_SALT_LEN = 16; +var GENSALT_DEFAULT_LOG2_ROUNDS = 10; +var BLOWFISH_NUM_ROUNDS = 16; +var MAX_EXECUTION_TIME = 100; +var P_ORIG = [ + 608135816, + 2242054355, + 320440878, + 57701188, + 2752067618, + 698298832, + 137296536, + 3964562569, + 1160258022, + 953160567, + 3193202383, + 887688300, + 3232508343, + 3380367581, + 1065670069, + 3041331479, + 2450970073, + 2306472731 +]; +var S_ORIG = [ + 3509652390, + 2564797868, + 805139163, + 3491422135, + 3101798381, + 1780907670, + 3128725573, + 4046225305, + 614570311, + 3012652279, + 134345442, + 2240740374, + 1667834072, + 1901547113, + 2757295779, + 4103290238, + 227898511, + 1921955416, + 1904987480, + 2182433518, + 2069144605, + 3260701109, + 2620446009, + 720527379, + 3318853667, + 677414384, + 3393288472, + 3101374703, + 2390351024, + 1614419982, + 1822297739, + 2954791486, + 3608508353, + 3174124327, + 2024746970, + 1432378464, + 3864339955, + 2857741204, + 1464375394, + 1676153920, + 1439316330, + 715854006, + 3033291828, + 289532110, + 2706671279, + 2087905683, + 3018724369, + 1668267050, + 732546397, + 1947742710, + 3462151702, + 2609353502, + 2950085171, + 1814351708, + 2050118529, + 680887927, + 999245976, + 1800124847, + 3300911131, + 1713906067, + 1641548236, + 4213287313, + 1216130144, + 1575780402, + 4018429277, + 3917837745, + 3693486850, + 3949271944, + 596196993, + 3549867205, + 258830323, + 2213823033, + 772490370, + 2760122372, + 1774776394, + 2652871518, + 566650946, + 4142492826, + 1728879713, + 2882767088, + 1783734482, + 3629395816, + 2517608232, + 2874225571, + 1861159788, + 326777828, + 3124490320, + 2130389656, + 2716951837, + 967770486, + 1724537150, + 2185432712, + 2364442137, + 1164943284, + 2105845187, + 998989502, + 3765401048, + 2244026483, + 1075463327, + 1455516326, + 1322494562, + 910128902, + 469688178, + 1117454909, + 936433444, + 3490320968, + 3675253459, + 1240580251, + 122909385, + 2157517691, + 634681816, + 4142456567, + 3825094682, + 3061402683, + 2540495037, + 79693498, + 3249098678, + 1084186820, + 1583128258, + 426386531, + 1761308591, + 1047286709, + 322548459, + 995290223, + 1845252383, + 2603652396, + 3431023940, + 2942221577, + 3202600964, + 3727903485, + 1712269319, + 422464435, + 3234572375, + 1170764815, + 3523960633, + 3117677531, + 1434042557, + 442511882, + 3600875718, + 1076654713, + 1738483198, + 4213154764, + 2393238008, + 3677496056, + 1014306527, + 4251020053, + 793779912, + 2902807211, + 842905082, + 4246964064, + 1395751752, + 1040244610, + 2656851899, + 3396308128, + 445077038, + 3742853595, + 3577915638, + 679411651, + 2892444358, + 2354009459, + 1767581616, + 3150600392, + 3791627101, + 3102740896, + 284835224, + 4246832056, + 1258075500, + 768725851, + 2589189241, + 3069724005, + 3532540348, + 1274779536, + 3789419226, + 2764799539, + 1660621633, + 3471099624, + 4011903706, + 913787905, + 3497959166, + 737222580, + 2514213453, + 2928710040, + 3937242737, + 1804850592, + 3499020752, + 2949064160, + 2386320175, + 2390070455, + 2415321851, + 4061277028, + 2290661394, + 2416832540, + 1336762016, + 1754252060, + 3520065937, + 3014181293, + 791618072, + 3188594551, + 3933548030, + 2332172193, + 3852520463, + 3043980520, + 413987798, + 3465142937, + 3030929376, + 4245938359, + 2093235073, + 3534596313, + 375366246, + 2157278981, + 2479649556, + 555357303, + 3870105701, + 2008414854, + 3344188149, + 4221384143, + 3956125452, + 2067696032, + 3594591187, + 2921233993, + 2428461, + 544322398, + 577241275, + 1471733935, + 610547355, + 4027169054, + 1432588573, + 1507829418, + 2025931657, + 3646575487, + 545086370, + 48609733, + 2200306550, + 1653985193, + 298326376, + 1316178497, + 3007786442, + 2064951626, + 458293330, + 2589141269, + 3591329599, + 3164325604, + 727753846, + 2179363840, + 146436021, + 1461446943, + 4069977195, + 705550613, + 3059967265, + 3887724982, + 4281599278, + 3313849956, + 1404054877, + 2845806497, + 146425753, + 1854211946, + 1266315497, + 3048417604, + 3681880366, + 3289982499, + 290971e4, + 1235738493, + 2632868024, + 2414719590, + 3970600049, + 1771706367, + 1449415276, + 3266420449, + 422970021, + 1963543593, + 2690192192, + 3826793022, + 1062508698, + 1531092325, + 1804592342, + 2583117782, + 2714934279, + 4024971509, + 1294809318, + 4028980673, + 1289560198, + 2221992742, + 1669523910, + 35572830, + 157838143, + 1052438473, + 1016535060, + 1802137761, + 1753167236, + 1386275462, + 3080475397, + 2857371447, + 1040679964, + 2145300060, + 2390574316, + 1461121720, + 2956646967, + 4031777805, + 4028374788, + 33600511, + 2920084762, + 1018524850, + 629373528, + 3691585981, + 3515945977, + 2091462646, + 2486323059, + 586499841, + 988145025, + 935516892, + 3367335476, + 2599673255, + 2839830854, + 265290510, + 3972581182, + 2759138881, + 3795373465, + 1005194799, + 847297441, + 406762289, + 1314163512, + 1332590856, + 1866599683, + 4127851711, + 750260880, + 613907577, + 1450815602, + 3165620655, + 3734664991, + 3650291728, + 3012275730, + 3704569646, + 1427272223, + 778793252, + 1343938022, + 2676280711, + 2052605720, + 1946737175, + 3164576444, + 3914038668, + 3967478842, + 3682934266, + 1661551462, + 3294938066, + 4011595847, + 840292616, + 3712170807, + 616741398, + 312560963, + 711312465, + 1351876610, + 322626781, + 1910503582, + 271666773, + 2175563734, + 1594956187, + 70604529, + 3617834859, + 1007753275, + 1495573769, + 4069517037, + 2549218298, + 2663038764, + 504708206, + 2263041392, + 3941167025, + 2249088522, + 1514023603, + 1998579484, + 1312622330, + 694541497, + 2582060303, + 2151582166, + 1382467621, + 776784248, + 2618340202, + 3323268794, + 2497899128, + 2784771155, + 503983604, + 4076293799, + 907881277, + 423175695, + 432175456, + 1378068232, + 4145222326, + 3954048622, + 3938656102, + 3820766613, + 2793130115, + 2977904593, + 26017576, + 3274890735, + 3194772133, + 1700274565, + 1756076034, + 4006520079, + 3677328699, + 720338349, + 1533947780, + 354530856, + 688349552, + 3973924725, + 1637815568, + 332179504, + 3949051286, + 53804574, + 2852348879, + 3044236432, + 1282449977, + 3583942155, + 3416972820, + 4006381244, + 1617046695, + 2628476075, + 3002303598, + 1686838959, + 431878346, + 2686675385, + 1700445008, + 1080580658, + 1009431731, + 832498133, + 3223435511, + 2605976345, + 2271191193, + 2516031870, + 1648197032, + 4164389018, + 2548247927, + 300782431, + 375919233, + 238389289, + 3353747414, + 2531188641, + 2019080857, + 1475708069, + 455242339, + 2609103871, + 448939670, + 3451063019, + 1395535956, + 2413381860, + 1841049896, + 1491858159, + 885456874, + 4264095073, + 4001119347, + 1565136089, + 3898914787, + 1108368660, + 540939232, + 1173283510, + 2745871338, + 3681308437, + 4207628240, + 3343053890, + 4016749493, + 1699691293, + 1103962373, + 3625875870, + 2256883143, + 3830138730, + 1031889488, + 3479347698, + 1535977030, + 4236805024, + 3251091107, + 2132092099, + 1774941330, + 1199868427, + 1452454533, + 157007616, + 2904115357, + 342012276, + 595725824, + 1480756522, + 206960106, + 497939518, + 591360097, + 863170706, + 2375253569, + 3596610801, + 1814182875, + 2094937945, + 3421402208, + 1082520231, + 3463918190, + 2785509508, + 435703966, + 3908032597, + 1641649973, + 2842273706, + 3305899714, + 1510255612, + 2148256476, + 2655287854, + 3276092548, + 4258621189, + 236887753, + 3681803219, + 274041037, + 1734335097, + 3815195456, + 3317970021, + 1899903192, + 1026095262, + 4050517792, + 356393447, + 2410691914, + 3873677099, + 3682840055, + 3913112168, + 2491498743, + 4132185628, + 2489919796, + 1091903735, + 1979897079, + 3170134830, + 3567386728, + 3557303409, + 857797738, + 1136121015, + 1342202287, + 507115054, + 2535736646, + 337727348, + 3213592640, + 1301675037, + 2528481711, + 1895095763, + 1721773893, + 3216771564, + 62756741, + 2142006736, + 835421444, + 2531993523, + 1442658625, + 3659876326, + 2882144922, + 676362277, + 1392781812, + 170690266, + 3921047035, + 1759253602, + 3611846912, + 1745797284, + 664899054, + 1329594018, + 3901205900, + 3045908486, + 2062866102, + 2865634940, + 3543621612, + 3464012697, + 1080764994, + 553557557, + 3656615353, + 3996768171, + 991055499, + 499776247, + 1265440854, + 648242737, + 3940784050, + 980351604, + 3713745714, + 1749149687, + 3396870395, + 4211799374, + 3640570775, + 1161844396, + 3125318951, + 1431517754, + 545492359, + 4268468663, + 3499529547, + 1437099964, + 2702547544, + 3433638243, + 2581715763, + 2787789398, + 1060185593, + 1593081372, + 2418618748, + 4260947970, + 69676912, + 2159744348, + 86519011, + 2512459080, + 3838209314, + 1220612927, + 3339683548, + 133810670, + 1090789135, + 1078426020, + 1569222167, + 845107691, + 3583754449, + 4072456591, + 1091646820, + 628848692, + 1613405280, + 3757631651, + 526609435, + 236106946, + 48312990, + 2942717905, + 3402727701, + 1797494240, + 859738849, + 992217954, + 4005476642, + 2243076622, + 3870952857, + 3732016268, + 765654824, + 3490871365, + 2511836413, + 1685915746, + 3888969200, + 1414112111, + 2273134842, + 3281911079, + 4080962846, + 172450625, + 2569994100, + 980381355, + 4109958455, + 2819808352, + 2716589560, + 2568741196, + 3681446669, + 3329971472, + 1835478071, + 660984891, + 3704678404, + 4045999559, + 3422617507, + 3040415634, + 1762651403, + 1719377915, + 3470491036, + 2693910283, + 3642056355, + 3138596744, + 1364962596, + 2073328063, + 1983633131, + 926494387, + 3423689081, + 2150032023, + 4096667949, + 1749200295, + 3328846651, + 309677260, + 2016342300, + 1779581495, + 3079819751, + 111262694, + 1274766160, + 443224088, + 298511866, + 1025883608, + 3806446537, + 1145181785, + 168956806, + 3641502830, + 3584813610, + 1689216846, + 3666258015, + 3200248200, + 1692713982, + 2646376535, + 4042768518, + 1618508792, + 1610833997, + 3523052358, + 4130873264, + 2001055236, + 3610705100, + 2202168115, + 4028541809, + 2961195399, + 1006657119, + 2006996926, + 3186142756, + 1430667929, + 3210227297, + 1314452623, + 4074634658, + 4101304120, + 2273951170, + 1399257539, + 3367210612, + 3027628629, + 1190975929, + 2062231137, + 2333990788, + 2221543033, + 2438960610, + 1181637006, + 548689776, + 2362791313, + 3372408396, + 3104550113, + 3145860560, + 296247880, + 1970579870, + 3078560182, + 3769228297, + 1714227617, + 3291629107, + 3898220290, + 166772364, + 1251581989, + 493813264, + 448347421, + 195405023, + 2709975567, + 677966185, + 3703036547, + 1463355134, + 2715995803, + 1338867538, + 1343315457, + 2802222074, + 2684532164, + 233230375, + 2599980071, + 2000651841, + 3277868038, + 1638401717, + 4028070440, + 3237316320, + 6314154, + 819756386, + 300326615, + 590932579, + 1405279636, + 3267499572, + 3150704214, + 2428286686, + 3959192993, + 3461946742, + 1862657033, + 1266418056, + 963775037, + 2089974820, + 2263052895, + 1917689273, + 448879540, + 3550394620, + 3981727096, + 150775221, + 3627908307, + 1303187396, + 508620638, + 2975983352, + 2726630617, + 1817252668, + 1876281319, + 1457606340, + 908771278, + 3720792119, + 3617206836, + 2455994898, + 1729034894, + 1080033504, + 976866871, + 3556439503, + 2881648439, + 1522871579, + 1555064734, + 1336096578, + 3548522304, + 2579274686, + 3574697629, + 3205460757, + 3593280638, + 3338716283, + 3079412587, + 564236357, + 2993598910, + 1781952180, + 1464380207, + 3163844217, + 3332601554, + 1699332808, + 1393555694, + 1183702653, + 3581086237, + 1288719814, + 691649499, + 2847557200, + 2895455976, + 3193889540, + 2717570544, + 1781354906, + 1676643554, + 2592534050, + 3230253752, + 1126444790, + 2770207658, + 2633158820, + 2210423226, + 2615765581, + 2414155088, + 3127139286, + 673620729, + 2805611233, + 1269405062, + 4015350505, + 3341807571, + 4149409754, + 1057255273, + 2012875353, + 2162469141, + 2276492801, + 2601117357, + 993977747, + 3918593370, + 2654263191, + 753973209, + 36408145, + 2530585658, + 25011837, + 3520020182, + 2088578344, + 530523599, + 2918365339, + 1524020338, + 1518925132, + 3760827505, + 3759777254, + 1202760957, + 3985898139, + 3906192525, + 674977740, + 4174734889, + 2031300136, + 2019492241, + 3983892565, + 4153806404, + 3822280332, + 352677332, + 2297720250, + 60907813, + 90501309, + 3286998549, + 1016092578, + 2535922412, + 2839152426, + 457141659, + 509813237, + 4120667899, + 652014361, + 1966332200, + 2975202805, + 55981186, + 2327461051, + 676427537, + 3255491064, + 2882294119, + 3433927263, + 1307055953, + 942726286, + 933058658, + 2468411793, + 3933900994, + 4215176142, + 1361170020, + 2001714738, + 2830558078, + 3274259782, + 1222529897, + 1679025792, + 2729314320, + 3714953764, + 1770335741, + 151462246, + 3013232138, + 1682292957, + 1483529935, + 471910574, + 1539241949, + 458788160, + 3436315007, + 1807016891, + 3718408830, + 978976581, + 1043663428, + 3165965781, + 1927990952, + 4200891579, + 2372276910, + 3208408903, + 3533431907, + 1412390302, + 2931980059, + 4132332400, + 1947078029, + 3881505623, + 4168226417, + 2941484381, + 1077988104, + 1320477388, + 886195818, + 18198404, + 3786409e3, + 2509781533, + 112762804, + 3463356488, + 1866414978, + 891333506, + 18488651, + 661792760, + 1628790961, + 3885187036, + 3141171499, + 876946877, + 2693282273, + 1372485963, + 791857591, + 2686433993, + 3759982718, + 3167212022, + 3472953795, + 2716379847, + 445679433, + 3561995674, + 3504004811, + 3574258232, + 54117162, + 3331405415, + 2381918588, + 3769707343, + 4154350007, + 1140177722, + 4074052095, + 668550556, + 3214352940, + 367459370, + 261225585, + 2610173221, + 4209349473, + 3468074219, + 3265815641, + 314222801, + 3066103646, + 3808782860, + 282218597, + 3406013506, + 3773591054, + 379116347, + 1285071038, + 846784868, + 2669647154, + 3771962079, + 3550491691, + 2305946142, + 453669953, + 1268987020, + 3317592352, + 3279303384, + 3744833421, + 2610507566, + 3859509063, + 266596637, + 3847019092, + 517658769, + 3462560207, + 3443424879, + 370717030, + 4247526661, + 2224018117, + 4143653529, + 4112773975, + 2788324899, + 2477274417, + 1456262402, + 2901442914, + 1517677493, + 1846949527, + 2295493580, + 3734397586, + 2176403920, + 1280348187, + 1908823572, + 3871786941, + 846861322, + 1172426758, + 3287448474, + 3383383037, + 1655181056, + 3139813346, + 901632758, + 1897031941, + 2986607138, + 3066810236, + 3447102507, + 1393639104, + 373351379, + 950779232, + 625454576, + 3124240540, + 4148612726, + 2007998917, + 544563296, + 2244738638, + 2330496472, + 2058025392, + 1291430526, + 424198748, + 50039436, + 29584100, + 3605783033, + 2429876329, + 2791104160, + 1057563949, + 3255363231, + 3075367218, + 3463963227, + 1469046755, + 985887462 +]; +var C_ORIG = [ + 1332899944, + 1700884034, + 1701343084, + 1684370003, + 1668446532, + 1869963892 +]; +function _encipher(lr, off, P, S) { + var n, l = lr[off], r = lr[off + 1]; + l ^= P[0]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[1]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[2]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[3]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[4]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[5]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[6]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[7]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[8]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[9]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[10]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[11]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[12]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[13]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[14]; + n = S[l >>> 24]; + n += S[256 | l >> 16 & 255]; + n ^= S[512 | l >> 8 & 255]; + n += S[768 | l & 255]; + r ^= n ^ P[15]; + n = S[r >>> 24]; + n += S[256 | r >> 16 & 255]; + n ^= S[512 | r >> 8 & 255]; + n += S[768 | r & 255]; + l ^= n ^ P[16]; + lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; + lr[off + 1] = l; + return lr; +} +function _streamtoword(data, offp) { + for (var i = 0, word = 0; i < 4; ++i) + word = word << 8 | data[offp] & 255, offp = (offp + 1) % data.length; + return { key: word, offp }; +} +function _key(key, P, S) { + var offset = 0, lr = [0, 0], plen = P.length, slen = S.length, sw; + for (var i = 0; i < plen; i++) + sw = _streamtoword(key, offset), offset = sw.offp, P[i] = P[i] ^ sw.key; + for (i = 0; i < plen; i += 2) + lr = _encipher(lr, 0, P, S), P[i] = lr[0], P[i + 1] = lr[1]; + for (i = 0; i < slen; i += 2) + lr = _encipher(lr, 0, P, S), S[i] = lr[0], S[i + 1] = lr[1]; +} +function _ekskey(data, key, P, S) { + var offp = 0, lr = [0, 0], plen = P.length, slen = S.length, sw; + for (var i = 0; i < plen; i++) + sw = _streamtoword(key, offp), offp = sw.offp, P[i] = P[i] ^ sw.key; + offp = 0; + for (i = 0; i < plen; i += 2) + sw = _streamtoword(data, offp), offp = sw.offp, lr[0] ^= sw.key, sw = _streamtoword(data, offp), offp = sw.offp, lr[1] ^= sw.key, lr = _encipher(lr, 0, P, S), P[i] = lr[0], P[i + 1] = lr[1]; + for (i = 0; i < slen; i += 2) + sw = _streamtoword(data, offp), offp = sw.offp, lr[0] ^= sw.key, sw = _streamtoword(data, offp), offp = sw.offp, lr[1] ^= sw.key, lr = _encipher(lr, 0, P, S), S[i] = lr[0], S[i + 1] = lr[1]; +} +function _crypt(b, salt, rounds, callback, progressCallback) { + var cdata = C_ORIG.slice(), clen = cdata.length, err; + if (rounds < 4 || rounds > 31) { + err = Error("Illegal number of rounds (4-31): " + rounds); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + if (salt.length !== BCRYPT_SALT_LEN) { + err = Error( + "Illegal salt length: " + salt.length + " != " + BCRYPT_SALT_LEN + ); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + rounds = 1 << rounds >>> 0; + var P, S, i = 0, j; + if (typeof Int32Array === "function") { + P = new Int32Array(P_ORIG); + S = new Int32Array(S_ORIG); + } else { + P = P_ORIG.slice(); + S = S_ORIG.slice(); + } + _ekskey(salt, b, P, S); + function next() { + if (progressCallback) progressCallback(i / rounds); + if (i < rounds) { + var start = Date.now(); + for (; i < rounds; ) { + i = i + 1; + _key(b, P, S); + _key(salt, P, S); + if (Date.now() - start > MAX_EXECUTION_TIME) break; + } + } else { + for (i = 0; i < 64; i++) + for (j = 0; j < clen >> 1; j++) _encipher(cdata, j << 1, P, S); + var ret = []; + for (i = 0; i < clen; i++) + ret.push((cdata[i] >> 24 & 255) >>> 0), ret.push((cdata[i] >> 16 & 255) >>> 0), ret.push((cdata[i] >> 8 & 255) >>> 0), ret.push((cdata[i] & 255) >>> 0); + if (callback) { + callback(null, ret); + return; + } else return ret; + } + if (callback) nextTick(next); + } + if (typeof callback !== "undefined") { + next(); + } else { + var res; + while (true) if (typeof (res = next()) !== "undefined") return res || []; + } +} +function _hash(password, salt, callback, progressCallback) { + var err; + if (typeof password !== "string" || typeof salt !== "string") { + err = Error("Invalid string / salt: Not a string"); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + var minor, offset; + if (salt.charAt(0) !== "$" || salt.charAt(1) !== "2") { + err = Error("Invalid salt version: " + salt.substring(0, 2)); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + if (salt.charAt(2) === "$") minor = String.fromCharCode(0), offset = 3; + else { + minor = salt.charAt(2); + if (minor !== "a" && minor !== "b" && minor !== "y" || salt.charAt(3) !== "$") { + err = Error("Invalid salt revision: " + salt.substring(2, 4)); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + offset = 4; + } + if (salt.charAt(offset + 2) > "$") { + err = Error("Missing salt rounds"); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else throw err; + } + var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), rounds = r1 + r2, real_salt = salt.substring(offset + 3, offset + 25); + password += minor >= "a" ? "\0" : ""; + var passwordb = utf8Array(password), saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); + function finish(bytes) { + var res = []; + res.push("$2"); + if (minor >= "a") res.push(minor); + res.push("$"); + if (rounds < 10) res.push("0"); + res.push(rounds.toString()); + res.push("$"); + res.push(base64_encode(saltb, saltb.length)); + res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); + return res.join(""); + } + if (typeof callback == "undefined") + return finish(_crypt(passwordb, saltb, rounds)); + else { + _crypt( + passwordb, + saltb, + rounds, + function(err2, bytes) { + if (err2) callback(err2, null); + else callback(null, finish(bytes)); + }, + progressCallback + ); + } +} + +// src/modules/auth/acl.constants.ts +var ALL_RIDS = [ + "branch.create", + "branch.list", + "buy.order.list", + "cities.create", + "cities.list", + "cities.list.remove", + "cities.list.view", + "cities.list.view.edit", + "collection.create", + "collection.list", + "collection.list.edit", + "collection.list.remove", + "comment", + "comment.remove", + "comment.state", + "comment.view", + "comment.view.edit", + "config.report", + "config.statics", + "config.statics.brand", + "config.statics.brand.create", + "config.statics.brand.edit", + "config.statics.brand.remove", + "config.statics.tags", + "config.statics.tags.create", + "config.statics.tags.edit", + "config.statics.tags.remove", + "config.wallet", + "custom.config.statics.slider", + "custom.config.statics.tags.banner.ids", + "dashboard.omde", + "dashboard.tak", + "document.create", + "document.list", + "document.list.confirm", + "document.list.deny", + "document.list.edit", + "document.list.get", + "document.list.remove", + "invoice.create", + "invoice.list", + "newsletters", + "notify.create", + "notify.me", + "offers.autopromotion", + "offers.create", + "offers.create.tak", + "offers.list", + "offers.list.edit", + "offers.list.remove", + "offers.list.tak.edit", + "offers.list.tak.remove", + "offersIgnore", + "order.create", + "order.list", + "order.list.pdf", + "order.list.sts", + "order.list.sts.remove", + "order.list.sts.submit", + "order.list.view", + "order.list.view.edit", + "order.makeOrder", + "order.makeOrder.get", + "order.makeOrder.remove", + "order.makeOrder.state", + "order.makeOrder.state.remove", + "order.makeOrder.state.submit", + "order.makeOrder.view", + "order.makeOrder.view.edit", + "order.omde", + "order.omde.get", + "order.omde.remove", + "order.omde.state", + "order.omde.state.remove", + "order.omde.state.submit", + "order.omde.view", + "order.omde.view.edit", + "order.omde.view.remove", + "order.tamin", + "order.tamin.state", + "order.tamin.state.remove", + "order.tamin.state.submit", + "order.tamin.view", + "order.tamin.view.edit", + "persons.create", + "persons.create.client", + "persons.create.customer.tak", + "persons.create.seller", + "persons.list.client.omde", + "persons.list.client.omde.able", + "persons.list.client.omde.able.order", + "persons.list.client.omde.edit", + "persons.list.client.omde.unable", + "persons.list.client.omde.unable.order", + "persons.list.client.omde.view", + "persons.list.client.omde.view.documents", + "persons.list.client.omde.view.orders", + "persons.list.client.single", + "persons.list.client.single.edit", + "persons.list.client.single.view", + "persons.list.sellers", + "persons.list.sellers.able", + "persons.list.sellers.able.order", + "persons.list.sellers.edit", + "persons.list.sellers.unable", + "persons.list.sellers.unable.order", + "persons.list.sellers.view", + "persons.list.sellers.view.documents", + "persons.list.sellers.view.orders", + "product.create", + "product.list", + "product.list.edit", + "product.list.group.edit", + "product.list.remove", + "product.list.variants", + "product.list.variants.add", + "product.list.variants.edit", + "product.list.variants.remove", + "product.list.view", + "product.percent", + "report.order.item", + "report.product", + "sms.create", + "sms.create.all", + "sms.create.multiple", + "sms.create.omde", + "sms.create.reagent", + "sms.create.single", + "sms.list", + "statics", + "user.create", + "user.list", + "user.list.create", + "user.list.edit", + "user.list.remove", + "user.permission", + "user.permission.create", + "user.permission.edit", + "wallet", + "wallet.charge", + "wallet.list", + "wallet.percent", + "workshop.create", + "workshop.list" +]; + +// prisma/seed.ts var prisma = new import_client.PrismaClient(); -var PLACEHOLDER_PASSWORD_HASH = "placeholder-hash-not-for-production"; +var DEV_PASSWORD = "admin1234"; +var PLACEHOLDER_PASSWORD_HASH = hashSync(DEV_PASSWORD, 10); +var DEV_TEST_PHONE = "09128081392"; +var DEV_TEST_PHONE_PASSWORD_HASH = hashSync(DEV_TEST_PHONE, 10); var PLACEHOLDER_PRODUCT_IMAGE = "/img/no-items.png"; async function main() { const [tehran, mashhad, isfahan, tabriz] = await Promise.all([ @@ -27,65 +1765,168 @@ async function main() { update: {}, create: { id: "workshop-central", name: "\u06A9\u0627\u0631\u06AF\u0627\u0647 \u0645\u0631\u06A9\u0632\u06CC \u0633\u0627\u062E\u062A \u0637\u0644\u0627" } }); + const userTypes = [ + // Full access — every rid the routers gate. + { id: 85, title: "\u0645\u062F\u06CC\u0631 \u0627\u0631\u0634\u062F", rids: ALL_RIDS }, + { + id: 86, + title: "\u06A9\u0627\u0631\u0634\u0646\u0627\u0633 \u0641\u0631\u0648\u0634", + rids: [ + "order.list", + "order.create", + "order.omde", + "order.makeOrder", + "persons.list.client.omde", + "persons.list.client.omde.view", + "persons.list.client.single", + "persons.list.client.single.view", + "persons.create", + "product.list", + "dashboard.tak", + "comment" + ] + }, + { + id: 87, + title: "\u062D\u0633\u0627\u0628\u062F\u0627\u0631", + rids: [ + "document.list", + "document.create", + "document.list.edit", + "invoice.list", + "invoice.create", + "wallet", + "config.wallet", + "report.order.item", + "report.product", + "config.report", + "dashboard.omde" + ] + }, + { + id: 88, + title: "\u0633\u0631\u067E\u0631\u0633\u062A \u06A9\u0627\u0631\u06AF\u0627\u0647", + rids: ["workshop.list", "workshop.create", "order.tamin", "order.list", "product.list"] + }, + { + id: 89, + title: "\u06A9\u0627\u0631\u0628\u0631 \u0634\u0639\u0628\u0647", + rids: ["buy.order.list", "order.create", "persons.create", "branch.list"] + } + ]; + for (const ut of userTypes) { + await prisma.userType.upsert({ + where: { id: ut.id }, + update: { title: ut.title }, + create: { id: ut.id, title: ut.title } + }); + await prisma.permission.createMany({ + data: ut.rids.map((rid) => ({ rid, userTypeId: ut.id })), + skipDuplicates: true + }); + } + await prisma.adminUser.upsert({ + where: { mobile: DEV_TEST_PHONE }, + update: { passwordHash: DEV_TEST_PHONE_PASSWORD_HASH, userTypeId: 85, branchId: null }, + create: { + mobile: DEV_TEST_PHONE, + fullName: "\u06A9\u0627\u0631\u0628\u0631 \u062A\u0633\u062A \u062A\u0648\u0633\u0639\u0647", + passwordHash: DEV_TEST_PHONE_PASSWORD_HASH, + role: import_client.AdminRole.SUPER_ADMIN, + userTypeId: 85, + branchId: null + } + }); await prisma.adminUser.upsert({ where: { mobile: "09120000001" }, - update: {}, + update: { passwordHash: PLACEHOLDER_PASSWORD_HASH, userTypeId: 85, branchId: null }, create: { mobile: "09120000001", fullName: "\u0645\u062F\u06CC\u0631 \u0627\u0631\u0634\u062F \u0633\u06CC\u0633\u062A\u0645", passwordHash: PLACEHOLDER_PASSWORD_HASH, role: import_client.AdminRole.SUPER_ADMIN, - branchId: branchTehran.id + userTypeId: 85, + // Head office: deliberately branch-less. Legacy scoped every list by + // branch_id whenever the user had one, so head-office staff must have none + // or they would see only a single branch's data. + branchId: null } }); const agentReza = await prisma.adminUser.upsert({ where: { mobile: "09121234567" }, - update: {}, + update: { passwordHash: PLACEHOLDER_PASSWORD_HASH, userTypeId: 86 }, create: { mobile: "09121234567", fullName: "\u0631\u0636\u0627 \u0627\u062D\u0645\u062F\u06CC", passwordHash: PLACEHOLDER_PASSWORD_HASH, role: import_client.AdminRole.SALES_EXPERT, + userTypeId: 86, branchId: branchTehran.id, wagePercent: 1.5 } }); const agentSara = await prisma.adminUser.upsert({ where: { mobile: "09129876543" }, - update: {}, + update: { passwordHash: PLACEHOLDER_PASSWORD_HASH, userTypeId: 86 }, create: { mobile: "09129876543", fullName: "\u0633\u0627\u0631\u0627 \u06A9\u0631\u06CC\u0645\u06CC", passwordHash: PLACEHOLDER_PASSWORD_HASH, role: import_client.AdminRole.SALES_EXPERT, + userTypeId: 86, branchId: branchMashhad.id, wagePercent: 1.2 } }); await prisma.adminUser.upsert({ where: { mobile: "09123334444" }, - update: {}, + update: { passwordHash: PLACEHOLDER_PASSWORD_HASH, userTypeId: 88 }, create: { mobile: "09123334444", fullName: "\u0647\u0648\u0645\u0646 \u06CC\u0632\u062F\u0627\u0646\u06CC", passwordHash: PLACEHOLDER_PASSWORD_HASH, - role: import_client.AdminRole.WORKSHOP_SUPERVISOR + role: import_client.AdminRole.WORKSHOP_SUPERVISOR, + userTypeId: 88 } }); await prisma.adminUser.upsert({ where: { mobile: "09125556666" }, - update: {}, + update: { passwordHash: PLACEHOLDER_PASSWORD_HASH, userTypeId: 87, branchId: null }, create: { mobile: "09125556666", fullName: "\u0641\u0631\u0632\u0627\u0646\u0647 \u0645\u062D\u0645\u0648\u062F\u06CC", passwordHash: PLACEHOLDER_PASSWORD_HASH, role: import_client.AdminRole.ACCOUNTANT, - branchId: branchTehran.id + userTypeId: 87, + branchId: null } }); const customerData = [ + { + // DEV-ONLY test login, per explicit request: same number as the admin + // panel account above, so it can also sign in to the user-app (OTP step + // matches on mobile against a real seeded customer — see LoginView.vue). + // Fully verified so no onboarding step blocks it. Not for a real deployment. + id: "customer-dev-test", + kind: import_client.CustomerKind.APP_SHOPKEEPER, + memberCode: "DEV-TEST", + fullName: "\u06A9\u0627\u0631\u0628\u0631 \u062A\u0633\u062A \u062A\u0648\u0633\u0639\u0647", + mobile: DEV_TEST_PHONE, + nationalCode: "0000000000", + cityId: tehran.id, + referredByAgentId: null, + goldCreditLimitGrams: "1000", + verificationStep: import_client.VerificationStep.VERIFIED + }, { id: "customer-1", + kind: import_client.CustomerKind.BANKER, + storeName: "\u0637\u0644\u0627\u06CC \u0645\u062D\u0645\u062F\u06CC", + pasazhName: "\u067E\u0627\u0633\u0627\u0698 \u0628\u0632\u0631\u06AF", + zone: "\u0628\u0627\u0632\u0627\u0631", + memberCode: "M-1001", + phone: "02133445566", + address: "\u062A\u0647\u0631\u0627\u0646\u060C \u0628\u0627\u0632\u0627\u0631 \u0628\u0632\u0631\u06AF\u060C \u067E\u0644\u0627\u06A9 \u06F1\u06F2", fullName: "\u0639\u0644\u06CC \u0645\u062D\u0645\u062F\u06CC", mobile: "09151112233", nationalCode: "0012345678", @@ -96,6 +1937,11 @@ async function main() { }, { id: "customer-2", + kind: import_client.CustomerKind.APP_SHOPKEEPER, + storeName: "\u06AF\u0627\u0644\u0631\u06CC \u062D\u0633\u06CC\u0646\u06CC", + zone: "\u0648\u0646\u06A9", + memberCode: "M-1002", + phone: "02188776655", fullName: "\u0645\u0631\u06CC\u0645 \u062D\u0633\u06CC\u0646\u06CC", mobile: "09151112234", nationalCode: "0012345679", @@ -106,6 +1952,11 @@ async function main() { }, { id: "customer-3", + kind: import_client.CustomerKind.WALK_IN_SHOPKEEPER, + storeName: "\u0632\u0631\u06AF\u0631\u06CC \u0646\u0648\u0631\u0648\u0632\u06CC", + pasazhName: "\u067E\u0627\u0633\u0627\u0698 \u0631\u0636\u0627", + zone: "\u0637\u0631\u0642", + memberCode: "M-1003", fullName: "\u062C\u0648\u0627\u062F \u0646\u0648\u0631\u0648\u0632\u06CC", mobile: "09151112235", nationalCode: "0012345680", @@ -116,16 +1967,26 @@ async function main() { }, { id: "customer-4", + kind: import_client.CustomerKind.APP_SHOPKEEPER, + memberCode: "M-1004", fullName: "\u0646\u0631\u06AF\u0633 \u0627\u0628\u0631\u0627\u0647\u06CC\u0645\u06CC", mobile: "09151112236", nationalCode: "0012345681", cityId: isfahan.id, referredByAgentId: null, goldCreditLimitGrams: "30", - verificationStep: import_client.VerificationStep.UNVERIFIED + verificationStep: import_client.VerificationStep.UNVERIFIED, + // archived, so the "لیست بایگانی" grid has a row and the type lists + // correctly exclude it + isArchived: true }, { id: "customer-5", + kind: import_client.CustomerKind.BANKER, + storeName: "\u0635\u0627\u062F\u0642\u06CC \u0648 \u067E\u0633\u0631\u0627\u0646", + zone: "\u0628\u0627\u0632\u0627\u0631", + memberCode: "M-1005", + phone: "02155443322", fullName: "\u06A9\u0627\u0645\u0631\u0627\u0646 \u0635\u0627\u062F\u0642\u06CC", mobile: "09151112237", nationalCode: "0012345682", @@ -136,6 +1997,10 @@ async function main() { }, { id: "customer-6", + kind: import_client.CustomerKind.WALK_IN_SHOPKEEPER, + storeName: "\u0637\u0644\u0627\u0633\u0631\u0627\u06CC \u0642\u0627\u0633\u0645\u06CC", + zone: "\u0627\u0626\u0644 \u06AF\u0644\u06CC", + memberCode: "M-1006", fullName: "\u0632\u0647\u0631\u0627 \u0642\u0627\u0633\u0645\u06CC", mobile: "09151112238", nationalCode: "0012345683", @@ -150,7 +2015,20 @@ async function main() { customers.push( await prisma.customer.upsert({ where: { id: c.id }, - update: {}, + // Re-assert the DESCRIPTIVE fields on an existing row so a re-seed + // backfills columns added after that row was first created. Balances, + // verification state and credit limits are deliberately NOT touched — + // those are live data a re-seed must never overwrite. + update: { + kind: c.kind, + phone: "phone" in c ? c.phone : null, + address: "address" in c ? c.address : null, + storeName: "storeName" in c ? c.storeName : null, + pasazhName: "pasazhName" in c ? c.pasazhName : null, + zone: "zone" in c ? c.zone : null, + memberCode: c.memberCode, + isArchived: "isArchived" in c ? c.isArchived : false + }, create: { id: c.id, fullName: c.fullName, @@ -160,12 +2038,23 @@ async function main() { cityId: c.cityId, referredByAgentId: c.referredByAgentId, goldCreditLimitGrams: c.goldCreditLimitGrams, - verificationStep: c.verificationStep + verificationStep: c.verificationStep, + kind: c.kind, + phone: "phone" in c ? c.phone : null, + address: "address" in c ? c.address : null, + storeName: "storeName" in c ? c.storeName : null, + pasazhName: "pasazhName" in c ? c.pasazhName : null, + zone: "zone" in c ? c.zone : null, + memberCode: c.memberCode, + isArchived: "isArchived" in c ? c.isArchived : false } }) ); } - const [customer1, customer2, , , customer5] = customers; + const byId = (id) => customers.find((c) => c.id === id); + const customer1 = byId("customer-1"); + const customer2 = byId("customer-2"); + const customer5 = byId("customer-5"); const [ringsCategory, braceletsCategory, necklacesCategory, earringsCategory, coinsCategory] = await Promise.all([ prisma.category.upsert({ where: { id: "cat-rings" }, update: {}, create: { id: "cat-rings", title: "\u0627\u0646\u06AF\u0634\u062A\u0631" } }), prisma.category.upsert({ where: { id: "cat-bracelets" }, update: {}, create: { id: "cat-bracelets", title: "\u062F\u0633\u062A\u0628\u0646\u062F" } }), @@ -303,6 +2192,48 @@ async function main() { await prisma.goldPriceQuote.create({ data: { karatPerMille: 750, pricePerGramRial: "61500000", source: "seed-illustrative" } }); + const existingRetail = await prisma.order.findUnique({ + where: { orderNumber: "ORD-SEED-0002" } + }); + if (!existingRetail) { + const rash = "2.400"; + const wage = 7.5; + const computed = (parseFloat(rash) * (1 + wage / 100)).toFixed(4); + await prisma.order.create({ + data: { + orderNumber: "ORD-SEED-0002", + customerId: customer2.id, + branchId: branchTehran.id, + channel: import_client.OrderChannel.RETAIL, + status: "PLACED", + totalGoldWeightGrams: computed, + wageWeightGrams: (parseFloat(computed) - parseFloat(rash)).toFixed(4), + flatRialCharge: "0", + items: { + create: [ + { + productVariantId: "variant-ring-size-7", + quantity: 1, + rashWeightGramsSnapshot: rash, + wagePercentSnapshot: wage.toString(), + discountPercentSnapshot: "0", + computedWeightGrams: computed, + flatRialCharge: "0" + } + ] + }, + statusEvents: { create: [{ toStatus: "PLACED" }] } + } + }); + } + await prisma.order.updateMany({ + where: { orderNumber: "ORD-SEED-0001" }, + data: { channel: import_client.OrderChannel.WHOLESALE } + }); + await prisma.order.updateMany({ + where: { orderNumber: "ORD-SEED-0002" }, + data: { channel: import_client.OrderChannel.RETAIL } + }); const existingDemoOrder = await prisma.order.findUnique({ where: { orderNumber: "ORD-SEED-0001" } }); if (!existingDemoOrder) { const rashWeight = "3.100"; @@ -316,6 +2247,8 @@ async function main() { orderNumber: "ORD-SEED-0001", customerId: customer1.id, branchId: branchTehran.id, + // customer1 is a بنکدار, so this belongs to the wholesale grid + channel: import_client.OrderChannel.WHOLESALE, status: "DELIVERED_TO_CUSTOMER", totalGoldWeightGrams: computedWeight, wageWeightGrams: (parseFloat(computedWeight) - parseFloat(rashWeight)).toFixed(4), @@ -384,6 +2317,82 @@ async function main() { } await prisma.customer.update({ where: { id: customer2.id }, data: { goldDebtGrams: "8.2500", fiatDebtRial: "2000000" } }); await prisma.customer.update({ where: { id: customer5.id }, data: { goldDebtGrams: "0", fiatDebtRial: "0" } }); + const preOrderSeeds = [ + { + id: "preorder-0001", + customerId: customer2.id, + cityId: tehran.id, + status: "PLACED", + colorName: "\u0631\u0632\u06AF\u0644\u062F", + sizeSpec: "\u06F1\u06F6", + stoneColor: "\u0633\u0641\u06CC\u062F", + minaColor: "\u0622\u0628\u06CC", + description: "\u0627\u0646\u06AF\u0634\u062A\u0631 \u0637\u0631\u062D \u0633\u0646\u062A\u06CC \u0628\u0627 \u0646\u06AF\u06CC\u0646 \u0633\u0641\u06CC\u062F", + estimatedWeightGrams: "4.5000" + }, + { + id: "preorder-0002", + customerId: customer5.id, + cityId: mashhad.id, + status: "ADMIN_APPROVED", + colorName: "\u0632\u0631\u062F", + sizeSpec: "\u06F1\u06F8", + stoneColor: "\u0642\u0631\u0645\u0632", + minaColor: "\u0633\u0628\u0632", + description: "\u062F\u0633\u062A\u0628\u0646\u062F \u0645\u06CC\u0646\u0627 \u06A9\u0627\u0631\u06CC", + estimatedWeightGrams: "9.2500" + } + ]; + for (const po of preOrderSeeds) { + await prisma.preOrder.upsert({ + where: { id: po.id }, + update: {}, + create: po + }); + } + const allProducts = await prisma.product.findMany({ take: 3 }); + if (allProducts.length > 0) { + const commentSeeds = [ + { + id: "comment-0001", + productId: allProducts[0].id, + customerId: customer2.id, + body: "\u06A9\u06CC\u0641\u06CC\u062A \u0633\u0627\u062E\u062A \u0639\u0627\u0644\u06CC \u0628\u0648\u062F\u060C \u0645\u0645\u0646\u0648\u0646 \u0627\u0632 \u0627\u0631\u0633\u0627\u0644 \u0633\u0631\u06CC\u0639.", + status: "APPROVED" + }, + { + id: "comment-0002", + productId: allProducts[0].id, + customerId: customer5.id, + body: "\u0622\u06CC\u0627 \u0627\u06CC\u0646 \u0645\u062F\u0644 \u062F\u0631 \u0633\u0627\u06CC\u0632 \u0628\u0632\u0631\u06AF\u200C\u062A\u0631 \u0647\u0645 \u0645\u0648\u062C\u0648\u062F \u0645\u06CC\u200C\u0634\u0648\u062F\u061F", + status: "PENDING" + }, + { + id: "comment-0003", + productId: allProducts[Math.min(1, allProducts.length - 1)].id, + customerId: customer2.id, + body: "\u0648\u0632\u0646 \u0628\u0627 \u0622\u0646\u0686\u0647 \u0646\u0648\u0634\u062A\u0647 \u0634\u062F\u0647 \u06A9\u0645\u06CC \u062A\u0641\u0627\u0648\u062A \u062F\u0627\u0634\u062A.", + status: "REJECTED" + } + ]; + for (const c of commentSeeds) { + await prisma.comment.upsert({ where: { id: c.id }, update: {}, create: c }); + } + } + const allVariants = await prisma.productVariant.findMany(); + for (const [i, v] of allVariants.entries()) { + await prisma.productVariant.update({ + where: { id: v.id }, + data: { qty: 5 + i % 4, isPreOrder: i % 5 === 0 } + }); + } + const codedProducts = await prisma.product.findMany({ orderBy: { title: "asc" } }); + for (const [i, p] of codedProducts.entries()) { + await prisma.product.update({ + where: { id: p.id }, + data: { productCode: `P-${String(i + 1).padStart(4, "0")}` } + }); + } console.log("Seed complete:", { cities: 4, branches: 2, diff --git a/apps/api/release/vendor/.prisma/client/edge.js b/apps/api/release/vendor/.prisma/client/edge.js index a685edb..f20fef8 100644 --- a/apps/api/release/vendor/.prisma/client/edge.js +++ b/apps/api/release/vendor/.prisma/client/edge.js @@ -93,7 +93,9 @@ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ exports.Prisma.CityScalarFieldEnum = { id: 'id', name: 'name', - province: 'province' + province: 'province', + percent: 'percent', + percentAux: 'percentAux' }; exports.Prisma.AdminUserScalarFieldEnum = { @@ -102,6 +104,7 @@ exports.Prisma.AdminUserScalarFieldEnum = { mobile: 'mobile', passwordHash: 'passwordHash', role: 'role', + userTypeId: 'userTypeId', branchId: 'branchId', wagePercent: 'wagePercent', isActive: 'isActive', @@ -115,6 +118,13 @@ exports.Prisma.CustomerScalarFieldEnum = { nationalCode: 'nationalCode', passwordHash: 'passwordHash', cityId: 'cityId', + kind: 'kind', + phone: 'phone', + address: 'address', + storeName: 'storeName', + pasazhName: 'pasazhName', + zone: 'zone', + memberCode: 'memberCode', referredByAgentId: 'referredByAgentId', goldCreditLimitGrams: 'goldCreditLimitGrams', goldDebtGrams: 'goldDebtGrams', @@ -123,7 +133,10 @@ exports.Prisma.CustomerScalarFieldEnum = { nationalIdImageUrl: 'nationalIdImageUrl', businessLicenseUrl: 'businessLicenseUrl', shopImageUrl: 'shopImageUrl', + avatarFileId: 'avatarFileId', + canPlaceOrders: 'canPlaceOrders', isActive: 'isActive', + isArchived: 'isArchived', createdAt: 'createdAt', updatedAt: 'updatedAt' }; @@ -139,18 +152,29 @@ exports.Prisma.CustomerAddressScalarFieldEnum = { exports.Prisma.BranchScalarFieldEnum = { id: 'id', name: 'name', + address: 'address', + phone: 'phone', + isActive: 'isActive', cityId: 'cityId' }; exports.Prisma.WorkshopScalarFieldEnum = { id: 'id', name: 'name', + address: 'address', + phone: 'phone', + supervisorId: 'supervisorId', isActive: 'isActive' }; exports.Prisma.CategoryScalarFieldEnum = { id: 'id', title: 'title', + type: 'type', + imageUrl: 'imageUrl', + iconUrl: 'iconUrl', + metaTag: 'metaTag', + description: 'description', parentId: 'parentId' }; @@ -177,6 +201,8 @@ exports.Prisma.ProductScalarFieldEnum = { description: 'description', categoryId: 'categoryId', brandId: 'brandId', + productCode: 'productCode', + showType: 'showType', isActive: 'isActive', createdAt: 'createdAt' }; @@ -195,6 +221,8 @@ exports.Prisma.ProductVariantScalarFieldEnum = { sku: 'sku', rashWeightGrams: 'rashWeightGrams', defaultWagePercent: 'defaultWagePercent', + qty: 'qty', + isPreOrder: 'isPreOrder', isActive: 'isActive' }; @@ -203,6 +231,7 @@ exports.Prisma.OrderScalarFieldEnum = { orderNumber: 'orderNumber', customerId: 'customerId', branchId: 'branchId', + channel: 'channel', status: 'status', totalGoldWeightGrams: 'totalGoldWeightGrams', wageWeightGrams: 'wageWeightGrams', @@ -276,6 +305,14 @@ exports.Prisma.LedgerEntryScalarFieldEnum = { confirmed: 'confirmed', confirmedAt: 'confirmedAt', postedByAdminUserId: 'postedByAdminUserId', + labName: 'labName', + hallmark: 'hallmark', + accountName: 'accountName', + bankName: 'bankName', + transferTo: 'transferTo', + originalValue: 'originalValue', + priceRial: 'priceRial', + receivedAt: 'receivedAt', note: 'note', createdAt: 'createdAt' }; @@ -299,6 +336,128 @@ exports.Prisma.WalletBonusScalarFieldEnum = { isActive: 'isActive' }; +exports.Prisma.UserTypeScalarFieldEnum = { + id: 'id', + title: 'title', + isActive: 'isActive', + createdAt: 'createdAt' +}; + +exports.Prisma.PermissionScalarFieldEnum = { + rid: 'rid', + userTypeId: 'userTypeId' +}; + +exports.Prisma.CommentScalarFieldEnum = { + id: 'id', + productId: 'productId', + customerId: 'customerId', + body: 'body', + status: 'status', + replyToId: 'replyToId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.SettingScalarFieldEnum = { + key: 'key', + value: 'value', + updatedAt: 'updatedAt' +}; + +exports.Prisma.PromotionScalarFieldEnum = { + id: 'id', + title: 'title', + description: 'description', + scope: 'scope', + usage: 'usage', + discountPercent: 'discountPercent', + isActive: 'isActive', + platform: 'platform', + startsAt: 'startsAt', + endsAt: 'endsAt', + productId: 'productId', + categoryId: 'categoryId', + customerId: 'customerId', + brandId: 'brandId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.PromotionExclusionScalarFieldEnum = { + id: 'id', + type: 'type', + itemId: 'itemId', + createdAt: 'createdAt' +}; + +exports.Prisma.BranchAllocationScalarFieldEnum = { + id: 'id', + branchId: 'branchId', + allocatorAdminUserId: 'allocatorAdminUserId', + note: 'note', + createdAt: 'createdAt' +}; + +exports.Prisma.BranchAllocationItemScalarFieldEnum = { + id: 'id', + allocationId: 'allocationId', + productId: 'productId', + weightGrams: 'weightGrams' +}; + +exports.Prisma.SmsMessageScalarFieldEnum = { + id: 'id', + audience: 'audience', + recipients: 'recipients', + body: 'body', + sentCount: 'sentCount', + sentByAdminUserId: 'sentByAdminUserId', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationScalarFieldEnum = { + id: 'id', + title: 'title', + body: 'body', + audience: 'audience', + sentByAdminUserId: 'sentByAdminUserId', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationRecipientScalarFieldEnum = { + id: 'id', + notificationId: 'notificationId', + customerId: 'customerId', + readAt: 'readAt' +}; + +exports.Prisma.NewsletterSubscriberScalarFieldEnum = { + id: 'id', + email: 'email', + mobile: 'mobile', + createdAt: 'createdAt' +}; + +exports.Prisma.CustomerActivityLogScalarFieldEnum = { + id: 'id', + customerId: 'customerId', + action: 'action', + detail: 'detail', + createdAt: 'createdAt' +}; + +exports.Prisma.UploadedFileScalarFieldEnum = { + id: 'id', + url: 'url', + originalName: 'originalName', + mimeType: 'mimeType', + sizeBytes: 'sizeBytes', + purpose: 'purpose', + uploadedByAdminUserId: 'uploadedByAdminUserId', + createdAt: 'createdAt' +}; + exports.Prisma.SortOrder = { asc: 'asc', desc: 'desc' @@ -331,6 +490,14 @@ exports.AdminRole = exports.$Enums.AdminRole = { ACCOUNTANT: 'ACCOUNTANT' }; +exports.CustomerKind = exports.$Enums.CustomerKind = { + SALES_AGENT: 'SALES_AGENT', + APP_SHOPKEEPER: 'APP_SHOPKEEPER', + WALK_IN_SHOPKEEPER: 'WALK_IN_SHOPKEEPER', + BANKER: 'BANKER', + WORKSHOP_SUPERVISOR: 'WORKSHOP_SUPERVISOR' +}; + exports.VerificationStep = exports.$Enums.VerificationStep = { UNVERIFIED: 'UNVERIFIED', STEP_ONE_SUBMITTED: 'STEP_ONE_SUBMITTED', @@ -338,6 +505,11 @@ exports.VerificationStep = exports.$Enums.VerificationStep = { VERIFIED: 'VERIFIED' }; +exports.OrderChannel = exports.$Enums.OrderChannel = { + RETAIL: 'RETAIL', + WHOLESALE: 'WHOLESALE' +}; + exports.OrderStatus = exports.$Enums.OrderStatus = { SUSPENDED: 'SUSPENDED', PLACED: 'PLACED', @@ -379,6 +551,33 @@ exports.LedgerSourceType = exports.$Enums.LedgerSourceType = { ADJUSTMENT: 'ADJUSTMENT' }; +exports.CommentStatus = exports.$Enums.CommentStatus = { + PENDING: 'PENDING', + APPROVED: 'APPROVED', + REJECTED: 'REJECTED' +}; + +exports.PromotionScope = exports.$Enums.PromotionScope = { + PRODUCT: 'PRODUCT', + CATEGORY: 'CATEGORY', + CUSTOMER: 'CUSTOMER', + BRAND: 'BRAND' +}; + +exports.PromotionUsage = exports.$Enums.PromotionUsage = { + ONCE: 'ONCE', + UNTIL_END_DATE: 'UNTIL_END_DATE' +}; + +exports.MessageAudience = exports.$Enums.MessageAudience = { + SINGLE_NUMBER: 'SINGLE_NUMBER', + MULTIPLE_NUMBERS: 'MULTIPLE_NUMBERS', + ALL_CUSTOMERS: 'ALL_CUSTOMERS', + WHOLESALE_CUSTOMERS: 'WHOLESALE_CUSTOMERS', + RETAIL_CUSTOMERS: 'RETAIL_CUSTOMERS', + SALES_AGENTS: 'SALES_AGENTS' +}; + exports.Prisma.ModelName = { City: 'City', AdminUser: 'AdminUser', @@ -400,7 +599,21 @@ exports.Prisma.ModelName = { PreOrderStatusEvent: 'PreOrderStatusEvent', LedgerEntry: 'LedgerEntry', GoldPriceQuote: 'GoldPriceQuote', - WalletBonus: 'WalletBonus' + WalletBonus: 'WalletBonus', + UserType: 'UserType', + Permission: 'Permission', + Comment: 'Comment', + Setting: 'Setting', + Promotion: 'Promotion', + PromotionExclusion: 'PromotionExclusion', + BranchAllocation: 'BranchAllocation', + BranchAllocationItem: 'BranchAllocationItem', + SmsMessage: 'SmsMessage', + Notification: 'Notification', + NotificationRecipient: 'NotificationRecipient', + NewsletterSubscriber: 'NewsletterSubscriber', + CustomerActivityLog: 'CustomerActivityLog', + UploadedFile: 'UploadedFile' }; /** * Create the Client @@ -413,7 +626,7 @@ const config = { "value": "prisma-client-js" }, "output": { - "value": "C:\\App\\gold-bank\\node_modules\\.pnpm\\@prisma+client@5.22.0_prisma@5.22.0\\node_modules\\@prisma\\client", + "value": "E:\\gold bank\\gold-banking-monorepo\\node_modules\\.pnpm\\@prisma+client@5.22.0_prisma@5.22.0\\node_modules\\@prisma\\client", "fromEnvVar": null }, "config": { @@ -431,7 +644,7 @@ const config = { } ], "previewFeatures": [], - "sourceFilePath": "C:\\App\\gold-bank\\apps\\api\\prisma\\schema.prisma" + "sourceFilePath": "E:\\gold bank\\gold-banking-monorepo\\apps\\api\\prisma\\schema.prisma" }, "relativeEnvPaths": { "rootEnvPath": null, @@ -453,13 +666,13 @@ const config = { } } }, - "inlineSchema": "// Gold Banking System — core schema\n// Canonical accounting model: legacy \"System A\" gram ledger (see migration notes).\n// The external \"Tahesab\" service is retired — LedgerEntry is the sole source of truth.\n// All money/weight fields use Decimal, never Float, to avoid rounding drift in debt math.\n\ngenerator client {\n provider = \"prisma-client-js\"\n // native = local Windows/macOS; debian-openssl-3.0.x = node:20-bookworm-slim (Arvan)\n binaryTargets = [\"native\", \"debian-openssl-3.0.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Enums\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AdminRole {\n SUPER_ADMIN\n SYSTEM_APPROVER // legacy: تایید مدیر سیستم\n SALES_EXPERT // legacy Customer.type=1, also acts as a referral \"reagent\"\n WORKSHOP_SUPERVISOR\n ACCOUNTANT\n}\n\nenum VerificationStep {\n UNVERIFIED\n STEP_ONE_SUBMITTED\n STEP_TWO_SUBMITTED\n VERIFIED\n}\n\nenum OrderStatus {\n SUSPENDED // credit limit (goldCreditLimitGrams) exceeded at placement\n PLACED\n ADMIN_APPROVED\n SOURCING\n PREPARING\n DELIVERED_TO_AGENT\n DELIVERED_TO_CUSTOMER // debt recognition point — mirrors legacy sts>4\n CANCELLED\n}\n\nenum PreOrderStatus {\n PLACED\n ADMIN_APPROVED\n WORKSHOP_APPROVED\n READY_TO_SHIP\n DELIVERED\n CANCELLED\n}\n\nenum LedgerCurrency {\n GOLD_GRAM\n RIAL\n}\n\nenum LedgerDirection {\n DEBIT // increases what the customer owes\n CREDIT // decreases what the customer owes\n}\n\nenum LedgerSourceType {\n ORDER_STOCK\n ORDER_PRE_ORDER\n REPAYMENT_MELTED_GOLD // karat-normalized: amount * karatPerMille / 750\n REPAYMENT_TRANSFER\n REPAYMENT_CHEQUE\n REPAYMENT_CASH // price-per-gram-normalized via pricePerGramRialAtEntry\n WALLET_BONUS\n ADJUSTMENT\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Identity\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel City {\n id String @id @default(cuid())\n name String\n province String?\n customers Customer[]\n addresses CustomerAddress[]\n branches Branch[]\n preOrders PreOrder[]\n}\n\nmodel AdminUser {\n id String @id @default(cuid())\n fullName String\n mobile String @unique\n passwordHash String\n role AdminRole\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n wagePercent Decimal? @db.Decimal(6, 3) // legacy Customer.percent, commission on referred orders\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n referredCustomers Customer[] @relation(\"ReferralAgent\")\n postedLedgerEntries LedgerEntry[]\n orderStatusEvents OrderStatusEvent[]\n preOrderStatusEvents PreOrderStatusEvent[]\n\n @@index([role])\n}\n\nmodel Customer {\n id String @id @default(cuid())\n fullName String\n mobile String @unique\n nationalCode String @unique\n passwordHash String\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n referredByAgentId String?\n referredByAgent AdminUser? @relation(\"ReferralAgent\", fields: [referredByAgentId], references: [id])\n\n // Credit limit + cached ledger balances (source of truth is LedgerEntry; these\n // are denormalized for fast reads and reconciled by a scheduled job).\n goldCreditLimitGrams Decimal @default(0) @db.Decimal(14, 4) // legacy gram_level\n goldDebtGrams Decimal @default(0) @db.Decimal(14, 4) // legacy remain\n fiatDebtRial Decimal @default(0) @db.Decimal(20, 2) // legacy rial_remain\n\n verificationStep VerificationStep @default(UNVERIFIED)\n nationalIdImageUrl String?\n businessLicenseUrl String?\n shopImageUrl String?\n\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n addresses CustomerAddress[]\n orders Order[]\n preOrders PreOrder[]\n ledgerEntries LedgerEntry[]\n walletBonuses WalletBonus[]\n\n @@index([referredByAgentId])\n}\n\nmodel CustomerAddress {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n addressLine String\n isDefault Boolean @default(false)\n}\n\nmodel Branch {\n id String @id @default(cuid())\n name String\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n adminUsers AdminUser[]\n orders Order[]\n}\n\nmodel Workshop {\n id String @id @default(cuid())\n name String\n isActive Boolean @default(true)\n preOrders PreOrder[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Catalog — item reference catalog\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Category {\n id String @id @default(cuid())\n title String\n parentId String?\n parent Category? @relation(\"CategoryTree\", fields: [parentId], references: [id])\n children Category[] @relation(\"CategoryTree\")\n products Product[]\n}\n\nmodel Brand {\n id String @id @default(cuid())\n title String\n products Product[]\n}\n\n/// Curated product groupings — replaces legacy \"Ciny/CinyProduct\" (a tagging\n/// feature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\nmodel Collection {\n id String @id @default(cuid())\n title String\n description String?\n isActive Boolean @default(true)\n products CollectionProduct[]\n}\n\nmodel CollectionProduct {\n collectionId String\n collection Collection @relation(fields: [collectionId], references: [id])\n productId String\n product Product @relation(fields: [productId], references: [id])\n\n @@id([collectionId, productId])\n}\n\nmodel Product {\n id String @id @default(cuid())\n title String\n description String?\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n variants ProductVariant[]\n images ProductImage[]\n collections CollectionProduct[]\n}\n\nmodel ProductImage {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n url String\n sortOrder Int @default(0)\n}\n\nmodel ProductVariant {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n title String\n sku String? @unique\n /// Base/raw weight before making charge (\"rash weight\").\n rashWeightGrams Decimal @db.Decimal(14, 4)\n /// Default making-charge percentage applied on top of rash weight.\n defaultWagePercent Decimal @db.Decimal(6, 3)\n isActive Boolean @default(true)\n\n orderItems OrderItem[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Orders — stock orders (debt-bearing)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Order {\n id String @id @default(cuid())\n orderNumber String @unique\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n status OrderStatus @default(PLACED)\n\n /// Total gold weight incl. wage across all items (\"allGram\" / order.w).\n totalGoldWeightGrams Decimal @db.Decimal(14, 4)\n /// Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\n wageWeightGrams Decimal @db.Decimal(14, 4)\n /// Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n\n isSuspendedOverCreditLimit Boolean @default(false)\n deliveredAt DateTime? // setting this is what triggers debt recognition\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n items OrderItem[]\n statusEvents OrderStatusEvent[]\n ledgerEntries LedgerEntry[]\n convertedFromPreOrder PreOrder?\n\n @@index([customerId])\n @@index([status])\n}\n\nmodel OrderItem {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n productVariantId String\n productVariant ProductVariant @relation(fields: [productVariantId], references: [id])\n quantity Int\n\n // Snapshots at order time — never re-read from ProductVariant after placement.\n rashWeightGramsSnapshot Decimal @db.Decimal(14, 4)\n wagePercentSnapshot Decimal @db.Decimal(6, 3)\n discountPercentSnapshot Decimal @default(0) @db.Decimal(6, 3)\n /// computed: rash*(1 + (wagePercent-discount)/100)\n computedWeightGrams Decimal @db.Decimal(14, 4)\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n}\n\nmodel OrderStatusEvent {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n fromStatus OrderStatus?\n toStatus OrderStatus\n note String?\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n createdAt DateTime @default(now())\n\n @@index([orderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Pre-orders — custom manufacturing requests (not debt-bearing until converted)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel PreOrder {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n workshopId String?\n workshop Workshop? @relation(fields: [workshopId], references: [id])\n status PreOrderStatus @default(PLACED)\n\n designImageUrl String?\n colorName String?\n sizeSpec String?\n stoneColor String?\n minaColor String?\n estimatedWeightGrams Decimal? @db.Decimal(14, 4)\n estimatedPriceRial Decimal? @db.Decimal(20, 2)\n description String?\n\n /// Once priced, an admin converts this into a real (debt-bearing) Order.\n convertedOrderId String? @unique\n convertedOrder Order? @relation(fields: [convertedOrderId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n statusEvents PreOrderStatusEvent[]\n\n @@index([customerId])\n}\n\nmodel PreOrderStatusEvent {\n id String @id @default(cuid())\n preOrderId String\n preOrder PreOrder @relation(fields: [preOrderId], references: [id])\n /// Field-level diff, e.g. {\"status\": {\"old\": \"PLACED\", \"new\": \"ADMIN_APPROVED\"}}\n changes Json\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n ipAddress String?\n createdAt DateTime @default(now())\n\n @@index([preOrderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting — the dual-currency ledger (core of the system)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel LedgerEntry {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n\n currency LedgerCurrency\n direction LedgerDirection\n sourceType LedgerSourceType\n /// Always positive; direction determines the sign applied to the customer balance.\n amount Decimal @db.Decimal(20, 4)\n\n /// Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\n karatPerMille Int?\n /// Gold price/gram at conversion time, for REPAYMENT_CASH.\n pricePerGramRialAtEntry Decimal? @db.Decimal(20, 2)\n\n orderId String?\n order Order? @relation(fields: [orderId], references: [id])\n\n /// Pending entries don't count toward the cached customer balance until confirmed.\n confirmed Boolean @default(false)\n confirmedAt DateTime?\n postedByAdminUserId String?\n postedByAdminUser AdminUser? @relation(fields: [postedByAdminUserId], references: [id])\n\n note String?\n createdAt DateTime @default(now())\n\n @@index([customerId, currency])\n @@index([orderId])\n}\n\n/// Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\nmodel GoldPriceQuote {\n id String @id @default(cuid())\n karatPerMille Int\n pricePerGramRial Decimal @db.Decimal(20, 2)\n source String\n quotedAt DateTime @default(now())\n\n @@index([karatPerMille, quotedAt])\n}\n\n/// Time-limited gold cashback bonus — replaces the legacy Rooyesh\\Wallet gold credit.\nmodel WalletBonus {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n orderId String?\n goldGrams Decimal @db.Decimal(14, 4)\n grantedAt DateTime @default(now())\n expiresAt DateTime\n consumedAt DateTime?\n isActive Boolean @default(true)\n\n @@index([customerId, isActive])\n}\n", - "inlineSchemaHash": "c0944da476bdb47884e1c9d2aeeb374e6077907fd89970148d89eff210dfe8ab", + "inlineSchema": "// Gold Banking System — core schema\n// Canonical accounting model: legacy \"System A\" gram ledger (see migration notes).\n// The external \"Tahesab\" service is retired — LedgerEntry is the sole source of truth.\n// All money/weight fields use Decimal, never Float, to avoid rounding drift in debt math.\n\ngenerator client {\n provider = \"prisma-client-js\"\n // native = local Windows/macOS; debian-openssl-3.0.x = node:20-bookworm-slim (Arvan)\n binaryTargets = [\"native\", \"debian-openssl-3.0.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Enums\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AdminRole {\n SUPER_ADMIN\n SYSTEM_APPROVER // legacy: تایید مدیر سیستم\n SALES_EXPERT // legacy Customer.type=1, also acts as a referral \"reagent\"\n WORKSHOP_SUPERVISOR\n ACCOUNTANT\n}\n\n/// Legacy Customer.type — what kind of wholesale customer this is. Values and\n/// labels taken verbatim from bulkCustomer.vue's userTypes list.\nenum CustomerKind {\n SALES_AGENT // 1 کارشناس فروش\n APP_SHOPKEEPER // 2 مغازه دار اپلیکیشن\n WALK_IN_SHOPKEEPER // 3 مغازه دار حضوری\n BANKER // 4 بنکدار\n WORKSHOP_SUPERVISOR // 5 سرپرست کارگاه\n}\n\nenum VerificationStep {\n UNVERIFIED\n STEP_ONE_SUBMITTED\n STEP_TWO_SUBMITTED\n VERIFIED\n}\n\n/// Legacy kept retail and wholesale orders in two SEPARATE tables\n/// (orders_orders vs orders). The redesigned schema has one Order model, so the\n/// distinction lives here instead.\nenum OrderChannel {\n RETAIL // تک فروشی\n WHOLESALE // عمده فروشی\n}\n\nenum OrderStatus {\n SUSPENDED // credit limit (goldCreditLimitGrams) exceeded at placement\n PLACED\n ADMIN_APPROVED\n SOURCING\n PREPARING\n DELIVERED_TO_AGENT\n DELIVERED_TO_CUSTOMER // debt recognition point — mirrors legacy sts>4\n CANCELLED\n}\n\nenum PreOrderStatus {\n PLACED\n ADMIN_APPROVED\n WORKSHOP_APPROVED\n READY_TO_SHIP\n DELIVERED\n CANCELLED\n}\n\nenum LedgerCurrency {\n GOLD_GRAM\n RIAL\n}\n\nenum LedgerDirection {\n DEBIT // increases what the customer owes\n CREDIT // decreases what the customer owes\n}\n\nenum LedgerSourceType {\n ORDER_STOCK\n ORDER_PRE_ORDER\n REPAYMENT_MELTED_GOLD // karat-normalized: amount * karatPerMille / 750\n REPAYMENT_TRANSFER\n REPAYMENT_CHEQUE\n REPAYMENT_CASH // price-per-gram-normalized via pricePerGramRialAtEntry\n WALLET_BONUS\n ADJUSTMENT\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Identity\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel City {\n id String @id @default(cuid())\n name String\n province String?\n /// Legacy cities.percent / percent_aux — per-city wage surcharges the city\n /// screen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\n percent Decimal? @db.Decimal(6, 3)\n percentAux Decimal? @db.Decimal(6, 3)\n customers Customer[]\n addresses CustomerAddress[]\n branches Branch[]\n preOrders PreOrder[]\n}\n\nmodel AdminUser {\n id String @id @default(cuid())\n fullName String\n mobile String @unique\n passwordHash String\n role AdminRole\n /// Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\n /// the coarse `role` enum above is retained for the business rules that already\n /// switch on it. Nullable so existing seeded admins remain valid.\n userTypeId Int?\n userType UserType? @relation(fields: [userTypeId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n wagePercent Decimal? @db.Decimal(6, 3) // legacy Customer.percent, commission on referred orders\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n referredCustomers Customer[] @relation(\"ReferralAgent\")\n supervisedWorkshops Workshop[] @relation(\"WorkshopSupervisor\")\n branchAllocations BranchAllocation[] @relation(\"AllocationAuthor\")\n postedLedgerEntries LedgerEntry[]\n orderStatusEvents OrderStatusEvent[]\n preOrderStatusEvents PreOrderStatusEvent[]\n sentSmsMessages SmsMessage[] @relation(\"SmsAuthor\")\n sentNotifications Notification[] @relation(\"NotificationAuthor\")\n uploadedFiles UploadedFile[] @relation(\"FileUploader\")\n\n @@index([role])\n @@index([userTypeId])\n}\n\nmodel Customer {\n id String @id @default(cuid())\n fullName String\n mobile String @unique\n nationalCode String @unique\n passwordHash String\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n /// Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\n /// BankerList / ShopkeeperList screens filter on.\n kind CustomerKind @default(APP_SHOPKEEPER)\n\n /// Legacy contact + shop columns, shown on the wholesale customer form and as\n /// (hidden-by-default) columns in its grid.\n phone String?\n address String?\n storeName String?\n pasazhName String?\n zone String?\n /// Legacy mcode — the operator-assigned customer code.\n memberCode String?\n\n referredByAgentId String?\n referredByAgent AdminUser? @relation(\"ReferralAgent\", fields: [referredByAgentId], references: [id])\n\n // Credit limit + cached ledger balances (source of truth is LedgerEntry; these\n // are denormalized for fast reads and reconciled by a scheduled job).\n goldCreditLimitGrams Decimal @default(0) @db.Decimal(14, 4) // legacy gram_level\n goldDebtGrams Decimal @default(0) @db.Decimal(14, 4) // legacy remain\n fiatDebtRial Decimal @default(0) @db.Decimal(20, 2) // legacy rial_remain\n\n verificationStep VerificationStep @default(UNVERIFIED)\n nationalIdImageUrl String?\n businessLicenseUrl String?\n shopImageUrl String?\n\n /// Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\n /// form. Legacy stored an FK to its Image table and read it back as a nested\n /// `image: { id, image }`, so this is a relation, not a bare URL string.\n avatarFileId String?\n avatarFile UploadedFile? @relation(\"CustomerAvatar\", fields: [avatarFileId], references: [id])\n\n /// Legacy had TWO independent switches on a customer:\n /// sts -> may they place orders (this field)\n /// active -> is the account enabled (isActive, below)\n /// The port previously drove both from isActive; they are separate again.\n canPlaceOrders Boolean @default(true)\n\n isActive Boolean @default(true)\n /// Legacy archive flag — the archived list filtered on this, not on isActive.\n isArchived Boolean @default(false)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n addresses CustomerAddress[]\n orders Order[]\n preOrders PreOrder[]\n ledgerEntries LedgerEntry[]\n walletBonuses WalletBonus[]\n comments Comment[]\n promotions Promotion[]\n notifications NotificationRecipient[]\n activityLogs CustomerActivityLog[]\n\n @@index([referredByAgentId])\n}\n\nmodel CustomerAddress {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n addressLine String\n isDefault Boolean @default(false)\n}\n\nmodel Branch {\n id String @id @default(cuid())\n name String\n /// Legacy Branch.address / phone — both are columns in the branch grid.\n address String?\n phone String?\n /// Legacy GET branch/active/{id} toggles this.\n isActive Boolean @default(true)\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n adminUsers AdminUser[]\n orders Order[]\n allocations BranchAllocation[]\n}\n\nmodel Workshop {\n id String @id @default(cuid())\n name String\n /// Legacy Workshop.address / phone — both are columns in the workshop grid.\n address String?\n phone String?\n /// The supervisor created alongside the workshop by the legacy Add form.\n supervisorId String?\n supervisor AdminUser? @relation(\"WorkshopSupervisor\", fields: [supervisorId], references: [id])\n isActive Boolean @default(true)\n preOrders PreOrder[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Catalog — item reference catalog\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Category {\n id String @id @default(cuid())\n title String\n /// Legacy Category.type — which storefront the category belongs to:\n /// 1 سایت | 2 اپلیکشن موبایل. Drives the \"type_str\" grid column.\n type Int @default(1)\n /// Legacy Category.image / icon — the grid renders the image, the storefront the icon.\n imageUrl String?\n iconUrl String?\n /// Legacy meta tag + description, used for SEO on the site categories.\n metaTag String?\n description String?\n parentId String?\n parent Category? @relation(\"CategoryTree\", fields: [parentId], references: [id])\n children Category[] @relation(\"CategoryTree\")\n products Product[]\n promotions Promotion[]\n}\n\nmodel Brand {\n id String @id @default(cuid())\n title String\n products Product[]\n promotions Promotion[]\n}\n\n/// Curated product groupings — replaces legacy \"Ciny/CinyProduct\" (a tagging\n/// feature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\nmodel Collection {\n id String @id @default(cuid())\n title String\n description String?\n isActive Boolean @default(true)\n products CollectionProduct[]\n}\n\nmodel CollectionProduct {\n collectionId String\n collection Collection @relation(fields: [collectionId], references: [id])\n productId String\n product Product @relation(fields: [productId], references: [id])\n\n @@id([collectionId, productId])\n}\n\nmodel Product {\n id String @id @default(cuid())\n title String\n description String?\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n /// Legacy Product.product_code — the human-facing SKU shown in the grid.\n productCode String? @unique\n /// Legacy Product.show_type: 1 site, 2 mobile, 3 both.\n showType Int @default(3)\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n variants ProductVariant[]\n images ProductImage[]\n collections CollectionProduct[]\n comments Comment[]\n promotions Promotion[]\n allocationItems BranchAllocationItem[]\n}\n\nmodel ProductImage {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n url String\n sortOrder Int @default(0)\n}\n\nmodel ProductVariant {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n title String\n sku String? @unique\n /// Base/raw weight before making charge (\"rash weight\").\n rashWeightGrams Decimal @db.Decimal(14, 4)\n /// Default making-charge percentage applied on top of rash weight.\n defaultWagePercent Decimal @db.Decimal(6, 3)\n /// Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\n /// qty 0 unless it is flagged pre-order, so both fields are required for that\n /// guard to work (see apps/admin-panel/src/stores/cart.ts).\n qty Int @default(0)\n /// Legacy is_pre_order: orderable even at zero stock.\n isPreOrder Boolean @default(false)\n isActive Boolean @default(true)\n\n orderItems OrderItem[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Orders — stock orders (debt-bearing)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Order {\n id String @id @default(cuid())\n orderNumber String @unique\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n /// Which sales channel placed this order — see OrderChannel.\n channel OrderChannel @default(RETAIL)\n status OrderStatus @default(PLACED)\n\n /// Total gold weight incl. wage across all items (\"allGram\" / order.w).\n totalGoldWeightGrams Decimal @db.Decimal(14, 4)\n /// Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\n wageWeightGrams Decimal @db.Decimal(14, 4)\n /// Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n\n isSuspendedOverCreditLimit Boolean @default(false)\n deliveredAt DateTime? // setting this is what triggers debt recognition\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n items OrderItem[]\n statusEvents OrderStatusEvent[]\n ledgerEntries LedgerEntry[]\n convertedFromPreOrder PreOrder?\n\n @@index([customerId])\n @@index([status])\n}\n\nmodel OrderItem {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n productVariantId String\n productVariant ProductVariant @relation(fields: [productVariantId], references: [id])\n quantity Int\n\n // Snapshots at order time — never re-read from ProductVariant after placement.\n rashWeightGramsSnapshot Decimal @db.Decimal(14, 4)\n wagePercentSnapshot Decimal @db.Decimal(6, 3)\n discountPercentSnapshot Decimal @default(0) @db.Decimal(6, 3)\n /// computed: rash*(1 + (wagePercent-discount)/100)\n computedWeightGrams Decimal @db.Decimal(14, 4)\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n}\n\nmodel OrderStatusEvent {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n fromStatus OrderStatus?\n toStatus OrderStatus\n note String?\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n createdAt DateTime @default(now())\n\n @@index([orderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Pre-orders — custom manufacturing requests (not debt-bearing until converted)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel PreOrder {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n workshopId String?\n workshop Workshop? @relation(fields: [workshopId], references: [id])\n status PreOrderStatus @default(PLACED)\n\n designImageUrl String?\n colorName String?\n sizeSpec String?\n stoneColor String?\n minaColor String?\n estimatedWeightGrams Decimal? @db.Decimal(14, 4)\n estimatedPriceRial Decimal? @db.Decimal(20, 2)\n description String?\n\n /// Once priced, an admin converts this into a real (debt-bearing) Order.\n convertedOrderId String? @unique\n convertedOrder Order? @relation(fields: [convertedOrderId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n statusEvents PreOrderStatusEvent[]\n\n @@index([customerId])\n}\n\nmodel PreOrderStatusEvent {\n id String @id @default(cuid())\n preOrderId String\n preOrder PreOrder @relation(fields: [preOrderId], references: [id])\n /// Field-level diff, e.g. {\"status\": {\"old\": \"PLACED\", \"new\": \"ADMIN_APPROVED\"}}\n changes Json\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n ipAddress String?\n createdAt DateTime @default(now())\n\n @@index([preOrderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting — the dual-currency ledger (core of the system)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel LedgerEntry {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n\n currency LedgerCurrency\n direction LedgerDirection\n sourceType LedgerSourceType\n /// Always positive; direction determines the sign applied to the customer balance.\n amount Decimal @db.Decimal(20, 4)\n\n /// Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\n karatPerMille Int?\n /// Gold price/gram at conversion time, for REPAYMENT_CASH.\n pricePerGramRialAtEntry Decimal? @db.Decimal(20, 2)\n\n orderId String?\n order Order? @relation(fields: [orderId], references: [id])\n\n /// Pending entries don't count toward the cached customer balance until confirmed.\n confirmed Boolean @default(false)\n confirmedAt DateTime?\n postedByAdminUserId String?\n postedByAdminUser AdminUser? @relation(fields: [postedByAdminUserId], references: [id])\n\n /// Instrument metadata from the legacy \"cash\" document form. Which fields are\n /// filled depends on sourceType: a melted-gold receipt carries lab/hallmark and\n /// the pre-normalization weight, a cheque carries the account and bank, and a\n /// transfer carries its destination.\n /// Legacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\n labName String?\n hallmark String?\n accountName String?\n bankName String?\n transferTo String?\n /// Weight as handed over, BEFORE karat normalization (legacy original_value).\n originalValue Decimal? @db.Decimal(14, 4)\n /// Rial amount for cash/cheque documents (legacy price).\n priceRial Decimal? @db.Decimal(20, 2)\n receivedAt DateTime?\n\n note String?\n createdAt DateTime @default(now())\n\n @@index([customerId, currency])\n @@index([orderId])\n}\n\n/// Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\nmodel GoldPriceQuote {\n id String @id @default(cuid())\n karatPerMille Int\n pricePerGramRial Decimal @db.Decimal(20, 2)\n source String\n quotedAt DateTime @default(now())\n\n @@index([karatPerMille, quotedAt])\n}\n\n/// Time-limited gold cashback bonus — replaces the legacy Rooyesh\\Wallet gold credit.\nmodel WalletBonus {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n orderId String?\n goldGrams Decimal @db.Decimal(14, 4)\n grantedAt DateTime @default(now())\n expiresAt DateTime\n consumedAt DateTime?\n isActive Boolean @default(true)\n\n @@index([customerId, isActive])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Admin ACL — faithful port of the legacy granular permission model.\n//\n// Legacy (henza_server):\n// Schema::create('permission', function (Blueprint $table) {\n// $table->string('rid');\n// $table->integer('ut');\n// $table->primary(['rid' , 'ut']);\n// });\n//\n// Permissions attach to the USER TYPE (`ut`), never to an individual user, so\n// every admin of a given type shares one permission set. `ut` pointed at a row\n// in the legacy `config_static` lookup table; UserType is that table, narrowed\n// to the admin-user-type rows it was actually used for.\n//\n// A `rid` is a dotted permission id such as \"persons.list.client.omde\". The\n// frontend expands each stored rid into its ancestors at runtime via\n// checkParent() — see apps/admin-panel/src/stores/users.ts. Only the 58 leaf\n// rids the routers actually gate are seeded; ancestors are derived, not stored.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UserType {\n /// Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\n /// rows keep their legacy identity rather than getting new cuids.\n id Int @id\n title String\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n permissions Permission[]\n adminUsers AdminUser[]\n\n @@map(\"user_type\")\n}\n\nmodel Permission {\n /// Dotted permission id, e.g. \"order.list\", \"persons.list.client.omde\".\n rid String\n userTypeId Int\n userType UserType @relation(fields: [userTypeId], references: [id], onDelete: Cascade)\n\n /// Legacy's composite primary key (rid, ut), preserved exactly.\n @@id([rid, userTypeId])\n @@index([userTypeId])\n @@map(\"permission\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Product comments / reviews — legacy `comment` table (App\\Models\\Comment),\n// moderated from views/customer/Comments/Comments.vue.\n//\n// Legacy fillable: product_id, comment, reply_to, sts, customer_id\n// Legacy Comment::$STS = [1 => 'در انتظار تایید', 2 => 'تایید شده', 3 => 'رد شده']\n// which is represented here as an enum rather than a magic integer.\n// ─────────────────────────────────────────────────────────────────────────\n\nenum CommentStatus {\n PENDING // 1 — در انتظار تایید\n APPROVED // 2 — تایید شده\n REJECTED // 3 — رد شده\n}\n\nmodel Comment {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n body String\n status CommentStatus @default(PENDING)\n\n /// Legacy `reply_to`: a staff reply threads under the comment it answers.\n replyToId String?\n replyTo Comment? @relation(\"CommentReplies\", fields: [replyToId], references: [id])\n replies Comment[] @relation(\"CommentReplies\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([productId])\n @@index([customerId])\n @@index([status])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Settings — replaces legacy `config_static`, a key/value table the admin\n// panel read and wrote through endpoints like /wallet/config and\n// /const/__list__ut. Values are stored as JSON so a setting can hold a scalar,\n// an object, or the dynamic option lists legacy kept under `__list__*` keys.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Setting {\n key String @id\n value Json\n updatedAt DateTime @updatedAt\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Promotions / discounts — legacy views/promotion/*, served by\n// PromotionController (`product/variant/promotion`). The redesigned schema had\n// no promotion concept at all; this models what the legacy forms actually\n// collect.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Legacy Promotion.type — what the discount is scoped to.\nenum PromotionScope {\n PRODUCT // 1 محصولات\n CATEGORY // 2 دسته بندی\n CUSTOMER // 3 مشتری\n BRAND // 4 برند\n}\n\n/// Legacy Promotion.use_only — how often a customer may redeem it.\nenum PromotionUsage {\n ONCE // 1 فقط یکبار\n UNTIL_END_DATE // 2 تا تاریخ پایان\n}\n\nmodel Promotion {\n id String @id @default(cuid())\n title String\n description String?\n scope PromotionScope @default(PRODUCT)\n usage PromotionUsage @default(ONCE)\n /// Percentage off, 0-100 (legacy discount_percent).\n discountPercent Decimal @db.Decimal(6, 3)\n isActive Boolean @default(true)\n /// Which storefront it shows on, mirroring Product.showType (legacy platform).\n platform Int @default(3)\n\n startsAt DateTime?\n endsAt DateTime?\n\n /// Exactly one of these is populated, per `scope`.\n productId String?\n product Product? @relation(fields: [productId], references: [id])\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n customerId String?\n customer Customer? @relation(fields: [customerId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([scope, isActive])\n}\n\n/// Legacy \"ignore\" table (views/offersIgnore) — specific products, categories,\n/// customers or brands excluded from the automatic discount engine.\n/// Legacy posts { type, item_id[] }: \"type\" reuses the promotion scope codes\n/// (1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \"itemId\" is the excluded row.\nmodel PromotionExclusion {\n id String @id @default(cuid())\n type Int\n itemId String\n createdAt DateTime @default(now())\n\n @@unique([type, itemId])\n @@index([type])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Branch stock allocation — legacy views/invoice/* (\"فاکتور انتقال\"), served by\n// BranchController as `branch/product`. Despite the screen being called an\n// invoice, it is not a sales document: it records which products head office\n// allocated to a branch, and who allocated them.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel BranchAllocation {\n id String @id @default(cuid())\n branchId String\n branch Branch @relation(fields: [branchId], references: [id])\n\n /// Legacy `allocator_user` — the admin who filed the allocation.\n allocatorAdminUserId String?\n allocatorAdminUser AdminUser? @relation(\"AllocationAuthor\", fields: [allocatorAdminUserId], references: [id])\n\n note String?\n createdAt DateTime @default(now())\n\n items BranchAllocationItem[]\n\n @@index([branchId])\n}\n\nmodel BranchAllocationItem {\n id String @id @default(cuid())\n allocationId String\n allocation BranchAllocation @relation(fields: [allocationId], references: [id], onDelete: Cascade)\n productId String\n product Product @relation(fields: [productId], references: [id])\n /// Weight snapshot at allocation time, so later catalog edits do not rewrite history.\n weightGrams Decimal? @db.Decimal(14, 4)\n\n @@unique([allocationId, productId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Messaging + audit — legacy views/sms, views/notify, views/newsletters and\n// views/statics. None of these had a model in the redesigned schema.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Who an SMS or notification was aimed at. Legacy's sms/create offered these\n/// audiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\nenum MessageAudience {\n SINGLE_NUMBER // یک شماره\n MULTIPLE_NUMBERS // چند شماره\n ALL_CUSTOMERS // همه\n WHOLESALE_CUSTOMERS // عمده\n RETAIL_CUSTOMERS // تک\n SALES_AGENTS // کارشناسان فروش\n}\n\nmodel SmsMessage {\n id String @id @default(cuid())\n audience MessageAudience\n /// Comma-separated recipients for the SINGLE/MULTIPLE audiences.\n recipients String?\n body String\n /// How many numbers the send actually resolved to.\n sentCount Int @default(0)\n\n sentByAdminUserId String?\n sentByAdminUser AdminUser? @relation(\"SmsAuthor\", fields: [sentByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n\n @@index([createdAt])\n}\n\nmodel Notification {\n id String @id @default(cuid())\n title String\n body String\n audience MessageAudience @default(ALL_CUSTOMERS)\n\n sentByAdminUserId String?\n sentByAdminUser AdminUser? @relation(\"NotificationAuthor\", fields: [sentByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n\n recipients NotificationRecipient[]\n\n @@index([createdAt])\n}\n\n/// Per-customer delivery + read state — legacy `GET notify/read/{id}`.\nmodel NotificationRecipient {\n id String @id @default(cuid())\n notificationId String\n notification Notification @relation(fields: [notificationId], references: [id], onDelete: Cascade)\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n readAt DateTime?\n\n @@unique([notificationId, customerId])\n @@index([customerId, readAt])\n}\n\n/// Legacy views/newsletters — the mailing-list signups collected by the site.\nmodel NewsletterSubscriber {\n id String @id @default(cuid())\n email String?\n mobile String?\n createdAt DateTime @default(now())\n\n @@unique([email])\n @@unique([mobile])\n}\n\n/// Legacy views/statics — the customer activity log the \"آمار\" screen reads\n/// (`log/list/customer`, `log/ago/{customerId}`).\nmodel CustomerActivityLog {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n /// Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\n action String\n detail String?\n createdAt DateTime @default(now())\n\n @@index([customerId, createdAt])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Uploads — replaces the legacy MyUpload / SingleUploadInput widgets, which\n// POSTed to a file endpoint and stored the returned URL on the owning record.\n// Ports of those forms currently take a URL by hand; this gives them a real\n// destination to upload to.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UploadedFile {\n id String @id @default(cuid())\n /// Public URL the stored file is served from.\n url String\n originalName String\n mimeType String\n sizeBytes Int\n /// Free-form tag for what the file belongs to, e.g. 'product', 'category',\n /// 'customer.nationalId'. Kept loose so a new form needs no schema change.\n purpose String?\n\n uploadedByAdminUserId String?\n uploadedByAdminUser AdminUser? @relation(\"FileUploader\", fields: [uploadedByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n customerAvatars Customer[] @relation(\"CustomerAvatar\")\n\n @@index([purpose])\n}\n", + "inlineSchemaHash": "4cc939ac6b5cd721518113b1d37a86a6f2cbfcc7f4466eff02a3535e7b385f45", "copyEngine": true } config.dirname = '/' -config.runtimeDataModel = JSON.parse("{\"models\":{\"City\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"province\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branches\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"AdminUser\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminRole\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredCustomers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedLedgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Customer\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredByAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredByAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[\"referredByAgentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldCreditLimitGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldDebtGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fiatDebtRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"verificationStep\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"VerificationStep\",\"default\":\"UNVERIFIED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalIdImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"businessLicenseUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"shopImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"walletBonuses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"WalletBonus\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerAddress\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addressLine\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isDefault\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Branch\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Workshop\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Category\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Brand\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Collection\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Curated product groupings — replaces legacy \\\"Ciny/CinyProduct\\\" (a tagging\\\\nfeature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\"},\"CollectionProduct\":{\"dbName\":null,\"fields\":[{\"name\":\"collectionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collection\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Collection\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[\"collectionId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"collectionId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Product\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"images\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collections\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductImage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sortOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductVariant\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sku\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Base/raw weight before making charge (\\\"rash weight\\\").\"},{\"name\":\"defaultWagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Default making-charge percentage applied on top of rash weight.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Order\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"totalGoldWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Total gold weight incl. wage across all items (\\\"allGram\\\" / order.w).\"},{\"name\":\"wageWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\"},{\"name\":\"isSuspendedOverCreditLimit\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deliveredAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedFromPreOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariantId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariant\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[\"productVariantId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quantity\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGramsSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"computedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"computed: rash*(1 + (wagePercent-discount)/100)\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fromStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"toStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrder\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshopId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshop\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[\"workshopId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PreOrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"designImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"colorName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeSpec\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stoneColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"minaColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedPriceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Once priced, an admin converts this into a real (debt-bearing) Order.\"},{\"name\":\"convertedOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[\"convertedOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[\"preOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"changes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Field-level diff, e.g. {\\\"status\\\": {\\\"old\\\": \\\"PLACED\\\", \\\"new\\\": \\\"ADMIN_APPROVED\\\"}}\"},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"LedgerEntry\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"currency\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerCurrency\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"direction\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerDirection\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sourceType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerSourceType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"amount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Always positive; direction determines the sign applied to the customer balance.\"},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\"},{\"name\":\"pricePerGramRialAtEntry\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Gold price/gram at conversion time, for REPAYMENT_CASH.\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"confirmed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pending entries don't count toward the cached customer balance until confirmed.\"},{\"name\":\"confirmedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[\"postedByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"GoldPriceQuote\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pricePerGramRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"source\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quotedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\"},\"WalletBonus\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"grantedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Time-limited gold cashback bonus — replaces the legacy Rooyesh\\\\Wallet gold credit.\"}},\"enums\":{\"AdminRole\":{\"values\":[{\"name\":\"SUPER_ADMIN\",\"dbName\":null},{\"name\":\"SYSTEM_APPROVER\",\"dbName\":null},{\"name\":\"SALES_EXPERT\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"ACCOUNTANT\",\"dbName\":null}],\"dbName\":null},\"VerificationStep\":{\"values\":[{\"name\":\"UNVERIFIED\",\"dbName\":null},{\"name\":\"STEP_ONE_SUBMITTED\",\"dbName\":null},{\"name\":\"STEP_TWO_SUBMITTED\",\"dbName\":null},{\"name\":\"VERIFIED\",\"dbName\":null}],\"dbName\":null},\"OrderStatus\":{\"values\":[{\"name\":\"SUSPENDED\",\"dbName\":null},{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"SOURCING\",\"dbName\":null},{\"name\":\"PREPARING\",\"dbName\":null},{\"name\":\"DELIVERED_TO_AGENT\",\"dbName\":null},{\"name\":\"DELIVERED_TO_CUSTOMER\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"PreOrderStatus\":{\"values\":[{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"WORKSHOP_APPROVED\",\"dbName\":null},{\"name\":\"READY_TO_SHIP\",\"dbName\":null},{\"name\":\"DELIVERED\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"LedgerCurrency\":{\"values\":[{\"name\":\"GOLD_GRAM\",\"dbName\":null},{\"name\":\"RIAL\",\"dbName\":null}],\"dbName\":null},\"LedgerDirection\":{\"values\":[{\"name\":\"DEBIT\",\"dbName\":null},{\"name\":\"CREDIT\",\"dbName\":null}],\"dbName\":null},\"LedgerSourceType\":{\"values\":[{\"name\":\"ORDER_STOCK\",\"dbName\":null},{\"name\":\"ORDER_PRE_ORDER\",\"dbName\":null},{\"name\":\"REPAYMENT_MELTED_GOLD\",\"dbName\":null},{\"name\":\"REPAYMENT_TRANSFER\",\"dbName\":null},{\"name\":\"REPAYMENT_CHEQUE\",\"dbName\":null},{\"name\":\"REPAYMENT_CASH\",\"dbName\":null},{\"name\":\"WALLET_BONUS\",\"dbName\":null},{\"name\":\"ADJUSTMENT\",\"dbName\":null}],\"dbName\":null}},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"City\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"province\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"percent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy cities.percent / percent_aux — per-city wage surcharges the city\\\\nscreen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\"},{\"name\":\"percentAux\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branches\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"AdminUser\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminRole\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\\\\nthe coarse `role` enum above is retained for the business rules that already\\\\nswitch on it. Nullable so existing seeded admins remain valid.\"},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredCustomers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supervisedWorkshops\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchAllocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedLedgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentSmsMessages\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SmsMessage\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentNotifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedFiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"FileUploader\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Customer\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kind\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CustomerKind\",\"default\":\"APP_SHOPKEEPER\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\\\\nBankerList / ShopkeeperList screens filter on.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy contact + shop columns, shown on the wholesale customer form and as\\\\n(hidden-by-default) columns in its grid.\"},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"storeName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pasazhName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"zone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"memberCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy mcode — the operator-assigned customer code.\"},{\"name\":\"referredByAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredByAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[\"referredByAgentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldCreditLimitGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldDebtGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fiatDebtRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"verificationStep\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"VerificationStep\",\"default\":\"UNVERIFIED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalIdImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"businessLicenseUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"shopImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"avatarFileId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\\\\nform. Legacy stored an FK to its Image table and read it back as a nested\\\\n`image: { id, image }`, so this is a relation, not a bare URL string.\"},{\"name\":\"avatarFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[\"avatarFileId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"canPlaceOrders\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy had TWO independent switches on a customer:\\\\nsts -> may they place orders (this field)\\\\nactive -> is the account enabled (isActive, below)\\\\nThe port previously drove both from isActive; they are separate again.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isArchived\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy archive flag — the archived list filtered on this, not on isActive.\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"walletBonuses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"WalletBonus\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"activityLogs\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerActivityLog\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerAddress\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addressLine\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isDefault\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Branch\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Branch.address / phone — both are columns in the branch grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy GET branch/active/{id} toggles this.\"},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Workshop\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Workshop.address / phone — both are columns in the workshop grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supervisorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The supervisor created alongside the workshop by the legacy Add form.\"},{\"name\":\"supervisor\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[\"supervisorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Category\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":1,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.type — which storefront the category belongs to:\\\\n1 سایت | 2 اپلیکشن موبایل. Drives the \\\"type_str\\\" grid column.\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.image / icon — the grid renders the image, the storefront the icon.\"},{\"name\":\"iconUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"metaTag\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy meta tag + description, used for SEO on the site categories.\"},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Brand\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Collection\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Curated product groupings — replaces legacy \\\"Ciny/CinyProduct\\\" (a tagging\\\\nfeature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\"},\"CollectionProduct\":{\"dbName\":null,\"fields\":[{\"name\":\"collectionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collection\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Collection\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[\"collectionId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"collectionId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Product\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.product_code — the human-facing SKU shown in the grid.\"},{\"name\":\"showType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.show_type: 1 site, 2 mobile, 3 both.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"images\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collections\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductImage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sortOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductVariant\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sku\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Base/raw weight before making charge (\\\"rash weight\\\").\"},{\"name\":\"defaultWagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Default making-charge percentage applied on top of rash weight.\"},{\"name\":\"qty\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\\\\nqty 0 unless it is flagged pre-order, so both fields are required for that\\\\nguard to work (see apps/admin-panel/src/stores/cart.ts).\"},{\"name\":\"isPreOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy is_pre_order: orderable even at zero stock.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Order\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channel\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderChannel\",\"default\":\"RETAIL\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which sales channel placed this order — see OrderChannel.\"},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"totalGoldWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Total gold weight incl. wage across all items (\\\"allGram\\\" / order.w).\"},{\"name\":\"wageWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\"},{\"name\":\"isSuspendedOverCreditLimit\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deliveredAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedFromPreOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariantId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariant\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[\"productVariantId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quantity\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGramsSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"computedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"computed: rash*(1 + (wagePercent-discount)/100)\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fromStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"toStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrder\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshopId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshop\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[\"workshopId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PreOrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"designImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"colorName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeSpec\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stoneColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"minaColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedPriceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Once priced, an admin converts this into a real (debt-bearing) Order.\"},{\"name\":\"convertedOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[\"convertedOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[\"preOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"changes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Field-level diff, e.g. {\\\"status\\\": {\\\"old\\\": \\\"PLACED\\\", \\\"new\\\": \\\"ADMIN_APPROVED\\\"}}\"},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"LedgerEntry\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"currency\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerCurrency\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"direction\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerDirection\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sourceType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerSourceType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"amount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Always positive; direction determines the sign applied to the customer balance.\"},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\"},{\"name\":\"pricePerGramRialAtEntry\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Gold price/gram at conversion time, for REPAYMENT_CASH.\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"confirmed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pending entries don't count toward the cached customer balance until confirmed.\"},{\"name\":\"confirmedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[\"postedByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"labName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Instrument metadata from the legacy \\\"cash\\\" document form. Which fields are\\\\nfilled depends on sourceType: a melted-gold receipt carries lab/hallmark and\\\\nthe pre-normalization weight, a cheque carries the account and bank, and a\\\\ntransfer carries its destination.\\\\nLegacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\"},{\"name\":\"hallmark\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bankName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"transferTo\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"originalValue\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight as handed over, BEFORE karat normalization (legacy original_value).\"},{\"name\":\"priceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Rial amount for cash/cheque documents (legacy price).\"},{\"name\":\"receivedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"GoldPriceQuote\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pricePerGramRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"source\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quotedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\"},\"WalletBonus\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"grantedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Time-limited gold cashback bonus — replaces the legacy Rooyesh\\\\Wallet gold credit.\"},\"UserType\":{\"dbName\":\"user_type\",\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\\\\nrows keep their legacy identity rather than getting new cuids.\"},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"permissions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Permission\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Permission\":{\"dbName\":\"permission\",\"fields\":[{\"name\":\"rid\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Dotted permission id, e.g. \\\"order.list\\\", \\\"persons.list.client.omde\\\".\"},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"rid\",\"userTypeId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Comment\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CommentStatus\",\"default\":\"PENDING\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replyToId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `reply_to`: a staff reply threads under the comment it answers.\"},{\"name\":\"replyTo\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[\"replyToId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replies\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Setting\":{\"dbName\":null,\"fields\":[{\"name\":\"key\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"value\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Promotion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scope\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionScope\",\"default\":\"PRODUCT\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"usage\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionUsage\",\"default\":\"ONCE\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Percentage off, 0-100 (legacy discount_percent).\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"platform\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which storefront it shows on, mirroring Product.showType (legacy platform).\"},{\"name\":\"startsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"endsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Exactly one of these is populated, per `scope`.\"},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PromotionExclusion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"itemId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"type\",\"itemId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"type\",\"itemId\"]}],\"isGenerated\":false,\"documentation\":\"Legacy \\\"ignore\\\" table (views/offersIgnore) — specific products, categories,\\\\ncustomers or brands excluded from the automatic discount engine.\\\\nLegacy posts { type, item_id[] }: \\\"type\\\" reuses the promotion scope codes\\\\n(1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \\\"itemId\\\" is the excluded row.\"},\"BranchAllocation\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocatorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `allocator_user` — the admin who filed the allocation.\"},{\"name\":\"allocatorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[\"allocatorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"BranchAllocationItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocation\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[\"allocationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"weightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight snapshot at allocation time, so later catalog edits do not rewrite history.\"}],\"primaryKey\":null,\"uniqueFields\":[[\"allocationId\",\"productId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"allocationId\",\"productId\"]}],\"isGenerated\":false},\"SmsMessage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MessageAudience\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Comma-separated recipients for the SINGLE/MULTIPLE audiences.\"},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"How many numbers the send actually resolved to.\"},{\"name\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[\"sentByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Notification\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"MessageAudience\",\"default\":\"ALL_CUSTOMERS\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[\"sentByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"NotificationRecipient\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notificationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notification\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[\"notificationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"readAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"notificationId\",\"customerId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"notificationId\",\"customerId\"]}],\"isGenerated\":false,\"documentation\":\"Per-customer delivery + read state — legacy `GET notify/read/{id}`.\"},\"NewsletterSubscriber\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"email\"],[\"mobile\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"email\"]},{\"name\":null,\"fields\":[\"mobile\"]}],\"isGenerated\":false,\"documentation\":\"Legacy views/newsletters — the mailing-list signups collected by the site.\"},\"CustomerActivityLog\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"action\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\"},{\"name\":\"detail\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy views/statics — the customer activity log the \\\"آمار\\\" screen reads\\\\n(`log/list/customer`, `log/ago/{customerId}`).\"},\"UploadedFile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Public URL the stored file is served from.\"},{\"name\":\"originalName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mimeType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeBytes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"purpose\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form tag for what the file belongs to, e.g. 'product', 'category',\\\\n'customer.nationalId'. Kept loose so a new form needs no schema change.\"},{\"name\":\"uploadedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"FileUploader\",\"relationFromFields\":[\"uploadedByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerAvatars\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{\"AdminRole\":{\"values\":[{\"name\":\"SUPER_ADMIN\",\"dbName\":null},{\"name\":\"SYSTEM_APPROVER\",\"dbName\":null},{\"name\":\"SALES_EXPERT\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"ACCOUNTANT\",\"dbName\":null}],\"dbName\":null},\"CustomerKind\":{\"values\":[{\"name\":\"SALES_AGENT\",\"dbName\":null},{\"name\":\"APP_SHOPKEEPER\",\"dbName\":null},{\"name\":\"WALK_IN_SHOPKEEPER\",\"dbName\":null},{\"name\":\"BANKER\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Customer.type — what kind of wholesale customer this is. Values and\\\\nlabels taken verbatim from bulkCustomer.vue's userTypes list.\"},\"VerificationStep\":{\"values\":[{\"name\":\"UNVERIFIED\",\"dbName\":null},{\"name\":\"STEP_ONE_SUBMITTED\",\"dbName\":null},{\"name\":\"STEP_TWO_SUBMITTED\",\"dbName\":null},{\"name\":\"VERIFIED\",\"dbName\":null}],\"dbName\":null},\"OrderChannel\":{\"values\":[{\"name\":\"RETAIL\",\"dbName\":null},{\"name\":\"WHOLESALE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy kept retail and wholesale orders in two SEPARATE tables\\\\n(orders_orders vs orders). The redesigned schema has one Order model, so the\\\\ndistinction lives here instead.\"},\"OrderStatus\":{\"values\":[{\"name\":\"SUSPENDED\",\"dbName\":null},{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"SOURCING\",\"dbName\":null},{\"name\":\"PREPARING\",\"dbName\":null},{\"name\":\"DELIVERED_TO_AGENT\",\"dbName\":null},{\"name\":\"DELIVERED_TO_CUSTOMER\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"PreOrderStatus\":{\"values\":[{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"WORKSHOP_APPROVED\",\"dbName\":null},{\"name\":\"READY_TO_SHIP\",\"dbName\":null},{\"name\":\"DELIVERED\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"LedgerCurrency\":{\"values\":[{\"name\":\"GOLD_GRAM\",\"dbName\":null},{\"name\":\"RIAL\",\"dbName\":null}],\"dbName\":null},\"LedgerDirection\":{\"values\":[{\"name\":\"DEBIT\",\"dbName\":null},{\"name\":\"CREDIT\",\"dbName\":null}],\"dbName\":null},\"LedgerSourceType\":{\"values\":[{\"name\":\"ORDER_STOCK\",\"dbName\":null},{\"name\":\"ORDER_PRE_ORDER\",\"dbName\":null},{\"name\":\"REPAYMENT_MELTED_GOLD\",\"dbName\":null},{\"name\":\"REPAYMENT_TRANSFER\",\"dbName\":null},{\"name\":\"REPAYMENT_CHEQUE\",\"dbName\":null},{\"name\":\"REPAYMENT_CASH\",\"dbName\":null},{\"name\":\"WALLET_BONUS\",\"dbName\":null},{\"name\":\"ADJUSTMENT\",\"dbName\":null}],\"dbName\":null},\"CommentStatus\":{\"values\":[{\"name\":\"PENDING\",\"dbName\":null},{\"name\":\"APPROVED\",\"dbName\":null},{\"name\":\"REJECTED\",\"dbName\":null}],\"dbName\":null},\"PromotionScope\":{\"values\":[{\"name\":\"PRODUCT\",\"dbName\":null},{\"name\":\"CATEGORY\",\"dbName\":null},{\"name\":\"CUSTOMER\",\"dbName\":null},{\"name\":\"BRAND\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.type — what the discount is scoped to.\"},\"PromotionUsage\":{\"values\":[{\"name\":\"ONCE\",\"dbName\":null},{\"name\":\"UNTIL_END_DATE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.use_only — how often a customer may redeem it.\"},\"MessageAudience\":{\"values\":[{\"name\":\"SINGLE_NUMBER\",\"dbName\":null},{\"name\":\"MULTIPLE_NUMBERS\",\"dbName\":null},{\"name\":\"ALL_CUSTOMERS\",\"dbName\":null},{\"name\":\"WHOLESALE_CUSTOMERS\",\"dbName\":null},{\"name\":\"RETAIL_CUSTOMERS\",\"dbName\":null},{\"name\":\"SALES_AGENTS\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Who an SMS or notification was aimed at. Legacy's sms/create offered these\\\\naudiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\"}},\"types\":{}}") defineDmmfProperty(exports.Prisma, config.runtimeDataModel) config.engineWasm = undefined diff --git a/apps/api/release/vendor/.prisma/client/index-browser.js b/apps/api/release/vendor/.prisma/client/index-browser.js index 2152108..c9801a3 100644 --- a/apps/api/release/vendor/.prisma/client/index-browser.js +++ b/apps/api/release/vendor/.prisma/client/index-browser.js @@ -125,7 +125,9 @@ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ exports.Prisma.CityScalarFieldEnum = { id: 'id', name: 'name', - province: 'province' + province: 'province', + percent: 'percent', + percentAux: 'percentAux' }; exports.Prisma.AdminUserScalarFieldEnum = { @@ -134,6 +136,7 @@ exports.Prisma.AdminUserScalarFieldEnum = { mobile: 'mobile', passwordHash: 'passwordHash', role: 'role', + userTypeId: 'userTypeId', branchId: 'branchId', wagePercent: 'wagePercent', isActive: 'isActive', @@ -147,6 +150,13 @@ exports.Prisma.CustomerScalarFieldEnum = { nationalCode: 'nationalCode', passwordHash: 'passwordHash', cityId: 'cityId', + kind: 'kind', + phone: 'phone', + address: 'address', + storeName: 'storeName', + pasazhName: 'pasazhName', + zone: 'zone', + memberCode: 'memberCode', referredByAgentId: 'referredByAgentId', goldCreditLimitGrams: 'goldCreditLimitGrams', goldDebtGrams: 'goldDebtGrams', @@ -155,7 +165,10 @@ exports.Prisma.CustomerScalarFieldEnum = { nationalIdImageUrl: 'nationalIdImageUrl', businessLicenseUrl: 'businessLicenseUrl', shopImageUrl: 'shopImageUrl', + avatarFileId: 'avatarFileId', + canPlaceOrders: 'canPlaceOrders', isActive: 'isActive', + isArchived: 'isArchived', createdAt: 'createdAt', updatedAt: 'updatedAt' }; @@ -171,18 +184,29 @@ exports.Prisma.CustomerAddressScalarFieldEnum = { exports.Prisma.BranchScalarFieldEnum = { id: 'id', name: 'name', + address: 'address', + phone: 'phone', + isActive: 'isActive', cityId: 'cityId' }; exports.Prisma.WorkshopScalarFieldEnum = { id: 'id', name: 'name', + address: 'address', + phone: 'phone', + supervisorId: 'supervisorId', isActive: 'isActive' }; exports.Prisma.CategoryScalarFieldEnum = { id: 'id', title: 'title', + type: 'type', + imageUrl: 'imageUrl', + iconUrl: 'iconUrl', + metaTag: 'metaTag', + description: 'description', parentId: 'parentId' }; @@ -209,6 +233,8 @@ exports.Prisma.ProductScalarFieldEnum = { description: 'description', categoryId: 'categoryId', brandId: 'brandId', + productCode: 'productCode', + showType: 'showType', isActive: 'isActive', createdAt: 'createdAt' }; @@ -227,6 +253,8 @@ exports.Prisma.ProductVariantScalarFieldEnum = { sku: 'sku', rashWeightGrams: 'rashWeightGrams', defaultWagePercent: 'defaultWagePercent', + qty: 'qty', + isPreOrder: 'isPreOrder', isActive: 'isActive' }; @@ -235,6 +263,7 @@ exports.Prisma.OrderScalarFieldEnum = { orderNumber: 'orderNumber', customerId: 'customerId', branchId: 'branchId', + channel: 'channel', status: 'status', totalGoldWeightGrams: 'totalGoldWeightGrams', wageWeightGrams: 'wageWeightGrams', @@ -308,6 +337,14 @@ exports.Prisma.LedgerEntryScalarFieldEnum = { confirmed: 'confirmed', confirmedAt: 'confirmedAt', postedByAdminUserId: 'postedByAdminUserId', + labName: 'labName', + hallmark: 'hallmark', + accountName: 'accountName', + bankName: 'bankName', + transferTo: 'transferTo', + originalValue: 'originalValue', + priceRial: 'priceRial', + receivedAt: 'receivedAt', note: 'note', createdAt: 'createdAt' }; @@ -331,6 +368,128 @@ exports.Prisma.WalletBonusScalarFieldEnum = { isActive: 'isActive' }; +exports.Prisma.UserTypeScalarFieldEnum = { + id: 'id', + title: 'title', + isActive: 'isActive', + createdAt: 'createdAt' +}; + +exports.Prisma.PermissionScalarFieldEnum = { + rid: 'rid', + userTypeId: 'userTypeId' +}; + +exports.Prisma.CommentScalarFieldEnum = { + id: 'id', + productId: 'productId', + customerId: 'customerId', + body: 'body', + status: 'status', + replyToId: 'replyToId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.SettingScalarFieldEnum = { + key: 'key', + value: 'value', + updatedAt: 'updatedAt' +}; + +exports.Prisma.PromotionScalarFieldEnum = { + id: 'id', + title: 'title', + description: 'description', + scope: 'scope', + usage: 'usage', + discountPercent: 'discountPercent', + isActive: 'isActive', + platform: 'platform', + startsAt: 'startsAt', + endsAt: 'endsAt', + productId: 'productId', + categoryId: 'categoryId', + customerId: 'customerId', + brandId: 'brandId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.PromotionExclusionScalarFieldEnum = { + id: 'id', + type: 'type', + itemId: 'itemId', + createdAt: 'createdAt' +}; + +exports.Prisma.BranchAllocationScalarFieldEnum = { + id: 'id', + branchId: 'branchId', + allocatorAdminUserId: 'allocatorAdminUserId', + note: 'note', + createdAt: 'createdAt' +}; + +exports.Prisma.BranchAllocationItemScalarFieldEnum = { + id: 'id', + allocationId: 'allocationId', + productId: 'productId', + weightGrams: 'weightGrams' +}; + +exports.Prisma.SmsMessageScalarFieldEnum = { + id: 'id', + audience: 'audience', + recipients: 'recipients', + body: 'body', + sentCount: 'sentCount', + sentByAdminUserId: 'sentByAdminUserId', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationScalarFieldEnum = { + id: 'id', + title: 'title', + body: 'body', + audience: 'audience', + sentByAdminUserId: 'sentByAdminUserId', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationRecipientScalarFieldEnum = { + id: 'id', + notificationId: 'notificationId', + customerId: 'customerId', + readAt: 'readAt' +}; + +exports.Prisma.NewsletterSubscriberScalarFieldEnum = { + id: 'id', + email: 'email', + mobile: 'mobile', + createdAt: 'createdAt' +}; + +exports.Prisma.CustomerActivityLogScalarFieldEnum = { + id: 'id', + customerId: 'customerId', + action: 'action', + detail: 'detail', + createdAt: 'createdAt' +}; + +exports.Prisma.UploadedFileScalarFieldEnum = { + id: 'id', + url: 'url', + originalName: 'originalName', + mimeType: 'mimeType', + sizeBytes: 'sizeBytes', + purpose: 'purpose', + uploadedByAdminUserId: 'uploadedByAdminUserId', + createdAt: 'createdAt' +}; + exports.Prisma.SortOrder = { asc: 'asc', desc: 'desc' @@ -363,6 +522,14 @@ exports.AdminRole = exports.$Enums.AdminRole = { ACCOUNTANT: 'ACCOUNTANT' }; +exports.CustomerKind = exports.$Enums.CustomerKind = { + SALES_AGENT: 'SALES_AGENT', + APP_SHOPKEEPER: 'APP_SHOPKEEPER', + WALK_IN_SHOPKEEPER: 'WALK_IN_SHOPKEEPER', + BANKER: 'BANKER', + WORKSHOP_SUPERVISOR: 'WORKSHOP_SUPERVISOR' +}; + exports.VerificationStep = exports.$Enums.VerificationStep = { UNVERIFIED: 'UNVERIFIED', STEP_ONE_SUBMITTED: 'STEP_ONE_SUBMITTED', @@ -370,6 +537,11 @@ exports.VerificationStep = exports.$Enums.VerificationStep = { VERIFIED: 'VERIFIED' }; +exports.OrderChannel = exports.$Enums.OrderChannel = { + RETAIL: 'RETAIL', + WHOLESALE: 'WHOLESALE' +}; + exports.OrderStatus = exports.$Enums.OrderStatus = { SUSPENDED: 'SUSPENDED', PLACED: 'PLACED', @@ -411,6 +583,33 @@ exports.LedgerSourceType = exports.$Enums.LedgerSourceType = { ADJUSTMENT: 'ADJUSTMENT' }; +exports.CommentStatus = exports.$Enums.CommentStatus = { + PENDING: 'PENDING', + APPROVED: 'APPROVED', + REJECTED: 'REJECTED' +}; + +exports.PromotionScope = exports.$Enums.PromotionScope = { + PRODUCT: 'PRODUCT', + CATEGORY: 'CATEGORY', + CUSTOMER: 'CUSTOMER', + BRAND: 'BRAND' +}; + +exports.PromotionUsage = exports.$Enums.PromotionUsage = { + ONCE: 'ONCE', + UNTIL_END_DATE: 'UNTIL_END_DATE' +}; + +exports.MessageAudience = exports.$Enums.MessageAudience = { + SINGLE_NUMBER: 'SINGLE_NUMBER', + MULTIPLE_NUMBERS: 'MULTIPLE_NUMBERS', + ALL_CUSTOMERS: 'ALL_CUSTOMERS', + WHOLESALE_CUSTOMERS: 'WHOLESALE_CUSTOMERS', + RETAIL_CUSTOMERS: 'RETAIL_CUSTOMERS', + SALES_AGENTS: 'SALES_AGENTS' +}; + exports.Prisma.ModelName = { City: 'City', AdminUser: 'AdminUser', @@ -432,7 +631,21 @@ exports.Prisma.ModelName = { PreOrderStatusEvent: 'PreOrderStatusEvent', LedgerEntry: 'LedgerEntry', GoldPriceQuote: 'GoldPriceQuote', - WalletBonus: 'WalletBonus' + WalletBonus: 'WalletBonus', + UserType: 'UserType', + Permission: 'Permission', + Comment: 'Comment', + Setting: 'Setting', + Promotion: 'Promotion', + PromotionExclusion: 'PromotionExclusion', + BranchAllocation: 'BranchAllocation', + BranchAllocationItem: 'BranchAllocationItem', + SmsMessage: 'SmsMessage', + Notification: 'Notification', + NotificationRecipient: 'NotificationRecipient', + NewsletterSubscriber: 'NewsletterSubscriber', + CustomerActivityLog: 'CustomerActivityLog', + UploadedFile: 'UploadedFile' }; /** diff --git a/apps/api/release/vendor/.prisma/client/index.d.ts b/apps/api/release/vendor/.prisma/client/index.d.ts index 30e3f1c..4f5d20c 100644 --- a/apps/api/release/vendor/.prisma/client/index.d.ts +++ b/apps/api/release/vendor/.prisma/client/index.d.ts @@ -119,6 +119,80 @@ export type GoldPriceQuote = $Result.DefaultSelection<Prisma.$GoldPriceQuotePayl * Time-limited gold cashback bonus — replaces the legacy Rooyesh\Wallet gold credit. */ export type WalletBonus = $Result.DefaultSelection<Prisma.$WalletBonusPayload> +/** + * Model UserType + * + */ +export type UserType = $Result.DefaultSelection<Prisma.$UserTypePayload> +/** + * Model Permission + * + */ +export type Permission = $Result.DefaultSelection<Prisma.$PermissionPayload> +/** + * Model Comment + * + */ +export type Comment = $Result.DefaultSelection<Prisma.$CommentPayload> +/** + * Model Setting + * + */ +export type Setting = $Result.DefaultSelection<Prisma.$SettingPayload> +/** + * Model Promotion + * + */ +export type Promotion = $Result.DefaultSelection<Prisma.$PromotionPayload> +/** + * Model PromotionExclusion + * Legacy "ignore" table (views/offersIgnore) — specific products, categories, + * customers or brands excluded from the automatic discount engine. + * Legacy posts { type, item_id[] }: "type" reuses the promotion scope codes + * (1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and "itemId" is the excluded row. + */ +export type PromotionExclusion = $Result.DefaultSelection<Prisma.$PromotionExclusionPayload> +/** + * Model BranchAllocation + * + */ +export type BranchAllocation = $Result.DefaultSelection<Prisma.$BranchAllocationPayload> +/** + * Model BranchAllocationItem + * + */ +export type BranchAllocationItem = $Result.DefaultSelection<Prisma.$BranchAllocationItemPayload> +/** + * Model SmsMessage + * + */ +export type SmsMessage = $Result.DefaultSelection<Prisma.$SmsMessagePayload> +/** + * Model Notification + * + */ +export type Notification = $Result.DefaultSelection<Prisma.$NotificationPayload> +/** + * Model NotificationRecipient + * Per-customer delivery + read state — legacy `GET notify/read/{id}`. + */ +export type NotificationRecipient = $Result.DefaultSelection<Prisma.$NotificationRecipientPayload> +/** + * Model NewsletterSubscriber + * Legacy views/newsletters — the mailing-list signups collected by the site. + */ +export type NewsletterSubscriber = $Result.DefaultSelection<Prisma.$NewsletterSubscriberPayload> +/** + * Model CustomerActivityLog + * Legacy views/statics — the customer activity log the "آمار" screen reads + * (`log/list/customer`, `log/ago/{customerId}`). + */ +export type CustomerActivityLog = $Result.DefaultSelection<Prisma.$CustomerActivityLogPayload> +/** + * Model UploadedFile + * + */ +export type UploadedFile = $Result.DefaultSelection<Prisma.$UploadedFilePayload> /** * Enums @@ -135,6 +209,17 @@ export namespace $Enums { export type AdminRole = (typeof AdminRole)[keyof typeof AdminRole] +export const CustomerKind: { + SALES_AGENT: 'SALES_AGENT', + APP_SHOPKEEPER: 'APP_SHOPKEEPER', + WALK_IN_SHOPKEEPER: 'WALK_IN_SHOPKEEPER', + BANKER: 'BANKER', + WORKSHOP_SUPERVISOR: 'WORKSHOP_SUPERVISOR' +}; + +export type CustomerKind = (typeof CustomerKind)[keyof typeof CustomerKind] + + export const VerificationStep: { UNVERIFIED: 'UNVERIFIED', STEP_ONE_SUBMITTED: 'STEP_ONE_SUBMITTED', @@ -145,6 +230,14 @@ export const VerificationStep: { export type VerificationStep = (typeof VerificationStep)[keyof typeof VerificationStep] +export const OrderChannel: { + RETAIL: 'RETAIL', + WHOLESALE: 'WHOLESALE' +}; + +export type OrderChannel = (typeof OrderChannel)[keyof typeof OrderChannel] + + export const OrderStatus: { SUSPENDED: 'SUSPENDED', PLACED: 'PLACED', @@ -200,16 +293,63 @@ export const LedgerSourceType: { export type LedgerSourceType = (typeof LedgerSourceType)[keyof typeof LedgerSourceType] + +export const CommentStatus: { + PENDING: 'PENDING', + APPROVED: 'APPROVED', + REJECTED: 'REJECTED' +}; + +export type CommentStatus = (typeof CommentStatus)[keyof typeof CommentStatus] + + +export const PromotionScope: { + PRODUCT: 'PRODUCT', + CATEGORY: 'CATEGORY', + CUSTOMER: 'CUSTOMER', + BRAND: 'BRAND' +}; + +export type PromotionScope = (typeof PromotionScope)[keyof typeof PromotionScope] + + +export const PromotionUsage: { + ONCE: 'ONCE', + UNTIL_END_DATE: 'UNTIL_END_DATE' +}; + +export type PromotionUsage = (typeof PromotionUsage)[keyof typeof PromotionUsage] + + +export const MessageAudience: { + SINGLE_NUMBER: 'SINGLE_NUMBER', + MULTIPLE_NUMBERS: 'MULTIPLE_NUMBERS', + ALL_CUSTOMERS: 'ALL_CUSTOMERS', + WHOLESALE_CUSTOMERS: 'WHOLESALE_CUSTOMERS', + RETAIL_CUSTOMERS: 'RETAIL_CUSTOMERS', + SALES_AGENTS: 'SALES_AGENTS' +}; + +export type MessageAudience = (typeof MessageAudience)[keyof typeof MessageAudience] + } export type AdminRole = $Enums.AdminRole export const AdminRole: typeof $Enums.AdminRole +export type CustomerKind = $Enums.CustomerKind + +export const CustomerKind: typeof $Enums.CustomerKind + export type VerificationStep = $Enums.VerificationStep export const VerificationStep: typeof $Enums.VerificationStep +export type OrderChannel = $Enums.OrderChannel + +export const OrderChannel: typeof $Enums.OrderChannel + export type OrderStatus = $Enums.OrderStatus export const OrderStatus: typeof $Enums.OrderStatus @@ -230,6 +370,22 @@ export type LedgerSourceType = $Enums.LedgerSourceType export const LedgerSourceType: typeof $Enums.LedgerSourceType +export type CommentStatus = $Enums.CommentStatus + +export const CommentStatus: typeof $Enums.CommentStatus + +export type PromotionScope = $Enums.PromotionScope + +export const PromotionScope: typeof $Enums.PromotionScope + +export type PromotionUsage = $Enums.PromotionUsage + +export const PromotionUsage: typeof $Enums.PromotionUsage + +export type MessageAudience = $Enums.MessageAudience + +export const MessageAudience: typeof $Enums.MessageAudience + /** * ## Prisma Client ʲˢ * @@ -562,6 +718,146 @@ export class PrismaClient< * ``` */ get walletBonus(): Prisma.WalletBonusDelegate<ExtArgs>; + + /** + * `prisma.userType`: Exposes CRUD operations for the **UserType** model. + * Example usage: + * ```ts + * // Fetch zero or more UserTypes + * const userTypes = await prisma.userType.findMany() + * ``` + */ + get userType(): Prisma.UserTypeDelegate<ExtArgs>; + + /** + * `prisma.permission`: Exposes CRUD operations for the **Permission** model. + * Example usage: + * ```ts + * // Fetch zero or more Permissions + * const permissions = await prisma.permission.findMany() + * ``` + */ + get permission(): Prisma.PermissionDelegate<ExtArgs>; + + /** + * `prisma.comment`: Exposes CRUD operations for the **Comment** model. + * Example usage: + * ```ts + * // Fetch zero or more Comments + * const comments = await prisma.comment.findMany() + * ``` + */ + get comment(): Prisma.CommentDelegate<ExtArgs>; + + /** + * `prisma.setting`: Exposes CRUD operations for the **Setting** model. + * Example usage: + * ```ts + * // Fetch zero or more Settings + * const settings = await prisma.setting.findMany() + * ``` + */ + get setting(): Prisma.SettingDelegate<ExtArgs>; + + /** + * `prisma.promotion`: Exposes CRUD operations for the **Promotion** model. + * Example usage: + * ```ts + * // Fetch zero or more Promotions + * const promotions = await prisma.promotion.findMany() + * ``` + */ + get promotion(): Prisma.PromotionDelegate<ExtArgs>; + + /** + * `prisma.promotionExclusion`: Exposes CRUD operations for the **PromotionExclusion** model. + * Example usage: + * ```ts + * // Fetch zero or more PromotionExclusions + * const promotionExclusions = await prisma.promotionExclusion.findMany() + * ``` + */ + get promotionExclusion(): Prisma.PromotionExclusionDelegate<ExtArgs>; + + /** + * `prisma.branchAllocation`: Exposes CRUD operations for the **BranchAllocation** model. + * Example usage: + * ```ts + * // Fetch zero or more BranchAllocations + * const branchAllocations = await prisma.branchAllocation.findMany() + * ``` + */ + get branchAllocation(): Prisma.BranchAllocationDelegate<ExtArgs>; + + /** + * `prisma.branchAllocationItem`: Exposes CRUD operations for the **BranchAllocationItem** model. + * Example usage: + * ```ts + * // Fetch zero or more BranchAllocationItems + * const branchAllocationItems = await prisma.branchAllocationItem.findMany() + * ``` + */ + get branchAllocationItem(): Prisma.BranchAllocationItemDelegate<ExtArgs>; + + /** + * `prisma.smsMessage`: Exposes CRUD operations for the **SmsMessage** model. + * Example usage: + * ```ts + * // Fetch zero or more SmsMessages + * const smsMessages = await prisma.smsMessage.findMany() + * ``` + */ + get smsMessage(): Prisma.SmsMessageDelegate<ExtArgs>; + + /** + * `prisma.notification`: Exposes CRUD operations for the **Notification** model. + * Example usage: + * ```ts + * // Fetch zero or more Notifications + * const notifications = await prisma.notification.findMany() + * ``` + */ + get notification(): Prisma.NotificationDelegate<ExtArgs>; + + /** + * `prisma.notificationRecipient`: Exposes CRUD operations for the **NotificationRecipient** model. + * Example usage: + * ```ts + * // Fetch zero or more NotificationRecipients + * const notificationRecipients = await prisma.notificationRecipient.findMany() + * ``` + */ + get notificationRecipient(): Prisma.NotificationRecipientDelegate<ExtArgs>; + + /** + * `prisma.newsletterSubscriber`: Exposes CRUD operations for the **NewsletterSubscriber** model. + * Example usage: + * ```ts + * // Fetch zero or more NewsletterSubscribers + * const newsletterSubscribers = await prisma.newsletterSubscriber.findMany() + * ``` + */ + get newsletterSubscriber(): Prisma.NewsletterSubscriberDelegate<ExtArgs>; + + /** + * `prisma.customerActivityLog`: Exposes CRUD operations for the **CustomerActivityLog** model. + * Example usage: + * ```ts + * // Fetch zero or more CustomerActivityLogs + * const customerActivityLogs = await prisma.customerActivityLog.findMany() + * ``` + */ + get customerActivityLog(): Prisma.CustomerActivityLogDelegate<ExtArgs>; + + /** + * `prisma.uploadedFile`: Exposes CRUD operations for the **UploadedFile** model. + * Example usage: + * ```ts + * // Fetch zero or more UploadedFiles + * const uploadedFiles = await prisma.uploadedFile.findMany() + * ``` + */ + get uploadedFile(): Prisma.UploadedFileDelegate<ExtArgs>; } export namespace Prisma { @@ -1023,7 +1319,21 @@ export namespace Prisma { PreOrderStatusEvent: 'PreOrderStatusEvent', LedgerEntry: 'LedgerEntry', GoldPriceQuote: 'GoldPriceQuote', - WalletBonus: 'WalletBonus' + WalletBonus: 'WalletBonus', + UserType: 'UserType', + Permission: 'Permission', + Comment: 'Comment', + Setting: 'Setting', + Promotion: 'Promotion', + PromotionExclusion: 'PromotionExclusion', + BranchAllocation: 'BranchAllocation', + BranchAllocationItem: 'BranchAllocationItem', + SmsMessage: 'SmsMessage', + Notification: 'Notification', + NotificationRecipient: 'NotificationRecipient', + NewsletterSubscriber: 'NewsletterSubscriber', + CustomerActivityLog: 'CustomerActivityLog', + UploadedFile: 'UploadedFile' }; export type ModelName = (typeof ModelName)[keyof typeof ModelName] @@ -1039,7 +1349,7 @@ export namespace Prisma { export type TypeMap<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs, ClientOptions = {}> = { meta: { - modelProps: "city" | "adminUser" | "customer" | "customerAddress" | "branch" | "workshop" | "category" | "brand" | "collection" | "collectionProduct" | "product" | "productImage" | "productVariant" | "order" | "orderItem" | "orderStatusEvent" | "preOrder" | "preOrderStatusEvent" | "ledgerEntry" | "goldPriceQuote" | "walletBonus" + modelProps: "city" | "adminUser" | "customer" | "customerAddress" | "branch" | "workshop" | "category" | "brand" | "collection" | "collectionProduct" | "product" | "productImage" | "productVariant" | "order" | "orderItem" | "orderStatusEvent" | "preOrder" | "preOrderStatusEvent" | "ledgerEntry" | "goldPriceQuote" | "walletBonus" | "userType" | "permission" | "comment" | "setting" | "promotion" | "promotionExclusion" | "branchAllocation" | "branchAllocationItem" | "smsMessage" | "notification" | "notificationRecipient" | "newsletterSubscriber" | "customerActivityLog" | "uploadedFile" txIsolationLevel: Prisma.TransactionIsolationLevel } model: { @@ -2513,6 +2823,986 @@ export namespace Prisma { } } } + UserType: { + payload: Prisma.$UserTypePayload<ExtArgs> + fields: Prisma.UserTypeFieldRefs + operations: { + findUnique: { + args: Prisma.UserTypeFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UserTypePayload> | null + } + findUniqueOrThrow: { + args: Prisma.UserTypeFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UserTypePayload> + } + findFirst: { + args: Prisma.UserTypeFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UserTypePayload> | null + } + findFirstOrThrow: { + args: Prisma.UserTypeFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UserTypePayload> + } + findMany: { + args: Prisma.UserTypeFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UserTypePayload>[] + } + create: { + args: Prisma.UserTypeCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UserTypePayload> + } + createMany: { + args: Prisma.UserTypeCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.UserTypeCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UserTypePayload>[] + } + delete: { + args: Prisma.UserTypeDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UserTypePayload> + } + update: { + args: Prisma.UserTypeUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UserTypePayload> + } + deleteMany: { + args: Prisma.UserTypeDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.UserTypeUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.UserTypeUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UserTypePayload> + } + aggregate: { + args: Prisma.UserTypeAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateUserType> + } + groupBy: { + args: Prisma.UserTypeGroupByArgs<ExtArgs> + result: $Utils.Optional<UserTypeGroupByOutputType>[] + } + count: { + args: Prisma.UserTypeCountArgs<ExtArgs> + result: $Utils.Optional<UserTypeCountAggregateOutputType> | number + } + } + } + Permission: { + payload: Prisma.$PermissionPayload<ExtArgs> + fields: Prisma.PermissionFieldRefs + operations: { + findUnique: { + args: Prisma.PermissionFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PermissionPayload> | null + } + findUniqueOrThrow: { + args: Prisma.PermissionFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PermissionPayload> + } + findFirst: { + args: Prisma.PermissionFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PermissionPayload> | null + } + findFirstOrThrow: { + args: Prisma.PermissionFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PermissionPayload> + } + findMany: { + args: Prisma.PermissionFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PermissionPayload>[] + } + create: { + args: Prisma.PermissionCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PermissionPayload> + } + createMany: { + args: Prisma.PermissionCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.PermissionCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PermissionPayload>[] + } + delete: { + args: Prisma.PermissionDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PermissionPayload> + } + update: { + args: Prisma.PermissionUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PermissionPayload> + } + deleteMany: { + args: Prisma.PermissionDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.PermissionUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.PermissionUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PermissionPayload> + } + aggregate: { + args: Prisma.PermissionAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregatePermission> + } + groupBy: { + args: Prisma.PermissionGroupByArgs<ExtArgs> + result: $Utils.Optional<PermissionGroupByOutputType>[] + } + count: { + args: Prisma.PermissionCountArgs<ExtArgs> + result: $Utils.Optional<PermissionCountAggregateOutputType> | number + } + } + } + Comment: { + payload: Prisma.$CommentPayload<ExtArgs> + fields: Prisma.CommentFieldRefs + operations: { + findUnique: { + args: Prisma.CommentFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CommentPayload> | null + } + findUniqueOrThrow: { + args: Prisma.CommentFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CommentPayload> + } + findFirst: { + args: Prisma.CommentFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CommentPayload> | null + } + findFirstOrThrow: { + args: Prisma.CommentFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CommentPayload> + } + findMany: { + args: Prisma.CommentFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CommentPayload>[] + } + create: { + args: Prisma.CommentCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CommentPayload> + } + createMany: { + args: Prisma.CommentCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.CommentCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CommentPayload>[] + } + delete: { + args: Prisma.CommentDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CommentPayload> + } + update: { + args: Prisma.CommentUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CommentPayload> + } + deleteMany: { + args: Prisma.CommentDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.CommentUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.CommentUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CommentPayload> + } + aggregate: { + args: Prisma.CommentAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateComment> + } + groupBy: { + args: Prisma.CommentGroupByArgs<ExtArgs> + result: $Utils.Optional<CommentGroupByOutputType>[] + } + count: { + args: Prisma.CommentCountArgs<ExtArgs> + result: $Utils.Optional<CommentCountAggregateOutputType> | number + } + } + } + Setting: { + payload: Prisma.$SettingPayload<ExtArgs> + fields: Prisma.SettingFieldRefs + operations: { + findUnique: { + args: Prisma.SettingFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SettingPayload> | null + } + findUniqueOrThrow: { + args: Prisma.SettingFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SettingPayload> + } + findFirst: { + args: Prisma.SettingFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SettingPayload> | null + } + findFirstOrThrow: { + args: Prisma.SettingFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SettingPayload> + } + findMany: { + args: Prisma.SettingFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SettingPayload>[] + } + create: { + args: Prisma.SettingCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SettingPayload> + } + createMany: { + args: Prisma.SettingCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.SettingCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SettingPayload>[] + } + delete: { + args: Prisma.SettingDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SettingPayload> + } + update: { + args: Prisma.SettingUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SettingPayload> + } + deleteMany: { + args: Prisma.SettingDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.SettingUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.SettingUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SettingPayload> + } + aggregate: { + args: Prisma.SettingAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateSetting> + } + groupBy: { + args: Prisma.SettingGroupByArgs<ExtArgs> + result: $Utils.Optional<SettingGroupByOutputType>[] + } + count: { + args: Prisma.SettingCountArgs<ExtArgs> + result: $Utils.Optional<SettingCountAggregateOutputType> | number + } + } + } + Promotion: { + payload: Prisma.$PromotionPayload<ExtArgs> + fields: Prisma.PromotionFieldRefs + operations: { + findUnique: { + args: Prisma.PromotionFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionPayload> | null + } + findUniqueOrThrow: { + args: Prisma.PromotionFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionPayload> + } + findFirst: { + args: Prisma.PromotionFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionPayload> | null + } + findFirstOrThrow: { + args: Prisma.PromotionFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionPayload> + } + findMany: { + args: Prisma.PromotionFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionPayload>[] + } + create: { + args: Prisma.PromotionCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionPayload> + } + createMany: { + args: Prisma.PromotionCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.PromotionCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionPayload>[] + } + delete: { + args: Prisma.PromotionDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionPayload> + } + update: { + args: Prisma.PromotionUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionPayload> + } + deleteMany: { + args: Prisma.PromotionDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.PromotionUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.PromotionUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionPayload> + } + aggregate: { + args: Prisma.PromotionAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregatePromotion> + } + groupBy: { + args: Prisma.PromotionGroupByArgs<ExtArgs> + result: $Utils.Optional<PromotionGroupByOutputType>[] + } + count: { + args: Prisma.PromotionCountArgs<ExtArgs> + result: $Utils.Optional<PromotionCountAggregateOutputType> | number + } + } + } + PromotionExclusion: { + payload: Prisma.$PromotionExclusionPayload<ExtArgs> + fields: Prisma.PromotionExclusionFieldRefs + operations: { + findUnique: { + args: Prisma.PromotionExclusionFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionExclusionPayload> | null + } + findUniqueOrThrow: { + args: Prisma.PromotionExclusionFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionExclusionPayload> + } + findFirst: { + args: Prisma.PromotionExclusionFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionExclusionPayload> | null + } + findFirstOrThrow: { + args: Prisma.PromotionExclusionFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionExclusionPayload> + } + findMany: { + args: Prisma.PromotionExclusionFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionExclusionPayload>[] + } + create: { + args: Prisma.PromotionExclusionCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionExclusionPayload> + } + createMany: { + args: Prisma.PromotionExclusionCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.PromotionExclusionCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionExclusionPayload>[] + } + delete: { + args: Prisma.PromotionExclusionDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionExclusionPayload> + } + update: { + args: Prisma.PromotionExclusionUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionExclusionPayload> + } + deleteMany: { + args: Prisma.PromotionExclusionDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.PromotionExclusionUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.PromotionExclusionUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$PromotionExclusionPayload> + } + aggregate: { + args: Prisma.PromotionExclusionAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregatePromotionExclusion> + } + groupBy: { + args: Prisma.PromotionExclusionGroupByArgs<ExtArgs> + result: $Utils.Optional<PromotionExclusionGroupByOutputType>[] + } + count: { + args: Prisma.PromotionExclusionCountArgs<ExtArgs> + result: $Utils.Optional<PromotionExclusionCountAggregateOutputType> | number + } + } + } + BranchAllocation: { + payload: Prisma.$BranchAllocationPayload<ExtArgs> + fields: Prisma.BranchAllocationFieldRefs + operations: { + findUnique: { + args: Prisma.BranchAllocationFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationPayload> | null + } + findUniqueOrThrow: { + args: Prisma.BranchAllocationFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationPayload> + } + findFirst: { + args: Prisma.BranchAllocationFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationPayload> | null + } + findFirstOrThrow: { + args: Prisma.BranchAllocationFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationPayload> + } + findMany: { + args: Prisma.BranchAllocationFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationPayload>[] + } + create: { + args: Prisma.BranchAllocationCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationPayload> + } + createMany: { + args: Prisma.BranchAllocationCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.BranchAllocationCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationPayload>[] + } + delete: { + args: Prisma.BranchAllocationDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationPayload> + } + update: { + args: Prisma.BranchAllocationUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationPayload> + } + deleteMany: { + args: Prisma.BranchAllocationDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.BranchAllocationUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.BranchAllocationUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationPayload> + } + aggregate: { + args: Prisma.BranchAllocationAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateBranchAllocation> + } + groupBy: { + args: Prisma.BranchAllocationGroupByArgs<ExtArgs> + result: $Utils.Optional<BranchAllocationGroupByOutputType>[] + } + count: { + args: Prisma.BranchAllocationCountArgs<ExtArgs> + result: $Utils.Optional<BranchAllocationCountAggregateOutputType> | number + } + } + } + BranchAllocationItem: { + payload: Prisma.$BranchAllocationItemPayload<ExtArgs> + fields: Prisma.BranchAllocationItemFieldRefs + operations: { + findUnique: { + args: Prisma.BranchAllocationItemFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationItemPayload> | null + } + findUniqueOrThrow: { + args: Prisma.BranchAllocationItemFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationItemPayload> + } + findFirst: { + args: Prisma.BranchAllocationItemFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationItemPayload> | null + } + findFirstOrThrow: { + args: Prisma.BranchAllocationItemFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationItemPayload> + } + findMany: { + args: Prisma.BranchAllocationItemFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationItemPayload>[] + } + create: { + args: Prisma.BranchAllocationItemCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationItemPayload> + } + createMany: { + args: Prisma.BranchAllocationItemCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.BranchAllocationItemCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationItemPayload>[] + } + delete: { + args: Prisma.BranchAllocationItemDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationItemPayload> + } + update: { + args: Prisma.BranchAllocationItemUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationItemPayload> + } + deleteMany: { + args: Prisma.BranchAllocationItemDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.BranchAllocationItemUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.BranchAllocationItemUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$BranchAllocationItemPayload> + } + aggregate: { + args: Prisma.BranchAllocationItemAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateBranchAllocationItem> + } + groupBy: { + args: Prisma.BranchAllocationItemGroupByArgs<ExtArgs> + result: $Utils.Optional<BranchAllocationItemGroupByOutputType>[] + } + count: { + args: Prisma.BranchAllocationItemCountArgs<ExtArgs> + result: $Utils.Optional<BranchAllocationItemCountAggregateOutputType> | number + } + } + } + SmsMessage: { + payload: Prisma.$SmsMessagePayload<ExtArgs> + fields: Prisma.SmsMessageFieldRefs + operations: { + findUnique: { + args: Prisma.SmsMessageFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SmsMessagePayload> | null + } + findUniqueOrThrow: { + args: Prisma.SmsMessageFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SmsMessagePayload> + } + findFirst: { + args: Prisma.SmsMessageFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SmsMessagePayload> | null + } + findFirstOrThrow: { + args: Prisma.SmsMessageFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SmsMessagePayload> + } + findMany: { + args: Prisma.SmsMessageFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SmsMessagePayload>[] + } + create: { + args: Prisma.SmsMessageCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SmsMessagePayload> + } + createMany: { + args: Prisma.SmsMessageCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.SmsMessageCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SmsMessagePayload>[] + } + delete: { + args: Prisma.SmsMessageDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SmsMessagePayload> + } + update: { + args: Prisma.SmsMessageUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SmsMessagePayload> + } + deleteMany: { + args: Prisma.SmsMessageDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.SmsMessageUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.SmsMessageUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$SmsMessagePayload> + } + aggregate: { + args: Prisma.SmsMessageAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateSmsMessage> + } + groupBy: { + args: Prisma.SmsMessageGroupByArgs<ExtArgs> + result: $Utils.Optional<SmsMessageGroupByOutputType>[] + } + count: { + args: Prisma.SmsMessageCountArgs<ExtArgs> + result: $Utils.Optional<SmsMessageCountAggregateOutputType> | number + } + } + } + Notification: { + payload: Prisma.$NotificationPayload<ExtArgs> + fields: Prisma.NotificationFieldRefs + operations: { + findUnique: { + args: Prisma.NotificationFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationPayload> | null + } + findUniqueOrThrow: { + args: Prisma.NotificationFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationPayload> + } + findFirst: { + args: Prisma.NotificationFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationPayload> | null + } + findFirstOrThrow: { + args: Prisma.NotificationFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationPayload> + } + findMany: { + args: Prisma.NotificationFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationPayload>[] + } + create: { + args: Prisma.NotificationCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationPayload> + } + createMany: { + args: Prisma.NotificationCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.NotificationCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationPayload>[] + } + delete: { + args: Prisma.NotificationDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationPayload> + } + update: { + args: Prisma.NotificationUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationPayload> + } + deleteMany: { + args: Prisma.NotificationDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.NotificationUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.NotificationUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationPayload> + } + aggregate: { + args: Prisma.NotificationAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateNotification> + } + groupBy: { + args: Prisma.NotificationGroupByArgs<ExtArgs> + result: $Utils.Optional<NotificationGroupByOutputType>[] + } + count: { + args: Prisma.NotificationCountArgs<ExtArgs> + result: $Utils.Optional<NotificationCountAggregateOutputType> | number + } + } + } + NotificationRecipient: { + payload: Prisma.$NotificationRecipientPayload<ExtArgs> + fields: Prisma.NotificationRecipientFieldRefs + operations: { + findUnique: { + args: Prisma.NotificationRecipientFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationRecipientPayload> | null + } + findUniqueOrThrow: { + args: Prisma.NotificationRecipientFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationRecipientPayload> + } + findFirst: { + args: Prisma.NotificationRecipientFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationRecipientPayload> | null + } + findFirstOrThrow: { + args: Prisma.NotificationRecipientFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationRecipientPayload> + } + findMany: { + args: Prisma.NotificationRecipientFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationRecipientPayload>[] + } + create: { + args: Prisma.NotificationRecipientCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationRecipientPayload> + } + createMany: { + args: Prisma.NotificationRecipientCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.NotificationRecipientCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationRecipientPayload>[] + } + delete: { + args: Prisma.NotificationRecipientDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationRecipientPayload> + } + update: { + args: Prisma.NotificationRecipientUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationRecipientPayload> + } + deleteMany: { + args: Prisma.NotificationRecipientDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.NotificationRecipientUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.NotificationRecipientUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NotificationRecipientPayload> + } + aggregate: { + args: Prisma.NotificationRecipientAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateNotificationRecipient> + } + groupBy: { + args: Prisma.NotificationRecipientGroupByArgs<ExtArgs> + result: $Utils.Optional<NotificationRecipientGroupByOutputType>[] + } + count: { + args: Prisma.NotificationRecipientCountArgs<ExtArgs> + result: $Utils.Optional<NotificationRecipientCountAggregateOutputType> | number + } + } + } + NewsletterSubscriber: { + payload: Prisma.$NewsletterSubscriberPayload<ExtArgs> + fields: Prisma.NewsletterSubscriberFieldRefs + operations: { + findUnique: { + args: Prisma.NewsletterSubscriberFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NewsletterSubscriberPayload> | null + } + findUniqueOrThrow: { + args: Prisma.NewsletterSubscriberFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NewsletterSubscriberPayload> + } + findFirst: { + args: Prisma.NewsletterSubscriberFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NewsletterSubscriberPayload> | null + } + findFirstOrThrow: { + args: Prisma.NewsletterSubscriberFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NewsletterSubscriberPayload> + } + findMany: { + args: Prisma.NewsletterSubscriberFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NewsletterSubscriberPayload>[] + } + create: { + args: Prisma.NewsletterSubscriberCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NewsletterSubscriberPayload> + } + createMany: { + args: Prisma.NewsletterSubscriberCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.NewsletterSubscriberCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NewsletterSubscriberPayload>[] + } + delete: { + args: Prisma.NewsletterSubscriberDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NewsletterSubscriberPayload> + } + update: { + args: Prisma.NewsletterSubscriberUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NewsletterSubscriberPayload> + } + deleteMany: { + args: Prisma.NewsletterSubscriberDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.NewsletterSubscriberUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.NewsletterSubscriberUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$NewsletterSubscriberPayload> + } + aggregate: { + args: Prisma.NewsletterSubscriberAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateNewsletterSubscriber> + } + groupBy: { + args: Prisma.NewsletterSubscriberGroupByArgs<ExtArgs> + result: $Utils.Optional<NewsletterSubscriberGroupByOutputType>[] + } + count: { + args: Prisma.NewsletterSubscriberCountArgs<ExtArgs> + result: $Utils.Optional<NewsletterSubscriberCountAggregateOutputType> | number + } + } + } + CustomerActivityLog: { + payload: Prisma.$CustomerActivityLogPayload<ExtArgs> + fields: Prisma.CustomerActivityLogFieldRefs + operations: { + findUnique: { + args: Prisma.CustomerActivityLogFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CustomerActivityLogPayload> | null + } + findUniqueOrThrow: { + args: Prisma.CustomerActivityLogFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CustomerActivityLogPayload> + } + findFirst: { + args: Prisma.CustomerActivityLogFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CustomerActivityLogPayload> | null + } + findFirstOrThrow: { + args: Prisma.CustomerActivityLogFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CustomerActivityLogPayload> + } + findMany: { + args: Prisma.CustomerActivityLogFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CustomerActivityLogPayload>[] + } + create: { + args: Prisma.CustomerActivityLogCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CustomerActivityLogPayload> + } + createMany: { + args: Prisma.CustomerActivityLogCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.CustomerActivityLogCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CustomerActivityLogPayload>[] + } + delete: { + args: Prisma.CustomerActivityLogDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CustomerActivityLogPayload> + } + update: { + args: Prisma.CustomerActivityLogUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CustomerActivityLogPayload> + } + deleteMany: { + args: Prisma.CustomerActivityLogDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.CustomerActivityLogUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.CustomerActivityLogUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$CustomerActivityLogPayload> + } + aggregate: { + args: Prisma.CustomerActivityLogAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateCustomerActivityLog> + } + groupBy: { + args: Prisma.CustomerActivityLogGroupByArgs<ExtArgs> + result: $Utils.Optional<CustomerActivityLogGroupByOutputType>[] + } + count: { + args: Prisma.CustomerActivityLogCountArgs<ExtArgs> + result: $Utils.Optional<CustomerActivityLogCountAggregateOutputType> | number + } + } + } + UploadedFile: { + payload: Prisma.$UploadedFilePayload<ExtArgs> + fields: Prisma.UploadedFileFieldRefs + operations: { + findUnique: { + args: Prisma.UploadedFileFindUniqueArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UploadedFilePayload> | null + } + findUniqueOrThrow: { + args: Prisma.UploadedFileFindUniqueOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UploadedFilePayload> + } + findFirst: { + args: Prisma.UploadedFileFindFirstArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UploadedFilePayload> | null + } + findFirstOrThrow: { + args: Prisma.UploadedFileFindFirstOrThrowArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UploadedFilePayload> + } + findMany: { + args: Prisma.UploadedFileFindManyArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UploadedFilePayload>[] + } + create: { + args: Prisma.UploadedFileCreateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UploadedFilePayload> + } + createMany: { + args: Prisma.UploadedFileCreateManyArgs<ExtArgs> + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.UploadedFileCreateManyAndReturnArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UploadedFilePayload>[] + } + delete: { + args: Prisma.UploadedFileDeleteArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UploadedFilePayload> + } + update: { + args: Prisma.UploadedFileUpdateArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UploadedFilePayload> + } + deleteMany: { + args: Prisma.UploadedFileDeleteManyArgs<ExtArgs> + result: BatchPayload + } + updateMany: { + args: Prisma.UploadedFileUpdateManyArgs<ExtArgs> + result: BatchPayload + } + upsert: { + args: Prisma.UploadedFileUpsertArgs<ExtArgs> + result: $Utils.PayloadToResult<Prisma.$UploadedFilePayload> + } + aggregate: { + args: Prisma.UploadedFileAggregateArgs<ExtArgs> + result: $Utils.Optional<AggregateUploadedFile> + } + groupBy: { + args: Prisma.UploadedFileGroupByArgs<ExtArgs> + result: $Utils.Optional<UploadedFileGroupByOutputType>[] + } + count: { + args: Prisma.UploadedFileCountArgs<ExtArgs> + result: $Utils.Optional<UploadedFileCountAggregateOutputType> | number + } + } + } } } & { other: { @@ -2733,16 +4023,26 @@ export namespace Prisma { export type AdminUserCountOutputType = { referredCustomers: number + supervisedWorkshops: number + branchAllocations: number postedLedgerEntries: number orderStatusEvents: number preOrderStatusEvents: number + sentSmsMessages: number + sentNotifications: number + uploadedFiles: number } export type AdminUserCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { referredCustomers?: boolean | AdminUserCountOutputTypeCountReferredCustomersArgs + supervisedWorkshops?: boolean | AdminUserCountOutputTypeCountSupervisedWorkshopsArgs + branchAllocations?: boolean | AdminUserCountOutputTypeCountBranchAllocationsArgs postedLedgerEntries?: boolean | AdminUserCountOutputTypeCountPostedLedgerEntriesArgs orderStatusEvents?: boolean | AdminUserCountOutputTypeCountOrderStatusEventsArgs preOrderStatusEvents?: boolean | AdminUserCountOutputTypeCountPreOrderStatusEventsArgs + sentSmsMessages?: boolean | AdminUserCountOutputTypeCountSentSmsMessagesArgs + sentNotifications?: boolean | AdminUserCountOutputTypeCountSentNotificationsArgs + uploadedFiles?: boolean | AdminUserCountOutputTypeCountUploadedFilesArgs } // Custom InputTypes @@ -2763,6 +4063,20 @@ export namespace Prisma { where?: CustomerWhereInput } + /** + * AdminUserCountOutputType without action + */ + export type AdminUserCountOutputTypeCountSupervisedWorkshopsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: WorkshopWhereInput + } + + /** + * AdminUserCountOutputType without action + */ + export type AdminUserCountOutputTypeCountBranchAllocationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: BranchAllocationWhereInput + } + /** * AdminUserCountOutputType without action */ @@ -2784,6 +4098,27 @@ export namespace Prisma { where?: PreOrderStatusEventWhereInput } + /** + * AdminUserCountOutputType without action + */ + export type AdminUserCountOutputTypeCountSentSmsMessagesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: SmsMessageWhereInput + } + + /** + * AdminUserCountOutputType without action + */ + export type AdminUserCountOutputTypeCountSentNotificationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: NotificationWhereInput + } + + /** + * AdminUserCountOutputType without action + */ + export type AdminUserCountOutputTypeCountUploadedFilesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: UploadedFileWhereInput + } + /** * Count Type CustomerCountOutputType @@ -2795,6 +4130,10 @@ export namespace Prisma { preOrders: number ledgerEntries: number walletBonuses: number + comments: number + promotions: number + notifications: number + activityLogs: number } export type CustomerCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { @@ -2803,6 +4142,10 @@ export namespace Prisma { preOrders?: boolean | CustomerCountOutputTypeCountPreOrdersArgs ledgerEntries?: boolean | CustomerCountOutputTypeCountLedgerEntriesArgs walletBonuses?: boolean | CustomerCountOutputTypeCountWalletBonusesArgs + comments?: boolean | CustomerCountOutputTypeCountCommentsArgs + promotions?: boolean | CustomerCountOutputTypeCountPromotionsArgs + notifications?: boolean | CustomerCountOutputTypeCountNotificationsArgs + activityLogs?: boolean | CustomerCountOutputTypeCountActivityLogsArgs } // Custom InputTypes @@ -2851,6 +4194,34 @@ export namespace Prisma { where?: WalletBonusWhereInput } + /** + * CustomerCountOutputType without action + */ + export type CustomerCountOutputTypeCountCommentsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: CommentWhereInput + } + + /** + * CustomerCountOutputType without action + */ + export type CustomerCountOutputTypeCountPromotionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: PromotionWhereInput + } + + /** + * CustomerCountOutputType without action + */ + export type CustomerCountOutputTypeCountNotificationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: NotificationRecipientWhereInput + } + + /** + * CustomerCountOutputType without action + */ + export type CustomerCountOutputTypeCountActivityLogsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: CustomerActivityLogWhereInput + } + /** * Count Type BranchCountOutputType @@ -2859,11 +4230,13 @@ export namespace Prisma { export type BranchCountOutputType = { adminUsers: number orders: number + allocations: number } export type BranchCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { adminUsers?: boolean | BranchCountOutputTypeCountAdminUsersArgs orders?: boolean | BranchCountOutputTypeCountOrdersArgs + allocations?: boolean | BranchCountOutputTypeCountAllocationsArgs } // Custom InputTypes @@ -2891,6 +4264,13 @@ export namespace Prisma { where?: OrderWhereInput } + /** + * BranchCountOutputType without action + */ + export type BranchCountOutputTypeCountAllocationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: BranchAllocationWhereInput + } + /** * Count Type WorkshopCountOutputType @@ -2930,11 +4310,13 @@ export namespace Prisma { export type CategoryCountOutputType = { children: number products: number + promotions: number } export type CategoryCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { children?: boolean | CategoryCountOutputTypeCountChildrenArgs products?: boolean | CategoryCountOutputTypeCountProductsArgs + promotions?: boolean | CategoryCountOutputTypeCountPromotionsArgs } // Custom InputTypes @@ -2962,6 +4344,13 @@ export namespace Prisma { where?: ProductWhereInput } + /** + * CategoryCountOutputType without action + */ + export type CategoryCountOutputTypeCountPromotionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: PromotionWhereInput + } + /** * Count Type BrandCountOutputType @@ -2969,10 +4358,12 @@ export namespace Prisma { export type BrandCountOutputType = { products: number + promotions: number } export type BrandCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { products?: boolean | BrandCountOutputTypeCountProductsArgs + promotions?: boolean | BrandCountOutputTypeCountPromotionsArgs } // Custom InputTypes @@ -2993,6 +4384,13 @@ export namespace Prisma { where?: ProductWhereInput } + /** + * BrandCountOutputType without action + */ + export type BrandCountOutputTypeCountPromotionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: PromotionWhereInput + } + /** * Count Type CollectionCountOutputType @@ -3033,12 +4431,18 @@ export namespace Prisma { variants: number images: number collections: number + comments: number + promotions: number + allocationItems: number } export type ProductCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { variants?: boolean | ProductCountOutputTypeCountVariantsArgs images?: boolean | ProductCountOutputTypeCountImagesArgs collections?: boolean | ProductCountOutputTypeCountCollectionsArgs + comments?: boolean | ProductCountOutputTypeCountCommentsArgs + promotions?: boolean | ProductCountOutputTypeCountPromotionsArgs + allocationItems?: boolean | ProductCountOutputTypeCountAllocationItemsArgs } // Custom InputTypes @@ -3073,6 +4477,27 @@ export namespace Prisma { where?: CollectionProductWhereInput } + /** + * ProductCountOutputType without action + */ + export type ProductCountOutputTypeCountCommentsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: CommentWhereInput + } + + /** + * ProductCountOutputType without action + */ + export type ProductCountOutputTypeCountPromotionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: PromotionWhereInput + } + + /** + * ProductCountOutputType without action + */ + export type ProductCountOutputTypeCountAllocationItemsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: BranchAllocationItemWhereInput + } + /** * Count Type ProductVariantCountOutputType @@ -3185,6 +4610,170 @@ export namespace Prisma { } + /** + * Count Type UserTypeCountOutputType + */ + + export type UserTypeCountOutputType = { + permissions: number + adminUsers: number + } + + export type UserTypeCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + permissions?: boolean | UserTypeCountOutputTypeCountPermissionsArgs + adminUsers?: boolean | UserTypeCountOutputTypeCountAdminUsersArgs + } + + // Custom InputTypes + /** + * UserTypeCountOutputType without action + */ + export type UserTypeCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserTypeCountOutputType + */ + select?: UserTypeCountOutputTypeSelect<ExtArgs> | null + } + + /** + * UserTypeCountOutputType without action + */ + export type UserTypeCountOutputTypeCountPermissionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: PermissionWhereInput + } + + /** + * UserTypeCountOutputType without action + */ + export type UserTypeCountOutputTypeCountAdminUsersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: AdminUserWhereInput + } + + + /** + * Count Type CommentCountOutputType + */ + + export type CommentCountOutputType = { + replies: number + } + + export type CommentCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + replies?: boolean | CommentCountOutputTypeCountRepliesArgs + } + + // Custom InputTypes + /** + * CommentCountOutputType without action + */ + export type CommentCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CommentCountOutputType + */ + select?: CommentCountOutputTypeSelect<ExtArgs> | null + } + + /** + * CommentCountOutputType without action + */ + export type CommentCountOutputTypeCountRepliesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: CommentWhereInput + } + + + /** + * Count Type BranchAllocationCountOutputType + */ + + export type BranchAllocationCountOutputType = { + items: number + } + + export type BranchAllocationCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + items?: boolean | BranchAllocationCountOutputTypeCountItemsArgs + } + + // Custom InputTypes + /** + * BranchAllocationCountOutputType without action + */ + export type BranchAllocationCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationCountOutputType + */ + select?: BranchAllocationCountOutputTypeSelect<ExtArgs> | null + } + + /** + * BranchAllocationCountOutputType without action + */ + export type BranchAllocationCountOutputTypeCountItemsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: BranchAllocationItemWhereInput + } + + + /** + * Count Type NotificationCountOutputType + */ + + export type NotificationCountOutputType = { + recipients: number + } + + export type NotificationCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + recipients?: boolean | NotificationCountOutputTypeCountRecipientsArgs + } + + // Custom InputTypes + /** + * NotificationCountOutputType without action + */ + export type NotificationCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationCountOutputType + */ + select?: NotificationCountOutputTypeSelect<ExtArgs> | null + } + + /** + * NotificationCountOutputType without action + */ + export type NotificationCountOutputTypeCountRecipientsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: NotificationRecipientWhereInput + } + + + /** + * Count Type UploadedFileCountOutputType + */ + + export type UploadedFileCountOutputType = { + customerAvatars: number + } + + export type UploadedFileCountOutputTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + customerAvatars?: boolean | UploadedFileCountOutputTypeCountCustomerAvatarsArgs + } + + // Custom InputTypes + /** + * UploadedFileCountOutputType without action + */ + export type UploadedFileCountOutputTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFileCountOutputType + */ + select?: UploadedFileCountOutputTypeSelect<ExtArgs> | null + } + + /** + * UploadedFileCountOutputType without action + */ + export type UploadedFileCountOutputTypeCountCustomerAvatarsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: CustomerWhereInput + } + + /** * Models */ @@ -3195,46 +4784,80 @@ export namespace Prisma { export type AggregateCity = { _count: CityCountAggregateOutputType | null + _avg: CityAvgAggregateOutputType | null + _sum: CitySumAggregateOutputType | null _min: CityMinAggregateOutputType | null _max: CityMaxAggregateOutputType | null } + export type CityAvgAggregateOutputType = { + percent: Decimal | null + percentAux: Decimal | null + } + + export type CitySumAggregateOutputType = { + percent: Decimal | null + percentAux: Decimal | null + } + export type CityMinAggregateOutputType = { id: string | null name: string | null province: string | null + percent: Decimal | null + percentAux: Decimal | null } export type CityMaxAggregateOutputType = { id: string | null name: string | null province: string | null + percent: Decimal | null + percentAux: Decimal | null } export type CityCountAggregateOutputType = { id: number name: number province: number + percent: number + percentAux: number _all: number } + export type CityAvgAggregateInputType = { + percent?: true + percentAux?: true + } + + export type CitySumAggregateInputType = { + percent?: true + percentAux?: true + } + export type CityMinAggregateInputType = { id?: true name?: true province?: true + percent?: true + percentAux?: true } export type CityMaxAggregateInputType = { id?: true name?: true province?: true + percent?: true + percentAux?: true } export type CityCountAggregateInputType = { id?: true name?: true province?: true + percent?: true + percentAux?: true _all?: true } @@ -3273,6 +4896,18 @@ export namespace Prisma { * Count returned Cities **/ _count?: true | CityCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: CityAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: CitySumAggregateInputType /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * @@ -3306,6 +4941,8 @@ export namespace Prisma { take?: number skip?: number _count?: CityCountAggregateInputType | true + _avg?: CityAvgAggregateInputType + _sum?: CitySumAggregateInputType _min?: CityMinAggregateInputType _max?: CityMaxAggregateInputType } @@ -3314,7 +4951,11 @@ export namespace Prisma { id: string name: string province: string | null + percent: Decimal | null + percentAux: Decimal | null _count: CityCountAggregateOutputType | null + _avg: CityAvgAggregateOutputType | null + _sum: CitySumAggregateOutputType | null _min: CityMinAggregateOutputType | null _max: CityMaxAggregateOutputType | null } @@ -3337,6 +4978,8 @@ export namespace Prisma { id?: boolean name?: boolean province?: boolean + percent?: boolean + percentAux?: boolean customers?: boolean | City$customersArgs<ExtArgs> addresses?: boolean | City$addressesArgs<ExtArgs> branches?: boolean | City$branchesArgs<ExtArgs> @@ -3348,12 +4991,16 @@ export namespace Prisma { id?: boolean name?: boolean province?: boolean + percent?: boolean + percentAux?: boolean }, ExtArgs["result"]["city"]> export type CitySelectScalar = { id?: boolean name?: boolean province?: boolean + percent?: boolean + percentAux?: boolean } export type CityInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { @@ -3377,6 +5024,12 @@ export namespace Prisma { id: string name: string province: string | null + /** + * Legacy cities.percent / percent_aux — per-city wage surcharges the city + * screen edits through GET cities/get-percent/{id} and get-percent-aux/{id}. + */ + percent: Prisma.Decimal | null + percentAux: Prisma.Decimal | null }, ExtArgs["result"]["city"]> composites: {} } @@ -3777,6 +5430,8 @@ export namespace Prisma { readonly id: FieldRef<"City", 'String'> readonly name: FieldRef<"City", 'String'> readonly province: FieldRef<"City", 'String'> + readonly percent: FieldRef<"City", 'Decimal'> + readonly percentAux: FieldRef<"City", 'Decimal'> } @@ -4198,10 +5853,12 @@ export namespace Prisma { } export type AdminUserAvgAggregateOutputType = { + userTypeId: number | null wagePercent: Decimal | null } export type AdminUserSumAggregateOutputType = { + userTypeId: number | null wagePercent: Decimal | null } @@ -4211,6 +5868,7 @@ export namespace Prisma { mobile: string | null passwordHash: string | null role: $Enums.AdminRole | null + userTypeId: number | null branchId: string | null wagePercent: Decimal | null isActive: boolean | null @@ -4223,6 +5881,7 @@ export namespace Prisma { mobile: string | null passwordHash: string | null role: $Enums.AdminRole | null + userTypeId: number | null branchId: string | null wagePercent: Decimal | null isActive: boolean | null @@ -4235,6 +5894,7 @@ export namespace Prisma { mobile: number passwordHash: number role: number + userTypeId: number branchId: number wagePercent: number isActive: number @@ -4244,10 +5904,12 @@ export namespace Prisma { export type AdminUserAvgAggregateInputType = { + userTypeId?: true wagePercent?: true } export type AdminUserSumAggregateInputType = { + userTypeId?: true wagePercent?: true } @@ -4257,6 +5919,7 @@ export namespace Prisma { mobile?: true passwordHash?: true role?: true + userTypeId?: true branchId?: true wagePercent?: true isActive?: true @@ -4269,6 +5932,7 @@ export namespace Prisma { mobile?: true passwordHash?: true role?: true + userTypeId?: true branchId?: true wagePercent?: true isActive?: true @@ -4281,6 +5945,7 @@ export namespace Prisma { mobile?: true passwordHash?: true role?: true + userTypeId?: true branchId?: true wagePercent?: true isActive?: true @@ -4380,6 +6045,7 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole + userTypeId: number | null branchId: string | null wagePercent: Decimal | null isActive: boolean @@ -4411,15 +6077,22 @@ export namespace Prisma { mobile?: boolean passwordHash?: boolean role?: boolean + userTypeId?: boolean branchId?: boolean wagePercent?: boolean isActive?: boolean createdAt?: boolean + userType?: boolean | AdminUser$userTypeArgs<ExtArgs> branch?: boolean | AdminUser$branchArgs<ExtArgs> referredCustomers?: boolean | AdminUser$referredCustomersArgs<ExtArgs> + supervisedWorkshops?: boolean | AdminUser$supervisedWorkshopsArgs<ExtArgs> + branchAllocations?: boolean | AdminUser$branchAllocationsArgs<ExtArgs> postedLedgerEntries?: boolean | AdminUser$postedLedgerEntriesArgs<ExtArgs> orderStatusEvents?: boolean | AdminUser$orderStatusEventsArgs<ExtArgs> preOrderStatusEvents?: boolean | AdminUser$preOrderStatusEventsArgs<ExtArgs> + sentSmsMessages?: boolean | AdminUser$sentSmsMessagesArgs<ExtArgs> + sentNotifications?: boolean | AdminUser$sentNotificationsArgs<ExtArgs> + uploadedFiles?: boolean | AdminUser$uploadedFilesArgs<ExtArgs> _count?: boolean | AdminUserCountOutputTypeDefaultArgs<ExtArgs> }, ExtArgs["result"]["adminUser"]> @@ -4429,10 +6102,12 @@ export namespace Prisma { mobile?: boolean passwordHash?: boolean role?: boolean + userTypeId?: boolean branchId?: boolean wagePercent?: boolean isActive?: boolean createdAt?: boolean + userType?: boolean | AdminUser$userTypeArgs<ExtArgs> branch?: boolean | AdminUser$branchArgs<ExtArgs> }, ExtArgs["result"]["adminUser"]> @@ -4442,6 +6117,7 @@ export namespace Prisma { mobile?: boolean passwordHash?: boolean role?: boolean + userTypeId?: boolean branchId?: boolean wagePercent?: boolean isActive?: boolean @@ -4449,25 +6125,38 @@ export namespace Prisma { } export type AdminUserInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + userType?: boolean | AdminUser$userTypeArgs<ExtArgs> branch?: boolean | AdminUser$branchArgs<ExtArgs> referredCustomers?: boolean | AdminUser$referredCustomersArgs<ExtArgs> + supervisedWorkshops?: boolean | AdminUser$supervisedWorkshopsArgs<ExtArgs> + branchAllocations?: boolean | AdminUser$branchAllocationsArgs<ExtArgs> postedLedgerEntries?: boolean | AdminUser$postedLedgerEntriesArgs<ExtArgs> orderStatusEvents?: boolean | AdminUser$orderStatusEventsArgs<ExtArgs> preOrderStatusEvents?: boolean | AdminUser$preOrderStatusEventsArgs<ExtArgs> + sentSmsMessages?: boolean | AdminUser$sentSmsMessagesArgs<ExtArgs> + sentNotifications?: boolean | AdminUser$sentNotificationsArgs<ExtArgs> + uploadedFiles?: boolean | AdminUser$uploadedFilesArgs<ExtArgs> _count?: boolean | AdminUserCountOutputTypeDefaultArgs<ExtArgs> } export type AdminUserIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + userType?: boolean | AdminUser$userTypeArgs<ExtArgs> branch?: boolean | AdminUser$branchArgs<ExtArgs> } export type $AdminUserPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { name: "AdminUser" objects: { + userType: Prisma.$UserTypePayload<ExtArgs> | null branch: Prisma.$BranchPayload<ExtArgs> | null referredCustomers: Prisma.$CustomerPayload<ExtArgs>[] + supervisedWorkshops: Prisma.$WorkshopPayload<ExtArgs>[] + branchAllocations: Prisma.$BranchAllocationPayload<ExtArgs>[] postedLedgerEntries: Prisma.$LedgerEntryPayload<ExtArgs>[] orderStatusEvents: Prisma.$OrderStatusEventPayload<ExtArgs>[] preOrderStatusEvents: Prisma.$PreOrderStatusEventPayload<ExtArgs>[] + sentSmsMessages: Prisma.$SmsMessagePayload<ExtArgs>[] + sentNotifications: Prisma.$NotificationPayload<ExtArgs>[] + uploadedFiles: Prisma.$UploadedFilePayload<ExtArgs>[] } scalars: $Extensions.GetPayloadResult<{ id: string @@ -4475,6 +6164,12 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole + /** + * Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType); + * the coarse `role` enum above is retained for the business rules that already + * switch on it. Nullable so existing seeded admins remain valid. + */ + userTypeId: number | null branchId: string | null wagePercent: Prisma.Decimal | null isActive: boolean @@ -4843,11 +6538,17 @@ export namespace Prisma { */ export interface Prisma__AdminUserClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { readonly [Symbol.toStringTag]: "PrismaPromise" + userType<T extends AdminUser$userTypeArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$userTypeArgs<ExtArgs>>): Prisma__UserTypeClient<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> branch<T extends AdminUser$branchArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$branchArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> referredCustomers<T extends AdminUser$referredCustomersArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$referredCustomersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findMany"> | Null> + supervisedWorkshops<T extends AdminUser$supervisedWorkshopsArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$supervisedWorkshopsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$WorkshopPayload<ExtArgs>, T, "findMany"> | Null> + branchAllocations<T extends AdminUser$branchAllocationsArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$branchAllocationsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "findMany"> | Null> postedLedgerEntries<T extends AdminUser$postedLedgerEntriesArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$postedLedgerEntriesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$LedgerEntryPayload<ExtArgs>, T, "findMany"> | Null> orderStatusEvents<T extends AdminUser$orderStatusEventsArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$orderStatusEventsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$OrderStatusEventPayload<ExtArgs>, T, "findMany"> | Null> preOrderStatusEvents<T extends AdminUser$preOrderStatusEventsArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$preOrderStatusEventsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PreOrderStatusEventPayload<ExtArgs>, T, "findMany"> | Null> + sentSmsMessages<T extends AdminUser$sentSmsMessagesArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$sentSmsMessagesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "findMany"> | Null> + sentNotifications<T extends AdminUser$sentNotificationsArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$sentNotificationsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "findMany"> | Null> + uploadedFiles<T extends AdminUser$uploadedFilesArgs<ExtArgs> = {}>(args?: Subset<T, AdminUser$uploadedFilesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -4882,6 +6583,7 @@ export namespace Prisma { readonly mobile: FieldRef<"AdminUser", 'String'> readonly passwordHash: FieldRef<"AdminUser", 'String'> readonly role: FieldRef<"AdminUser", 'AdminRole'> + readonly userTypeId: FieldRef<"AdminUser", 'Int'> readonly branchId: FieldRef<"AdminUser", 'String'> readonly wagePercent: FieldRef<"AdminUser", 'Decimal'> readonly isActive: FieldRef<"AdminUser", 'Boolean'> @@ -5203,6 +6905,21 @@ export namespace Prisma { where?: AdminUserWhereInput } + /** + * AdminUser.userType + */ + export type AdminUser$userTypeArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + where?: UserTypeWhereInput + } + /** * AdminUser.branch */ @@ -5238,6 +6955,46 @@ export namespace Prisma { distinct?: CustomerScalarFieldEnum | CustomerScalarFieldEnum[] } + /** + * AdminUser.supervisedWorkshops + */ + export type AdminUser$supervisedWorkshopsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Workshop + */ + select?: WorkshopSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: WorkshopInclude<ExtArgs> | null + where?: WorkshopWhereInput + orderBy?: WorkshopOrderByWithRelationInput | WorkshopOrderByWithRelationInput[] + cursor?: WorkshopWhereUniqueInput + take?: number + skip?: number + distinct?: WorkshopScalarFieldEnum | WorkshopScalarFieldEnum[] + } + + /** + * AdminUser.branchAllocations + */ + export type AdminUser$branchAllocationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + where?: BranchAllocationWhereInput + orderBy?: BranchAllocationOrderByWithRelationInput | BranchAllocationOrderByWithRelationInput[] + cursor?: BranchAllocationWhereUniqueInput + take?: number + skip?: number + distinct?: BranchAllocationScalarFieldEnum | BranchAllocationScalarFieldEnum[] + } + /** * AdminUser.postedLedgerEntries */ @@ -5298,6 +7055,66 @@ export namespace Prisma { distinct?: PreOrderStatusEventScalarFieldEnum | PreOrderStatusEventScalarFieldEnum[] } + /** + * AdminUser.sentSmsMessages + */ + export type AdminUser$sentSmsMessagesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + where?: SmsMessageWhereInput + orderBy?: SmsMessageOrderByWithRelationInput | SmsMessageOrderByWithRelationInput[] + cursor?: SmsMessageWhereUniqueInput + take?: number + skip?: number + distinct?: SmsMessageScalarFieldEnum | SmsMessageScalarFieldEnum[] + } + + /** + * AdminUser.sentNotifications + */ + export type AdminUser$sentNotificationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + where?: NotificationWhereInput + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + cursor?: NotificationWhereUniqueInput + take?: number + skip?: number + distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[] + } + + /** + * AdminUser.uploadedFiles + */ + export type AdminUser$uploadedFilesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + where?: UploadedFileWhereInput + orderBy?: UploadedFileOrderByWithRelationInput | UploadedFileOrderByWithRelationInput[] + cursor?: UploadedFileWhereUniqueInput + take?: number + skip?: number + distinct?: UploadedFileScalarFieldEnum | UploadedFileScalarFieldEnum[] + } + /** * AdminUser without action */ @@ -5344,6 +7161,13 @@ export namespace Prisma { nationalCode: string | null passwordHash: string | null cityId: string | null + kind: $Enums.CustomerKind | null + phone: string | null + address: string | null + storeName: string | null + pasazhName: string | null + zone: string | null + memberCode: string | null referredByAgentId: string | null goldCreditLimitGrams: Decimal | null goldDebtGrams: Decimal | null @@ -5352,7 +7176,10 @@ export namespace Prisma { nationalIdImageUrl: string | null businessLicenseUrl: string | null shopImageUrl: string | null + avatarFileId: string | null + canPlaceOrders: boolean | null isActive: boolean | null + isArchived: boolean | null createdAt: Date | null updatedAt: Date | null } @@ -5364,6 +7191,13 @@ export namespace Prisma { nationalCode: string | null passwordHash: string | null cityId: string | null + kind: $Enums.CustomerKind | null + phone: string | null + address: string | null + storeName: string | null + pasazhName: string | null + zone: string | null + memberCode: string | null referredByAgentId: string | null goldCreditLimitGrams: Decimal | null goldDebtGrams: Decimal | null @@ -5372,7 +7206,10 @@ export namespace Prisma { nationalIdImageUrl: string | null businessLicenseUrl: string | null shopImageUrl: string | null + avatarFileId: string | null + canPlaceOrders: boolean | null isActive: boolean | null + isArchived: boolean | null createdAt: Date | null updatedAt: Date | null } @@ -5384,6 +7221,13 @@ export namespace Prisma { nationalCode: number passwordHash: number cityId: number + kind: number + phone: number + address: number + storeName: number + pasazhName: number + zone: number + memberCode: number referredByAgentId: number goldCreditLimitGrams: number goldDebtGrams: number @@ -5392,7 +7236,10 @@ export namespace Prisma { nationalIdImageUrl: number businessLicenseUrl: number shopImageUrl: number + avatarFileId: number + canPlaceOrders: number isActive: number + isArchived: number createdAt: number updatedAt: number _all: number @@ -5418,6 +7265,13 @@ export namespace Prisma { nationalCode?: true passwordHash?: true cityId?: true + kind?: true + phone?: true + address?: true + storeName?: true + pasazhName?: true + zone?: true + memberCode?: true referredByAgentId?: true goldCreditLimitGrams?: true goldDebtGrams?: true @@ -5426,7 +7280,10 @@ export namespace Prisma { nationalIdImageUrl?: true businessLicenseUrl?: true shopImageUrl?: true + avatarFileId?: true + canPlaceOrders?: true isActive?: true + isArchived?: true createdAt?: true updatedAt?: true } @@ -5438,6 +7295,13 @@ export namespace Prisma { nationalCode?: true passwordHash?: true cityId?: true + kind?: true + phone?: true + address?: true + storeName?: true + pasazhName?: true + zone?: true + memberCode?: true referredByAgentId?: true goldCreditLimitGrams?: true goldDebtGrams?: true @@ -5446,7 +7310,10 @@ export namespace Prisma { nationalIdImageUrl?: true businessLicenseUrl?: true shopImageUrl?: true + avatarFileId?: true + canPlaceOrders?: true isActive?: true + isArchived?: true createdAt?: true updatedAt?: true } @@ -5458,6 +7325,13 @@ export namespace Prisma { nationalCode?: true passwordHash?: true cityId?: true + kind?: true + phone?: true + address?: true + storeName?: true + pasazhName?: true + zone?: true + memberCode?: true referredByAgentId?: true goldCreditLimitGrams?: true goldDebtGrams?: true @@ -5466,7 +7340,10 @@ export namespace Prisma { nationalIdImageUrl?: true businessLicenseUrl?: true shopImageUrl?: true + avatarFileId?: true + canPlaceOrders?: true isActive?: true + isArchived?: true createdAt?: true updatedAt?: true _all?: true @@ -5565,6 +7442,13 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId: string | null + kind: $Enums.CustomerKind + phone: string | null + address: string | null + storeName: string | null + pasazhName: string | null + zone: string | null + memberCode: string | null referredByAgentId: string | null goldCreditLimitGrams: Decimal goldDebtGrams: Decimal @@ -5573,7 +7457,10 @@ export namespace Prisma { nationalIdImageUrl: string | null businessLicenseUrl: string | null shopImageUrl: string | null + avatarFileId: string | null + canPlaceOrders: boolean isActive: boolean + isArchived: boolean createdAt: Date updatedAt: Date _count: CustomerCountAggregateOutputType | null @@ -5604,6 +7491,13 @@ export namespace Prisma { nationalCode?: boolean passwordHash?: boolean cityId?: boolean + kind?: boolean + phone?: boolean + address?: boolean + storeName?: boolean + pasazhName?: boolean + zone?: boolean + memberCode?: boolean referredByAgentId?: boolean goldCreditLimitGrams?: boolean goldDebtGrams?: boolean @@ -5612,16 +7506,24 @@ export namespace Prisma { nationalIdImageUrl?: boolean businessLicenseUrl?: boolean shopImageUrl?: boolean + avatarFileId?: boolean + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: boolean updatedAt?: boolean city?: boolean | Customer$cityArgs<ExtArgs> referredByAgent?: boolean | Customer$referredByAgentArgs<ExtArgs> + avatarFile?: boolean | Customer$avatarFileArgs<ExtArgs> addresses?: boolean | Customer$addressesArgs<ExtArgs> orders?: boolean | Customer$ordersArgs<ExtArgs> preOrders?: boolean | Customer$preOrdersArgs<ExtArgs> ledgerEntries?: boolean | Customer$ledgerEntriesArgs<ExtArgs> walletBonuses?: boolean | Customer$walletBonusesArgs<ExtArgs> + comments?: boolean | Customer$commentsArgs<ExtArgs> + promotions?: boolean | Customer$promotionsArgs<ExtArgs> + notifications?: boolean | Customer$notificationsArgs<ExtArgs> + activityLogs?: boolean | Customer$activityLogsArgs<ExtArgs> _count?: boolean | CustomerCountOutputTypeDefaultArgs<ExtArgs> }, ExtArgs["result"]["customer"]> @@ -5632,6 +7534,13 @@ export namespace Prisma { nationalCode?: boolean passwordHash?: boolean cityId?: boolean + kind?: boolean + phone?: boolean + address?: boolean + storeName?: boolean + pasazhName?: boolean + zone?: boolean + memberCode?: boolean referredByAgentId?: boolean goldCreditLimitGrams?: boolean goldDebtGrams?: boolean @@ -5640,11 +7549,15 @@ export namespace Prisma { nationalIdImageUrl?: boolean businessLicenseUrl?: boolean shopImageUrl?: boolean + avatarFileId?: boolean + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: boolean updatedAt?: boolean city?: boolean | Customer$cityArgs<ExtArgs> referredByAgent?: boolean | Customer$referredByAgentArgs<ExtArgs> + avatarFile?: boolean | Customer$avatarFileArgs<ExtArgs> }, ExtArgs["result"]["customer"]> export type CustomerSelectScalar = { @@ -5654,6 +7567,13 @@ export namespace Prisma { nationalCode?: boolean passwordHash?: boolean cityId?: boolean + kind?: boolean + phone?: boolean + address?: boolean + storeName?: boolean + pasazhName?: boolean + zone?: boolean + memberCode?: boolean referredByAgentId?: boolean goldCreditLimitGrams?: boolean goldDebtGrams?: boolean @@ -5662,7 +7582,10 @@ export namespace Prisma { nationalIdImageUrl?: boolean businessLicenseUrl?: boolean shopImageUrl?: boolean + avatarFileId?: boolean + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: boolean updatedAt?: boolean } @@ -5670,16 +7593,22 @@ export namespace Prisma { export type CustomerInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { city?: boolean | Customer$cityArgs<ExtArgs> referredByAgent?: boolean | Customer$referredByAgentArgs<ExtArgs> + avatarFile?: boolean | Customer$avatarFileArgs<ExtArgs> addresses?: boolean | Customer$addressesArgs<ExtArgs> orders?: boolean | Customer$ordersArgs<ExtArgs> preOrders?: boolean | Customer$preOrdersArgs<ExtArgs> ledgerEntries?: boolean | Customer$ledgerEntriesArgs<ExtArgs> walletBonuses?: boolean | Customer$walletBonusesArgs<ExtArgs> + comments?: boolean | Customer$commentsArgs<ExtArgs> + promotions?: boolean | Customer$promotionsArgs<ExtArgs> + notifications?: boolean | Customer$notificationsArgs<ExtArgs> + activityLogs?: boolean | Customer$activityLogsArgs<ExtArgs> _count?: boolean | CustomerCountOutputTypeDefaultArgs<ExtArgs> } export type CustomerIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { city?: boolean | Customer$cityArgs<ExtArgs> referredByAgent?: boolean | Customer$referredByAgentArgs<ExtArgs> + avatarFile?: boolean | Customer$avatarFileArgs<ExtArgs> } export type $CustomerPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { @@ -5687,11 +7616,16 @@ export namespace Prisma { objects: { city: Prisma.$CityPayload<ExtArgs> | null referredByAgent: Prisma.$AdminUserPayload<ExtArgs> | null + avatarFile: Prisma.$UploadedFilePayload<ExtArgs> | null addresses: Prisma.$CustomerAddressPayload<ExtArgs>[] orders: Prisma.$OrderPayload<ExtArgs>[] preOrders: Prisma.$PreOrderPayload<ExtArgs>[] ledgerEntries: Prisma.$LedgerEntryPayload<ExtArgs>[] walletBonuses: Prisma.$WalletBonusPayload<ExtArgs>[] + comments: Prisma.$CommentPayload<ExtArgs>[] + promotions: Prisma.$PromotionPayload<ExtArgs>[] + notifications: Prisma.$NotificationRecipientPayload<ExtArgs>[] + activityLogs: Prisma.$CustomerActivityLogPayload<ExtArgs>[] } scalars: $Extensions.GetPayloadResult<{ id: string @@ -5700,6 +7634,24 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId: string | null + /** + * Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the + * BankerList / ShopkeeperList screens filter on. + */ + kind: $Enums.CustomerKind + /** + * Legacy contact + shop columns, shown on the wholesale customer form and as + * (hidden-by-default) columns in its grid. + */ + phone: string | null + address: string | null + storeName: string | null + pasazhName: string | null + zone: string | null + /** + * Legacy mcode — the operator-assigned customer code. + */ + memberCode: string | null referredByAgentId: string | null goldCreditLimitGrams: Prisma.Decimal goldDebtGrams: Prisma.Decimal @@ -5708,7 +7660,24 @@ export namespace Prisma { nationalIdImageUrl: string | null businessLicenseUrl: string | null shopImageUrl: string | null + /** + * Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent + * form. Legacy stored an FK to its Image table and read it back as a nested + * `image: { id, image }`, so this is a relation, not a bare URL string. + */ + avatarFileId: string | null + /** + * Legacy had TWO independent switches on a customer: + * sts -> may they place orders (this field) + * active -> is the account enabled (isActive, below) + * The port previously drove both from isActive; they are separate again. + */ + canPlaceOrders: boolean isActive: boolean + /** + * Legacy archive flag — the archived list filtered on this, not on isActive. + */ + isArchived: boolean createdAt: Date updatedAt: Date }, ExtArgs["result"]["customer"]> @@ -6077,11 +8046,16 @@ export namespace Prisma { readonly [Symbol.toStringTag]: "PrismaPromise" city<T extends Customer$cityArgs<ExtArgs> = {}>(args?: Subset<T, Customer$cityArgs<ExtArgs>>): Prisma__CityClient<$Result.GetResult<Prisma.$CityPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> referredByAgent<T extends Customer$referredByAgentArgs<ExtArgs> = {}>(args?: Subset<T, Customer$referredByAgentArgs<ExtArgs>>): Prisma__AdminUserClient<$Result.GetResult<Prisma.$AdminUserPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> + avatarFile<T extends Customer$avatarFileArgs<ExtArgs> = {}>(args?: Subset<T, Customer$avatarFileArgs<ExtArgs>>): Prisma__UploadedFileClient<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> addresses<T extends Customer$addressesArgs<ExtArgs> = {}>(args?: Subset<T, Customer$addressesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CustomerAddressPayload<ExtArgs>, T, "findMany"> | Null> orders<T extends Customer$ordersArgs<ExtArgs> = {}>(args?: Subset<T, Customer$ordersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$OrderPayload<ExtArgs>, T, "findMany"> | Null> preOrders<T extends Customer$preOrdersArgs<ExtArgs> = {}>(args?: Subset<T, Customer$preOrdersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PreOrderPayload<ExtArgs>, T, "findMany"> | Null> ledgerEntries<T extends Customer$ledgerEntriesArgs<ExtArgs> = {}>(args?: Subset<T, Customer$ledgerEntriesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$LedgerEntryPayload<ExtArgs>, T, "findMany"> | Null> walletBonuses<T extends Customer$walletBonusesArgs<ExtArgs> = {}>(args?: Subset<T, Customer$walletBonusesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$WalletBonusPayload<ExtArgs>, T, "findMany"> | Null> + comments<T extends Customer$commentsArgs<ExtArgs> = {}>(args?: Subset<T, Customer$commentsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "findMany"> | Null> + promotions<T extends Customer$promotionsArgs<ExtArgs> = {}>(args?: Subset<T, Customer$promotionsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "findMany"> | Null> + notifications<T extends Customer$notificationsArgs<ExtArgs> = {}>(args?: Subset<T, Customer$notificationsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "findMany"> | Null> + activityLogs<T extends Customer$activityLogsArgs<ExtArgs> = {}>(args?: Subset<T, Customer$activityLogsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -6117,6 +8091,13 @@ export namespace Prisma { readonly nationalCode: FieldRef<"Customer", 'String'> readonly passwordHash: FieldRef<"Customer", 'String'> readonly cityId: FieldRef<"Customer", 'String'> + readonly kind: FieldRef<"Customer", 'CustomerKind'> + readonly phone: FieldRef<"Customer", 'String'> + readonly address: FieldRef<"Customer", 'String'> + readonly storeName: FieldRef<"Customer", 'String'> + readonly pasazhName: FieldRef<"Customer", 'String'> + readonly zone: FieldRef<"Customer", 'String'> + readonly memberCode: FieldRef<"Customer", 'String'> readonly referredByAgentId: FieldRef<"Customer", 'String'> readonly goldCreditLimitGrams: FieldRef<"Customer", 'Decimal'> readonly goldDebtGrams: FieldRef<"Customer", 'Decimal'> @@ -6125,7 +8106,10 @@ export namespace Prisma { readonly nationalIdImageUrl: FieldRef<"Customer", 'String'> readonly businessLicenseUrl: FieldRef<"Customer", 'String'> readonly shopImageUrl: FieldRef<"Customer", 'String'> + readonly avatarFileId: FieldRef<"Customer", 'String'> + readonly canPlaceOrders: FieldRef<"Customer", 'Boolean'> readonly isActive: FieldRef<"Customer", 'Boolean'> + readonly isArchived: FieldRef<"Customer", 'Boolean'> readonly createdAt: FieldRef<"Customer", 'DateTime'> readonly updatedAt: FieldRef<"Customer", 'DateTime'> } @@ -6475,6 +8459,21 @@ export namespace Prisma { where?: AdminUserWhereInput } + /** + * Customer.avatarFile + */ + export type Customer$avatarFileArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + where?: UploadedFileWhereInput + } + /** * Customer.addresses */ @@ -6575,6 +8574,86 @@ export namespace Prisma { distinct?: WalletBonusScalarFieldEnum | WalletBonusScalarFieldEnum[] } + /** + * Customer.comments + */ + export type Customer$commentsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + where?: CommentWhereInput + orderBy?: CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] + cursor?: CommentWhereUniqueInput + take?: number + skip?: number + distinct?: CommentScalarFieldEnum | CommentScalarFieldEnum[] + } + + /** + * Customer.promotions + */ + export type Customer$promotionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + where?: PromotionWhereInput + orderBy?: PromotionOrderByWithRelationInput | PromotionOrderByWithRelationInput[] + cursor?: PromotionWhereUniqueInput + take?: number + skip?: number + distinct?: PromotionScalarFieldEnum | PromotionScalarFieldEnum[] + } + + /** + * Customer.notifications + */ + export type Customer$notificationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + where?: NotificationRecipientWhereInput + orderBy?: NotificationRecipientOrderByWithRelationInput | NotificationRecipientOrderByWithRelationInput[] + cursor?: NotificationRecipientWhereUniqueInput + take?: number + skip?: number + distinct?: NotificationRecipientScalarFieldEnum | NotificationRecipientScalarFieldEnum[] + } + + /** + * Customer.activityLogs + */ + export type Customer$activityLogsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + where?: CustomerActivityLogWhereInput + orderBy?: CustomerActivityLogOrderByWithRelationInput | CustomerActivityLogOrderByWithRelationInput[] + cursor?: CustomerActivityLogWhereUniqueInput + take?: number + skip?: number + distinct?: CustomerActivityLogScalarFieldEnum | CustomerActivityLogScalarFieldEnum[] + } + /** * Customer without action */ @@ -7557,18 +9636,27 @@ export namespace Prisma { export type BranchMinAggregateOutputType = { id: string | null name: string | null + address: string | null + phone: string | null + isActive: boolean | null cityId: string | null } export type BranchMaxAggregateOutputType = { id: string | null name: string | null + address: string | null + phone: string | null + isActive: boolean | null cityId: string | null } export type BranchCountAggregateOutputType = { id: number name: number + address: number + phone: number + isActive: number cityId: number _all: number } @@ -7577,18 +9665,27 @@ export namespace Prisma { export type BranchMinAggregateInputType = { id?: true name?: true + address?: true + phone?: true + isActive?: true cityId?: true } export type BranchMaxAggregateInputType = { id?: true name?: true + address?: true + phone?: true + isActive?: true cityId?: true } export type BranchCountAggregateInputType = { id?: true name?: true + address?: true + phone?: true + isActive?: true cityId?: true _all?: true } @@ -7668,6 +9765,9 @@ export namespace Prisma { export type BranchGroupByOutputType = { id: string name: string + address: string | null + phone: string | null + isActive: boolean cityId: string | null _count: BranchCountAggregateOutputType | null _min: BranchMinAggregateOutputType | null @@ -7691,16 +9791,23 @@ export namespace Prisma { export type BranchSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ id?: boolean name?: boolean + address?: boolean + phone?: boolean + isActive?: boolean cityId?: boolean city?: boolean | Branch$cityArgs<ExtArgs> adminUsers?: boolean | Branch$adminUsersArgs<ExtArgs> orders?: boolean | Branch$ordersArgs<ExtArgs> + allocations?: boolean | Branch$allocationsArgs<ExtArgs> _count?: boolean | BranchCountOutputTypeDefaultArgs<ExtArgs> }, ExtArgs["result"]["branch"]> export type BranchSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ id?: boolean name?: boolean + address?: boolean + phone?: boolean + isActive?: boolean cityId?: boolean city?: boolean | Branch$cityArgs<ExtArgs> }, ExtArgs["result"]["branch"]> @@ -7708,6 +9815,9 @@ export namespace Prisma { export type BranchSelectScalar = { id?: boolean name?: boolean + address?: boolean + phone?: boolean + isActive?: boolean cityId?: boolean } @@ -7715,6 +9825,7 @@ export namespace Prisma { city?: boolean | Branch$cityArgs<ExtArgs> adminUsers?: boolean | Branch$adminUsersArgs<ExtArgs> orders?: boolean | Branch$ordersArgs<ExtArgs> + allocations?: boolean | Branch$allocationsArgs<ExtArgs> _count?: boolean | BranchCountOutputTypeDefaultArgs<ExtArgs> } export type BranchIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { @@ -7727,10 +9838,20 @@ export namespace Prisma { city: Prisma.$CityPayload<ExtArgs> | null adminUsers: Prisma.$AdminUserPayload<ExtArgs>[] orders: Prisma.$OrderPayload<ExtArgs>[] + allocations: Prisma.$BranchAllocationPayload<ExtArgs>[] } scalars: $Extensions.GetPayloadResult<{ id: string name: string + /** + * Legacy Branch.address / phone — both are columns in the branch grid. + */ + address: string | null + phone: string | null + /** + * Legacy GET branch/active/{id} toggles this. + */ + isActive: boolean cityId: string | null }, ExtArgs["result"]["branch"]> composites: {} @@ -8099,6 +10220,7 @@ export namespace Prisma { city<T extends Branch$cityArgs<ExtArgs> = {}>(args?: Subset<T, Branch$cityArgs<ExtArgs>>): Prisma__CityClient<$Result.GetResult<Prisma.$CityPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> adminUsers<T extends Branch$adminUsersArgs<ExtArgs> = {}>(args?: Subset<T, Branch$adminUsersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$AdminUserPayload<ExtArgs>, T, "findMany"> | Null> orders<T extends Branch$ordersArgs<ExtArgs> = {}>(args?: Subset<T, Branch$ordersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$OrderPayload<ExtArgs>, T, "findMany"> | Null> + allocations<T extends Branch$allocationsArgs<ExtArgs> = {}>(args?: Subset<T, Branch$allocationsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -8130,6 +10252,9 @@ export namespace Prisma { interface BranchFieldRefs { readonly id: FieldRef<"Branch", 'String'> readonly name: FieldRef<"Branch", 'String'> + readonly address: FieldRef<"Branch", 'String'> + readonly phone: FieldRef<"Branch", 'String'> + readonly isActive: FieldRef<"Branch", 'Boolean'> readonly cityId: FieldRef<"Branch", 'String'> } @@ -8503,6 +10628,26 @@ export namespace Prisma { distinct?: OrderScalarFieldEnum | OrderScalarFieldEnum[] } + /** + * Branch.allocations + */ + export type Branch$allocationsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + where?: BranchAllocationWhereInput + orderBy?: BranchAllocationOrderByWithRelationInput | BranchAllocationOrderByWithRelationInput[] + cursor?: BranchAllocationWhereUniqueInput + take?: number + skip?: number + distinct?: BranchAllocationScalarFieldEnum | BranchAllocationScalarFieldEnum[] + } + /** * Branch without action */ @@ -8531,18 +10676,27 @@ export namespace Prisma { export type WorkshopMinAggregateOutputType = { id: string | null name: string | null + address: string | null + phone: string | null + supervisorId: string | null isActive: boolean | null } export type WorkshopMaxAggregateOutputType = { id: string | null name: string | null + address: string | null + phone: string | null + supervisorId: string | null isActive: boolean | null } export type WorkshopCountAggregateOutputType = { id: number name: number + address: number + phone: number + supervisorId: number isActive: number _all: number } @@ -8551,18 +10705,27 @@ export namespace Prisma { export type WorkshopMinAggregateInputType = { id?: true name?: true + address?: true + phone?: true + supervisorId?: true isActive?: true } export type WorkshopMaxAggregateInputType = { id?: true name?: true + address?: true + phone?: true + supervisorId?: true isActive?: true } export type WorkshopCountAggregateInputType = { id?: true name?: true + address?: true + phone?: true + supervisorId?: true isActive?: true _all?: true } @@ -8642,6 +10805,9 @@ export namespace Prisma { export type WorkshopGroupByOutputType = { id: string name: string + address: string | null + phone: string | null + supervisorId: string | null isActive: boolean _count: WorkshopCountAggregateOutputType | null _min: WorkshopMinAggregateOutputType | null @@ -8665,7 +10831,11 @@ export namespace Prisma { export type WorkshopSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ id?: boolean name?: boolean + address?: boolean + phone?: boolean + supervisorId?: boolean isActive?: boolean + supervisor?: boolean | Workshop$supervisorArgs<ExtArgs> preOrders?: boolean | Workshop$preOrdersArgs<ExtArgs> _count?: boolean | WorkshopCountOutputTypeDefaultArgs<ExtArgs> }, ExtArgs["result"]["workshop"]> @@ -8673,29 +10843,49 @@ export namespace Prisma { export type WorkshopSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ id?: boolean name?: boolean + address?: boolean + phone?: boolean + supervisorId?: boolean isActive?: boolean + supervisor?: boolean | Workshop$supervisorArgs<ExtArgs> }, ExtArgs["result"]["workshop"]> export type WorkshopSelectScalar = { id?: boolean name?: boolean + address?: boolean + phone?: boolean + supervisorId?: boolean isActive?: boolean } export type WorkshopInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + supervisor?: boolean | Workshop$supervisorArgs<ExtArgs> preOrders?: boolean | Workshop$preOrdersArgs<ExtArgs> _count?: boolean | WorkshopCountOutputTypeDefaultArgs<ExtArgs> } - export type WorkshopIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {} + export type WorkshopIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + supervisor?: boolean | Workshop$supervisorArgs<ExtArgs> + } export type $WorkshopPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { name: "Workshop" objects: { + supervisor: Prisma.$AdminUserPayload<ExtArgs> | null preOrders: Prisma.$PreOrderPayload<ExtArgs>[] } scalars: $Extensions.GetPayloadResult<{ id: string name: string + /** + * Legacy Workshop.address / phone — both are columns in the workshop grid. + */ + address: string | null + phone: string | null + /** + * The supervisor created alongside the workshop by the legacy Add form. + */ + supervisorId: string | null isActive: boolean }, ExtArgs["result"]["workshop"]> composites: {} @@ -9061,6 +11251,7 @@ export namespace Prisma { */ export interface Prisma__WorkshopClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { readonly [Symbol.toStringTag]: "PrismaPromise" + supervisor<T extends Workshop$supervisorArgs<ExtArgs> = {}>(args?: Subset<T, Workshop$supervisorArgs<ExtArgs>>): Prisma__AdminUserClient<$Result.GetResult<Prisma.$AdminUserPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> preOrders<T extends Workshop$preOrdersArgs<ExtArgs> = {}>(args?: Subset<T, Workshop$preOrdersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PreOrderPayload<ExtArgs>, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. @@ -9093,6 +11284,9 @@ export namespace Prisma { interface WorkshopFieldRefs { readonly id: FieldRef<"Workshop", 'String'> readonly name: FieldRef<"Workshop", 'String'> + readonly address: FieldRef<"Workshop", 'String'> + readonly phone: FieldRef<"Workshop", 'String'> + readonly supervisorId: FieldRef<"Workshop", 'String'> readonly isActive: FieldRef<"Workshop", 'Boolean'> } @@ -9315,6 +11509,10 @@ export namespace Prisma { */ data: WorkshopCreateManyInput | WorkshopCreateManyInput[] skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: WorkshopIncludeCreateManyAndReturn<ExtArgs> | null } /** @@ -9407,6 +11605,21 @@ export namespace Prisma { where?: WorkshopWhereInput } + /** + * Workshop.supervisor + */ + export type Workshop$supervisorArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the AdminUser + */ + select?: AdminUserSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminUserInclude<ExtArgs> | null + where?: AdminUserWhereInput + } + /** * Workshop.preOrders */ @@ -9448,45 +11661,93 @@ export namespace Prisma { export type AggregateCategory = { _count: CategoryCountAggregateOutputType | null + _avg: CategoryAvgAggregateOutputType | null + _sum: CategorySumAggregateOutputType | null _min: CategoryMinAggregateOutputType | null _max: CategoryMaxAggregateOutputType | null } + export type CategoryAvgAggregateOutputType = { + type: number | null + } + + export type CategorySumAggregateOutputType = { + type: number | null + } + export type CategoryMinAggregateOutputType = { id: string | null title: string | null + type: number | null + imageUrl: string | null + iconUrl: string | null + metaTag: string | null + description: string | null parentId: string | null } export type CategoryMaxAggregateOutputType = { id: string | null title: string | null + type: number | null + imageUrl: string | null + iconUrl: string | null + metaTag: string | null + description: string | null parentId: string | null } export type CategoryCountAggregateOutputType = { id: number title: number + type: number + imageUrl: number + iconUrl: number + metaTag: number + description: number parentId: number _all: number } + export type CategoryAvgAggregateInputType = { + type?: true + } + + export type CategorySumAggregateInputType = { + type?: true + } + export type CategoryMinAggregateInputType = { id?: true title?: true + type?: true + imageUrl?: true + iconUrl?: true + metaTag?: true + description?: true parentId?: true } export type CategoryMaxAggregateInputType = { id?: true title?: true + type?: true + imageUrl?: true + iconUrl?: true + metaTag?: true + description?: true parentId?: true } export type CategoryCountAggregateInputType = { id?: true title?: true + type?: true + imageUrl?: true + iconUrl?: true + metaTag?: true + description?: true parentId?: true _all?: true } @@ -9526,6 +11787,18 @@ export namespace Prisma { * Count returned Categories **/ _count?: true | CategoryCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: CategoryAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: CategorySumAggregateInputType /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * @@ -9559,6 +11832,8 @@ export namespace Prisma { take?: number skip?: number _count?: CategoryCountAggregateInputType | true + _avg?: CategoryAvgAggregateInputType + _sum?: CategorySumAggregateInputType _min?: CategoryMinAggregateInputType _max?: CategoryMaxAggregateInputType } @@ -9566,8 +11841,15 @@ export namespace Prisma { export type CategoryGroupByOutputType = { id: string title: string + type: number + imageUrl: string | null + iconUrl: string | null + metaTag: string | null + description: string | null parentId: string | null _count: CategoryCountAggregateOutputType | null + _avg: CategoryAvgAggregateOutputType | null + _sum: CategorySumAggregateOutputType | null _min: CategoryMinAggregateOutputType | null _max: CategoryMaxAggregateOutputType | null } @@ -9589,16 +11871,27 @@ export namespace Prisma { export type CategorySelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ id?: boolean title?: boolean + type?: boolean + imageUrl?: boolean + iconUrl?: boolean + metaTag?: boolean + description?: boolean parentId?: boolean parent?: boolean | Category$parentArgs<ExtArgs> children?: boolean | Category$childrenArgs<ExtArgs> products?: boolean | Category$productsArgs<ExtArgs> + promotions?: boolean | Category$promotionsArgs<ExtArgs> _count?: boolean | CategoryCountOutputTypeDefaultArgs<ExtArgs> }, ExtArgs["result"]["category"]> export type CategorySelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ id?: boolean title?: boolean + type?: boolean + imageUrl?: boolean + iconUrl?: boolean + metaTag?: boolean + description?: boolean parentId?: boolean parent?: boolean | Category$parentArgs<ExtArgs> }, ExtArgs["result"]["category"]> @@ -9606,6 +11899,11 @@ export namespace Prisma { export type CategorySelectScalar = { id?: boolean title?: boolean + type?: boolean + imageUrl?: boolean + iconUrl?: boolean + metaTag?: boolean + description?: boolean parentId?: boolean } @@ -9613,6 +11911,7 @@ export namespace Prisma { parent?: boolean | Category$parentArgs<ExtArgs> children?: boolean | Category$childrenArgs<ExtArgs> products?: boolean | Category$productsArgs<ExtArgs> + promotions?: boolean | Category$promotionsArgs<ExtArgs> _count?: boolean | CategoryCountOutputTypeDefaultArgs<ExtArgs> } export type CategoryIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { @@ -9625,10 +11924,26 @@ export namespace Prisma { parent: Prisma.$CategoryPayload<ExtArgs> | null children: Prisma.$CategoryPayload<ExtArgs>[] products: Prisma.$ProductPayload<ExtArgs>[] + promotions: Prisma.$PromotionPayload<ExtArgs>[] } scalars: $Extensions.GetPayloadResult<{ id: string title: string + /** + * Legacy Category.type — which storefront the category belongs to: + * 1 سایت | 2 اپلیکشن موبایل. Drives the "type_str" grid column. + */ + type: number + /** + * Legacy Category.image / icon — the grid renders the image, the storefront the icon. + */ + imageUrl: string | null + iconUrl: string | null + /** + * Legacy meta tag + description, used for SEO on the site categories. + */ + metaTag: string | null + description: string | null parentId: string | null }, ExtArgs["result"]["category"]> composites: {} @@ -9997,6 +12312,7 @@ export namespace Prisma { parent<T extends Category$parentArgs<ExtArgs> = {}>(args?: Subset<T, Category$parentArgs<ExtArgs>>): Prisma__CategoryClient<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> children<T extends Category$childrenArgs<ExtArgs> = {}>(args?: Subset<T, Category$childrenArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "findMany"> | Null> products<T extends Category$productsArgs<ExtArgs> = {}>(args?: Subset<T, Category$productsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findMany"> | Null> + promotions<T extends Category$promotionsArgs<ExtArgs> = {}>(args?: Subset<T, Category$promotionsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -10028,6 +12344,11 @@ export namespace Prisma { interface CategoryFieldRefs { readonly id: FieldRef<"Category", 'String'> readonly title: FieldRef<"Category", 'String'> + readonly type: FieldRef<"Category", 'Int'> + readonly imageUrl: FieldRef<"Category", 'String'> + readonly iconUrl: FieldRef<"Category", 'String'> + readonly metaTag: FieldRef<"Category", 'String'> + readonly description: FieldRef<"Category", 'String'> readonly parentId: FieldRef<"Category", 'String'> } @@ -10401,6 +12722,26 @@ export namespace Prisma { distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[] } + /** + * Category.promotions + */ + export type Category$promotionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + where?: PromotionWhereInput + orderBy?: PromotionOrderByWithRelationInput | PromotionOrderByWithRelationInput[] + cursor?: PromotionWhereUniqueInput + take?: number + skip?: number + distinct?: PromotionScalarFieldEnum | PromotionScalarFieldEnum[] + } + /** * Category without action */ @@ -10557,6 +12898,7 @@ export namespace Prisma { id?: boolean title?: boolean products?: boolean | Brand$productsArgs<ExtArgs> + promotions?: boolean | Brand$promotionsArgs<ExtArgs> _count?: boolean | BrandCountOutputTypeDefaultArgs<ExtArgs> }, ExtArgs["result"]["brand"]> @@ -10572,6 +12914,7 @@ export namespace Prisma { export type BrandInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { products?: boolean | Brand$productsArgs<ExtArgs> + promotions?: boolean | Brand$promotionsArgs<ExtArgs> _count?: boolean | BrandCountOutputTypeDefaultArgs<ExtArgs> } export type BrandIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {} @@ -10580,6 +12923,7 @@ export namespace Prisma { name: "Brand" objects: { products: Prisma.$ProductPayload<ExtArgs>[] + promotions: Prisma.$PromotionPayload<ExtArgs>[] } scalars: $Extensions.GetPayloadResult<{ id: string @@ -10949,6 +13293,7 @@ export namespace Prisma { export interface Prisma__BrandClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { readonly [Symbol.toStringTag]: "PrismaPromise" products<T extends Brand$productsArgs<ExtArgs> = {}>(args?: Subset<T, Brand$productsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findMany"> | Null> + promotions<T extends Brand$promotionsArgs<ExtArgs> = {}>(args?: Subset<T, Brand$promotionsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -11313,6 +13658,26 @@ export namespace Prisma { distinct?: ProductScalarFieldEnum | ProductScalarFieldEnum[] } + /** + * Brand.promotions + */ + export type Brand$promotionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + where?: PromotionWhereInput + orderBy?: PromotionOrderByWithRelationInput | PromotionOrderByWithRelationInput[] + cursor?: PromotionWhereUniqueInput + take?: number + skip?: number + distinct?: PromotionScalarFieldEnum | PromotionScalarFieldEnum[] + } + /** * Brand without action */ @@ -13173,16 +15538,28 @@ export namespace Prisma { export type AggregateProduct = { _count: ProductCountAggregateOutputType | null + _avg: ProductAvgAggregateOutputType | null + _sum: ProductSumAggregateOutputType | null _min: ProductMinAggregateOutputType | null _max: ProductMaxAggregateOutputType | null } + export type ProductAvgAggregateOutputType = { + showType: number | null + } + + export type ProductSumAggregateOutputType = { + showType: number | null + } + export type ProductMinAggregateOutputType = { id: string | null title: string | null description: string | null categoryId: string | null brandId: string | null + productCode: string | null + showType: number | null isActive: boolean | null createdAt: Date | null } @@ -13193,6 +15570,8 @@ export namespace Prisma { description: string | null categoryId: string | null brandId: string | null + productCode: string | null + showType: number | null isActive: boolean | null createdAt: Date | null } @@ -13203,18 +15582,30 @@ export namespace Prisma { description: number categoryId: number brandId: number + productCode: number + showType: number isActive: number createdAt: number _all: number } + export type ProductAvgAggregateInputType = { + showType?: true + } + + export type ProductSumAggregateInputType = { + showType?: true + } + export type ProductMinAggregateInputType = { id?: true title?: true description?: true categoryId?: true brandId?: true + productCode?: true + showType?: true isActive?: true createdAt?: true } @@ -13225,6 +15616,8 @@ export namespace Prisma { description?: true categoryId?: true brandId?: true + productCode?: true + showType?: true isActive?: true createdAt?: true } @@ -13235,6 +15628,8 @@ export namespace Prisma { description?: true categoryId?: true brandId?: true + productCode?: true + showType?: true isActive?: true createdAt?: true _all?: true @@ -13275,6 +15670,18 @@ export namespace Prisma { * Count returned Products **/ _count?: true | ProductCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: ProductAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: ProductSumAggregateInputType /** * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} * @@ -13308,6 +15715,8 @@ export namespace Prisma { take?: number skip?: number _count?: ProductCountAggregateInputType | true + _avg?: ProductAvgAggregateInputType + _sum?: ProductSumAggregateInputType _min?: ProductMinAggregateInputType _max?: ProductMaxAggregateInputType } @@ -13318,9 +15727,13 @@ export namespace Prisma { description: string | null categoryId: string | null brandId: string | null + productCode: string | null + showType: number isActive: boolean createdAt: Date _count: ProductCountAggregateOutputType | null + _avg: ProductAvgAggregateOutputType | null + _sum: ProductSumAggregateOutputType | null _min: ProductMinAggregateOutputType | null _max: ProductMaxAggregateOutputType | null } @@ -13345,6 +15758,8 @@ export namespace Prisma { description?: boolean categoryId?: boolean brandId?: boolean + productCode?: boolean + showType?: boolean isActive?: boolean createdAt?: boolean category?: boolean | Product$categoryArgs<ExtArgs> @@ -13352,6 +15767,9 @@ export namespace Prisma { variants?: boolean | Product$variantsArgs<ExtArgs> images?: boolean | Product$imagesArgs<ExtArgs> collections?: boolean | Product$collectionsArgs<ExtArgs> + comments?: boolean | Product$commentsArgs<ExtArgs> + promotions?: boolean | Product$promotionsArgs<ExtArgs> + allocationItems?: boolean | Product$allocationItemsArgs<ExtArgs> _count?: boolean | ProductCountOutputTypeDefaultArgs<ExtArgs> }, ExtArgs["result"]["product"]> @@ -13361,6 +15779,8 @@ export namespace Prisma { description?: boolean categoryId?: boolean brandId?: boolean + productCode?: boolean + showType?: boolean isActive?: boolean createdAt?: boolean category?: boolean | Product$categoryArgs<ExtArgs> @@ -13373,6 +15793,8 @@ export namespace Prisma { description?: boolean categoryId?: boolean brandId?: boolean + productCode?: boolean + showType?: boolean isActive?: boolean createdAt?: boolean } @@ -13383,6 +15805,9 @@ export namespace Prisma { variants?: boolean | Product$variantsArgs<ExtArgs> images?: boolean | Product$imagesArgs<ExtArgs> collections?: boolean | Product$collectionsArgs<ExtArgs> + comments?: boolean | Product$commentsArgs<ExtArgs> + promotions?: boolean | Product$promotionsArgs<ExtArgs> + allocationItems?: boolean | Product$allocationItemsArgs<ExtArgs> _count?: boolean | ProductCountOutputTypeDefaultArgs<ExtArgs> } export type ProductIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { @@ -13398,6 +15823,9 @@ export namespace Prisma { variants: Prisma.$ProductVariantPayload<ExtArgs>[] images: Prisma.$ProductImagePayload<ExtArgs>[] collections: Prisma.$CollectionProductPayload<ExtArgs>[] + comments: Prisma.$CommentPayload<ExtArgs>[] + promotions: Prisma.$PromotionPayload<ExtArgs>[] + allocationItems: Prisma.$BranchAllocationItemPayload<ExtArgs>[] } scalars: $Extensions.GetPayloadResult<{ id: string @@ -13405,6 +15833,14 @@ export namespace Prisma { description: string | null categoryId: string | null brandId: string | null + /** + * Legacy Product.product_code — the human-facing SKU shown in the grid. + */ + productCode: string | null + /** + * Legacy Product.show_type: 1 site, 2 mobile, 3 both. + */ + showType: number isActive: boolean createdAt: Date }, ExtArgs["result"]["product"]> @@ -13776,6 +16212,9 @@ export namespace Prisma { variants<T extends Product$variantsArgs<ExtArgs> = {}>(args?: Subset<T, Product$variantsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductVariantPayload<ExtArgs>, T, "findMany"> | Null> images<T extends Product$imagesArgs<ExtArgs> = {}>(args?: Subset<T, Product$imagesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$ProductImagePayload<ExtArgs>, T, "findMany"> | Null> collections<T extends Product$collectionsArgs<ExtArgs> = {}>(args?: Subset<T, Product$collectionsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CollectionProductPayload<ExtArgs>, T, "findMany"> | Null> + comments<T extends Product$commentsArgs<ExtArgs> = {}>(args?: Subset<T, Product$commentsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "findMany"> | Null> + promotions<T extends Product$promotionsArgs<ExtArgs> = {}>(args?: Subset<T, Product$promotionsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "findMany"> | Null> + allocationItems<T extends Product$allocationItemsArgs<ExtArgs> = {}>(args?: Subset<T, Product$allocationItemsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "findMany"> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -13810,6 +16249,8 @@ export namespace Prisma { readonly description: FieldRef<"Product", 'String'> readonly categoryId: FieldRef<"Product", 'String'> readonly brandId: FieldRef<"Product", 'String'> + readonly productCode: FieldRef<"Product", 'String'> + readonly showType: FieldRef<"Product", 'Int'> readonly isActive: FieldRef<"Product", 'Boolean'> readonly createdAt: FieldRef<"Product", 'DateTime'> } @@ -14219,6 +16660,66 @@ export namespace Prisma { distinct?: CollectionProductScalarFieldEnum | CollectionProductScalarFieldEnum[] } + /** + * Product.comments + */ + export type Product$commentsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + where?: CommentWhereInput + orderBy?: CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] + cursor?: CommentWhereUniqueInput + take?: number + skip?: number + distinct?: CommentScalarFieldEnum | CommentScalarFieldEnum[] + } + + /** + * Product.promotions + */ + export type Product$promotionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + where?: PromotionWhereInput + orderBy?: PromotionOrderByWithRelationInput | PromotionOrderByWithRelationInput[] + cursor?: PromotionWhereUniqueInput + take?: number + skip?: number + distinct?: PromotionScalarFieldEnum | PromotionScalarFieldEnum[] + } + + /** + * Product.allocationItems + */ + export type Product$allocationItemsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + where?: BranchAllocationItemWhereInput + orderBy?: BranchAllocationItemOrderByWithRelationInput | BranchAllocationItemOrderByWithRelationInput[] + cursor?: BranchAllocationItemWhereUniqueInput + take?: number + skip?: number + distinct?: BranchAllocationItemScalarFieldEnum | BranchAllocationItemScalarFieldEnum[] + } + /** * Product without action */ @@ -15204,11 +17705,13 @@ export namespace Prisma { export type ProductVariantAvgAggregateOutputType = { rashWeightGrams: Decimal | null defaultWagePercent: Decimal | null + qty: number | null } export type ProductVariantSumAggregateOutputType = { rashWeightGrams: Decimal | null defaultWagePercent: Decimal | null + qty: number | null } export type ProductVariantMinAggregateOutputType = { @@ -15218,6 +17721,8 @@ export namespace Prisma { sku: string | null rashWeightGrams: Decimal | null defaultWagePercent: Decimal | null + qty: number | null + isPreOrder: boolean | null isActive: boolean | null } @@ -15228,6 +17733,8 @@ export namespace Prisma { sku: string | null rashWeightGrams: Decimal | null defaultWagePercent: Decimal | null + qty: number | null + isPreOrder: boolean | null isActive: boolean | null } @@ -15238,6 +17745,8 @@ export namespace Prisma { sku: number rashWeightGrams: number defaultWagePercent: number + qty: number + isPreOrder: number isActive: number _all: number } @@ -15246,11 +17755,13 @@ export namespace Prisma { export type ProductVariantAvgAggregateInputType = { rashWeightGrams?: true defaultWagePercent?: true + qty?: true } export type ProductVariantSumAggregateInputType = { rashWeightGrams?: true defaultWagePercent?: true + qty?: true } export type ProductVariantMinAggregateInputType = { @@ -15260,6 +17771,8 @@ export namespace Prisma { sku?: true rashWeightGrams?: true defaultWagePercent?: true + qty?: true + isPreOrder?: true isActive?: true } @@ -15270,6 +17783,8 @@ export namespace Prisma { sku?: true rashWeightGrams?: true defaultWagePercent?: true + qty?: true + isPreOrder?: true isActive?: true } @@ -15280,6 +17795,8 @@ export namespace Prisma { sku?: true rashWeightGrams?: true defaultWagePercent?: true + qty?: true + isPreOrder?: true isActive?: true _all?: true } @@ -15377,6 +17894,8 @@ export namespace Prisma { sku: string | null rashWeightGrams: Decimal defaultWagePercent: Decimal + qty: number + isPreOrder: boolean isActive: boolean _count: ProductVariantCountAggregateOutputType | null _avg: ProductVariantAvgAggregateOutputType | null @@ -15406,6 +17925,8 @@ export namespace Prisma { sku?: boolean rashWeightGrams?: boolean defaultWagePercent?: boolean + qty?: boolean + isPreOrder?: boolean isActive?: boolean product?: boolean | ProductDefaultArgs<ExtArgs> orderItems?: boolean | ProductVariant$orderItemsArgs<ExtArgs> @@ -15419,6 +17940,8 @@ export namespace Prisma { sku?: boolean rashWeightGrams?: boolean defaultWagePercent?: boolean + qty?: boolean + isPreOrder?: boolean isActive?: boolean product?: boolean | ProductDefaultArgs<ExtArgs> }, ExtArgs["result"]["productVariant"]> @@ -15430,6 +17953,8 @@ export namespace Prisma { sku?: boolean rashWeightGrams?: boolean defaultWagePercent?: boolean + qty?: boolean + isPreOrder?: boolean isActive?: boolean } @@ -15461,6 +17986,16 @@ export namespace Prisma { * Default making-charge percentage applied on top of rash weight. */ defaultWagePercent: Prisma.Decimal + /** + * Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with + * qty 0 unless it is flagged pre-order, so both fields are required for that + * guard to work (see apps/admin-panel/src/stores/cart.ts). + */ + qty: number + /** + * Legacy is_pre_order: orderable even at zero stock. + */ + isPreOrder: boolean isActive: boolean }, ExtArgs["result"]["productVariant"]> composites: {} @@ -15863,6 +18398,8 @@ export namespace Prisma { readonly sku: FieldRef<"ProductVariant", 'String'> readonly rashWeightGrams: FieldRef<"ProductVariant", 'Decimal'> readonly defaultWagePercent: FieldRef<"ProductVariant", 'Decimal'> + readonly qty: FieldRef<"ProductVariant", 'Int'> + readonly isPreOrder: FieldRef<"ProductVariant", 'Boolean'> readonly isActive: FieldRef<"ProductVariant", 'Boolean'> } @@ -16245,6 +18782,7 @@ export namespace Prisma { orderNumber: string | null customerId: string | null branchId: string | null + channel: $Enums.OrderChannel | null status: $Enums.OrderStatus | null totalGoldWeightGrams: Decimal | null wageWeightGrams: Decimal | null @@ -16260,6 +18798,7 @@ export namespace Prisma { orderNumber: string | null customerId: string | null branchId: string | null + channel: $Enums.OrderChannel | null status: $Enums.OrderStatus | null totalGoldWeightGrams: Decimal | null wageWeightGrams: Decimal | null @@ -16275,6 +18814,7 @@ export namespace Prisma { orderNumber: number customerId: number branchId: number + channel: number status: number totalGoldWeightGrams: number wageWeightGrams: number @@ -16304,6 +18844,7 @@ export namespace Prisma { orderNumber?: true customerId?: true branchId?: true + channel?: true status?: true totalGoldWeightGrams?: true wageWeightGrams?: true @@ -16319,6 +18860,7 @@ export namespace Prisma { orderNumber?: true customerId?: true branchId?: true + channel?: true status?: true totalGoldWeightGrams?: true wageWeightGrams?: true @@ -16334,6 +18876,7 @@ export namespace Prisma { orderNumber?: true customerId?: true branchId?: true + channel?: true status?: true totalGoldWeightGrams?: true wageWeightGrams?: true @@ -16436,6 +18979,7 @@ export namespace Prisma { orderNumber: string customerId: string branchId: string | null + channel: $Enums.OrderChannel status: $Enums.OrderStatus totalGoldWeightGrams: Decimal wageWeightGrams: Decimal @@ -16470,6 +19014,7 @@ export namespace Prisma { orderNumber?: boolean customerId?: boolean branchId?: boolean + channel?: boolean status?: boolean totalGoldWeightGrams?: boolean wageWeightGrams?: boolean @@ -16492,6 +19037,7 @@ export namespace Prisma { orderNumber?: boolean customerId?: boolean branchId?: boolean + channel?: boolean status?: boolean totalGoldWeightGrams?: boolean wageWeightGrams?: boolean @@ -16509,6 +19055,7 @@ export namespace Prisma { orderNumber?: boolean customerId?: boolean branchId?: boolean + channel?: boolean status?: boolean totalGoldWeightGrams?: boolean wageWeightGrams?: boolean @@ -16548,6 +19095,10 @@ export namespace Prisma { orderNumber: string customerId: string branchId: string | null + /** + * Which sales channel placed this order — see OrderChannel. + */ + channel: $Enums.OrderChannel status: $Enums.OrderStatus /** * Total gold weight incl. wage across all items ("allGram" / order.w). @@ -16968,6 +19519,7 @@ export namespace Prisma { readonly orderNumber: FieldRef<"Order", 'String'> readonly customerId: FieldRef<"Order", 'String'> readonly branchId: FieldRef<"Order", 'String'> + readonly channel: FieldRef<"Order", 'OrderChannel'> readonly status: FieldRef<"Order", 'OrderStatus'> readonly totalGoldWeightGrams: FieldRef<"Order", 'Decimal'> readonly wageWeightGrams: FieldRef<"Order", 'Decimal'> @@ -21596,12 +24148,16 @@ export namespace Prisma { amount: Decimal | null karatPerMille: number | null pricePerGramRialAtEntry: Decimal | null + originalValue: Decimal | null + priceRial: Decimal | null } export type LedgerEntrySumAggregateOutputType = { amount: Decimal | null karatPerMille: number | null pricePerGramRialAtEntry: Decimal | null + originalValue: Decimal | null + priceRial: Decimal | null } export type LedgerEntryMinAggregateOutputType = { @@ -21617,6 +24173,14 @@ export namespace Prisma { confirmed: boolean | null confirmedAt: Date | null postedByAdminUserId: string | null + labName: string | null + hallmark: string | null + accountName: string | null + bankName: string | null + transferTo: string | null + originalValue: Decimal | null + priceRial: Decimal | null + receivedAt: Date | null note: string | null createdAt: Date | null } @@ -21634,6 +24198,14 @@ export namespace Prisma { confirmed: boolean | null confirmedAt: Date | null postedByAdminUserId: string | null + labName: string | null + hallmark: string | null + accountName: string | null + bankName: string | null + transferTo: string | null + originalValue: Decimal | null + priceRial: Decimal | null + receivedAt: Date | null note: string | null createdAt: Date | null } @@ -21651,6 +24223,14 @@ export namespace Prisma { confirmed: number confirmedAt: number postedByAdminUserId: number + labName: number + hallmark: number + accountName: number + bankName: number + transferTo: number + originalValue: number + priceRial: number + receivedAt: number note: number createdAt: number _all: number @@ -21661,12 +24241,16 @@ export namespace Prisma { amount?: true karatPerMille?: true pricePerGramRialAtEntry?: true + originalValue?: true + priceRial?: true } export type LedgerEntrySumAggregateInputType = { amount?: true karatPerMille?: true pricePerGramRialAtEntry?: true + originalValue?: true + priceRial?: true } export type LedgerEntryMinAggregateInputType = { @@ -21682,6 +24266,14 @@ export namespace Prisma { confirmed?: true confirmedAt?: true postedByAdminUserId?: true + labName?: true + hallmark?: true + accountName?: true + bankName?: true + transferTo?: true + originalValue?: true + priceRial?: true + receivedAt?: true note?: true createdAt?: true } @@ -21699,6 +24291,14 @@ export namespace Prisma { confirmed?: true confirmedAt?: true postedByAdminUserId?: true + labName?: true + hallmark?: true + accountName?: true + bankName?: true + transferTo?: true + originalValue?: true + priceRial?: true + receivedAt?: true note?: true createdAt?: true } @@ -21716,6 +24316,14 @@ export namespace Prisma { confirmed?: true confirmedAt?: true postedByAdminUserId?: true + labName?: true + hallmark?: true + accountName?: true + bankName?: true + transferTo?: true + originalValue?: true + priceRial?: true + receivedAt?: true note?: true createdAt?: true _all?: true @@ -21820,6 +24428,14 @@ export namespace Prisma { confirmed: boolean confirmedAt: Date | null postedByAdminUserId: string | null + labName: string | null + hallmark: string | null + accountName: string | null + bankName: string | null + transferTo: string | null + originalValue: Decimal | null + priceRial: Decimal | null + receivedAt: Date | null note: string | null createdAt: Date _count: LedgerEntryCountAggregateOutputType | null @@ -21856,6 +24472,14 @@ export namespace Prisma { confirmed?: boolean confirmedAt?: boolean postedByAdminUserId?: boolean + labName?: boolean + hallmark?: boolean + accountName?: boolean + bankName?: boolean + transferTo?: boolean + originalValue?: boolean + priceRial?: boolean + receivedAt?: boolean note?: boolean createdAt?: boolean customer?: boolean | CustomerDefaultArgs<ExtArgs> @@ -21876,6 +24500,14 @@ export namespace Prisma { confirmed?: boolean confirmedAt?: boolean postedByAdminUserId?: boolean + labName?: boolean + hallmark?: boolean + accountName?: boolean + bankName?: boolean + transferTo?: boolean + originalValue?: boolean + priceRial?: boolean + receivedAt?: boolean note?: boolean createdAt?: boolean customer?: boolean | CustomerDefaultArgs<ExtArgs> @@ -21896,6 +24528,14 @@ export namespace Prisma { confirmed?: boolean confirmedAt?: boolean postedByAdminUserId?: boolean + labName?: boolean + hallmark?: boolean + accountName?: boolean + bankName?: boolean + transferTo?: boolean + originalValue?: boolean + priceRial?: boolean + receivedAt?: boolean note?: boolean createdAt?: boolean } @@ -21943,6 +24583,27 @@ export namespace Prisma { confirmed: boolean confirmedAt: Date | null postedByAdminUserId: string | null + /** + * Instrument metadata from the legacy "cash" document form. Which fields are + * filled depends on sourceType: a melted-gold receipt carries lab/hallmark and + * the pre-normalization weight, a cheque carries the account and bank, and a + * transfer carries its destination. + * Legacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date. + */ + labName: string | null + hallmark: string | null + accountName: string | null + bankName: string | null + transferTo: string | null + /** + * Weight as handed over, BEFORE karat normalization (legacy original_value). + */ + originalValue: Prisma.Decimal | null + /** + * Rial amount for cash/cheque documents (legacy price). + */ + priceRial: Prisma.Decimal | null + receivedAt: Date | null note: string | null createdAt: Date }, ExtArgs["result"]["ledgerEntry"]> @@ -22353,6 +25014,14 @@ export namespace Prisma { readonly confirmed: FieldRef<"LedgerEntry", 'Boolean'> readonly confirmedAt: FieldRef<"LedgerEntry", 'DateTime'> readonly postedByAdminUserId: FieldRef<"LedgerEntry", 'String'> + readonly labName: FieldRef<"LedgerEntry", 'String'> + readonly hallmark: FieldRef<"LedgerEntry", 'String'> + readonly accountName: FieldRef<"LedgerEntry", 'String'> + readonly bankName: FieldRef<"LedgerEntry", 'String'> + readonly transferTo: FieldRef<"LedgerEntry", 'String'> + readonly originalValue: FieldRef<"LedgerEntry", 'Decimal'> + readonly priceRial: FieldRef<"LedgerEntry", 'Decimal'> + readonly receivedAt: FieldRef<"LedgerEntry", 'DateTime'> readonly note: FieldRef<"LedgerEntry", 'String'> readonly createdAt: FieldRef<"LedgerEntry", 'DateTime'> } @@ -24636,6 +27305,13628 @@ export namespace Prisma { } + /** + * Model UserType + */ + + export type AggregateUserType = { + _count: UserTypeCountAggregateOutputType | null + _avg: UserTypeAvgAggregateOutputType | null + _sum: UserTypeSumAggregateOutputType | null + _min: UserTypeMinAggregateOutputType | null + _max: UserTypeMaxAggregateOutputType | null + } + + export type UserTypeAvgAggregateOutputType = { + id: number | null + } + + export type UserTypeSumAggregateOutputType = { + id: number | null + } + + export type UserTypeMinAggregateOutputType = { + id: number | null + title: string | null + isActive: boolean | null + createdAt: Date | null + } + + export type UserTypeMaxAggregateOutputType = { + id: number | null + title: string | null + isActive: boolean | null + createdAt: Date | null + } + + export type UserTypeCountAggregateOutputType = { + id: number + title: number + isActive: number + createdAt: number + _all: number + } + + + export type UserTypeAvgAggregateInputType = { + id?: true + } + + export type UserTypeSumAggregateInputType = { + id?: true + } + + export type UserTypeMinAggregateInputType = { + id?: true + title?: true + isActive?: true + createdAt?: true + } + + export type UserTypeMaxAggregateInputType = { + id?: true + title?: true + isActive?: true + createdAt?: true + } + + export type UserTypeCountAggregateInputType = { + id?: true + title?: true + isActive?: true + createdAt?: true + _all?: true + } + + export type UserTypeAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which UserType to aggregate. + */ + where?: UserTypeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserTypes to fetch. + */ + orderBy?: UserTypeOrderByWithRelationInput | UserTypeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: UserTypeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserTypes 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` UserTypes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned UserTypes + **/ + _count?: true | UserTypeCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: UserTypeAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: UserTypeSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UserTypeMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UserTypeMaxAggregateInputType + } + + export type GetUserTypeAggregateType<T extends UserTypeAggregateArgs> = { + [P in keyof T & keyof AggregateUserType]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateUserType[P]> + : GetScalarType<T[P], AggregateUserType[P]> + } + + + + + export type UserTypeGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: UserTypeWhereInput + orderBy?: UserTypeOrderByWithAggregationInput | UserTypeOrderByWithAggregationInput[] + by: UserTypeScalarFieldEnum[] | UserTypeScalarFieldEnum + having?: UserTypeScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserTypeCountAggregateInputType | true + _avg?: UserTypeAvgAggregateInputType + _sum?: UserTypeSumAggregateInputType + _min?: UserTypeMinAggregateInputType + _max?: UserTypeMaxAggregateInputType + } + + export type UserTypeGroupByOutputType = { + id: number + title: string + isActive: boolean + createdAt: Date + _count: UserTypeCountAggregateOutputType | null + _avg: UserTypeAvgAggregateOutputType | null + _sum: UserTypeSumAggregateOutputType | null + _min: UserTypeMinAggregateOutputType | null + _max: UserTypeMaxAggregateOutputType | null + } + + type GetUserTypeGroupByPayload<T extends UserTypeGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<UserTypeGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof UserTypeGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], UserTypeGroupByOutputType[P]> + : GetScalarType<T[P], UserTypeGroupByOutputType[P]> + } + > + > + + + export type UserTypeSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + title?: boolean + isActive?: boolean + createdAt?: boolean + permissions?: boolean | UserType$permissionsArgs<ExtArgs> + adminUsers?: boolean | UserType$adminUsersArgs<ExtArgs> + _count?: boolean | UserTypeCountOutputTypeDefaultArgs<ExtArgs> + }, ExtArgs["result"]["userType"]> + + export type UserTypeSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + title?: boolean + isActive?: boolean + createdAt?: boolean + }, ExtArgs["result"]["userType"]> + + export type UserTypeSelectScalar = { + id?: boolean + title?: boolean + isActive?: boolean + createdAt?: boolean + } + + export type UserTypeInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + permissions?: boolean | UserType$permissionsArgs<ExtArgs> + adminUsers?: boolean | UserType$adminUsersArgs<ExtArgs> + _count?: boolean | UserTypeCountOutputTypeDefaultArgs<ExtArgs> + } + export type UserTypeIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = {} + + export type $UserTypePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "UserType" + objects: { + permissions: Prisma.$PermissionPayload<ExtArgs>[] + adminUsers: Prisma.$AdminUserPayload<ExtArgs>[] + } + scalars: $Extensions.GetPayloadResult<{ + /** + * Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded + * rows keep their legacy identity rather than getting new cuids. + */ + id: number + title: string + isActive: boolean + createdAt: Date + }, ExtArgs["result"]["userType"]> + composites: {} + } + + type UserTypeGetPayload<S extends boolean | null | undefined | UserTypeDefaultArgs> = $Result.GetResult<Prisma.$UserTypePayload, S> + + type UserTypeCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<UserTypeFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: UserTypeCountAggregateInputType | true + } + + export interface UserTypeDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['UserType'], meta: { name: 'UserType' } } + /** + * Find zero or one UserType that matches the filter. + * @param {UserTypeFindUniqueArgs} args - Arguments to find a UserType + * @example + * // Get one UserType + * const userType = await prisma.userType.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends UserTypeFindUniqueArgs>(args: SelectSubset<T, UserTypeFindUniqueArgs<ExtArgs>>): Prisma__UserTypeClient<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one UserType that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UserTypeFindUniqueOrThrowArgs} args - Arguments to find a UserType + * @example + * // Get one UserType + * const userType = await prisma.userType.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends UserTypeFindUniqueOrThrowArgs>(args: SelectSubset<T, UserTypeFindUniqueOrThrowArgs<ExtArgs>>): Prisma__UserTypeClient<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first UserType 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 {UserTypeFindFirstArgs} args - Arguments to find a UserType + * @example + * // Get one UserType + * const userType = await prisma.userType.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends UserTypeFindFirstArgs>(args?: SelectSubset<T, UserTypeFindFirstArgs<ExtArgs>>): Prisma__UserTypeClient<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first UserType 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 {UserTypeFindFirstOrThrowArgs} args - Arguments to find a UserType + * @example + * // Get one UserType + * const userType = await prisma.userType.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends UserTypeFindFirstOrThrowArgs>(args?: SelectSubset<T, UserTypeFindFirstOrThrowArgs<ExtArgs>>): Prisma__UserTypeClient<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more UserTypes 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 {UserTypeFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all UserTypes + * const userTypes = await prisma.userType.findMany() + * + * // Get first 10 UserTypes + * const userTypes = await prisma.userType.findMany({ take: 10 }) + * + * // Only select the `id` + * const userTypeWithIdOnly = await prisma.userType.findMany({ select: { id: true } }) + * + */ + findMany<T extends UserTypeFindManyArgs>(args?: SelectSubset<T, UserTypeFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "findMany">> + + /** + * Create a UserType. + * @param {UserTypeCreateArgs} args - Arguments to create a UserType. + * @example + * // Create one UserType + * const UserType = await prisma.userType.create({ + * data: { + * // ... data to create a UserType + * } + * }) + * + */ + create<T extends UserTypeCreateArgs>(args: SelectSubset<T, UserTypeCreateArgs<ExtArgs>>): Prisma__UserTypeClient<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many UserTypes. + * @param {UserTypeCreateManyArgs} args - Arguments to create many UserTypes. + * @example + * // Create many UserTypes + * const userType = await prisma.userType.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends UserTypeCreateManyArgs>(args?: SelectSubset<T, UserTypeCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many UserTypes and returns the data saved in the database. + * @param {UserTypeCreateManyAndReturnArgs} args - Arguments to create many UserTypes. + * @example + * // Create many UserTypes + * const userType = await prisma.userType.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many UserTypes and only return the `id` + * const userTypeWithIdOnly = await prisma.userType.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends UserTypeCreateManyAndReturnArgs>(args?: SelectSubset<T, UserTypeCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a UserType. + * @param {UserTypeDeleteArgs} args - Arguments to delete one UserType. + * @example + * // Delete one UserType + * const UserType = await prisma.userType.delete({ + * where: { + * // ... filter to delete one UserType + * } + * }) + * + */ + delete<T extends UserTypeDeleteArgs>(args: SelectSubset<T, UserTypeDeleteArgs<ExtArgs>>): Prisma__UserTypeClient<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one UserType. + * @param {UserTypeUpdateArgs} args - Arguments to update one UserType. + * @example + * // Update one UserType + * const userType = await prisma.userType.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends UserTypeUpdateArgs>(args: SelectSubset<T, UserTypeUpdateArgs<ExtArgs>>): Prisma__UserTypeClient<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more UserTypes. + * @param {UserTypeDeleteManyArgs} args - Arguments to filter UserTypes to delete. + * @example + * // Delete a few UserTypes + * const { count } = await prisma.userType.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends UserTypeDeleteManyArgs>(args?: SelectSubset<T, UserTypeDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more UserTypes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserTypeUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many UserTypes + * const userType = await prisma.userType.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends UserTypeUpdateManyArgs>(args: SelectSubset<T, UserTypeUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one UserType. + * @param {UserTypeUpsertArgs} args - Arguments to update or create a UserType. + * @example + * // Update or create a UserType + * const userType = await prisma.userType.upsert({ + * create: { + * // ... data to create a UserType + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the UserType we want to update + * } + * }) + */ + upsert<T extends UserTypeUpsertArgs>(args: SelectSubset<T, UserTypeUpsertArgs<ExtArgs>>): Prisma__UserTypeClient<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of UserTypes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserTypeCountArgs} args - Arguments to filter UserTypes to count. + * @example + * // Count the number of UserTypes + * const count = await prisma.userType.count({ + * where: { + * // ... the filter for the UserTypes we want to count + * } + * }) + **/ + count<T extends UserTypeCountArgs>( + args?: Subset<T, UserTypeCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], UserTypeCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a UserType. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserTypeAggregateArgs} 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<T extends UserTypeAggregateArgs>(args: Subset<T, UserTypeAggregateArgs>): Prisma.PrismaPromise<GetUserTypeAggregateType<T>> + + /** + * Group by UserType. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserTypeGroupByArgs} 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 UserTypeGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: UserTypeGroupByArgs['orderBy'] } + : { orderBy?: UserTypeGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, UserTypeGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetUserTypeGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the UserType model + */ + readonly fields: UserTypeFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for UserType. + * 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__UserTypeClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + permissions<T extends UserType$permissionsArgs<ExtArgs> = {}>(args?: Subset<T, UserType$permissionsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "findMany"> | Null> + adminUsers<T extends UserType$adminUsersArgs<ExtArgs> = {}>(args?: Subset<T, UserType$adminUsersArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$AdminUserPayload<ExtArgs>, T, "findMany"> | 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the UserType model + */ + interface UserTypeFieldRefs { + readonly id: FieldRef<"UserType", 'Int'> + readonly title: FieldRef<"UserType", 'String'> + readonly isActive: FieldRef<"UserType", 'Boolean'> + readonly createdAt: FieldRef<"UserType", 'DateTime'> + } + + + // Custom InputTypes + /** + * UserType findUnique + */ + export type UserTypeFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + /** + * Filter, which UserType to fetch. + */ + where: UserTypeWhereUniqueInput + } + + /** + * UserType findUniqueOrThrow + */ + export type UserTypeFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + /** + * Filter, which UserType to fetch. + */ + where: UserTypeWhereUniqueInput + } + + /** + * UserType findFirst + */ + export type UserTypeFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + /** + * Filter, which UserType to fetch. + */ + where?: UserTypeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserTypes to fetch. + */ + orderBy?: UserTypeOrderByWithRelationInput | UserTypeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for UserTypes. + */ + cursor?: UserTypeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserTypes 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` UserTypes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of UserTypes. + */ + distinct?: UserTypeScalarFieldEnum | UserTypeScalarFieldEnum[] + } + + /** + * UserType findFirstOrThrow + */ + export type UserTypeFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + /** + * Filter, which UserType to fetch. + */ + where?: UserTypeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserTypes to fetch. + */ + orderBy?: UserTypeOrderByWithRelationInput | UserTypeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for UserTypes. + */ + cursor?: UserTypeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserTypes 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` UserTypes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of UserTypes. + */ + distinct?: UserTypeScalarFieldEnum | UserTypeScalarFieldEnum[] + } + + /** + * UserType findMany + */ + export type UserTypeFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + /** + * Filter, which UserTypes to fetch. + */ + where?: UserTypeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UserTypes to fetch. + */ + orderBy?: UserTypeOrderByWithRelationInput | UserTypeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing UserTypes. + */ + cursor?: UserTypeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UserTypes 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` UserTypes. + */ + skip?: number + distinct?: UserTypeScalarFieldEnum | UserTypeScalarFieldEnum[] + } + + /** + * UserType create + */ + export type UserTypeCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + /** + * The data needed to create a UserType. + */ + data: XOR<UserTypeCreateInput, UserTypeUncheckedCreateInput> + } + + /** + * UserType createMany + */ + export type UserTypeCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many UserTypes. + */ + data: UserTypeCreateManyInput | UserTypeCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * UserType createManyAndReturn + */ + export type UserTypeCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many UserTypes. + */ + data: UserTypeCreateManyInput | UserTypeCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * UserType update + */ + export type UserTypeUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + /** + * The data needed to update a UserType. + */ + data: XOR<UserTypeUpdateInput, UserTypeUncheckedUpdateInput> + /** + * Choose, which UserType to update. + */ + where: UserTypeWhereUniqueInput + } + + /** + * UserType updateMany + */ + export type UserTypeUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update UserTypes. + */ + data: XOR<UserTypeUpdateManyMutationInput, UserTypeUncheckedUpdateManyInput> + /** + * Filter which UserTypes to update + */ + where?: UserTypeWhereInput + } + + /** + * UserType upsert + */ + export type UserTypeUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + /** + * The filter to search for the UserType to update in case it exists. + */ + where: UserTypeWhereUniqueInput + /** + * In case the UserType found by the `where` argument doesn't exist, create a new UserType with this data. + */ + create: XOR<UserTypeCreateInput, UserTypeUncheckedCreateInput> + /** + * In case the UserType was found with the provided `where` argument, update it with this data. + */ + update: XOR<UserTypeUpdateInput, UserTypeUncheckedUpdateInput> + } + + /** + * UserType delete + */ + export type UserTypeDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + /** + * Filter which UserType to delete. + */ + where: UserTypeWhereUniqueInput + } + + /** + * UserType deleteMany + */ + export type UserTypeDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which UserTypes to delete + */ + where?: UserTypeWhereInput + } + + /** + * UserType.permissions + */ + export type UserType$permissionsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + where?: PermissionWhereInput + orderBy?: PermissionOrderByWithRelationInput | PermissionOrderByWithRelationInput[] + cursor?: PermissionWhereUniqueInput + take?: number + skip?: number + distinct?: PermissionScalarFieldEnum | PermissionScalarFieldEnum[] + } + + /** + * UserType.adminUsers + */ + export type UserType$adminUsersArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the AdminUser + */ + select?: AdminUserSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminUserInclude<ExtArgs> | null + where?: AdminUserWhereInput + orderBy?: AdminUserOrderByWithRelationInput | AdminUserOrderByWithRelationInput[] + cursor?: AdminUserWhereUniqueInput + take?: number + skip?: number + distinct?: AdminUserScalarFieldEnum | AdminUserScalarFieldEnum[] + } + + /** + * UserType without action + */ + export type UserTypeDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UserType + */ + select?: UserTypeSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UserTypeInclude<ExtArgs> | null + } + + + /** + * Model Permission + */ + + export type AggregatePermission = { + _count: PermissionCountAggregateOutputType | null + _avg: PermissionAvgAggregateOutputType | null + _sum: PermissionSumAggregateOutputType | null + _min: PermissionMinAggregateOutputType | null + _max: PermissionMaxAggregateOutputType | null + } + + export type PermissionAvgAggregateOutputType = { + userTypeId: number | null + } + + export type PermissionSumAggregateOutputType = { + userTypeId: number | null + } + + export type PermissionMinAggregateOutputType = { + rid: string | null + userTypeId: number | null + } + + export type PermissionMaxAggregateOutputType = { + rid: string | null + userTypeId: number | null + } + + export type PermissionCountAggregateOutputType = { + rid: number + userTypeId: number + _all: number + } + + + export type PermissionAvgAggregateInputType = { + userTypeId?: true + } + + export type PermissionSumAggregateInputType = { + userTypeId?: true + } + + export type PermissionMinAggregateInputType = { + rid?: true + userTypeId?: true + } + + export type PermissionMaxAggregateInputType = { + rid?: true + userTypeId?: true + } + + export type PermissionCountAggregateInputType = { + rid?: true + userTypeId?: true + _all?: true + } + + export type PermissionAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which Permission to aggregate. + */ + where?: PermissionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Permissions to fetch. + */ + orderBy?: PermissionOrderByWithRelationInput | PermissionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: PermissionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Permissions 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` Permissions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Permissions + **/ + _count?: true | PermissionCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PermissionAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PermissionSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PermissionMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PermissionMaxAggregateInputType + } + + export type GetPermissionAggregateType<T extends PermissionAggregateArgs> = { + [P in keyof T & keyof AggregatePermission]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregatePermission[P]> + : GetScalarType<T[P], AggregatePermission[P]> + } + + + + + export type PermissionGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: PermissionWhereInput + orderBy?: PermissionOrderByWithAggregationInput | PermissionOrderByWithAggregationInput[] + by: PermissionScalarFieldEnum[] | PermissionScalarFieldEnum + having?: PermissionScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PermissionCountAggregateInputType | true + _avg?: PermissionAvgAggregateInputType + _sum?: PermissionSumAggregateInputType + _min?: PermissionMinAggregateInputType + _max?: PermissionMaxAggregateInputType + } + + export type PermissionGroupByOutputType = { + rid: string + userTypeId: number + _count: PermissionCountAggregateOutputType | null + _avg: PermissionAvgAggregateOutputType | null + _sum: PermissionSumAggregateOutputType | null + _min: PermissionMinAggregateOutputType | null + _max: PermissionMaxAggregateOutputType | null + } + + type GetPermissionGroupByPayload<T extends PermissionGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<PermissionGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof PermissionGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], PermissionGroupByOutputType[P]> + : GetScalarType<T[P], PermissionGroupByOutputType[P]> + } + > + > + + + export type PermissionSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + rid?: boolean + userTypeId?: boolean + userType?: boolean | UserTypeDefaultArgs<ExtArgs> + }, ExtArgs["result"]["permission"]> + + export type PermissionSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + rid?: boolean + userTypeId?: boolean + userType?: boolean | UserTypeDefaultArgs<ExtArgs> + }, ExtArgs["result"]["permission"]> + + export type PermissionSelectScalar = { + rid?: boolean + userTypeId?: boolean + } + + export type PermissionInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + userType?: boolean | UserTypeDefaultArgs<ExtArgs> + } + export type PermissionIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + userType?: boolean | UserTypeDefaultArgs<ExtArgs> + } + + export type $PermissionPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "Permission" + objects: { + userType: Prisma.$UserTypePayload<ExtArgs> + } + scalars: $Extensions.GetPayloadResult<{ + /** + * Dotted permission id, e.g. "order.list", "persons.list.client.omde". + */ + rid: string + userTypeId: number + }, ExtArgs["result"]["permission"]> + composites: {} + } + + type PermissionGetPayload<S extends boolean | null | undefined | PermissionDefaultArgs> = $Result.GetResult<Prisma.$PermissionPayload, S> + + type PermissionCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<PermissionFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: PermissionCountAggregateInputType | true + } + + export interface PermissionDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['Permission'], meta: { name: 'Permission' } } + /** + * Find zero or one Permission that matches the filter. + * @param {PermissionFindUniqueArgs} args - Arguments to find a Permission + * @example + * // Get one Permission + * const permission = await prisma.permission.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends PermissionFindUniqueArgs>(args: SelectSubset<T, PermissionFindUniqueArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one Permission that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PermissionFindUniqueOrThrowArgs} args - Arguments to find a Permission + * @example + * // Get one Permission + * const permission = await prisma.permission.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends PermissionFindUniqueOrThrowArgs>(args: SelectSubset<T, PermissionFindUniqueOrThrowArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first Permission 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 {PermissionFindFirstArgs} args - Arguments to find a Permission + * @example + * // Get one Permission + * const permission = await prisma.permission.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends PermissionFindFirstArgs>(args?: SelectSubset<T, PermissionFindFirstArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first Permission 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 {PermissionFindFirstOrThrowArgs} args - Arguments to find a Permission + * @example + * // Get one Permission + * const permission = await prisma.permission.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends PermissionFindFirstOrThrowArgs>(args?: SelectSubset<T, PermissionFindFirstOrThrowArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more Permissions 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 {PermissionFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Permissions + * const permissions = await prisma.permission.findMany() + * + * // Get first 10 Permissions + * const permissions = await prisma.permission.findMany({ take: 10 }) + * + * // Only select the `rid` + * const permissionWithRidOnly = await prisma.permission.findMany({ select: { rid: true } }) + * + */ + findMany<T extends PermissionFindManyArgs>(args?: SelectSubset<T, PermissionFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "findMany">> + + /** + * Create a Permission. + * @param {PermissionCreateArgs} args - Arguments to create a Permission. + * @example + * // Create one Permission + * const Permission = await prisma.permission.create({ + * data: { + * // ... data to create a Permission + * } + * }) + * + */ + create<T extends PermissionCreateArgs>(args: SelectSubset<T, PermissionCreateArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many Permissions. + * @param {PermissionCreateManyArgs} args - Arguments to create many Permissions. + * @example + * // Create many Permissions + * const permission = await prisma.permission.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends PermissionCreateManyArgs>(args?: SelectSubset<T, PermissionCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many Permissions and returns the data saved in the database. + * @param {PermissionCreateManyAndReturnArgs} args - Arguments to create many Permissions. + * @example + * // Create many Permissions + * const permission = await prisma.permission.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Permissions and only return the `rid` + * const permissionWithRidOnly = await prisma.permission.createManyAndReturn({ + * select: { rid: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends PermissionCreateManyAndReturnArgs>(args?: SelectSubset<T, PermissionCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a Permission. + * @param {PermissionDeleteArgs} args - Arguments to delete one Permission. + * @example + * // Delete one Permission + * const Permission = await prisma.permission.delete({ + * where: { + * // ... filter to delete one Permission + * } + * }) + * + */ + delete<T extends PermissionDeleteArgs>(args: SelectSubset<T, PermissionDeleteArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one Permission. + * @param {PermissionUpdateArgs} args - Arguments to update one Permission. + * @example + * // Update one Permission + * const permission = await prisma.permission.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends PermissionUpdateArgs>(args: SelectSubset<T, PermissionUpdateArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more Permissions. + * @param {PermissionDeleteManyArgs} args - Arguments to filter Permissions to delete. + * @example + * // Delete a few Permissions + * const { count } = await prisma.permission.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends PermissionDeleteManyArgs>(args?: SelectSubset<T, PermissionDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more Permissions. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PermissionUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Permissions + * const permission = await prisma.permission.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends PermissionUpdateManyArgs>(args: SelectSubset<T, PermissionUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one Permission. + * @param {PermissionUpsertArgs} args - Arguments to update or create a Permission. + * @example + * // Update or create a Permission + * const permission = await prisma.permission.upsert({ + * create: { + * // ... data to create a Permission + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Permission we want to update + * } + * }) + */ + upsert<T extends PermissionUpsertArgs>(args: SelectSubset<T, PermissionUpsertArgs<ExtArgs>>): Prisma__PermissionClient<$Result.GetResult<Prisma.$PermissionPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of Permissions. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PermissionCountArgs} args - Arguments to filter Permissions to count. + * @example + * // Count the number of Permissions + * const count = await prisma.permission.count({ + * where: { + * // ... the filter for the Permissions we want to count + * } + * }) + **/ + count<T extends PermissionCountArgs>( + args?: Subset<T, PermissionCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], PermissionCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a Permission. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PermissionAggregateArgs} 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<T extends PermissionAggregateArgs>(args: Subset<T, PermissionAggregateArgs>): Prisma.PrismaPromise<GetPermissionAggregateType<T>> + + /** + * Group by Permission. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PermissionGroupByArgs} 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 PermissionGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: PermissionGroupByArgs['orderBy'] } + : { orderBy?: PermissionGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, PermissionGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPermissionGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the Permission model + */ + readonly fields: PermissionFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Permission. + * 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__PermissionClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + userType<T extends UserTypeDefaultArgs<ExtArgs> = {}>(args?: Subset<T, UserTypeDefaultArgs<ExtArgs>>): Prisma__UserTypeClient<$Result.GetResult<Prisma.$UserTypePayload<ExtArgs>, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + /** + * 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the Permission model + */ + interface PermissionFieldRefs { + readonly rid: FieldRef<"Permission", 'String'> + readonly userTypeId: FieldRef<"Permission", 'Int'> + } + + + // Custom InputTypes + /** + * Permission findUnique + */ + export type PermissionFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + /** + * Filter, which Permission to fetch. + */ + where: PermissionWhereUniqueInput + } + + /** + * Permission findUniqueOrThrow + */ + export type PermissionFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + /** + * Filter, which Permission to fetch. + */ + where: PermissionWhereUniqueInput + } + + /** + * Permission findFirst + */ + export type PermissionFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + /** + * Filter, which Permission to fetch. + */ + where?: PermissionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Permissions to fetch. + */ + orderBy?: PermissionOrderByWithRelationInput | PermissionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Permissions. + */ + cursor?: PermissionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Permissions 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` Permissions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Permissions. + */ + distinct?: PermissionScalarFieldEnum | PermissionScalarFieldEnum[] + } + + /** + * Permission findFirstOrThrow + */ + export type PermissionFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + /** + * Filter, which Permission to fetch. + */ + where?: PermissionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Permissions to fetch. + */ + orderBy?: PermissionOrderByWithRelationInput | PermissionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Permissions. + */ + cursor?: PermissionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Permissions 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` Permissions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Permissions. + */ + distinct?: PermissionScalarFieldEnum | PermissionScalarFieldEnum[] + } + + /** + * Permission findMany + */ + export type PermissionFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + /** + * Filter, which Permissions to fetch. + */ + where?: PermissionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Permissions to fetch. + */ + orderBy?: PermissionOrderByWithRelationInput | PermissionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Permissions. + */ + cursor?: PermissionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Permissions 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` Permissions. + */ + skip?: number + distinct?: PermissionScalarFieldEnum | PermissionScalarFieldEnum[] + } + + /** + * Permission create + */ + export type PermissionCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + /** + * The data needed to create a Permission. + */ + data: XOR<PermissionCreateInput, PermissionUncheckedCreateInput> + } + + /** + * Permission createMany + */ + export type PermissionCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many Permissions. + */ + data: PermissionCreateManyInput | PermissionCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Permission createManyAndReturn + */ + export type PermissionCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many Permissions. + */ + data: PermissionCreateManyInput | PermissionCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionIncludeCreateManyAndReturn<ExtArgs> | null + } + + /** + * Permission update + */ + export type PermissionUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + /** + * The data needed to update a Permission. + */ + data: XOR<PermissionUpdateInput, PermissionUncheckedUpdateInput> + /** + * Choose, which Permission to update. + */ + where: PermissionWhereUniqueInput + } + + /** + * Permission updateMany + */ + export type PermissionUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update Permissions. + */ + data: XOR<PermissionUpdateManyMutationInput, PermissionUncheckedUpdateManyInput> + /** + * Filter which Permissions to update + */ + where?: PermissionWhereInput + } + + /** + * Permission upsert + */ + export type PermissionUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + /** + * The filter to search for the Permission to update in case it exists. + */ + where: PermissionWhereUniqueInput + /** + * In case the Permission found by the `where` argument doesn't exist, create a new Permission with this data. + */ + create: XOR<PermissionCreateInput, PermissionUncheckedCreateInput> + /** + * In case the Permission was found with the provided `where` argument, update it with this data. + */ + update: XOR<PermissionUpdateInput, PermissionUncheckedUpdateInput> + } + + /** + * Permission delete + */ + export type PermissionDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + /** + * Filter which Permission to delete. + */ + where: PermissionWhereUniqueInput + } + + /** + * Permission deleteMany + */ + export type PermissionDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which Permissions to delete + */ + where?: PermissionWhereInput + } + + /** + * Permission without action + */ + export type PermissionDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Permission + */ + select?: PermissionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PermissionInclude<ExtArgs> | null + } + + + /** + * Model Comment + */ + + export type AggregateComment = { + _count: CommentCountAggregateOutputType | null + _min: CommentMinAggregateOutputType | null + _max: CommentMaxAggregateOutputType | null + } + + export type CommentMinAggregateOutputType = { + id: string | null + productId: string | null + customerId: string | null + body: string | null + status: $Enums.CommentStatus | null + replyToId: string | null + createdAt: Date | null + updatedAt: Date | null + } + + export type CommentMaxAggregateOutputType = { + id: string | null + productId: string | null + customerId: string | null + body: string | null + status: $Enums.CommentStatus | null + replyToId: string | null + createdAt: Date | null + updatedAt: Date | null + } + + export type CommentCountAggregateOutputType = { + id: number + productId: number + customerId: number + body: number + status: number + replyToId: number + createdAt: number + updatedAt: number + _all: number + } + + + export type CommentMinAggregateInputType = { + id?: true + productId?: true + customerId?: true + body?: true + status?: true + replyToId?: true + createdAt?: true + updatedAt?: true + } + + export type CommentMaxAggregateInputType = { + id?: true + productId?: true + customerId?: true + body?: true + status?: true + replyToId?: true + createdAt?: true + updatedAt?: true + } + + export type CommentCountAggregateInputType = { + id?: true + productId?: true + customerId?: true + body?: true + status?: true + replyToId?: true + createdAt?: true + updatedAt?: true + _all?: true + } + + export type CommentAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which Comment to aggregate. + */ + where?: CommentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Comments to fetch. + */ + orderBy?: CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: CommentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Comments 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` Comments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Comments + **/ + _count?: true | CommentCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: CommentMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: CommentMaxAggregateInputType + } + + export type GetCommentAggregateType<T extends CommentAggregateArgs> = { + [P in keyof T & keyof AggregateComment]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateComment[P]> + : GetScalarType<T[P], AggregateComment[P]> + } + + + + + export type CommentGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: CommentWhereInput + orderBy?: CommentOrderByWithAggregationInput | CommentOrderByWithAggregationInput[] + by: CommentScalarFieldEnum[] | CommentScalarFieldEnum + having?: CommentScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: CommentCountAggregateInputType | true + _min?: CommentMinAggregateInputType + _max?: CommentMaxAggregateInputType + } + + export type CommentGroupByOutputType = { + id: string + productId: string + customerId: string + body: string + status: $Enums.CommentStatus + replyToId: string | null + createdAt: Date + updatedAt: Date + _count: CommentCountAggregateOutputType | null + _min: CommentMinAggregateOutputType | null + _max: CommentMaxAggregateOutputType | null + } + + type GetCommentGroupByPayload<T extends CommentGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<CommentGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof CommentGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], CommentGroupByOutputType[P]> + : GetScalarType<T[P], CommentGroupByOutputType[P]> + } + > + > + + + export type CommentSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + productId?: boolean + customerId?: boolean + body?: boolean + status?: boolean + replyToId?: boolean + createdAt?: boolean + updatedAt?: boolean + product?: boolean | ProductDefaultArgs<ExtArgs> + customer?: boolean | CustomerDefaultArgs<ExtArgs> + replyTo?: boolean | Comment$replyToArgs<ExtArgs> + replies?: boolean | Comment$repliesArgs<ExtArgs> + _count?: boolean | CommentCountOutputTypeDefaultArgs<ExtArgs> + }, ExtArgs["result"]["comment"]> + + export type CommentSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + productId?: boolean + customerId?: boolean + body?: boolean + status?: boolean + replyToId?: boolean + createdAt?: boolean + updatedAt?: boolean + product?: boolean | ProductDefaultArgs<ExtArgs> + customer?: boolean | CustomerDefaultArgs<ExtArgs> + replyTo?: boolean | Comment$replyToArgs<ExtArgs> + }, ExtArgs["result"]["comment"]> + + export type CommentSelectScalar = { + id?: boolean + productId?: boolean + customerId?: boolean + body?: boolean + status?: boolean + replyToId?: boolean + createdAt?: boolean + updatedAt?: boolean + } + + export type CommentInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + product?: boolean | ProductDefaultArgs<ExtArgs> + customer?: boolean | CustomerDefaultArgs<ExtArgs> + replyTo?: boolean | Comment$replyToArgs<ExtArgs> + replies?: boolean | Comment$repliesArgs<ExtArgs> + _count?: boolean | CommentCountOutputTypeDefaultArgs<ExtArgs> + } + export type CommentIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + product?: boolean | ProductDefaultArgs<ExtArgs> + customer?: boolean | CustomerDefaultArgs<ExtArgs> + replyTo?: boolean | Comment$replyToArgs<ExtArgs> + } + + export type $CommentPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "Comment" + objects: { + product: Prisma.$ProductPayload<ExtArgs> + customer: Prisma.$CustomerPayload<ExtArgs> + replyTo: Prisma.$CommentPayload<ExtArgs> | null + replies: Prisma.$CommentPayload<ExtArgs>[] + } + scalars: $Extensions.GetPayloadResult<{ + id: string + productId: string + customerId: string + body: string + status: $Enums.CommentStatus + /** + * Legacy `reply_to`: a staff reply threads under the comment it answers. + */ + replyToId: string | null + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["comment"]> + composites: {} + } + + type CommentGetPayload<S extends boolean | null | undefined | CommentDefaultArgs> = $Result.GetResult<Prisma.$CommentPayload, S> + + type CommentCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<CommentFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: CommentCountAggregateInputType | true + } + + export interface CommentDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['Comment'], meta: { name: 'Comment' } } + /** + * Find zero or one Comment that matches the filter. + * @param {CommentFindUniqueArgs} args - Arguments to find a Comment + * @example + * // Get one Comment + * const comment = await prisma.comment.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends CommentFindUniqueArgs>(args: SelectSubset<T, CommentFindUniqueArgs<ExtArgs>>): Prisma__CommentClient<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one Comment that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {CommentFindUniqueOrThrowArgs} args - Arguments to find a Comment + * @example + * // Get one Comment + * const comment = await prisma.comment.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends CommentFindUniqueOrThrowArgs>(args: SelectSubset<T, CommentFindUniqueOrThrowArgs<ExtArgs>>): Prisma__CommentClient<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first Comment 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 {CommentFindFirstArgs} args - Arguments to find a Comment + * @example + * // Get one Comment + * const comment = await prisma.comment.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends CommentFindFirstArgs>(args?: SelectSubset<T, CommentFindFirstArgs<ExtArgs>>): Prisma__CommentClient<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first Comment 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 {CommentFindFirstOrThrowArgs} args - Arguments to find a Comment + * @example + * // Get one Comment + * const comment = await prisma.comment.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends CommentFindFirstOrThrowArgs>(args?: SelectSubset<T, CommentFindFirstOrThrowArgs<ExtArgs>>): Prisma__CommentClient<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more Comments 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 {CommentFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Comments + * const comments = await prisma.comment.findMany() + * + * // Get first 10 Comments + * const comments = await prisma.comment.findMany({ take: 10 }) + * + * // Only select the `id` + * const commentWithIdOnly = await prisma.comment.findMany({ select: { id: true } }) + * + */ + findMany<T extends CommentFindManyArgs>(args?: SelectSubset<T, CommentFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "findMany">> + + /** + * Create a Comment. + * @param {CommentCreateArgs} args - Arguments to create a Comment. + * @example + * // Create one Comment + * const Comment = await prisma.comment.create({ + * data: { + * // ... data to create a Comment + * } + * }) + * + */ + create<T extends CommentCreateArgs>(args: SelectSubset<T, CommentCreateArgs<ExtArgs>>): Prisma__CommentClient<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many Comments. + * @param {CommentCreateManyArgs} args - Arguments to create many Comments. + * @example + * // Create many Comments + * const comment = await prisma.comment.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends CommentCreateManyArgs>(args?: SelectSubset<T, CommentCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many Comments and returns the data saved in the database. + * @param {CommentCreateManyAndReturnArgs} args - Arguments to create many Comments. + * @example + * // Create many Comments + * const comment = await prisma.comment.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Comments and only return the `id` + * const commentWithIdOnly = await prisma.comment.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends CommentCreateManyAndReturnArgs>(args?: SelectSubset<T, CommentCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a Comment. + * @param {CommentDeleteArgs} args - Arguments to delete one Comment. + * @example + * // Delete one Comment + * const Comment = await prisma.comment.delete({ + * where: { + * // ... filter to delete one Comment + * } + * }) + * + */ + delete<T extends CommentDeleteArgs>(args: SelectSubset<T, CommentDeleteArgs<ExtArgs>>): Prisma__CommentClient<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one Comment. + * @param {CommentUpdateArgs} args - Arguments to update one Comment. + * @example + * // Update one Comment + * const comment = await prisma.comment.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends CommentUpdateArgs>(args: SelectSubset<T, CommentUpdateArgs<ExtArgs>>): Prisma__CommentClient<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more Comments. + * @param {CommentDeleteManyArgs} args - Arguments to filter Comments to delete. + * @example + * // Delete a few Comments + * const { count } = await prisma.comment.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends CommentDeleteManyArgs>(args?: SelectSubset<T, CommentDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more Comments. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CommentUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Comments + * const comment = await prisma.comment.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends CommentUpdateManyArgs>(args: SelectSubset<T, CommentUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one Comment. + * @param {CommentUpsertArgs} args - Arguments to update or create a Comment. + * @example + * // Update or create a Comment + * const comment = await prisma.comment.upsert({ + * create: { + * // ... data to create a Comment + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Comment we want to update + * } + * }) + */ + upsert<T extends CommentUpsertArgs>(args: SelectSubset<T, CommentUpsertArgs<ExtArgs>>): Prisma__CommentClient<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of Comments. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CommentCountArgs} args - Arguments to filter Comments to count. + * @example + * // Count the number of Comments + * const count = await prisma.comment.count({ + * where: { + * // ... the filter for the Comments we want to count + * } + * }) + **/ + count<T extends CommentCountArgs>( + args?: Subset<T, CommentCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], CommentCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a Comment. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CommentAggregateArgs} 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<T extends CommentAggregateArgs>(args: Subset<T, CommentAggregateArgs>): Prisma.PrismaPromise<GetCommentAggregateType<T>> + + /** + * Group by Comment. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CommentGroupByArgs} 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 CommentGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: CommentGroupByArgs['orderBy'] } + : { orderBy?: CommentGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, CommentGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetCommentGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the Comment model + */ + readonly fields: CommentFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Comment. + * 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__CommentClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + product<T extends ProductDefaultArgs<ExtArgs> = {}>(args?: Subset<T, ProductDefaultArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + customer<T extends CustomerDefaultArgs<ExtArgs> = {}>(args?: Subset<T, CustomerDefaultArgs<ExtArgs>>): Prisma__CustomerClient<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + replyTo<T extends Comment$replyToArgs<ExtArgs> = {}>(args?: Subset<T, Comment$replyToArgs<ExtArgs>>): Prisma__CommentClient<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> + replies<T extends Comment$repliesArgs<ExtArgs> = {}>(args?: Subset<T, Comment$repliesArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CommentPayload<ExtArgs>, T, "findMany"> | 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the Comment model + */ + interface CommentFieldRefs { + readonly id: FieldRef<"Comment", 'String'> + readonly productId: FieldRef<"Comment", 'String'> + readonly customerId: FieldRef<"Comment", 'String'> + readonly body: FieldRef<"Comment", 'String'> + readonly status: FieldRef<"Comment", 'CommentStatus'> + readonly replyToId: FieldRef<"Comment", 'String'> + readonly createdAt: FieldRef<"Comment", 'DateTime'> + readonly updatedAt: FieldRef<"Comment", 'DateTime'> + } + + + // Custom InputTypes + /** + * Comment findUnique + */ + export type CommentFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + /** + * Filter, which Comment to fetch. + */ + where: CommentWhereUniqueInput + } + + /** + * Comment findUniqueOrThrow + */ + export type CommentFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + /** + * Filter, which Comment to fetch. + */ + where: CommentWhereUniqueInput + } + + /** + * Comment findFirst + */ + export type CommentFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + /** + * Filter, which Comment to fetch. + */ + where?: CommentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Comments to fetch. + */ + orderBy?: CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Comments. + */ + cursor?: CommentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Comments 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` Comments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Comments. + */ + distinct?: CommentScalarFieldEnum | CommentScalarFieldEnum[] + } + + /** + * Comment findFirstOrThrow + */ + export type CommentFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + /** + * Filter, which Comment to fetch. + */ + where?: CommentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Comments to fetch. + */ + orderBy?: CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Comments. + */ + cursor?: CommentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Comments 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` Comments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Comments. + */ + distinct?: CommentScalarFieldEnum | CommentScalarFieldEnum[] + } + + /** + * Comment findMany + */ + export type CommentFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + /** + * Filter, which Comments to fetch. + */ + where?: CommentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Comments to fetch. + */ + orderBy?: CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Comments. + */ + cursor?: CommentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Comments 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` Comments. + */ + skip?: number + distinct?: CommentScalarFieldEnum | CommentScalarFieldEnum[] + } + + /** + * Comment create + */ + export type CommentCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + /** + * The data needed to create a Comment. + */ + data: XOR<CommentCreateInput, CommentUncheckedCreateInput> + } + + /** + * Comment createMany + */ + export type CommentCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many Comments. + */ + data: CommentCreateManyInput | CommentCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Comment createManyAndReturn + */ + export type CommentCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many Comments. + */ + data: CommentCreateManyInput | CommentCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentIncludeCreateManyAndReturn<ExtArgs> | null + } + + /** + * Comment update + */ + export type CommentUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + /** + * The data needed to update a Comment. + */ + data: XOR<CommentUpdateInput, CommentUncheckedUpdateInput> + /** + * Choose, which Comment to update. + */ + where: CommentWhereUniqueInput + } + + /** + * Comment updateMany + */ + export type CommentUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update Comments. + */ + data: XOR<CommentUpdateManyMutationInput, CommentUncheckedUpdateManyInput> + /** + * Filter which Comments to update + */ + where?: CommentWhereInput + } + + /** + * Comment upsert + */ + export type CommentUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + /** + * The filter to search for the Comment to update in case it exists. + */ + where: CommentWhereUniqueInput + /** + * In case the Comment found by the `where` argument doesn't exist, create a new Comment with this data. + */ + create: XOR<CommentCreateInput, CommentUncheckedCreateInput> + /** + * In case the Comment was found with the provided `where` argument, update it with this data. + */ + update: XOR<CommentUpdateInput, CommentUncheckedUpdateInput> + } + + /** + * Comment delete + */ + export type CommentDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + /** + * Filter which Comment to delete. + */ + where: CommentWhereUniqueInput + } + + /** + * Comment deleteMany + */ + export type CommentDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which Comments to delete + */ + where?: CommentWhereInput + } + + /** + * Comment.replyTo + */ + export type Comment$replyToArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + where?: CommentWhereInput + } + + /** + * Comment.replies + */ + export type Comment$repliesArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + where?: CommentWhereInput + orderBy?: CommentOrderByWithRelationInput | CommentOrderByWithRelationInput[] + cursor?: CommentWhereUniqueInput + take?: number + skip?: number + distinct?: CommentScalarFieldEnum | CommentScalarFieldEnum[] + } + + /** + * Comment without action + */ + export type CommentDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Comment + */ + select?: CommentSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CommentInclude<ExtArgs> | null + } + + + /** + * Model Setting + */ + + export type AggregateSetting = { + _count: SettingCountAggregateOutputType | null + _min: SettingMinAggregateOutputType | null + _max: SettingMaxAggregateOutputType | null + } + + export type SettingMinAggregateOutputType = { + key: string | null + updatedAt: Date | null + } + + export type SettingMaxAggregateOutputType = { + key: string | null + updatedAt: Date | null + } + + export type SettingCountAggregateOutputType = { + key: number + value: number + updatedAt: number + _all: number + } + + + export type SettingMinAggregateInputType = { + key?: true + updatedAt?: true + } + + export type SettingMaxAggregateInputType = { + key?: true + updatedAt?: true + } + + export type SettingCountAggregateInputType = { + key?: true + value?: true + updatedAt?: true + _all?: true + } + + export type SettingAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which Setting to aggregate. + */ + where?: SettingWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Settings to fetch. + */ + orderBy?: SettingOrderByWithRelationInput | SettingOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: SettingWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Settings 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` Settings. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Settings + **/ + _count?: true | SettingCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: SettingMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: SettingMaxAggregateInputType + } + + export type GetSettingAggregateType<T extends SettingAggregateArgs> = { + [P in keyof T & keyof AggregateSetting]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateSetting[P]> + : GetScalarType<T[P], AggregateSetting[P]> + } + + + + + export type SettingGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: SettingWhereInput + orderBy?: SettingOrderByWithAggregationInput | SettingOrderByWithAggregationInput[] + by: SettingScalarFieldEnum[] | SettingScalarFieldEnum + having?: SettingScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: SettingCountAggregateInputType | true + _min?: SettingMinAggregateInputType + _max?: SettingMaxAggregateInputType + } + + export type SettingGroupByOutputType = { + key: string + value: JsonValue + updatedAt: Date + _count: SettingCountAggregateOutputType | null + _min: SettingMinAggregateOutputType | null + _max: SettingMaxAggregateOutputType | null + } + + type GetSettingGroupByPayload<T extends SettingGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<SettingGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof SettingGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], SettingGroupByOutputType[P]> + : GetScalarType<T[P], SettingGroupByOutputType[P]> + } + > + > + + + export type SettingSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + key?: boolean + value?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["setting"]> + + export type SettingSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + key?: boolean + value?: boolean + updatedAt?: boolean + }, ExtArgs["result"]["setting"]> + + export type SettingSelectScalar = { + key?: boolean + value?: boolean + updatedAt?: boolean + } + + + export type $SettingPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "Setting" + objects: {} + scalars: $Extensions.GetPayloadResult<{ + key: string + value: Prisma.JsonValue + updatedAt: Date + }, ExtArgs["result"]["setting"]> + composites: {} + } + + type SettingGetPayload<S extends boolean | null | undefined | SettingDefaultArgs> = $Result.GetResult<Prisma.$SettingPayload, S> + + type SettingCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<SettingFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: SettingCountAggregateInputType | true + } + + export interface SettingDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['Setting'], meta: { name: 'Setting' } } + /** + * Find zero or one Setting that matches the filter. + * @param {SettingFindUniqueArgs} args - Arguments to find a Setting + * @example + * // Get one Setting + * const setting = await prisma.setting.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends SettingFindUniqueArgs>(args: SelectSubset<T, SettingFindUniqueArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one Setting that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {SettingFindUniqueOrThrowArgs} args - Arguments to find a Setting + * @example + * // Get one Setting + * const setting = await prisma.setting.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends SettingFindUniqueOrThrowArgs>(args: SelectSubset<T, SettingFindUniqueOrThrowArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first Setting 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 {SettingFindFirstArgs} args - Arguments to find a Setting + * @example + * // Get one Setting + * const setting = await prisma.setting.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends SettingFindFirstArgs>(args?: SelectSubset<T, SettingFindFirstArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first Setting 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 {SettingFindFirstOrThrowArgs} args - Arguments to find a Setting + * @example + * // Get one Setting + * const setting = await prisma.setting.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends SettingFindFirstOrThrowArgs>(args?: SelectSubset<T, SettingFindFirstOrThrowArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more Settings 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 {SettingFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Settings + * const settings = await prisma.setting.findMany() + * + * // Get first 10 Settings + * const settings = await prisma.setting.findMany({ take: 10 }) + * + * // Only select the `key` + * const settingWithKeyOnly = await prisma.setting.findMany({ select: { key: true } }) + * + */ + findMany<T extends SettingFindManyArgs>(args?: SelectSubset<T, SettingFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "findMany">> + + /** + * Create a Setting. + * @param {SettingCreateArgs} args - Arguments to create a Setting. + * @example + * // Create one Setting + * const Setting = await prisma.setting.create({ + * data: { + * // ... data to create a Setting + * } + * }) + * + */ + create<T extends SettingCreateArgs>(args: SelectSubset<T, SettingCreateArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many Settings. + * @param {SettingCreateManyArgs} args - Arguments to create many Settings. + * @example + * // Create many Settings + * const setting = await prisma.setting.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends SettingCreateManyArgs>(args?: SelectSubset<T, SettingCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many Settings and returns the data saved in the database. + * @param {SettingCreateManyAndReturnArgs} args - Arguments to create many Settings. + * @example + * // Create many Settings + * const setting = await prisma.setting.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Settings and only return the `key` + * const settingWithKeyOnly = await prisma.setting.createManyAndReturn({ + * select: { key: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends SettingCreateManyAndReturnArgs>(args?: SelectSubset<T, SettingCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a Setting. + * @param {SettingDeleteArgs} args - Arguments to delete one Setting. + * @example + * // Delete one Setting + * const Setting = await prisma.setting.delete({ + * where: { + * // ... filter to delete one Setting + * } + * }) + * + */ + delete<T extends SettingDeleteArgs>(args: SelectSubset<T, SettingDeleteArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one Setting. + * @param {SettingUpdateArgs} args - Arguments to update one Setting. + * @example + * // Update one Setting + * const setting = await prisma.setting.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends SettingUpdateArgs>(args: SelectSubset<T, SettingUpdateArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more Settings. + * @param {SettingDeleteManyArgs} args - Arguments to filter Settings to delete. + * @example + * // Delete a few Settings + * const { count } = await prisma.setting.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends SettingDeleteManyArgs>(args?: SelectSubset<T, SettingDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more Settings. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SettingUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Settings + * const setting = await prisma.setting.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends SettingUpdateManyArgs>(args: SelectSubset<T, SettingUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one Setting. + * @param {SettingUpsertArgs} args - Arguments to update or create a Setting. + * @example + * // Update or create a Setting + * const setting = await prisma.setting.upsert({ + * create: { + * // ... data to create a Setting + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Setting we want to update + * } + * }) + */ + upsert<T extends SettingUpsertArgs>(args: SelectSubset<T, SettingUpsertArgs<ExtArgs>>): Prisma__SettingClient<$Result.GetResult<Prisma.$SettingPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of Settings. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SettingCountArgs} args - Arguments to filter Settings to count. + * @example + * // Count the number of Settings + * const count = await prisma.setting.count({ + * where: { + * // ... the filter for the Settings we want to count + * } + * }) + **/ + count<T extends SettingCountArgs>( + args?: Subset<T, SettingCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], SettingCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a Setting. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SettingAggregateArgs} 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<T extends SettingAggregateArgs>(args: Subset<T, SettingAggregateArgs>): Prisma.PrismaPromise<GetSettingAggregateType<T>> + + /** + * Group by Setting. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SettingGroupByArgs} 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 SettingGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: SettingGroupByArgs['orderBy'] } + : { orderBy?: SettingGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, SettingGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetSettingGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the Setting model + */ + readonly fields: SettingFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Setting. + * 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__SettingClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the Setting model + */ + interface SettingFieldRefs { + readonly key: FieldRef<"Setting", 'String'> + readonly value: FieldRef<"Setting", 'Json'> + readonly updatedAt: FieldRef<"Setting", 'DateTime'> + } + + + // Custom InputTypes + /** + * Setting findUnique + */ + export type SettingFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelect<ExtArgs> | null + /** + * Filter, which Setting to fetch. + */ + where: SettingWhereUniqueInput + } + + /** + * Setting findUniqueOrThrow + */ + export type SettingFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelect<ExtArgs> | null + /** + * Filter, which Setting to fetch. + */ + where: SettingWhereUniqueInput + } + + /** + * Setting findFirst + */ + export type SettingFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelect<ExtArgs> | null + /** + * Filter, which Setting to fetch. + */ + where?: SettingWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Settings to fetch. + */ + orderBy?: SettingOrderByWithRelationInput | SettingOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Settings. + */ + cursor?: SettingWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Settings 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` Settings. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Settings. + */ + distinct?: SettingScalarFieldEnum | SettingScalarFieldEnum[] + } + + /** + * Setting findFirstOrThrow + */ + export type SettingFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelect<ExtArgs> | null + /** + * Filter, which Setting to fetch. + */ + where?: SettingWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Settings to fetch. + */ + orderBy?: SettingOrderByWithRelationInput | SettingOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Settings. + */ + cursor?: SettingWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Settings 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` Settings. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Settings. + */ + distinct?: SettingScalarFieldEnum | SettingScalarFieldEnum[] + } + + /** + * Setting findMany + */ + export type SettingFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelect<ExtArgs> | null + /** + * Filter, which Settings to fetch. + */ + where?: SettingWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Settings to fetch. + */ + orderBy?: SettingOrderByWithRelationInput | SettingOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Settings. + */ + cursor?: SettingWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Settings 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` Settings. + */ + skip?: number + distinct?: SettingScalarFieldEnum | SettingScalarFieldEnum[] + } + + /** + * Setting create + */ + export type SettingCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelect<ExtArgs> | null + /** + * The data needed to create a Setting. + */ + data: XOR<SettingCreateInput, SettingUncheckedCreateInput> + } + + /** + * Setting createMany + */ + export type SettingCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many Settings. + */ + data: SettingCreateManyInput | SettingCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Setting createManyAndReturn + */ + export type SettingCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many Settings. + */ + data: SettingCreateManyInput | SettingCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Setting update + */ + export type SettingUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelect<ExtArgs> | null + /** + * The data needed to update a Setting. + */ + data: XOR<SettingUpdateInput, SettingUncheckedUpdateInput> + /** + * Choose, which Setting to update. + */ + where: SettingWhereUniqueInput + } + + /** + * Setting updateMany + */ + export type SettingUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update Settings. + */ + data: XOR<SettingUpdateManyMutationInput, SettingUncheckedUpdateManyInput> + /** + * Filter which Settings to update + */ + where?: SettingWhereInput + } + + /** + * Setting upsert + */ + export type SettingUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelect<ExtArgs> | null + /** + * The filter to search for the Setting to update in case it exists. + */ + where: SettingWhereUniqueInput + /** + * In case the Setting found by the `where` argument doesn't exist, create a new Setting with this data. + */ + create: XOR<SettingCreateInput, SettingUncheckedCreateInput> + /** + * In case the Setting was found with the provided `where` argument, update it with this data. + */ + update: XOR<SettingUpdateInput, SettingUncheckedUpdateInput> + } + + /** + * Setting delete + */ + export type SettingDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelect<ExtArgs> | null + /** + * Filter which Setting to delete. + */ + where: SettingWhereUniqueInput + } + + /** + * Setting deleteMany + */ + export type SettingDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which Settings to delete + */ + where?: SettingWhereInput + } + + /** + * Setting without action + */ + export type SettingDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Setting + */ + select?: SettingSelect<ExtArgs> | null + } + + + /** + * Model Promotion + */ + + export type AggregatePromotion = { + _count: PromotionCountAggregateOutputType | null + _avg: PromotionAvgAggregateOutputType | null + _sum: PromotionSumAggregateOutputType | null + _min: PromotionMinAggregateOutputType | null + _max: PromotionMaxAggregateOutputType | null + } + + export type PromotionAvgAggregateOutputType = { + discountPercent: Decimal | null + platform: number | null + } + + export type PromotionSumAggregateOutputType = { + discountPercent: Decimal | null + platform: number | null + } + + export type PromotionMinAggregateOutputType = { + id: string | null + title: string | null + description: string | null + scope: $Enums.PromotionScope | null + usage: $Enums.PromotionUsage | null + discountPercent: Decimal | null + isActive: boolean | null + platform: number | null + startsAt: Date | null + endsAt: Date | null + productId: string | null + categoryId: string | null + customerId: string | null + brandId: string | null + createdAt: Date | null + updatedAt: Date | null + } + + export type PromotionMaxAggregateOutputType = { + id: string | null + title: string | null + description: string | null + scope: $Enums.PromotionScope | null + usage: $Enums.PromotionUsage | null + discountPercent: Decimal | null + isActive: boolean | null + platform: number | null + startsAt: Date | null + endsAt: Date | null + productId: string | null + categoryId: string | null + customerId: string | null + brandId: string | null + createdAt: Date | null + updatedAt: Date | null + } + + export type PromotionCountAggregateOutputType = { + id: number + title: number + description: number + scope: number + usage: number + discountPercent: number + isActive: number + platform: number + startsAt: number + endsAt: number + productId: number + categoryId: number + customerId: number + brandId: number + createdAt: number + updatedAt: number + _all: number + } + + + export type PromotionAvgAggregateInputType = { + discountPercent?: true + platform?: true + } + + export type PromotionSumAggregateInputType = { + discountPercent?: true + platform?: true + } + + export type PromotionMinAggregateInputType = { + id?: true + title?: true + description?: true + scope?: true + usage?: true + discountPercent?: true + isActive?: true + platform?: true + startsAt?: true + endsAt?: true + productId?: true + categoryId?: true + customerId?: true + brandId?: true + createdAt?: true + updatedAt?: true + } + + export type PromotionMaxAggregateInputType = { + id?: true + title?: true + description?: true + scope?: true + usage?: true + discountPercent?: true + isActive?: true + platform?: true + startsAt?: true + endsAt?: true + productId?: true + categoryId?: true + customerId?: true + brandId?: true + createdAt?: true + updatedAt?: true + } + + export type PromotionCountAggregateInputType = { + id?: true + title?: true + description?: true + scope?: true + usage?: true + discountPercent?: true + isActive?: true + platform?: true + startsAt?: true + endsAt?: true + productId?: true + categoryId?: true + customerId?: true + brandId?: true + createdAt?: true + updatedAt?: true + _all?: true + } + + export type PromotionAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which Promotion to aggregate. + */ + where?: PromotionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Promotions to fetch. + */ + orderBy?: PromotionOrderByWithRelationInput | PromotionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: PromotionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Promotions 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` Promotions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Promotions + **/ + _count?: true | PromotionCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PromotionAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PromotionSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PromotionMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PromotionMaxAggregateInputType + } + + export type GetPromotionAggregateType<T extends PromotionAggregateArgs> = { + [P in keyof T & keyof AggregatePromotion]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregatePromotion[P]> + : GetScalarType<T[P], AggregatePromotion[P]> + } + + + + + export type PromotionGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: PromotionWhereInput + orderBy?: PromotionOrderByWithAggregationInput | PromotionOrderByWithAggregationInput[] + by: PromotionScalarFieldEnum[] | PromotionScalarFieldEnum + having?: PromotionScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PromotionCountAggregateInputType | true + _avg?: PromotionAvgAggregateInputType + _sum?: PromotionSumAggregateInputType + _min?: PromotionMinAggregateInputType + _max?: PromotionMaxAggregateInputType + } + + export type PromotionGroupByOutputType = { + id: string + title: string + description: string | null + scope: $Enums.PromotionScope + usage: $Enums.PromotionUsage + discountPercent: Decimal + isActive: boolean + platform: number + startsAt: Date | null + endsAt: Date | null + productId: string | null + categoryId: string | null + customerId: string | null + brandId: string | null + createdAt: Date + updatedAt: Date + _count: PromotionCountAggregateOutputType | null + _avg: PromotionAvgAggregateOutputType | null + _sum: PromotionSumAggregateOutputType | null + _min: PromotionMinAggregateOutputType | null + _max: PromotionMaxAggregateOutputType | null + } + + type GetPromotionGroupByPayload<T extends PromotionGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<PromotionGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof PromotionGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], PromotionGroupByOutputType[P]> + : GetScalarType<T[P], PromotionGroupByOutputType[P]> + } + > + > + + + export type PromotionSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + title?: boolean + description?: boolean + scope?: boolean + usage?: boolean + discountPercent?: boolean + isActive?: boolean + platform?: boolean + startsAt?: boolean + endsAt?: boolean + productId?: boolean + categoryId?: boolean + customerId?: boolean + brandId?: boolean + createdAt?: boolean + updatedAt?: boolean + product?: boolean | Promotion$productArgs<ExtArgs> + category?: boolean | Promotion$categoryArgs<ExtArgs> + customer?: boolean | Promotion$customerArgs<ExtArgs> + brand?: boolean | Promotion$brandArgs<ExtArgs> + }, ExtArgs["result"]["promotion"]> + + export type PromotionSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + title?: boolean + description?: boolean + scope?: boolean + usage?: boolean + discountPercent?: boolean + isActive?: boolean + platform?: boolean + startsAt?: boolean + endsAt?: boolean + productId?: boolean + categoryId?: boolean + customerId?: boolean + brandId?: boolean + createdAt?: boolean + updatedAt?: boolean + product?: boolean | Promotion$productArgs<ExtArgs> + category?: boolean | Promotion$categoryArgs<ExtArgs> + customer?: boolean | Promotion$customerArgs<ExtArgs> + brand?: boolean | Promotion$brandArgs<ExtArgs> + }, ExtArgs["result"]["promotion"]> + + export type PromotionSelectScalar = { + id?: boolean + title?: boolean + description?: boolean + scope?: boolean + usage?: boolean + discountPercent?: boolean + isActive?: boolean + platform?: boolean + startsAt?: boolean + endsAt?: boolean + productId?: boolean + categoryId?: boolean + customerId?: boolean + brandId?: boolean + createdAt?: boolean + updatedAt?: boolean + } + + export type PromotionInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + product?: boolean | Promotion$productArgs<ExtArgs> + category?: boolean | Promotion$categoryArgs<ExtArgs> + customer?: boolean | Promotion$customerArgs<ExtArgs> + brand?: boolean | Promotion$brandArgs<ExtArgs> + } + export type PromotionIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + product?: boolean | Promotion$productArgs<ExtArgs> + category?: boolean | Promotion$categoryArgs<ExtArgs> + customer?: boolean | Promotion$customerArgs<ExtArgs> + brand?: boolean | Promotion$brandArgs<ExtArgs> + } + + export type $PromotionPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "Promotion" + objects: { + product: Prisma.$ProductPayload<ExtArgs> | null + category: Prisma.$CategoryPayload<ExtArgs> | null + customer: Prisma.$CustomerPayload<ExtArgs> | null + brand: Prisma.$BrandPayload<ExtArgs> | null + } + scalars: $Extensions.GetPayloadResult<{ + id: string + title: string + description: string | null + scope: $Enums.PromotionScope + usage: $Enums.PromotionUsage + /** + * Percentage off, 0-100 (legacy discount_percent). + */ + discountPercent: Prisma.Decimal + isActive: boolean + /** + * Which storefront it shows on, mirroring Product.showType (legacy platform). + */ + platform: number + startsAt: Date | null + endsAt: Date | null + /** + * Exactly one of these is populated, per `scope`. + */ + productId: string | null + categoryId: string | null + customerId: string | null + brandId: string | null + createdAt: Date + updatedAt: Date + }, ExtArgs["result"]["promotion"]> + composites: {} + } + + type PromotionGetPayload<S extends boolean | null | undefined | PromotionDefaultArgs> = $Result.GetResult<Prisma.$PromotionPayload, S> + + type PromotionCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<PromotionFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: PromotionCountAggregateInputType | true + } + + export interface PromotionDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['Promotion'], meta: { name: 'Promotion' } } + /** + * Find zero or one Promotion that matches the filter. + * @param {PromotionFindUniqueArgs} args - Arguments to find a Promotion + * @example + * // Get one Promotion + * const promotion = await prisma.promotion.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends PromotionFindUniqueArgs>(args: SelectSubset<T, PromotionFindUniqueArgs<ExtArgs>>): Prisma__PromotionClient<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one Promotion that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PromotionFindUniqueOrThrowArgs} args - Arguments to find a Promotion + * @example + * // Get one Promotion + * const promotion = await prisma.promotion.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends PromotionFindUniqueOrThrowArgs>(args: SelectSubset<T, PromotionFindUniqueOrThrowArgs<ExtArgs>>): Prisma__PromotionClient<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first Promotion 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 {PromotionFindFirstArgs} args - Arguments to find a Promotion + * @example + * // Get one Promotion + * const promotion = await prisma.promotion.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends PromotionFindFirstArgs>(args?: SelectSubset<T, PromotionFindFirstArgs<ExtArgs>>): Prisma__PromotionClient<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first Promotion 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 {PromotionFindFirstOrThrowArgs} args - Arguments to find a Promotion + * @example + * // Get one Promotion + * const promotion = await prisma.promotion.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends PromotionFindFirstOrThrowArgs>(args?: SelectSubset<T, PromotionFindFirstOrThrowArgs<ExtArgs>>): Prisma__PromotionClient<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more Promotions 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 {PromotionFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Promotions + * const promotions = await prisma.promotion.findMany() + * + * // Get first 10 Promotions + * const promotions = await prisma.promotion.findMany({ take: 10 }) + * + * // Only select the `id` + * const promotionWithIdOnly = await prisma.promotion.findMany({ select: { id: true } }) + * + */ + findMany<T extends PromotionFindManyArgs>(args?: SelectSubset<T, PromotionFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "findMany">> + + /** + * Create a Promotion. + * @param {PromotionCreateArgs} args - Arguments to create a Promotion. + * @example + * // Create one Promotion + * const Promotion = await prisma.promotion.create({ + * data: { + * // ... data to create a Promotion + * } + * }) + * + */ + create<T extends PromotionCreateArgs>(args: SelectSubset<T, PromotionCreateArgs<ExtArgs>>): Prisma__PromotionClient<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many Promotions. + * @param {PromotionCreateManyArgs} args - Arguments to create many Promotions. + * @example + * // Create many Promotions + * const promotion = await prisma.promotion.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends PromotionCreateManyArgs>(args?: SelectSubset<T, PromotionCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many Promotions and returns the data saved in the database. + * @param {PromotionCreateManyAndReturnArgs} args - Arguments to create many Promotions. + * @example + * // Create many Promotions + * const promotion = await prisma.promotion.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Promotions and only return the `id` + * const promotionWithIdOnly = await prisma.promotion.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends PromotionCreateManyAndReturnArgs>(args?: SelectSubset<T, PromotionCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a Promotion. + * @param {PromotionDeleteArgs} args - Arguments to delete one Promotion. + * @example + * // Delete one Promotion + * const Promotion = await prisma.promotion.delete({ + * where: { + * // ... filter to delete one Promotion + * } + * }) + * + */ + delete<T extends PromotionDeleteArgs>(args: SelectSubset<T, PromotionDeleteArgs<ExtArgs>>): Prisma__PromotionClient<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one Promotion. + * @param {PromotionUpdateArgs} args - Arguments to update one Promotion. + * @example + * // Update one Promotion + * const promotion = await prisma.promotion.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends PromotionUpdateArgs>(args: SelectSubset<T, PromotionUpdateArgs<ExtArgs>>): Prisma__PromotionClient<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more Promotions. + * @param {PromotionDeleteManyArgs} args - Arguments to filter Promotions to delete. + * @example + * // Delete a few Promotions + * const { count } = await prisma.promotion.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends PromotionDeleteManyArgs>(args?: SelectSubset<T, PromotionDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more Promotions. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PromotionUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Promotions + * const promotion = await prisma.promotion.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends PromotionUpdateManyArgs>(args: SelectSubset<T, PromotionUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one Promotion. + * @param {PromotionUpsertArgs} args - Arguments to update or create a Promotion. + * @example + * // Update or create a Promotion + * const promotion = await prisma.promotion.upsert({ + * create: { + * // ... data to create a Promotion + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Promotion we want to update + * } + * }) + */ + upsert<T extends PromotionUpsertArgs>(args: SelectSubset<T, PromotionUpsertArgs<ExtArgs>>): Prisma__PromotionClient<$Result.GetResult<Prisma.$PromotionPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of Promotions. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PromotionCountArgs} args - Arguments to filter Promotions to count. + * @example + * // Count the number of Promotions + * const count = await prisma.promotion.count({ + * where: { + * // ... the filter for the Promotions we want to count + * } + * }) + **/ + count<T extends PromotionCountArgs>( + args?: Subset<T, PromotionCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], PromotionCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a Promotion. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PromotionAggregateArgs} 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<T extends PromotionAggregateArgs>(args: Subset<T, PromotionAggregateArgs>): Prisma.PrismaPromise<GetPromotionAggregateType<T>> + + /** + * Group by Promotion. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PromotionGroupByArgs} 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 PromotionGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: PromotionGroupByArgs['orderBy'] } + : { orderBy?: PromotionGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, PromotionGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPromotionGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the Promotion model + */ + readonly fields: PromotionFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Promotion. + * 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__PromotionClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + product<T extends Promotion$productArgs<ExtArgs> = {}>(args?: Subset<T, Promotion$productArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> + category<T extends Promotion$categoryArgs<ExtArgs> = {}>(args?: Subset<T, Promotion$categoryArgs<ExtArgs>>): Prisma__CategoryClient<$Result.GetResult<Prisma.$CategoryPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> + customer<T extends Promotion$customerArgs<ExtArgs> = {}>(args?: Subset<T, Promotion$customerArgs<ExtArgs>>): Prisma__CustomerClient<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> + brand<T extends Promotion$brandArgs<ExtArgs> = {}>(args?: Subset<T, Promotion$brandArgs<ExtArgs>>): Prisma__BrandClient<$Result.GetResult<Prisma.$BrandPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> + /** + * 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the Promotion model + */ + interface PromotionFieldRefs { + readonly id: FieldRef<"Promotion", 'String'> + readonly title: FieldRef<"Promotion", 'String'> + readonly description: FieldRef<"Promotion", 'String'> + readonly scope: FieldRef<"Promotion", 'PromotionScope'> + readonly usage: FieldRef<"Promotion", 'PromotionUsage'> + readonly discountPercent: FieldRef<"Promotion", 'Decimal'> + readonly isActive: FieldRef<"Promotion", 'Boolean'> + readonly platform: FieldRef<"Promotion", 'Int'> + readonly startsAt: FieldRef<"Promotion", 'DateTime'> + readonly endsAt: FieldRef<"Promotion", 'DateTime'> + readonly productId: FieldRef<"Promotion", 'String'> + readonly categoryId: FieldRef<"Promotion", 'String'> + readonly customerId: FieldRef<"Promotion", 'String'> + readonly brandId: FieldRef<"Promotion", 'String'> + readonly createdAt: FieldRef<"Promotion", 'DateTime'> + readonly updatedAt: FieldRef<"Promotion", 'DateTime'> + } + + + // Custom InputTypes + /** + * Promotion findUnique + */ + export type PromotionFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + /** + * Filter, which Promotion to fetch. + */ + where: PromotionWhereUniqueInput + } + + /** + * Promotion findUniqueOrThrow + */ + export type PromotionFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + /** + * Filter, which Promotion to fetch. + */ + where: PromotionWhereUniqueInput + } + + /** + * Promotion findFirst + */ + export type PromotionFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + /** + * Filter, which Promotion to fetch. + */ + where?: PromotionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Promotions to fetch. + */ + orderBy?: PromotionOrderByWithRelationInput | PromotionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Promotions. + */ + cursor?: PromotionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Promotions 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` Promotions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Promotions. + */ + distinct?: PromotionScalarFieldEnum | PromotionScalarFieldEnum[] + } + + /** + * Promotion findFirstOrThrow + */ + export type PromotionFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + /** + * Filter, which Promotion to fetch. + */ + where?: PromotionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Promotions to fetch. + */ + orderBy?: PromotionOrderByWithRelationInput | PromotionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Promotions. + */ + cursor?: PromotionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Promotions 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` Promotions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Promotions. + */ + distinct?: PromotionScalarFieldEnum | PromotionScalarFieldEnum[] + } + + /** + * Promotion findMany + */ + export type PromotionFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + /** + * Filter, which Promotions to fetch. + */ + where?: PromotionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Promotions to fetch. + */ + orderBy?: PromotionOrderByWithRelationInput | PromotionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Promotions. + */ + cursor?: PromotionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Promotions 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` Promotions. + */ + skip?: number + distinct?: PromotionScalarFieldEnum | PromotionScalarFieldEnum[] + } + + /** + * Promotion create + */ + export type PromotionCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + /** + * The data needed to create a Promotion. + */ + data: XOR<PromotionCreateInput, PromotionUncheckedCreateInput> + } + + /** + * Promotion createMany + */ + export type PromotionCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many Promotions. + */ + data: PromotionCreateManyInput | PromotionCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Promotion createManyAndReturn + */ + export type PromotionCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many Promotions. + */ + data: PromotionCreateManyInput | PromotionCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionIncludeCreateManyAndReturn<ExtArgs> | null + } + + /** + * Promotion update + */ + export type PromotionUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + /** + * The data needed to update a Promotion. + */ + data: XOR<PromotionUpdateInput, PromotionUncheckedUpdateInput> + /** + * Choose, which Promotion to update. + */ + where: PromotionWhereUniqueInput + } + + /** + * Promotion updateMany + */ + export type PromotionUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update Promotions. + */ + data: XOR<PromotionUpdateManyMutationInput, PromotionUncheckedUpdateManyInput> + /** + * Filter which Promotions to update + */ + where?: PromotionWhereInput + } + + /** + * Promotion upsert + */ + export type PromotionUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + /** + * The filter to search for the Promotion to update in case it exists. + */ + where: PromotionWhereUniqueInput + /** + * In case the Promotion found by the `where` argument doesn't exist, create a new Promotion with this data. + */ + create: XOR<PromotionCreateInput, PromotionUncheckedCreateInput> + /** + * In case the Promotion was found with the provided `where` argument, update it with this data. + */ + update: XOR<PromotionUpdateInput, PromotionUncheckedUpdateInput> + } + + /** + * Promotion delete + */ + export type PromotionDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + /** + * Filter which Promotion to delete. + */ + where: PromotionWhereUniqueInput + } + + /** + * Promotion deleteMany + */ + export type PromotionDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which Promotions to delete + */ + where?: PromotionWhereInput + } + + /** + * Promotion.product + */ + export type Promotion$productArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Product + */ + select?: ProductSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: ProductInclude<ExtArgs> | null + where?: ProductWhereInput + } + + /** + * Promotion.category + */ + export type Promotion$categoryArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Category + */ + select?: CategorySelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CategoryInclude<ExtArgs> | null + where?: CategoryWhereInput + } + + /** + * Promotion.customer + */ + export type Promotion$customerArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Customer + */ + select?: CustomerSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerInclude<ExtArgs> | null + where?: CustomerWhereInput + } + + /** + * Promotion.brand + */ + export type Promotion$brandArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Brand + */ + select?: BrandSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BrandInclude<ExtArgs> | null + where?: BrandWhereInput + } + + /** + * Promotion without action + */ + export type PromotionDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Promotion + */ + select?: PromotionSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: PromotionInclude<ExtArgs> | null + } + + + /** + * Model PromotionExclusion + */ + + export type AggregatePromotionExclusion = { + _count: PromotionExclusionCountAggregateOutputType | null + _avg: PromotionExclusionAvgAggregateOutputType | null + _sum: PromotionExclusionSumAggregateOutputType | null + _min: PromotionExclusionMinAggregateOutputType | null + _max: PromotionExclusionMaxAggregateOutputType | null + } + + export type PromotionExclusionAvgAggregateOutputType = { + type: number | null + } + + export type PromotionExclusionSumAggregateOutputType = { + type: number | null + } + + export type PromotionExclusionMinAggregateOutputType = { + id: string | null + type: number | null + itemId: string | null + createdAt: Date | null + } + + export type PromotionExclusionMaxAggregateOutputType = { + id: string | null + type: number | null + itemId: string | null + createdAt: Date | null + } + + export type PromotionExclusionCountAggregateOutputType = { + id: number + type: number + itemId: number + createdAt: number + _all: number + } + + + export type PromotionExclusionAvgAggregateInputType = { + type?: true + } + + export type PromotionExclusionSumAggregateInputType = { + type?: true + } + + export type PromotionExclusionMinAggregateInputType = { + id?: true + type?: true + itemId?: true + createdAt?: true + } + + export type PromotionExclusionMaxAggregateInputType = { + id?: true + type?: true + itemId?: true + createdAt?: true + } + + export type PromotionExclusionCountAggregateInputType = { + id?: true + type?: true + itemId?: true + createdAt?: true + _all?: true + } + + export type PromotionExclusionAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which PromotionExclusion to aggregate. + */ + where?: PromotionExclusionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PromotionExclusions to fetch. + */ + orderBy?: PromotionExclusionOrderByWithRelationInput | PromotionExclusionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: PromotionExclusionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PromotionExclusions 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` PromotionExclusions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned PromotionExclusions + **/ + _count?: true | PromotionExclusionCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PromotionExclusionAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PromotionExclusionSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PromotionExclusionMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PromotionExclusionMaxAggregateInputType + } + + export type GetPromotionExclusionAggregateType<T extends PromotionExclusionAggregateArgs> = { + [P in keyof T & keyof AggregatePromotionExclusion]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregatePromotionExclusion[P]> + : GetScalarType<T[P], AggregatePromotionExclusion[P]> + } + + + + + export type PromotionExclusionGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: PromotionExclusionWhereInput + orderBy?: PromotionExclusionOrderByWithAggregationInput | PromotionExclusionOrderByWithAggregationInput[] + by: PromotionExclusionScalarFieldEnum[] | PromotionExclusionScalarFieldEnum + having?: PromotionExclusionScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PromotionExclusionCountAggregateInputType | true + _avg?: PromotionExclusionAvgAggregateInputType + _sum?: PromotionExclusionSumAggregateInputType + _min?: PromotionExclusionMinAggregateInputType + _max?: PromotionExclusionMaxAggregateInputType + } + + export type PromotionExclusionGroupByOutputType = { + id: string + type: number + itemId: string + createdAt: Date + _count: PromotionExclusionCountAggregateOutputType | null + _avg: PromotionExclusionAvgAggregateOutputType | null + _sum: PromotionExclusionSumAggregateOutputType | null + _min: PromotionExclusionMinAggregateOutputType | null + _max: PromotionExclusionMaxAggregateOutputType | null + } + + type GetPromotionExclusionGroupByPayload<T extends PromotionExclusionGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<PromotionExclusionGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof PromotionExclusionGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], PromotionExclusionGroupByOutputType[P]> + : GetScalarType<T[P], PromotionExclusionGroupByOutputType[P]> + } + > + > + + + export type PromotionExclusionSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + type?: boolean + itemId?: boolean + createdAt?: boolean + }, ExtArgs["result"]["promotionExclusion"]> + + export type PromotionExclusionSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + type?: boolean + itemId?: boolean + createdAt?: boolean + }, ExtArgs["result"]["promotionExclusion"]> + + export type PromotionExclusionSelectScalar = { + id?: boolean + type?: boolean + itemId?: boolean + createdAt?: boolean + } + + + export type $PromotionExclusionPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "PromotionExclusion" + objects: {} + scalars: $Extensions.GetPayloadResult<{ + id: string + type: number + itemId: string + createdAt: Date + }, ExtArgs["result"]["promotionExclusion"]> + composites: {} + } + + type PromotionExclusionGetPayload<S extends boolean | null | undefined | PromotionExclusionDefaultArgs> = $Result.GetResult<Prisma.$PromotionExclusionPayload, S> + + type PromotionExclusionCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<PromotionExclusionFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: PromotionExclusionCountAggregateInputType | true + } + + export interface PromotionExclusionDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['PromotionExclusion'], meta: { name: 'PromotionExclusion' } } + /** + * Find zero or one PromotionExclusion that matches the filter. + * @param {PromotionExclusionFindUniqueArgs} args - Arguments to find a PromotionExclusion + * @example + * // Get one PromotionExclusion + * const promotionExclusion = await prisma.promotionExclusion.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends PromotionExclusionFindUniqueArgs>(args: SelectSubset<T, PromotionExclusionFindUniqueArgs<ExtArgs>>): Prisma__PromotionExclusionClient<$Result.GetResult<Prisma.$PromotionExclusionPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one PromotionExclusion that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PromotionExclusionFindUniqueOrThrowArgs} args - Arguments to find a PromotionExclusion + * @example + * // Get one PromotionExclusion + * const promotionExclusion = await prisma.promotionExclusion.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends PromotionExclusionFindUniqueOrThrowArgs>(args: SelectSubset<T, PromotionExclusionFindUniqueOrThrowArgs<ExtArgs>>): Prisma__PromotionExclusionClient<$Result.GetResult<Prisma.$PromotionExclusionPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first PromotionExclusion 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 {PromotionExclusionFindFirstArgs} args - Arguments to find a PromotionExclusion + * @example + * // Get one PromotionExclusion + * const promotionExclusion = await prisma.promotionExclusion.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends PromotionExclusionFindFirstArgs>(args?: SelectSubset<T, PromotionExclusionFindFirstArgs<ExtArgs>>): Prisma__PromotionExclusionClient<$Result.GetResult<Prisma.$PromotionExclusionPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first PromotionExclusion 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 {PromotionExclusionFindFirstOrThrowArgs} args - Arguments to find a PromotionExclusion + * @example + * // Get one PromotionExclusion + * const promotionExclusion = await prisma.promotionExclusion.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends PromotionExclusionFindFirstOrThrowArgs>(args?: SelectSubset<T, PromotionExclusionFindFirstOrThrowArgs<ExtArgs>>): Prisma__PromotionExclusionClient<$Result.GetResult<Prisma.$PromotionExclusionPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more PromotionExclusions 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 {PromotionExclusionFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all PromotionExclusions + * const promotionExclusions = await prisma.promotionExclusion.findMany() + * + * // Get first 10 PromotionExclusions + * const promotionExclusions = await prisma.promotionExclusion.findMany({ take: 10 }) + * + * // Only select the `id` + * const promotionExclusionWithIdOnly = await prisma.promotionExclusion.findMany({ select: { id: true } }) + * + */ + findMany<T extends PromotionExclusionFindManyArgs>(args?: SelectSubset<T, PromotionExclusionFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PromotionExclusionPayload<ExtArgs>, T, "findMany">> + + /** + * Create a PromotionExclusion. + * @param {PromotionExclusionCreateArgs} args - Arguments to create a PromotionExclusion. + * @example + * // Create one PromotionExclusion + * const PromotionExclusion = await prisma.promotionExclusion.create({ + * data: { + * // ... data to create a PromotionExclusion + * } + * }) + * + */ + create<T extends PromotionExclusionCreateArgs>(args: SelectSubset<T, PromotionExclusionCreateArgs<ExtArgs>>): Prisma__PromotionExclusionClient<$Result.GetResult<Prisma.$PromotionExclusionPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many PromotionExclusions. + * @param {PromotionExclusionCreateManyArgs} args - Arguments to create many PromotionExclusions. + * @example + * // Create many PromotionExclusions + * const promotionExclusion = await prisma.promotionExclusion.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends PromotionExclusionCreateManyArgs>(args?: SelectSubset<T, PromotionExclusionCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many PromotionExclusions and returns the data saved in the database. + * @param {PromotionExclusionCreateManyAndReturnArgs} args - Arguments to create many PromotionExclusions. + * @example + * // Create many PromotionExclusions + * const promotionExclusion = await prisma.promotionExclusion.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many PromotionExclusions and only return the `id` + * const promotionExclusionWithIdOnly = await prisma.promotionExclusion.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends PromotionExclusionCreateManyAndReturnArgs>(args?: SelectSubset<T, PromotionExclusionCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$PromotionExclusionPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a PromotionExclusion. + * @param {PromotionExclusionDeleteArgs} args - Arguments to delete one PromotionExclusion. + * @example + * // Delete one PromotionExclusion + * const PromotionExclusion = await prisma.promotionExclusion.delete({ + * where: { + * // ... filter to delete one PromotionExclusion + * } + * }) + * + */ + delete<T extends PromotionExclusionDeleteArgs>(args: SelectSubset<T, PromotionExclusionDeleteArgs<ExtArgs>>): Prisma__PromotionExclusionClient<$Result.GetResult<Prisma.$PromotionExclusionPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one PromotionExclusion. + * @param {PromotionExclusionUpdateArgs} args - Arguments to update one PromotionExclusion. + * @example + * // Update one PromotionExclusion + * const promotionExclusion = await prisma.promotionExclusion.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends PromotionExclusionUpdateArgs>(args: SelectSubset<T, PromotionExclusionUpdateArgs<ExtArgs>>): Prisma__PromotionExclusionClient<$Result.GetResult<Prisma.$PromotionExclusionPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more PromotionExclusions. + * @param {PromotionExclusionDeleteManyArgs} args - Arguments to filter PromotionExclusions to delete. + * @example + * // Delete a few PromotionExclusions + * const { count } = await prisma.promotionExclusion.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends PromotionExclusionDeleteManyArgs>(args?: SelectSubset<T, PromotionExclusionDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more PromotionExclusions. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PromotionExclusionUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many PromotionExclusions + * const promotionExclusion = await prisma.promotionExclusion.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends PromotionExclusionUpdateManyArgs>(args: SelectSubset<T, PromotionExclusionUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one PromotionExclusion. + * @param {PromotionExclusionUpsertArgs} args - Arguments to update or create a PromotionExclusion. + * @example + * // Update or create a PromotionExclusion + * const promotionExclusion = await prisma.promotionExclusion.upsert({ + * create: { + * // ... data to create a PromotionExclusion + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the PromotionExclusion we want to update + * } + * }) + */ + upsert<T extends PromotionExclusionUpsertArgs>(args: SelectSubset<T, PromotionExclusionUpsertArgs<ExtArgs>>): Prisma__PromotionExclusionClient<$Result.GetResult<Prisma.$PromotionExclusionPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of PromotionExclusions. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PromotionExclusionCountArgs} args - Arguments to filter PromotionExclusions to count. + * @example + * // Count the number of PromotionExclusions + * const count = await prisma.promotionExclusion.count({ + * where: { + * // ... the filter for the PromotionExclusions we want to count + * } + * }) + **/ + count<T extends PromotionExclusionCountArgs>( + args?: Subset<T, PromotionExclusionCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], PromotionExclusionCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a PromotionExclusion. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PromotionExclusionAggregateArgs} 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<T extends PromotionExclusionAggregateArgs>(args: Subset<T, PromotionExclusionAggregateArgs>): Prisma.PrismaPromise<GetPromotionExclusionAggregateType<T>> + + /** + * Group by PromotionExclusion. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PromotionExclusionGroupByArgs} 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 PromotionExclusionGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: PromotionExclusionGroupByArgs['orderBy'] } + : { orderBy?: PromotionExclusionGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, PromotionExclusionGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetPromotionExclusionGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the PromotionExclusion model + */ + readonly fields: PromotionExclusionFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for PromotionExclusion. + * 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__PromotionExclusionClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the PromotionExclusion model + */ + interface PromotionExclusionFieldRefs { + readonly id: FieldRef<"PromotionExclusion", 'String'> + readonly type: FieldRef<"PromotionExclusion", 'Int'> + readonly itemId: FieldRef<"PromotionExclusion", 'String'> + readonly createdAt: FieldRef<"PromotionExclusion", 'DateTime'> + } + + + // Custom InputTypes + /** + * PromotionExclusion findUnique + */ + export type PromotionExclusionFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelect<ExtArgs> | null + /** + * Filter, which PromotionExclusion to fetch. + */ + where: PromotionExclusionWhereUniqueInput + } + + /** + * PromotionExclusion findUniqueOrThrow + */ + export type PromotionExclusionFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelect<ExtArgs> | null + /** + * Filter, which PromotionExclusion to fetch. + */ + where: PromotionExclusionWhereUniqueInput + } + + /** + * PromotionExclusion findFirst + */ + export type PromotionExclusionFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelect<ExtArgs> | null + /** + * Filter, which PromotionExclusion to fetch. + */ + where?: PromotionExclusionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PromotionExclusions to fetch. + */ + orderBy?: PromotionExclusionOrderByWithRelationInput | PromotionExclusionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for PromotionExclusions. + */ + cursor?: PromotionExclusionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PromotionExclusions 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` PromotionExclusions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of PromotionExclusions. + */ + distinct?: PromotionExclusionScalarFieldEnum | PromotionExclusionScalarFieldEnum[] + } + + /** + * PromotionExclusion findFirstOrThrow + */ + export type PromotionExclusionFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelect<ExtArgs> | null + /** + * Filter, which PromotionExclusion to fetch. + */ + where?: PromotionExclusionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PromotionExclusions to fetch. + */ + orderBy?: PromotionExclusionOrderByWithRelationInput | PromotionExclusionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for PromotionExclusions. + */ + cursor?: PromotionExclusionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PromotionExclusions 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` PromotionExclusions. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of PromotionExclusions. + */ + distinct?: PromotionExclusionScalarFieldEnum | PromotionExclusionScalarFieldEnum[] + } + + /** + * PromotionExclusion findMany + */ + export type PromotionExclusionFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelect<ExtArgs> | null + /** + * Filter, which PromotionExclusions to fetch. + */ + where?: PromotionExclusionWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PromotionExclusions to fetch. + */ + orderBy?: PromotionExclusionOrderByWithRelationInput | PromotionExclusionOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing PromotionExclusions. + */ + cursor?: PromotionExclusionWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PromotionExclusions 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` PromotionExclusions. + */ + skip?: number + distinct?: PromotionExclusionScalarFieldEnum | PromotionExclusionScalarFieldEnum[] + } + + /** + * PromotionExclusion create + */ + export type PromotionExclusionCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelect<ExtArgs> | null + /** + * The data needed to create a PromotionExclusion. + */ + data: XOR<PromotionExclusionCreateInput, PromotionExclusionUncheckedCreateInput> + } + + /** + * PromotionExclusion createMany + */ + export type PromotionExclusionCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many PromotionExclusions. + */ + data: PromotionExclusionCreateManyInput | PromotionExclusionCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * PromotionExclusion createManyAndReturn + */ + export type PromotionExclusionCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many PromotionExclusions. + */ + data: PromotionExclusionCreateManyInput | PromotionExclusionCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * PromotionExclusion update + */ + export type PromotionExclusionUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelect<ExtArgs> | null + /** + * The data needed to update a PromotionExclusion. + */ + data: XOR<PromotionExclusionUpdateInput, PromotionExclusionUncheckedUpdateInput> + /** + * Choose, which PromotionExclusion to update. + */ + where: PromotionExclusionWhereUniqueInput + } + + /** + * PromotionExclusion updateMany + */ + export type PromotionExclusionUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update PromotionExclusions. + */ + data: XOR<PromotionExclusionUpdateManyMutationInput, PromotionExclusionUncheckedUpdateManyInput> + /** + * Filter which PromotionExclusions to update + */ + where?: PromotionExclusionWhereInput + } + + /** + * PromotionExclusion upsert + */ + export type PromotionExclusionUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelect<ExtArgs> | null + /** + * The filter to search for the PromotionExclusion to update in case it exists. + */ + where: PromotionExclusionWhereUniqueInput + /** + * In case the PromotionExclusion found by the `where` argument doesn't exist, create a new PromotionExclusion with this data. + */ + create: XOR<PromotionExclusionCreateInput, PromotionExclusionUncheckedCreateInput> + /** + * In case the PromotionExclusion was found with the provided `where` argument, update it with this data. + */ + update: XOR<PromotionExclusionUpdateInput, PromotionExclusionUncheckedUpdateInput> + } + + /** + * PromotionExclusion delete + */ + export type PromotionExclusionDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelect<ExtArgs> | null + /** + * Filter which PromotionExclusion to delete. + */ + where: PromotionExclusionWhereUniqueInput + } + + /** + * PromotionExclusion deleteMany + */ + export type PromotionExclusionDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which PromotionExclusions to delete + */ + where?: PromotionExclusionWhereInput + } + + /** + * PromotionExclusion without action + */ + export type PromotionExclusionDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the PromotionExclusion + */ + select?: PromotionExclusionSelect<ExtArgs> | null + } + + + /** + * Model BranchAllocation + */ + + export type AggregateBranchAllocation = { + _count: BranchAllocationCountAggregateOutputType | null + _min: BranchAllocationMinAggregateOutputType | null + _max: BranchAllocationMaxAggregateOutputType | null + } + + export type BranchAllocationMinAggregateOutputType = { + id: string | null + branchId: string | null + allocatorAdminUserId: string | null + note: string | null + createdAt: Date | null + } + + export type BranchAllocationMaxAggregateOutputType = { + id: string | null + branchId: string | null + allocatorAdminUserId: string | null + note: string | null + createdAt: Date | null + } + + export type BranchAllocationCountAggregateOutputType = { + id: number + branchId: number + allocatorAdminUserId: number + note: number + createdAt: number + _all: number + } + + + export type BranchAllocationMinAggregateInputType = { + id?: true + branchId?: true + allocatorAdminUserId?: true + note?: true + createdAt?: true + } + + export type BranchAllocationMaxAggregateInputType = { + id?: true + branchId?: true + allocatorAdminUserId?: true + note?: true + createdAt?: true + } + + export type BranchAllocationCountAggregateInputType = { + id?: true + branchId?: true + allocatorAdminUserId?: true + note?: true + createdAt?: true + _all?: true + } + + export type BranchAllocationAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which BranchAllocation to aggregate. + */ + where?: BranchAllocationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BranchAllocations to fetch. + */ + orderBy?: BranchAllocationOrderByWithRelationInput | BranchAllocationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: BranchAllocationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BranchAllocations 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` BranchAllocations. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned BranchAllocations + **/ + _count?: true | BranchAllocationCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: BranchAllocationMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: BranchAllocationMaxAggregateInputType + } + + export type GetBranchAllocationAggregateType<T extends BranchAllocationAggregateArgs> = { + [P in keyof T & keyof AggregateBranchAllocation]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateBranchAllocation[P]> + : GetScalarType<T[P], AggregateBranchAllocation[P]> + } + + + + + export type BranchAllocationGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: BranchAllocationWhereInput + orderBy?: BranchAllocationOrderByWithAggregationInput | BranchAllocationOrderByWithAggregationInput[] + by: BranchAllocationScalarFieldEnum[] | BranchAllocationScalarFieldEnum + having?: BranchAllocationScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: BranchAllocationCountAggregateInputType | true + _min?: BranchAllocationMinAggregateInputType + _max?: BranchAllocationMaxAggregateInputType + } + + export type BranchAllocationGroupByOutputType = { + id: string + branchId: string + allocatorAdminUserId: string | null + note: string | null + createdAt: Date + _count: BranchAllocationCountAggregateOutputType | null + _min: BranchAllocationMinAggregateOutputType | null + _max: BranchAllocationMaxAggregateOutputType | null + } + + type GetBranchAllocationGroupByPayload<T extends BranchAllocationGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<BranchAllocationGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof BranchAllocationGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], BranchAllocationGroupByOutputType[P]> + : GetScalarType<T[P], BranchAllocationGroupByOutputType[P]> + } + > + > + + + export type BranchAllocationSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + branchId?: boolean + allocatorAdminUserId?: boolean + note?: boolean + createdAt?: boolean + branch?: boolean | BranchDefaultArgs<ExtArgs> + allocatorAdminUser?: boolean | BranchAllocation$allocatorAdminUserArgs<ExtArgs> + items?: boolean | BranchAllocation$itemsArgs<ExtArgs> + _count?: boolean | BranchAllocationCountOutputTypeDefaultArgs<ExtArgs> + }, ExtArgs["result"]["branchAllocation"]> + + export type BranchAllocationSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + branchId?: boolean + allocatorAdminUserId?: boolean + note?: boolean + createdAt?: boolean + branch?: boolean | BranchDefaultArgs<ExtArgs> + allocatorAdminUser?: boolean | BranchAllocation$allocatorAdminUserArgs<ExtArgs> + }, ExtArgs["result"]["branchAllocation"]> + + export type BranchAllocationSelectScalar = { + id?: boolean + branchId?: boolean + allocatorAdminUserId?: boolean + note?: boolean + createdAt?: boolean + } + + export type BranchAllocationInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + branch?: boolean | BranchDefaultArgs<ExtArgs> + allocatorAdminUser?: boolean | BranchAllocation$allocatorAdminUserArgs<ExtArgs> + items?: boolean | BranchAllocation$itemsArgs<ExtArgs> + _count?: boolean | BranchAllocationCountOutputTypeDefaultArgs<ExtArgs> + } + export type BranchAllocationIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + branch?: boolean | BranchDefaultArgs<ExtArgs> + allocatorAdminUser?: boolean | BranchAllocation$allocatorAdminUserArgs<ExtArgs> + } + + export type $BranchAllocationPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "BranchAllocation" + objects: { + branch: Prisma.$BranchPayload<ExtArgs> + allocatorAdminUser: Prisma.$AdminUserPayload<ExtArgs> | null + items: Prisma.$BranchAllocationItemPayload<ExtArgs>[] + } + scalars: $Extensions.GetPayloadResult<{ + id: string + branchId: string + /** + * Legacy `allocator_user` — the admin who filed the allocation. + */ + allocatorAdminUserId: string | null + note: string | null + createdAt: Date + }, ExtArgs["result"]["branchAllocation"]> + composites: {} + } + + type BranchAllocationGetPayload<S extends boolean | null | undefined | BranchAllocationDefaultArgs> = $Result.GetResult<Prisma.$BranchAllocationPayload, S> + + type BranchAllocationCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<BranchAllocationFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: BranchAllocationCountAggregateInputType | true + } + + export interface BranchAllocationDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['BranchAllocation'], meta: { name: 'BranchAllocation' } } + /** + * Find zero or one BranchAllocation that matches the filter. + * @param {BranchAllocationFindUniqueArgs} args - Arguments to find a BranchAllocation + * @example + * // Get one BranchAllocation + * const branchAllocation = await prisma.branchAllocation.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends BranchAllocationFindUniqueArgs>(args: SelectSubset<T, BranchAllocationFindUniqueArgs<ExtArgs>>): Prisma__BranchAllocationClient<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one BranchAllocation that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {BranchAllocationFindUniqueOrThrowArgs} args - Arguments to find a BranchAllocation + * @example + * // Get one BranchAllocation + * const branchAllocation = await prisma.branchAllocation.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends BranchAllocationFindUniqueOrThrowArgs>(args: SelectSubset<T, BranchAllocationFindUniqueOrThrowArgs<ExtArgs>>): Prisma__BranchAllocationClient<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first BranchAllocation 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 {BranchAllocationFindFirstArgs} args - Arguments to find a BranchAllocation + * @example + * // Get one BranchAllocation + * const branchAllocation = await prisma.branchAllocation.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends BranchAllocationFindFirstArgs>(args?: SelectSubset<T, BranchAllocationFindFirstArgs<ExtArgs>>): Prisma__BranchAllocationClient<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first BranchAllocation 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 {BranchAllocationFindFirstOrThrowArgs} args - Arguments to find a BranchAllocation + * @example + * // Get one BranchAllocation + * const branchAllocation = await prisma.branchAllocation.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends BranchAllocationFindFirstOrThrowArgs>(args?: SelectSubset<T, BranchAllocationFindFirstOrThrowArgs<ExtArgs>>): Prisma__BranchAllocationClient<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more BranchAllocations 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 {BranchAllocationFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all BranchAllocations + * const branchAllocations = await prisma.branchAllocation.findMany() + * + * // Get first 10 BranchAllocations + * const branchAllocations = await prisma.branchAllocation.findMany({ take: 10 }) + * + * // Only select the `id` + * const branchAllocationWithIdOnly = await prisma.branchAllocation.findMany({ select: { id: true } }) + * + */ + findMany<T extends BranchAllocationFindManyArgs>(args?: SelectSubset<T, BranchAllocationFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "findMany">> + + /** + * Create a BranchAllocation. + * @param {BranchAllocationCreateArgs} args - Arguments to create a BranchAllocation. + * @example + * // Create one BranchAllocation + * const BranchAllocation = await prisma.branchAllocation.create({ + * data: { + * // ... data to create a BranchAllocation + * } + * }) + * + */ + create<T extends BranchAllocationCreateArgs>(args: SelectSubset<T, BranchAllocationCreateArgs<ExtArgs>>): Prisma__BranchAllocationClient<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many BranchAllocations. + * @param {BranchAllocationCreateManyArgs} args - Arguments to create many BranchAllocations. + * @example + * // Create many BranchAllocations + * const branchAllocation = await prisma.branchAllocation.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends BranchAllocationCreateManyArgs>(args?: SelectSubset<T, BranchAllocationCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many BranchAllocations and returns the data saved in the database. + * @param {BranchAllocationCreateManyAndReturnArgs} args - Arguments to create many BranchAllocations. + * @example + * // Create many BranchAllocations + * const branchAllocation = await prisma.branchAllocation.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many BranchAllocations and only return the `id` + * const branchAllocationWithIdOnly = await prisma.branchAllocation.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends BranchAllocationCreateManyAndReturnArgs>(args?: SelectSubset<T, BranchAllocationCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a BranchAllocation. + * @param {BranchAllocationDeleteArgs} args - Arguments to delete one BranchAllocation. + * @example + * // Delete one BranchAllocation + * const BranchAllocation = await prisma.branchAllocation.delete({ + * where: { + * // ... filter to delete one BranchAllocation + * } + * }) + * + */ + delete<T extends BranchAllocationDeleteArgs>(args: SelectSubset<T, BranchAllocationDeleteArgs<ExtArgs>>): Prisma__BranchAllocationClient<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one BranchAllocation. + * @param {BranchAllocationUpdateArgs} args - Arguments to update one BranchAllocation. + * @example + * // Update one BranchAllocation + * const branchAllocation = await prisma.branchAllocation.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends BranchAllocationUpdateArgs>(args: SelectSubset<T, BranchAllocationUpdateArgs<ExtArgs>>): Prisma__BranchAllocationClient<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more BranchAllocations. + * @param {BranchAllocationDeleteManyArgs} args - Arguments to filter BranchAllocations to delete. + * @example + * // Delete a few BranchAllocations + * const { count } = await prisma.branchAllocation.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends BranchAllocationDeleteManyArgs>(args?: SelectSubset<T, BranchAllocationDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more BranchAllocations. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BranchAllocationUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many BranchAllocations + * const branchAllocation = await prisma.branchAllocation.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends BranchAllocationUpdateManyArgs>(args: SelectSubset<T, BranchAllocationUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one BranchAllocation. + * @param {BranchAllocationUpsertArgs} args - Arguments to update or create a BranchAllocation. + * @example + * // Update or create a BranchAllocation + * const branchAllocation = await prisma.branchAllocation.upsert({ + * create: { + * // ... data to create a BranchAllocation + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the BranchAllocation we want to update + * } + * }) + */ + upsert<T extends BranchAllocationUpsertArgs>(args: SelectSubset<T, BranchAllocationUpsertArgs<ExtArgs>>): Prisma__BranchAllocationClient<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of BranchAllocations. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BranchAllocationCountArgs} args - Arguments to filter BranchAllocations to count. + * @example + * // Count the number of BranchAllocations + * const count = await prisma.branchAllocation.count({ + * where: { + * // ... the filter for the BranchAllocations we want to count + * } + * }) + **/ + count<T extends BranchAllocationCountArgs>( + args?: Subset<T, BranchAllocationCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], BranchAllocationCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a BranchAllocation. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BranchAllocationAggregateArgs} 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<T extends BranchAllocationAggregateArgs>(args: Subset<T, BranchAllocationAggregateArgs>): Prisma.PrismaPromise<GetBranchAllocationAggregateType<T>> + + /** + * Group by BranchAllocation. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BranchAllocationGroupByArgs} 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 BranchAllocationGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: BranchAllocationGroupByArgs['orderBy'] } + : { orderBy?: BranchAllocationGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, BranchAllocationGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetBranchAllocationGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the BranchAllocation model + */ + readonly fields: BranchAllocationFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for BranchAllocation. + * 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__BranchAllocationClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + branch<T extends BranchDefaultArgs<ExtArgs> = {}>(args?: Subset<T, BranchDefaultArgs<ExtArgs>>): Prisma__BranchClient<$Result.GetResult<Prisma.$BranchPayload<ExtArgs>, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + allocatorAdminUser<T extends BranchAllocation$allocatorAdminUserArgs<ExtArgs> = {}>(args?: Subset<T, BranchAllocation$allocatorAdminUserArgs<ExtArgs>>): Prisma__AdminUserClient<$Result.GetResult<Prisma.$AdminUserPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> + items<T extends BranchAllocation$itemsArgs<ExtArgs> = {}>(args?: Subset<T, BranchAllocation$itemsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "findMany"> | 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the BranchAllocation model + */ + interface BranchAllocationFieldRefs { + readonly id: FieldRef<"BranchAllocation", 'String'> + readonly branchId: FieldRef<"BranchAllocation", 'String'> + readonly allocatorAdminUserId: FieldRef<"BranchAllocation", 'String'> + readonly note: FieldRef<"BranchAllocation", 'String'> + readonly createdAt: FieldRef<"BranchAllocation", 'DateTime'> + } + + + // Custom InputTypes + /** + * BranchAllocation findUnique + */ + export type BranchAllocationFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + /** + * Filter, which BranchAllocation to fetch. + */ + where: BranchAllocationWhereUniqueInput + } + + /** + * BranchAllocation findUniqueOrThrow + */ + export type BranchAllocationFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + /** + * Filter, which BranchAllocation to fetch. + */ + where: BranchAllocationWhereUniqueInput + } + + /** + * BranchAllocation findFirst + */ + export type BranchAllocationFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + /** + * Filter, which BranchAllocation to fetch. + */ + where?: BranchAllocationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BranchAllocations to fetch. + */ + orderBy?: BranchAllocationOrderByWithRelationInput | BranchAllocationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for BranchAllocations. + */ + cursor?: BranchAllocationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BranchAllocations 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` BranchAllocations. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of BranchAllocations. + */ + distinct?: BranchAllocationScalarFieldEnum | BranchAllocationScalarFieldEnum[] + } + + /** + * BranchAllocation findFirstOrThrow + */ + export type BranchAllocationFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + /** + * Filter, which BranchAllocation to fetch. + */ + where?: BranchAllocationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BranchAllocations to fetch. + */ + orderBy?: BranchAllocationOrderByWithRelationInput | BranchAllocationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for BranchAllocations. + */ + cursor?: BranchAllocationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BranchAllocations 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` BranchAllocations. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of BranchAllocations. + */ + distinct?: BranchAllocationScalarFieldEnum | BranchAllocationScalarFieldEnum[] + } + + /** + * BranchAllocation findMany + */ + export type BranchAllocationFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + /** + * Filter, which BranchAllocations to fetch. + */ + where?: BranchAllocationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BranchAllocations to fetch. + */ + orderBy?: BranchAllocationOrderByWithRelationInput | BranchAllocationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing BranchAllocations. + */ + cursor?: BranchAllocationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BranchAllocations 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` BranchAllocations. + */ + skip?: number + distinct?: BranchAllocationScalarFieldEnum | BranchAllocationScalarFieldEnum[] + } + + /** + * BranchAllocation create + */ + export type BranchAllocationCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + /** + * The data needed to create a BranchAllocation. + */ + data: XOR<BranchAllocationCreateInput, BranchAllocationUncheckedCreateInput> + } + + /** + * BranchAllocation createMany + */ + export type BranchAllocationCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many BranchAllocations. + */ + data: BranchAllocationCreateManyInput | BranchAllocationCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * BranchAllocation createManyAndReturn + */ + export type BranchAllocationCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many BranchAllocations. + */ + data: BranchAllocationCreateManyInput | BranchAllocationCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationIncludeCreateManyAndReturn<ExtArgs> | null + } + + /** + * BranchAllocation update + */ + export type BranchAllocationUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + /** + * The data needed to update a BranchAllocation. + */ + data: XOR<BranchAllocationUpdateInput, BranchAllocationUncheckedUpdateInput> + /** + * Choose, which BranchAllocation to update. + */ + where: BranchAllocationWhereUniqueInput + } + + /** + * BranchAllocation updateMany + */ + export type BranchAllocationUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update BranchAllocations. + */ + data: XOR<BranchAllocationUpdateManyMutationInput, BranchAllocationUncheckedUpdateManyInput> + /** + * Filter which BranchAllocations to update + */ + where?: BranchAllocationWhereInput + } + + /** + * BranchAllocation upsert + */ + export type BranchAllocationUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + /** + * The filter to search for the BranchAllocation to update in case it exists. + */ + where: BranchAllocationWhereUniqueInput + /** + * In case the BranchAllocation found by the `where` argument doesn't exist, create a new BranchAllocation with this data. + */ + create: XOR<BranchAllocationCreateInput, BranchAllocationUncheckedCreateInput> + /** + * In case the BranchAllocation was found with the provided `where` argument, update it with this data. + */ + update: XOR<BranchAllocationUpdateInput, BranchAllocationUncheckedUpdateInput> + } + + /** + * BranchAllocation delete + */ + export type BranchAllocationDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + /** + * Filter which BranchAllocation to delete. + */ + where: BranchAllocationWhereUniqueInput + } + + /** + * BranchAllocation deleteMany + */ + export type BranchAllocationDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which BranchAllocations to delete + */ + where?: BranchAllocationWhereInput + } + + /** + * BranchAllocation.allocatorAdminUser + */ + export type BranchAllocation$allocatorAdminUserArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the AdminUser + */ + select?: AdminUserSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminUserInclude<ExtArgs> | null + where?: AdminUserWhereInput + } + + /** + * BranchAllocation.items + */ + export type BranchAllocation$itemsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + where?: BranchAllocationItemWhereInput + orderBy?: BranchAllocationItemOrderByWithRelationInput | BranchAllocationItemOrderByWithRelationInput[] + cursor?: BranchAllocationItemWhereUniqueInput + take?: number + skip?: number + distinct?: BranchAllocationItemScalarFieldEnum | BranchAllocationItemScalarFieldEnum[] + } + + /** + * BranchAllocation without action + */ + export type BranchAllocationDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocation + */ + select?: BranchAllocationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationInclude<ExtArgs> | null + } + + + /** + * Model BranchAllocationItem + */ + + export type AggregateBranchAllocationItem = { + _count: BranchAllocationItemCountAggregateOutputType | null + _avg: BranchAllocationItemAvgAggregateOutputType | null + _sum: BranchAllocationItemSumAggregateOutputType | null + _min: BranchAllocationItemMinAggregateOutputType | null + _max: BranchAllocationItemMaxAggregateOutputType | null + } + + export type BranchAllocationItemAvgAggregateOutputType = { + weightGrams: Decimal | null + } + + export type BranchAllocationItemSumAggregateOutputType = { + weightGrams: Decimal | null + } + + export type BranchAllocationItemMinAggregateOutputType = { + id: string | null + allocationId: string | null + productId: string | null + weightGrams: Decimal | null + } + + export type BranchAllocationItemMaxAggregateOutputType = { + id: string | null + allocationId: string | null + productId: string | null + weightGrams: Decimal | null + } + + export type BranchAllocationItemCountAggregateOutputType = { + id: number + allocationId: number + productId: number + weightGrams: number + _all: number + } + + + export type BranchAllocationItemAvgAggregateInputType = { + weightGrams?: true + } + + export type BranchAllocationItemSumAggregateInputType = { + weightGrams?: true + } + + export type BranchAllocationItemMinAggregateInputType = { + id?: true + allocationId?: true + productId?: true + weightGrams?: true + } + + export type BranchAllocationItemMaxAggregateInputType = { + id?: true + allocationId?: true + productId?: true + weightGrams?: true + } + + export type BranchAllocationItemCountAggregateInputType = { + id?: true + allocationId?: true + productId?: true + weightGrams?: true + _all?: true + } + + export type BranchAllocationItemAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which BranchAllocationItem to aggregate. + */ + where?: BranchAllocationItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BranchAllocationItems to fetch. + */ + orderBy?: BranchAllocationItemOrderByWithRelationInput | BranchAllocationItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: BranchAllocationItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BranchAllocationItems 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` BranchAllocationItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned BranchAllocationItems + **/ + _count?: true | BranchAllocationItemCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: BranchAllocationItemAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: BranchAllocationItemSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: BranchAllocationItemMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: BranchAllocationItemMaxAggregateInputType + } + + export type GetBranchAllocationItemAggregateType<T extends BranchAllocationItemAggregateArgs> = { + [P in keyof T & keyof AggregateBranchAllocationItem]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateBranchAllocationItem[P]> + : GetScalarType<T[P], AggregateBranchAllocationItem[P]> + } + + + + + export type BranchAllocationItemGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: BranchAllocationItemWhereInput + orderBy?: BranchAllocationItemOrderByWithAggregationInput | BranchAllocationItemOrderByWithAggregationInput[] + by: BranchAllocationItemScalarFieldEnum[] | BranchAllocationItemScalarFieldEnum + having?: BranchAllocationItemScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: BranchAllocationItemCountAggregateInputType | true + _avg?: BranchAllocationItemAvgAggregateInputType + _sum?: BranchAllocationItemSumAggregateInputType + _min?: BranchAllocationItemMinAggregateInputType + _max?: BranchAllocationItemMaxAggregateInputType + } + + export type BranchAllocationItemGroupByOutputType = { + id: string + allocationId: string + productId: string + weightGrams: Decimal | null + _count: BranchAllocationItemCountAggregateOutputType | null + _avg: BranchAllocationItemAvgAggregateOutputType | null + _sum: BranchAllocationItemSumAggregateOutputType | null + _min: BranchAllocationItemMinAggregateOutputType | null + _max: BranchAllocationItemMaxAggregateOutputType | null + } + + type GetBranchAllocationItemGroupByPayload<T extends BranchAllocationItemGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<BranchAllocationItemGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof BranchAllocationItemGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], BranchAllocationItemGroupByOutputType[P]> + : GetScalarType<T[P], BranchAllocationItemGroupByOutputType[P]> + } + > + > + + + export type BranchAllocationItemSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + allocationId?: boolean + productId?: boolean + weightGrams?: boolean + allocation?: boolean | BranchAllocationDefaultArgs<ExtArgs> + product?: boolean | ProductDefaultArgs<ExtArgs> + }, ExtArgs["result"]["branchAllocationItem"]> + + export type BranchAllocationItemSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + allocationId?: boolean + productId?: boolean + weightGrams?: boolean + allocation?: boolean | BranchAllocationDefaultArgs<ExtArgs> + product?: boolean | ProductDefaultArgs<ExtArgs> + }, ExtArgs["result"]["branchAllocationItem"]> + + export type BranchAllocationItemSelectScalar = { + id?: boolean + allocationId?: boolean + productId?: boolean + weightGrams?: boolean + } + + export type BranchAllocationItemInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + allocation?: boolean | BranchAllocationDefaultArgs<ExtArgs> + product?: boolean | ProductDefaultArgs<ExtArgs> + } + export type BranchAllocationItemIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + allocation?: boolean | BranchAllocationDefaultArgs<ExtArgs> + product?: boolean | ProductDefaultArgs<ExtArgs> + } + + export type $BranchAllocationItemPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "BranchAllocationItem" + objects: { + allocation: Prisma.$BranchAllocationPayload<ExtArgs> + product: Prisma.$ProductPayload<ExtArgs> + } + scalars: $Extensions.GetPayloadResult<{ + id: string + allocationId: string + productId: string + /** + * Weight snapshot at allocation time, so later catalog edits do not rewrite history. + */ + weightGrams: Prisma.Decimal | null + }, ExtArgs["result"]["branchAllocationItem"]> + composites: {} + } + + type BranchAllocationItemGetPayload<S extends boolean | null | undefined | BranchAllocationItemDefaultArgs> = $Result.GetResult<Prisma.$BranchAllocationItemPayload, S> + + type BranchAllocationItemCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<BranchAllocationItemFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: BranchAllocationItemCountAggregateInputType | true + } + + export interface BranchAllocationItemDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['BranchAllocationItem'], meta: { name: 'BranchAllocationItem' } } + /** + * Find zero or one BranchAllocationItem that matches the filter. + * @param {BranchAllocationItemFindUniqueArgs} args - Arguments to find a BranchAllocationItem + * @example + * // Get one BranchAllocationItem + * const branchAllocationItem = await prisma.branchAllocationItem.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends BranchAllocationItemFindUniqueArgs>(args: SelectSubset<T, BranchAllocationItemFindUniqueArgs<ExtArgs>>): Prisma__BranchAllocationItemClient<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one BranchAllocationItem that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {BranchAllocationItemFindUniqueOrThrowArgs} args - Arguments to find a BranchAllocationItem + * @example + * // Get one BranchAllocationItem + * const branchAllocationItem = await prisma.branchAllocationItem.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends BranchAllocationItemFindUniqueOrThrowArgs>(args: SelectSubset<T, BranchAllocationItemFindUniqueOrThrowArgs<ExtArgs>>): Prisma__BranchAllocationItemClient<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first BranchAllocationItem 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 {BranchAllocationItemFindFirstArgs} args - Arguments to find a BranchAllocationItem + * @example + * // Get one BranchAllocationItem + * const branchAllocationItem = await prisma.branchAllocationItem.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends BranchAllocationItemFindFirstArgs>(args?: SelectSubset<T, BranchAllocationItemFindFirstArgs<ExtArgs>>): Prisma__BranchAllocationItemClient<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first BranchAllocationItem 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 {BranchAllocationItemFindFirstOrThrowArgs} args - Arguments to find a BranchAllocationItem + * @example + * // Get one BranchAllocationItem + * const branchAllocationItem = await prisma.branchAllocationItem.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends BranchAllocationItemFindFirstOrThrowArgs>(args?: SelectSubset<T, BranchAllocationItemFindFirstOrThrowArgs<ExtArgs>>): Prisma__BranchAllocationItemClient<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more BranchAllocationItems 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 {BranchAllocationItemFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all BranchAllocationItems + * const branchAllocationItems = await prisma.branchAllocationItem.findMany() + * + * // Get first 10 BranchAllocationItems + * const branchAllocationItems = await prisma.branchAllocationItem.findMany({ take: 10 }) + * + * // Only select the `id` + * const branchAllocationItemWithIdOnly = await prisma.branchAllocationItem.findMany({ select: { id: true } }) + * + */ + findMany<T extends BranchAllocationItemFindManyArgs>(args?: SelectSubset<T, BranchAllocationItemFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "findMany">> + + /** + * Create a BranchAllocationItem. + * @param {BranchAllocationItemCreateArgs} args - Arguments to create a BranchAllocationItem. + * @example + * // Create one BranchAllocationItem + * const BranchAllocationItem = await prisma.branchAllocationItem.create({ + * data: { + * // ... data to create a BranchAllocationItem + * } + * }) + * + */ + create<T extends BranchAllocationItemCreateArgs>(args: SelectSubset<T, BranchAllocationItemCreateArgs<ExtArgs>>): Prisma__BranchAllocationItemClient<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many BranchAllocationItems. + * @param {BranchAllocationItemCreateManyArgs} args - Arguments to create many BranchAllocationItems. + * @example + * // Create many BranchAllocationItems + * const branchAllocationItem = await prisma.branchAllocationItem.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends BranchAllocationItemCreateManyArgs>(args?: SelectSubset<T, BranchAllocationItemCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many BranchAllocationItems and returns the data saved in the database. + * @param {BranchAllocationItemCreateManyAndReturnArgs} args - Arguments to create many BranchAllocationItems. + * @example + * // Create many BranchAllocationItems + * const branchAllocationItem = await prisma.branchAllocationItem.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many BranchAllocationItems and only return the `id` + * const branchAllocationItemWithIdOnly = await prisma.branchAllocationItem.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends BranchAllocationItemCreateManyAndReturnArgs>(args?: SelectSubset<T, BranchAllocationItemCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a BranchAllocationItem. + * @param {BranchAllocationItemDeleteArgs} args - Arguments to delete one BranchAllocationItem. + * @example + * // Delete one BranchAllocationItem + * const BranchAllocationItem = await prisma.branchAllocationItem.delete({ + * where: { + * // ... filter to delete one BranchAllocationItem + * } + * }) + * + */ + delete<T extends BranchAllocationItemDeleteArgs>(args: SelectSubset<T, BranchAllocationItemDeleteArgs<ExtArgs>>): Prisma__BranchAllocationItemClient<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one BranchAllocationItem. + * @param {BranchAllocationItemUpdateArgs} args - Arguments to update one BranchAllocationItem. + * @example + * // Update one BranchAllocationItem + * const branchAllocationItem = await prisma.branchAllocationItem.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends BranchAllocationItemUpdateArgs>(args: SelectSubset<T, BranchAllocationItemUpdateArgs<ExtArgs>>): Prisma__BranchAllocationItemClient<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more BranchAllocationItems. + * @param {BranchAllocationItemDeleteManyArgs} args - Arguments to filter BranchAllocationItems to delete. + * @example + * // Delete a few BranchAllocationItems + * const { count } = await prisma.branchAllocationItem.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends BranchAllocationItemDeleteManyArgs>(args?: SelectSubset<T, BranchAllocationItemDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more BranchAllocationItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BranchAllocationItemUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many BranchAllocationItems + * const branchAllocationItem = await prisma.branchAllocationItem.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends BranchAllocationItemUpdateManyArgs>(args: SelectSubset<T, BranchAllocationItemUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one BranchAllocationItem. + * @param {BranchAllocationItemUpsertArgs} args - Arguments to update or create a BranchAllocationItem. + * @example + * // Update or create a BranchAllocationItem + * const branchAllocationItem = await prisma.branchAllocationItem.upsert({ + * create: { + * // ... data to create a BranchAllocationItem + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the BranchAllocationItem we want to update + * } + * }) + */ + upsert<T extends BranchAllocationItemUpsertArgs>(args: SelectSubset<T, BranchAllocationItemUpsertArgs<ExtArgs>>): Prisma__BranchAllocationItemClient<$Result.GetResult<Prisma.$BranchAllocationItemPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of BranchAllocationItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BranchAllocationItemCountArgs} args - Arguments to filter BranchAllocationItems to count. + * @example + * // Count the number of BranchAllocationItems + * const count = await prisma.branchAllocationItem.count({ + * where: { + * // ... the filter for the BranchAllocationItems we want to count + * } + * }) + **/ + count<T extends BranchAllocationItemCountArgs>( + args?: Subset<T, BranchAllocationItemCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], BranchAllocationItemCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a BranchAllocationItem. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BranchAllocationItemAggregateArgs} 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<T extends BranchAllocationItemAggregateArgs>(args: Subset<T, BranchAllocationItemAggregateArgs>): Prisma.PrismaPromise<GetBranchAllocationItemAggregateType<T>> + + /** + * Group by BranchAllocationItem. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BranchAllocationItemGroupByArgs} 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 BranchAllocationItemGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: BranchAllocationItemGroupByArgs['orderBy'] } + : { orderBy?: BranchAllocationItemGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, BranchAllocationItemGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetBranchAllocationItemGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the BranchAllocationItem model + */ + readonly fields: BranchAllocationItemFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for BranchAllocationItem. + * 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__BranchAllocationItemClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + allocation<T extends BranchAllocationDefaultArgs<ExtArgs> = {}>(args?: Subset<T, BranchAllocationDefaultArgs<ExtArgs>>): Prisma__BranchAllocationClient<$Result.GetResult<Prisma.$BranchAllocationPayload<ExtArgs>, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + product<T extends ProductDefaultArgs<ExtArgs> = {}>(args?: Subset<T, ProductDefaultArgs<ExtArgs>>): Prisma__ProductClient<$Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + /** + * 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the BranchAllocationItem model + */ + interface BranchAllocationItemFieldRefs { + readonly id: FieldRef<"BranchAllocationItem", 'String'> + readonly allocationId: FieldRef<"BranchAllocationItem", 'String'> + readonly productId: FieldRef<"BranchAllocationItem", 'String'> + readonly weightGrams: FieldRef<"BranchAllocationItem", 'Decimal'> + } + + + // Custom InputTypes + /** + * BranchAllocationItem findUnique + */ + export type BranchAllocationItemFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + /** + * Filter, which BranchAllocationItem to fetch. + */ + where: BranchAllocationItemWhereUniqueInput + } + + /** + * BranchAllocationItem findUniqueOrThrow + */ + export type BranchAllocationItemFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + /** + * Filter, which BranchAllocationItem to fetch. + */ + where: BranchAllocationItemWhereUniqueInput + } + + /** + * BranchAllocationItem findFirst + */ + export type BranchAllocationItemFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + /** + * Filter, which BranchAllocationItem to fetch. + */ + where?: BranchAllocationItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BranchAllocationItems to fetch. + */ + orderBy?: BranchAllocationItemOrderByWithRelationInput | BranchAllocationItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for BranchAllocationItems. + */ + cursor?: BranchAllocationItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BranchAllocationItems 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` BranchAllocationItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of BranchAllocationItems. + */ + distinct?: BranchAllocationItemScalarFieldEnum | BranchAllocationItemScalarFieldEnum[] + } + + /** + * BranchAllocationItem findFirstOrThrow + */ + export type BranchAllocationItemFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + /** + * Filter, which BranchAllocationItem to fetch. + */ + where?: BranchAllocationItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BranchAllocationItems to fetch. + */ + orderBy?: BranchAllocationItemOrderByWithRelationInput | BranchAllocationItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for BranchAllocationItems. + */ + cursor?: BranchAllocationItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BranchAllocationItems 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` BranchAllocationItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of BranchAllocationItems. + */ + distinct?: BranchAllocationItemScalarFieldEnum | BranchAllocationItemScalarFieldEnum[] + } + + /** + * BranchAllocationItem findMany + */ + export type BranchAllocationItemFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + /** + * Filter, which BranchAllocationItems to fetch. + */ + where?: BranchAllocationItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of BranchAllocationItems to fetch. + */ + orderBy?: BranchAllocationItemOrderByWithRelationInput | BranchAllocationItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing BranchAllocationItems. + */ + cursor?: BranchAllocationItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` BranchAllocationItems 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` BranchAllocationItems. + */ + skip?: number + distinct?: BranchAllocationItemScalarFieldEnum | BranchAllocationItemScalarFieldEnum[] + } + + /** + * BranchAllocationItem create + */ + export type BranchAllocationItemCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + /** + * The data needed to create a BranchAllocationItem. + */ + data: XOR<BranchAllocationItemCreateInput, BranchAllocationItemUncheckedCreateInput> + } + + /** + * BranchAllocationItem createMany + */ + export type BranchAllocationItemCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many BranchAllocationItems. + */ + data: BranchAllocationItemCreateManyInput | BranchAllocationItemCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * BranchAllocationItem createManyAndReturn + */ + export type BranchAllocationItemCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many BranchAllocationItems. + */ + data: BranchAllocationItemCreateManyInput | BranchAllocationItemCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemIncludeCreateManyAndReturn<ExtArgs> | null + } + + /** + * BranchAllocationItem update + */ + export type BranchAllocationItemUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + /** + * The data needed to update a BranchAllocationItem. + */ + data: XOR<BranchAllocationItemUpdateInput, BranchAllocationItemUncheckedUpdateInput> + /** + * Choose, which BranchAllocationItem to update. + */ + where: BranchAllocationItemWhereUniqueInput + } + + /** + * BranchAllocationItem updateMany + */ + export type BranchAllocationItemUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update BranchAllocationItems. + */ + data: XOR<BranchAllocationItemUpdateManyMutationInput, BranchAllocationItemUncheckedUpdateManyInput> + /** + * Filter which BranchAllocationItems to update + */ + where?: BranchAllocationItemWhereInput + } + + /** + * BranchAllocationItem upsert + */ + export type BranchAllocationItemUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + /** + * The filter to search for the BranchAllocationItem to update in case it exists. + */ + where: BranchAllocationItemWhereUniqueInput + /** + * In case the BranchAllocationItem found by the `where` argument doesn't exist, create a new BranchAllocationItem with this data. + */ + create: XOR<BranchAllocationItemCreateInput, BranchAllocationItemUncheckedCreateInput> + /** + * In case the BranchAllocationItem was found with the provided `where` argument, update it with this data. + */ + update: XOR<BranchAllocationItemUpdateInput, BranchAllocationItemUncheckedUpdateInput> + } + + /** + * BranchAllocationItem delete + */ + export type BranchAllocationItemDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + /** + * Filter which BranchAllocationItem to delete. + */ + where: BranchAllocationItemWhereUniqueInput + } + + /** + * BranchAllocationItem deleteMany + */ + export type BranchAllocationItemDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which BranchAllocationItems to delete + */ + where?: BranchAllocationItemWhereInput + } + + /** + * BranchAllocationItem without action + */ + export type BranchAllocationItemDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the BranchAllocationItem + */ + select?: BranchAllocationItemSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: BranchAllocationItemInclude<ExtArgs> | null + } + + + /** + * Model SmsMessage + */ + + export type AggregateSmsMessage = { + _count: SmsMessageCountAggregateOutputType | null + _avg: SmsMessageAvgAggregateOutputType | null + _sum: SmsMessageSumAggregateOutputType | null + _min: SmsMessageMinAggregateOutputType | null + _max: SmsMessageMaxAggregateOutputType | null + } + + export type SmsMessageAvgAggregateOutputType = { + sentCount: number | null + } + + export type SmsMessageSumAggregateOutputType = { + sentCount: number | null + } + + export type SmsMessageMinAggregateOutputType = { + id: string | null + audience: $Enums.MessageAudience | null + recipients: string | null + body: string | null + sentCount: number | null + sentByAdminUserId: string | null + createdAt: Date | null + } + + export type SmsMessageMaxAggregateOutputType = { + id: string | null + audience: $Enums.MessageAudience | null + recipients: string | null + body: string | null + sentCount: number | null + sentByAdminUserId: string | null + createdAt: Date | null + } + + export type SmsMessageCountAggregateOutputType = { + id: number + audience: number + recipients: number + body: number + sentCount: number + sentByAdminUserId: number + createdAt: number + _all: number + } + + + export type SmsMessageAvgAggregateInputType = { + sentCount?: true + } + + export type SmsMessageSumAggregateInputType = { + sentCount?: true + } + + export type SmsMessageMinAggregateInputType = { + id?: true + audience?: true + recipients?: true + body?: true + sentCount?: true + sentByAdminUserId?: true + createdAt?: true + } + + export type SmsMessageMaxAggregateInputType = { + id?: true + audience?: true + recipients?: true + body?: true + sentCount?: true + sentByAdminUserId?: true + createdAt?: true + } + + export type SmsMessageCountAggregateInputType = { + id?: true + audience?: true + recipients?: true + body?: true + sentCount?: true + sentByAdminUserId?: true + createdAt?: true + _all?: true + } + + export type SmsMessageAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which SmsMessage to aggregate. + */ + where?: SmsMessageWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SmsMessages to fetch. + */ + orderBy?: SmsMessageOrderByWithRelationInput | SmsMessageOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: SmsMessageWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SmsMessages 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` SmsMessages. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned SmsMessages + **/ + _count?: true | SmsMessageCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: SmsMessageAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: SmsMessageSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: SmsMessageMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: SmsMessageMaxAggregateInputType + } + + export type GetSmsMessageAggregateType<T extends SmsMessageAggregateArgs> = { + [P in keyof T & keyof AggregateSmsMessage]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateSmsMessage[P]> + : GetScalarType<T[P], AggregateSmsMessage[P]> + } + + + + + export type SmsMessageGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: SmsMessageWhereInput + orderBy?: SmsMessageOrderByWithAggregationInput | SmsMessageOrderByWithAggregationInput[] + by: SmsMessageScalarFieldEnum[] | SmsMessageScalarFieldEnum + having?: SmsMessageScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: SmsMessageCountAggregateInputType | true + _avg?: SmsMessageAvgAggregateInputType + _sum?: SmsMessageSumAggregateInputType + _min?: SmsMessageMinAggregateInputType + _max?: SmsMessageMaxAggregateInputType + } + + export type SmsMessageGroupByOutputType = { + id: string + audience: $Enums.MessageAudience + recipients: string | null + body: string + sentCount: number + sentByAdminUserId: string | null + createdAt: Date + _count: SmsMessageCountAggregateOutputType | null + _avg: SmsMessageAvgAggregateOutputType | null + _sum: SmsMessageSumAggregateOutputType | null + _min: SmsMessageMinAggregateOutputType | null + _max: SmsMessageMaxAggregateOutputType | null + } + + type GetSmsMessageGroupByPayload<T extends SmsMessageGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<SmsMessageGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof SmsMessageGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], SmsMessageGroupByOutputType[P]> + : GetScalarType<T[P], SmsMessageGroupByOutputType[P]> + } + > + > + + + export type SmsMessageSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + audience?: boolean + recipients?: boolean + body?: boolean + sentCount?: boolean + sentByAdminUserId?: boolean + createdAt?: boolean + sentByAdminUser?: boolean | SmsMessage$sentByAdminUserArgs<ExtArgs> + }, ExtArgs["result"]["smsMessage"]> + + export type SmsMessageSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + audience?: boolean + recipients?: boolean + body?: boolean + sentCount?: boolean + sentByAdminUserId?: boolean + createdAt?: boolean + sentByAdminUser?: boolean | SmsMessage$sentByAdminUserArgs<ExtArgs> + }, ExtArgs["result"]["smsMessage"]> + + export type SmsMessageSelectScalar = { + id?: boolean + audience?: boolean + recipients?: boolean + body?: boolean + sentCount?: boolean + sentByAdminUserId?: boolean + createdAt?: boolean + } + + export type SmsMessageInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + sentByAdminUser?: boolean | SmsMessage$sentByAdminUserArgs<ExtArgs> + } + export type SmsMessageIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + sentByAdminUser?: boolean | SmsMessage$sentByAdminUserArgs<ExtArgs> + } + + export type $SmsMessagePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "SmsMessage" + objects: { + sentByAdminUser: Prisma.$AdminUserPayload<ExtArgs> | null + } + scalars: $Extensions.GetPayloadResult<{ + id: string + audience: $Enums.MessageAudience + /** + * Comma-separated recipients for the SINGLE/MULTIPLE audiences. + */ + recipients: string | null + body: string + /** + * How many numbers the send actually resolved to. + */ + sentCount: number + sentByAdminUserId: string | null + createdAt: Date + }, ExtArgs["result"]["smsMessage"]> + composites: {} + } + + type SmsMessageGetPayload<S extends boolean | null | undefined | SmsMessageDefaultArgs> = $Result.GetResult<Prisma.$SmsMessagePayload, S> + + type SmsMessageCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<SmsMessageFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: SmsMessageCountAggregateInputType | true + } + + export interface SmsMessageDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['SmsMessage'], meta: { name: 'SmsMessage' } } + /** + * Find zero or one SmsMessage that matches the filter. + * @param {SmsMessageFindUniqueArgs} args - Arguments to find a SmsMessage + * @example + * // Get one SmsMessage + * const smsMessage = await prisma.smsMessage.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends SmsMessageFindUniqueArgs>(args: SelectSubset<T, SmsMessageFindUniqueArgs<ExtArgs>>): Prisma__SmsMessageClient<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one SmsMessage that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {SmsMessageFindUniqueOrThrowArgs} args - Arguments to find a SmsMessage + * @example + * // Get one SmsMessage + * const smsMessage = await prisma.smsMessage.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends SmsMessageFindUniqueOrThrowArgs>(args: SelectSubset<T, SmsMessageFindUniqueOrThrowArgs<ExtArgs>>): Prisma__SmsMessageClient<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first SmsMessage 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 {SmsMessageFindFirstArgs} args - Arguments to find a SmsMessage + * @example + * // Get one SmsMessage + * const smsMessage = await prisma.smsMessage.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends SmsMessageFindFirstArgs>(args?: SelectSubset<T, SmsMessageFindFirstArgs<ExtArgs>>): Prisma__SmsMessageClient<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first SmsMessage 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 {SmsMessageFindFirstOrThrowArgs} args - Arguments to find a SmsMessage + * @example + * // Get one SmsMessage + * const smsMessage = await prisma.smsMessage.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends SmsMessageFindFirstOrThrowArgs>(args?: SelectSubset<T, SmsMessageFindFirstOrThrowArgs<ExtArgs>>): Prisma__SmsMessageClient<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more SmsMessages 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 {SmsMessageFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all SmsMessages + * const smsMessages = await prisma.smsMessage.findMany() + * + * // Get first 10 SmsMessages + * const smsMessages = await prisma.smsMessage.findMany({ take: 10 }) + * + * // Only select the `id` + * const smsMessageWithIdOnly = await prisma.smsMessage.findMany({ select: { id: true } }) + * + */ + findMany<T extends SmsMessageFindManyArgs>(args?: SelectSubset<T, SmsMessageFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "findMany">> + + /** + * Create a SmsMessage. + * @param {SmsMessageCreateArgs} args - Arguments to create a SmsMessage. + * @example + * // Create one SmsMessage + * const SmsMessage = await prisma.smsMessage.create({ + * data: { + * // ... data to create a SmsMessage + * } + * }) + * + */ + create<T extends SmsMessageCreateArgs>(args: SelectSubset<T, SmsMessageCreateArgs<ExtArgs>>): Prisma__SmsMessageClient<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many SmsMessages. + * @param {SmsMessageCreateManyArgs} args - Arguments to create many SmsMessages. + * @example + * // Create many SmsMessages + * const smsMessage = await prisma.smsMessage.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends SmsMessageCreateManyArgs>(args?: SelectSubset<T, SmsMessageCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many SmsMessages and returns the data saved in the database. + * @param {SmsMessageCreateManyAndReturnArgs} args - Arguments to create many SmsMessages. + * @example + * // Create many SmsMessages + * const smsMessage = await prisma.smsMessage.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many SmsMessages and only return the `id` + * const smsMessageWithIdOnly = await prisma.smsMessage.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends SmsMessageCreateManyAndReturnArgs>(args?: SelectSubset<T, SmsMessageCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a SmsMessage. + * @param {SmsMessageDeleteArgs} args - Arguments to delete one SmsMessage. + * @example + * // Delete one SmsMessage + * const SmsMessage = await prisma.smsMessage.delete({ + * where: { + * // ... filter to delete one SmsMessage + * } + * }) + * + */ + delete<T extends SmsMessageDeleteArgs>(args: SelectSubset<T, SmsMessageDeleteArgs<ExtArgs>>): Prisma__SmsMessageClient<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one SmsMessage. + * @param {SmsMessageUpdateArgs} args - Arguments to update one SmsMessage. + * @example + * // Update one SmsMessage + * const smsMessage = await prisma.smsMessage.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends SmsMessageUpdateArgs>(args: SelectSubset<T, SmsMessageUpdateArgs<ExtArgs>>): Prisma__SmsMessageClient<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more SmsMessages. + * @param {SmsMessageDeleteManyArgs} args - Arguments to filter SmsMessages to delete. + * @example + * // Delete a few SmsMessages + * const { count } = await prisma.smsMessage.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends SmsMessageDeleteManyArgs>(args?: SelectSubset<T, SmsMessageDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more SmsMessages. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SmsMessageUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many SmsMessages + * const smsMessage = await prisma.smsMessage.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends SmsMessageUpdateManyArgs>(args: SelectSubset<T, SmsMessageUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one SmsMessage. + * @param {SmsMessageUpsertArgs} args - Arguments to update or create a SmsMessage. + * @example + * // Update or create a SmsMessage + * const smsMessage = await prisma.smsMessage.upsert({ + * create: { + * // ... data to create a SmsMessage + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the SmsMessage we want to update + * } + * }) + */ + upsert<T extends SmsMessageUpsertArgs>(args: SelectSubset<T, SmsMessageUpsertArgs<ExtArgs>>): Prisma__SmsMessageClient<$Result.GetResult<Prisma.$SmsMessagePayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of SmsMessages. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SmsMessageCountArgs} args - Arguments to filter SmsMessages to count. + * @example + * // Count the number of SmsMessages + * const count = await prisma.smsMessage.count({ + * where: { + * // ... the filter for the SmsMessages we want to count + * } + * }) + **/ + count<T extends SmsMessageCountArgs>( + args?: Subset<T, SmsMessageCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], SmsMessageCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a SmsMessage. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SmsMessageAggregateArgs} 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<T extends SmsMessageAggregateArgs>(args: Subset<T, SmsMessageAggregateArgs>): Prisma.PrismaPromise<GetSmsMessageAggregateType<T>> + + /** + * Group by SmsMessage. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SmsMessageGroupByArgs} 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 SmsMessageGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: SmsMessageGroupByArgs['orderBy'] } + : { orderBy?: SmsMessageGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, SmsMessageGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetSmsMessageGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the SmsMessage model + */ + readonly fields: SmsMessageFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for SmsMessage. + * 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__SmsMessageClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + sentByAdminUser<T extends SmsMessage$sentByAdminUserArgs<ExtArgs> = {}>(args?: Subset<T, SmsMessage$sentByAdminUserArgs<ExtArgs>>): Prisma__AdminUserClient<$Result.GetResult<Prisma.$AdminUserPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> + /** + * 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the SmsMessage model + */ + interface SmsMessageFieldRefs { + readonly id: FieldRef<"SmsMessage", 'String'> + readonly audience: FieldRef<"SmsMessage", 'MessageAudience'> + readonly recipients: FieldRef<"SmsMessage", 'String'> + readonly body: FieldRef<"SmsMessage", 'String'> + readonly sentCount: FieldRef<"SmsMessage", 'Int'> + readonly sentByAdminUserId: FieldRef<"SmsMessage", 'String'> + readonly createdAt: FieldRef<"SmsMessage", 'DateTime'> + } + + + // Custom InputTypes + /** + * SmsMessage findUnique + */ + export type SmsMessageFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + /** + * Filter, which SmsMessage to fetch. + */ + where: SmsMessageWhereUniqueInput + } + + /** + * SmsMessage findUniqueOrThrow + */ + export type SmsMessageFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + /** + * Filter, which SmsMessage to fetch. + */ + where: SmsMessageWhereUniqueInput + } + + /** + * SmsMessage findFirst + */ + export type SmsMessageFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + /** + * Filter, which SmsMessage to fetch. + */ + where?: SmsMessageWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SmsMessages to fetch. + */ + orderBy?: SmsMessageOrderByWithRelationInput | SmsMessageOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for SmsMessages. + */ + cursor?: SmsMessageWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SmsMessages 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` SmsMessages. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of SmsMessages. + */ + distinct?: SmsMessageScalarFieldEnum | SmsMessageScalarFieldEnum[] + } + + /** + * SmsMessage findFirstOrThrow + */ + export type SmsMessageFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + /** + * Filter, which SmsMessage to fetch. + */ + where?: SmsMessageWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SmsMessages to fetch. + */ + orderBy?: SmsMessageOrderByWithRelationInput | SmsMessageOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for SmsMessages. + */ + cursor?: SmsMessageWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SmsMessages 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` SmsMessages. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of SmsMessages. + */ + distinct?: SmsMessageScalarFieldEnum | SmsMessageScalarFieldEnum[] + } + + /** + * SmsMessage findMany + */ + export type SmsMessageFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + /** + * Filter, which SmsMessages to fetch. + */ + where?: SmsMessageWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SmsMessages to fetch. + */ + orderBy?: SmsMessageOrderByWithRelationInput | SmsMessageOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing SmsMessages. + */ + cursor?: SmsMessageWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SmsMessages 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` SmsMessages. + */ + skip?: number + distinct?: SmsMessageScalarFieldEnum | SmsMessageScalarFieldEnum[] + } + + /** + * SmsMessage create + */ + export type SmsMessageCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + /** + * The data needed to create a SmsMessage. + */ + data: XOR<SmsMessageCreateInput, SmsMessageUncheckedCreateInput> + } + + /** + * SmsMessage createMany + */ + export type SmsMessageCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many SmsMessages. + */ + data: SmsMessageCreateManyInput | SmsMessageCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * SmsMessage createManyAndReturn + */ + export type SmsMessageCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many SmsMessages. + */ + data: SmsMessageCreateManyInput | SmsMessageCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageIncludeCreateManyAndReturn<ExtArgs> | null + } + + /** + * SmsMessage update + */ + export type SmsMessageUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + /** + * The data needed to update a SmsMessage. + */ + data: XOR<SmsMessageUpdateInput, SmsMessageUncheckedUpdateInput> + /** + * Choose, which SmsMessage to update. + */ + where: SmsMessageWhereUniqueInput + } + + /** + * SmsMessage updateMany + */ + export type SmsMessageUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update SmsMessages. + */ + data: XOR<SmsMessageUpdateManyMutationInput, SmsMessageUncheckedUpdateManyInput> + /** + * Filter which SmsMessages to update + */ + where?: SmsMessageWhereInput + } + + /** + * SmsMessage upsert + */ + export type SmsMessageUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + /** + * The filter to search for the SmsMessage to update in case it exists. + */ + where: SmsMessageWhereUniqueInput + /** + * In case the SmsMessage found by the `where` argument doesn't exist, create a new SmsMessage with this data. + */ + create: XOR<SmsMessageCreateInput, SmsMessageUncheckedCreateInput> + /** + * In case the SmsMessage was found with the provided `where` argument, update it with this data. + */ + update: XOR<SmsMessageUpdateInput, SmsMessageUncheckedUpdateInput> + } + + /** + * SmsMessage delete + */ + export type SmsMessageDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + /** + * Filter which SmsMessage to delete. + */ + where: SmsMessageWhereUniqueInput + } + + /** + * SmsMessage deleteMany + */ + export type SmsMessageDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which SmsMessages to delete + */ + where?: SmsMessageWhereInput + } + + /** + * SmsMessage.sentByAdminUser + */ + export type SmsMessage$sentByAdminUserArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the AdminUser + */ + select?: AdminUserSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminUserInclude<ExtArgs> | null + where?: AdminUserWhereInput + } + + /** + * SmsMessage without action + */ + export type SmsMessageDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the SmsMessage + */ + select?: SmsMessageSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: SmsMessageInclude<ExtArgs> | null + } + + + /** + * Model Notification + */ + + export type AggregateNotification = { + _count: NotificationCountAggregateOutputType | null + _min: NotificationMinAggregateOutputType | null + _max: NotificationMaxAggregateOutputType | null + } + + export type NotificationMinAggregateOutputType = { + id: string | null + title: string | null + body: string | null + audience: $Enums.MessageAudience | null + sentByAdminUserId: string | null + createdAt: Date | null + } + + export type NotificationMaxAggregateOutputType = { + id: string | null + title: string | null + body: string | null + audience: $Enums.MessageAudience | null + sentByAdminUserId: string | null + createdAt: Date | null + } + + export type NotificationCountAggregateOutputType = { + id: number + title: number + body: number + audience: number + sentByAdminUserId: number + createdAt: number + _all: number + } + + + export type NotificationMinAggregateInputType = { + id?: true + title?: true + body?: true + audience?: true + sentByAdminUserId?: true + createdAt?: true + } + + export type NotificationMaxAggregateInputType = { + id?: true + title?: true + body?: true + audience?: true + sentByAdminUserId?: true + createdAt?: true + } + + export type NotificationCountAggregateInputType = { + id?: true + title?: true + body?: true + audience?: true + sentByAdminUserId?: true + createdAt?: true + _all?: true + } + + export type NotificationAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which Notification to aggregate. + */ + where?: NotificationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Notifications to fetch. + */ + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: NotificationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Notifications 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` Notifications. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Notifications + **/ + _count?: true | NotificationCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: NotificationMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: NotificationMaxAggregateInputType + } + + export type GetNotificationAggregateType<T extends NotificationAggregateArgs> = { + [P in keyof T & keyof AggregateNotification]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateNotification[P]> + : GetScalarType<T[P], AggregateNotification[P]> + } + + + + + export type NotificationGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: NotificationWhereInput + orderBy?: NotificationOrderByWithAggregationInput | NotificationOrderByWithAggregationInput[] + by: NotificationScalarFieldEnum[] | NotificationScalarFieldEnum + having?: NotificationScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: NotificationCountAggregateInputType | true + _min?: NotificationMinAggregateInputType + _max?: NotificationMaxAggregateInputType + } + + export type NotificationGroupByOutputType = { + id: string + title: string + body: string + audience: $Enums.MessageAudience + sentByAdminUserId: string | null + createdAt: Date + _count: NotificationCountAggregateOutputType | null + _min: NotificationMinAggregateOutputType | null + _max: NotificationMaxAggregateOutputType | null + } + + type GetNotificationGroupByPayload<T extends NotificationGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<NotificationGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof NotificationGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], NotificationGroupByOutputType[P]> + : GetScalarType<T[P], NotificationGroupByOutputType[P]> + } + > + > + + + export type NotificationSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + title?: boolean + body?: boolean + audience?: boolean + sentByAdminUserId?: boolean + createdAt?: boolean + sentByAdminUser?: boolean | Notification$sentByAdminUserArgs<ExtArgs> + recipients?: boolean | Notification$recipientsArgs<ExtArgs> + _count?: boolean | NotificationCountOutputTypeDefaultArgs<ExtArgs> + }, ExtArgs["result"]["notification"]> + + export type NotificationSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + title?: boolean + body?: boolean + audience?: boolean + sentByAdminUserId?: boolean + createdAt?: boolean + sentByAdminUser?: boolean | Notification$sentByAdminUserArgs<ExtArgs> + }, ExtArgs["result"]["notification"]> + + export type NotificationSelectScalar = { + id?: boolean + title?: boolean + body?: boolean + audience?: boolean + sentByAdminUserId?: boolean + createdAt?: boolean + } + + export type NotificationInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + sentByAdminUser?: boolean | Notification$sentByAdminUserArgs<ExtArgs> + recipients?: boolean | Notification$recipientsArgs<ExtArgs> + _count?: boolean | NotificationCountOutputTypeDefaultArgs<ExtArgs> + } + export type NotificationIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + sentByAdminUser?: boolean | Notification$sentByAdminUserArgs<ExtArgs> + } + + export type $NotificationPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "Notification" + objects: { + sentByAdminUser: Prisma.$AdminUserPayload<ExtArgs> | null + recipients: Prisma.$NotificationRecipientPayload<ExtArgs>[] + } + scalars: $Extensions.GetPayloadResult<{ + id: string + title: string + body: string + audience: $Enums.MessageAudience + sentByAdminUserId: string | null + createdAt: Date + }, ExtArgs["result"]["notification"]> + composites: {} + } + + type NotificationGetPayload<S extends boolean | null | undefined | NotificationDefaultArgs> = $Result.GetResult<Prisma.$NotificationPayload, S> + + type NotificationCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<NotificationFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: NotificationCountAggregateInputType | true + } + + export interface NotificationDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['Notification'], meta: { name: 'Notification' } } + /** + * Find zero or one Notification that matches the filter. + * @param {NotificationFindUniqueArgs} args - Arguments to find a Notification + * @example + * // Get one Notification + * const notification = await prisma.notification.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends NotificationFindUniqueArgs>(args: SelectSubset<T, NotificationFindUniqueArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one Notification that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {NotificationFindUniqueOrThrowArgs} args - Arguments to find a Notification + * @example + * // Get one Notification + * const notification = await prisma.notification.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends NotificationFindUniqueOrThrowArgs>(args: SelectSubset<T, NotificationFindUniqueOrThrowArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first Notification 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 {NotificationFindFirstArgs} args - Arguments to find a Notification + * @example + * // Get one Notification + * const notification = await prisma.notification.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends NotificationFindFirstArgs>(args?: SelectSubset<T, NotificationFindFirstArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first Notification 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 {NotificationFindFirstOrThrowArgs} args - Arguments to find a Notification + * @example + * // Get one Notification + * const notification = await prisma.notification.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends NotificationFindFirstOrThrowArgs>(args?: SelectSubset<T, NotificationFindFirstOrThrowArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more Notifications 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 {NotificationFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Notifications + * const notifications = await prisma.notification.findMany() + * + * // Get first 10 Notifications + * const notifications = await prisma.notification.findMany({ take: 10 }) + * + * // Only select the `id` + * const notificationWithIdOnly = await prisma.notification.findMany({ select: { id: true } }) + * + */ + findMany<T extends NotificationFindManyArgs>(args?: SelectSubset<T, NotificationFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "findMany">> + + /** + * Create a Notification. + * @param {NotificationCreateArgs} args - Arguments to create a Notification. + * @example + * // Create one Notification + * const Notification = await prisma.notification.create({ + * data: { + * // ... data to create a Notification + * } + * }) + * + */ + create<T extends NotificationCreateArgs>(args: SelectSubset<T, NotificationCreateArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many Notifications. + * @param {NotificationCreateManyArgs} args - Arguments to create many Notifications. + * @example + * // Create many Notifications + * const notification = await prisma.notification.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends NotificationCreateManyArgs>(args?: SelectSubset<T, NotificationCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many Notifications and returns the data saved in the database. + * @param {NotificationCreateManyAndReturnArgs} args - Arguments to create many Notifications. + * @example + * // Create many Notifications + * const notification = await prisma.notification.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Notifications and only return the `id` + * const notificationWithIdOnly = await prisma.notification.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends NotificationCreateManyAndReturnArgs>(args?: SelectSubset<T, NotificationCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a Notification. + * @param {NotificationDeleteArgs} args - Arguments to delete one Notification. + * @example + * // Delete one Notification + * const Notification = await prisma.notification.delete({ + * where: { + * // ... filter to delete one Notification + * } + * }) + * + */ + delete<T extends NotificationDeleteArgs>(args: SelectSubset<T, NotificationDeleteArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one Notification. + * @param {NotificationUpdateArgs} args - Arguments to update one Notification. + * @example + * // Update one Notification + * const notification = await prisma.notification.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends NotificationUpdateArgs>(args: SelectSubset<T, NotificationUpdateArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more Notifications. + * @param {NotificationDeleteManyArgs} args - Arguments to filter Notifications to delete. + * @example + * // Delete a few Notifications + * const { count } = await prisma.notification.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends NotificationDeleteManyArgs>(args?: SelectSubset<T, NotificationDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more Notifications. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Notifications + * const notification = await prisma.notification.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends NotificationUpdateManyArgs>(args: SelectSubset<T, NotificationUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one Notification. + * @param {NotificationUpsertArgs} args - Arguments to update or create a Notification. + * @example + * // Update or create a Notification + * const notification = await prisma.notification.upsert({ + * create: { + * // ... data to create a Notification + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Notification we want to update + * } + * }) + */ + upsert<T extends NotificationUpsertArgs>(args: SelectSubset<T, NotificationUpsertArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of Notifications. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationCountArgs} args - Arguments to filter Notifications to count. + * @example + * // Count the number of Notifications + * const count = await prisma.notification.count({ + * where: { + * // ... the filter for the Notifications we want to count + * } + * }) + **/ + count<T extends NotificationCountArgs>( + args?: Subset<T, NotificationCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], NotificationCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a Notification. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationAggregateArgs} 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<T extends NotificationAggregateArgs>(args: Subset<T, NotificationAggregateArgs>): Prisma.PrismaPromise<GetNotificationAggregateType<T>> + + /** + * Group by Notification. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationGroupByArgs} 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 NotificationGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: NotificationGroupByArgs['orderBy'] } + : { orderBy?: NotificationGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, NotificationGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetNotificationGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the Notification model + */ + readonly fields: NotificationFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for Notification. + * 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__NotificationClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + sentByAdminUser<T extends Notification$sentByAdminUserArgs<ExtArgs> = {}>(args?: Subset<T, Notification$sentByAdminUserArgs<ExtArgs>>): Prisma__AdminUserClient<$Result.GetResult<Prisma.$AdminUserPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> + recipients<T extends Notification$recipientsArgs<ExtArgs> = {}>(args?: Subset<T, Notification$recipientsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "findMany"> | 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the Notification model + */ + interface NotificationFieldRefs { + readonly id: FieldRef<"Notification", 'String'> + readonly title: FieldRef<"Notification", 'String'> + readonly body: FieldRef<"Notification", 'String'> + readonly audience: FieldRef<"Notification", 'MessageAudience'> + readonly sentByAdminUserId: FieldRef<"Notification", 'String'> + readonly createdAt: FieldRef<"Notification", 'DateTime'> + } + + + // Custom InputTypes + /** + * Notification findUnique + */ + export type NotificationFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + /** + * Filter, which Notification to fetch. + */ + where: NotificationWhereUniqueInput + } + + /** + * Notification findUniqueOrThrow + */ + export type NotificationFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + /** + * Filter, which Notification to fetch. + */ + where: NotificationWhereUniqueInput + } + + /** + * Notification findFirst + */ + export type NotificationFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + /** + * Filter, which Notification to fetch. + */ + where?: NotificationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Notifications to fetch. + */ + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Notifications. + */ + cursor?: NotificationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Notifications 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` Notifications. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Notifications. + */ + distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[] + } + + /** + * Notification findFirstOrThrow + */ + export type NotificationFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + /** + * Filter, which Notification to fetch. + */ + where?: NotificationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Notifications to fetch. + */ + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Notifications. + */ + cursor?: NotificationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Notifications 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` Notifications. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Notifications. + */ + distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[] + } + + /** + * Notification findMany + */ + export type NotificationFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + /** + * Filter, which Notifications to fetch. + */ + where?: NotificationWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Notifications to fetch. + */ + orderBy?: NotificationOrderByWithRelationInput | NotificationOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Notifications. + */ + cursor?: NotificationWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Notifications 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` Notifications. + */ + skip?: number + distinct?: NotificationScalarFieldEnum | NotificationScalarFieldEnum[] + } + + /** + * Notification create + */ + export type NotificationCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + /** + * The data needed to create a Notification. + */ + data: XOR<NotificationCreateInput, NotificationUncheckedCreateInput> + } + + /** + * Notification createMany + */ + export type NotificationCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many Notifications. + */ + data: NotificationCreateManyInput | NotificationCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * Notification createManyAndReturn + */ + export type NotificationCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many Notifications. + */ + data: NotificationCreateManyInput | NotificationCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationIncludeCreateManyAndReturn<ExtArgs> | null + } + + /** + * Notification update + */ + export type NotificationUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + /** + * The data needed to update a Notification. + */ + data: XOR<NotificationUpdateInput, NotificationUncheckedUpdateInput> + /** + * Choose, which Notification to update. + */ + where: NotificationWhereUniqueInput + } + + /** + * Notification updateMany + */ + export type NotificationUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update Notifications. + */ + data: XOR<NotificationUpdateManyMutationInput, NotificationUncheckedUpdateManyInput> + /** + * Filter which Notifications to update + */ + where?: NotificationWhereInput + } + + /** + * Notification upsert + */ + export type NotificationUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + /** + * The filter to search for the Notification to update in case it exists. + */ + where: NotificationWhereUniqueInput + /** + * In case the Notification found by the `where` argument doesn't exist, create a new Notification with this data. + */ + create: XOR<NotificationCreateInput, NotificationUncheckedCreateInput> + /** + * In case the Notification was found with the provided `where` argument, update it with this data. + */ + update: XOR<NotificationUpdateInput, NotificationUncheckedUpdateInput> + } + + /** + * Notification delete + */ + export type NotificationDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + /** + * Filter which Notification to delete. + */ + where: NotificationWhereUniqueInput + } + + /** + * Notification deleteMany + */ + export type NotificationDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which Notifications to delete + */ + where?: NotificationWhereInput + } + + /** + * Notification.sentByAdminUser + */ + export type Notification$sentByAdminUserArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the AdminUser + */ + select?: AdminUserSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminUserInclude<ExtArgs> | null + where?: AdminUserWhereInput + } + + /** + * Notification.recipients + */ + export type Notification$recipientsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + where?: NotificationRecipientWhereInput + orderBy?: NotificationRecipientOrderByWithRelationInput | NotificationRecipientOrderByWithRelationInput[] + cursor?: NotificationRecipientWhereUniqueInput + take?: number + skip?: number + distinct?: NotificationRecipientScalarFieldEnum | NotificationRecipientScalarFieldEnum[] + } + + /** + * Notification without action + */ + export type NotificationDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Notification + */ + select?: NotificationSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationInclude<ExtArgs> | null + } + + + /** + * Model NotificationRecipient + */ + + export type AggregateNotificationRecipient = { + _count: NotificationRecipientCountAggregateOutputType | null + _min: NotificationRecipientMinAggregateOutputType | null + _max: NotificationRecipientMaxAggregateOutputType | null + } + + export type NotificationRecipientMinAggregateOutputType = { + id: string | null + notificationId: string | null + customerId: string | null + readAt: Date | null + } + + export type NotificationRecipientMaxAggregateOutputType = { + id: string | null + notificationId: string | null + customerId: string | null + readAt: Date | null + } + + export type NotificationRecipientCountAggregateOutputType = { + id: number + notificationId: number + customerId: number + readAt: number + _all: number + } + + + export type NotificationRecipientMinAggregateInputType = { + id?: true + notificationId?: true + customerId?: true + readAt?: true + } + + export type NotificationRecipientMaxAggregateInputType = { + id?: true + notificationId?: true + customerId?: true + readAt?: true + } + + export type NotificationRecipientCountAggregateInputType = { + id?: true + notificationId?: true + customerId?: true + readAt?: true + _all?: true + } + + export type NotificationRecipientAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which NotificationRecipient to aggregate. + */ + where?: NotificationRecipientWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of NotificationRecipients to fetch. + */ + orderBy?: NotificationRecipientOrderByWithRelationInput | NotificationRecipientOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: NotificationRecipientWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` NotificationRecipients 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` NotificationRecipients. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned NotificationRecipients + **/ + _count?: true | NotificationRecipientCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: NotificationRecipientMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: NotificationRecipientMaxAggregateInputType + } + + export type GetNotificationRecipientAggregateType<T extends NotificationRecipientAggregateArgs> = { + [P in keyof T & keyof AggregateNotificationRecipient]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateNotificationRecipient[P]> + : GetScalarType<T[P], AggregateNotificationRecipient[P]> + } + + + + + export type NotificationRecipientGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: NotificationRecipientWhereInput + orderBy?: NotificationRecipientOrderByWithAggregationInput | NotificationRecipientOrderByWithAggregationInput[] + by: NotificationRecipientScalarFieldEnum[] | NotificationRecipientScalarFieldEnum + having?: NotificationRecipientScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: NotificationRecipientCountAggregateInputType | true + _min?: NotificationRecipientMinAggregateInputType + _max?: NotificationRecipientMaxAggregateInputType + } + + export type NotificationRecipientGroupByOutputType = { + id: string + notificationId: string + customerId: string + readAt: Date | null + _count: NotificationRecipientCountAggregateOutputType | null + _min: NotificationRecipientMinAggregateOutputType | null + _max: NotificationRecipientMaxAggregateOutputType | null + } + + type GetNotificationRecipientGroupByPayload<T extends NotificationRecipientGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<NotificationRecipientGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof NotificationRecipientGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], NotificationRecipientGroupByOutputType[P]> + : GetScalarType<T[P], NotificationRecipientGroupByOutputType[P]> + } + > + > + + + export type NotificationRecipientSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + notificationId?: boolean + customerId?: boolean + readAt?: boolean + notification?: boolean | NotificationDefaultArgs<ExtArgs> + customer?: boolean | CustomerDefaultArgs<ExtArgs> + }, ExtArgs["result"]["notificationRecipient"]> + + export type NotificationRecipientSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + notificationId?: boolean + customerId?: boolean + readAt?: boolean + notification?: boolean | NotificationDefaultArgs<ExtArgs> + customer?: boolean | CustomerDefaultArgs<ExtArgs> + }, ExtArgs["result"]["notificationRecipient"]> + + export type NotificationRecipientSelectScalar = { + id?: boolean + notificationId?: boolean + customerId?: boolean + readAt?: boolean + } + + export type NotificationRecipientInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + notification?: boolean | NotificationDefaultArgs<ExtArgs> + customer?: boolean | CustomerDefaultArgs<ExtArgs> + } + export type NotificationRecipientIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + notification?: boolean | NotificationDefaultArgs<ExtArgs> + customer?: boolean | CustomerDefaultArgs<ExtArgs> + } + + export type $NotificationRecipientPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "NotificationRecipient" + objects: { + notification: Prisma.$NotificationPayload<ExtArgs> + customer: Prisma.$CustomerPayload<ExtArgs> + } + scalars: $Extensions.GetPayloadResult<{ + id: string + notificationId: string + customerId: string + readAt: Date | null + }, ExtArgs["result"]["notificationRecipient"]> + composites: {} + } + + type NotificationRecipientGetPayload<S extends boolean | null | undefined | NotificationRecipientDefaultArgs> = $Result.GetResult<Prisma.$NotificationRecipientPayload, S> + + type NotificationRecipientCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<NotificationRecipientFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: NotificationRecipientCountAggregateInputType | true + } + + export interface NotificationRecipientDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['NotificationRecipient'], meta: { name: 'NotificationRecipient' } } + /** + * Find zero or one NotificationRecipient that matches the filter. + * @param {NotificationRecipientFindUniqueArgs} args - Arguments to find a NotificationRecipient + * @example + * // Get one NotificationRecipient + * const notificationRecipient = await prisma.notificationRecipient.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends NotificationRecipientFindUniqueArgs>(args: SelectSubset<T, NotificationRecipientFindUniqueArgs<ExtArgs>>): Prisma__NotificationRecipientClient<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one NotificationRecipient that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {NotificationRecipientFindUniqueOrThrowArgs} args - Arguments to find a NotificationRecipient + * @example + * // Get one NotificationRecipient + * const notificationRecipient = await prisma.notificationRecipient.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends NotificationRecipientFindUniqueOrThrowArgs>(args: SelectSubset<T, NotificationRecipientFindUniqueOrThrowArgs<ExtArgs>>): Prisma__NotificationRecipientClient<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first NotificationRecipient 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 {NotificationRecipientFindFirstArgs} args - Arguments to find a NotificationRecipient + * @example + * // Get one NotificationRecipient + * const notificationRecipient = await prisma.notificationRecipient.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends NotificationRecipientFindFirstArgs>(args?: SelectSubset<T, NotificationRecipientFindFirstArgs<ExtArgs>>): Prisma__NotificationRecipientClient<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first NotificationRecipient 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 {NotificationRecipientFindFirstOrThrowArgs} args - Arguments to find a NotificationRecipient + * @example + * // Get one NotificationRecipient + * const notificationRecipient = await prisma.notificationRecipient.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends NotificationRecipientFindFirstOrThrowArgs>(args?: SelectSubset<T, NotificationRecipientFindFirstOrThrowArgs<ExtArgs>>): Prisma__NotificationRecipientClient<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more NotificationRecipients 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 {NotificationRecipientFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all NotificationRecipients + * const notificationRecipients = await prisma.notificationRecipient.findMany() + * + * // Get first 10 NotificationRecipients + * const notificationRecipients = await prisma.notificationRecipient.findMany({ take: 10 }) + * + * // Only select the `id` + * const notificationRecipientWithIdOnly = await prisma.notificationRecipient.findMany({ select: { id: true } }) + * + */ + findMany<T extends NotificationRecipientFindManyArgs>(args?: SelectSubset<T, NotificationRecipientFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "findMany">> + + /** + * Create a NotificationRecipient. + * @param {NotificationRecipientCreateArgs} args - Arguments to create a NotificationRecipient. + * @example + * // Create one NotificationRecipient + * const NotificationRecipient = await prisma.notificationRecipient.create({ + * data: { + * // ... data to create a NotificationRecipient + * } + * }) + * + */ + create<T extends NotificationRecipientCreateArgs>(args: SelectSubset<T, NotificationRecipientCreateArgs<ExtArgs>>): Prisma__NotificationRecipientClient<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many NotificationRecipients. + * @param {NotificationRecipientCreateManyArgs} args - Arguments to create many NotificationRecipients. + * @example + * // Create many NotificationRecipients + * const notificationRecipient = await prisma.notificationRecipient.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends NotificationRecipientCreateManyArgs>(args?: SelectSubset<T, NotificationRecipientCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many NotificationRecipients and returns the data saved in the database. + * @param {NotificationRecipientCreateManyAndReturnArgs} args - Arguments to create many NotificationRecipients. + * @example + * // Create many NotificationRecipients + * const notificationRecipient = await prisma.notificationRecipient.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many NotificationRecipients and only return the `id` + * const notificationRecipientWithIdOnly = await prisma.notificationRecipient.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends NotificationRecipientCreateManyAndReturnArgs>(args?: SelectSubset<T, NotificationRecipientCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a NotificationRecipient. + * @param {NotificationRecipientDeleteArgs} args - Arguments to delete one NotificationRecipient. + * @example + * // Delete one NotificationRecipient + * const NotificationRecipient = await prisma.notificationRecipient.delete({ + * where: { + * // ... filter to delete one NotificationRecipient + * } + * }) + * + */ + delete<T extends NotificationRecipientDeleteArgs>(args: SelectSubset<T, NotificationRecipientDeleteArgs<ExtArgs>>): Prisma__NotificationRecipientClient<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one NotificationRecipient. + * @param {NotificationRecipientUpdateArgs} args - Arguments to update one NotificationRecipient. + * @example + * // Update one NotificationRecipient + * const notificationRecipient = await prisma.notificationRecipient.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends NotificationRecipientUpdateArgs>(args: SelectSubset<T, NotificationRecipientUpdateArgs<ExtArgs>>): Prisma__NotificationRecipientClient<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more NotificationRecipients. + * @param {NotificationRecipientDeleteManyArgs} args - Arguments to filter NotificationRecipients to delete. + * @example + * // Delete a few NotificationRecipients + * const { count } = await prisma.notificationRecipient.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends NotificationRecipientDeleteManyArgs>(args?: SelectSubset<T, NotificationRecipientDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more NotificationRecipients. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationRecipientUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many NotificationRecipients + * const notificationRecipient = await prisma.notificationRecipient.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends NotificationRecipientUpdateManyArgs>(args: SelectSubset<T, NotificationRecipientUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one NotificationRecipient. + * @param {NotificationRecipientUpsertArgs} args - Arguments to update or create a NotificationRecipient. + * @example + * // Update or create a NotificationRecipient + * const notificationRecipient = await prisma.notificationRecipient.upsert({ + * create: { + * // ... data to create a NotificationRecipient + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the NotificationRecipient we want to update + * } + * }) + */ + upsert<T extends NotificationRecipientUpsertArgs>(args: SelectSubset<T, NotificationRecipientUpsertArgs<ExtArgs>>): Prisma__NotificationRecipientClient<$Result.GetResult<Prisma.$NotificationRecipientPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of NotificationRecipients. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationRecipientCountArgs} args - Arguments to filter NotificationRecipients to count. + * @example + * // Count the number of NotificationRecipients + * const count = await prisma.notificationRecipient.count({ + * where: { + * // ... the filter for the NotificationRecipients we want to count + * } + * }) + **/ + count<T extends NotificationRecipientCountArgs>( + args?: Subset<T, NotificationRecipientCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], NotificationRecipientCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a NotificationRecipient. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationRecipientAggregateArgs} 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<T extends NotificationRecipientAggregateArgs>(args: Subset<T, NotificationRecipientAggregateArgs>): Prisma.PrismaPromise<GetNotificationRecipientAggregateType<T>> + + /** + * Group by NotificationRecipient. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NotificationRecipientGroupByArgs} 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 NotificationRecipientGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: NotificationRecipientGroupByArgs['orderBy'] } + : { orderBy?: NotificationRecipientGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, NotificationRecipientGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetNotificationRecipientGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the NotificationRecipient model + */ + readonly fields: NotificationRecipientFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for NotificationRecipient. + * 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__NotificationRecipientClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + notification<T extends NotificationDefaultArgs<ExtArgs> = {}>(args?: Subset<T, NotificationDefaultArgs<ExtArgs>>): Prisma__NotificationClient<$Result.GetResult<Prisma.$NotificationPayload<ExtArgs>, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + customer<T extends CustomerDefaultArgs<ExtArgs> = {}>(args?: Subset<T, CustomerDefaultArgs<ExtArgs>>): Prisma__CustomerClient<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + /** + * 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the NotificationRecipient model + */ + interface NotificationRecipientFieldRefs { + readonly id: FieldRef<"NotificationRecipient", 'String'> + readonly notificationId: FieldRef<"NotificationRecipient", 'String'> + readonly customerId: FieldRef<"NotificationRecipient", 'String'> + readonly readAt: FieldRef<"NotificationRecipient", 'DateTime'> + } + + + // Custom InputTypes + /** + * NotificationRecipient findUnique + */ + export type NotificationRecipientFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + /** + * Filter, which NotificationRecipient to fetch. + */ + where: NotificationRecipientWhereUniqueInput + } + + /** + * NotificationRecipient findUniqueOrThrow + */ + export type NotificationRecipientFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + /** + * Filter, which NotificationRecipient to fetch. + */ + where: NotificationRecipientWhereUniqueInput + } + + /** + * NotificationRecipient findFirst + */ + export type NotificationRecipientFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + /** + * Filter, which NotificationRecipient to fetch. + */ + where?: NotificationRecipientWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of NotificationRecipients to fetch. + */ + orderBy?: NotificationRecipientOrderByWithRelationInput | NotificationRecipientOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for NotificationRecipients. + */ + cursor?: NotificationRecipientWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` NotificationRecipients 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` NotificationRecipients. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of NotificationRecipients. + */ + distinct?: NotificationRecipientScalarFieldEnum | NotificationRecipientScalarFieldEnum[] + } + + /** + * NotificationRecipient findFirstOrThrow + */ + export type NotificationRecipientFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + /** + * Filter, which NotificationRecipient to fetch. + */ + where?: NotificationRecipientWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of NotificationRecipients to fetch. + */ + orderBy?: NotificationRecipientOrderByWithRelationInput | NotificationRecipientOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for NotificationRecipients. + */ + cursor?: NotificationRecipientWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` NotificationRecipients 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` NotificationRecipients. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of NotificationRecipients. + */ + distinct?: NotificationRecipientScalarFieldEnum | NotificationRecipientScalarFieldEnum[] + } + + /** + * NotificationRecipient findMany + */ + export type NotificationRecipientFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + /** + * Filter, which NotificationRecipients to fetch. + */ + where?: NotificationRecipientWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of NotificationRecipients to fetch. + */ + orderBy?: NotificationRecipientOrderByWithRelationInput | NotificationRecipientOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing NotificationRecipients. + */ + cursor?: NotificationRecipientWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` NotificationRecipients 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` NotificationRecipients. + */ + skip?: number + distinct?: NotificationRecipientScalarFieldEnum | NotificationRecipientScalarFieldEnum[] + } + + /** + * NotificationRecipient create + */ + export type NotificationRecipientCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + /** + * The data needed to create a NotificationRecipient. + */ + data: XOR<NotificationRecipientCreateInput, NotificationRecipientUncheckedCreateInput> + } + + /** + * NotificationRecipient createMany + */ + export type NotificationRecipientCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many NotificationRecipients. + */ + data: NotificationRecipientCreateManyInput | NotificationRecipientCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * NotificationRecipient createManyAndReturn + */ + export type NotificationRecipientCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many NotificationRecipients. + */ + data: NotificationRecipientCreateManyInput | NotificationRecipientCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientIncludeCreateManyAndReturn<ExtArgs> | null + } + + /** + * NotificationRecipient update + */ + export type NotificationRecipientUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + /** + * The data needed to update a NotificationRecipient. + */ + data: XOR<NotificationRecipientUpdateInput, NotificationRecipientUncheckedUpdateInput> + /** + * Choose, which NotificationRecipient to update. + */ + where: NotificationRecipientWhereUniqueInput + } + + /** + * NotificationRecipient updateMany + */ + export type NotificationRecipientUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update NotificationRecipients. + */ + data: XOR<NotificationRecipientUpdateManyMutationInput, NotificationRecipientUncheckedUpdateManyInput> + /** + * Filter which NotificationRecipients to update + */ + where?: NotificationRecipientWhereInput + } + + /** + * NotificationRecipient upsert + */ + export type NotificationRecipientUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + /** + * The filter to search for the NotificationRecipient to update in case it exists. + */ + where: NotificationRecipientWhereUniqueInput + /** + * In case the NotificationRecipient found by the `where` argument doesn't exist, create a new NotificationRecipient with this data. + */ + create: XOR<NotificationRecipientCreateInput, NotificationRecipientUncheckedCreateInput> + /** + * In case the NotificationRecipient was found with the provided `where` argument, update it with this data. + */ + update: XOR<NotificationRecipientUpdateInput, NotificationRecipientUncheckedUpdateInput> + } + + /** + * NotificationRecipient delete + */ + export type NotificationRecipientDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + /** + * Filter which NotificationRecipient to delete. + */ + where: NotificationRecipientWhereUniqueInput + } + + /** + * NotificationRecipient deleteMany + */ + export type NotificationRecipientDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which NotificationRecipients to delete + */ + where?: NotificationRecipientWhereInput + } + + /** + * NotificationRecipient without action + */ + export type NotificationRecipientDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NotificationRecipient + */ + select?: NotificationRecipientSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NotificationRecipientInclude<ExtArgs> | null + } + + + /** + * Model NewsletterSubscriber + */ + + export type AggregateNewsletterSubscriber = { + _count: NewsletterSubscriberCountAggregateOutputType | null + _min: NewsletterSubscriberMinAggregateOutputType | null + _max: NewsletterSubscriberMaxAggregateOutputType | null + } + + export type NewsletterSubscriberMinAggregateOutputType = { + id: string | null + email: string | null + mobile: string | null + createdAt: Date | null + } + + export type NewsletterSubscriberMaxAggregateOutputType = { + id: string | null + email: string | null + mobile: string | null + createdAt: Date | null + } + + export type NewsletterSubscriberCountAggregateOutputType = { + id: number + email: number + mobile: number + createdAt: number + _all: number + } + + + export type NewsletterSubscriberMinAggregateInputType = { + id?: true + email?: true + mobile?: true + createdAt?: true + } + + export type NewsletterSubscriberMaxAggregateInputType = { + id?: true + email?: true + mobile?: true + createdAt?: true + } + + export type NewsletterSubscriberCountAggregateInputType = { + id?: true + email?: true + mobile?: true + createdAt?: true + _all?: true + } + + export type NewsletterSubscriberAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which NewsletterSubscriber to aggregate. + */ + where?: NewsletterSubscriberWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of NewsletterSubscribers to fetch. + */ + orderBy?: NewsletterSubscriberOrderByWithRelationInput | NewsletterSubscriberOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: NewsletterSubscriberWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` NewsletterSubscribers 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` NewsletterSubscribers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned NewsletterSubscribers + **/ + _count?: true | NewsletterSubscriberCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: NewsletterSubscriberMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: NewsletterSubscriberMaxAggregateInputType + } + + export type GetNewsletterSubscriberAggregateType<T extends NewsletterSubscriberAggregateArgs> = { + [P in keyof T & keyof AggregateNewsletterSubscriber]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateNewsletterSubscriber[P]> + : GetScalarType<T[P], AggregateNewsletterSubscriber[P]> + } + + + + + export type NewsletterSubscriberGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: NewsletterSubscriberWhereInput + orderBy?: NewsletterSubscriberOrderByWithAggregationInput | NewsletterSubscriberOrderByWithAggregationInput[] + by: NewsletterSubscriberScalarFieldEnum[] | NewsletterSubscriberScalarFieldEnum + having?: NewsletterSubscriberScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: NewsletterSubscriberCountAggregateInputType | true + _min?: NewsletterSubscriberMinAggregateInputType + _max?: NewsletterSubscriberMaxAggregateInputType + } + + export type NewsletterSubscriberGroupByOutputType = { + id: string + email: string | null + mobile: string | null + createdAt: Date + _count: NewsletterSubscriberCountAggregateOutputType | null + _min: NewsletterSubscriberMinAggregateOutputType | null + _max: NewsletterSubscriberMaxAggregateOutputType | null + } + + type GetNewsletterSubscriberGroupByPayload<T extends NewsletterSubscriberGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<NewsletterSubscriberGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof NewsletterSubscriberGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], NewsletterSubscriberGroupByOutputType[P]> + : GetScalarType<T[P], NewsletterSubscriberGroupByOutputType[P]> + } + > + > + + + export type NewsletterSubscriberSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + email?: boolean + mobile?: boolean + createdAt?: boolean + }, ExtArgs["result"]["newsletterSubscriber"]> + + export type NewsletterSubscriberSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + email?: boolean + mobile?: boolean + createdAt?: boolean + }, ExtArgs["result"]["newsletterSubscriber"]> + + export type NewsletterSubscriberSelectScalar = { + id?: boolean + email?: boolean + mobile?: boolean + createdAt?: boolean + } + + + export type $NewsletterSubscriberPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "NewsletterSubscriber" + objects: {} + scalars: $Extensions.GetPayloadResult<{ + id: string + email: string | null + mobile: string | null + createdAt: Date + }, ExtArgs["result"]["newsletterSubscriber"]> + composites: {} + } + + type NewsletterSubscriberGetPayload<S extends boolean | null | undefined | NewsletterSubscriberDefaultArgs> = $Result.GetResult<Prisma.$NewsletterSubscriberPayload, S> + + type NewsletterSubscriberCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<NewsletterSubscriberFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: NewsletterSubscriberCountAggregateInputType | true + } + + export interface NewsletterSubscriberDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['NewsletterSubscriber'], meta: { name: 'NewsletterSubscriber' } } + /** + * Find zero or one NewsletterSubscriber that matches the filter. + * @param {NewsletterSubscriberFindUniqueArgs} args - Arguments to find a NewsletterSubscriber + * @example + * // Get one NewsletterSubscriber + * const newsletterSubscriber = await prisma.newsletterSubscriber.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends NewsletterSubscriberFindUniqueArgs>(args: SelectSubset<T, NewsletterSubscriberFindUniqueArgs<ExtArgs>>): Prisma__NewsletterSubscriberClient<$Result.GetResult<Prisma.$NewsletterSubscriberPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one NewsletterSubscriber that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {NewsletterSubscriberFindUniqueOrThrowArgs} args - Arguments to find a NewsletterSubscriber + * @example + * // Get one NewsletterSubscriber + * const newsletterSubscriber = await prisma.newsletterSubscriber.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends NewsletterSubscriberFindUniqueOrThrowArgs>(args: SelectSubset<T, NewsletterSubscriberFindUniqueOrThrowArgs<ExtArgs>>): Prisma__NewsletterSubscriberClient<$Result.GetResult<Prisma.$NewsletterSubscriberPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first NewsletterSubscriber 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 {NewsletterSubscriberFindFirstArgs} args - Arguments to find a NewsletterSubscriber + * @example + * // Get one NewsletterSubscriber + * const newsletterSubscriber = await prisma.newsletterSubscriber.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends NewsletterSubscriberFindFirstArgs>(args?: SelectSubset<T, NewsletterSubscriberFindFirstArgs<ExtArgs>>): Prisma__NewsletterSubscriberClient<$Result.GetResult<Prisma.$NewsletterSubscriberPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first NewsletterSubscriber 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 {NewsletterSubscriberFindFirstOrThrowArgs} args - Arguments to find a NewsletterSubscriber + * @example + * // Get one NewsletterSubscriber + * const newsletterSubscriber = await prisma.newsletterSubscriber.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends NewsletterSubscriberFindFirstOrThrowArgs>(args?: SelectSubset<T, NewsletterSubscriberFindFirstOrThrowArgs<ExtArgs>>): Prisma__NewsletterSubscriberClient<$Result.GetResult<Prisma.$NewsletterSubscriberPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more NewsletterSubscribers 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 {NewsletterSubscriberFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all NewsletterSubscribers + * const newsletterSubscribers = await prisma.newsletterSubscriber.findMany() + * + * // Get first 10 NewsletterSubscribers + * const newsletterSubscribers = await prisma.newsletterSubscriber.findMany({ take: 10 }) + * + * // Only select the `id` + * const newsletterSubscriberWithIdOnly = await prisma.newsletterSubscriber.findMany({ select: { id: true } }) + * + */ + findMany<T extends NewsletterSubscriberFindManyArgs>(args?: SelectSubset<T, NewsletterSubscriberFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NewsletterSubscriberPayload<ExtArgs>, T, "findMany">> + + /** + * Create a NewsletterSubscriber. + * @param {NewsletterSubscriberCreateArgs} args - Arguments to create a NewsletterSubscriber. + * @example + * // Create one NewsletterSubscriber + * const NewsletterSubscriber = await prisma.newsletterSubscriber.create({ + * data: { + * // ... data to create a NewsletterSubscriber + * } + * }) + * + */ + create<T extends NewsletterSubscriberCreateArgs>(args: SelectSubset<T, NewsletterSubscriberCreateArgs<ExtArgs>>): Prisma__NewsletterSubscriberClient<$Result.GetResult<Prisma.$NewsletterSubscriberPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many NewsletterSubscribers. + * @param {NewsletterSubscriberCreateManyArgs} args - Arguments to create many NewsletterSubscribers. + * @example + * // Create many NewsletterSubscribers + * const newsletterSubscriber = await prisma.newsletterSubscriber.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends NewsletterSubscriberCreateManyArgs>(args?: SelectSubset<T, NewsletterSubscriberCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many NewsletterSubscribers and returns the data saved in the database. + * @param {NewsletterSubscriberCreateManyAndReturnArgs} args - Arguments to create many NewsletterSubscribers. + * @example + * // Create many NewsletterSubscribers + * const newsletterSubscriber = await prisma.newsletterSubscriber.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many NewsletterSubscribers and only return the `id` + * const newsletterSubscriberWithIdOnly = await prisma.newsletterSubscriber.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends NewsletterSubscriberCreateManyAndReturnArgs>(args?: SelectSubset<T, NewsletterSubscriberCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$NewsletterSubscriberPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a NewsletterSubscriber. + * @param {NewsletterSubscriberDeleteArgs} args - Arguments to delete one NewsletterSubscriber. + * @example + * // Delete one NewsletterSubscriber + * const NewsletterSubscriber = await prisma.newsletterSubscriber.delete({ + * where: { + * // ... filter to delete one NewsletterSubscriber + * } + * }) + * + */ + delete<T extends NewsletterSubscriberDeleteArgs>(args: SelectSubset<T, NewsletterSubscriberDeleteArgs<ExtArgs>>): Prisma__NewsletterSubscriberClient<$Result.GetResult<Prisma.$NewsletterSubscriberPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one NewsletterSubscriber. + * @param {NewsletterSubscriberUpdateArgs} args - Arguments to update one NewsletterSubscriber. + * @example + * // Update one NewsletterSubscriber + * const newsletterSubscriber = await prisma.newsletterSubscriber.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends NewsletterSubscriberUpdateArgs>(args: SelectSubset<T, NewsletterSubscriberUpdateArgs<ExtArgs>>): Prisma__NewsletterSubscriberClient<$Result.GetResult<Prisma.$NewsletterSubscriberPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more NewsletterSubscribers. + * @param {NewsletterSubscriberDeleteManyArgs} args - Arguments to filter NewsletterSubscribers to delete. + * @example + * // Delete a few NewsletterSubscribers + * const { count } = await prisma.newsletterSubscriber.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends NewsletterSubscriberDeleteManyArgs>(args?: SelectSubset<T, NewsletterSubscriberDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more NewsletterSubscribers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NewsletterSubscriberUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many NewsletterSubscribers + * const newsletterSubscriber = await prisma.newsletterSubscriber.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends NewsletterSubscriberUpdateManyArgs>(args: SelectSubset<T, NewsletterSubscriberUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one NewsletterSubscriber. + * @param {NewsletterSubscriberUpsertArgs} args - Arguments to update or create a NewsletterSubscriber. + * @example + * // Update or create a NewsletterSubscriber + * const newsletterSubscriber = await prisma.newsletterSubscriber.upsert({ + * create: { + * // ... data to create a NewsletterSubscriber + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the NewsletterSubscriber we want to update + * } + * }) + */ + upsert<T extends NewsletterSubscriberUpsertArgs>(args: SelectSubset<T, NewsletterSubscriberUpsertArgs<ExtArgs>>): Prisma__NewsletterSubscriberClient<$Result.GetResult<Prisma.$NewsletterSubscriberPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of NewsletterSubscribers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NewsletterSubscriberCountArgs} args - Arguments to filter NewsletterSubscribers to count. + * @example + * // Count the number of NewsletterSubscribers + * const count = await prisma.newsletterSubscriber.count({ + * where: { + * // ... the filter for the NewsletterSubscribers we want to count + * } + * }) + **/ + count<T extends NewsletterSubscriberCountArgs>( + args?: Subset<T, NewsletterSubscriberCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], NewsletterSubscriberCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a NewsletterSubscriber. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NewsletterSubscriberAggregateArgs} 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<T extends NewsletterSubscriberAggregateArgs>(args: Subset<T, NewsletterSubscriberAggregateArgs>): Prisma.PrismaPromise<GetNewsletterSubscriberAggregateType<T>> + + /** + * Group by NewsletterSubscriber. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {NewsletterSubscriberGroupByArgs} 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 NewsletterSubscriberGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: NewsletterSubscriberGroupByArgs['orderBy'] } + : { orderBy?: NewsletterSubscriberGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, NewsletterSubscriberGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetNewsletterSubscriberGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the NewsletterSubscriber model + */ + readonly fields: NewsletterSubscriberFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for NewsletterSubscriber. + * 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__NewsletterSubscriberClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the NewsletterSubscriber model + */ + interface NewsletterSubscriberFieldRefs { + readonly id: FieldRef<"NewsletterSubscriber", 'String'> + readonly email: FieldRef<"NewsletterSubscriber", 'String'> + readonly mobile: FieldRef<"NewsletterSubscriber", 'String'> + readonly createdAt: FieldRef<"NewsletterSubscriber", 'DateTime'> + } + + + // Custom InputTypes + /** + * NewsletterSubscriber findUnique + */ + export type NewsletterSubscriberFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelect<ExtArgs> | null + /** + * Filter, which NewsletterSubscriber to fetch. + */ + where: NewsletterSubscriberWhereUniqueInput + } + + /** + * NewsletterSubscriber findUniqueOrThrow + */ + export type NewsletterSubscriberFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelect<ExtArgs> | null + /** + * Filter, which NewsletterSubscriber to fetch. + */ + where: NewsletterSubscriberWhereUniqueInput + } + + /** + * NewsletterSubscriber findFirst + */ + export type NewsletterSubscriberFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelect<ExtArgs> | null + /** + * Filter, which NewsletterSubscriber to fetch. + */ + where?: NewsletterSubscriberWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of NewsletterSubscribers to fetch. + */ + orderBy?: NewsletterSubscriberOrderByWithRelationInput | NewsletterSubscriberOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for NewsletterSubscribers. + */ + cursor?: NewsletterSubscriberWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` NewsletterSubscribers 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` NewsletterSubscribers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of NewsletterSubscribers. + */ + distinct?: NewsletterSubscriberScalarFieldEnum | NewsletterSubscriberScalarFieldEnum[] + } + + /** + * NewsletterSubscriber findFirstOrThrow + */ + export type NewsletterSubscriberFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelect<ExtArgs> | null + /** + * Filter, which NewsletterSubscriber to fetch. + */ + where?: NewsletterSubscriberWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of NewsletterSubscribers to fetch. + */ + orderBy?: NewsletterSubscriberOrderByWithRelationInput | NewsletterSubscriberOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for NewsletterSubscribers. + */ + cursor?: NewsletterSubscriberWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` NewsletterSubscribers 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` NewsletterSubscribers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of NewsletterSubscribers. + */ + distinct?: NewsletterSubscriberScalarFieldEnum | NewsletterSubscriberScalarFieldEnum[] + } + + /** + * NewsletterSubscriber findMany + */ + export type NewsletterSubscriberFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelect<ExtArgs> | null + /** + * Filter, which NewsletterSubscribers to fetch. + */ + where?: NewsletterSubscriberWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of NewsletterSubscribers to fetch. + */ + orderBy?: NewsletterSubscriberOrderByWithRelationInput | NewsletterSubscriberOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing NewsletterSubscribers. + */ + cursor?: NewsletterSubscriberWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` NewsletterSubscribers 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` NewsletterSubscribers. + */ + skip?: number + distinct?: NewsletterSubscriberScalarFieldEnum | NewsletterSubscriberScalarFieldEnum[] + } + + /** + * NewsletterSubscriber create + */ + export type NewsletterSubscriberCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelect<ExtArgs> | null + /** + * The data needed to create a NewsletterSubscriber. + */ + data?: XOR<NewsletterSubscriberCreateInput, NewsletterSubscriberUncheckedCreateInput> + } + + /** + * NewsletterSubscriber createMany + */ + export type NewsletterSubscriberCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many NewsletterSubscribers. + */ + data: NewsletterSubscriberCreateManyInput | NewsletterSubscriberCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * NewsletterSubscriber createManyAndReturn + */ + export type NewsletterSubscriberCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many NewsletterSubscribers. + */ + data: NewsletterSubscriberCreateManyInput | NewsletterSubscriberCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * NewsletterSubscriber update + */ + export type NewsletterSubscriberUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelect<ExtArgs> | null + /** + * The data needed to update a NewsletterSubscriber. + */ + data: XOR<NewsletterSubscriberUpdateInput, NewsletterSubscriberUncheckedUpdateInput> + /** + * Choose, which NewsletterSubscriber to update. + */ + where: NewsletterSubscriberWhereUniqueInput + } + + /** + * NewsletterSubscriber updateMany + */ + export type NewsletterSubscriberUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update NewsletterSubscribers. + */ + data: XOR<NewsletterSubscriberUpdateManyMutationInput, NewsletterSubscriberUncheckedUpdateManyInput> + /** + * Filter which NewsletterSubscribers to update + */ + where?: NewsletterSubscriberWhereInput + } + + /** + * NewsletterSubscriber upsert + */ + export type NewsletterSubscriberUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelect<ExtArgs> | null + /** + * The filter to search for the NewsletterSubscriber to update in case it exists. + */ + where: NewsletterSubscriberWhereUniqueInput + /** + * In case the NewsletterSubscriber found by the `where` argument doesn't exist, create a new NewsletterSubscriber with this data. + */ + create: XOR<NewsletterSubscriberCreateInput, NewsletterSubscriberUncheckedCreateInput> + /** + * In case the NewsletterSubscriber was found with the provided `where` argument, update it with this data. + */ + update: XOR<NewsletterSubscriberUpdateInput, NewsletterSubscriberUncheckedUpdateInput> + } + + /** + * NewsletterSubscriber delete + */ + export type NewsletterSubscriberDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelect<ExtArgs> | null + /** + * Filter which NewsletterSubscriber to delete. + */ + where: NewsletterSubscriberWhereUniqueInput + } + + /** + * NewsletterSubscriber deleteMany + */ + export type NewsletterSubscriberDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which NewsletterSubscribers to delete + */ + where?: NewsletterSubscriberWhereInput + } + + /** + * NewsletterSubscriber without action + */ + export type NewsletterSubscriberDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the NewsletterSubscriber + */ + select?: NewsletterSubscriberSelect<ExtArgs> | null + } + + + /** + * Model CustomerActivityLog + */ + + export type AggregateCustomerActivityLog = { + _count: CustomerActivityLogCountAggregateOutputType | null + _min: CustomerActivityLogMinAggregateOutputType | null + _max: CustomerActivityLogMaxAggregateOutputType | null + } + + export type CustomerActivityLogMinAggregateOutputType = { + id: string | null + customerId: string | null + action: string | null + detail: string | null + createdAt: Date | null + } + + export type CustomerActivityLogMaxAggregateOutputType = { + id: string | null + customerId: string | null + action: string | null + detail: string | null + createdAt: Date | null + } + + export type CustomerActivityLogCountAggregateOutputType = { + id: number + customerId: number + action: number + detail: number + createdAt: number + _all: number + } + + + export type CustomerActivityLogMinAggregateInputType = { + id?: true + customerId?: true + action?: true + detail?: true + createdAt?: true + } + + export type CustomerActivityLogMaxAggregateInputType = { + id?: true + customerId?: true + action?: true + detail?: true + createdAt?: true + } + + export type CustomerActivityLogCountAggregateInputType = { + id?: true + customerId?: true + action?: true + detail?: true + createdAt?: true + _all?: true + } + + export type CustomerActivityLogAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which CustomerActivityLog to aggregate. + */ + where?: CustomerActivityLogWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CustomerActivityLogs to fetch. + */ + orderBy?: CustomerActivityLogOrderByWithRelationInput | CustomerActivityLogOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: CustomerActivityLogWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CustomerActivityLogs 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` CustomerActivityLogs. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned CustomerActivityLogs + **/ + _count?: true | CustomerActivityLogCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: CustomerActivityLogMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: CustomerActivityLogMaxAggregateInputType + } + + export type GetCustomerActivityLogAggregateType<T extends CustomerActivityLogAggregateArgs> = { + [P in keyof T & keyof AggregateCustomerActivityLog]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateCustomerActivityLog[P]> + : GetScalarType<T[P], AggregateCustomerActivityLog[P]> + } + + + + + export type CustomerActivityLogGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: CustomerActivityLogWhereInput + orderBy?: CustomerActivityLogOrderByWithAggregationInput | CustomerActivityLogOrderByWithAggregationInput[] + by: CustomerActivityLogScalarFieldEnum[] | CustomerActivityLogScalarFieldEnum + having?: CustomerActivityLogScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: CustomerActivityLogCountAggregateInputType | true + _min?: CustomerActivityLogMinAggregateInputType + _max?: CustomerActivityLogMaxAggregateInputType + } + + export type CustomerActivityLogGroupByOutputType = { + id: string + customerId: string + action: string + detail: string | null + createdAt: Date + _count: CustomerActivityLogCountAggregateOutputType | null + _min: CustomerActivityLogMinAggregateOutputType | null + _max: CustomerActivityLogMaxAggregateOutputType | null + } + + type GetCustomerActivityLogGroupByPayload<T extends CustomerActivityLogGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<CustomerActivityLogGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof CustomerActivityLogGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], CustomerActivityLogGroupByOutputType[P]> + : GetScalarType<T[P], CustomerActivityLogGroupByOutputType[P]> + } + > + > + + + export type CustomerActivityLogSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + customerId?: boolean + action?: boolean + detail?: boolean + createdAt?: boolean + customer?: boolean | CustomerDefaultArgs<ExtArgs> + }, ExtArgs["result"]["customerActivityLog"]> + + export type CustomerActivityLogSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + customerId?: boolean + action?: boolean + detail?: boolean + createdAt?: boolean + customer?: boolean | CustomerDefaultArgs<ExtArgs> + }, ExtArgs["result"]["customerActivityLog"]> + + export type CustomerActivityLogSelectScalar = { + id?: boolean + customerId?: boolean + action?: boolean + detail?: boolean + createdAt?: boolean + } + + export type CustomerActivityLogInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + customer?: boolean | CustomerDefaultArgs<ExtArgs> + } + export type CustomerActivityLogIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + customer?: boolean | CustomerDefaultArgs<ExtArgs> + } + + export type $CustomerActivityLogPayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "CustomerActivityLog" + objects: { + customer: Prisma.$CustomerPayload<ExtArgs> + } + scalars: $Extensions.GetPayloadResult<{ + id: string + customerId: string + /** + * Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'. + */ + action: string + detail: string | null + createdAt: Date + }, ExtArgs["result"]["customerActivityLog"]> + composites: {} + } + + type CustomerActivityLogGetPayload<S extends boolean | null | undefined | CustomerActivityLogDefaultArgs> = $Result.GetResult<Prisma.$CustomerActivityLogPayload, S> + + type CustomerActivityLogCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<CustomerActivityLogFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: CustomerActivityLogCountAggregateInputType | true + } + + export interface CustomerActivityLogDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['CustomerActivityLog'], meta: { name: 'CustomerActivityLog' } } + /** + * Find zero or one CustomerActivityLog that matches the filter. + * @param {CustomerActivityLogFindUniqueArgs} args - Arguments to find a CustomerActivityLog + * @example + * // Get one CustomerActivityLog + * const customerActivityLog = await prisma.customerActivityLog.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends CustomerActivityLogFindUniqueArgs>(args: SelectSubset<T, CustomerActivityLogFindUniqueArgs<ExtArgs>>): Prisma__CustomerActivityLogClient<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one CustomerActivityLog that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {CustomerActivityLogFindUniqueOrThrowArgs} args - Arguments to find a CustomerActivityLog + * @example + * // Get one CustomerActivityLog + * const customerActivityLog = await prisma.customerActivityLog.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends CustomerActivityLogFindUniqueOrThrowArgs>(args: SelectSubset<T, CustomerActivityLogFindUniqueOrThrowArgs<ExtArgs>>): Prisma__CustomerActivityLogClient<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first CustomerActivityLog 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 {CustomerActivityLogFindFirstArgs} args - Arguments to find a CustomerActivityLog + * @example + * // Get one CustomerActivityLog + * const customerActivityLog = await prisma.customerActivityLog.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends CustomerActivityLogFindFirstArgs>(args?: SelectSubset<T, CustomerActivityLogFindFirstArgs<ExtArgs>>): Prisma__CustomerActivityLogClient<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first CustomerActivityLog 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 {CustomerActivityLogFindFirstOrThrowArgs} args - Arguments to find a CustomerActivityLog + * @example + * // Get one CustomerActivityLog + * const customerActivityLog = await prisma.customerActivityLog.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends CustomerActivityLogFindFirstOrThrowArgs>(args?: SelectSubset<T, CustomerActivityLogFindFirstOrThrowArgs<ExtArgs>>): Prisma__CustomerActivityLogClient<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more CustomerActivityLogs 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 {CustomerActivityLogFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all CustomerActivityLogs + * const customerActivityLogs = await prisma.customerActivityLog.findMany() + * + * // Get first 10 CustomerActivityLogs + * const customerActivityLogs = await prisma.customerActivityLog.findMany({ take: 10 }) + * + * // Only select the `id` + * const customerActivityLogWithIdOnly = await prisma.customerActivityLog.findMany({ select: { id: true } }) + * + */ + findMany<T extends CustomerActivityLogFindManyArgs>(args?: SelectSubset<T, CustomerActivityLogFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "findMany">> + + /** + * Create a CustomerActivityLog. + * @param {CustomerActivityLogCreateArgs} args - Arguments to create a CustomerActivityLog. + * @example + * // Create one CustomerActivityLog + * const CustomerActivityLog = await prisma.customerActivityLog.create({ + * data: { + * // ... data to create a CustomerActivityLog + * } + * }) + * + */ + create<T extends CustomerActivityLogCreateArgs>(args: SelectSubset<T, CustomerActivityLogCreateArgs<ExtArgs>>): Prisma__CustomerActivityLogClient<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many CustomerActivityLogs. + * @param {CustomerActivityLogCreateManyArgs} args - Arguments to create many CustomerActivityLogs. + * @example + * // Create many CustomerActivityLogs + * const customerActivityLog = await prisma.customerActivityLog.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends CustomerActivityLogCreateManyArgs>(args?: SelectSubset<T, CustomerActivityLogCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many CustomerActivityLogs and returns the data saved in the database. + * @param {CustomerActivityLogCreateManyAndReturnArgs} args - Arguments to create many CustomerActivityLogs. + * @example + * // Create many CustomerActivityLogs + * const customerActivityLog = await prisma.customerActivityLog.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many CustomerActivityLogs and only return the `id` + * const customerActivityLogWithIdOnly = await prisma.customerActivityLog.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends CustomerActivityLogCreateManyAndReturnArgs>(args?: SelectSubset<T, CustomerActivityLogCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a CustomerActivityLog. + * @param {CustomerActivityLogDeleteArgs} args - Arguments to delete one CustomerActivityLog. + * @example + * // Delete one CustomerActivityLog + * const CustomerActivityLog = await prisma.customerActivityLog.delete({ + * where: { + * // ... filter to delete one CustomerActivityLog + * } + * }) + * + */ + delete<T extends CustomerActivityLogDeleteArgs>(args: SelectSubset<T, CustomerActivityLogDeleteArgs<ExtArgs>>): Prisma__CustomerActivityLogClient<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one CustomerActivityLog. + * @param {CustomerActivityLogUpdateArgs} args - Arguments to update one CustomerActivityLog. + * @example + * // Update one CustomerActivityLog + * const customerActivityLog = await prisma.customerActivityLog.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends CustomerActivityLogUpdateArgs>(args: SelectSubset<T, CustomerActivityLogUpdateArgs<ExtArgs>>): Prisma__CustomerActivityLogClient<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more CustomerActivityLogs. + * @param {CustomerActivityLogDeleteManyArgs} args - Arguments to filter CustomerActivityLogs to delete. + * @example + * // Delete a few CustomerActivityLogs + * const { count } = await prisma.customerActivityLog.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends CustomerActivityLogDeleteManyArgs>(args?: SelectSubset<T, CustomerActivityLogDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more CustomerActivityLogs. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CustomerActivityLogUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many CustomerActivityLogs + * const customerActivityLog = await prisma.customerActivityLog.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends CustomerActivityLogUpdateManyArgs>(args: SelectSubset<T, CustomerActivityLogUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one CustomerActivityLog. + * @param {CustomerActivityLogUpsertArgs} args - Arguments to update or create a CustomerActivityLog. + * @example + * // Update or create a CustomerActivityLog + * const customerActivityLog = await prisma.customerActivityLog.upsert({ + * create: { + * // ... data to create a CustomerActivityLog + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the CustomerActivityLog we want to update + * } + * }) + */ + upsert<T extends CustomerActivityLogUpsertArgs>(args: SelectSubset<T, CustomerActivityLogUpsertArgs<ExtArgs>>): Prisma__CustomerActivityLogClient<$Result.GetResult<Prisma.$CustomerActivityLogPayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of CustomerActivityLogs. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CustomerActivityLogCountArgs} args - Arguments to filter CustomerActivityLogs to count. + * @example + * // Count the number of CustomerActivityLogs + * const count = await prisma.customerActivityLog.count({ + * where: { + * // ... the filter for the CustomerActivityLogs we want to count + * } + * }) + **/ + count<T extends CustomerActivityLogCountArgs>( + args?: Subset<T, CustomerActivityLogCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], CustomerActivityLogCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a CustomerActivityLog. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CustomerActivityLogAggregateArgs} 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<T extends CustomerActivityLogAggregateArgs>(args: Subset<T, CustomerActivityLogAggregateArgs>): Prisma.PrismaPromise<GetCustomerActivityLogAggregateType<T>> + + /** + * Group by CustomerActivityLog. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {CustomerActivityLogGroupByArgs} 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 CustomerActivityLogGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: CustomerActivityLogGroupByArgs['orderBy'] } + : { orderBy?: CustomerActivityLogGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, CustomerActivityLogGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetCustomerActivityLogGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the CustomerActivityLog model + */ + readonly fields: CustomerActivityLogFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for CustomerActivityLog. + * 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__CustomerActivityLogClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + customer<T extends CustomerDefaultArgs<ExtArgs> = {}>(args?: Subset<T, CustomerDefaultArgs<ExtArgs>>): Prisma__CustomerClient<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow"> | Null, Null, ExtArgs> + /** + * 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the CustomerActivityLog model + */ + interface CustomerActivityLogFieldRefs { + readonly id: FieldRef<"CustomerActivityLog", 'String'> + readonly customerId: FieldRef<"CustomerActivityLog", 'String'> + readonly action: FieldRef<"CustomerActivityLog", 'String'> + readonly detail: FieldRef<"CustomerActivityLog", 'String'> + readonly createdAt: FieldRef<"CustomerActivityLog", 'DateTime'> + } + + + // Custom InputTypes + /** + * CustomerActivityLog findUnique + */ + export type CustomerActivityLogFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + /** + * Filter, which CustomerActivityLog to fetch. + */ + where: CustomerActivityLogWhereUniqueInput + } + + /** + * CustomerActivityLog findUniqueOrThrow + */ + export type CustomerActivityLogFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + /** + * Filter, which CustomerActivityLog to fetch. + */ + where: CustomerActivityLogWhereUniqueInput + } + + /** + * CustomerActivityLog findFirst + */ + export type CustomerActivityLogFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + /** + * Filter, which CustomerActivityLog to fetch. + */ + where?: CustomerActivityLogWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CustomerActivityLogs to fetch. + */ + orderBy?: CustomerActivityLogOrderByWithRelationInput | CustomerActivityLogOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for CustomerActivityLogs. + */ + cursor?: CustomerActivityLogWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CustomerActivityLogs 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` CustomerActivityLogs. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CustomerActivityLogs. + */ + distinct?: CustomerActivityLogScalarFieldEnum | CustomerActivityLogScalarFieldEnum[] + } + + /** + * CustomerActivityLog findFirstOrThrow + */ + export type CustomerActivityLogFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + /** + * Filter, which CustomerActivityLog to fetch. + */ + where?: CustomerActivityLogWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CustomerActivityLogs to fetch. + */ + orderBy?: CustomerActivityLogOrderByWithRelationInput | CustomerActivityLogOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for CustomerActivityLogs. + */ + cursor?: CustomerActivityLogWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CustomerActivityLogs 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` CustomerActivityLogs. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of CustomerActivityLogs. + */ + distinct?: CustomerActivityLogScalarFieldEnum | CustomerActivityLogScalarFieldEnum[] + } + + /** + * CustomerActivityLog findMany + */ + export type CustomerActivityLogFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + /** + * Filter, which CustomerActivityLogs to fetch. + */ + where?: CustomerActivityLogWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of CustomerActivityLogs to fetch. + */ + orderBy?: CustomerActivityLogOrderByWithRelationInput | CustomerActivityLogOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing CustomerActivityLogs. + */ + cursor?: CustomerActivityLogWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` CustomerActivityLogs 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` CustomerActivityLogs. + */ + skip?: number + distinct?: CustomerActivityLogScalarFieldEnum | CustomerActivityLogScalarFieldEnum[] + } + + /** + * CustomerActivityLog create + */ + export type CustomerActivityLogCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + /** + * The data needed to create a CustomerActivityLog. + */ + data: XOR<CustomerActivityLogCreateInput, CustomerActivityLogUncheckedCreateInput> + } + + /** + * CustomerActivityLog createMany + */ + export type CustomerActivityLogCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many CustomerActivityLogs. + */ + data: CustomerActivityLogCreateManyInput | CustomerActivityLogCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * CustomerActivityLog createManyAndReturn + */ + export type CustomerActivityLogCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many CustomerActivityLogs. + */ + data: CustomerActivityLogCreateManyInput | CustomerActivityLogCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogIncludeCreateManyAndReturn<ExtArgs> | null + } + + /** + * CustomerActivityLog update + */ + export type CustomerActivityLogUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + /** + * The data needed to update a CustomerActivityLog. + */ + data: XOR<CustomerActivityLogUpdateInput, CustomerActivityLogUncheckedUpdateInput> + /** + * Choose, which CustomerActivityLog to update. + */ + where: CustomerActivityLogWhereUniqueInput + } + + /** + * CustomerActivityLog updateMany + */ + export type CustomerActivityLogUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update CustomerActivityLogs. + */ + data: XOR<CustomerActivityLogUpdateManyMutationInput, CustomerActivityLogUncheckedUpdateManyInput> + /** + * Filter which CustomerActivityLogs to update + */ + where?: CustomerActivityLogWhereInput + } + + /** + * CustomerActivityLog upsert + */ + export type CustomerActivityLogUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + /** + * The filter to search for the CustomerActivityLog to update in case it exists. + */ + where: CustomerActivityLogWhereUniqueInput + /** + * In case the CustomerActivityLog found by the `where` argument doesn't exist, create a new CustomerActivityLog with this data. + */ + create: XOR<CustomerActivityLogCreateInput, CustomerActivityLogUncheckedCreateInput> + /** + * In case the CustomerActivityLog was found with the provided `where` argument, update it with this data. + */ + update: XOR<CustomerActivityLogUpdateInput, CustomerActivityLogUncheckedUpdateInput> + } + + /** + * CustomerActivityLog delete + */ + export type CustomerActivityLogDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + /** + * Filter which CustomerActivityLog to delete. + */ + where: CustomerActivityLogWhereUniqueInput + } + + /** + * CustomerActivityLog deleteMany + */ + export type CustomerActivityLogDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which CustomerActivityLogs to delete + */ + where?: CustomerActivityLogWhereInput + } + + /** + * CustomerActivityLog without action + */ + export type CustomerActivityLogDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the CustomerActivityLog + */ + select?: CustomerActivityLogSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerActivityLogInclude<ExtArgs> | null + } + + + /** + * Model UploadedFile + */ + + export type AggregateUploadedFile = { + _count: UploadedFileCountAggregateOutputType | null + _avg: UploadedFileAvgAggregateOutputType | null + _sum: UploadedFileSumAggregateOutputType | null + _min: UploadedFileMinAggregateOutputType | null + _max: UploadedFileMaxAggregateOutputType | null + } + + export type UploadedFileAvgAggregateOutputType = { + sizeBytes: number | null + } + + export type UploadedFileSumAggregateOutputType = { + sizeBytes: number | null + } + + export type UploadedFileMinAggregateOutputType = { + id: string | null + url: string | null + originalName: string | null + mimeType: string | null + sizeBytes: number | null + purpose: string | null + uploadedByAdminUserId: string | null + createdAt: Date | null + } + + export type UploadedFileMaxAggregateOutputType = { + id: string | null + url: string | null + originalName: string | null + mimeType: string | null + sizeBytes: number | null + purpose: string | null + uploadedByAdminUserId: string | null + createdAt: Date | null + } + + export type UploadedFileCountAggregateOutputType = { + id: number + url: number + originalName: number + mimeType: number + sizeBytes: number + purpose: number + uploadedByAdminUserId: number + createdAt: number + _all: number + } + + + export type UploadedFileAvgAggregateInputType = { + sizeBytes?: true + } + + export type UploadedFileSumAggregateInputType = { + sizeBytes?: true + } + + export type UploadedFileMinAggregateInputType = { + id?: true + url?: true + originalName?: true + mimeType?: true + sizeBytes?: true + purpose?: true + uploadedByAdminUserId?: true + createdAt?: true + } + + export type UploadedFileMaxAggregateInputType = { + id?: true + url?: true + originalName?: true + mimeType?: true + sizeBytes?: true + purpose?: true + uploadedByAdminUserId?: true + createdAt?: true + } + + export type UploadedFileCountAggregateInputType = { + id?: true + url?: true + originalName?: true + mimeType?: true + sizeBytes?: true + purpose?: true + uploadedByAdminUserId?: true + createdAt?: true + _all?: true + } + + export type UploadedFileAggregateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which UploadedFile to aggregate. + */ + where?: UploadedFileWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UploadedFiles to fetch. + */ + orderBy?: UploadedFileOrderByWithRelationInput | UploadedFileOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: UploadedFileWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UploadedFiles 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` UploadedFiles. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned UploadedFiles + **/ + _count?: true | UploadedFileCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: UploadedFileAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: UploadedFileSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UploadedFileMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UploadedFileMaxAggregateInputType + } + + export type GetUploadedFileAggregateType<T extends UploadedFileAggregateArgs> = { + [P in keyof T & keyof AggregateUploadedFile]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType<T[P], AggregateUploadedFile[P]> + : GetScalarType<T[P], AggregateUploadedFile[P]> + } + + + + + export type UploadedFileGroupByArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + where?: UploadedFileWhereInput + orderBy?: UploadedFileOrderByWithAggregationInput | UploadedFileOrderByWithAggregationInput[] + by: UploadedFileScalarFieldEnum[] | UploadedFileScalarFieldEnum + having?: UploadedFileScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UploadedFileCountAggregateInputType | true + _avg?: UploadedFileAvgAggregateInputType + _sum?: UploadedFileSumAggregateInputType + _min?: UploadedFileMinAggregateInputType + _max?: UploadedFileMaxAggregateInputType + } + + export type UploadedFileGroupByOutputType = { + id: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose: string | null + uploadedByAdminUserId: string | null + createdAt: Date + _count: UploadedFileCountAggregateOutputType | null + _avg: UploadedFileAvgAggregateOutputType | null + _sum: UploadedFileSumAggregateOutputType | null + _min: UploadedFileMinAggregateOutputType | null + _max: UploadedFileMaxAggregateOutputType | null + } + + type GetUploadedFileGroupByPayload<T extends UploadedFileGroupByArgs> = Prisma.PrismaPromise< + Array< + PickEnumerable<UploadedFileGroupByOutputType, T['by']> & + { + [P in ((keyof T) & (keyof UploadedFileGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType<T[P], UploadedFileGroupByOutputType[P]> + : GetScalarType<T[P], UploadedFileGroupByOutputType[P]> + } + > + > + + + export type UploadedFileSelect<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + url?: boolean + originalName?: boolean + mimeType?: boolean + sizeBytes?: boolean + purpose?: boolean + uploadedByAdminUserId?: boolean + createdAt?: boolean + uploadedByAdminUser?: boolean | UploadedFile$uploadedByAdminUserArgs<ExtArgs> + customerAvatars?: boolean | UploadedFile$customerAvatarsArgs<ExtArgs> + _count?: boolean | UploadedFileCountOutputTypeDefaultArgs<ExtArgs> + }, ExtArgs["result"]["uploadedFile"]> + + export type UploadedFileSelectCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = $Extensions.GetSelect<{ + id?: boolean + url?: boolean + originalName?: boolean + mimeType?: boolean + sizeBytes?: boolean + purpose?: boolean + uploadedByAdminUserId?: boolean + createdAt?: boolean + uploadedByAdminUser?: boolean | UploadedFile$uploadedByAdminUserArgs<ExtArgs> + }, ExtArgs["result"]["uploadedFile"]> + + export type UploadedFileSelectScalar = { + id?: boolean + url?: boolean + originalName?: boolean + mimeType?: boolean + sizeBytes?: boolean + purpose?: boolean + uploadedByAdminUserId?: boolean + createdAt?: boolean + } + + export type UploadedFileInclude<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + uploadedByAdminUser?: boolean | UploadedFile$uploadedByAdminUserArgs<ExtArgs> + customerAvatars?: boolean | UploadedFile$customerAvatarsArgs<ExtArgs> + _count?: boolean | UploadedFileCountOutputTypeDefaultArgs<ExtArgs> + } + export type UploadedFileIncludeCreateManyAndReturn<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + uploadedByAdminUser?: boolean | UploadedFile$uploadedByAdminUserArgs<ExtArgs> + } + + export type $UploadedFilePayload<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + name: "UploadedFile" + objects: { + uploadedByAdminUser: Prisma.$AdminUserPayload<ExtArgs> | null + customerAvatars: Prisma.$CustomerPayload<ExtArgs>[] + } + scalars: $Extensions.GetPayloadResult<{ + id: string + /** + * Public URL the stored file is served from. + */ + url: string + originalName: string + mimeType: string + sizeBytes: number + /** + * Free-form tag for what the file belongs to, e.g. 'product', 'category', + * 'customer.nationalId'. Kept loose so a new form needs no schema change. + */ + purpose: string | null + uploadedByAdminUserId: string | null + createdAt: Date + }, ExtArgs["result"]["uploadedFile"]> + composites: {} + } + + type UploadedFileGetPayload<S extends boolean | null | undefined | UploadedFileDefaultArgs> = $Result.GetResult<Prisma.$UploadedFilePayload, S> + + type UploadedFileCountArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = + Omit<UploadedFileFindManyArgs, 'select' | 'include' | 'distinct'> & { + select?: UploadedFileCountAggregateInputType | true + } + + export interface UploadedFileDelegate<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> { + [K: symbol]: { types: Prisma.TypeMap<ExtArgs>['model']['UploadedFile'], meta: { name: 'UploadedFile' } } + /** + * Find zero or one UploadedFile that matches the filter. + * @param {UploadedFileFindUniqueArgs} args - Arguments to find a UploadedFile + * @example + * // Get one UploadedFile + * const uploadedFile = await prisma.uploadedFile.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique<T extends UploadedFileFindUniqueArgs>(args: SelectSubset<T, UploadedFileFindUniqueArgs<ExtArgs>>): Prisma__UploadedFileClient<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "findUnique"> | null, null, ExtArgs> + + /** + * Find one UploadedFile that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UploadedFileFindUniqueOrThrowArgs} args - Arguments to find a UploadedFile + * @example + * // Get one UploadedFile + * const uploadedFile = await prisma.uploadedFile.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow<T extends UploadedFileFindUniqueOrThrowArgs>(args: SelectSubset<T, UploadedFileFindUniqueOrThrowArgs<ExtArgs>>): Prisma__UploadedFileClient<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "findUniqueOrThrow">, never, ExtArgs> + + /** + * Find the first UploadedFile 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 {UploadedFileFindFirstArgs} args - Arguments to find a UploadedFile + * @example + * // Get one UploadedFile + * const uploadedFile = await prisma.uploadedFile.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst<T extends UploadedFileFindFirstArgs>(args?: SelectSubset<T, UploadedFileFindFirstArgs<ExtArgs>>): Prisma__UploadedFileClient<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "findFirst"> | null, null, ExtArgs> + + /** + * Find the first UploadedFile 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 {UploadedFileFindFirstOrThrowArgs} args - Arguments to find a UploadedFile + * @example + * // Get one UploadedFile + * const uploadedFile = await prisma.uploadedFile.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow<T extends UploadedFileFindFirstOrThrowArgs>(args?: SelectSubset<T, UploadedFileFindFirstOrThrowArgs<ExtArgs>>): Prisma__UploadedFileClient<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "findFirstOrThrow">, never, ExtArgs> + + /** + * Find zero or more UploadedFiles 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 {UploadedFileFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all UploadedFiles + * const uploadedFiles = await prisma.uploadedFile.findMany() + * + * // Get first 10 UploadedFiles + * const uploadedFiles = await prisma.uploadedFile.findMany({ take: 10 }) + * + * // Only select the `id` + * const uploadedFileWithIdOnly = await prisma.uploadedFile.findMany({ select: { id: true } }) + * + */ + findMany<T extends UploadedFileFindManyArgs>(args?: SelectSubset<T, UploadedFileFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "findMany">> + + /** + * Create a UploadedFile. + * @param {UploadedFileCreateArgs} args - Arguments to create a UploadedFile. + * @example + * // Create one UploadedFile + * const UploadedFile = await prisma.uploadedFile.create({ + * data: { + * // ... data to create a UploadedFile + * } + * }) + * + */ + create<T extends UploadedFileCreateArgs>(args: SelectSubset<T, UploadedFileCreateArgs<ExtArgs>>): Prisma__UploadedFileClient<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "create">, never, ExtArgs> + + /** + * Create many UploadedFiles. + * @param {UploadedFileCreateManyArgs} args - Arguments to create many UploadedFiles. + * @example + * // Create many UploadedFiles + * const uploadedFile = await prisma.uploadedFile.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany<T extends UploadedFileCreateManyArgs>(args?: SelectSubset<T, UploadedFileCreateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create many UploadedFiles and returns the data saved in the database. + * @param {UploadedFileCreateManyAndReturnArgs} args - Arguments to create many UploadedFiles. + * @example + * // Create many UploadedFiles + * const uploadedFile = await prisma.uploadedFile.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many UploadedFiles and only return the `id` + * const uploadedFileWithIdOnly = await prisma.uploadedFile.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn<T extends UploadedFileCreateManyAndReturnArgs>(args?: SelectSubset<T, UploadedFileCreateManyAndReturnArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "createManyAndReturn">> + + /** + * Delete a UploadedFile. + * @param {UploadedFileDeleteArgs} args - Arguments to delete one UploadedFile. + * @example + * // Delete one UploadedFile + * const UploadedFile = await prisma.uploadedFile.delete({ + * where: { + * // ... filter to delete one UploadedFile + * } + * }) + * + */ + delete<T extends UploadedFileDeleteArgs>(args: SelectSubset<T, UploadedFileDeleteArgs<ExtArgs>>): Prisma__UploadedFileClient<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "delete">, never, ExtArgs> + + /** + * Update one UploadedFile. + * @param {UploadedFileUpdateArgs} args - Arguments to update one UploadedFile. + * @example + * // Update one UploadedFile + * const uploadedFile = await prisma.uploadedFile.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update<T extends UploadedFileUpdateArgs>(args: SelectSubset<T, UploadedFileUpdateArgs<ExtArgs>>): Prisma__UploadedFileClient<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "update">, never, ExtArgs> + + /** + * Delete zero or more UploadedFiles. + * @param {UploadedFileDeleteManyArgs} args - Arguments to filter UploadedFiles to delete. + * @example + * // Delete a few UploadedFiles + * const { count } = await prisma.uploadedFile.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany<T extends UploadedFileDeleteManyArgs>(args?: SelectSubset<T, UploadedFileDeleteManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Update zero or more UploadedFiles. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UploadedFileUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many UploadedFiles + * const uploadedFile = await prisma.uploadedFile.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany<T extends UploadedFileUpdateManyArgs>(args: SelectSubset<T, UploadedFileUpdateManyArgs<ExtArgs>>): Prisma.PrismaPromise<BatchPayload> + + /** + * Create or update one UploadedFile. + * @param {UploadedFileUpsertArgs} args - Arguments to update or create a UploadedFile. + * @example + * // Update or create a UploadedFile + * const uploadedFile = await prisma.uploadedFile.upsert({ + * create: { + * // ... data to create a UploadedFile + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the UploadedFile we want to update + * } + * }) + */ + upsert<T extends UploadedFileUpsertArgs>(args: SelectSubset<T, UploadedFileUpsertArgs<ExtArgs>>): Prisma__UploadedFileClient<$Result.GetResult<Prisma.$UploadedFilePayload<ExtArgs>, T, "upsert">, never, ExtArgs> + + + /** + * Count the number of UploadedFiles. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UploadedFileCountArgs} args - Arguments to filter UploadedFiles to count. + * @example + * // Count the number of UploadedFiles + * const count = await prisma.uploadedFile.count({ + * where: { + * // ... the filter for the UploadedFiles we want to count + * } + * }) + **/ + count<T extends UploadedFileCountArgs>( + args?: Subset<T, UploadedFileCountArgs>, + ): Prisma.PrismaPromise< + T extends $Utils.Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType<T['select'], UploadedFileCountAggregateOutputType> + : number + > + + /** + * Allows you to perform aggregations operations on a UploadedFile. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UploadedFileAggregateArgs} 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<T extends UploadedFileAggregateArgs>(args: Subset<T, UploadedFileAggregateArgs>): Prisma.PrismaPromise<GetUploadedFileAggregateType<T>> + + /** + * Group by UploadedFile. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UploadedFileGroupByArgs} 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 UploadedFileGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys<T>>, + Extends<'take', Keys<T>> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: UploadedFileGroupByArgs['orderBy'] } + : { orderBy?: UploadedFileGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys<Keys<MaybeTupleToUnion<T['orderBy']>>>, + ByFields extends MaybeTupleToUnion<T['by']>, + ByValid extends Has<ByFields, OrderFields>, + HavingFields extends GetHavingFields<T['having']>, + HavingValid extends Has<ByFields, HavingFields>, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 Keys<T> + ? 'orderBy' extends Keys<T> + ? ByValid extends 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 True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection<T, UploadedFileGroupByArgs, OrderByArg> & InputErrors): {} extends InputErrors ? GetUploadedFileGroupByPayload<T> : Prisma.PrismaPromise<InputErrors> + /** + * Fields of the UploadedFile model + */ + readonly fields: UploadedFileFieldRefs; + } + + /** + * The delegate class that acts as a "Promise-like" for UploadedFile. + * 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__UploadedFileClient<T, Null = never, ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> extends Prisma.PrismaPromise<T> { + readonly [Symbol.toStringTag]: "PrismaPromise" + uploadedByAdminUser<T extends UploadedFile$uploadedByAdminUserArgs<ExtArgs> = {}>(args?: Subset<T, UploadedFile$uploadedByAdminUserArgs<ExtArgs>>): Prisma__AdminUserClient<$Result.GetResult<Prisma.$AdminUserPayload<ExtArgs>, T, "findUniqueOrThrow"> | null, null, ExtArgs> + customerAvatars<T extends UploadedFile$customerAvatarsArgs<ExtArgs> = {}>(args?: Subset<T, UploadedFile$customerAvatarsArgs<ExtArgs>>): Prisma.PrismaPromise<$Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findMany"> | 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<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): $Utils.JsPromise<TResult1 | TResult2> + /** + * 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<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): $Utils.JsPromise<T | TResult> + /** + * 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): $Utils.JsPromise<T> + } + + + + + /** + * Fields of the UploadedFile model + */ + interface UploadedFileFieldRefs { + readonly id: FieldRef<"UploadedFile", 'String'> + readonly url: FieldRef<"UploadedFile", 'String'> + readonly originalName: FieldRef<"UploadedFile", 'String'> + readonly mimeType: FieldRef<"UploadedFile", 'String'> + readonly sizeBytes: FieldRef<"UploadedFile", 'Int'> + readonly purpose: FieldRef<"UploadedFile", 'String'> + readonly uploadedByAdminUserId: FieldRef<"UploadedFile", 'String'> + readonly createdAt: FieldRef<"UploadedFile", 'DateTime'> + } + + + // Custom InputTypes + /** + * UploadedFile findUnique + */ + export type UploadedFileFindUniqueArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + /** + * Filter, which UploadedFile to fetch. + */ + where: UploadedFileWhereUniqueInput + } + + /** + * UploadedFile findUniqueOrThrow + */ + export type UploadedFileFindUniqueOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + /** + * Filter, which UploadedFile to fetch. + */ + where: UploadedFileWhereUniqueInput + } + + /** + * UploadedFile findFirst + */ + export type UploadedFileFindFirstArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + /** + * Filter, which UploadedFile to fetch. + */ + where?: UploadedFileWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UploadedFiles to fetch. + */ + orderBy?: UploadedFileOrderByWithRelationInput | UploadedFileOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for UploadedFiles. + */ + cursor?: UploadedFileWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UploadedFiles 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` UploadedFiles. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of UploadedFiles. + */ + distinct?: UploadedFileScalarFieldEnum | UploadedFileScalarFieldEnum[] + } + + /** + * UploadedFile findFirstOrThrow + */ + export type UploadedFileFindFirstOrThrowArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + /** + * Filter, which UploadedFile to fetch. + */ + where?: UploadedFileWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UploadedFiles to fetch. + */ + orderBy?: UploadedFileOrderByWithRelationInput | UploadedFileOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for UploadedFiles. + */ + cursor?: UploadedFileWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UploadedFiles 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` UploadedFiles. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of UploadedFiles. + */ + distinct?: UploadedFileScalarFieldEnum | UploadedFileScalarFieldEnum[] + } + + /** + * UploadedFile findMany + */ + export type UploadedFileFindManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + /** + * Filter, which UploadedFiles to fetch. + */ + where?: UploadedFileWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of UploadedFiles to fetch. + */ + orderBy?: UploadedFileOrderByWithRelationInput | UploadedFileOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing UploadedFiles. + */ + cursor?: UploadedFileWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` UploadedFiles 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` UploadedFiles. + */ + skip?: number + distinct?: UploadedFileScalarFieldEnum | UploadedFileScalarFieldEnum[] + } + + /** + * UploadedFile create + */ + export type UploadedFileCreateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + /** + * The data needed to create a UploadedFile. + */ + data: XOR<UploadedFileCreateInput, UploadedFileUncheckedCreateInput> + } + + /** + * UploadedFile createMany + */ + export type UploadedFileCreateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to create many UploadedFiles. + */ + data: UploadedFileCreateManyInput | UploadedFileCreateManyInput[] + skipDuplicates?: boolean + } + + /** + * UploadedFile createManyAndReturn + */ + export type UploadedFileCreateManyAndReturnArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelectCreateManyAndReturn<ExtArgs> | null + /** + * The data used to create many UploadedFiles. + */ + data: UploadedFileCreateManyInput | UploadedFileCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileIncludeCreateManyAndReturn<ExtArgs> | null + } + + /** + * UploadedFile update + */ + export type UploadedFileUpdateArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + /** + * The data needed to update a UploadedFile. + */ + data: XOR<UploadedFileUpdateInput, UploadedFileUncheckedUpdateInput> + /** + * Choose, which UploadedFile to update. + */ + where: UploadedFileWhereUniqueInput + } + + /** + * UploadedFile updateMany + */ + export type UploadedFileUpdateManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * The data used to update UploadedFiles. + */ + data: XOR<UploadedFileUpdateManyMutationInput, UploadedFileUncheckedUpdateManyInput> + /** + * Filter which UploadedFiles to update + */ + where?: UploadedFileWhereInput + } + + /** + * UploadedFile upsert + */ + export type UploadedFileUpsertArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + /** + * The filter to search for the UploadedFile to update in case it exists. + */ + where: UploadedFileWhereUniqueInput + /** + * In case the UploadedFile found by the `where` argument doesn't exist, create a new UploadedFile with this data. + */ + create: XOR<UploadedFileCreateInput, UploadedFileUncheckedCreateInput> + /** + * In case the UploadedFile was found with the provided `where` argument, update it with this data. + */ + update: XOR<UploadedFileUpdateInput, UploadedFileUncheckedUpdateInput> + } + + /** + * UploadedFile delete + */ + export type UploadedFileDeleteArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + /** + * Filter which UploadedFile to delete. + */ + where: UploadedFileWhereUniqueInput + } + + /** + * UploadedFile deleteMany + */ + export type UploadedFileDeleteManyArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Filter which UploadedFiles to delete + */ + where?: UploadedFileWhereInput + } + + /** + * UploadedFile.uploadedByAdminUser + */ + export type UploadedFile$uploadedByAdminUserArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the AdminUser + */ + select?: AdminUserSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: AdminUserInclude<ExtArgs> | null + where?: AdminUserWhereInput + } + + /** + * UploadedFile.customerAvatars + */ + export type UploadedFile$customerAvatarsArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the Customer + */ + select?: CustomerSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: CustomerInclude<ExtArgs> | null + where?: CustomerWhereInput + orderBy?: CustomerOrderByWithRelationInput | CustomerOrderByWithRelationInput[] + cursor?: CustomerWhereUniqueInput + take?: number + skip?: number + distinct?: CustomerScalarFieldEnum | CustomerScalarFieldEnum[] + } + + /** + * UploadedFile without action + */ + export type UploadedFileDefaultArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = { + /** + * Select specific fields to fetch from the UploadedFile + */ + select?: UploadedFileSelect<ExtArgs> | null + /** + * Choose, which related nodes to fetch as well + */ + include?: UploadedFileInclude<ExtArgs> | null + } + + /** * Enums */ @@ -24653,7 +40944,9 @@ export namespace Prisma { export const CityScalarFieldEnum: { id: 'id', name: 'name', - province: 'province' + province: 'province', + percent: 'percent', + percentAux: 'percentAux' }; export type CityScalarFieldEnum = (typeof CityScalarFieldEnum)[keyof typeof CityScalarFieldEnum] @@ -24665,6 +40958,7 @@ export namespace Prisma { mobile: 'mobile', passwordHash: 'passwordHash', role: 'role', + userTypeId: 'userTypeId', branchId: 'branchId', wagePercent: 'wagePercent', isActive: 'isActive', @@ -24681,6 +40975,13 @@ export namespace Prisma { nationalCode: 'nationalCode', passwordHash: 'passwordHash', cityId: 'cityId', + kind: 'kind', + phone: 'phone', + address: 'address', + storeName: 'storeName', + pasazhName: 'pasazhName', + zone: 'zone', + memberCode: 'memberCode', referredByAgentId: 'referredByAgentId', goldCreditLimitGrams: 'goldCreditLimitGrams', goldDebtGrams: 'goldDebtGrams', @@ -24689,7 +40990,10 @@ export namespace Prisma { nationalIdImageUrl: 'nationalIdImageUrl', businessLicenseUrl: 'businessLicenseUrl', shopImageUrl: 'shopImageUrl', + avatarFileId: 'avatarFileId', + canPlaceOrders: 'canPlaceOrders', isActive: 'isActive', + isArchived: 'isArchived', createdAt: 'createdAt', updatedAt: 'updatedAt' }; @@ -24711,6 +41015,9 @@ export namespace Prisma { export const BranchScalarFieldEnum: { id: 'id', name: 'name', + address: 'address', + phone: 'phone', + isActive: 'isActive', cityId: 'cityId' }; @@ -24720,6 +41027,9 @@ export namespace Prisma { export const WorkshopScalarFieldEnum: { id: 'id', name: 'name', + address: 'address', + phone: 'phone', + supervisorId: 'supervisorId', isActive: 'isActive' }; @@ -24729,6 +41039,11 @@ export namespace Prisma { export const CategoryScalarFieldEnum: { id: 'id', title: 'title', + type: 'type', + imageUrl: 'imageUrl', + iconUrl: 'iconUrl', + metaTag: 'metaTag', + description: 'description', parentId: 'parentId' }; @@ -24767,6 +41082,8 @@ export namespace Prisma { description: 'description', categoryId: 'categoryId', brandId: 'brandId', + productCode: 'productCode', + showType: 'showType', isActive: 'isActive', createdAt: 'createdAt' }; @@ -24791,6 +41108,8 @@ export namespace Prisma { sku: 'sku', rashWeightGrams: 'rashWeightGrams', defaultWagePercent: 'defaultWagePercent', + qty: 'qty', + isPreOrder: 'isPreOrder', isActive: 'isActive' }; @@ -24802,6 +41121,7 @@ export namespace Prisma { orderNumber: 'orderNumber', customerId: 'customerId', branchId: 'branchId', + channel: 'channel', status: 'status', totalGoldWeightGrams: 'totalGoldWeightGrams', wageWeightGrams: 'wageWeightGrams', @@ -24890,6 +41210,14 @@ export namespace Prisma { confirmed: 'confirmed', confirmedAt: 'confirmedAt', postedByAdminUserId: 'postedByAdminUserId', + labName: 'labName', + hallmark: 'hallmark', + accountName: 'accountName', + bankName: 'bankName', + transferTo: 'transferTo', + originalValue: 'originalValue', + priceRial: 'priceRial', + receivedAt: 'receivedAt', note: 'note', createdAt: 'createdAt' }; @@ -24922,6 +41250,170 @@ export namespace Prisma { export type WalletBonusScalarFieldEnum = (typeof WalletBonusScalarFieldEnum)[keyof typeof WalletBonusScalarFieldEnum] + export const UserTypeScalarFieldEnum: { + id: 'id', + title: 'title', + isActive: 'isActive', + createdAt: 'createdAt' + }; + + export type UserTypeScalarFieldEnum = (typeof UserTypeScalarFieldEnum)[keyof typeof UserTypeScalarFieldEnum] + + + export const PermissionScalarFieldEnum: { + rid: 'rid', + userTypeId: 'userTypeId' + }; + + export type PermissionScalarFieldEnum = (typeof PermissionScalarFieldEnum)[keyof typeof PermissionScalarFieldEnum] + + + export const CommentScalarFieldEnum: { + id: 'id', + productId: 'productId', + customerId: 'customerId', + body: 'body', + status: 'status', + replyToId: 'replyToId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' + }; + + export type CommentScalarFieldEnum = (typeof CommentScalarFieldEnum)[keyof typeof CommentScalarFieldEnum] + + + export const SettingScalarFieldEnum: { + key: 'key', + value: 'value', + updatedAt: 'updatedAt' + }; + + export type SettingScalarFieldEnum = (typeof SettingScalarFieldEnum)[keyof typeof SettingScalarFieldEnum] + + + export const PromotionScalarFieldEnum: { + id: 'id', + title: 'title', + description: 'description', + scope: 'scope', + usage: 'usage', + discountPercent: 'discountPercent', + isActive: 'isActive', + platform: 'platform', + startsAt: 'startsAt', + endsAt: 'endsAt', + productId: 'productId', + categoryId: 'categoryId', + customerId: 'customerId', + brandId: 'brandId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' + }; + + export type PromotionScalarFieldEnum = (typeof PromotionScalarFieldEnum)[keyof typeof PromotionScalarFieldEnum] + + + export const PromotionExclusionScalarFieldEnum: { + id: 'id', + type: 'type', + itemId: 'itemId', + createdAt: 'createdAt' + }; + + export type PromotionExclusionScalarFieldEnum = (typeof PromotionExclusionScalarFieldEnum)[keyof typeof PromotionExclusionScalarFieldEnum] + + + export const BranchAllocationScalarFieldEnum: { + id: 'id', + branchId: 'branchId', + allocatorAdminUserId: 'allocatorAdminUserId', + note: 'note', + createdAt: 'createdAt' + }; + + export type BranchAllocationScalarFieldEnum = (typeof BranchAllocationScalarFieldEnum)[keyof typeof BranchAllocationScalarFieldEnum] + + + export const BranchAllocationItemScalarFieldEnum: { + id: 'id', + allocationId: 'allocationId', + productId: 'productId', + weightGrams: 'weightGrams' + }; + + export type BranchAllocationItemScalarFieldEnum = (typeof BranchAllocationItemScalarFieldEnum)[keyof typeof BranchAllocationItemScalarFieldEnum] + + + export const SmsMessageScalarFieldEnum: { + id: 'id', + audience: 'audience', + recipients: 'recipients', + body: 'body', + sentCount: 'sentCount', + sentByAdminUserId: 'sentByAdminUserId', + createdAt: 'createdAt' + }; + + export type SmsMessageScalarFieldEnum = (typeof SmsMessageScalarFieldEnum)[keyof typeof SmsMessageScalarFieldEnum] + + + export const NotificationScalarFieldEnum: { + id: 'id', + title: 'title', + body: 'body', + audience: 'audience', + sentByAdminUserId: 'sentByAdminUserId', + createdAt: 'createdAt' + }; + + export type NotificationScalarFieldEnum = (typeof NotificationScalarFieldEnum)[keyof typeof NotificationScalarFieldEnum] + + + export const NotificationRecipientScalarFieldEnum: { + id: 'id', + notificationId: 'notificationId', + customerId: 'customerId', + readAt: 'readAt' + }; + + export type NotificationRecipientScalarFieldEnum = (typeof NotificationRecipientScalarFieldEnum)[keyof typeof NotificationRecipientScalarFieldEnum] + + + export const NewsletterSubscriberScalarFieldEnum: { + id: 'id', + email: 'email', + mobile: 'mobile', + createdAt: 'createdAt' + }; + + export type NewsletterSubscriberScalarFieldEnum = (typeof NewsletterSubscriberScalarFieldEnum)[keyof typeof NewsletterSubscriberScalarFieldEnum] + + + export const CustomerActivityLogScalarFieldEnum: { + id: 'id', + customerId: 'customerId', + action: 'action', + detail: 'detail', + createdAt: 'createdAt' + }; + + export type CustomerActivityLogScalarFieldEnum = (typeof CustomerActivityLogScalarFieldEnum)[keyof typeof CustomerActivityLogScalarFieldEnum] + + + export const UploadedFileScalarFieldEnum: { + id: 'id', + url: 'url', + originalName: 'originalName', + mimeType: 'mimeType', + sizeBytes: 'sizeBytes', + purpose: 'purpose', + uploadedByAdminUserId: 'uploadedByAdminUserId', + createdAt: 'createdAt' + }; + + export type UploadedFileScalarFieldEnum = (typeof UploadedFileScalarFieldEnum)[keyof typeof UploadedFileScalarFieldEnum] + + export const SortOrder: { asc: 'asc', desc: 'desc' @@ -24981,6 +41473,20 @@ export namespace Prisma { + /** + * Reference to a field of type 'Decimal' + */ + export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Decimal'> + + + + /** + * Reference to a field of type 'Decimal[]' + */ + export type ListDecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Decimal[]'> + + + /** * Reference to a field of type 'AdminRole' */ @@ -24996,16 +41502,16 @@ export namespace Prisma { /** - * Reference to a field of type 'Decimal' + * Reference to a field of type 'Int' */ - export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Decimal'> + export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> /** - * Reference to a field of type 'Decimal[]' + * Reference to a field of type 'Int[]' */ - export type ListDecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Decimal[]'> + export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> @@ -25030,6 +41536,20 @@ export namespace Prisma { + /** + * Reference to a field of type 'CustomerKind' + */ + export type EnumCustomerKindFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CustomerKind'> + + + + /** + * Reference to a field of type 'CustomerKind[]' + */ + export type ListEnumCustomerKindFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CustomerKind[]'> + + + /** * Reference to a field of type 'VerificationStep' */ @@ -25045,16 +41565,16 @@ export namespace Prisma { /** - * Reference to a field of type 'Int' + * Reference to a field of type 'OrderChannel' */ - export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> + export type EnumOrderChannelFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'OrderChannel'> /** - * Reference to a field of type 'Int[]' + * Reference to a field of type 'OrderChannel[]' */ - export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> + export type ListEnumOrderChannelFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'OrderChannel[]'> @@ -25135,6 +41655,62 @@ export namespace Prisma { + /** + * Reference to a field of type 'CommentStatus' + */ + export type EnumCommentStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CommentStatus'> + + + + /** + * Reference to a field of type 'CommentStatus[]' + */ + export type ListEnumCommentStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'CommentStatus[]'> + + + + /** + * Reference to a field of type 'PromotionScope' + */ + export type EnumPromotionScopeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'PromotionScope'> + + + + /** + * Reference to a field of type 'PromotionScope[]' + */ + export type ListEnumPromotionScopeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'PromotionScope[]'> + + + + /** + * Reference to a field of type 'PromotionUsage' + */ + export type EnumPromotionUsageFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'PromotionUsage'> + + + + /** + * Reference to a field of type 'PromotionUsage[]' + */ + export type ListEnumPromotionUsageFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'PromotionUsage[]'> + + + + /** + * Reference to a field of type 'MessageAudience' + */ + export type EnumMessageAudienceFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'MessageAudience'> + + + + /** + * Reference to a field of type 'MessageAudience[]' + */ + export type ListEnumMessageAudienceFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'MessageAudience[]'> + + + /** * Reference to a field of type 'Float' */ @@ -25159,6 +41735,8 @@ export namespace Prisma { id?: StringFilter<"City"> | string name?: StringFilter<"City"> | string province?: StringNullableFilter<"City"> | string | null + percent?: DecimalNullableFilter<"City"> | Decimal | DecimalJsLike | number | string | null + percentAux?: DecimalNullableFilter<"City"> | Decimal | DecimalJsLike | number | string | null customers?: CustomerListRelationFilter addresses?: CustomerAddressListRelationFilter branches?: BranchListRelationFilter @@ -25169,6 +41747,8 @@ export namespace Prisma { id?: SortOrder name?: SortOrder province?: SortOrderInput | SortOrder + percent?: SortOrderInput | SortOrder + percentAux?: SortOrderInput | SortOrder customers?: CustomerOrderByRelationAggregateInput addresses?: CustomerAddressOrderByRelationAggregateInput branches?: BranchOrderByRelationAggregateInput @@ -25182,6 +41762,8 @@ export namespace Prisma { NOT?: CityWhereInput | CityWhereInput[] name?: StringFilter<"City"> | string province?: StringNullableFilter<"City"> | string | null + percent?: DecimalNullableFilter<"City"> | Decimal | DecimalJsLike | number | string | null + percentAux?: DecimalNullableFilter<"City"> | Decimal | DecimalJsLike | number | string | null customers?: CustomerListRelationFilter addresses?: CustomerAddressListRelationFilter branches?: BranchListRelationFilter @@ -25192,9 +41774,13 @@ export namespace Prisma { id?: SortOrder name?: SortOrder province?: SortOrderInput | SortOrder + percent?: SortOrderInput | SortOrder + percentAux?: SortOrderInput | SortOrder _count?: CityCountOrderByAggregateInput + _avg?: CityAvgOrderByAggregateInput _max?: CityMaxOrderByAggregateInput _min?: CityMinOrderByAggregateInput + _sum?: CitySumOrderByAggregateInput } export type CityScalarWhereWithAggregatesInput = { @@ -25204,6 +41790,8 @@ export namespace Prisma { id?: StringWithAggregatesFilter<"City"> | string name?: StringWithAggregatesFilter<"City"> | string province?: StringNullableWithAggregatesFilter<"City"> | string | null + percent?: DecimalNullableWithAggregatesFilter<"City"> | Decimal | DecimalJsLike | number | string | null + percentAux?: DecimalNullableWithAggregatesFilter<"City"> | Decimal | DecimalJsLike | number | string | null } export type AdminUserWhereInput = { @@ -25215,15 +41803,22 @@ export namespace Prisma { mobile?: StringFilter<"AdminUser"> | string passwordHash?: StringFilter<"AdminUser"> | string role?: EnumAdminRoleFilter<"AdminUser"> | $Enums.AdminRole + userTypeId?: IntNullableFilter<"AdminUser"> | number | null branchId?: StringNullableFilter<"AdminUser"> | string | null wagePercent?: DecimalNullableFilter<"AdminUser"> | Decimal | DecimalJsLike | number | string | null isActive?: BoolFilter<"AdminUser"> | boolean createdAt?: DateTimeFilter<"AdminUser"> | Date | string + userType?: XOR<UserTypeNullableRelationFilter, UserTypeWhereInput> | null branch?: XOR<BranchNullableRelationFilter, BranchWhereInput> | null referredCustomers?: CustomerListRelationFilter + supervisedWorkshops?: WorkshopListRelationFilter + branchAllocations?: BranchAllocationListRelationFilter postedLedgerEntries?: LedgerEntryListRelationFilter orderStatusEvents?: OrderStatusEventListRelationFilter preOrderStatusEvents?: PreOrderStatusEventListRelationFilter + sentSmsMessages?: SmsMessageListRelationFilter + sentNotifications?: NotificationListRelationFilter + uploadedFiles?: UploadedFileListRelationFilter } export type AdminUserOrderByWithRelationInput = { @@ -25232,15 +41827,22 @@ export namespace Prisma { mobile?: SortOrder passwordHash?: SortOrder role?: SortOrder + userTypeId?: SortOrderInput | SortOrder branchId?: SortOrderInput | SortOrder wagePercent?: SortOrderInput | SortOrder isActive?: SortOrder createdAt?: SortOrder + userType?: UserTypeOrderByWithRelationInput branch?: BranchOrderByWithRelationInput referredCustomers?: CustomerOrderByRelationAggregateInput + supervisedWorkshops?: WorkshopOrderByRelationAggregateInput + branchAllocations?: BranchAllocationOrderByRelationAggregateInput postedLedgerEntries?: LedgerEntryOrderByRelationAggregateInput orderStatusEvents?: OrderStatusEventOrderByRelationAggregateInput preOrderStatusEvents?: PreOrderStatusEventOrderByRelationAggregateInput + sentSmsMessages?: SmsMessageOrderByRelationAggregateInput + sentNotifications?: NotificationOrderByRelationAggregateInput + uploadedFiles?: UploadedFileOrderByRelationAggregateInput } export type AdminUserWhereUniqueInput = Prisma.AtLeast<{ @@ -25252,15 +41854,22 @@ export namespace Prisma { fullName?: StringFilter<"AdminUser"> | string passwordHash?: StringFilter<"AdminUser"> | string role?: EnumAdminRoleFilter<"AdminUser"> | $Enums.AdminRole + userTypeId?: IntNullableFilter<"AdminUser"> | number | null branchId?: StringNullableFilter<"AdminUser"> | string | null wagePercent?: DecimalNullableFilter<"AdminUser"> | Decimal | DecimalJsLike | number | string | null isActive?: BoolFilter<"AdminUser"> | boolean createdAt?: DateTimeFilter<"AdminUser"> | Date | string + userType?: XOR<UserTypeNullableRelationFilter, UserTypeWhereInput> | null branch?: XOR<BranchNullableRelationFilter, BranchWhereInput> | null referredCustomers?: CustomerListRelationFilter + supervisedWorkshops?: WorkshopListRelationFilter + branchAllocations?: BranchAllocationListRelationFilter postedLedgerEntries?: LedgerEntryListRelationFilter orderStatusEvents?: OrderStatusEventListRelationFilter preOrderStatusEvents?: PreOrderStatusEventListRelationFilter + sentSmsMessages?: SmsMessageListRelationFilter + sentNotifications?: NotificationListRelationFilter + uploadedFiles?: UploadedFileListRelationFilter }, "id" | "mobile"> export type AdminUserOrderByWithAggregationInput = { @@ -25269,6 +41878,7 @@ export namespace Prisma { mobile?: SortOrder passwordHash?: SortOrder role?: SortOrder + userTypeId?: SortOrderInput | SortOrder branchId?: SortOrderInput | SortOrder wagePercent?: SortOrderInput | SortOrder isActive?: SortOrder @@ -25289,6 +41899,7 @@ export namespace Prisma { mobile?: StringWithAggregatesFilter<"AdminUser"> | string passwordHash?: StringWithAggregatesFilter<"AdminUser"> | string role?: EnumAdminRoleWithAggregatesFilter<"AdminUser"> | $Enums.AdminRole + userTypeId?: IntNullableWithAggregatesFilter<"AdminUser"> | number | null branchId?: StringNullableWithAggregatesFilter<"AdminUser"> | string | null wagePercent?: DecimalNullableWithAggregatesFilter<"AdminUser"> | Decimal | DecimalJsLike | number | string | null isActive?: BoolWithAggregatesFilter<"AdminUser"> | boolean @@ -25305,6 +41916,13 @@ export namespace Prisma { nationalCode?: StringFilter<"Customer"> | string passwordHash?: StringFilter<"Customer"> | string cityId?: StringNullableFilter<"Customer"> | string | null + kind?: EnumCustomerKindFilter<"Customer"> | $Enums.CustomerKind + phone?: StringNullableFilter<"Customer"> | string | null + address?: StringNullableFilter<"Customer"> | string | null + storeName?: StringNullableFilter<"Customer"> | string | null + pasazhName?: StringNullableFilter<"Customer"> | string | null + zone?: StringNullableFilter<"Customer"> | string | null + memberCode?: StringNullableFilter<"Customer"> | string | null referredByAgentId?: StringNullableFilter<"Customer"> | string | null goldCreditLimitGrams?: DecimalFilter<"Customer"> | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFilter<"Customer"> | Decimal | DecimalJsLike | number | string @@ -25313,16 +41931,24 @@ export namespace Prisma { nationalIdImageUrl?: StringNullableFilter<"Customer"> | string | null businessLicenseUrl?: StringNullableFilter<"Customer"> | string | null shopImageUrl?: StringNullableFilter<"Customer"> | string | null + avatarFileId?: StringNullableFilter<"Customer"> | string | null + canPlaceOrders?: BoolFilter<"Customer"> | boolean isActive?: BoolFilter<"Customer"> | boolean + isArchived?: BoolFilter<"Customer"> | boolean createdAt?: DateTimeFilter<"Customer"> | Date | string updatedAt?: DateTimeFilter<"Customer"> | Date | string city?: XOR<CityNullableRelationFilter, CityWhereInput> | null referredByAgent?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null + avatarFile?: XOR<UploadedFileNullableRelationFilter, UploadedFileWhereInput> | null addresses?: CustomerAddressListRelationFilter orders?: OrderListRelationFilter preOrders?: PreOrderListRelationFilter ledgerEntries?: LedgerEntryListRelationFilter walletBonuses?: WalletBonusListRelationFilter + comments?: CommentListRelationFilter + promotions?: PromotionListRelationFilter + notifications?: NotificationRecipientListRelationFilter + activityLogs?: CustomerActivityLogListRelationFilter } export type CustomerOrderByWithRelationInput = { @@ -25332,6 +41958,13 @@ export namespace Prisma { nationalCode?: SortOrder passwordHash?: SortOrder cityId?: SortOrderInput | SortOrder + kind?: SortOrder + phone?: SortOrderInput | SortOrder + address?: SortOrderInput | SortOrder + storeName?: SortOrderInput | SortOrder + pasazhName?: SortOrderInput | SortOrder + zone?: SortOrderInput | SortOrder + memberCode?: SortOrderInput | SortOrder referredByAgentId?: SortOrderInput | SortOrder goldCreditLimitGrams?: SortOrder goldDebtGrams?: SortOrder @@ -25340,16 +41973,24 @@ export namespace Prisma { nationalIdImageUrl?: SortOrderInput | SortOrder businessLicenseUrl?: SortOrderInput | SortOrder shopImageUrl?: SortOrderInput | SortOrder + avatarFileId?: SortOrderInput | SortOrder + canPlaceOrders?: SortOrder isActive?: SortOrder + isArchived?: SortOrder createdAt?: SortOrder updatedAt?: SortOrder city?: CityOrderByWithRelationInput referredByAgent?: AdminUserOrderByWithRelationInput + avatarFile?: UploadedFileOrderByWithRelationInput addresses?: CustomerAddressOrderByRelationAggregateInput orders?: OrderOrderByRelationAggregateInput preOrders?: PreOrderOrderByRelationAggregateInput ledgerEntries?: LedgerEntryOrderByRelationAggregateInput walletBonuses?: WalletBonusOrderByRelationAggregateInput + comments?: CommentOrderByRelationAggregateInput + promotions?: PromotionOrderByRelationAggregateInput + notifications?: NotificationRecipientOrderByRelationAggregateInput + activityLogs?: CustomerActivityLogOrderByRelationAggregateInput } export type CustomerWhereUniqueInput = Prisma.AtLeast<{ @@ -25362,6 +42003,13 @@ export namespace Prisma { fullName?: StringFilter<"Customer"> | string passwordHash?: StringFilter<"Customer"> | string cityId?: StringNullableFilter<"Customer"> | string | null + kind?: EnumCustomerKindFilter<"Customer"> | $Enums.CustomerKind + phone?: StringNullableFilter<"Customer"> | string | null + address?: StringNullableFilter<"Customer"> | string | null + storeName?: StringNullableFilter<"Customer"> | string | null + pasazhName?: StringNullableFilter<"Customer"> | string | null + zone?: StringNullableFilter<"Customer"> | string | null + memberCode?: StringNullableFilter<"Customer"> | string | null referredByAgentId?: StringNullableFilter<"Customer"> | string | null goldCreditLimitGrams?: DecimalFilter<"Customer"> | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFilter<"Customer"> | Decimal | DecimalJsLike | number | string @@ -25370,16 +42018,24 @@ export namespace Prisma { nationalIdImageUrl?: StringNullableFilter<"Customer"> | string | null businessLicenseUrl?: StringNullableFilter<"Customer"> | string | null shopImageUrl?: StringNullableFilter<"Customer"> | string | null + avatarFileId?: StringNullableFilter<"Customer"> | string | null + canPlaceOrders?: BoolFilter<"Customer"> | boolean isActive?: BoolFilter<"Customer"> | boolean + isArchived?: BoolFilter<"Customer"> | boolean createdAt?: DateTimeFilter<"Customer"> | Date | string updatedAt?: DateTimeFilter<"Customer"> | Date | string city?: XOR<CityNullableRelationFilter, CityWhereInput> | null referredByAgent?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null + avatarFile?: XOR<UploadedFileNullableRelationFilter, UploadedFileWhereInput> | null addresses?: CustomerAddressListRelationFilter orders?: OrderListRelationFilter preOrders?: PreOrderListRelationFilter ledgerEntries?: LedgerEntryListRelationFilter walletBonuses?: WalletBonusListRelationFilter + comments?: CommentListRelationFilter + promotions?: PromotionListRelationFilter + notifications?: NotificationRecipientListRelationFilter + activityLogs?: CustomerActivityLogListRelationFilter }, "id" | "mobile" | "nationalCode"> export type CustomerOrderByWithAggregationInput = { @@ -25389,6 +42045,13 @@ export namespace Prisma { nationalCode?: SortOrder passwordHash?: SortOrder cityId?: SortOrderInput | SortOrder + kind?: SortOrder + phone?: SortOrderInput | SortOrder + address?: SortOrderInput | SortOrder + storeName?: SortOrderInput | SortOrder + pasazhName?: SortOrderInput | SortOrder + zone?: SortOrderInput | SortOrder + memberCode?: SortOrderInput | SortOrder referredByAgentId?: SortOrderInput | SortOrder goldCreditLimitGrams?: SortOrder goldDebtGrams?: SortOrder @@ -25397,7 +42060,10 @@ export namespace Prisma { nationalIdImageUrl?: SortOrderInput | SortOrder businessLicenseUrl?: SortOrderInput | SortOrder shopImageUrl?: SortOrderInput | SortOrder + avatarFileId?: SortOrderInput | SortOrder + canPlaceOrders?: SortOrder isActive?: SortOrder + isArchived?: SortOrder createdAt?: SortOrder updatedAt?: SortOrder _count?: CustomerCountOrderByAggregateInput @@ -25417,6 +42083,13 @@ export namespace Prisma { nationalCode?: StringWithAggregatesFilter<"Customer"> | string passwordHash?: StringWithAggregatesFilter<"Customer"> | string cityId?: StringNullableWithAggregatesFilter<"Customer"> | string | null + kind?: EnumCustomerKindWithAggregatesFilter<"Customer"> | $Enums.CustomerKind + phone?: StringNullableWithAggregatesFilter<"Customer"> | string | null + address?: StringNullableWithAggregatesFilter<"Customer"> | string | null + storeName?: StringNullableWithAggregatesFilter<"Customer"> | string | null + pasazhName?: StringNullableWithAggregatesFilter<"Customer"> | string | null + zone?: StringNullableWithAggregatesFilter<"Customer"> | string | null + memberCode?: StringNullableWithAggregatesFilter<"Customer"> | string | null referredByAgentId?: StringNullableWithAggregatesFilter<"Customer"> | string | null goldCreditLimitGrams?: DecimalWithAggregatesFilter<"Customer"> | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalWithAggregatesFilter<"Customer"> | Decimal | DecimalJsLike | number | string @@ -25425,7 +42098,10 @@ export namespace Prisma { nationalIdImageUrl?: StringNullableWithAggregatesFilter<"Customer"> | string | null businessLicenseUrl?: StringNullableWithAggregatesFilter<"Customer"> | string | null shopImageUrl?: StringNullableWithAggregatesFilter<"Customer"> | string | null + avatarFileId?: StringNullableWithAggregatesFilter<"Customer"> | string | null + canPlaceOrders?: BoolWithAggregatesFilter<"Customer"> | boolean isActive?: BoolWithAggregatesFilter<"Customer"> | boolean + isArchived?: BoolWithAggregatesFilter<"Customer"> | boolean createdAt?: DateTimeWithAggregatesFilter<"Customer"> | Date | string updatedAt?: DateTimeWithAggregatesFilter<"Customer"> | Date | string } @@ -25494,19 +42170,27 @@ export namespace Prisma { NOT?: BranchWhereInput | BranchWhereInput[] id?: StringFilter<"Branch"> | string name?: StringFilter<"Branch"> | string + address?: StringNullableFilter<"Branch"> | string | null + phone?: StringNullableFilter<"Branch"> | string | null + isActive?: BoolFilter<"Branch"> | boolean cityId?: StringNullableFilter<"Branch"> | string | null city?: XOR<CityNullableRelationFilter, CityWhereInput> | null adminUsers?: AdminUserListRelationFilter orders?: OrderListRelationFilter + allocations?: BranchAllocationListRelationFilter } export type BranchOrderByWithRelationInput = { id?: SortOrder name?: SortOrder + address?: SortOrderInput | SortOrder + phone?: SortOrderInput | SortOrder + isActive?: SortOrder cityId?: SortOrderInput | SortOrder city?: CityOrderByWithRelationInput adminUsers?: AdminUserOrderByRelationAggregateInput orders?: OrderOrderByRelationAggregateInput + allocations?: BranchAllocationOrderByRelationAggregateInput } export type BranchWhereUniqueInput = Prisma.AtLeast<{ @@ -25515,15 +42199,22 @@ export namespace Prisma { OR?: BranchWhereInput[] NOT?: BranchWhereInput | BranchWhereInput[] name?: StringFilter<"Branch"> | string + address?: StringNullableFilter<"Branch"> | string | null + phone?: StringNullableFilter<"Branch"> | string | null + isActive?: BoolFilter<"Branch"> | boolean cityId?: StringNullableFilter<"Branch"> | string | null city?: XOR<CityNullableRelationFilter, CityWhereInput> | null adminUsers?: AdminUserListRelationFilter orders?: OrderListRelationFilter + allocations?: BranchAllocationListRelationFilter }, "id"> export type BranchOrderByWithAggregationInput = { id?: SortOrder name?: SortOrder + address?: SortOrderInput | SortOrder + phone?: SortOrderInput | SortOrder + isActive?: SortOrder cityId?: SortOrderInput | SortOrder _count?: BranchCountOrderByAggregateInput _max?: BranchMaxOrderByAggregateInput @@ -25536,6 +42227,9 @@ export namespace Prisma { NOT?: BranchScalarWhereWithAggregatesInput | BranchScalarWhereWithAggregatesInput[] id?: StringWithAggregatesFilter<"Branch"> | string name?: StringWithAggregatesFilter<"Branch"> | string + address?: StringNullableWithAggregatesFilter<"Branch"> | string | null + phone?: StringNullableWithAggregatesFilter<"Branch"> | string | null + isActive?: BoolWithAggregatesFilter<"Branch"> | boolean cityId?: StringNullableWithAggregatesFilter<"Branch"> | string | null } @@ -25545,14 +42239,22 @@ export namespace Prisma { NOT?: WorkshopWhereInput | WorkshopWhereInput[] id?: StringFilter<"Workshop"> | string name?: StringFilter<"Workshop"> | string + address?: StringNullableFilter<"Workshop"> | string | null + phone?: StringNullableFilter<"Workshop"> | string | null + supervisorId?: StringNullableFilter<"Workshop"> | string | null isActive?: BoolFilter<"Workshop"> | boolean + supervisor?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null preOrders?: PreOrderListRelationFilter } export type WorkshopOrderByWithRelationInput = { id?: SortOrder name?: SortOrder + address?: SortOrderInput | SortOrder + phone?: SortOrderInput | SortOrder + supervisorId?: SortOrderInput | SortOrder isActive?: SortOrder + supervisor?: AdminUserOrderByWithRelationInput preOrders?: PreOrderOrderByRelationAggregateInput } @@ -25562,13 +42264,20 @@ export namespace Prisma { OR?: WorkshopWhereInput[] NOT?: WorkshopWhereInput | WorkshopWhereInput[] name?: StringFilter<"Workshop"> | string + address?: StringNullableFilter<"Workshop"> | string | null + phone?: StringNullableFilter<"Workshop"> | string | null + supervisorId?: StringNullableFilter<"Workshop"> | string | null isActive?: BoolFilter<"Workshop"> | boolean + supervisor?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null preOrders?: PreOrderListRelationFilter }, "id"> export type WorkshopOrderByWithAggregationInput = { id?: SortOrder name?: SortOrder + address?: SortOrderInput | SortOrder + phone?: SortOrderInput | SortOrder + supervisorId?: SortOrderInput | SortOrder isActive?: SortOrder _count?: WorkshopCountOrderByAggregateInput _max?: WorkshopMaxOrderByAggregateInput @@ -25581,6 +42290,9 @@ export namespace Prisma { NOT?: WorkshopScalarWhereWithAggregatesInput | WorkshopScalarWhereWithAggregatesInput[] id?: StringWithAggregatesFilter<"Workshop"> | string name?: StringWithAggregatesFilter<"Workshop"> | string + address?: StringNullableWithAggregatesFilter<"Workshop"> | string | null + phone?: StringNullableWithAggregatesFilter<"Workshop"> | string | null + supervisorId?: StringNullableWithAggregatesFilter<"Workshop"> | string | null isActive?: BoolWithAggregatesFilter<"Workshop"> | boolean } @@ -25590,19 +42302,31 @@ export namespace Prisma { NOT?: CategoryWhereInput | CategoryWhereInput[] id?: StringFilter<"Category"> | string title?: StringFilter<"Category"> | string + type?: IntFilter<"Category"> | number + imageUrl?: StringNullableFilter<"Category"> | string | null + iconUrl?: StringNullableFilter<"Category"> | string | null + metaTag?: StringNullableFilter<"Category"> | string | null + description?: StringNullableFilter<"Category"> | string | null parentId?: StringNullableFilter<"Category"> | string | null parent?: XOR<CategoryNullableRelationFilter, CategoryWhereInput> | null children?: CategoryListRelationFilter products?: ProductListRelationFilter + promotions?: PromotionListRelationFilter } export type CategoryOrderByWithRelationInput = { id?: SortOrder title?: SortOrder + type?: SortOrder + imageUrl?: SortOrderInput | SortOrder + iconUrl?: SortOrderInput | SortOrder + metaTag?: SortOrderInput | SortOrder + description?: SortOrderInput | SortOrder parentId?: SortOrderInput | SortOrder parent?: CategoryOrderByWithRelationInput children?: CategoryOrderByRelationAggregateInput products?: ProductOrderByRelationAggregateInput + promotions?: PromotionOrderByRelationAggregateInput } export type CategoryWhereUniqueInput = Prisma.AtLeast<{ @@ -25611,19 +42335,32 @@ export namespace Prisma { OR?: CategoryWhereInput[] NOT?: CategoryWhereInput | CategoryWhereInput[] title?: StringFilter<"Category"> | string + type?: IntFilter<"Category"> | number + imageUrl?: StringNullableFilter<"Category"> | string | null + iconUrl?: StringNullableFilter<"Category"> | string | null + metaTag?: StringNullableFilter<"Category"> | string | null + description?: StringNullableFilter<"Category"> | string | null parentId?: StringNullableFilter<"Category"> | string | null parent?: XOR<CategoryNullableRelationFilter, CategoryWhereInput> | null children?: CategoryListRelationFilter products?: ProductListRelationFilter + promotions?: PromotionListRelationFilter }, "id"> export type CategoryOrderByWithAggregationInput = { id?: SortOrder title?: SortOrder + type?: SortOrder + imageUrl?: SortOrderInput | SortOrder + iconUrl?: SortOrderInput | SortOrder + metaTag?: SortOrderInput | SortOrder + description?: SortOrderInput | SortOrder parentId?: SortOrderInput | SortOrder _count?: CategoryCountOrderByAggregateInput + _avg?: CategoryAvgOrderByAggregateInput _max?: CategoryMaxOrderByAggregateInput _min?: CategoryMinOrderByAggregateInput + _sum?: CategorySumOrderByAggregateInput } export type CategoryScalarWhereWithAggregatesInput = { @@ -25632,6 +42369,11 @@ export namespace Prisma { NOT?: CategoryScalarWhereWithAggregatesInput | CategoryScalarWhereWithAggregatesInput[] id?: StringWithAggregatesFilter<"Category"> | string title?: StringWithAggregatesFilter<"Category"> | string + type?: IntWithAggregatesFilter<"Category"> | number + imageUrl?: StringNullableWithAggregatesFilter<"Category"> | string | null + iconUrl?: StringNullableWithAggregatesFilter<"Category"> | string | null + metaTag?: StringNullableWithAggregatesFilter<"Category"> | string | null + description?: StringNullableWithAggregatesFilter<"Category"> | string | null parentId?: StringNullableWithAggregatesFilter<"Category"> | string | null } @@ -25642,12 +42384,14 @@ export namespace Prisma { id?: StringFilter<"Brand"> | string title?: StringFilter<"Brand"> | string products?: ProductListRelationFilter + promotions?: PromotionListRelationFilter } export type BrandOrderByWithRelationInput = { id?: SortOrder title?: SortOrder products?: ProductOrderByRelationAggregateInput + promotions?: PromotionOrderByRelationAggregateInput } export type BrandWhereUniqueInput = Prisma.AtLeast<{ @@ -25657,6 +42401,7 @@ export namespace Prisma { NOT?: BrandWhereInput | BrandWhereInput[] title?: StringFilter<"Brand"> | string products?: ProductListRelationFilter + promotions?: PromotionListRelationFilter }, "id"> export type BrandOrderByWithAggregationInput = { @@ -25778,6 +42523,8 @@ export namespace Prisma { description?: StringNullableFilter<"Product"> | string | null categoryId?: StringNullableFilter<"Product"> | string | null brandId?: StringNullableFilter<"Product"> | string | null + productCode?: StringNullableFilter<"Product"> | string | null + showType?: IntFilter<"Product"> | number isActive?: BoolFilter<"Product"> | boolean createdAt?: DateTimeFilter<"Product"> | Date | string category?: XOR<CategoryNullableRelationFilter, CategoryWhereInput> | null @@ -25785,6 +42532,9 @@ export namespace Prisma { variants?: ProductVariantListRelationFilter images?: ProductImageListRelationFilter collections?: CollectionProductListRelationFilter + comments?: CommentListRelationFilter + promotions?: PromotionListRelationFilter + allocationItems?: BranchAllocationItemListRelationFilter } export type ProductOrderByWithRelationInput = { @@ -25793,6 +42543,8 @@ export namespace Prisma { description?: SortOrderInput | SortOrder categoryId?: SortOrderInput | SortOrder brandId?: SortOrderInput | SortOrder + productCode?: SortOrderInput | SortOrder + showType?: SortOrder isActive?: SortOrder createdAt?: SortOrder category?: CategoryOrderByWithRelationInput @@ -25800,10 +42552,14 @@ export namespace Prisma { variants?: ProductVariantOrderByRelationAggregateInput images?: ProductImageOrderByRelationAggregateInput collections?: CollectionProductOrderByRelationAggregateInput + comments?: CommentOrderByRelationAggregateInput + promotions?: PromotionOrderByRelationAggregateInput + allocationItems?: BranchAllocationItemOrderByRelationAggregateInput } export type ProductWhereUniqueInput = Prisma.AtLeast<{ id?: string + productCode?: string AND?: ProductWhereInput | ProductWhereInput[] OR?: ProductWhereInput[] NOT?: ProductWhereInput | ProductWhereInput[] @@ -25811,6 +42567,7 @@ export namespace Prisma { description?: StringNullableFilter<"Product"> | string | null categoryId?: StringNullableFilter<"Product"> | string | null brandId?: StringNullableFilter<"Product"> | string | null + showType?: IntFilter<"Product"> | number isActive?: BoolFilter<"Product"> | boolean createdAt?: DateTimeFilter<"Product"> | Date | string category?: XOR<CategoryNullableRelationFilter, CategoryWhereInput> | null @@ -25818,7 +42575,10 @@ export namespace Prisma { variants?: ProductVariantListRelationFilter images?: ProductImageListRelationFilter collections?: CollectionProductListRelationFilter - }, "id"> + comments?: CommentListRelationFilter + promotions?: PromotionListRelationFilter + allocationItems?: BranchAllocationItemListRelationFilter + }, "id" | "productCode"> export type ProductOrderByWithAggregationInput = { id?: SortOrder @@ -25826,11 +42586,15 @@ export namespace Prisma { description?: SortOrderInput | SortOrder categoryId?: SortOrderInput | SortOrder brandId?: SortOrderInput | SortOrder + productCode?: SortOrderInput | SortOrder + showType?: SortOrder isActive?: SortOrder createdAt?: SortOrder _count?: ProductCountOrderByAggregateInput + _avg?: ProductAvgOrderByAggregateInput _max?: ProductMaxOrderByAggregateInput _min?: ProductMinOrderByAggregateInput + _sum?: ProductSumOrderByAggregateInput } export type ProductScalarWhereWithAggregatesInput = { @@ -25842,6 +42606,8 @@ export namespace Prisma { description?: StringNullableWithAggregatesFilter<"Product"> | string | null categoryId?: StringNullableWithAggregatesFilter<"Product"> | string | null brandId?: StringNullableWithAggregatesFilter<"Product"> | string | null + productCode?: StringNullableWithAggregatesFilter<"Product"> | string | null + showType?: IntWithAggregatesFilter<"Product"> | number isActive?: BoolWithAggregatesFilter<"Product"> | boolean createdAt?: DateTimeWithAggregatesFilter<"Product"> | Date | string } @@ -25908,6 +42674,8 @@ export namespace Prisma { sku?: StringNullableFilter<"ProductVariant"> | string | null rashWeightGrams?: DecimalFilter<"ProductVariant"> | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFilter<"ProductVariant"> | Decimal | DecimalJsLike | number | string + qty?: IntFilter<"ProductVariant"> | number + isPreOrder?: BoolFilter<"ProductVariant"> | boolean isActive?: BoolFilter<"ProductVariant"> | boolean product?: XOR<ProductRelationFilter, ProductWhereInput> orderItems?: OrderItemListRelationFilter @@ -25920,6 +42688,8 @@ export namespace Prisma { sku?: SortOrderInput | SortOrder rashWeightGrams?: SortOrder defaultWagePercent?: SortOrder + qty?: SortOrder + isPreOrder?: SortOrder isActive?: SortOrder product?: ProductOrderByWithRelationInput orderItems?: OrderItemOrderByRelationAggregateInput @@ -25935,6 +42705,8 @@ export namespace Prisma { title?: StringFilter<"ProductVariant"> | string rashWeightGrams?: DecimalFilter<"ProductVariant"> | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFilter<"ProductVariant"> | Decimal | DecimalJsLike | number | string + qty?: IntFilter<"ProductVariant"> | number + isPreOrder?: BoolFilter<"ProductVariant"> | boolean isActive?: BoolFilter<"ProductVariant"> | boolean product?: XOR<ProductRelationFilter, ProductWhereInput> orderItems?: OrderItemListRelationFilter @@ -25947,6 +42719,8 @@ export namespace Prisma { sku?: SortOrderInput | SortOrder rashWeightGrams?: SortOrder defaultWagePercent?: SortOrder + qty?: SortOrder + isPreOrder?: SortOrder isActive?: SortOrder _count?: ProductVariantCountOrderByAggregateInput _avg?: ProductVariantAvgOrderByAggregateInput @@ -25965,6 +42739,8 @@ export namespace Prisma { sku?: StringNullableWithAggregatesFilter<"ProductVariant"> | string | null rashWeightGrams?: DecimalWithAggregatesFilter<"ProductVariant"> | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalWithAggregatesFilter<"ProductVariant"> | Decimal | DecimalJsLike | number | string + qty?: IntWithAggregatesFilter<"ProductVariant"> | number + isPreOrder?: BoolWithAggregatesFilter<"ProductVariant"> | boolean isActive?: BoolWithAggregatesFilter<"ProductVariant"> | boolean } @@ -25976,6 +42752,7 @@ export namespace Prisma { orderNumber?: StringFilter<"Order"> | string customerId?: StringFilter<"Order"> | string branchId?: StringNullableFilter<"Order"> | string | null + channel?: EnumOrderChannelFilter<"Order"> | $Enums.OrderChannel status?: EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFilter<"Order"> | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFilter<"Order"> | Decimal | DecimalJsLike | number | string @@ -25997,6 +42774,7 @@ export namespace Prisma { orderNumber?: SortOrder customerId?: SortOrder branchId?: SortOrderInput | SortOrder + channel?: SortOrder status?: SortOrder totalGoldWeightGrams?: SortOrder wageWeightGrams?: SortOrder @@ -26021,6 +42799,7 @@ export namespace Prisma { NOT?: OrderWhereInput | OrderWhereInput[] customerId?: StringFilter<"Order"> | string branchId?: StringNullableFilter<"Order"> | string | null + channel?: EnumOrderChannelFilter<"Order"> | $Enums.OrderChannel status?: EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFilter<"Order"> | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFilter<"Order"> | Decimal | DecimalJsLike | number | string @@ -26042,6 +42821,7 @@ export namespace Prisma { orderNumber?: SortOrder customerId?: SortOrder branchId?: SortOrderInput | SortOrder + channel?: SortOrder status?: SortOrder totalGoldWeightGrams?: SortOrder wageWeightGrams?: SortOrder @@ -26065,6 +42845,7 @@ export namespace Prisma { orderNumber?: StringWithAggregatesFilter<"Order"> | string customerId?: StringWithAggregatesFilter<"Order"> | string branchId?: StringNullableWithAggregatesFilter<"Order"> | string | null + channel?: EnumOrderChannelWithAggregatesFilter<"Order"> | $Enums.OrderChannel status?: EnumOrderStatusWithAggregatesFilter<"Order"> | $Enums.OrderStatus totalGoldWeightGrams?: DecimalWithAggregatesFilter<"Order"> | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalWithAggregatesFilter<"Order"> | Decimal | DecimalJsLike | number | string @@ -26426,6 +43207,14 @@ export namespace Prisma { confirmed?: BoolFilter<"LedgerEntry"> | boolean confirmedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null postedByAdminUserId?: StringNullableFilter<"LedgerEntry"> | string | null + labName?: StringNullableFilter<"LedgerEntry"> | string | null + hallmark?: StringNullableFilter<"LedgerEntry"> | string | null + accountName?: StringNullableFilter<"LedgerEntry"> | string | null + bankName?: StringNullableFilter<"LedgerEntry"> | string | null + transferTo?: StringNullableFilter<"LedgerEntry"> | string | null + originalValue?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + priceRial?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + receivedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null note?: StringNullableFilter<"LedgerEntry"> | string | null createdAt?: DateTimeFilter<"LedgerEntry"> | Date | string customer?: XOR<CustomerRelationFilter, CustomerWhereInput> @@ -26446,6 +43235,14 @@ export namespace Prisma { confirmed?: SortOrder confirmedAt?: SortOrderInput | SortOrder postedByAdminUserId?: SortOrderInput | SortOrder + labName?: SortOrderInput | SortOrder + hallmark?: SortOrderInput | SortOrder + accountName?: SortOrderInput | SortOrder + bankName?: SortOrderInput | SortOrder + transferTo?: SortOrderInput | SortOrder + originalValue?: SortOrderInput | SortOrder + priceRial?: SortOrderInput | SortOrder + receivedAt?: SortOrderInput | SortOrder note?: SortOrderInput | SortOrder createdAt?: SortOrder customer?: CustomerOrderByWithRelationInput @@ -26469,6 +43266,14 @@ export namespace Prisma { confirmed?: BoolFilter<"LedgerEntry"> | boolean confirmedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null postedByAdminUserId?: StringNullableFilter<"LedgerEntry"> | string | null + labName?: StringNullableFilter<"LedgerEntry"> | string | null + hallmark?: StringNullableFilter<"LedgerEntry"> | string | null + accountName?: StringNullableFilter<"LedgerEntry"> | string | null + bankName?: StringNullableFilter<"LedgerEntry"> | string | null + transferTo?: StringNullableFilter<"LedgerEntry"> | string | null + originalValue?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + priceRial?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + receivedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null note?: StringNullableFilter<"LedgerEntry"> | string | null createdAt?: DateTimeFilter<"LedgerEntry"> | Date | string customer?: XOR<CustomerRelationFilter, CustomerWhereInput> @@ -26489,6 +43294,14 @@ export namespace Prisma { confirmed?: SortOrder confirmedAt?: SortOrderInput | SortOrder postedByAdminUserId?: SortOrderInput | SortOrder + labName?: SortOrderInput | SortOrder + hallmark?: SortOrderInput | SortOrder + accountName?: SortOrderInput | SortOrder + bankName?: SortOrderInput | SortOrder + transferTo?: SortOrderInput | SortOrder + originalValue?: SortOrderInput | SortOrder + priceRial?: SortOrderInput | SortOrder + receivedAt?: SortOrderInput | SortOrder note?: SortOrderInput | SortOrder createdAt?: SortOrder _count?: LedgerEntryCountOrderByAggregateInput @@ -26514,6 +43327,14 @@ export namespace Prisma { confirmed?: BoolWithAggregatesFilter<"LedgerEntry"> | boolean confirmedAt?: DateTimeNullableWithAggregatesFilter<"LedgerEntry"> | Date | string | null postedByAdminUserId?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null + labName?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null + hallmark?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null + accountName?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null + bankName?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null + transferTo?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null + originalValue?: DecimalNullableWithAggregatesFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + priceRial?: DecimalNullableWithAggregatesFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + receivedAt?: DateTimeNullableWithAggregatesFilter<"LedgerEntry"> | Date | string | null note?: StringNullableWithAggregatesFilter<"LedgerEntry"> | string | null createdAt?: DateTimeWithAggregatesFilter<"LedgerEntry"> | Date | string } @@ -26644,10 +43465,880 @@ export namespace Prisma { isActive?: BoolWithAggregatesFilter<"WalletBonus"> | boolean } + export type UserTypeWhereInput = { + AND?: UserTypeWhereInput | UserTypeWhereInput[] + OR?: UserTypeWhereInput[] + NOT?: UserTypeWhereInput | UserTypeWhereInput[] + id?: IntFilter<"UserType"> | number + title?: StringFilter<"UserType"> | string + isActive?: BoolFilter<"UserType"> | boolean + createdAt?: DateTimeFilter<"UserType"> | Date | string + permissions?: PermissionListRelationFilter + adminUsers?: AdminUserListRelationFilter + } + + export type UserTypeOrderByWithRelationInput = { + id?: SortOrder + title?: SortOrder + isActive?: SortOrder + createdAt?: SortOrder + permissions?: PermissionOrderByRelationAggregateInput + adminUsers?: AdminUserOrderByRelationAggregateInput + } + + export type UserTypeWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: UserTypeWhereInput | UserTypeWhereInput[] + OR?: UserTypeWhereInput[] + NOT?: UserTypeWhereInput | UserTypeWhereInput[] + title?: StringFilter<"UserType"> | string + isActive?: BoolFilter<"UserType"> | boolean + createdAt?: DateTimeFilter<"UserType"> | Date | string + permissions?: PermissionListRelationFilter + adminUsers?: AdminUserListRelationFilter + }, "id"> + + export type UserTypeOrderByWithAggregationInput = { + id?: SortOrder + title?: SortOrder + isActive?: SortOrder + createdAt?: SortOrder + _count?: UserTypeCountOrderByAggregateInput + _avg?: UserTypeAvgOrderByAggregateInput + _max?: UserTypeMaxOrderByAggregateInput + _min?: UserTypeMinOrderByAggregateInput + _sum?: UserTypeSumOrderByAggregateInput + } + + export type UserTypeScalarWhereWithAggregatesInput = { + AND?: UserTypeScalarWhereWithAggregatesInput | UserTypeScalarWhereWithAggregatesInput[] + OR?: UserTypeScalarWhereWithAggregatesInput[] + NOT?: UserTypeScalarWhereWithAggregatesInput | UserTypeScalarWhereWithAggregatesInput[] + id?: IntWithAggregatesFilter<"UserType"> | number + title?: StringWithAggregatesFilter<"UserType"> | string + isActive?: BoolWithAggregatesFilter<"UserType"> | boolean + createdAt?: DateTimeWithAggregatesFilter<"UserType"> | Date | string + } + + export type PermissionWhereInput = { + AND?: PermissionWhereInput | PermissionWhereInput[] + OR?: PermissionWhereInput[] + NOT?: PermissionWhereInput | PermissionWhereInput[] + rid?: StringFilter<"Permission"> | string + userTypeId?: IntFilter<"Permission"> | number + userType?: XOR<UserTypeRelationFilter, UserTypeWhereInput> + } + + export type PermissionOrderByWithRelationInput = { + rid?: SortOrder + userTypeId?: SortOrder + userType?: UserTypeOrderByWithRelationInput + } + + export type PermissionWhereUniqueInput = Prisma.AtLeast<{ + rid_userTypeId?: PermissionRidUserTypeIdCompoundUniqueInput + AND?: PermissionWhereInput | PermissionWhereInput[] + OR?: PermissionWhereInput[] + NOT?: PermissionWhereInput | PermissionWhereInput[] + rid?: StringFilter<"Permission"> | string + userTypeId?: IntFilter<"Permission"> | number + userType?: XOR<UserTypeRelationFilter, UserTypeWhereInput> + }, "rid_userTypeId"> + + export type PermissionOrderByWithAggregationInput = { + rid?: SortOrder + userTypeId?: SortOrder + _count?: PermissionCountOrderByAggregateInput + _avg?: PermissionAvgOrderByAggregateInput + _max?: PermissionMaxOrderByAggregateInput + _min?: PermissionMinOrderByAggregateInput + _sum?: PermissionSumOrderByAggregateInput + } + + export type PermissionScalarWhereWithAggregatesInput = { + AND?: PermissionScalarWhereWithAggregatesInput | PermissionScalarWhereWithAggregatesInput[] + OR?: PermissionScalarWhereWithAggregatesInput[] + NOT?: PermissionScalarWhereWithAggregatesInput | PermissionScalarWhereWithAggregatesInput[] + rid?: StringWithAggregatesFilter<"Permission"> | string + userTypeId?: IntWithAggregatesFilter<"Permission"> | number + } + + export type CommentWhereInput = { + AND?: CommentWhereInput | CommentWhereInput[] + OR?: CommentWhereInput[] + NOT?: CommentWhereInput | CommentWhereInput[] + id?: StringFilter<"Comment"> | string + productId?: StringFilter<"Comment"> | string + customerId?: StringFilter<"Comment"> | string + body?: StringFilter<"Comment"> | string + status?: EnumCommentStatusFilter<"Comment"> | $Enums.CommentStatus + replyToId?: StringNullableFilter<"Comment"> | string | null + createdAt?: DateTimeFilter<"Comment"> | Date | string + updatedAt?: DateTimeFilter<"Comment"> | Date | string + product?: XOR<ProductRelationFilter, ProductWhereInput> + customer?: XOR<CustomerRelationFilter, CustomerWhereInput> + replyTo?: XOR<CommentNullableRelationFilter, CommentWhereInput> | null + replies?: CommentListRelationFilter + } + + export type CommentOrderByWithRelationInput = { + id?: SortOrder + productId?: SortOrder + customerId?: SortOrder + body?: SortOrder + status?: SortOrder + replyToId?: SortOrderInput | SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + product?: ProductOrderByWithRelationInput + customer?: CustomerOrderByWithRelationInput + replyTo?: CommentOrderByWithRelationInput + replies?: CommentOrderByRelationAggregateInput + } + + export type CommentWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: CommentWhereInput | CommentWhereInput[] + OR?: CommentWhereInput[] + NOT?: CommentWhereInput | CommentWhereInput[] + productId?: StringFilter<"Comment"> | string + customerId?: StringFilter<"Comment"> | string + body?: StringFilter<"Comment"> | string + status?: EnumCommentStatusFilter<"Comment"> | $Enums.CommentStatus + replyToId?: StringNullableFilter<"Comment"> | string | null + createdAt?: DateTimeFilter<"Comment"> | Date | string + updatedAt?: DateTimeFilter<"Comment"> | Date | string + product?: XOR<ProductRelationFilter, ProductWhereInput> + customer?: XOR<CustomerRelationFilter, CustomerWhereInput> + replyTo?: XOR<CommentNullableRelationFilter, CommentWhereInput> | null + replies?: CommentListRelationFilter + }, "id"> + + export type CommentOrderByWithAggregationInput = { + id?: SortOrder + productId?: SortOrder + customerId?: SortOrder + body?: SortOrder + status?: SortOrder + replyToId?: SortOrderInput | SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + _count?: CommentCountOrderByAggregateInput + _max?: CommentMaxOrderByAggregateInput + _min?: CommentMinOrderByAggregateInput + } + + export type CommentScalarWhereWithAggregatesInput = { + AND?: CommentScalarWhereWithAggregatesInput | CommentScalarWhereWithAggregatesInput[] + OR?: CommentScalarWhereWithAggregatesInput[] + NOT?: CommentScalarWhereWithAggregatesInput | CommentScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Comment"> | string + productId?: StringWithAggregatesFilter<"Comment"> | string + customerId?: StringWithAggregatesFilter<"Comment"> | string + body?: StringWithAggregatesFilter<"Comment"> | string + status?: EnumCommentStatusWithAggregatesFilter<"Comment"> | $Enums.CommentStatus + replyToId?: StringNullableWithAggregatesFilter<"Comment"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"Comment"> | Date | string + updatedAt?: DateTimeWithAggregatesFilter<"Comment"> | Date | string + } + + export type SettingWhereInput = { + AND?: SettingWhereInput | SettingWhereInput[] + OR?: SettingWhereInput[] + NOT?: SettingWhereInput | SettingWhereInput[] + key?: StringFilter<"Setting"> | string + value?: JsonFilter<"Setting"> + updatedAt?: DateTimeFilter<"Setting"> | Date | string + } + + export type SettingOrderByWithRelationInput = { + key?: SortOrder + value?: SortOrder + updatedAt?: SortOrder + } + + export type SettingWhereUniqueInput = Prisma.AtLeast<{ + key?: string + AND?: SettingWhereInput | SettingWhereInput[] + OR?: SettingWhereInput[] + NOT?: SettingWhereInput | SettingWhereInput[] + value?: JsonFilter<"Setting"> + updatedAt?: DateTimeFilter<"Setting"> | Date | string + }, "key"> + + export type SettingOrderByWithAggregationInput = { + key?: SortOrder + value?: SortOrder + updatedAt?: SortOrder + _count?: SettingCountOrderByAggregateInput + _max?: SettingMaxOrderByAggregateInput + _min?: SettingMinOrderByAggregateInput + } + + export type SettingScalarWhereWithAggregatesInput = { + AND?: SettingScalarWhereWithAggregatesInput | SettingScalarWhereWithAggregatesInput[] + OR?: SettingScalarWhereWithAggregatesInput[] + NOT?: SettingScalarWhereWithAggregatesInput | SettingScalarWhereWithAggregatesInput[] + key?: StringWithAggregatesFilter<"Setting"> | string + value?: JsonWithAggregatesFilter<"Setting"> + updatedAt?: DateTimeWithAggregatesFilter<"Setting"> | Date | string + } + + export type PromotionWhereInput = { + AND?: PromotionWhereInput | PromotionWhereInput[] + OR?: PromotionWhereInput[] + NOT?: PromotionWhereInput | PromotionWhereInput[] + id?: StringFilter<"Promotion"> | string + title?: StringFilter<"Promotion"> | string + description?: StringNullableFilter<"Promotion"> | string | null + scope?: EnumPromotionScopeFilter<"Promotion"> | $Enums.PromotionScope + usage?: EnumPromotionUsageFilter<"Promotion"> | $Enums.PromotionUsage + discountPercent?: DecimalFilter<"Promotion"> | Decimal | DecimalJsLike | number | string + isActive?: BoolFilter<"Promotion"> | boolean + platform?: IntFilter<"Promotion"> | number + startsAt?: DateTimeNullableFilter<"Promotion"> | Date | string | null + endsAt?: DateTimeNullableFilter<"Promotion"> | Date | string | null + productId?: StringNullableFilter<"Promotion"> | string | null + categoryId?: StringNullableFilter<"Promotion"> | string | null + customerId?: StringNullableFilter<"Promotion"> | string | null + brandId?: StringNullableFilter<"Promotion"> | string | null + createdAt?: DateTimeFilter<"Promotion"> | Date | string + updatedAt?: DateTimeFilter<"Promotion"> | Date | string + product?: XOR<ProductNullableRelationFilter, ProductWhereInput> | null + category?: XOR<CategoryNullableRelationFilter, CategoryWhereInput> | null + customer?: XOR<CustomerNullableRelationFilter, CustomerWhereInput> | null + brand?: XOR<BrandNullableRelationFilter, BrandWhereInput> | null + } + + export type PromotionOrderByWithRelationInput = { + id?: SortOrder + title?: SortOrder + description?: SortOrderInput | SortOrder + scope?: SortOrder + usage?: SortOrder + discountPercent?: SortOrder + isActive?: SortOrder + platform?: SortOrder + startsAt?: SortOrderInput | SortOrder + endsAt?: SortOrderInput | SortOrder + productId?: SortOrderInput | SortOrder + categoryId?: SortOrderInput | SortOrder + customerId?: SortOrderInput | SortOrder + brandId?: SortOrderInput | SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + product?: ProductOrderByWithRelationInput + category?: CategoryOrderByWithRelationInput + customer?: CustomerOrderByWithRelationInput + brand?: BrandOrderByWithRelationInput + } + + export type PromotionWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: PromotionWhereInput | PromotionWhereInput[] + OR?: PromotionWhereInput[] + NOT?: PromotionWhereInput | PromotionWhereInput[] + title?: StringFilter<"Promotion"> | string + description?: StringNullableFilter<"Promotion"> | string | null + scope?: EnumPromotionScopeFilter<"Promotion"> | $Enums.PromotionScope + usage?: EnumPromotionUsageFilter<"Promotion"> | $Enums.PromotionUsage + discountPercent?: DecimalFilter<"Promotion"> | Decimal | DecimalJsLike | number | string + isActive?: BoolFilter<"Promotion"> | boolean + platform?: IntFilter<"Promotion"> | number + startsAt?: DateTimeNullableFilter<"Promotion"> | Date | string | null + endsAt?: DateTimeNullableFilter<"Promotion"> | Date | string | null + productId?: StringNullableFilter<"Promotion"> | string | null + categoryId?: StringNullableFilter<"Promotion"> | string | null + customerId?: StringNullableFilter<"Promotion"> | string | null + brandId?: StringNullableFilter<"Promotion"> | string | null + createdAt?: DateTimeFilter<"Promotion"> | Date | string + updatedAt?: DateTimeFilter<"Promotion"> | Date | string + product?: XOR<ProductNullableRelationFilter, ProductWhereInput> | null + category?: XOR<CategoryNullableRelationFilter, CategoryWhereInput> | null + customer?: XOR<CustomerNullableRelationFilter, CustomerWhereInput> | null + brand?: XOR<BrandNullableRelationFilter, BrandWhereInput> | null + }, "id"> + + export type PromotionOrderByWithAggregationInput = { + id?: SortOrder + title?: SortOrder + description?: SortOrderInput | SortOrder + scope?: SortOrder + usage?: SortOrder + discountPercent?: SortOrder + isActive?: SortOrder + platform?: SortOrder + startsAt?: SortOrderInput | SortOrder + endsAt?: SortOrderInput | SortOrder + productId?: SortOrderInput | SortOrder + categoryId?: SortOrderInput | SortOrder + customerId?: SortOrderInput | SortOrder + brandId?: SortOrderInput | SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + _count?: PromotionCountOrderByAggregateInput + _avg?: PromotionAvgOrderByAggregateInput + _max?: PromotionMaxOrderByAggregateInput + _min?: PromotionMinOrderByAggregateInput + _sum?: PromotionSumOrderByAggregateInput + } + + export type PromotionScalarWhereWithAggregatesInput = { + AND?: PromotionScalarWhereWithAggregatesInput | PromotionScalarWhereWithAggregatesInput[] + OR?: PromotionScalarWhereWithAggregatesInput[] + NOT?: PromotionScalarWhereWithAggregatesInput | PromotionScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Promotion"> | string + title?: StringWithAggregatesFilter<"Promotion"> | string + description?: StringNullableWithAggregatesFilter<"Promotion"> | string | null + scope?: EnumPromotionScopeWithAggregatesFilter<"Promotion"> | $Enums.PromotionScope + usage?: EnumPromotionUsageWithAggregatesFilter<"Promotion"> | $Enums.PromotionUsage + discountPercent?: DecimalWithAggregatesFilter<"Promotion"> | Decimal | DecimalJsLike | number | string + isActive?: BoolWithAggregatesFilter<"Promotion"> | boolean + platform?: IntWithAggregatesFilter<"Promotion"> | number + startsAt?: DateTimeNullableWithAggregatesFilter<"Promotion"> | Date | string | null + endsAt?: DateTimeNullableWithAggregatesFilter<"Promotion"> | Date | string | null + productId?: StringNullableWithAggregatesFilter<"Promotion"> | string | null + categoryId?: StringNullableWithAggregatesFilter<"Promotion"> | string | null + customerId?: StringNullableWithAggregatesFilter<"Promotion"> | string | null + brandId?: StringNullableWithAggregatesFilter<"Promotion"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"Promotion"> | Date | string + updatedAt?: DateTimeWithAggregatesFilter<"Promotion"> | Date | string + } + + export type PromotionExclusionWhereInput = { + AND?: PromotionExclusionWhereInput | PromotionExclusionWhereInput[] + OR?: PromotionExclusionWhereInput[] + NOT?: PromotionExclusionWhereInput | PromotionExclusionWhereInput[] + id?: StringFilter<"PromotionExclusion"> | string + type?: IntFilter<"PromotionExclusion"> | number + itemId?: StringFilter<"PromotionExclusion"> | string + createdAt?: DateTimeFilter<"PromotionExclusion"> | Date | string + } + + export type PromotionExclusionOrderByWithRelationInput = { + id?: SortOrder + type?: SortOrder + itemId?: SortOrder + createdAt?: SortOrder + } + + export type PromotionExclusionWhereUniqueInput = Prisma.AtLeast<{ + id?: string + type_itemId?: PromotionExclusionTypeItemIdCompoundUniqueInput + AND?: PromotionExclusionWhereInput | PromotionExclusionWhereInput[] + OR?: PromotionExclusionWhereInput[] + NOT?: PromotionExclusionWhereInput | PromotionExclusionWhereInput[] + type?: IntFilter<"PromotionExclusion"> | number + itemId?: StringFilter<"PromotionExclusion"> | string + createdAt?: DateTimeFilter<"PromotionExclusion"> | Date | string + }, "id" | "type_itemId"> + + export type PromotionExclusionOrderByWithAggregationInput = { + id?: SortOrder + type?: SortOrder + itemId?: SortOrder + createdAt?: SortOrder + _count?: PromotionExclusionCountOrderByAggregateInput + _avg?: PromotionExclusionAvgOrderByAggregateInput + _max?: PromotionExclusionMaxOrderByAggregateInput + _min?: PromotionExclusionMinOrderByAggregateInput + _sum?: PromotionExclusionSumOrderByAggregateInput + } + + export type PromotionExclusionScalarWhereWithAggregatesInput = { + AND?: PromotionExclusionScalarWhereWithAggregatesInput | PromotionExclusionScalarWhereWithAggregatesInput[] + OR?: PromotionExclusionScalarWhereWithAggregatesInput[] + NOT?: PromotionExclusionScalarWhereWithAggregatesInput | PromotionExclusionScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"PromotionExclusion"> | string + type?: IntWithAggregatesFilter<"PromotionExclusion"> | number + itemId?: StringWithAggregatesFilter<"PromotionExclusion"> | string + createdAt?: DateTimeWithAggregatesFilter<"PromotionExclusion"> | Date | string + } + + export type BranchAllocationWhereInput = { + AND?: BranchAllocationWhereInput | BranchAllocationWhereInput[] + OR?: BranchAllocationWhereInput[] + NOT?: BranchAllocationWhereInput | BranchAllocationWhereInput[] + id?: StringFilter<"BranchAllocation"> | string + branchId?: StringFilter<"BranchAllocation"> | string + allocatorAdminUserId?: StringNullableFilter<"BranchAllocation"> | string | null + note?: StringNullableFilter<"BranchAllocation"> | string | null + createdAt?: DateTimeFilter<"BranchAllocation"> | Date | string + branch?: XOR<BranchRelationFilter, BranchWhereInput> + allocatorAdminUser?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null + items?: BranchAllocationItemListRelationFilter + } + + export type BranchAllocationOrderByWithRelationInput = { + id?: SortOrder + branchId?: SortOrder + allocatorAdminUserId?: SortOrderInput | SortOrder + note?: SortOrderInput | SortOrder + createdAt?: SortOrder + branch?: BranchOrderByWithRelationInput + allocatorAdminUser?: AdminUserOrderByWithRelationInput + items?: BranchAllocationItemOrderByRelationAggregateInput + } + + export type BranchAllocationWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: BranchAllocationWhereInput | BranchAllocationWhereInput[] + OR?: BranchAllocationWhereInput[] + NOT?: BranchAllocationWhereInput | BranchAllocationWhereInput[] + branchId?: StringFilter<"BranchAllocation"> | string + allocatorAdminUserId?: StringNullableFilter<"BranchAllocation"> | string | null + note?: StringNullableFilter<"BranchAllocation"> | string | null + createdAt?: DateTimeFilter<"BranchAllocation"> | Date | string + branch?: XOR<BranchRelationFilter, BranchWhereInput> + allocatorAdminUser?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null + items?: BranchAllocationItemListRelationFilter + }, "id"> + + export type BranchAllocationOrderByWithAggregationInput = { + id?: SortOrder + branchId?: SortOrder + allocatorAdminUserId?: SortOrderInput | SortOrder + note?: SortOrderInput | SortOrder + createdAt?: SortOrder + _count?: BranchAllocationCountOrderByAggregateInput + _max?: BranchAllocationMaxOrderByAggregateInput + _min?: BranchAllocationMinOrderByAggregateInput + } + + export type BranchAllocationScalarWhereWithAggregatesInput = { + AND?: BranchAllocationScalarWhereWithAggregatesInput | BranchAllocationScalarWhereWithAggregatesInput[] + OR?: BranchAllocationScalarWhereWithAggregatesInput[] + NOT?: BranchAllocationScalarWhereWithAggregatesInput | BranchAllocationScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"BranchAllocation"> | string + branchId?: StringWithAggregatesFilter<"BranchAllocation"> | string + allocatorAdminUserId?: StringNullableWithAggregatesFilter<"BranchAllocation"> | string | null + note?: StringNullableWithAggregatesFilter<"BranchAllocation"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"BranchAllocation"> | Date | string + } + + export type BranchAllocationItemWhereInput = { + AND?: BranchAllocationItemWhereInput | BranchAllocationItemWhereInput[] + OR?: BranchAllocationItemWhereInput[] + NOT?: BranchAllocationItemWhereInput | BranchAllocationItemWhereInput[] + id?: StringFilter<"BranchAllocationItem"> | string + allocationId?: StringFilter<"BranchAllocationItem"> | string + productId?: StringFilter<"BranchAllocationItem"> | string + weightGrams?: DecimalNullableFilter<"BranchAllocationItem"> | Decimal | DecimalJsLike | number | string | null + allocation?: XOR<BranchAllocationRelationFilter, BranchAllocationWhereInput> + product?: XOR<ProductRelationFilter, ProductWhereInput> + } + + export type BranchAllocationItemOrderByWithRelationInput = { + id?: SortOrder + allocationId?: SortOrder + productId?: SortOrder + weightGrams?: SortOrderInput | SortOrder + allocation?: BranchAllocationOrderByWithRelationInput + product?: ProductOrderByWithRelationInput + } + + export type BranchAllocationItemWhereUniqueInput = Prisma.AtLeast<{ + id?: string + allocationId_productId?: BranchAllocationItemAllocationIdProductIdCompoundUniqueInput + AND?: BranchAllocationItemWhereInput | BranchAllocationItemWhereInput[] + OR?: BranchAllocationItemWhereInput[] + NOT?: BranchAllocationItemWhereInput | BranchAllocationItemWhereInput[] + allocationId?: StringFilter<"BranchAllocationItem"> | string + productId?: StringFilter<"BranchAllocationItem"> | string + weightGrams?: DecimalNullableFilter<"BranchAllocationItem"> | Decimal | DecimalJsLike | number | string | null + allocation?: XOR<BranchAllocationRelationFilter, BranchAllocationWhereInput> + product?: XOR<ProductRelationFilter, ProductWhereInput> + }, "id" | "allocationId_productId"> + + export type BranchAllocationItemOrderByWithAggregationInput = { + id?: SortOrder + allocationId?: SortOrder + productId?: SortOrder + weightGrams?: SortOrderInput | SortOrder + _count?: BranchAllocationItemCountOrderByAggregateInput + _avg?: BranchAllocationItemAvgOrderByAggregateInput + _max?: BranchAllocationItemMaxOrderByAggregateInput + _min?: BranchAllocationItemMinOrderByAggregateInput + _sum?: BranchAllocationItemSumOrderByAggregateInput + } + + export type BranchAllocationItemScalarWhereWithAggregatesInput = { + AND?: BranchAllocationItemScalarWhereWithAggregatesInput | BranchAllocationItemScalarWhereWithAggregatesInput[] + OR?: BranchAllocationItemScalarWhereWithAggregatesInput[] + NOT?: BranchAllocationItemScalarWhereWithAggregatesInput | BranchAllocationItemScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"BranchAllocationItem"> | string + allocationId?: StringWithAggregatesFilter<"BranchAllocationItem"> | string + productId?: StringWithAggregatesFilter<"BranchAllocationItem"> | string + weightGrams?: DecimalNullableWithAggregatesFilter<"BranchAllocationItem"> | Decimal | DecimalJsLike | number | string | null + } + + export type SmsMessageWhereInput = { + AND?: SmsMessageWhereInput | SmsMessageWhereInput[] + OR?: SmsMessageWhereInput[] + NOT?: SmsMessageWhereInput | SmsMessageWhereInput[] + id?: StringFilter<"SmsMessage"> | string + audience?: EnumMessageAudienceFilter<"SmsMessage"> | $Enums.MessageAudience + recipients?: StringNullableFilter<"SmsMessage"> | string | null + body?: StringFilter<"SmsMessage"> | string + sentCount?: IntFilter<"SmsMessage"> | number + sentByAdminUserId?: StringNullableFilter<"SmsMessage"> | string | null + createdAt?: DateTimeFilter<"SmsMessage"> | Date | string + sentByAdminUser?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null + } + + export type SmsMessageOrderByWithRelationInput = { + id?: SortOrder + audience?: SortOrder + recipients?: SortOrderInput | SortOrder + body?: SortOrder + sentCount?: SortOrder + sentByAdminUserId?: SortOrderInput | SortOrder + createdAt?: SortOrder + sentByAdminUser?: AdminUserOrderByWithRelationInput + } + + export type SmsMessageWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: SmsMessageWhereInput | SmsMessageWhereInput[] + OR?: SmsMessageWhereInput[] + NOT?: SmsMessageWhereInput | SmsMessageWhereInput[] + audience?: EnumMessageAudienceFilter<"SmsMessage"> | $Enums.MessageAudience + recipients?: StringNullableFilter<"SmsMessage"> | string | null + body?: StringFilter<"SmsMessage"> | string + sentCount?: IntFilter<"SmsMessage"> | number + sentByAdminUserId?: StringNullableFilter<"SmsMessage"> | string | null + createdAt?: DateTimeFilter<"SmsMessage"> | Date | string + sentByAdminUser?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null + }, "id"> + + export type SmsMessageOrderByWithAggregationInput = { + id?: SortOrder + audience?: SortOrder + recipients?: SortOrderInput | SortOrder + body?: SortOrder + sentCount?: SortOrder + sentByAdminUserId?: SortOrderInput | SortOrder + createdAt?: SortOrder + _count?: SmsMessageCountOrderByAggregateInput + _avg?: SmsMessageAvgOrderByAggregateInput + _max?: SmsMessageMaxOrderByAggregateInput + _min?: SmsMessageMinOrderByAggregateInput + _sum?: SmsMessageSumOrderByAggregateInput + } + + export type SmsMessageScalarWhereWithAggregatesInput = { + AND?: SmsMessageScalarWhereWithAggregatesInput | SmsMessageScalarWhereWithAggregatesInput[] + OR?: SmsMessageScalarWhereWithAggregatesInput[] + NOT?: SmsMessageScalarWhereWithAggregatesInput | SmsMessageScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"SmsMessage"> | string + audience?: EnumMessageAudienceWithAggregatesFilter<"SmsMessage"> | $Enums.MessageAudience + recipients?: StringNullableWithAggregatesFilter<"SmsMessage"> | string | null + body?: StringWithAggregatesFilter<"SmsMessage"> | string + sentCount?: IntWithAggregatesFilter<"SmsMessage"> | number + sentByAdminUserId?: StringNullableWithAggregatesFilter<"SmsMessage"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"SmsMessage"> | Date | string + } + + export type NotificationWhereInput = { + AND?: NotificationWhereInput | NotificationWhereInput[] + OR?: NotificationWhereInput[] + NOT?: NotificationWhereInput | NotificationWhereInput[] + id?: StringFilter<"Notification"> | string + title?: StringFilter<"Notification"> | string + body?: StringFilter<"Notification"> | string + audience?: EnumMessageAudienceFilter<"Notification"> | $Enums.MessageAudience + sentByAdminUserId?: StringNullableFilter<"Notification"> | string | null + createdAt?: DateTimeFilter<"Notification"> | Date | string + sentByAdminUser?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null + recipients?: NotificationRecipientListRelationFilter + } + + export type NotificationOrderByWithRelationInput = { + id?: SortOrder + title?: SortOrder + body?: SortOrder + audience?: SortOrder + sentByAdminUserId?: SortOrderInput | SortOrder + createdAt?: SortOrder + sentByAdminUser?: AdminUserOrderByWithRelationInput + recipients?: NotificationRecipientOrderByRelationAggregateInput + } + + export type NotificationWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: NotificationWhereInput | NotificationWhereInput[] + OR?: NotificationWhereInput[] + NOT?: NotificationWhereInput | NotificationWhereInput[] + title?: StringFilter<"Notification"> | string + body?: StringFilter<"Notification"> | string + audience?: EnumMessageAudienceFilter<"Notification"> | $Enums.MessageAudience + sentByAdminUserId?: StringNullableFilter<"Notification"> | string | null + createdAt?: DateTimeFilter<"Notification"> | Date | string + sentByAdminUser?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null + recipients?: NotificationRecipientListRelationFilter + }, "id"> + + export type NotificationOrderByWithAggregationInput = { + id?: SortOrder + title?: SortOrder + body?: SortOrder + audience?: SortOrder + sentByAdminUserId?: SortOrderInput | SortOrder + createdAt?: SortOrder + _count?: NotificationCountOrderByAggregateInput + _max?: NotificationMaxOrderByAggregateInput + _min?: NotificationMinOrderByAggregateInput + } + + export type NotificationScalarWhereWithAggregatesInput = { + AND?: NotificationScalarWhereWithAggregatesInput | NotificationScalarWhereWithAggregatesInput[] + OR?: NotificationScalarWhereWithAggregatesInput[] + NOT?: NotificationScalarWhereWithAggregatesInput | NotificationScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"Notification"> | string + title?: StringWithAggregatesFilter<"Notification"> | string + body?: StringWithAggregatesFilter<"Notification"> | string + audience?: EnumMessageAudienceWithAggregatesFilter<"Notification"> | $Enums.MessageAudience + sentByAdminUserId?: StringNullableWithAggregatesFilter<"Notification"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"Notification"> | Date | string + } + + export type NotificationRecipientWhereInput = { + AND?: NotificationRecipientWhereInput | NotificationRecipientWhereInput[] + OR?: NotificationRecipientWhereInput[] + NOT?: NotificationRecipientWhereInput | NotificationRecipientWhereInput[] + id?: StringFilter<"NotificationRecipient"> | string + notificationId?: StringFilter<"NotificationRecipient"> | string + customerId?: StringFilter<"NotificationRecipient"> | string + readAt?: DateTimeNullableFilter<"NotificationRecipient"> | Date | string | null + notification?: XOR<NotificationRelationFilter, NotificationWhereInput> + customer?: XOR<CustomerRelationFilter, CustomerWhereInput> + } + + export type NotificationRecipientOrderByWithRelationInput = { + id?: SortOrder + notificationId?: SortOrder + customerId?: SortOrder + readAt?: SortOrderInput | SortOrder + notification?: NotificationOrderByWithRelationInput + customer?: CustomerOrderByWithRelationInput + } + + export type NotificationRecipientWhereUniqueInput = Prisma.AtLeast<{ + id?: string + notificationId_customerId?: NotificationRecipientNotificationIdCustomerIdCompoundUniqueInput + AND?: NotificationRecipientWhereInput | NotificationRecipientWhereInput[] + OR?: NotificationRecipientWhereInput[] + NOT?: NotificationRecipientWhereInput | NotificationRecipientWhereInput[] + notificationId?: StringFilter<"NotificationRecipient"> | string + customerId?: StringFilter<"NotificationRecipient"> | string + readAt?: DateTimeNullableFilter<"NotificationRecipient"> | Date | string | null + notification?: XOR<NotificationRelationFilter, NotificationWhereInput> + customer?: XOR<CustomerRelationFilter, CustomerWhereInput> + }, "id" | "notificationId_customerId"> + + export type NotificationRecipientOrderByWithAggregationInput = { + id?: SortOrder + notificationId?: SortOrder + customerId?: SortOrder + readAt?: SortOrderInput | SortOrder + _count?: NotificationRecipientCountOrderByAggregateInput + _max?: NotificationRecipientMaxOrderByAggregateInput + _min?: NotificationRecipientMinOrderByAggregateInput + } + + export type NotificationRecipientScalarWhereWithAggregatesInput = { + AND?: NotificationRecipientScalarWhereWithAggregatesInput | NotificationRecipientScalarWhereWithAggregatesInput[] + OR?: NotificationRecipientScalarWhereWithAggregatesInput[] + NOT?: NotificationRecipientScalarWhereWithAggregatesInput | NotificationRecipientScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"NotificationRecipient"> | string + notificationId?: StringWithAggregatesFilter<"NotificationRecipient"> | string + customerId?: StringWithAggregatesFilter<"NotificationRecipient"> | string + readAt?: DateTimeNullableWithAggregatesFilter<"NotificationRecipient"> | Date | string | null + } + + export type NewsletterSubscriberWhereInput = { + AND?: NewsletterSubscriberWhereInput | NewsletterSubscriberWhereInput[] + OR?: NewsletterSubscriberWhereInput[] + NOT?: NewsletterSubscriberWhereInput | NewsletterSubscriberWhereInput[] + id?: StringFilter<"NewsletterSubscriber"> | string + email?: StringNullableFilter<"NewsletterSubscriber"> | string | null + mobile?: StringNullableFilter<"NewsletterSubscriber"> | string | null + createdAt?: DateTimeFilter<"NewsletterSubscriber"> | Date | string + } + + export type NewsletterSubscriberOrderByWithRelationInput = { + id?: SortOrder + email?: SortOrderInput | SortOrder + mobile?: SortOrderInput | SortOrder + createdAt?: SortOrder + } + + export type NewsletterSubscriberWhereUniqueInput = Prisma.AtLeast<{ + id?: string + email?: string + mobile?: string + AND?: NewsletterSubscriberWhereInput | NewsletterSubscriberWhereInput[] + OR?: NewsletterSubscriberWhereInput[] + NOT?: NewsletterSubscriberWhereInput | NewsletterSubscriberWhereInput[] + createdAt?: DateTimeFilter<"NewsletterSubscriber"> | Date | string + }, "id" | "email" | "mobile"> + + export type NewsletterSubscriberOrderByWithAggregationInput = { + id?: SortOrder + email?: SortOrderInput | SortOrder + mobile?: SortOrderInput | SortOrder + createdAt?: SortOrder + _count?: NewsletterSubscriberCountOrderByAggregateInput + _max?: NewsletterSubscriberMaxOrderByAggregateInput + _min?: NewsletterSubscriberMinOrderByAggregateInput + } + + export type NewsletterSubscriberScalarWhereWithAggregatesInput = { + AND?: NewsletterSubscriberScalarWhereWithAggregatesInput | NewsletterSubscriberScalarWhereWithAggregatesInput[] + OR?: NewsletterSubscriberScalarWhereWithAggregatesInput[] + NOT?: NewsletterSubscriberScalarWhereWithAggregatesInput | NewsletterSubscriberScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"NewsletterSubscriber"> | string + email?: StringNullableWithAggregatesFilter<"NewsletterSubscriber"> | string | null + mobile?: StringNullableWithAggregatesFilter<"NewsletterSubscriber"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"NewsletterSubscriber"> | Date | string + } + + export type CustomerActivityLogWhereInput = { + AND?: CustomerActivityLogWhereInput | CustomerActivityLogWhereInput[] + OR?: CustomerActivityLogWhereInput[] + NOT?: CustomerActivityLogWhereInput | CustomerActivityLogWhereInput[] + id?: StringFilter<"CustomerActivityLog"> | string + customerId?: StringFilter<"CustomerActivityLog"> | string + action?: StringFilter<"CustomerActivityLog"> | string + detail?: StringNullableFilter<"CustomerActivityLog"> | string | null + createdAt?: DateTimeFilter<"CustomerActivityLog"> | Date | string + customer?: XOR<CustomerRelationFilter, CustomerWhereInput> + } + + export type CustomerActivityLogOrderByWithRelationInput = { + id?: SortOrder + customerId?: SortOrder + action?: SortOrder + detail?: SortOrderInput | SortOrder + createdAt?: SortOrder + customer?: CustomerOrderByWithRelationInput + } + + export type CustomerActivityLogWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: CustomerActivityLogWhereInput | CustomerActivityLogWhereInput[] + OR?: CustomerActivityLogWhereInput[] + NOT?: CustomerActivityLogWhereInput | CustomerActivityLogWhereInput[] + customerId?: StringFilter<"CustomerActivityLog"> | string + action?: StringFilter<"CustomerActivityLog"> | string + detail?: StringNullableFilter<"CustomerActivityLog"> | string | null + createdAt?: DateTimeFilter<"CustomerActivityLog"> | Date | string + customer?: XOR<CustomerRelationFilter, CustomerWhereInput> + }, "id"> + + export type CustomerActivityLogOrderByWithAggregationInput = { + id?: SortOrder + customerId?: SortOrder + action?: SortOrder + detail?: SortOrderInput | SortOrder + createdAt?: SortOrder + _count?: CustomerActivityLogCountOrderByAggregateInput + _max?: CustomerActivityLogMaxOrderByAggregateInput + _min?: CustomerActivityLogMinOrderByAggregateInput + } + + export type CustomerActivityLogScalarWhereWithAggregatesInput = { + AND?: CustomerActivityLogScalarWhereWithAggregatesInput | CustomerActivityLogScalarWhereWithAggregatesInput[] + OR?: CustomerActivityLogScalarWhereWithAggregatesInput[] + NOT?: CustomerActivityLogScalarWhereWithAggregatesInput | CustomerActivityLogScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"CustomerActivityLog"> | string + customerId?: StringWithAggregatesFilter<"CustomerActivityLog"> | string + action?: StringWithAggregatesFilter<"CustomerActivityLog"> | string + detail?: StringNullableWithAggregatesFilter<"CustomerActivityLog"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"CustomerActivityLog"> | Date | string + } + + export type UploadedFileWhereInput = { + AND?: UploadedFileWhereInput | UploadedFileWhereInput[] + OR?: UploadedFileWhereInput[] + NOT?: UploadedFileWhereInput | UploadedFileWhereInput[] + id?: StringFilter<"UploadedFile"> | string + url?: StringFilter<"UploadedFile"> | string + originalName?: StringFilter<"UploadedFile"> | string + mimeType?: StringFilter<"UploadedFile"> | string + sizeBytes?: IntFilter<"UploadedFile"> | number + purpose?: StringNullableFilter<"UploadedFile"> | string | null + uploadedByAdminUserId?: StringNullableFilter<"UploadedFile"> | string | null + createdAt?: DateTimeFilter<"UploadedFile"> | Date | string + uploadedByAdminUser?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null + customerAvatars?: CustomerListRelationFilter + } + + export type UploadedFileOrderByWithRelationInput = { + id?: SortOrder + url?: SortOrder + originalName?: SortOrder + mimeType?: SortOrder + sizeBytes?: SortOrder + purpose?: SortOrderInput | SortOrder + uploadedByAdminUserId?: SortOrderInput | SortOrder + createdAt?: SortOrder + uploadedByAdminUser?: AdminUserOrderByWithRelationInput + customerAvatars?: CustomerOrderByRelationAggregateInput + } + + export type UploadedFileWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: UploadedFileWhereInput | UploadedFileWhereInput[] + OR?: UploadedFileWhereInput[] + NOT?: UploadedFileWhereInput | UploadedFileWhereInput[] + url?: StringFilter<"UploadedFile"> | string + originalName?: StringFilter<"UploadedFile"> | string + mimeType?: StringFilter<"UploadedFile"> | string + sizeBytes?: IntFilter<"UploadedFile"> | number + purpose?: StringNullableFilter<"UploadedFile"> | string | null + uploadedByAdminUserId?: StringNullableFilter<"UploadedFile"> | string | null + createdAt?: DateTimeFilter<"UploadedFile"> | Date | string + uploadedByAdminUser?: XOR<AdminUserNullableRelationFilter, AdminUserWhereInput> | null + customerAvatars?: CustomerListRelationFilter + }, "id"> + + export type UploadedFileOrderByWithAggregationInput = { + id?: SortOrder + url?: SortOrder + originalName?: SortOrder + mimeType?: SortOrder + sizeBytes?: SortOrder + purpose?: SortOrderInput | SortOrder + uploadedByAdminUserId?: SortOrderInput | SortOrder + createdAt?: SortOrder + _count?: UploadedFileCountOrderByAggregateInput + _avg?: UploadedFileAvgOrderByAggregateInput + _max?: UploadedFileMaxOrderByAggregateInput + _min?: UploadedFileMinOrderByAggregateInput + _sum?: UploadedFileSumOrderByAggregateInput + } + + export type UploadedFileScalarWhereWithAggregatesInput = { + AND?: UploadedFileScalarWhereWithAggregatesInput | UploadedFileScalarWhereWithAggregatesInput[] + OR?: UploadedFileScalarWhereWithAggregatesInput[] + NOT?: UploadedFileScalarWhereWithAggregatesInput | UploadedFileScalarWhereWithAggregatesInput[] + id?: StringWithAggregatesFilter<"UploadedFile"> | string + url?: StringWithAggregatesFilter<"UploadedFile"> | string + originalName?: StringWithAggregatesFilter<"UploadedFile"> | string + mimeType?: StringWithAggregatesFilter<"UploadedFile"> | string + sizeBytes?: IntWithAggregatesFilter<"UploadedFile"> | number + purpose?: StringNullableWithAggregatesFilter<"UploadedFile"> | string | null + uploadedByAdminUserId?: StringNullableWithAggregatesFilter<"UploadedFile"> | string | null + createdAt?: DateTimeWithAggregatesFilter<"UploadedFile"> | Date | string + } + export type CityCreateInput = { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null customers?: CustomerCreateNestedManyWithoutCityInput addresses?: CustomerAddressCreateNestedManyWithoutCityInput branches?: BranchCreateNestedManyWithoutCityInput @@ -26658,6 +44349,8 @@ export namespace Prisma { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null customers?: CustomerUncheckedCreateNestedManyWithoutCityInput addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCityInput branches?: BranchUncheckedCreateNestedManyWithoutCityInput @@ -26668,6 +44361,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null customers?: CustomerUpdateManyWithoutCityNestedInput addresses?: CustomerAddressUpdateManyWithoutCityNestedInput branches?: BranchUpdateManyWithoutCityNestedInput @@ -26678,6 +44373,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null customers?: CustomerUncheckedUpdateManyWithoutCityNestedInput addresses?: CustomerAddressUncheckedUpdateManyWithoutCityNestedInput branches?: BranchUncheckedUpdateManyWithoutCityNestedInput @@ -26688,18 +44385,24 @@ export namespace Prisma { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null } export type CityUpdateManyMutationInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null } export type CityUncheckedUpdateManyInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null } export type AdminUserCreateInput = { @@ -26711,11 +44414,17 @@ export namespace Prisma { wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput branch?: BranchCreateNestedOneWithoutAdminUsersInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserUncheckedCreateInput = { @@ -26724,14 +44433,20 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole + userTypeId?: number | null branchId?: string | null wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserUpdateInput = { @@ -26743,11 +44458,17 @@ export namespace Prisma { wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput branch?: BranchUpdateOneWithoutAdminUsersNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput } export type AdminUserUncheckedUpdateInput = { @@ -26756,14 +44477,20 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput } export type AdminUserCreateManyInput = { @@ -26772,6 +44499,7 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole + userTypeId?: number | null branchId?: string | null wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean @@ -26795,6 +44523,7 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean @@ -26807,6 +44536,13 @@ export namespace Prisma { mobile: string nationalCode: string passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string fiatDebtRial?: Decimal | DecimalJsLike | number | string @@ -26814,16 +44550,23 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string city?: CityCreateNestedOneWithoutCustomersInput referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput orders?: OrderCreateNestedManyWithoutCustomerInput preOrders?: PreOrderCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput } export type CustomerUncheckedCreateInput = { @@ -26833,6 +44576,13 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null referredByAgentId?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string @@ -26841,7 +44591,10 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput @@ -26849,6 +44602,10 @@ export namespace Prisma { preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput } export type CustomerUpdateInput = { @@ -26857,6 +44614,13 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -26864,16 +44628,23 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string city?: CityUpdateOneWithoutCustomersNestedInput referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput orders?: OrderUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateInput = { @@ -26883,6 +44654,13 @@ export namespace Prisma { nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -26891,7 +44669,10 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput @@ -26899,6 +44680,10 @@ export namespace Prisma { preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput } export type CustomerCreateManyInput = { @@ -26908,6 +44693,13 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null referredByAgentId?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string @@ -26916,7 +44708,10 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string } @@ -26927,6 +44722,13 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -26934,7 +44736,9 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -26946,6 +44750,13 @@ export namespace Prisma { nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -26954,7 +44765,10 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -27016,62 +44830,93 @@ export namespace Prisma { export type BranchCreateInput = { id?: string name: string + address?: string | null + phone?: string | null + isActive?: boolean city?: CityCreateNestedOneWithoutBranchesInput adminUsers?: AdminUserCreateNestedManyWithoutBranchInput orders?: OrderCreateNestedManyWithoutBranchInput + allocations?: BranchAllocationCreateNestedManyWithoutBranchInput } export type BranchUncheckedCreateInput = { id?: string name: string + address?: string | null + phone?: string | null + isActive?: boolean cityId?: string | null adminUsers?: AdminUserUncheckedCreateNestedManyWithoutBranchInput orders?: OrderUncheckedCreateNestedManyWithoutBranchInput + allocations?: BranchAllocationUncheckedCreateNestedManyWithoutBranchInput } export type BranchUpdateInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean city?: CityUpdateOneWithoutBranchesNestedInput adminUsers?: AdminUserUpdateManyWithoutBranchNestedInput orders?: OrderUpdateManyWithoutBranchNestedInput + allocations?: BranchAllocationUpdateManyWithoutBranchNestedInput } export type BranchUncheckedUpdateInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean cityId?: NullableStringFieldUpdateOperationsInput | string | null adminUsers?: AdminUserUncheckedUpdateManyWithoutBranchNestedInput orders?: OrderUncheckedUpdateManyWithoutBranchNestedInput + allocations?: BranchAllocationUncheckedUpdateManyWithoutBranchNestedInput } export type BranchCreateManyInput = { id?: string name: string + address?: string | null + phone?: string | null + isActive?: boolean cityId?: string | null } export type BranchUpdateManyMutationInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean } export type BranchUncheckedUpdateManyInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean cityId?: NullableStringFieldUpdateOperationsInput | string | null } export type WorkshopCreateInput = { id?: string name: string + address?: string | null + phone?: string | null isActive?: boolean + supervisor?: AdminUserCreateNestedOneWithoutSupervisedWorkshopsInput preOrders?: PreOrderCreateNestedManyWithoutWorkshopInput } export type WorkshopUncheckedCreateInput = { id?: string name: string + address?: string | null + phone?: string | null + supervisorId?: string | null isActive?: boolean preOrders?: PreOrderUncheckedCreateNestedManyWithoutWorkshopInput } @@ -27079,13 +44924,19 @@ export namespace Prisma { export type WorkshopUpdateInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean + supervisor?: AdminUserUpdateOneWithoutSupervisedWorkshopsNestedInput preOrders?: PreOrderUpdateManyWithoutWorkshopNestedInput } export type WorkshopUncheckedUpdateInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + supervisorId?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean preOrders?: PreOrderUncheckedUpdateManyWithoutWorkshopNestedInput } @@ -27093,67 +44944,114 @@ export namespace Prisma { export type WorkshopCreateManyInput = { id?: string name: string + address?: string | null + phone?: string | null + supervisorId?: string | null isActive?: boolean } export type WorkshopUpdateManyMutationInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean } export type WorkshopUncheckedUpdateManyInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + supervisorId?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean } export type CategoryCreateInput = { id?: string title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null parent?: CategoryCreateNestedOneWithoutChildrenInput children?: CategoryCreateNestedManyWithoutParentInput products?: ProductCreateNestedManyWithoutCategoryInput + promotions?: PromotionCreateNestedManyWithoutCategoryInput } export type CategoryUncheckedCreateInput = { id?: string title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null parentId?: string | null children?: CategoryUncheckedCreateNestedManyWithoutParentInput products?: ProductUncheckedCreateNestedManyWithoutCategoryInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCategoryInput } export type CategoryUpdateInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null parent?: CategoryUpdateOneWithoutChildrenNestedInput children?: CategoryUpdateManyWithoutParentNestedInput products?: ProductUpdateManyWithoutCategoryNestedInput + promotions?: PromotionUpdateManyWithoutCategoryNestedInput } export type CategoryUncheckedUpdateInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null parentId?: NullableStringFieldUpdateOperationsInput | string | null children?: CategoryUncheckedUpdateManyWithoutParentNestedInput products?: ProductUncheckedUpdateManyWithoutCategoryNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCategoryNestedInput } export type CategoryCreateManyInput = { id?: string title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null parentId?: string | null } export type CategoryUpdateManyMutationInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null } export type CategoryUncheckedUpdateManyInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null parentId?: NullableStringFieldUpdateOperationsInput | string | null } @@ -27161,24 +45059,28 @@ export namespace Prisma { id?: string title: string products?: ProductCreateNestedManyWithoutBrandInput + promotions?: PromotionCreateNestedManyWithoutBrandInput } export type BrandUncheckedCreateInput = { id?: string title: string products?: ProductUncheckedCreateNestedManyWithoutBrandInput + promotions?: PromotionUncheckedCreateNestedManyWithoutBrandInput } export type BrandUpdateInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string products?: ProductUpdateManyWithoutBrandNestedInput + promotions?: PromotionUpdateManyWithoutBrandNestedInput } export type BrandUncheckedUpdateInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string products?: ProductUncheckedUpdateManyWithoutBrandNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutBrandNestedInput } export type BrandCreateManyInput = { @@ -27287,6 +45189,8 @@ export namespace Prisma { id?: string title: string description?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string category?: CategoryCreateNestedOneWithoutProductsInput @@ -27294,6 +45198,9 @@ export namespace Prisma { variants?: ProductVariantCreateNestedManyWithoutProductInput images?: ProductImageCreateNestedManyWithoutProductInput collections?: CollectionProductCreateNestedManyWithoutProductInput + comments?: CommentCreateNestedManyWithoutProductInput + promotions?: PromotionCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemCreateNestedManyWithoutProductInput } export type ProductUncheckedCreateInput = { @@ -27302,17 +45209,24 @@ export namespace Prisma { description?: string | null categoryId?: string | null brandId?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string variants?: ProductVariantUncheckedCreateNestedManyWithoutProductInput images?: ProductImageUncheckedCreateNestedManyWithoutProductInput collections?: CollectionProductUncheckedCreateNestedManyWithoutProductInput + comments?: CommentUncheckedCreateNestedManyWithoutProductInput + promotions?: PromotionUncheckedCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemUncheckedCreateNestedManyWithoutProductInput } export type ProductUpdateInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string category?: CategoryUpdateOneWithoutProductsNestedInput @@ -27320,6 +45234,9 @@ export namespace Prisma { variants?: ProductVariantUpdateManyWithoutProductNestedInput images?: ProductImageUpdateManyWithoutProductNestedInput collections?: CollectionProductUpdateManyWithoutProductNestedInput + comments?: CommentUpdateManyWithoutProductNestedInput + promotions?: PromotionUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateInput = { @@ -27328,11 +45245,16 @@ export namespace Prisma { description?: NullableStringFieldUpdateOperationsInput | string | null categoryId?: NullableStringFieldUpdateOperationsInput | string | null brandId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string variants?: ProductVariantUncheckedUpdateManyWithoutProductNestedInput images?: ProductImageUncheckedUpdateManyWithoutProductNestedInput collections?: CollectionProductUncheckedUpdateManyWithoutProductNestedInput + comments?: CommentUncheckedUpdateManyWithoutProductNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUncheckedUpdateManyWithoutProductNestedInput } export type ProductCreateManyInput = { @@ -27341,6 +45263,8 @@ export namespace Prisma { description?: string | null categoryId?: string | null brandId?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string } @@ -27349,6 +45273,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -27359,6 +45285,8 @@ export namespace Prisma { description?: NullableStringFieldUpdateOperationsInput | string | null categoryId?: NullableStringFieldUpdateOperationsInput | string | null brandId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -27417,6 +45345,8 @@ export namespace Prisma { sku?: string | null rashWeightGrams: Decimal | DecimalJsLike | number | string defaultWagePercent: Decimal | DecimalJsLike | number | string + qty?: number + isPreOrder?: boolean isActive?: boolean product: ProductCreateNestedOneWithoutVariantsInput orderItems?: OrderItemCreateNestedManyWithoutProductVariantInput @@ -27429,6 +45359,8 @@ export namespace Prisma { sku?: string | null rashWeightGrams: Decimal | DecimalJsLike | number | string defaultWagePercent: Decimal | DecimalJsLike | number | string + qty?: number + isPreOrder?: boolean isActive?: boolean orderItems?: OrderItemUncheckedCreateNestedManyWithoutProductVariantInput } @@ -27439,6 +45371,8 @@ export namespace Prisma { sku?: NullableStringFieldUpdateOperationsInput | string | null rashWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + qty?: IntFieldUpdateOperationsInput | number + isPreOrder?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean product?: ProductUpdateOneRequiredWithoutVariantsNestedInput orderItems?: OrderItemUpdateManyWithoutProductVariantNestedInput @@ -27451,6 +45385,8 @@ export namespace Prisma { sku?: NullableStringFieldUpdateOperationsInput | string | null rashWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + qty?: IntFieldUpdateOperationsInput | number + isPreOrder?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean orderItems?: OrderItemUncheckedUpdateManyWithoutProductVariantNestedInput } @@ -27462,6 +45398,8 @@ export namespace Prisma { sku?: string | null rashWeightGrams: Decimal | DecimalJsLike | number | string defaultWagePercent: Decimal | DecimalJsLike | number | string + qty?: number + isPreOrder?: boolean isActive?: boolean } @@ -27471,6 +45409,8 @@ export namespace Prisma { sku?: NullableStringFieldUpdateOperationsInput | string | null rashWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + qty?: IntFieldUpdateOperationsInput | number + isPreOrder?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean } @@ -27481,12 +45421,15 @@ export namespace Prisma { sku?: NullableStringFieldUpdateOperationsInput | string | null rashWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + qty?: IntFieldUpdateOperationsInput | number + isPreOrder?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean } export type OrderCreateInput = { id?: string orderNumber: string + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -27508,6 +45451,7 @@ export namespace Prisma { orderNumber: string customerId: string branchId?: string | null + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -27525,6 +45469,7 @@ export namespace Prisma { export type OrderUpdateInput = { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -27546,6 +45491,7 @@ export namespace Prisma { orderNumber?: StringFieldUpdateOperationsInput | string customerId?: StringFieldUpdateOperationsInput | string branchId?: NullableStringFieldUpdateOperationsInput | string | null + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -27565,6 +45511,7 @@ export namespace Prisma { orderNumber: string customerId: string branchId?: string | null + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -27578,6 +45525,7 @@ export namespace Prisma { export type OrderUpdateManyMutationInput = { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -27593,6 +45541,7 @@ export namespace Prisma { orderNumber?: StringFieldUpdateOperationsInput | string customerId?: StringFieldUpdateOperationsInput | string branchId?: NullableStringFieldUpdateOperationsInput | string | null + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -27957,6 +45906,14 @@ export namespace Prisma { pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null confirmed?: boolean confirmedAt?: Date | string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string customer: CustomerCreateNestedOneWithoutLedgerEntriesInput @@ -27977,6 +45934,14 @@ export namespace Prisma { confirmed?: boolean confirmedAt?: Date | string | null postedByAdminUserId?: string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string } @@ -27991,6 +45956,14 @@ export namespace Prisma { pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string customer?: CustomerUpdateOneRequiredWithoutLedgerEntriesNestedInput @@ -28011,6 +45984,14 @@ export namespace Prisma { confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -28028,6 +46009,14 @@ export namespace Prisma { confirmed?: boolean confirmedAt?: Date | string | null postedByAdminUserId?: string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string } @@ -28042,6 +46031,14 @@ export namespace Prisma { pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -28059,6 +46056,14 @@ export namespace Prisma { confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -28195,6 +46200,866 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean } + export type UserTypeCreateInput = { + id: number + title: string + isActive?: boolean + createdAt?: Date | string + permissions?: PermissionCreateNestedManyWithoutUserTypeInput + adminUsers?: AdminUserCreateNestedManyWithoutUserTypeInput + } + + export type UserTypeUncheckedCreateInput = { + id: number + title: string + isActive?: boolean + createdAt?: Date | string + permissions?: PermissionUncheckedCreateNestedManyWithoutUserTypeInput + adminUsers?: AdminUserUncheckedCreateNestedManyWithoutUserTypeInput + } + + export type UserTypeUpdateInput = { + id?: IntFieldUpdateOperationsInput | number + title?: StringFieldUpdateOperationsInput | string + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + permissions?: PermissionUpdateManyWithoutUserTypeNestedInput + adminUsers?: AdminUserUpdateManyWithoutUserTypeNestedInput + } + + export type UserTypeUncheckedUpdateInput = { + id?: IntFieldUpdateOperationsInput | number + title?: StringFieldUpdateOperationsInput | string + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + permissions?: PermissionUncheckedUpdateManyWithoutUserTypeNestedInput + adminUsers?: AdminUserUncheckedUpdateManyWithoutUserTypeNestedInput + } + + export type UserTypeCreateManyInput = { + id: number + title: string + isActive?: boolean + createdAt?: Date | string + } + + export type UserTypeUpdateManyMutationInput = { + id?: IntFieldUpdateOperationsInput | number + title?: StringFieldUpdateOperationsInput | string + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type UserTypeUncheckedUpdateManyInput = { + id?: IntFieldUpdateOperationsInput | number + title?: StringFieldUpdateOperationsInput | string + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PermissionCreateInput = { + rid: string + userType: UserTypeCreateNestedOneWithoutPermissionsInput + } + + export type PermissionUncheckedCreateInput = { + rid: string + userTypeId: number + } + + export type PermissionUpdateInput = { + rid?: StringFieldUpdateOperationsInput | string + userType?: UserTypeUpdateOneRequiredWithoutPermissionsNestedInput + } + + export type PermissionUncheckedUpdateInput = { + rid?: StringFieldUpdateOperationsInput | string + userTypeId?: IntFieldUpdateOperationsInput | number + } + + export type PermissionCreateManyInput = { + rid: string + userTypeId: number + } + + export type PermissionUpdateManyMutationInput = { + rid?: StringFieldUpdateOperationsInput | string + } + + export type PermissionUncheckedUpdateManyInput = { + rid?: StringFieldUpdateOperationsInput | string + userTypeId?: IntFieldUpdateOperationsInput | number + } + + export type CommentCreateInput = { + id?: string + body: string + status?: $Enums.CommentStatus + createdAt?: Date | string + updatedAt?: Date | string + product: ProductCreateNestedOneWithoutCommentsInput + customer: CustomerCreateNestedOneWithoutCommentsInput + replyTo?: CommentCreateNestedOneWithoutRepliesInput + replies?: CommentCreateNestedManyWithoutReplyToInput + } + + export type CommentUncheckedCreateInput = { + id?: string + productId: string + customerId: string + body: string + status?: $Enums.CommentStatus + replyToId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + replies?: CommentUncheckedCreateNestedManyWithoutReplyToInput + } + + export type CommentUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + product?: ProductUpdateOneRequiredWithoutCommentsNestedInput + customer?: CustomerUpdateOneRequiredWithoutCommentsNestedInput + replyTo?: CommentUpdateOneWithoutRepliesNestedInput + replies?: CommentUpdateManyWithoutReplyToNestedInput + } + + export type CommentUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + replyToId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + replies?: CommentUncheckedUpdateManyWithoutReplyToNestedInput + } + + export type CommentCreateManyInput = { + id?: string + productId: string + customerId: string + body: string + status?: $Enums.CommentStatus + replyToId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type CommentUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CommentUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + replyToId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SettingCreateInput = { + key: string + value: JsonNullValueInput | InputJsonValue + updatedAt?: Date | string + } + + export type SettingUncheckedCreateInput = { + key: string + value: JsonNullValueInput | InputJsonValue + updatedAt?: Date | string + } + + export type SettingUpdateInput = { + key?: StringFieldUpdateOperationsInput | string + value?: JsonNullValueInput | InputJsonValue + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SettingUncheckedUpdateInput = { + key?: StringFieldUpdateOperationsInput | string + value?: JsonNullValueInput | InputJsonValue + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SettingCreateManyInput = { + key: string + value: JsonNullValueInput | InputJsonValue + updatedAt?: Date | string + } + + export type SettingUpdateManyMutationInput = { + key?: StringFieldUpdateOperationsInput | string + value?: JsonNullValueInput | InputJsonValue + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SettingUncheckedUpdateManyInput = { + key?: StringFieldUpdateOperationsInput | string + value?: JsonNullValueInput | InputJsonValue + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionCreateInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string + product?: ProductCreateNestedOneWithoutPromotionsInput + category?: CategoryCreateNestedOneWithoutPromotionsInput + customer?: CustomerCreateNestedOneWithoutPromotionsInput + brand?: BrandCreateNestedOneWithoutPromotionsInput + } + + export type PromotionUncheckedCreateInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + productId?: string | null + categoryId?: string | null + customerId?: string | null + brandId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type PromotionUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + product?: ProductUpdateOneWithoutPromotionsNestedInput + category?: CategoryUpdateOneWithoutPromotionsNestedInput + customer?: CustomerUpdateOneWithoutPromotionsNestedInput + brand?: BrandUpdateOneWithoutPromotionsNestedInput + } + + export type PromotionUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: NullableStringFieldUpdateOperationsInput | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + customerId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionCreateManyInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + productId?: string | null + categoryId?: string | null + customerId?: string | null + brandId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type PromotionUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: NullableStringFieldUpdateOperationsInput | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + customerId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionExclusionCreateInput = { + id?: string + type: number + itemId: string + createdAt?: Date | string + } + + export type PromotionExclusionUncheckedCreateInput = { + id?: string + type: number + itemId: string + createdAt?: Date | string + } + + export type PromotionExclusionUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + itemId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionExclusionUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + itemId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionExclusionCreateManyInput = { + id?: string + type: number + itemId: string + createdAt?: Date | string + } + + export type PromotionExclusionUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + itemId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionExclusionUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + itemId?: StringFieldUpdateOperationsInput | string + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type BranchAllocationCreateInput = { + id?: string + note?: string | null + createdAt?: Date | string + branch: BranchCreateNestedOneWithoutAllocationsInput + allocatorAdminUser?: AdminUserCreateNestedOneWithoutBranchAllocationsInput + items?: BranchAllocationItemCreateNestedManyWithoutAllocationInput + } + + export type BranchAllocationUncheckedCreateInput = { + id?: string + branchId: string + allocatorAdminUserId?: string | null + note?: string | null + createdAt?: Date | string + items?: BranchAllocationItemUncheckedCreateNestedManyWithoutAllocationInput + } + + export type BranchAllocationUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + branch?: BranchUpdateOneRequiredWithoutAllocationsNestedInput + allocatorAdminUser?: AdminUserUpdateOneWithoutBranchAllocationsNestedInput + items?: BranchAllocationItemUpdateManyWithoutAllocationNestedInput + } + + export type BranchAllocationUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + branchId?: StringFieldUpdateOperationsInput | string + allocatorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + items?: BranchAllocationItemUncheckedUpdateManyWithoutAllocationNestedInput + } + + export type BranchAllocationCreateManyInput = { + id?: string + branchId: string + allocatorAdminUserId?: string | null + note?: string | null + createdAt?: Date | string + } + + export type BranchAllocationUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type BranchAllocationUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + branchId?: StringFieldUpdateOperationsInput | string + allocatorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type BranchAllocationItemCreateInput = { + id?: string + weightGrams?: Decimal | DecimalJsLike | number | string | null + allocation: BranchAllocationCreateNestedOneWithoutItemsInput + product: ProductCreateNestedOneWithoutAllocationItemsInput + } + + export type BranchAllocationItemUncheckedCreateInput = { + id?: string + allocationId: string + productId: string + weightGrams?: Decimal | DecimalJsLike | number | string | null + } + + export type BranchAllocationItemUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + weightGrams?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + allocation?: BranchAllocationUpdateOneRequiredWithoutItemsNestedInput + product?: ProductUpdateOneRequiredWithoutAllocationItemsNestedInput + } + + export type BranchAllocationItemUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + allocationId?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + weightGrams?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + } + + export type BranchAllocationItemCreateManyInput = { + id?: string + allocationId: string + productId: string + weightGrams?: Decimal | DecimalJsLike | number | string | null + } + + export type BranchAllocationItemUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + weightGrams?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + } + + export type BranchAllocationItemUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + allocationId?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + weightGrams?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + } + + export type SmsMessageCreateInput = { + id?: string + audience: $Enums.MessageAudience + recipients?: string | null + body: string + sentCount?: number + createdAt?: Date | string + sentByAdminUser?: AdminUserCreateNestedOneWithoutSentSmsMessagesInput + } + + export type SmsMessageUncheckedCreateInput = { + id?: string + audience: $Enums.MessageAudience + recipients?: string | null + body: string + sentCount?: number + sentByAdminUserId?: string | null + createdAt?: Date | string + } + + export type SmsMessageUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + recipients?: NullableStringFieldUpdateOperationsInput | string | null + body?: StringFieldUpdateOperationsInput | string + sentCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + sentByAdminUser?: AdminUserUpdateOneWithoutSentSmsMessagesNestedInput + } + + export type SmsMessageUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + recipients?: NullableStringFieldUpdateOperationsInput | string | null + body?: StringFieldUpdateOperationsInput | string + sentCount?: IntFieldUpdateOperationsInput | number + sentByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SmsMessageCreateManyInput = { + id?: string + audience: $Enums.MessageAudience + recipients?: string | null + body: string + sentCount?: number + sentByAdminUserId?: string | null + createdAt?: Date | string + } + + export type SmsMessageUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + recipients?: NullableStringFieldUpdateOperationsInput | string | null + body?: StringFieldUpdateOperationsInput | string + sentCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SmsMessageUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + recipients?: NullableStringFieldUpdateOperationsInput | string | null + body?: StringFieldUpdateOperationsInput | string + sentCount?: IntFieldUpdateOperationsInput | number + sentByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationCreateInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + createdAt?: Date | string + sentByAdminUser?: AdminUserCreateNestedOneWithoutSentNotificationsInput + recipients?: NotificationRecipientCreateNestedManyWithoutNotificationInput + } + + export type NotificationUncheckedCreateInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + sentByAdminUserId?: string | null + createdAt?: Date | string + recipients?: NotificationRecipientUncheckedCreateNestedManyWithoutNotificationInput + } + + export type NotificationUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + sentByAdminUser?: AdminUserUpdateOneWithoutSentNotificationsNestedInput + recipients?: NotificationRecipientUpdateManyWithoutNotificationNestedInput + } + + export type NotificationUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + sentByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + recipients?: NotificationRecipientUncheckedUpdateManyWithoutNotificationNestedInput + } + + export type NotificationCreateManyInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + sentByAdminUserId?: string | null + createdAt?: Date | string + } + + export type NotificationUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + sentByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationRecipientCreateInput = { + id?: string + readAt?: Date | string | null + notification: NotificationCreateNestedOneWithoutRecipientsInput + customer: CustomerCreateNestedOneWithoutNotificationsInput + } + + export type NotificationRecipientUncheckedCreateInput = { + id?: string + notificationId: string + customerId: string + readAt?: Date | string | null + } + + export type NotificationRecipientUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + readAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + notification?: NotificationUpdateOneRequiredWithoutRecipientsNestedInput + customer?: CustomerUpdateOneRequiredWithoutNotificationsNestedInput + } + + export type NotificationRecipientUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + notificationId?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + readAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type NotificationRecipientCreateManyInput = { + id?: string + notificationId: string + customerId: string + readAt?: Date | string | null + } + + export type NotificationRecipientUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + readAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type NotificationRecipientUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + notificationId?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + readAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type NewsletterSubscriberCreateInput = { + id?: string + email?: string | null + mobile?: string | null + createdAt?: Date | string + } + + export type NewsletterSubscriberUncheckedCreateInput = { + id?: string + email?: string | null + mobile?: string | null + createdAt?: Date | string + } + + export type NewsletterSubscriberUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + email?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NewsletterSubscriberUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + email?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NewsletterSubscriberCreateManyInput = { + id?: string + email?: string | null + mobile?: string | null + createdAt?: Date | string + } + + export type NewsletterSubscriberUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + email?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NewsletterSubscriberUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + email?: NullableStringFieldUpdateOperationsInput | string | null + mobile?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CustomerActivityLogCreateInput = { + id?: string + action: string + detail?: string | null + createdAt?: Date | string + customer: CustomerCreateNestedOneWithoutActivityLogsInput + } + + export type CustomerActivityLogUncheckedCreateInput = { + id?: string + customerId: string + action: string + detail?: string | null + createdAt?: Date | string + } + + export type CustomerActivityLogUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + action?: StringFieldUpdateOperationsInput | string + detail?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + customer?: CustomerUpdateOneRequiredWithoutActivityLogsNestedInput + } + + export type CustomerActivityLogUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + action?: StringFieldUpdateOperationsInput | string + detail?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CustomerActivityLogCreateManyInput = { + id?: string + customerId: string + action: string + detail?: string | null + createdAt?: Date | string + } + + export type CustomerActivityLogUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + action?: StringFieldUpdateOperationsInput | string + detail?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CustomerActivityLogUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + action?: StringFieldUpdateOperationsInput | string + detail?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type UploadedFileCreateInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + createdAt?: Date | string + uploadedByAdminUser?: AdminUserCreateNestedOneWithoutUploadedFilesInput + customerAvatars?: CustomerCreateNestedManyWithoutAvatarFileInput + } + + export type UploadedFileUncheckedCreateInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + uploadedByAdminUserId?: string | null + createdAt?: Date | string + customerAvatars?: CustomerUncheckedCreateNestedManyWithoutAvatarFileInput + } + + export type UploadedFileUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + uploadedByAdminUser?: AdminUserUpdateOneWithoutUploadedFilesNestedInput + customerAvatars?: CustomerUpdateManyWithoutAvatarFileNestedInput + } + + export type UploadedFileUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + uploadedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + customerAvatars?: CustomerUncheckedUpdateManyWithoutAvatarFileNestedInput + } + + export type UploadedFileCreateManyInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + uploadedByAdminUserId?: string | null + createdAt?: Date | string + } + + export type UploadedFileUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type UploadedFileUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + uploadedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + export type StringFilter<$PrismaModel = never> = { equals?: string | StringFieldRefInput<$PrismaModel> in?: string[] | ListStringFieldRefInput<$PrismaModel> @@ -28225,6 +47090,17 @@ export namespace Prisma { not?: NestedStringNullableFilter<$PrismaModel> | string | null } + export type DecimalNullableFilter<$PrismaModel = never> = { + equals?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> | null + in?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null + notIn?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null + lt?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> + lte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> + gt?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> + gte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> + not?: NestedDecimalNullableFilter<$PrismaModel> | Decimal | DecimalJsLike | number | string | null + } + export type CustomerListRelationFilter = { every?: CustomerWhereInput some?: CustomerWhereInput @@ -28274,18 +47150,34 @@ export namespace Prisma { id?: SortOrder name?: SortOrder province?: SortOrder + percent?: SortOrder + percentAux?: SortOrder + } + + export type CityAvgOrderByAggregateInput = { + percent?: SortOrder + percentAux?: SortOrder } export type CityMaxOrderByAggregateInput = { id?: SortOrder name?: SortOrder province?: SortOrder + percent?: SortOrder + percentAux?: SortOrder } export type CityMinOrderByAggregateInput = { id?: SortOrder name?: SortOrder province?: SortOrder + percent?: SortOrder + percentAux?: SortOrder + } + + export type CitySumOrderByAggregateInput = { + percent?: SortOrder + percentAux?: SortOrder } export type StringWithAggregatesFilter<$PrismaModel = never> = { @@ -28324,14 +47216,7 @@ export namespace Prisma { _max?: NestedStringNullableFilter<$PrismaModel> } - export type EnumAdminRoleFilter<$PrismaModel = never> = { - equals?: $Enums.AdminRole | EnumAdminRoleFieldRefInput<$PrismaModel> - in?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> - notIn?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> - not?: NestedEnumAdminRoleFilter<$PrismaModel> | $Enums.AdminRole - } - - export type DecimalNullableFilter<$PrismaModel = never> = { + export type DecimalNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> | null in?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null notIn?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null @@ -28339,7 +47224,30 @@ export namespace Prisma { lte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> gt?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> gte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> - not?: NestedDecimalNullableFilter<$PrismaModel> | Decimal | DecimalJsLike | number | string | null + not?: NestedDecimalNullableWithAggregatesFilter<$PrismaModel> | Decimal | DecimalJsLike | number | string | null + _count?: NestedIntNullableFilter<$PrismaModel> + _avg?: NestedDecimalNullableFilter<$PrismaModel> + _sum?: NestedDecimalNullableFilter<$PrismaModel> + _min?: NestedDecimalNullableFilter<$PrismaModel> + _max?: NestedDecimalNullableFilter<$PrismaModel> + } + + export type EnumAdminRoleFilter<$PrismaModel = never> = { + equals?: $Enums.AdminRole | EnumAdminRoleFieldRefInput<$PrismaModel> + in?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> + not?: NestedEnumAdminRoleFilter<$PrismaModel> | $Enums.AdminRole + } + + export type IntNullableFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> | null + in?: number[] | ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntNullableFilter<$PrismaModel> | number | null } export type BoolFilter<$PrismaModel = never> = { @@ -28358,11 +47266,28 @@ export namespace Prisma { not?: NestedDateTimeFilter<$PrismaModel> | Date | string } + export type UserTypeNullableRelationFilter = { + is?: UserTypeWhereInput | null + isNot?: UserTypeWhereInput | null + } + export type BranchNullableRelationFilter = { is?: BranchWhereInput | null isNot?: BranchWhereInput | null } + export type WorkshopListRelationFilter = { + every?: WorkshopWhereInput + some?: WorkshopWhereInput + none?: WorkshopWhereInput + } + + export type BranchAllocationListRelationFilter = { + every?: BranchAllocationWhereInput + some?: BranchAllocationWhereInput + none?: BranchAllocationWhereInput + } + export type LedgerEntryListRelationFilter = { every?: LedgerEntryWhereInput some?: LedgerEntryWhereInput @@ -28381,6 +47306,32 @@ export namespace Prisma { none?: PreOrderStatusEventWhereInput } + export type SmsMessageListRelationFilter = { + every?: SmsMessageWhereInput + some?: SmsMessageWhereInput + none?: SmsMessageWhereInput + } + + export type NotificationListRelationFilter = { + every?: NotificationWhereInput + some?: NotificationWhereInput + none?: NotificationWhereInput + } + + export type UploadedFileListRelationFilter = { + every?: UploadedFileWhereInput + some?: UploadedFileWhereInput + none?: UploadedFileWhereInput + } + + export type WorkshopOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type BranchAllocationOrderByRelationAggregateInput = { + _count?: SortOrder + } + export type LedgerEntryOrderByRelationAggregateInput = { _count?: SortOrder } @@ -28393,12 +47344,25 @@ export namespace Prisma { _count?: SortOrder } + export type SmsMessageOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type NotificationOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type UploadedFileOrderByRelationAggregateInput = { + _count?: SortOrder + } + export type AdminUserCountOrderByAggregateInput = { id?: SortOrder fullName?: SortOrder mobile?: SortOrder passwordHash?: SortOrder role?: SortOrder + userTypeId?: SortOrder branchId?: SortOrder wagePercent?: SortOrder isActive?: SortOrder @@ -28406,6 +47370,7 @@ export namespace Prisma { } export type AdminUserAvgOrderByAggregateInput = { + userTypeId?: SortOrder wagePercent?: SortOrder } @@ -28415,6 +47380,7 @@ export namespace Prisma { mobile?: SortOrder passwordHash?: SortOrder role?: SortOrder + userTypeId?: SortOrder branchId?: SortOrder wagePercent?: SortOrder isActive?: SortOrder @@ -28427,6 +47393,7 @@ export namespace Prisma { mobile?: SortOrder passwordHash?: SortOrder role?: SortOrder + userTypeId?: SortOrder branchId?: SortOrder wagePercent?: SortOrder isActive?: SortOrder @@ -28434,6 +47401,7 @@ export namespace Prisma { } export type AdminUserSumOrderByAggregateInput = { + userTypeId?: SortOrder wagePercent?: SortOrder } @@ -28447,20 +47415,20 @@ export namespace Prisma { _max?: NestedEnumAdminRoleFilter<$PrismaModel> } - export type DecimalNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> | null - in?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null - notIn?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null - lt?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> - lte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> - gt?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> - gte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> - not?: NestedDecimalNullableWithAggregatesFilter<$PrismaModel> | Decimal | DecimalJsLike | number | string | null + export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> | null + in?: number[] | ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null _count?: NestedIntNullableFilter<$PrismaModel> - _avg?: NestedDecimalNullableFilter<$PrismaModel> - _sum?: NestedDecimalNullableFilter<$PrismaModel> - _min?: NestedDecimalNullableFilter<$PrismaModel> - _max?: NestedDecimalNullableFilter<$PrismaModel> + _avg?: NestedFloatNullableFilter<$PrismaModel> + _sum?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedIntNullableFilter<$PrismaModel> + _max?: NestedIntNullableFilter<$PrismaModel> } export type BoolWithAggregatesFilter<$PrismaModel = never> = { @@ -28485,6 +47453,13 @@ export namespace Prisma { _max?: NestedDateTimeFilter<$PrismaModel> } + export type EnumCustomerKindFilter<$PrismaModel = never> = { + equals?: $Enums.CustomerKind | EnumCustomerKindFieldRefInput<$PrismaModel> + in?: $Enums.CustomerKind[] | ListEnumCustomerKindFieldRefInput<$PrismaModel> + notIn?: $Enums.CustomerKind[] | ListEnumCustomerKindFieldRefInput<$PrismaModel> + not?: NestedEnumCustomerKindFilter<$PrismaModel> | $Enums.CustomerKind + } + export type DecimalFilter<$PrismaModel = never> = { equals?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> in?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> @@ -28513,6 +47488,11 @@ export namespace Prisma { isNot?: AdminUserWhereInput | null } + export type UploadedFileNullableRelationFilter = { + is?: UploadedFileWhereInput | null + isNot?: UploadedFileWhereInput | null + } + export type OrderListRelationFilter = { every?: OrderWhereInput some?: OrderWhereInput @@ -28525,6 +47505,30 @@ export namespace Prisma { none?: WalletBonusWhereInput } + export type CommentListRelationFilter = { + every?: CommentWhereInput + some?: CommentWhereInput + none?: CommentWhereInput + } + + export type PromotionListRelationFilter = { + every?: PromotionWhereInput + some?: PromotionWhereInput + none?: PromotionWhereInput + } + + export type NotificationRecipientListRelationFilter = { + every?: NotificationRecipientWhereInput + some?: NotificationRecipientWhereInput + none?: NotificationRecipientWhereInput + } + + export type CustomerActivityLogListRelationFilter = { + every?: CustomerActivityLogWhereInput + some?: CustomerActivityLogWhereInput + none?: CustomerActivityLogWhereInput + } + export type OrderOrderByRelationAggregateInput = { _count?: SortOrder } @@ -28533,6 +47537,22 @@ export namespace Prisma { _count?: SortOrder } + export type CommentOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type PromotionOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type NotificationRecipientOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type CustomerActivityLogOrderByRelationAggregateInput = { + _count?: SortOrder + } + export type CustomerCountOrderByAggregateInput = { id?: SortOrder fullName?: SortOrder @@ -28540,6 +47560,13 @@ export namespace Prisma { nationalCode?: SortOrder passwordHash?: SortOrder cityId?: SortOrder + kind?: SortOrder + phone?: SortOrder + address?: SortOrder + storeName?: SortOrder + pasazhName?: SortOrder + zone?: SortOrder + memberCode?: SortOrder referredByAgentId?: SortOrder goldCreditLimitGrams?: SortOrder goldDebtGrams?: SortOrder @@ -28548,7 +47575,10 @@ export namespace Prisma { nationalIdImageUrl?: SortOrder businessLicenseUrl?: SortOrder shopImageUrl?: SortOrder + avatarFileId?: SortOrder + canPlaceOrders?: SortOrder isActive?: SortOrder + isArchived?: SortOrder createdAt?: SortOrder updatedAt?: SortOrder } @@ -28566,6 +47596,13 @@ export namespace Prisma { nationalCode?: SortOrder passwordHash?: SortOrder cityId?: SortOrder + kind?: SortOrder + phone?: SortOrder + address?: SortOrder + storeName?: SortOrder + pasazhName?: SortOrder + zone?: SortOrder + memberCode?: SortOrder referredByAgentId?: SortOrder goldCreditLimitGrams?: SortOrder goldDebtGrams?: SortOrder @@ -28574,7 +47611,10 @@ export namespace Prisma { nationalIdImageUrl?: SortOrder businessLicenseUrl?: SortOrder shopImageUrl?: SortOrder + avatarFileId?: SortOrder + canPlaceOrders?: SortOrder isActive?: SortOrder + isArchived?: SortOrder createdAt?: SortOrder updatedAt?: SortOrder } @@ -28586,6 +47626,13 @@ export namespace Prisma { nationalCode?: SortOrder passwordHash?: SortOrder cityId?: SortOrder + kind?: SortOrder + phone?: SortOrder + address?: SortOrder + storeName?: SortOrder + pasazhName?: SortOrder + zone?: SortOrder + memberCode?: SortOrder referredByAgentId?: SortOrder goldCreditLimitGrams?: SortOrder goldDebtGrams?: SortOrder @@ -28594,7 +47641,10 @@ export namespace Prisma { nationalIdImageUrl?: SortOrder businessLicenseUrl?: SortOrder shopImageUrl?: SortOrder + avatarFileId?: SortOrder + canPlaceOrders?: SortOrder isActive?: SortOrder + isArchived?: SortOrder createdAt?: SortOrder updatedAt?: SortOrder } @@ -28605,6 +47655,16 @@ export namespace Prisma { fiatDebtRial?: SortOrder } + export type EnumCustomerKindWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.CustomerKind | EnumCustomerKindFieldRefInput<$PrismaModel> + in?: $Enums.CustomerKind[] | ListEnumCustomerKindFieldRefInput<$PrismaModel> + notIn?: $Enums.CustomerKind[] | ListEnumCustomerKindFieldRefInput<$PrismaModel> + not?: NestedEnumCustomerKindWithAggregatesFilter<$PrismaModel> | $Enums.CustomerKind + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumCustomerKindFilter<$PrismaModel> + _max?: NestedEnumCustomerKindFilter<$PrismaModel> + } + export type DecimalWithAggregatesFilter<$PrismaModel = never> = { equals?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> in?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> @@ -28673,39 +47733,68 @@ export namespace Prisma { export type BranchCountOrderByAggregateInput = { id?: SortOrder name?: SortOrder + address?: SortOrder + phone?: SortOrder + isActive?: SortOrder cityId?: SortOrder } export type BranchMaxOrderByAggregateInput = { id?: SortOrder name?: SortOrder + address?: SortOrder + phone?: SortOrder + isActive?: SortOrder cityId?: SortOrder } export type BranchMinOrderByAggregateInput = { id?: SortOrder name?: SortOrder + address?: SortOrder + phone?: SortOrder + isActive?: SortOrder cityId?: SortOrder } export type WorkshopCountOrderByAggregateInput = { id?: SortOrder name?: SortOrder + address?: SortOrder + phone?: SortOrder + supervisorId?: SortOrder isActive?: SortOrder } export type WorkshopMaxOrderByAggregateInput = { id?: SortOrder name?: SortOrder + address?: SortOrder + phone?: SortOrder + supervisorId?: SortOrder isActive?: SortOrder } export type WorkshopMinOrderByAggregateInput = { id?: SortOrder name?: SortOrder + address?: SortOrder + phone?: SortOrder + supervisorId?: SortOrder isActive?: SortOrder } + export type IntFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> + in?: number[] | ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntFilter<$PrismaModel> | number + } + export type CategoryNullableRelationFilter = { is?: CategoryWhereInput | null isNot?: CategoryWhereInput | null @@ -28734,21 +47823,60 @@ export namespace Prisma { export type CategoryCountOrderByAggregateInput = { id?: SortOrder title?: SortOrder + type?: SortOrder + imageUrl?: SortOrder + iconUrl?: SortOrder + metaTag?: SortOrder + description?: SortOrder parentId?: SortOrder } + export type CategoryAvgOrderByAggregateInput = { + type?: SortOrder + } + export type CategoryMaxOrderByAggregateInput = { id?: SortOrder title?: SortOrder + type?: SortOrder + imageUrl?: SortOrder + iconUrl?: SortOrder + metaTag?: SortOrder + description?: SortOrder parentId?: SortOrder } export type CategoryMinOrderByAggregateInput = { id?: SortOrder title?: SortOrder + type?: SortOrder + imageUrl?: SortOrder + iconUrl?: SortOrder + metaTag?: SortOrder + description?: SortOrder parentId?: SortOrder } + export type CategorySumOrderByAggregateInput = { + type?: SortOrder + } + + export type IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> + in?: number[] | ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: NestedIntFilter<$PrismaModel> + _avg?: NestedFloatFilter<$PrismaModel> + _sum?: NestedIntFilter<$PrismaModel> + _min?: NestedIntFilter<$PrismaModel> + _max?: NestedIntFilter<$PrismaModel> + } + export type BrandCountOrderByAggregateInput = { id?: SortOrder title?: SortOrder @@ -28842,6 +47970,12 @@ export namespace Prisma { none?: ProductImageWhereInput } + export type BranchAllocationItemListRelationFilter = { + every?: BranchAllocationItemWhereInput + some?: BranchAllocationItemWhereInput + none?: BranchAllocationItemWhereInput + } + export type ProductVariantOrderByRelationAggregateInput = { _count?: SortOrder } @@ -28850,22 +47984,34 @@ export namespace Prisma { _count?: SortOrder } + export type BranchAllocationItemOrderByRelationAggregateInput = { + _count?: SortOrder + } + export type ProductCountOrderByAggregateInput = { id?: SortOrder title?: SortOrder description?: SortOrder categoryId?: SortOrder brandId?: SortOrder + productCode?: SortOrder + showType?: SortOrder isActive?: SortOrder createdAt?: SortOrder } + export type ProductAvgOrderByAggregateInput = { + showType?: SortOrder + } + export type ProductMaxOrderByAggregateInput = { id?: SortOrder title?: SortOrder description?: SortOrder categoryId?: SortOrder brandId?: SortOrder + productCode?: SortOrder + showType?: SortOrder isActive?: SortOrder createdAt?: SortOrder } @@ -28876,19 +48022,14 @@ export namespace Prisma { description?: SortOrder categoryId?: SortOrder brandId?: SortOrder + productCode?: SortOrder + showType?: SortOrder isActive?: SortOrder createdAt?: SortOrder } - export type IntFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] | ListIntFieldRefInput<$PrismaModel> - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntFilter<$PrismaModel> | number + export type ProductSumOrderByAggregateInput = { + showType?: SortOrder } export type ProductImageCountOrderByAggregateInput = { @@ -28920,22 +48061,6 @@ export namespace Prisma { sortOrder?: SortOrder } - export type IntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> - in?: number[] | ListIntFieldRefInput<$PrismaModel> - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: NestedIntFilter<$PrismaModel> - _avg?: NestedFloatFilter<$PrismaModel> - _sum?: NestedIntFilter<$PrismaModel> - _min?: NestedIntFilter<$PrismaModel> - _max?: NestedIntFilter<$PrismaModel> - } - export type OrderItemListRelationFilter = { every?: OrderItemWhereInput some?: OrderItemWhereInput @@ -28953,12 +48078,15 @@ export namespace Prisma { sku?: SortOrder rashWeightGrams?: SortOrder defaultWagePercent?: SortOrder + qty?: SortOrder + isPreOrder?: SortOrder isActive?: SortOrder } export type ProductVariantAvgOrderByAggregateInput = { rashWeightGrams?: SortOrder defaultWagePercent?: SortOrder + qty?: SortOrder } export type ProductVariantMaxOrderByAggregateInput = { @@ -28968,6 +48096,8 @@ export namespace Prisma { sku?: SortOrder rashWeightGrams?: SortOrder defaultWagePercent?: SortOrder + qty?: SortOrder + isPreOrder?: SortOrder isActive?: SortOrder } @@ -28978,12 +48108,22 @@ export namespace Prisma { sku?: SortOrder rashWeightGrams?: SortOrder defaultWagePercent?: SortOrder + qty?: SortOrder + isPreOrder?: SortOrder isActive?: SortOrder } export type ProductVariantSumOrderByAggregateInput = { rashWeightGrams?: SortOrder defaultWagePercent?: SortOrder + qty?: SortOrder + } + + export type EnumOrderChannelFilter<$PrismaModel = never> = { + equals?: $Enums.OrderChannel | EnumOrderChannelFieldRefInput<$PrismaModel> + in?: $Enums.OrderChannel[] | ListEnumOrderChannelFieldRefInput<$PrismaModel> + notIn?: $Enums.OrderChannel[] | ListEnumOrderChannelFieldRefInput<$PrismaModel> + not?: NestedEnumOrderChannelFilter<$PrismaModel> | $Enums.OrderChannel } export type EnumOrderStatusFilter<$PrismaModel = never> = { @@ -29014,6 +48154,7 @@ export namespace Prisma { orderNumber?: SortOrder customerId?: SortOrder branchId?: SortOrder + channel?: SortOrder status?: SortOrder totalGoldWeightGrams?: SortOrder wageWeightGrams?: SortOrder @@ -29035,6 +48176,7 @@ export namespace Prisma { orderNumber?: SortOrder customerId?: SortOrder branchId?: SortOrder + channel?: SortOrder status?: SortOrder totalGoldWeightGrams?: SortOrder wageWeightGrams?: SortOrder @@ -29050,6 +48192,7 @@ export namespace Prisma { orderNumber?: SortOrder customerId?: SortOrder branchId?: SortOrder + channel?: SortOrder status?: SortOrder totalGoldWeightGrams?: SortOrder wageWeightGrams?: SortOrder @@ -29066,6 +48209,16 @@ export namespace Prisma { flatRialCharge?: SortOrder } + export type EnumOrderChannelWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.OrderChannel | EnumOrderChannelFieldRefInput<$PrismaModel> + in?: $Enums.OrderChannel[] | ListEnumOrderChannelFieldRefInput<$PrismaModel> + notIn?: $Enums.OrderChannel[] | ListEnumOrderChannelFieldRefInput<$PrismaModel> + not?: NestedEnumOrderChannelWithAggregatesFilter<$PrismaModel> | $Enums.OrderChannel + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumOrderChannelFilter<$PrismaModel> + _max?: NestedEnumOrderChannelFilter<$PrismaModel> + } + export type EnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.OrderStatus | EnumOrderStatusFieldRefInput<$PrismaModel> in?: $Enums.OrderStatus[] | ListEnumOrderStatusFieldRefInput<$PrismaModel> @@ -29393,17 +48546,6 @@ export namespace Prisma { not?: NestedEnumLedgerSourceTypeFilter<$PrismaModel> | $Enums.LedgerSourceType } - export type IntNullableFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> | null - in?: number[] | ListIntFieldRefInput<$PrismaModel> | null - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntNullableFilter<$PrismaModel> | number | null - } - export type LedgerEntryCountOrderByAggregateInput = { id?: SortOrder customerId?: SortOrder @@ -29417,6 +48559,14 @@ export namespace Prisma { confirmed?: SortOrder confirmedAt?: SortOrder postedByAdminUserId?: SortOrder + labName?: SortOrder + hallmark?: SortOrder + accountName?: SortOrder + bankName?: SortOrder + transferTo?: SortOrder + originalValue?: SortOrder + priceRial?: SortOrder + receivedAt?: SortOrder note?: SortOrder createdAt?: SortOrder } @@ -29425,6 +48575,8 @@ export namespace Prisma { amount?: SortOrder karatPerMille?: SortOrder pricePerGramRialAtEntry?: SortOrder + originalValue?: SortOrder + priceRial?: SortOrder } export type LedgerEntryMaxOrderByAggregateInput = { @@ -29440,6 +48592,14 @@ export namespace Prisma { confirmed?: SortOrder confirmedAt?: SortOrder postedByAdminUserId?: SortOrder + labName?: SortOrder + hallmark?: SortOrder + accountName?: SortOrder + bankName?: SortOrder + transferTo?: SortOrder + originalValue?: SortOrder + priceRial?: SortOrder + receivedAt?: SortOrder note?: SortOrder createdAt?: SortOrder } @@ -29457,6 +48617,14 @@ export namespace Prisma { confirmed?: SortOrder confirmedAt?: SortOrder postedByAdminUserId?: SortOrder + labName?: SortOrder + hallmark?: SortOrder + accountName?: SortOrder + bankName?: SortOrder + transferTo?: SortOrder + originalValue?: SortOrder + priceRial?: SortOrder + receivedAt?: SortOrder note?: SortOrder createdAt?: SortOrder } @@ -29465,6 +48633,8 @@ export namespace Prisma { amount?: SortOrder karatPerMille?: SortOrder pricePerGramRialAtEntry?: SortOrder + originalValue?: SortOrder + priceRial?: SortOrder } export type EnumLedgerCurrencyWithAggregatesFilter<$PrismaModel = never> = { @@ -29497,22 +48667,6 @@ export namespace Prisma { _max?: NestedEnumLedgerSourceTypeFilter<$PrismaModel> } - export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> | null - in?: number[] | ListIntFieldRefInput<$PrismaModel> | null - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null - _count?: NestedIntNullableFilter<$PrismaModel> - _avg?: NestedFloatNullableFilter<$PrismaModel> - _sum?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedIntNullableFilter<$PrismaModel> - _max?: NestedIntNullableFilter<$PrismaModel> - } - export type GoldPriceQuoteCountOrderByAggregateInput = { id?: SortOrder karatPerMille?: SortOrder @@ -29588,6 +48742,561 @@ export namespace Prisma { goldGrams?: SortOrder } + export type PermissionListRelationFilter = { + every?: PermissionWhereInput + some?: PermissionWhereInput + none?: PermissionWhereInput + } + + export type PermissionOrderByRelationAggregateInput = { + _count?: SortOrder + } + + export type UserTypeCountOrderByAggregateInput = { + id?: SortOrder + title?: SortOrder + isActive?: SortOrder + createdAt?: SortOrder + } + + export type UserTypeAvgOrderByAggregateInput = { + id?: SortOrder + } + + export type UserTypeMaxOrderByAggregateInput = { + id?: SortOrder + title?: SortOrder + isActive?: SortOrder + createdAt?: SortOrder + } + + export type UserTypeMinOrderByAggregateInput = { + id?: SortOrder + title?: SortOrder + isActive?: SortOrder + createdAt?: SortOrder + } + + export type UserTypeSumOrderByAggregateInput = { + id?: SortOrder + } + + export type UserTypeRelationFilter = { + is?: UserTypeWhereInput + isNot?: UserTypeWhereInput + } + + export type PermissionRidUserTypeIdCompoundUniqueInput = { + rid: string + userTypeId: number + } + + export type PermissionCountOrderByAggregateInput = { + rid?: SortOrder + userTypeId?: SortOrder + } + + export type PermissionAvgOrderByAggregateInput = { + userTypeId?: SortOrder + } + + export type PermissionMaxOrderByAggregateInput = { + rid?: SortOrder + userTypeId?: SortOrder + } + + export type PermissionMinOrderByAggregateInput = { + rid?: SortOrder + userTypeId?: SortOrder + } + + export type PermissionSumOrderByAggregateInput = { + userTypeId?: SortOrder + } + + export type EnumCommentStatusFilter<$PrismaModel = never> = { + equals?: $Enums.CommentStatus | EnumCommentStatusFieldRefInput<$PrismaModel> + in?: $Enums.CommentStatus[] | ListEnumCommentStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.CommentStatus[] | ListEnumCommentStatusFieldRefInput<$PrismaModel> + not?: NestedEnumCommentStatusFilter<$PrismaModel> | $Enums.CommentStatus + } + + export type CommentNullableRelationFilter = { + is?: CommentWhereInput | null + isNot?: CommentWhereInput | null + } + + export type CommentCountOrderByAggregateInput = { + id?: SortOrder + productId?: SortOrder + customerId?: SortOrder + body?: SortOrder + status?: SortOrder + replyToId?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type CommentMaxOrderByAggregateInput = { + id?: SortOrder + productId?: SortOrder + customerId?: SortOrder + body?: SortOrder + status?: SortOrder + replyToId?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type CommentMinOrderByAggregateInput = { + id?: SortOrder + productId?: SortOrder + customerId?: SortOrder + body?: SortOrder + status?: SortOrder + replyToId?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type EnumCommentStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.CommentStatus | EnumCommentStatusFieldRefInput<$PrismaModel> + in?: $Enums.CommentStatus[] | ListEnumCommentStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.CommentStatus[] | ListEnumCommentStatusFieldRefInput<$PrismaModel> + not?: NestedEnumCommentStatusWithAggregatesFilter<$PrismaModel> | $Enums.CommentStatus + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumCommentStatusFilter<$PrismaModel> + _max?: NestedEnumCommentStatusFilter<$PrismaModel> + } + + export type SettingCountOrderByAggregateInput = { + key?: SortOrder + value?: SortOrder + updatedAt?: SortOrder + } + + export type SettingMaxOrderByAggregateInput = { + key?: SortOrder + updatedAt?: SortOrder + } + + export type SettingMinOrderByAggregateInput = { + key?: SortOrder + updatedAt?: SortOrder + } + + export type EnumPromotionScopeFilter<$PrismaModel = never> = { + equals?: $Enums.PromotionScope | EnumPromotionScopeFieldRefInput<$PrismaModel> + in?: $Enums.PromotionScope[] | ListEnumPromotionScopeFieldRefInput<$PrismaModel> + notIn?: $Enums.PromotionScope[] | ListEnumPromotionScopeFieldRefInput<$PrismaModel> + not?: NestedEnumPromotionScopeFilter<$PrismaModel> | $Enums.PromotionScope + } + + export type EnumPromotionUsageFilter<$PrismaModel = never> = { + equals?: $Enums.PromotionUsage | EnumPromotionUsageFieldRefInput<$PrismaModel> + in?: $Enums.PromotionUsage[] | ListEnumPromotionUsageFieldRefInput<$PrismaModel> + notIn?: $Enums.PromotionUsage[] | ListEnumPromotionUsageFieldRefInput<$PrismaModel> + not?: NestedEnumPromotionUsageFilter<$PrismaModel> | $Enums.PromotionUsage + } + + export type ProductNullableRelationFilter = { + is?: ProductWhereInput | null + isNot?: ProductWhereInput | null + } + + export type CustomerNullableRelationFilter = { + is?: CustomerWhereInput | null + isNot?: CustomerWhereInput | null + } + + export type PromotionCountOrderByAggregateInput = { + id?: SortOrder + title?: SortOrder + description?: SortOrder + scope?: SortOrder + usage?: SortOrder + discountPercent?: SortOrder + isActive?: SortOrder + platform?: SortOrder + startsAt?: SortOrder + endsAt?: SortOrder + productId?: SortOrder + categoryId?: SortOrder + customerId?: SortOrder + brandId?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type PromotionAvgOrderByAggregateInput = { + discountPercent?: SortOrder + platform?: SortOrder + } + + export type PromotionMaxOrderByAggregateInput = { + id?: SortOrder + title?: SortOrder + description?: SortOrder + scope?: SortOrder + usage?: SortOrder + discountPercent?: SortOrder + isActive?: SortOrder + platform?: SortOrder + startsAt?: SortOrder + endsAt?: SortOrder + productId?: SortOrder + categoryId?: SortOrder + customerId?: SortOrder + brandId?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type PromotionMinOrderByAggregateInput = { + id?: SortOrder + title?: SortOrder + description?: SortOrder + scope?: SortOrder + usage?: SortOrder + discountPercent?: SortOrder + isActive?: SortOrder + platform?: SortOrder + startsAt?: SortOrder + endsAt?: SortOrder + productId?: SortOrder + categoryId?: SortOrder + customerId?: SortOrder + brandId?: SortOrder + createdAt?: SortOrder + updatedAt?: SortOrder + } + + export type PromotionSumOrderByAggregateInput = { + discountPercent?: SortOrder + platform?: SortOrder + } + + export type EnumPromotionScopeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.PromotionScope | EnumPromotionScopeFieldRefInput<$PrismaModel> + in?: $Enums.PromotionScope[] | ListEnumPromotionScopeFieldRefInput<$PrismaModel> + notIn?: $Enums.PromotionScope[] | ListEnumPromotionScopeFieldRefInput<$PrismaModel> + not?: NestedEnumPromotionScopeWithAggregatesFilter<$PrismaModel> | $Enums.PromotionScope + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumPromotionScopeFilter<$PrismaModel> + _max?: NestedEnumPromotionScopeFilter<$PrismaModel> + } + + export type EnumPromotionUsageWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.PromotionUsage | EnumPromotionUsageFieldRefInput<$PrismaModel> + in?: $Enums.PromotionUsage[] | ListEnumPromotionUsageFieldRefInput<$PrismaModel> + notIn?: $Enums.PromotionUsage[] | ListEnumPromotionUsageFieldRefInput<$PrismaModel> + not?: NestedEnumPromotionUsageWithAggregatesFilter<$PrismaModel> | $Enums.PromotionUsage + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumPromotionUsageFilter<$PrismaModel> + _max?: NestedEnumPromotionUsageFilter<$PrismaModel> + } + + export type PromotionExclusionTypeItemIdCompoundUniqueInput = { + type: number + itemId: string + } + + export type PromotionExclusionCountOrderByAggregateInput = { + id?: SortOrder + type?: SortOrder + itemId?: SortOrder + createdAt?: SortOrder + } + + export type PromotionExclusionAvgOrderByAggregateInput = { + type?: SortOrder + } + + export type PromotionExclusionMaxOrderByAggregateInput = { + id?: SortOrder + type?: SortOrder + itemId?: SortOrder + createdAt?: SortOrder + } + + export type PromotionExclusionMinOrderByAggregateInput = { + id?: SortOrder + type?: SortOrder + itemId?: SortOrder + createdAt?: SortOrder + } + + export type PromotionExclusionSumOrderByAggregateInput = { + type?: SortOrder + } + + export type BranchRelationFilter = { + is?: BranchWhereInput + isNot?: BranchWhereInput + } + + export type BranchAllocationCountOrderByAggregateInput = { + id?: SortOrder + branchId?: SortOrder + allocatorAdminUserId?: SortOrder + note?: SortOrder + createdAt?: SortOrder + } + + export type BranchAllocationMaxOrderByAggregateInput = { + id?: SortOrder + branchId?: SortOrder + allocatorAdminUserId?: SortOrder + note?: SortOrder + createdAt?: SortOrder + } + + export type BranchAllocationMinOrderByAggregateInput = { + id?: SortOrder + branchId?: SortOrder + allocatorAdminUserId?: SortOrder + note?: SortOrder + createdAt?: SortOrder + } + + export type BranchAllocationRelationFilter = { + is?: BranchAllocationWhereInput + isNot?: BranchAllocationWhereInput + } + + export type BranchAllocationItemAllocationIdProductIdCompoundUniqueInput = { + allocationId: string + productId: string + } + + export type BranchAllocationItemCountOrderByAggregateInput = { + id?: SortOrder + allocationId?: SortOrder + productId?: SortOrder + weightGrams?: SortOrder + } + + export type BranchAllocationItemAvgOrderByAggregateInput = { + weightGrams?: SortOrder + } + + export type BranchAllocationItemMaxOrderByAggregateInput = { + id?: SortOrder + allocationId?: SortOrder + productId?: SortOrder + weightGrams?: SortOrder + } + + export type BranchAllocationItemMinOrderByAggregateInput = { + id?: SortOrder + allocationId?: SortOrder + productId?: SortOrder + weightGrams?: SortOrder + } + + export type BranchAllocationItemSumOrderByAggregateInput = { + weightGrams?: SortOrder + } + + export type EnumMessageAudienceFilter<$PrismaModel = never> = { + equals?: $Enums.MessageAudience | EnumMessageAudienceFieldRefInput<$PrismaModel> + in?: $Enums.MessageAudience[] | ListEnumMessageAudienceFieldRefInput<$PrismaModel> + notIn?: $Enums.MessageAudience[] | ListEnumMessageAudienceFieldRefInput<$PrismaModel> + not?: NestedEnumMessageAudienceFilter<$PrismaModel> | $Enums.MessageAudience + } + + export type SmsMessageCountOrderByAggregateInput = { + id?: SortOrder + audience?: SortOrder + recipients?: SortOrder + body?: SortOrder + sentCount?: SortOrder + sentByAdminUserId?: SortOrder + createdAt?: SortOrder + } + + export type SmsMessageAvgOrderByAggregateInput = { + sentCount?: SortOrder + } + + export type SmsMessageMaxOrderByAggregateInput = { + id?: SortOrder + audience?: SortOrder + recipients?: SortOrder + body?: SortOrder + sentCount?: SortOrder + sentByAdminUserId?: SortOrder + createdAt?: SortOrder + } + + export type SmsMessageMinOrderByAggregateInput = { + id?: SortOrder + audience?: SortOrder + recipients?: SortOrder + body?: SortOrder + sentCount?: SortOrder + sentByAdminUserId?: SortOrder + createdAt?: SortOrder + } + + export type SmsMessageSumOrderByAggregateInput = { + sentCount?: SortOrder + } + + export type EnumMessageAudienceWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.MessageAudience | EnumMessageAudienceFieldRefInput<$PrismaModel> + in?: $Enums.MessageAudience[] | ListEnumMessageAudienceFieldRefInput<$PrismaModel> + notIn?: $Enums.MessageAudience[] | ListEnumMessageAudienceFieldRefInput<$PrismaModel> + not?: NestedEnumMessageAudienceWithAggregatesFilter<$PrismaModel> | $Enums.MessageAudience + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumMessageAudienceFilter<$PrismaModel> + _max?: NestedEnumMessageAudienceFilter<$PrismaModel> + } + + export type NotificationCountOrderByAggregateInput = { + id?: SortOrder + title?: SortOrder + body?: SortOrder + audience?: SortOrder + sentByAdminUserId?: SortOrder + createdAt?: SortOrder + } + + export type NotificationMaxOrderByAggregateInput = { + id?: SortOrder + title?: SortOrder + body?: SortOrder + audience?: SortOrder + sentByAdminUserId?: SortOrder + createdAt?: SortOrder + } + + export type NotificationMinOrderByAggregateInput = { + id?: SortOrder + title?: SortOrder + body?: SortOrder + audience?: SortOrder + sentByAdminUserId?: SortOrder + createdAt?: SortOrder + } + + export type NotificationRelationFilter = { + is?: NotificationWhereInput + isNot?: NotificationWhereInput + } + + export type NotificationRecipientNotificationIdCustomerIdCompoundUniqueInput = { + notificationId: string + customerId: string + } + + export type NotificationRecipientCountOrderByAggregateInput = { + id?: SortOrder + notificationId?: SortOrder + customerId?: SortOrder + readAt?: SortOrder + } + + export type NotificationRecipientMaxOrderByAggregateInput = { + id?: SortOrder + notificationId?: SortOrder + customerId?: SortOrder + readAt?: SortOrder + } + + export type NotificationRecipientMinOrderByAggregateInput = { + id?: SortOrder + notificationId?: SortOrder + customerId?: SortOrder + readAt?: SortOrder + } + + export type NewsletterSubscriberCountOrderByAggregateInput = { + id?: SortOrder + email?: SortOrder + mobile?: SortOrder + createdAt?: SortOrder + } + + export type NewsletterSubscriberMaxOrderByAggregateInput = { + id?: SortOrder + email?: SortOrder + mobile?: SortOrder + createdAt?: SortOrder + } + + export type NewsletterSubscriberMinOrderByAggregateInput = { + id?: SortOrder + email?: SortOrder + mobile?: SortOrder + createdAt?: SortOrder + } + + export type CustomerActivityLogCountOrderByAggregateInput = { + id?: SortOrder + customerId?: SortOrder + action?: SortOrder + detail?: SortOrder + createdAt?: SortOrder + } + + export type CustomerActivityLogMaxOrderByAggregateInput = { + id?: SortOrder + customerId?: SortOrder + action?: SortOrder + detail?: SortOrder + createdAt?: SortOrder + } + + export type CustomerActivityLogMinOrderByAggregateInput = { + id?: SortOrder + customerId?: SortOrder + action?: SortOrder + detail?: SortOrder + createdAt?: SortOrder + } + + export type UploadedFileCountOrderByAggregateInput = { + id?: SortOrder + url?: SortOrder + originalName?: SortOrder + mimeType?: SortOrder + sizeBytes?: SortOrder + purpose?: SortOrder + uploadedByAdminUserId?: SortOrder + createdAt?: SortOrder + } + + export type UploadedFileAvgOrderByAggregateInput = { + sizeBytes?: SortOrder + } + + export type UploadedFileMaxOrderByAggregateInput = { + id?: SortOrder + url?: SortOrder + originalName?: SortOrder + mimeType?: SortOrder + sizeBytes?: SortOrder + purpose?: SortOrder + uploadedByAdminUserId?: SortOrder + createdAt?: SortOrder + } + + export type UploadedFileMinOrderByAggregateInput = { + id?: SortOrder + url?: SortOrder + originalName?: SortOrder + mimeType?: SortOrder + sizeBytes?: SortOrder + purpose?: SortOrder + uploadedByAdminUserId?: SortOrder + createdAt?: SortOrder + } + + export type UploadedFileSumOrderByAggregateInput = { + sizeBytes?: SortOrder + } + export type CustomerCreateNestedManyWithoutCityInput = { create?: XOR<CustomerCreateWithoutCityInput, CustomerUncheckedCreateWithoutCityInput> | CustomerCreateWithoutCityInput[] | CustomerUncheckedCreateWithoutCityInput[] connectOrCreate?: CustomerCreateOrConnectWithoutCityInput | CustomerCreateOrConnectWithoutCityInput[] @@ -29652,6 +49361,14 @@ export namespace Prisma { set?: string | null } + export type NullableDecimalFieldUpdateOperationsInput = { + set?: Decimal | DecimalJsLike | number | string | null + increment?: Decimal | DecimalJsLike | number | string + decrement?: Decimal | DecimalJsLike | number | string + multiply?: Decimal | DecimalJsLike | number | string + divide?: Decimal | DecimalJsLike | number | string + } + export type CustomerUpdateManyWithoutCityNestedInput = { create?: XOR<CustomerCreateWithoutCityInput, CustomerUncheckedCreateWithoutCityInput> | CustomerCreateWithoutCityInput[] | CustomerUncheckedCreateWithoutCityInput[] connectOrCreate?: CustomerCreateOrConnectWithoutCityInput | CustomerCreateOrConnectWithoutCityInput[] @@ -29764,6 +49481,12 @@ export namespace Prisma { deleteMany?: PreOrderScalarWhereInput | PreOrderScalarWhereInput[] } + export type UserTypeCreateNestedOneWithoutAdminUsersInput = { + create?: XOR<UserTypeCreateWithoutAdminUsersInput, UserTypeUncheckedCreateWithoutAdminUsersInput> + connectOrCreate?: UserTypeCreateOrConnectWithoutAdminUsersInput + connect?: UserTypeWhereUniqueInput + } + export type BranchCreateNestedOneWithoutAdminUsersInput = { create?: XOR<BranchCreateWithoutAdminUsersInput, BranchUncheckedCreateWithoutAdminUsersInput> connectOrCreate?: BranchCreateOrConnectWithoutAdminUsersInput @@ -29777,6 +49500,20 @@ export namespace Prisma { connect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] } + export type WorkshopCreateNestedManyWithoutSupervisorInput = { + create?: XOR<WorkshopCreateWithoutSupervisorInput, WorkshopUncheckedCreateWithoutSupervisorInput> | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] + connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] + createMany?: WorkshopCreateManySupervisorInputEnvelope + connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + } + + export type BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput = { + create?: XOR<BranchAllocationCreateWithoutAllocatorAdminUserInput, BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput> | BranchAllocationCreateWithoutAllocatorAdminUserInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput[] + createMany?: BranchAllocationCreateManyAllocatorAdminUserInputEnvelope + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + } + export type LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput = { create?: XOR<LedgerEntryCreateWithoutPostedByAdminUserInput, LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput> | LedgerEntryCreateWithoutPostedByAdminUserInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput[] connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput | LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput[] @@ -29798,6 +49535,27 @@ export namespace Prisma { connect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] } + export type SmsMessageCreateNestedManyWithoutSentByAdminUserInput = { + create?: XOR<SmsMessageCreateWithoutSentByAdminUserInput, SmsMessageUncheckedCreateWithoutSentByAdminUserInput> | SmsMessageCreateWithoutSentByAdminUserInput[] | SmsMessageUncheckedCreateWithoutSentByAdminUserInput[] + connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminUserInput | SmsMessageCreateOrConnectWithoutSentByAdminUserInput[] + createMany?: SmsMessageCreateManySentByAdminUserInputEnvelope + connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + } + + export type NotificationCreateNestedManyWithoutSentByAdminUserInput = { + create?: XOR<NotificationCreateWithoutSentByAdminUserInput, NotificationUncheckedCreateWithoutSentByAdminUserInput> | NotificationCreateWithoutSentByAdminUserInput[] | NotificationUncheckedCreateWithoutSentByAdminUserInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminUserInput | NotificationCreateOrConnectWithoutSentByAdminUserInput[] + createMany?: NotificationCreateManySentByAdminUserInputEnvelope + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + } + + export type UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput = { + create?: XOR<UploadedFileCreateWithoutUploadedByAdminUserInput, UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput> | UploadedFileCreateWithoutUploadedByAdminUserInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput[] + connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput | UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput[] + createMany?: UploadedFileCreateManyUploadedByAdminUserInputEnvelope + connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + } + export type CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput = { create?: XOR<CustomerCreateWithoutReferredByAgentInput, CustomerUncheckedCreateWithoutReferredByAgentInput> | CustomerCreateWithoutReferredByAgentInput[] | CustomerUncheckedCreateWithoutReferredByAgentInput[] connectOrCreate?: CustomerCreateOrConnectWithoutReferredByAgentInput | CustomerCreateOrConnectWithoutReferredByAgentInput[] @@ -29805,6 +49563,20 @@ export namespace Prisma { connect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] } + export type WorkshopUncheckedCreateNestedManyWithoutSupervisorInput = { + create?: XOR<WorkshopCreateWithoutSupervisorInput, WorkshopUncheckedCreateWithoutSupervisorInput> | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] + connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] + createMany?: WorkshopCreateManySupervisorInputEnvelope + connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + } + + export type BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput = { + create?: XOR<BranchAllocationCreateWithoutAllocatorAdminUserInput, BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput> | BranchAllocationCreateWithoutAllocatorAdminUserInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput[] + createMany?: BranchAllocationCreateManyAllocatorAdminUserInputEnvelope + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + } + export type LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput = { create?: XOR<LedgerEntryCreateWithoutPostedByAdminUserInput, LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput> | LedgerEntryCreateWithoutPostedByAdminUserInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput[] connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput | LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput[] @@ -29826,16 +49598,29 @@ export namespace Prisma { connect?: PreOrderStatusEventWhereUniqueInput | PreOrderStatusEventWhereUniqueInput[] } - export type EnumAdminRoleFieldUpdateOperationsInput = { - set?: $Enums.AdminRole + export type SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput = { + create?: XOR<SmsMessageCreateWithoutSentByAdminUserInput, SmsMessageUncheckedCreateWithoutSentByAdminUserInput> | SmsMessageCreateWithoutSentByAdminUserInput[] | SmsMessageUncheckedCreateWithoutSentByAdminUserInput[] + connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminUserInput | SmsMessageCreateOrConnectWithoutSentByAdminUserInput[] + createMany?: SmsMessageCreateManySentByAdminUserInputEnvelope + connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] } - export type NullableDecimalFieldUpdateOperationsInput = { - set?: Decimal | DecimalJsLike | number | string | null - increment?: Decimal | DecimalJsLike | number | string - decrement?: Decimal | DecimalJsLike | number | string - multiply?: Decimal | DecimalJsLike | number | string - divide?: Decimal | DecimalJsLike | number | string + export type NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput = { + create?: XOR<NotificationCreateWithoutSentByAdminUserInput, NotificationUncheckedCreateWithoutSentByAdminUserInput> | NotificationCreateWithoutSentByAdminUserInput[] | NotificationUncheckedCreateWithoutSentByAdminUserInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminUserInput | NotificationCreateOrConnectWithoutSentByAdminUserInput[] + createMany?: NotificationCreateManySentByAdminUserInputEnvelope + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + } + + export type UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput = { + create?: XOR<UploadedFileCreateWithoutUploadedByAdminUserInput, UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput> | UploadedFileCreateWithoutUploadedByAdminUserInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput[] + connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput | UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput[] + createMany?: UploadedFileCreateManyUploadedByAdminUserInputEnvelope + connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + } + + export type EnumAdminRoleFieldUpdateOperationsInput = { + set?: $Enums.AdminRole } export type BoolFieldUpdateOperationsInput = { @@ -29846,6 +49631,16 @@ export namespace Prisma { set?: Date | string } + export type UserTypeUpdateOneWithoutAdminUsersNestedInput = { + create?: XOR<UserTypeCreateWithoutAdminUsersInput, UserTypeUncheckedCreateWithoutAdminUsersInput> + connectOrCreate?: UserTypeCreateOrConnectWithoutAdminUsersInput + upsert?: UserTypeUpsertWithoutAdminUsersInput + disconnect?: UserTypeWhereInput | boolean + delete?: UserTypeWhereInput | boolean + connect?: UserTypeWhereUniqueInput + update?: XOR<XOR<UserTypeUpdateToOneWithWhereWithoutAdminUsersInput, UserTypeUpdateWithoutAdminUsersInput>, UserTypeUncheckedUpdateWithoutAdminUsersInput> + } + export type BranchUpdateOneWithoutAdminUsersNestedInput = { create?: XOR<BranchCreateWithoutAdminUsersInput, BranchUncheckedCreateWithoutAdminUsersInput> connectOrCreate?: BranchCreateOrConnectWithoutAdminUsersInput @@ -29870,6 +49665,34 @@ export namespace Prisma { deleteMany?: CustomerScalarWhereInput | CustomerScalarWhereInput[] } + export type WorkshopUpdateManyWithoutSupervisorNestedInput = { + create?: XOR<WorkshopCreateWithoutSupervisorInput, WorkshopUncheckedCreateWithoutSupervisorInput> | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] + connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] + upsert?: WorkshopUpsertWithWhereUniqueWithoutSupervisorInput | WorkshopUpsertWithWhereUniqueWithoutSupervisorInput[] + createMany?: WorkshopCreateManySupervisorInputEnvelope + set?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + disconnect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + delete?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + update?: WorkshopUpdateWithWhereUniqueWithoutSupervisorInput | WorkshopUpdateWithWhereUniqueWithoutSupervisorInput[] + updateMany?: WorkshopUpdateManyWithWhereWithoutSupervisorInput | WorkshopUpdateManyWithWhereWithoutSupervisorInput[] + deleteMany?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] + } + + export type BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput = { + create?: XOR<BranchAllocationCreateWithoutAllocatorAdminUserInput, BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput> | BranchAllocationCreateWithoutAllocatorAdminUserInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput[] + upsert?: BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminUserInput | BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminUserInput[] + createMany?: BranchAllocationCreateManyAllocatorAdminUserInputEnvelope + set?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + disconnect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + delete?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + update?: BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminUserInput | BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminUserInput[] + updateMany?: BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminUserInput | BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminUserInput[] + deleteMany?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] + } + export type LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput = { create?: XOR<LedgerEntryCreateWithoutPostedByAdminUserInput, LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput> | LedgerEntryCreateWithoutPostedByAdminUserInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput[] connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput | LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput[] @@ -29912,6 +49735,56 @@ export namespace Prisma { deleteMany?: PreOrderStatusEventScalarWhereInput | PreOrderStatusEventScalarWhereInput[] } + export type SmsMessageUpdateManyWithoutSentByAdminUserNestedInput = { + create?: XOR<SmsMessageCreateWithoutSentByAdminUserInput, SmsMessageUncheckedCreateWithoutSentByAdminUserInput> | SmsMessageCreateWithoutSentByAdminUserInput[] | SmsMessageUncheckedCreateWithoutSentByAdminUserInput[] + connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminUserInput | SmsMessageCreateOrConnectWithoutSentByAdminUserInput[] + upsert?: SmsMessageUpsertWithWhereUniqueWithoutSentByAdminUserInput | SmsMessageUpsertWithWhereUniqueWithoutSentByAdminUserInput[] + createMany?: SmsMessageCreateManySentByAdminUserInputEnvelope + set?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + disconnect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + delete?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + update?: SmsMessageUpdateWithWhereUniqueWithoutSentByAdminUserInput | SmsMessageUpdateWithWhereUniqueWithoutSentByAdminUserInput[] + updateMany?: SmsMessageUpdateManyWithWhereWithoutSentByAdminUserInput | SmsMessageUpdateManyWithWhereWithoutSentByAdminUserInput[] + deleteMany?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] + } + + export type NotificationUpdateManyWithoutSentByAdminUserNestedInput = { + create?: XOR<NotificationCreateWithoutSentByAdminUserInput, NotificationUncheckedCreateWithoutSentByAdminUserInput> | NotificationCreateWithoutSentByAdminUserInput[] | NotificationUncheckedCreateWithoutSentByAdminUserInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminUserInput | NotificationCreateOrConnectWithoutSentByAdminUserInput[] + upsert?: NotificationUpsertWithWhereUniqueWithoutSentByAdminUserInput | NotificationUpsertWithWhereUniqueWithoutSentByAdminUserInput[] + createMany?: NotificationCreateManySentByAdminUserInputEnvelope + set?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + disconnect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + delete?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + update?: NotificationUpdateWithWhereUniqueWithoutSentByAdminUserInput | NotificationUpdateWithWhereUniqueWithoutSentByAdminUserInput[] + updateMany?: NotificationUpdateManyWithWhereWithoutSentByAdminUserInput | NotificationUpdateManyWithWhereWithoutSentByAdminUserInput[] + deleteMany?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + } + + export type UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput = { + create?: XOR<UploadedFileCreateWithoutUploadedByAdminUserInput, UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput> | UploadedFileCreateWithoutUploadedByAdminUserInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput[] + connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput | UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput[] + upsert?: UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminUserInput | UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminUserInput[] + createMany?: UploadedFileCreateManyUploadedByAdminUserInputEnvelope + set?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + disconnect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + delete?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + update?: UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminUserInput | UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminUserInput[] + updateMany?: UploadedFileUpdateManyWithWhereWithoutUploadedByAdminUserInput | UploadedFileUpdateManyWithWhereWithoutUploadedByAdminUserInput[] + deleteMany?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] + } + + export type NullableIntFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number + } + export type CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput = { create?: XOR<CustomerCreateWithoutReferredByAgentInput, CustomerUncheckedCreateWithoutReferredByAgentInput> | CustomerCreateWithoutReferredByAgentInput[] | CustomerUncheckedCreateWithoutReferredByAgentInput[] connectOrCreate?: CustomerCreateOrConnectWithoutReferredByAgentInput | CustomerCreateOrConnectWithoutReferredByAgentInput[] @@ -29926,6 +49799,34 @@ export namespace Prisma { deleteMany?: CustomerScalarWhereInput | CustomerScalarWhereInput[] } + export type WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput = { + create?: XOR<WorkshopCreateWithoutSupervisorInput, WorkshopUncheckedCreateWithoutSupervisorInput> | WorkshopCreateWithoutSupervisorInput[] | WorkshopUncheckedCreateWithoutSupervisorInput[] + connectOrCreate?: WorkshopCreateOrConnectWithoutSupervisorInput | WorkshopCreateOrConnectWithoutSupervisorInput[] + upsert?: WorkshopUpsertWithWhereUniqueWithoutSupervisorInput | WorkshopUpsertWithWhereUniqueWithoutSupervisorInput[] + createMany?: WorkshopCreateManySupervisorInputEnvelope + set?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + disconnect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + delete?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + connect?: WorkshopWhereUniqueInput | WorkshopWhereUniqueInput[] + update?: WorkshopUpdateWithWhereUniqueWithoutSupervisorInput | WorkshopUpdateWithWhereUniqueWithoutSupervisorInput[] + updateMany?: WorkshopUpdateManyWithWhereWithoutSupervisorInput | WorkshopUpdateManyWithWhereWithoutSupervisorInput[] + deleteMany?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] + } + + export type BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput = { + create?: XOR<BranchAllocationCreateWithoutAllocatorAdminUserInput, BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput> | BranchAllocationCreateWithoutAllocatorAdminUserInput[] | BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput | BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput[] + upsert?: BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminUserInput | BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminUserInput[] + createMany?: BranchAllocationCreateManyAllocatorAdminUserInputEnvelope + set?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + disconnect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + delete?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + update?: BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminUserInput | BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminUserInput[] + updateMany?: BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminUserInput | BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminUserInput[] + deleteMany?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] + } + export type LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput = { create?: XOR<LedgerEntryCreateWithoutPostedByAdminUserInput, LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput> | LedgerEntryCreateWithoutPostedByAdminUserInput[] | LedgerEntryUncheckedCreateWithoutPostedByAdminUserInput[] connectOrCreate?: LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput | LedgerEntryCreateOrConnectWithoutPostedByAdminUserInput[] @@ -29968,6 +49869,48 @@ export namespace Prisma { deleteMany?: PreOrderStatusEventScalarWhereInput | PreOrderStatusEventScalarWhereInput[] } + export type SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput = { + create?: XOR<SmsMessageCreateWithoutSentByAdminUserInput, SmsMessageUncheckedCreateWithoutSentByAdminUserInput> | SmsMessageCreateWithoutSentByAdminUserInput[] | SmsMessageUncheckedCreateWithoutSentByAdminUserInput[] + connectOrCreate?: SmsMessageCreateOrConnectWithoutSentByAdminUserInput | SmsMessageCreateOrConnectWithoutSentByAdminUserInput[] + upsert?: SmsMessageUpsertWithWhereUniqueWithoutSentByAdminUserInput | SmsMessageUpsertWithWhereUniqueWithoutSentByAdminUserInput[] + createMany?: SmsMessageCreateManySentByAdminUserInputEnvelope + set?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + disconnect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + delete?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + connect?: SmsMessageWhereUniqueInput | SmsMessageWhereUniqueInput[] + update?: SmsMessageUpdateWithWhereUniqueWithoutSentByAdminUserInput | SmsMessageUpdateWithWhereUniqueWithoutSentByAdminUserInput[] + updateMany?: SmsMessageUpdateManyWithWhereWithoutSentByAdminUserInput | SmsMessageUpdateManyWithWhereWithoutSentByAdminUserInput[] + deleteMany?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] + } + + export type NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput = { + create?: XOR<NotificationCreateWithoutSentByAdminUserInput, NotificationUncheckedCreateWithoutSentByAdminUserInput> | NotificationCreateWithoutSentByAdminUserInput[] | NotificationUncheckedCreateWithoutSentByAdminUserInput[] + connectOrCreate?: NotificationCreateOrConnectWithoutSentByAdminUserInput | NotificationCreateOrConnectWithoutSentByAdminUserInput[] + upsert?: NotificationUpsertWithWhereUniqueWithoutSentByAdminUserInput | NotificationUpsertWithWhereUniqueWithoutSentByAdminUserInput[] + createMany?: NotificationCreateManySentByAdminUserInputEnvelope + set?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + disconnect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + delete?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + connect?: NotificationWhereUniqueInput | NotificationWhereUniqueInput[] + update?: NotificationUpdateWithWhereUniqueWithoutSentByAdminUserInput | NotificationUpdateWithWhereUniqueWithoutSentByAdminUserInput[] + updateMany?: NotificationUpdateManyWithWhereWithoutSentByAdminUserInput | NotificationUpdateManyWithWhereWithoutSentByAdminUserInput[] + deleteMany?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + } + + export type UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput = { + create?: XOR<UploadedFileCreateWithoutUploadedByAdminUserInput, UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput> | UploadedFileCreateWithoutUploadedByAdminUserInput[] | UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput[] + connectOrCreate?: UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput | UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput[] + upsert?: UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminUserInput | UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminUserInput[] + createMany?: UploadedFileCreateManyUploadedByAdminUserInputEnvelope + set?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + disconnect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + delete?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + connect?: UploadedFileWhereUniqueInput | UploadedFileWhereUniqueInput[] + update?: UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminUserInput | UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminUserInput[] + updateMany?: UploadedFileUpdateManyWithWhereWithoutUploadedByAdminUserInput | UploadedFileUpdateManyWithWhereWithoutUploadedByAdminUserInput[] + deleteMany?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] + } + export type CityCreateNestedOneWithoutCustomersInput = { create?: XOR<CityCreateWithoutCustomersInput, CityUncheckedCreateWithoutCustomersInput> connectOrCreate?: CityCreateOrConnectWithoutCustomersInput @@ -29980,6 +49923,12 @@ export namespace Prisma { connect?: AdminUserWhereUniqueInput } + export type UploadedFileCreateNestedOneWithoutCustomerAvatarsInput = { + create?: XOR<UploadedFileCreateWithoutCustomerAvatarsInput, UploadedFileUncheckedCreateWithoutCustomerAvatarsInput> + connectOrCreate?: UploadedFileCreateOrConnectWithoutCustomerAvatarsInput + connect?: UploadedFileWhereUniqueInput + } + export type CustomerAddressCreateNestedManyWithoutCustomerInput = { create?: XOR<CustomerAddressCreateWithoutCustomerInput, CustomerAddressUncheckedCreateWithoutCustomerInput> | CustomerAddressCreateWithoutCustomerInput[] | CustomerAddressUncheckedCreateWithoutCustomerInput[] connectOrCreate?: CustomerAddressCreateOrConnectWithoutCustomerInput | CustomerAddressCreateOrConnectWithoutCustomerInput[] @@ -30015,6 +49964,34 @@ export namespace Prisma { connect?: WalletBonusWhereUniqueInput | WalletBonusWhereUniqueInput[] } + export type CommentCreateNestedManyWithoutCustomerInput = { + create?: XOR<CommentCreateWithoutCustomerInput, CommentUncheckedCreateWithoutCustomerInput> | CommentCreateWithoutCustomerInput[] | CommentUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: CommentCreateOrConnectWithoutCustomerInput | CommentCreateOrConnectWithoutCustomerInput[] + createMany?: CommentCreateManyCustomerInputEnvelope + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + } + + export type PromotionCreateNestedManyWithoutCustomerInput = { + create?: XOR<PromotionCreateWithoutCustomerInput, PromotionUncheckedCreateWithoutCustomerInput> | PromotionCreateWithoutCustomerInput[] | PromotionUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutCustomerInput | PromotionCreateOrConnectWithoutCustomerInput[] + createMany?: PromotionCreateManyCustomerInputEnvelope + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + } + + export type NotificationRecipientCreateNestedManyWithoutCustomerInput = { + create?: XOR<NotificationRecipientCreateWithoutCustomerInput, NotificationRecipientUncheckedCreateWithoutCustomerInput> | NotificationRecipientCreateWithoutCustomerInput[] | NotificationRecipientUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: NotificationRecipientCreateOrConnectWithoutCustomerInput | NotificationRecipientCreateOrConnectWithoutCustomerInput[] + createMany?: NotificationRecipientCreateManyCustomerInputEnvelope + connect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + } + + export type CustomerActivityLogCreateNestedManyWithoutCustomerInput = { + create?: XOR<CustomerActivityLogCreateWithoutCustomerInput, CustomerActivityLogUncheckedCreateWithoutCustomerInput> | CustomerActivityLogCreateWithoutCustomerInput[] | CustomerActivityLogUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: CustomerActivityLogCreateOrConnectWithoutCustomerInput | CustomerActivityLogCreateOrConnectWithoutCustomerInput[] + createMany?: CustomerActivityLogCreateManyCustomerInputEnvelope + connect?: CustomerActivityLogWhereUniqueInput | CustomerActivityLogWhereUniqueInput[] + } + export type CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput = { create?: XOR<CustomerAddressCreateWithoutCustomerInput, CustomerAddressUncheckedCreateWithoutCustomerInput> | CustomerAddressCreateWithoutCustomerInput[] | CustomerAddressUncheckedCreateWithoutCustomerInput[] connectOrCreate?: CustomerAddressCreateOrConnectWithoutCustomerInput | CustomerAddressCreateOrConnectWithoutCustomerInput[] @@ -30050,6 +50027,38 @@ export namespace Prisma { connect?: WalletBonusWhereUniqueInput | WalletBonusWhereUniqueInput[] } + export type CommentUncheckedCreateNestedManyWithoutCustomerInput = { + create?: XOR<CommentCreateWithoutCustomerInput, CommentUncheckedCreateWithoutCustomerInput> | CommentCreateWithoutCustomerInput[] | CommentUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: CommentCreateOrConnectWithoutCustomerInput | CommentCreateOrConnectWithoutCustomerInput[] + createMany?: CommentCreateManyCustomerInputEnvelope + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + } + + export type PromotionUncheckedCreateNestedManyWithoutCustomerInput = { + create?: XOR<PromotionCreateWithoutCustomerInput, PromotionUncheckedCreateWithoutCustomerInput> | PromotionCreateWithoutCustomerInput[] | PromotionUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutCustomerInput | PromotionCreateOrConnectWithoutCustomerInput[] + createMany?: PromotionCreateManyCustomerInputEnvelope + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + } + + export type NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput = { + create?: XOR<NotificationRecipientCreateWithoutCustomerInput, NotificationRecipientUncheckedCreateWithoutCustomerInput> | NotificationRecipientCreateWithoutCustomerInput[] | NotificationRecipientUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: NotificationRecipientCreateOrConnectWithoutCustomerInput | NotificationRecipientCreateOrConnectWithoutCustomerInput[] + createMany?: NotificationRecipientCreateManyCustomerInputEnvelope + connect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + } + + export type CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput = { + create?: XOR<CustomerActivityLogCreateWithoutCustomerInput, CustomerActivityLogUncheckedCreateWithoutCustomerInput> | CustomerActivityLogCreateWithoutCustomerInput[] | CustomerActivityLogUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: CustomerActivityLogCreateOrConnectWithoutCustomerInput | CustomerActivityLogCreateOrConnectWithoutCustomerInput[] + createMany?: CustomerActivityLogCreateManyCustomerInputEnvelope + connect?: CustomerActivityLogWhereUniqueInput | CustomerActivityLogWhereUniqueInput[] + } + + export type EnumCustomerKindFieldUpdateOperationsInput = { + set?: $Enums.CustomerKind + } + export type DecimalFieldUpdateOperationsInput = { set?: Decimal | DecimalJsLike | number | string increment?: Decimal | DecimalJsLike | number | string @@ -30082,6 +50091,16 @@ export namespace Prisma { update?: XOR<XOR<AdminUserUpdateToOneWithWhereWithoutReferredCustomersInput, AdminUserUpdateWithoutReferredCustomersInput>, AdminUserUncheckedUpdateWithoutReferredCustomersInput> } + export type UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput = { + create?: XOR<UploadedFileCreateWithoutCustomerAvatarsInput, UploadedFileUncheckedCreateWithoutCustomerAvatarsInput> + connectOrCreate?: UploadedFileCreateOrConnectWithoutCustomerAvatarsInput + upsert?: UploadedFileUpsertWithoutCustomerAvatarsInput + disconnect?: UploadedFileWhereInput | boolean + delete?: UploadedFileWhereInput | boolean + connect?: UploadedFileWhereUniqueInput + update?: XOR<XOR<UploadedFileUpdateToOneWithWhereWithoutCustomerAvatarsInput, UploadedFileUpdateWithoutCustomerAvatarsInput>, UploadedFileUncheckedUpdateWithoutCustomerAvatarsInput> + } + export type CustomerAddressUpdateManyWithoutCustomerNestedInput = { create?: XOR<CustomerAddressCreateWithoutCustomerInput, CustomerAddressUncheckedCreateWithoutCustomerInput> | CustomerAddressCreateWithoutCustomerInput[] | CustomerAddressUncheckedCreateWithoutCustomerInput[] connectOrCreate?: CustomerAddressCreateOrConnectWithoutCustomerInput | CustomerAddressCreateOrConnectWithoutCustomerInput[] @@ -30152,6 +50171,62 @@ export namespace Prisma { deleteMany?: WalletBonusScalarWhereInput | WalletBonusScalarWhereInput[] } + export type CommentUpdateManyWithoutCustomerNestedInput = { + create?: XOR<CommentCreateWithoutCustomerInput, CommentUncheckedCreateWithoutCustomerInput> | CommentCreateWithoutCustomerInput[] | CommentUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: CommentCreateOrConnectWithoutCustomerInput | CommentCreateOrConnectWithoutCustomerInput[] + upsert?: CommentUpsertWithWhereUniqueWithoutCustomerInput | CommentUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: CommentCreateManyCustomerInputEnvelope + set?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + disconnect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + delete?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + update?: CommentUpdateWithWhereUniqueWithoutCustomerInput | CommentUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: CommentUpdateManyWithWhereWithoutCustomerInput | CommentUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: CommentScalarWhereInput | CommentScalarWhereInput[] + } + + export type PromotionUpdateManyWithoutCustomerNestedInput = { + create?: XOR<PromotionCreateWithoutCustomerInput, PromotionUncheckedCreateWithoutCustomerInput> | PromotionCreateWithoutCustomerInput[] | PromotionUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutCustomerInput | PromotionCreateOrConnectWithoutCustomerInput[] + upsert?: PromotionUpsertWithWhereUniqueWithoutCustomerInput | PromotionUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: PromotionCreateManyCustomerInputEnvelope + set?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + disconnect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + delete?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + update?: PromotionUpdateWithWhereUniqueWithoutCustomerInput | PromotionUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: PromotionUpdateManyWithWhereWithoutCustomerInput | PromotionUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: PromotionScalarWhereInput | PromotionScalarWhereInput[] + } + + export type NotificationRecipientUpdateManyWithoutCustomerNestedInput = { + create?: XOR<NotificationRecipientCreateWithoutCustomerInput, NotificationRecipientUncheckedCreateWithoutCustomerInput> | NotificationRecipientCreateWithoutCustomerInput[] | NotificationRecipientUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: NotificationRecipientCreateOrConnectWithoutCustomerInput | NotificationRecipientCreateOrConnectWithoutCustomerInput[] + upsert?: NotificationRecipientUpsertWithWhereUniqueWithoutCustomerInput | NotificationRecipientUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: NotificationRecipientCreateManyCustomerInputEnvelope + set?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + disconnect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + delete?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + connect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + update?: NotificationRecipientUpdateWithWhereUniqueWithoutCustomerInput | NotificationRecipientUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: NotificationRecipientUpdateManyWithWhereWithoutCustomerInput | NotificationRecipientUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: NotificationRecipientScalarWhereInput | NotificationRecipientScalarWhereInput[] + } + + export type CustomerActivityLogUpdateManyWithoutCustomerNestedInput = { + create?: XOR<CustomerActivityLogCreateWithoutCustomerInput, CustomerActivityLogUncheckedCreateWithoutCustomerInput> | CustomerActivityLogCreateWithoutCustomerInput[] | CustomerActivityLogUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: CustomerActivityLogCreateOrConnectWithoutCustomerInput | CustomerActivityLogCreateOrConnectWithoutCustomerInput[] + upsert?: CustomerActivityLogUpsertWithWhereUniqueWithoutCustomerInput | CustomerActivityLogUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: CustomerActivityLogCreateManyCustomerInputEnvelope + set?: CustomerActivityLogWhereUniqueInput | CustomerActivityLogWhereUniqueInput[] + disconnect?: CustomerActivityLogWhereUniqueInput | CustomerActivityLogWhereUniqueInput[] + delete?: CustomerActivityLogWhereUniqueInput | CustomerActivityLogWhereUniqueInput[] + connect?: CustomerActivityLogWhereUniqueInput | CustomerActivityLogWhereUniqueInput[] + update?: CustomerActivityLogUpdateWithWhereUniqueWithoutCustomerInput | CustomerActivityLogUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: CustomerActivityLogUpdateManyWithWhereWithoutCustomerInput | CustomerActivityLogUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: CustomerActivityLogScalarWhereInput | CustomerActivityLogScalarWhereInput[] + } + export type CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput = { create?: XOR<CustomerAddressCreateWithoutCustomerInput, CustomerAddressUncheckedCreateWithoutCustomerInput> | CustomerAddressCreateWithoutCustomerInput[] | CustomerAddressUncheckedCreateWithoutCustomerInput[] connectOrCreate?: CustomerAddressCreateOrConnectWithoutCustomerInput | CustomerAddressCreateOrConnectWithoutCustomerInput[] @@ -30222,6 +50297,62 @@ export namespace Prisma { deleteMany?: WalletBonusScalarWhereInput | WalletBonusScalarWhereInput[] } + export type CommentUncheckedUpdateManyWithoutCustomerNestedInput = { + create?: XOR<CommentCreateWithoutCustomerInput, CommentUncheckedCreateWithoutCustomerInput> | CommentCreateWithoutCustomerInput[] | CommentUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: CommentCreateOrConnectWithoutCustomerInput | CommentCreateOrConnectWithoutCustomerInput[] + upsert?: CommentUpsertWithWhereUniqueWithoutCustomerInput | CommentUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: CommentCreateManyCustomerInputEnvelope + set?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + disconnect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + delete?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + update?: CommentUpdateWithWhereUniqueWithoutCustomerInput | CommentUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: CommentUpdateManyWithWhereWithoutCustomerInput | CommentUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: CommentScalarWhereInput | CommentScalarWhereInput[] + } + + export type PromotionUncheckedUpdateManyWithoutCustomerNestedInput = { + create?: XOR<PromotionCreateWithoutCustomerInput, PromotionUncheckedCreateWithoutCustomerInput> | PromotionCreateWithoutCustomerInput[] | PromotionUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutCustomerInput | PromotionCreateOrConnectWithoutCustomerInput[] + upsert?: PromotionUpsertWithWhereUniqueWithoutCustomerInput | PromotionUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: PromotionCreateManyCustomerInputEnvelope + set?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + disconnect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + delete?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + update?: PromotionUpdateWithWhereUniqueWithoutCustomerInput | PromotionUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: PromotionUpdateManyWithWhereWithoutCustomerInput | PromotionUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: PromotionScalarWhereInput | PromotionScalarWhereInput[] + } + + export type NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput = { + create?: XOR<NotificationRecipientCreateWithoutCustomerInput, NotificationRecipientUncheckedCreateWithoutCustomerInput> | NotificationRecipientCreateWithoutCustomerInput[] | NotificationRecipientUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: NotificationRecipientCreateOrConnectWithoutCustomerInput | NotificationRecipientCreateOrConnectWithoutCustomerInput[] + upsert?: NotificationRecipientUpsertWithWhereUniqueWithoutCustomerInput | NotificationRecipientUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: NotificationRecipientCreateManyCustomerInputEnvelope + set?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + disconnect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + delete?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + connect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + update?: NotificationRecipientUpdateWithWhereUniqueWithoutCustomerInput | NotificationRecipientUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: NotificationRecipientUpdateManyWithWhereWithoutCustomerInput | NotificationRecipientUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: NotificationRecipientScalarWhereInput | NotificationRecipientScalarWhereInput[] + } + + export type CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput = { + create?: XOR<CustomerActivityLogCreateWithoutCustomerInput, CustomerActivityLogUncheckedCreateWithoutCustomerInput> | CustomerActivityLogCreateWithoutCustomerInput[] | CustomerActivityLogUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: CustomerActivityLogCreateOrConnectWithoutCustomerInput | CustomerActivityLogCreateOrConnectWithoutCustomerInput[] + upsert?: CustomerActivityLogUpsertWithWhereUniqueWithoutCustomerInput | CustomerActivityLogUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: CustomerActivityLogCreateManyCustomerInputEnvelope + set?: CustomerActivityLogWhereUniqueInput | CustomerActivityLogWhereUniqueInput[] + disconnect?: CustomerActivityLogWhereUniqueInput | CustomerActivityLogWhereUniqueInput[] + delete?: CustomerActivityLogWhereUniqueInput | CustomerActivityLogWhereUniqueInput[] + connect?: CustomerActivityLogWhereUniqueInput | CustomerActivityLogWhereUniqueInput[] + update?: CustomerActivityLogUpdateWithWhereUniqueWithoutCustomerInput | CustomerActivityLogUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: CustomerActivityLogUpdateManyWithWhereWithoutCustomerInput | CustomerActivityLogUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: CustomerActivityLogScalarWhereInput | CustomerActivityLogScalarWhereInput[] + } + export type CustomerCreateNestedOneWithoutAddressesInput = { create?: XOR<CustomerCreateWithoutAddressesInput, CustomerUncheckedCreateWithoutAddressesInput> connectOrCreate?: CustomerCreateOrConnectWithoutAddressesInput @@ -30272,6 +50403,13 @@ export namespace Prisma { connect?: OrderWhereUniqueInput | OrderWhereUniqueInput[] } + export type BranchAllocationCreateNestedManyWithoutBranchInput = { + create?: XOR<BranchAllocationCreateWithoutBranchInput, BranchAllocationUncheckedCreateWithoutBranchInput> | BranchAllocationCreateWithoutBranchInput[] | BranchAllocationUncheckedCreateWithoutBranchInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutBranchInput | BranchAllocationCreateOrConnectWithoutBranchInput[] + createMany?: BranchAllocationCreateManyBranchInputEnvelope + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + } + export type AdminUserUncheckedCreateNestedManyWithoutBranchInput = { create?: XOR<AdminUserCreateWithoutBranchInput, AdminUserUncheckedCreateWithoutBranchInput> | AdminUserCreateWithoutBranchInput[] | AdminUserUncheckedCreateWithoutBranchInput[] connectOrCreate?: AdminUserCreateOrConnectWithoutBranchInput | AdminUserCreateOrConnectWithoutBranchInput[] @@ -30286,6 +50424,13 @@ export namespace Prisma { connect?: OrderWhereUniqueInput | OrderWhereUniqueInput[] } + export type BranchAllocationUncheckedCreateNestedManyWithoutBranchInput = { + create?: XOR<BranchAllocationCreateWithoutBranchInput, BranchAllocationUncheckedCreateWithoutBranchInput> | BranchAllocationCreateWithoutBranchInput[] | BranchAllocationUncheckedCreateWithoutBranchInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutBranchInput | BranchAllocationCreateOrConnectWithoutBranchInput[] + createMany?: BranchAllocationCreateManyBranchInputEnvelope + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + } + export type CityUpdateOneWithoutBranchesNestedInput = { create?: XOR<CityCreateWithoutBranchesInput, CityUncheckedCreateWithoutBranchesInput> connectOrCreate?: CityCreateOrConnectWithoutBranchesInput @@ -30324,6 +50469,20 @@ export namespace Prisma { deleteMany?: OrderScalarWhereInput | OrderScalarWhereInput[] } + export type BranchAllocationUpdateManyWithoutBranchNestedInput = { + create?: XOR<BranchAllocationCreateWithoutBranchInput, BranchAllocationUncheckedCreateWithoutBranchInput> | BranchAllocationCreateWithoutBranchInput[] | BranchAllocationUncheckedCreateWithoutBranchInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutBranchInput | BranchAllocationCreateOrConnectWithoutBranchInput[] + upsert?: BranchAllocationUpsertWithWhereUniqueWithoutBranchInput | BranchAllocationUpsertWithWhereUniqueWithoutBranchInput[] + createMany?: BranchAllocationCreateManyBranchInputEnvelope + set?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + disconnect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + delete?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + update?: BranchAllocationUpdateWithWhereUniqueWithoutBranchInput | BranchAllocationUpdateWithWhereUniqueWithoutBranchInput[] + updateMany?: BranchAllocationUpdateManyWithWhereWithoutBranchInput | BranchAllocationUpdateManyWithWhereWithoutBranchInput[] + deleteMany?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] + } + export type AdminUserUncheckedUpdateManyWithoutBranchNestedInput = { create?: XOR<AdminUserCreateWithoutBranchInput, AdminUserUncheckedCreateWithoutBranchInput> | AdminUserCreateWithoutBranchInput[] | AdminUserUncheckedCreateWithoutBranchInput[] connectOrCreate?: AdminUserCreateOrConnectWithoutBranchInput | AdminUserCreateOrConnectWithoutBranchInput[] @@ -30352,6 +50511,26 @@ export namespace Prisma { deleteMany?: OrderScalarWhereInput | OrderScalarWhereInput[] } + export type BranchAllocationUncheckedUpdateManyWithoutBranchNestedInput = { + create?: XOR<BranchAllocationCreateWithoutBranchInput, BranchAllocationUncheckedCreateWithoutBranchInput> | BranchAllocationCreateWithoutBranchInput[] | BranchAllocationUncheckedCreateWithoutBranchInput[] + connectOrCreate?: BranchAllocationCreateOrConnectWithoutBranchInput | BranchAllocationCreateOrConnectWithoutBranchInput[] + upsert?: BranchAllocationUpsertWithWhereUniqueWithoutBranchInput | BranchAllocationUpsertWithWhereUniqueWithoutBranchInput[] + createMany?: BranchAllocationCreateManyBranchInputEnvelope + set?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + disconnect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + delete?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + connect?: BranchAllocationWhereUniqueInput | BranchAllocationWhereUniqueInput[] + update?: BranchAllocationUpdateWithWhereUniqueWithoutBranchInput | BranchAllocationUpdateWithWhereUniqueWithoutBranchInput[] + updateMany?: BranchAllocationUpdateManyWithWhereWithoutBranchInput | BranchAllocationUpdateManyWithWhereWithoutBranchInput[] + deleteMany?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] + } + + export type AdminUserCreateNestedOneWithoutSupervisedWorkshopsInput = { + create?: XOR<AdminUserCreateWithoutSupervisedWorkshopsInput, AdminUserUncheckedCreateWithoutSupervisedWorkshopsInput> + connectOrCreate?: AdminUserCreateOrConnectWithoutSupervisedWorkshopsInput + connect?: AdminUserWhereUniqueInput + } + export type PreOrderCreateNestedManyWithoutWorkshopInput = { create?: XOR<PreOrderCreateWithoutWorkshopInput, PreOrderUncheckedCreateWithoutWorkshopInput> | PreOrderCreateWithoutWorkshopInput[] | PreOrderUncheckedCreateWithoutWorkshopInput[] connectOrCreate?: PreOrderCreateOrConnectWithoutWorkshopInput | PreOrderCreateOrConnectWithoutWorkshopInput[] @@ -30366,6 +50545,16 @@ export namespace Prisma { connect?: PreOrderWhereUniqueInput | PreOrderWhereUniqueInput[] } + export type AdminUserUpdateOneWithoutSupervisedWorkshopsNestedInput = { + create?: XOR<AdminUserCreateWithoutSupervisedWorkshopsInput, AdminUserUncheckedCreateWithoutSupervisedWorkshopsInput> + connectOrCreate?: AdminUserCreateOrConnectWithoutSupervisedWorkshopsInput + upsert?: AdminUserUpsertWithoutSupervisedWorkshopsInput + disconnect?: AdminUserWhereInput | boolean + delete?: AdminUserWhereInput | boolean + connect?: AdminUserWhereUniqueInput + update?: XOR<XOR<AdminUserUpdateToOneWithWhereWithoutSupervisedWorkshopsInput, AdminUserUpdateWithoutSupervisedWorkshopsInput>, AdminUserUncheckedUpdateWithoutSupervisedWorkshopsInput> + } + export type PreOrderUpdateManyWithoutWorkshopNestedInput = { create?: XOR<PreOrderCreateWithoutWorkshopInput, PreOrderUncheckedCreateWithoutWorkshopInput> | PreOrderCreateWithoutWorkshopInput[] | PreOrderUncheckedCreateWithoutWorkshopInput[] connectOrCreate?: PreOrderCreateOrConnectWithoutWorkshopInput | PreOrderCreateOrConnectWithoutWorkshopInput[] @@ -30414,6 +50603,13 @@ export namespace Prisma { connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[] } + export type PromotionCreateNestedManyWithoutCategoryInput = { + create?: XOR<PromotionCreateWithoutCategoryInput, PromotionUncheckedCreateWithoutCategoryInput> | PromotionCreateWithoutCategoryInput[] | PromotionUncheckedCreateWithoutCategoryInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutCategoryInput | PromotionCreateOrConnectWithoutCategoryInput[] + createMany?: PromotionCreateManyCategoryInputEnvelope + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + } + export type CategoryUncheckedCreateNestedManyWithoutParentInput = { create?: XOR<CategoryCreateWithoutParentInput, CategoryUncheckedCreateWithoutParentInput> | CategoryCreateWithoutParentInput[] | CategoryUncheckedCreateWithoutParentInput[] connectOrCreate?: CategoryCreateOrConnectWithoutParentInput | CategoryCreateOrConnectWithoutParentInput[] @@ -30428,6 +50624,21 @@ export namespace Prisma { connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[] } + export type PromotionUncheckedCreateNestedManyWithoutCategoryInput = { + create?: XOR<PromotionCreateWithoutCategoryInput, PromotionUncheckedCreateWithoutCategoryInput> | PromotionCreateWithoutCategoryInput[] | PromotionUncheckedCreateWithoutCategoryInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutCategoryInput | PromotionCreateOrConnectWithoutCategoryInput[] + createMany?: PromotionCreateManyCategoryInputEnvelope + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + } + + export type IntFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number + } + export type CategoryUpdateOneWithoutChildrenNestedInput = { create?: XOR<CategoryCreateWithoutChildrenInput, CategoryUncheckedCreateWithoutChildrenInput> connectOrCreate?: CategoryCreateOrConnectWithoutChildrenInput @@ -30466,6 +50677,20 @@ export namespace Prisma { deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[] } + export type PromotionUpdateManyWithoutCategoryNestedInput = { + create?: XOR<PromotionCreateWithoutCategoryInput, PromotionUncheckedCreateWithoutCategoryInput> | PromotionCreateWithoutCategoryInput[] | PromotionUncheckedCreateWithoutCategoryInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutCategoryInput | PromotionCreateOrConnectWithoutCategoryInput[] + upsert?: PromotionUpsertWithWhereUniqueWithoutCategoryInput | PromotionUpsertWithWhereUniqueWithoutCategoryInput[] + createMany?: PromotionCreateManyCategoryInputEnvelope + set?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + disconnect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + delete?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + update?: PromotionUpdateWithWhereUniqueWithoutCategoryInput | PromotionUpdateWithWhereUniqueWithoutCategoryInput[] + updateMany?: PromotionUpdateManyWithWhereWithoutCategoryInput | PromotionUpdateManyWithWhereWithoutCategoryInput[] + deleteMany?: PromotionScalarWhereInput | PromotionScalarWhereInput[] + } + export type CategoryUncheckedUpdateManyWithoutParentNestedInput = { create?: XOR<CategoryCreateWithoutParentInput, CategoryUncheckedCreateWithoutParentInput> | CategoryCreateWithoutParentInput[] | CategoryUncheckedCreateWithoutParentInput[] connectOrCreate?: CategoryCreateOrConnectWithoutParentInput | CategoryCreateOrConnectWithoutParentInput[] @@ -30494,6 +50719,20 @@ export namespace Prisma { deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[] } + export type PromotionUncheckedUpdateManyWithoutCategoryNestedInput = { + create?: XOR<PromotionCreateWithoutCategoryInput, PromotionUncheckedCreateWithoutCategoryInput> | PromotionCreateWithoutCategoryInput[] | PromotionUncheckedCreateWithoutCategoryInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutCategoryInput | PromotionCreateOrConnectWithoutCategoryInput[] + upsert?: PromotionUpsertWithWhereUniqueWithoutCategoryInput | PromotionUpsertWithWhereUniqueWithoutCategoryInput[] + createMany?: PromotionCreateManyCategoryInputEnvelope + set?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + disconnect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + delete?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + update?: PromotionUpdateWithWhereUniqueWithoutCategoryInput | PromotionUpdateWithWhereUniqueWithoutCategoryInput[] + updateMany?: PromotionUpdateManyWithWhereWithoutCategoryInput | PromotionUpdateManyWithWhereWithoutCategoryInput[] + deleteMany?: PromotionScalarWhereInput | PromotionScalarWhereInput[] + } + export type ProductCreateNestedManyWithoutBrandInput = { create?: XOR<ProductCreateWithoutBrandInput, ProductUncheckedCreateWithoutBrandInput> | ProductCreateWithoutBrandInput[] | ProductUncheckedCreateWithoutBrandInput[] connectOrCreate?: ProductCreateOrConnectWithoutBrandInput | ProductCreateOrConnectWithoutBrandInput[] @@ -30501,6 +50740,13 @@ export namespace Prisma { connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[] } + export type PromotionCreateNestedManyWithoutBrandInput = { + create?: XOR<PromotionCreateWithoutBrandInput, PromotionUncheckedCreateWithoutBrandInput> | PromotionCreateWithoutBrandInput[] | PromotionUncheckedCreateWithoutBrandInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutBrandInput | PromotionCreateOrConnectWithoutBrandInput[] + createMany?: PromotionCreateManyBrandInputEnvelope + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + } + export type ProductUncheckedCreateNestedManyWithoutBrandInput = { create?: XOR<ProductCreateWithoutBrandInput, ProductUncheckedCreateWithoutBrandInput> | ProductCreateWithoutBrandInput[] | ProductUncheckedCreateWithoutBrandInput[] connectOrCreate?: ProductCreateOrConnectWithoutBrandInput | ProductCreateOrConnectWithoutBrandInput[] @@ -30508,6 +50754,13 @@ export namespace Prisma { connect?: ProductWhereUniqueInput | ProductWhereUniqueInput[] } + export type PromotionUncheckedCreateNestedManyWithoutBrandInput = { + create?: XOR<PromotionCreateWithoutBrandInput, PromotionUncheckedCreateWithoutBrandInput> | PromotionCreateWithoutBrandInput[] | PromotionUncheckedCreateWithoutBrandInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutBrandInput | PromotionCreateOrConnectWithoutBrandInput[] + createMany?: PromotionCreateManyBrandInputEnvelope + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + } + export type ProductUpdateManyWithoutBrandNestedInput = { create?: XOR<ProductCreateWithoutBrandInput, ProductUncheckedCreateWithoutBrandInput> | ProductCreateWithoutBrandInput[] | ProductUncheckedCreateWithoutBrandInput[] connectOrCreate?: ProductCreateOrConnectWithoutBrandInput | ProductCreateOrConnectWithoutBrandInput[] @@ -30522,6 +50775,20 @@ export namespace Prisma { deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[] } + export type PromotionUpdateManyWithoutBrandNestedInput = { + create?: XOR<PromotionCreateWithoutBrandInput, PromotionUncheckedCreateWithoutBrandInput> | PromotionCreateWithoutBrandInput[] | PromotionUncheckedCreateWithoutBrandInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutBrandInput | PromotionCreateOrConnectWithoutBrandInput[] + upsert?: PromotionUpsertWithWhereUniqueWithoutBrandInput | PromotionUpsertWithWhereUniqueWithoutBrandInput[] + createMany?: PromotionCreateManyBrandInputEnvelope + set?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + disconnect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + delete?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + update?: PromotionUpdateWithWhereUniqueWithoutBrandInput | PromotionUpdateWithWhereUniqueWithoutBrandInput[] + updateMany?: PromotionUpdateManyWithWhereWithoutBrandInput | PromotionUpdateManyWithWhereWithoutBrandInput[] + deleteMany?: PromotionScalarWhereInput | PromotionScalarWhereInput[] + } + export type ProductUncheckedUpdateManyWithoutBrandNestedInput = { create?: XOR<ProductCreateWithoutBrandInput, ProductUncheckedCreateWithoutBrandInput> | ProductCreateWithoutBrandInput[] | ProductUncheckedCreateWithoutBrandInput[] connectOrCreate?: ProductCreateOrConnectWithoutBrandInput | ProductCreateOrConnectWithoutBrandInput[] @@ -30536,6 +50803,20 @@ export namespace Prisma { deleteMany?: ProductScalarWhereInput | ProductScalarWhereInput[] } + export type PromotionUncheckedUpdateManyWithoutBrandNestedInput = { + create?: XOR<PromotionCreateWithoutBrandInput, PromotionUncheckedCreateWithoutBrandInput> | PromotionCreateWithoutBrandInput[] | PromotionUncheckedCreateWithoutBrandInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutBrandInput | PromotionCreateOrConnectWithoutBrandInput[] + upsert?: PromotionUpsertWithWhereUniqueWithoutBrandInput | PromotionUpsertWithWhereUniqueWithoutBrandInput[] + createMany?: PromotionCreateManyBrandInputEnvelope + set?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + disconnect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + delete?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + update?: PromotionUpdateWithWhereUniqueWithoutBrandInput | PromotionUpdateWithWhereUniqueWithoutBrandInput[] + updateMany?: PromotionUpdateManyWithWhereWithoutBrandInput | PromotionUpdateManyWithWhereWithoutBrandInput[] + deleteMany?: PromotionScalarWhereInput | PromotionScalarWhereInput[] + } + export type CollectionProductCreateNestedManyWithoutCollectionInput = { create?: XOR<CollectionProductCreateWithoutCollectionInput, CollectionProductUncheckedCreateWithoutCollectionInput> | CollectionProductCreateWithoutCollectionInput[] | CollectionProductUncheckedCreateWithoutCollectionInput[] connectOrCreate?: CollectionProductCreateOrConnectWithoutCollectionInput | CollectionProductCreateOrConnectWithoutCollectionInput[] @@ -30639,6 +50920,27 @@ export namespace Prisma { connect?: CollectionProductWhereUniqueInput | CollectionProductWhereUniqueInput[] } + export type CommentCreateNestedManyWithoutProductInput = { + create?: XOR<CommentCreateWithoutProductInput, CommentUncheckedCreateWithoutProductInput> | CommentCreateWithoutProductInput[] | CommentUncheckedCreateWithoutProductInput[] + connectOrCreate?: CommentCreateOrConnectWithoutProductInput | CommentCreateOrConnectWithoutProductInput[] + createMany?: CommentCreateManyProductInputEnvelope + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + } + + export type PromotionCreateNestedManyWithoutProductInput = { + create?: XOR<PromotionCreateWithoutProductInput, PromotionUncheckedCreateWithoutProductInput> | PromotionCreateWithoutProductInput[] | PromotionUncheckedCreateWithoutProductInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutProductInput | PromotionCreateOrConnectWithoutProductInput[] + createMany?: PromotionCreateManyProductInputEnvelope + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + } + + export type BranchAllocationItemCreateNestedManyWithoutProductInput = { + create?: XOR<BranchAllocationItemCreateWithoutProductInput, BranchAllocationItemUncheckedCreateWithoutProductInput> | BranchAllocationItemCreateWithoutProductInput[] | BranchAllocationItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: BranchAllocationItemCreateOrConnectWithoutProductInput | BranchAllocationItemCreateOrConnectWithoutProductInput[] + createMany?: BranchAllocationItemCreateManyProductInputEnvelope + connect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + } + export type ProductVariantUncheckedCreateNestedManyWithoutProductInput = { create?: XOR<ProductVariantCreateWithoutProductInput, ProductVariantUncheckedCreateWithoutProductInput> | ProductVariantCreateWithoutProductInput[] | ProductVariantUncheckedCreateWithoutProductInput[] connectOrCreate?: ProductVariantCreateOrConnectWithoutProductInput | ProductVariantCreateOrConnectWithoutProductInput[] @@ -30660,6 +50962,27 @@ export namespace Prisma { connect?: CollectionProductWhereUniqueInput | CollectionProductWhereUniqueInput[] } + export type CommentUncheckedCreateNestedManyWithoutProductInput = { + create?: XOR<CommentCreateWithoutProductInput, CommentUncheckedCreateWithoutProductInput> | CommentCreateWithoutProductInput[] | CommentUncheckedCreateWithoutProductInput[] + connectOrCreate?: CommentCreateOrConnectWithoutProductInput | CommentCreateOrConnectWithoutProductInput[] + createMany?: CommentCreateManyProductInputEnvelope + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + } + + export type PromotionUncheckedCreateNestedManyWithoutProductInput = { + create?: XOR<PromotionCreateWithoutProductInput, PromotionUncheckedCreateWithoutProductInput> | PromotionCreateWithoutProductInput[] | PromotionUncheckedCreateWithoutProductInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutProductInput | PromotionCreateOrConnectWithoutProductInput[] + createMany?: PromotionCreateManyProductInputEnvelope + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + } + + export type BranchAllocationItemUncheckedCreateNestedManyWithoutProductInput = { + create?: XOR<BranchAllocationItemCreateWithoutProductInput, BranchAllocationItemUncheckedCreateWithoutProductInput> | BranchAllocationItemCreateWithoutProductInput[] | BranchAllocationItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: BranchAllocationItemCreateOrConnectWithoutProductInput | BranchAllocationItemCreateOrConnectWithoutProductInput[] + createMany?: BranchAllocationItemCreateManyProductInputEnvelope + connect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + } + export type CategoryUpdateOneWithoutProductsNestedInput = { create?: XOR<CategoryCreateWithoutProductsInput, CategoryUncheckedCreateWithoutProductsInput> connectOrCreate?: CategoryCreateOrConnectWithoutProductsInput @@ -30722,6 +51045,48 @@ export namespace Prisma { deleteMany?: CollectionProductScalarWhereInput | CollectionProductScalarWhereInput[] } + export type CommentUpdateManyWithoutProductNestedInput = { + create?: XOR<CommentCreateWithoutProductInput, CommentUncheckedCreateWithoutProductInput> | CommentCreateWithoutProductInput[] | CommentUncheckedCreateWithoutProductInput[] + connectOrCreate?: CommentCreateOrConnectWithoutProductInput | CommentCreateOrConnectWithoutProductInput[] + upsert?: CommentUpsertWithWhereUniqueWithoutProductInput | CommentUpsertWithWhereUniqueWithoutProductInput[] + createMany?: CommentCreateManyProductInputEnvelope + set?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + disconnect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + delete?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + update?: CommentUpdateWithWhereUniqueWithoutProductInput | CommentUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: CommentUpdateManyWithWhereWithoutProductInput | CommentUpdateManyWithWhereWithoutProductInput[] + deleteMany?: CommentScalarWhereInput | CommentScalarWhereInput[] + } + + export type PromotionUpdateManyWithoutProductNestedInput = { + create?: XOR<PromotionCreateWithoutProductInput, PromotionUncheckedCreateWithoutProductInput> | PromotionCreateWithoutProductInput[] | PromotionUncheckedCreateWithoutProductInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutProductInput | PromotionCreateOrConnectWithoutProductInput[] + upsert?: PromotionUpsertWithWhereUniqueWithoutProductInput | PromotionUpsertWithWhereUniqueWithoutProductInput[] + createMany?: PromotionCreateManyProductInputEnvelope + set?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + disconnect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + delete?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + update?: PromotionUpdateWithWhereUniqueWithoutProductInput | PromotionUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: PromotionUpdateManyWithWhereWithoutProductInput | PromotionUpdateManyWithWhereWithoutProductInput[] + deleteMany?: PromotionScalarWhereInput | PromotionScalarWhereInput[] + } + + export type BranchAllocationItemUpdateManyWithoutProductNestedInput = { + create?: XOR<BranchAllocationItemCreateWithoutProductInput, BranchAllocationItemUncheckedCreateWithoutProductInput> | BranchAllocationItemCreateWithoutProductInput[] | BranchAllocationItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: BranchAllocationItemCreateOrConnectWithoutProductInput | BranchAllocationItemCreateOrConnectWithoutProductInput[] + upsert?: BranchAllocationItemUpsertWithWhereUniqueWithoutProductInput | BranchAllocationItemUpsertWithWhereUniqueWithoutProductInput[] + createMany?: BranchAllocationItemCreateManyProductInputEnvelope + set?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + disconnect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + delete?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + connect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + update?: BranchAllocationItemUpdateWithWhereUniqueWithoutProductInput | BranchAllocationItemUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: BranchAllocationItemUpdateManyWithWhereWithoutProductInput | BranchAllocationItemUpdateManyWithWhereWithoutProductInput[] + deleteMany?: BranchAllocationItemScalarWhereInput | BranchAllocationItemScalarWhereInput[] + } + export type ProductVariantUncheckedUpdateManyWithoutProductNestedInput = { create?: XOR<ProductVariantCreateWithoutProductInput, ProductVariantUncheckedCreateWithoutProductInput> | ProductVariantCreateWithoutProductInput[] | ProductVariantUncheckedCreateWithoutProductInput[] connectOrCreate?: ProductVariantCreateOrConnectWithoutProductInput | ProductVariantCreateOrConnectWithoutProductInput[] @@ -30764,20 +51129,54 @@ export namespace Prisma { deleteMany?: CollectionProductScalarWhereInput | CollectionProductScalarWhereInput[] } + export type CommentUncheckedUpdateManyWithoutProductNestedInput = { + create?: XOR<CommentCreateWithoutProductInput, CommentUncheckedCreateWithoutProductInput> | CommentCreateWithoutProductInput[] | CommentUncheckedCreateWithoutProductInput[] + connectOrCreate?: CommentCreateOrConnectWithoutProductInput | CommentCreateOrConnectWithoutProductInput[] + upsert?: CommentUpsertWithWhereUniqueWithoutProductInput | CommentUpsertWithWhereUniqueWithoutProductInput[] + createMany?: CommentCreateManyProductInputEnvelope + set?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + disconnect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + delete?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + update?: CommentUpdateWithWhereUniqueWithoutProductInput | CommentUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: CommentUpdateManyWithWhereWithoutProductInput | CommentUpdateManyWithWhereWithoutProductInput[] + deleteMany?: CommentScalarWhereInput | CommentScalarWhereInput[] + } + + export type PromotionUncheckedUpdateManyWithoutProductNestedInput = { + create?: XOR<PromotionCreateWithoutProductInput, PromotionUncheckedCreateWithoutProductInput> | PromotionCreateWithoutProductInput[] | PromotionUncheckedCreateWithoutProductInput[] + connectOrCreate?: PromotionCreateOrConnectWithoutProductInput | PromotionCreateOrConnectWithoutProductInput[] + upsert?: PromotionUpsertWithWhereUniqueWithoutProductInput | PromotionUpsertWithWhereUniqueWithoutProductInput[] + createMany?: PromotionCreateManyProductInputEnvelope + set?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + disconnect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + delete?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + connect?: PromotionWhereUniqueInput | PromotionWhereUniqueInput[] + update?: PromotionUpdateWithWhereUniqueWithoutProductInput | PromotionUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: PromotionUpdateManyWithWhereWithoutProductInput | PromotionUpdateManyWithWhereWithoutProductInput[] + deleteMany?: PromotionScalarWhereInput | PromotionScalarWhereInput[] + } + + export type BranchAllocationItemUncheckedUpdateManyWithoutProductNestedInput = { + create?: XOR<BranchAllocationItemCreateWithoutProductInput, BranchAllocationItemUncheckedCreateWithoutProductInput> | BranchAllocationItemCreateWithoutProductInput[] | BranchAllocationItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: BranchAllocationItemCreateOrConnectWithoutProductInput | BranchAllocationItemCreateOrConnectWithoutProductInput[] + upsert?: BranchAllocationItemUpsertWithWhereUniqueWithoutProductInput | BranchAllocationItemUpsertWithWhereUniqueWithoutProductInput[] + createMany?: BranchAllocationItemCreateManyProductInputEnvelope + set?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + disconnect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + delete?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + connect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + update?: BranchAllocationItemUpdateWithWhereUniqueWithoutProductInput | BranchAllocationItemUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: BranchAllocationItemUpdateManyWithWhereWithoutProductInput | BranchAllocationItemUpdateManyWithWhereWithoutProductInput[] + deleteMany?: BranchAllocationItemScalarWhereInput | BranchAllocationItemScalarWhereInput[] + } + export type ProductCreateNestedOneWithoutImagesInput = { create?: XOR<ProductCreateWithoutImagesInput, ProductUncheckedCreateWithoutImagesInput> connectOrCreate?: ProductCreateOrConnectWithoutImagesInput connect?: ProductWhereUniqueInput } - export type IntFieldUpdateOperationsInput = { - set?: number - increment?: number - decrement?: number - multiply?: number - divide?: number - } - export type ProductUpdateOneRequiredWithoutImagesNestedInput = { create?: XOR<ProductCreateWithoutImagesInput, ProductUncheckedCreateWithoutImagesInput> connectOrCreate?: ProductCreateOrConnectWithoutImagesInput @@ -30908,6 +51307,10 @@ export namespace Prisma { connect?: PreOrderWhereUniqueInput } + export type EnumOrderChannelFieldUpdateOperationsInput = { + set?: $Enums.OrderChannel + } + export type EnumOrderStatusFieldUpdateOperationsInput = { set?: $Enums.OrderStatus } @@ -31268,14 +51671,6 @@ export namespace Prisma { set?: $Enums.LedgerSourceType } - export type NullableIntFieldUpdateOperationsInput = { - set?: number | null - increment?: number - decrement?: number - multiply?: number - divide?: number - } - export type CustomerUpdateOneRequiredWithoutLedgerEntriesNestedInput = { create?: XOR<CustomerCreateWithoutLedgerEntriesInput, CustomerUncheckedCreateWithoutLedgerEntriesInput> connectOrCreate?: CustomerCreateOrConnectWithoutLedgerEntriesInput @@ -31318,6 +51713,544 @@ export namespace Prisma { update?: XOR<XOR<CustomerUpdateToOneWithWhereWithoutWalletBonusesInput, CustomerUpdateWithoutWalletBonusesInput>, CustomerUncheckedUpdateWithoutWalletBonusesInput> } + export type PermissionCreateNestedManyWithoutUserTypeInput = { + create?: XOR<PermissionCreateWithoutUserTypeInput, PermissionUncheckedCreateWithoutUserTypeInput> | PermissionCreateWithoutUserTypeInput[] | PermissionUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: PermissionCreateOrConnectWithoutUserTypeInput | PermissionCreateOrConnectWithoutUserTypeInput[] + createMany?: PermissionCreateManyUserTypeInputEnvelope + connect?: PermissionWhereUniqueInput | PermissionWhereUniqueInput[] + } + + export type AdminUserCreateNestedManyWithoutUserTypeInput = { + create?: XOR<AdminUserCreateWithoutUserTypeInput, AdminUserUncheckedCreateWithoutUserTypeInput> | AdminUserCreateWithoutUserTypeInput[] | AdminUserUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: AdminUserCreateOrConnectWithoutUserTypeInput | AdminUserCreateOrConnectWithoutUserTypeInput[] + createMany?: AdminUserCreateManyUserTypeInputEnvelope + connect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] + } + + export type PermissionUncheckedCreateNestedManyWithoutUserTypeInput = { + create?: XOR<PermissionCreateWithoutUserTypeInput, PermissionUncheckedCreateWithoutUserTypeInput> | PermissionCreateWithoutUserTypeInput[] | PermissionUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: PermissionCreateOrConnectWithoutUserTypeInput | PermissionCreateOrConnectWithoutUserTypeInput[] + createMany?: PermissionCreateManyUserTypeInputEnvelope + connect?: PermissionWhereUniqueInput | PermissionWhereUniqueInput[] + } + + export type AdminUserUncheckedCreateNestedManyWithoutUserTypeInput = { + create?: XOR<AdminUserCreateWithoutUserTypeInput, AdminUserUncheckedCreateWithoutUserTypeInput> | AdminUserCreateWithoutUserTypeInput[] | AdminUserUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: AdminUserCreateOrConnectWithoutUserTypeInput | AdminUserCreateOrConnectWithoutUserTypeInput[] + createMany?: AdminUserCreateManyUserTypeInputEnvelope + connect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] + } + + export type PermissionUpdateManyWithoutUserTypeNestedInput = { + create?: XOR<PermissionCreateWithoutUserTypeInput, PermissionUncheckedCreateWithoutUserTypeInput> | PermissionCreateWithoutUserTypeInput[] | PermissionUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: PermissionCreateOrConnectWithoutUserTypeInput | PermissionCreateOrConnectWithoutUserTypeInput[] + upsert?: PermissionUpsertWithWhereUniqueWithoutUserTypeInput | PermissionUpsertWithWhereUniqueWithoutUserTypeInput[] + createMany?: PermissionCreateManyUserTypeInputEnvelope + set?: PermissionWhereUniqueInput | PermissionWhereUniqueInput[] + disconnect?: PermissionWhereUniqueInput | PermissionWhereUniqueInput[] + delete?: PermissionWhereUniqueInput | PermissionWhereUniqueInput[] + connect?: PermissionWhereUniqueInput | PermissionWhereUniqueInput[] + update?: PermissionUpdateWithWhereUniqueWithoutUserTypeInput | PermissionUpdateWithWhereUniqueWithoutUserTypeInput[] + updateMany?: PermissionUpdateManyWithWhereWithoutUserTypeInput | PermissionUpdateManyWithWhereWithoutUserTypeInput[] + deleteMany?: PermissionScalarWhereInput | PermissionScalarWhereInput[] + } + + export type AdminUserUpdateManyWithoutUserTypeNestedInput = { + create?: XOR<AdminUserCreateWithoutUserTypeInput, AdminUserUncheckedCreateWithoutUserTypeInput> | AdminUserCreateWithoutUserTypeInput[] | AdminUserUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: AdminUserCreateOrConnectWithoutUserTypeInput | AdminUserCreateOrConnectWithoutUserTypeInput[] + upsert?: AdminUserUpsertWithWhereUniqueWithoutUserTypeInput | AdminUserUpsertWithWhereUniqueWithoutUserTypeInput[] + createMany?: AdminUserCreateManyUserTypeInputEnvelope + set?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] + disconnect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] + delete?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] + connect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] + update?: AdminUserUpdateWithWhereUniqueWithoutUserTypeInput | AdminUserUpdateWithWhereUniqueWithoutUserTypeInput[] + updateMany?: AdminUserUpdateManyWithWhereWithoutUserTypeInput | AdminUserUpdateManyWithWhereWithoutUserTypeInput[] + deleteMany?: AdminUserScalarWhereInput | AdminUserScalarWhereInput[] + } + + export type PermissionUncheckedUpdateManyWithoutUserTypeNestedInput = { + create?: XOR<PermissionCreateWithoutUserTypeInput, PermissionUncheckedCreateWithoutUserTypeInput> | PermissionCreateWithoutUserTypeInput[] | PermissionUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: PermissionCreateOrConnectWithoutUserTypeInput | PermissionCreateOrConnectWithoutUserTypeInput[] + upsert?: PermissionUpsertWithWhereUniqueWithoutUserTypeInput | PermissionUpsertWithWhereUniqueWithoutUserTypeInput[] + createMany?: PermissionCreateManyUserTypeInputEnvelope + set?: PermissionWhereUniqueInput | PermissionWhereUniqueInput[] + disconnect?: PermissionWhereUniqueInput | PermissionWhereUniqueInput[] + delete?: PermissionWhereUniqueInput | PermissionWhereUniqueInput[] + connect?: PermissionWhereUniqueInput | PermissionWhereUniqueInput[] + update?: PermissionUpdateWithWhereUniqueWithoutUserTypeInput | PermissionUpdateWithWhereUniqueWithoutUserTypeInput[] + updateMany?: PermissionUpdateManyWithWhereWithoutUserTypeInput | PermissionUpdateManyWithWhereWithoutUserTypeInput[] + deleteMany?: PermissionScalarWhereInput | PermissionScalarWhereInput[] + } + + export type AdminUserUncheckedUpdateManyWithoutUserTypeNestedInput = { + create?: XOR<AdminUserCreateWithoutUserTypeInput, AdminUserUncheckedCreateWithoutUserTypeInput> | AdminUserCreateWithoutUserTypeInput[] | AdminUserUncheckedCreateWithoutUserTypeInput[] + connectOrCreate?: AdminUserCreateOrConnectWithoutUserTypeInput | AdminUserCreateOrConnectWithoutUserTypeInput[] + upsert?: AdminUserUpsertWithWhereUniqueWithoutUserTypeInput | AdminUserUpsertWithWhereUniqueWithoutUserTypeInput[] + createMany?: AdminUserCreateManyUserTypeInputEnvelope + set?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] + disconnect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] + delete?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] + connect?: AdminUserWhereUniqueInput | AdminUserWhereUniqueInput[] + update?: AdminUserUpdateWithWhereUniqueWithoutUserTypeInput | AdminUserUpdateWithWhereUniqueWithoutUserTypeInput[] + updateMany?: AdminUserUpdateManyWithWhereWithoutUserTypeInput | AdminUserUpdateManyWithWhereWithoutUserTypeInput[] + deleteMany?: AdminUserScalarWhereInput | AdminUserScalarWhereInput[] + } + + export type UserTypeCreateNestedOneWithoutPermissionsInput = { + create?: XOR<UserTypeCreateWithoutPermissionsInput, UserTypeUncheckedCreateWithoutPermissionsInput> + connectOrCreate?: UserTypeCreateOrConnectWithoutPermissionsInput + connect?: UserTypeWhereUniqueInput + } + + export type UserTypeUpdateOneRequiredWithoutPermissionsNestedInput = { + create?: XOR<UserTypeCreateWithoutPermissionsInput, UserTypeUncheckedCreateWithoutPermissionsInput> + connectOrCreate?: UserTypeCreateOrConnectWithoutPermissionsInput + upsert?: UserTypeUpsertWithoutPermissionsInput + connect?: UserTypeWhereUniqueInput + update?: XOR<XOR<UserTypeUpdateToOneWithWhereWithoutPermissionsInput, UserTypeUpdateWithoutPermissionsInput>, UserTypeUncheckedUpdateWithoutPermissionsInput> + } + + export type ProductCreateNestedOneWithoutCommentsInput = { + create?: XOR<ProductCreateWithoutCommentsInput, ProductUncheckedCreateWithoutCommentsInput> + connectOrCreate?: ProductCreateOrConnectWithoutCommentsInput + connect?: ProductWhereUniqueInput + } + + export type CustomerCreateNestedOneWithoutCommentsInput = { + create?: XOR<CustomerCreateWithoutCommentsInput, CustomerUncheckedCreateWithoutCommentsInput> + connectOrCreate?: CustomerCreateOrConnectWithoutCommentsInput + connect?: CustomerWhereUniqueInput + } + + export type CommentCreateNestedOneWithoutRepliesInput = { + create?: XOR<CommentCreateWithoutRepliesInput, CommentUncheckedCreateWithoutRepliesInput> + connectOrCreate?: CommentCreateOrConnectWithoutRepliesInput + connect?: CommentWhereUniqueInput + } + + export type CommentCreateNestedManyWithoutReplyToInput = { + create?: XOR<CommentCreateWithoutReplyToInput, CommentUncheckedCreateWithoutReplyToInput> | CommentCreateWithoutReplyToInput[] | CommentUncheckedCreateWithoutReplyToInput[] + connectOrCreate?: CommentCreateOrConnectWithoutReplyToInput | CommentCreateOrConnectWithoutReplyToInput[] + createMany?: CommentCreateManyReplyToInputEnvelope + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + } + + export type CommentUncheckedCreateNestedManyWithoutReplyToInput = { + create?: XOR<CommentCreateWithoutReplyToInput, CommentUncheckedCreateWithoutReplyToInput> | CommentCreateWithoutReplyToInput[] | CommentUncheckedCreateWithoutReplyToInput[] + connectOrCreate?: CommentCreateOrConnectWithoutReplyToInput | CommentCreateOrConnectWithoutReplyToInput[] + createMany?: CommentCreateManyReplyToInputEnvelope + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + } + + export type EnumCommentStatusFieldUpdateOperationsInput = { + set?: $Enums.CommentStatus + } + + export type ProductUpdateOneRequiredWithoutCommentsNestedInput = { + create?: XOR<ProductCreateWithoutCommentsInput, ProductUncheckedCreateWithoutCommentsInput> + connectOrCreate?: ProductCreateOrConnectWithoutCommentsInput + upsert?: ProductUpsertWithoutCommentsInput + connect?: ProductWhereUniqueInput + update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutCommentsInput, ProductUpdateWithoutCommentsInput>, ProductUncheckedUpdateWithoutCommentsInput> + } + + export type CustomerUpdateOneRequiredWithoutCommentsNestedInput = { + create?: XOR<CustomerCreateWithoutCommentsInput, CustomerUncheckedCreateWithoutCommentsInput> + connectOrCreate?: CustomerCreateOrConnectWithoutCommentsInput + upsert?: CustomerUpsertWithoutCommentsInput + connect?: CustomerWhereUniqueInput + update?: XOR<XOR<CustomerUpdateToOneWithWhereWithoutCommentsInput, CustomerUpdateWithoutCommentsInput>, CustomerUncheckedUpdateWithoutCommentsInput> + } + + export type CommentUpdateOneWithoutRepliesNestedInput = { + create?: XOR<CommentCreateWithoutRepliesInput, CommentUncheckedCreateWithoutRepliesInput> + connectOrCreate?: CommentCreateOrConnectWithoutRepliesInput + upsert?: CommentUpsertWithoutRepliesInput + disconnect?: CommentWhereInput | boolean + delete?: CommentWhereInput | boolean + connect?: CommentWhereUniqueInput + update?: XOR<XOR<CommentUpdateToOneWithWhereWithoutRepliesInput, CommentUpdateWithoutRepliesInput>, CommentUncheckedUpdateWithoutRepliesInput> + } + + export type CommentUpdateManyWithoutReplyToNestedInput = { + create?: XOR<CommentCreateWithoutReplyToInput, CommentUncheckedCreateWithoutReplyToInput> | CommentCreateWithoutReplyToInput[] | CommentUncheckedCreateWithoutReplyToInput[] + connectOrCreate?: CommentCreateOrConnectWithoutReplyToInput | CommentCreateOrConnectWithoutReplyToInput[] + upsert?: CommentUpsertWithWhereUniqueWithoutReplyToInput | CommentUpsertWithWhereUniqueWithoutReplyToInput[] + createMany?: CommentCreateManyReplyToInputEnvelope + set?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + disconnect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + delete?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + update?: CommentUpdateWithWhereUniqueWithoutReplyToInput | CommentUpdateWithWhereUniqueWithoutReplyToInput[] + updateMany?: CommentUpdateManyWithWhereWithoutReplyToInput | CommentUpdateManyWithWhereWithoutReplyToInput[] + deleteMany?: CommentScalarWhereInput | CommentScalarWhereInput[] + } + + export type CommentUncheckedUpdateManyWithoutReplyToNestedInput = { + create?: XOR<CommentCreateWithoutReplyToInput, CommentUncheckedCreateWithoutReplyToInput> | CommentCreateWithoutReplyToInput[] | CommentUncheckedCreateWithoutReplyToInput[] + connectOrCreate?: CommentCreateOrConnectWithoutReplyToInput | CommentCreateOrConnectWithoutReplyToInput[] + upsert?: CommentUpsertWithWhereUniqueWithoutReplyToInput | CommentUpsertWithWhereUniqueWithoutReplyToInput[] + createMany?: CommentCreateManyReplyToInputEnvelope + set?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + disconnect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + delete?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + connect?: CommentWhereUniqueInput | CommentWhereUniqueInput[] + update?: CommentUpdateWithWhereUniqueWithoutReplyToInput | CommentUpdateWithWhereUniqueWithoutReplyToInput[] + updateMany?: CommentUpdateManyWithWhereWithoutReplyToInput | CommentUpdateManyWithWhereWithoutReplyToInput[] + deleteMany?: CommentScalarWhereInput | CommentScalarWhereInput[] + } + + export type ProductCreateNestedOneWithoutPromotionsInput = { + create?: XOR<ProductCreateWithoutPromotionsInput, ProductUncheckedCreateWithoutPromotionsInput> + connectOrCreate?: ProductCreateOrConnectWithoutPromotionsInput + connect?: ProductWhereUniqueInput + } + + export type CategoryCreateNestedOneWithoutPromotionsInput = { + create?: XOR<CategoryCreateWithoutPromotionsInput, CategoryUncheckedCreateWithoutPromotionsInput> + connectOrCreate?: CategoryCreateOrConnectWithoutPromotionsInput + connect?: CategoryWhereUniqueInput + } + + export type CustomerCreateNestedOneWithoutPromotionsInput = { + create?: XOR<CustomerCreateWithoutPromotionsInput, CustomerUncheckedCreateWithoutPromotionsInput> + connectOrCreate?: CustomerCreateOrConnectWithoutPromotionsInput + connect?: CustomerWhereUniqueInput + } + + export type BrandCreateNestedOneWithoutPromotionsInput = { + create?: XOR<BrandCreateWithoutPromotionsInput, BrandUncheckedCreateWithoutPromotionsInput> + connectOrCreate?: BrandCreateOrConnectWithoutPromotionsInput + connect?: BrandWhereUniqueInput + } + + export type EnumPromotionScopeFieldUpdateOperationsInput = { + set?: $Enums.PromotionScope + } + + export type EnumPromotionUsageFieldUpdateOperationsInput = { + set?: $Enums.PromotionUsage + } + + export type ProductUpdateOneWithoutPromotionsNestedInput = { + create?: XOR<ProductCreateWithoutPromotionsInput, ProductUncheckedCreateWithoutPromotionsInput> + connectOrCreate?: ProductCreateOrConnectWithoutPromotionsInput + upsert?: ProductUpsertWithoutPromotionsInput + disconnect?: ProductWhereInput | boolean + delete?: ProductWhereInput | boolean + connect?: ProductWhereUniqueInput + update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutPromotionsInput, ProductUpdateWithoutPromotionsInput>, ProductUncheckedUpdateWithoutPromotionsInput> + } + + export type CategoryUpdateOneWithoutPromotionsNestedInput = { + create?: XOR<CategoryCreateWithoutPromotionsInput, CategoryUncheckedCreateWithoutPromotionsInput> + connectOrCreate?: CategoryCreateOrConnectWithoutPromotionsInput + upsert?: CategoryUpsertWithoutPromotionsInput + disconnect?: CategoryWhereInput | boolean + delete?: CategoryWhereInput | boolean + connect?: CategoryWhereUniqueInput + update?: XOR<XOR<CategoryUpdateToOneWithWhereWithoutPromotionsInput, CategoryUpdateWithoutPromotionsInput>, CategoryUncheckedUpdateWithoutPromotionsInput> + } + + export type CustomerUpdateOneWithoutPromotionsNestedInput = { + create?: XOR<CustomerCreateWithoutPromotionsInput, CustomerUncheckedCreateWithoutPromotionsInput> + connectOrCreate?: CustomerCreateOrConnectWithoutPromotionsInput + upsert?: CustomerUpsertWithoutPromotionsInput + disconnect?: CustomerWhereInput | boolean + delete?: CustomerWhereInput | boolean + connect?: CustomerWhereUniqueInput + update?: XOR<XOR<CustomerUpdateToOneWithWhereWithoutPromotionsInput, CustomerUpdateWithoutPromotionsInput>, CustomerUncheckedUpdateWithoutPromotionsInput> + } + + export type BrandUpdateOneWithoutPromotionsNestedInput = { + create?: XOR<BrandCreateWithoutPromotionsInput, BrandUncheckedCreateWithoutPromotionsInput> + connectOrCreate?: BrandCreateOrConnectWithoutPromotionsInput + upsert?: BrandUpsertWithoutPromotionsInput + disconnect?: BrandWhereInput | boolean + delete?: BrandWhereInput | boolean + connect?: BrandWhereUniqueInput + update?: XOR<XOR<BrandUpdateToOneWithWhereWithoutPromotionsInput, BrandUpdateWithoutPromotionsInput>, BrandUncheckedUpdateWithoutPromotionsInput> + } + + export type BranchCreateNestedOneWithoutAllocationsInput = { + create?: XOR<BranchCreateWithoutAllocationsInput, BranchUncheckedCreateWithoutAllocationsInput> + connectOrCreate?: BranchCreateOrConnectWithoutAllocationsInput + connect?: BranchWhereUniqueInput + } + + export type AdminUserCreateNestedOneWithoutBranchAllocationsInput = { + create?: XOR<AdminUserCreateWithoutBranchAllocationsInput, AdminUserUncheckedCreateWithoutBranchAllocationsInput> + connectOrCreate?: AdminUserCreateOrConnectWithoutBranchAllocationsInput + connect?: AdminUserWhereUniqueInput + } + + export type BranchAllocationItemCreateNestedManyWithoutAllocationInput = { + create?: XOR<BranchAllocationItemCreateWithoutAllocationInput, BranchAllocationItemUncheckedCreateWithoutAllocationInput> | BranchAllocationItemCreateWithoutAllocationInput[] | BranchAllocationItemUncheckedCreateWithoutAllocationInput[] + connectOrCreate?: BranchAllocationItemCreateOrConnectWithoutAllocationInput | BranchAllocationItemCreateOrConnectWithoutAllocationInput[] + createMany?: BranchAllocationItemCreateManyAllocationInputEnvelope + connect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + } + + export type BranchAllocationItemUncheckedCreateNestedManyWithoutAllocationInput = { + create?: XOR<BranchAllocationItemCreateWithoutAllocationInput, BranchAllocationItemUncheckedCreateWithoutAllocationInput> | BranchAllocationItemCreateWithoutAllocationInput[] | BranchAllocationItemUncheckedCreateWithoutAllocationInput[] + connectOrCreate?: BranchAllocationItemCreateOrConnectWithoutAllocationInput | BranchAllocationItemCreateOrConnectWithoutAllocationInput[] + createMany?: BranchAllocationItemCreateManyAllocationInputEnvelope + connect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + } + + export type BranchUpdateOneRequiredWithoutAllocationsNestedInput = { + create?: XOR<BranchCreateWithoutAllocationsInput, BranchUncheckedCreateWithoutAllocationsInput> + connectOrCreate?: BranchCreateOrConnectWithoutAllocationsInput + upsert?: BranchUpsertWithoutAllocationsInput + connect?: BranchWhereUniqueInput + update?: XOR<XOR<BranchUpdateToOneWithWhereWithoutAllocationsInput, BranchUpdateWithoutAllocationsInput>, BranchUncheckedUpdateWithoutAllocationsInput> + } + + export type AdminUserUpdateOneWithoutBranchAllocationsNestedInput = { + create?: XOR<AdminUserCreateWithoutBranchAllocationsInput, AdminUserUncheckedCreateWithoutBranchAllocationsInput> + connectOrCreate?: AdminUserCreateOrConnectWithoutBranchAllocationsInput + upsert?: AdminUserUpsertWithoutBranchAllocationsInput + disconnect?: AdminUserWhereInput | boolean + delete?: AdminUserWhereInput | boolean + connect?: AdminUserWhereUniqueInput + update?: XOR<XOR<AdminUserUpdateToOneWithWhereWithoutBranchAllocationsInput, AdminUserUpdateWithoutBranchAllocationsInput>, AdminUserUncheckedUpdateWithoutBranchAllocationsInput> + } + + export type BranchAllocationItemUpdateManyWithoutAllocationNestedInput = { + create?: XOR<BranchAllocationItemCreateWithoutAllocationInput, BranchAllocationItemUncheckedCreateWithoutAllocationInput> | BranchAllocationItemCreateWithoutAllocationInput[] | BranchAllocationItemUncheckedCreateWithoutAllocationInput[] + connectOrCreate?: BranchAllocationItemCreateOrConnectWithoutAllocationInput | BranchAllocationItemCreateOrConnectWithoutAllocationInput[] + upsert?: BranchAllocationItemUpsertWithWhereUniqueWithoutAllocationInput | BranchAllocationItemUpsertWithWhereUniqueWithoutAllocationInput[] + createMany?: BranchAllocationItemCreateManyAllocationInputEnvelope + set?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + disconnect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + delete?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + connect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + update?: BranchAllocationItemUpdateWithWhereUniqueWithoutAllocationInput | BranchAllocationItemUpdateWithWhereUniqueWithoutAllocationInput[] + updateMany?: BranchAllocationItemUpdateManyWithWhereWithoutAllocationInput | BranchAllocationItemUpdateManyWithWhereWithoutAllocationInput[] + deleteMany?: BranchAllocationItemScalarWhereInput | BranchAllocationItemScalarWhereInput[] + } + + export type BranchAllocationItemUncheckedUpdateManyWithoutAllocationNestedInput = { + create?: XOR<BranchAllocationItemCreateWithoutAllocationInput, BranchAllocationItemUncheckedCreateWithoutAllocationInput> | BranchAllocationItemCreateWithoutAllocationInput[] | BranchAllocationItemUncheckedCreateWithoutAllocationInput[] + connectOrCreate?: BranchAllocationItemCreateOrConnectWithoutAllocationInput | BranchAllocationItemCreateOrConnectWithoutAllocationInput[] + upsert?: BranchAllocationItemUpsertWithWhereUniqueWithoutAllocationInput | BranchAllocationItemUpsertWithWhereUniqueWithoutAllocationInput[] + createMany?: BranchAllocationItemCreateManyAllocationInputEnvelope + set?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + disconnect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + delete?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + connect?: BranchAllocationItemWhereUniqueInput | BranchAllocationItemWhereUniqueInput[] + update?: BranchAllocationItemUpdateWithWhereUniqueWithoutAllocationInput | BranchAllocationItemUpdateWithWhereUniqueWithoutAllocationInput[] + updateMany?: BranchAllocationItemUpdateManyWithWhereWithoutAllocationInput | BranchAllocationItemUpdateManyWithWhereWithoutAllocationInput[] + deleteMany?: BranchAllocationItemScalarWhereInput | BranchAllocationItemScalarWhereInput[] + } + + export type BranchAllocationCreateNestedOneWithoutItemsInput = { + create?: XOR<BranchAllocationCreateWithoutItemsInput, BranchAllocationUncheckedCreateWithoutItemsInput> + connectOrCreate?: BranchAllocationCreateOrConnectWithoutItemsInput + connect?: BranchAllocationWhereUniqueInput + } + + export type ProductCreateNestedOneWithoutAllocationItemsInput = { + create?: XOR<ProductCreateWithoutAllocationItemsInput, ProductUncheckedCreateWithoutAllocationItemsInput> + connectOrCreate?: ProductCreateOrConnectWithoutAllocationItemsInput + connect?: ProductWhereUniqueInput + } + + export type BranchAllocationUpdateOneRequiredWithoutItemsNestedInput = { + create?: XOR<BranchAllocationCreateWithoutItemsInput, BranchAllocationUncheckedCreateWithoutItemsInput> + connectOrCreate?: BranchAllocationCreateOrConnectWithoutItemsInput + upsert?: BranchAllocationUpsertWithoutItemsInput + connect?: BranchAllocationWhereUniqueInput + update?: XOR<XOR<BranchAllocationUpdateToOneWithWhereWithoutItemsInput, BranchAllocationUpdateWithoutItemsInput>, BranchAllocationUncheckedUpdateWithoutItemsInput> + } + + export type ProductUpdateOneRequiredWithoutAllocationItemsNestedInput = { + create?: XOR<ProductCreateWithoutAllocationItemsInput, ProductUncheckedCreateWithoutAllocationItemsInput> + connectOrCreate?: ProductCreateOrConnectWithoutAllocationItemsInput + upsert?: ProductUpsertWithoutAllocationItemsInput + connect?: ProductWhereUniqueInput + update?: XOR<XOR<ProductUpdateToOneWithWhereWithoutAllocationItemsInput, ProductUpdateWithoutAllocationItemsInput>, ProductUncheckedUpdateWithoutAllocationItemsInput> + } + + export type AdminUserCreateNestedOneWithoutSentSmsMessagesInput = { + create?: XOR<AdminUserCreateWithoutSentSmsMessagesInput, AdminUserUncheckedCreateWithoutSentSmsMessagesInput> + connectOrCreate?: AdminUserCreateOrConnectWithoutSentSmsMessagesInput + connect?: AdminUserWhereUniqueInput + } + + export type EnumMessageAudienceFieldUpdateOperationsInput = { + set?: $Enums.MessageAudience + } + + export type AdminUserUpdateOneWithoutSentSmsMessagesNestedInput = { + create?: XOR<AdminUserCreateWithoutSentSmsMessagesInput, AdminUserUncheckedCreateWithoutSentSmsMessagesInput> + connectOrCreate?: AdminUserCreateOrConnectWithoutSentSmsMessagesInput + upsert?: AdminUserUpsertWithoutSentSmsMessagesInput + disconnect?: AdminUserWhereInput | boolean + delete?: AdminUserWhereInput | boolean + connect?: AdminUserWhereUniqueInput + update?: XOR<XOR<AdminUserUpdateToOneWithWhereWithoutSentSmsMessagesInput, AdminUserUpdateWithoutSentSmsMessagesInput>, AdminUserUncheckedUpdateWithoutSentSmsMessagesInput> + } + + export type AdminUserCreateNestedOneWithoutSentNotificationsInput = { + create?: XOR<AdminUserCreateWithoutSentNotificationsInput, AdminUserUncheckedCreateWithoutSentNotificationsInput> + connectOrCreate?: AdminUserCreateOrConnectWithoutSentNotificationsInput + connect?: AdminUserWhereUniqueInput + } + + export type NotificationRecipientCreateNestedManyWithoutNotificationInput = { + create?: XOR<NotificationRecipientCreateWithoutNotificationInput, NotificationRecipientUncheckedCreateWithoutNotificationInput> | NotificationRecipientCreateWithoutNotificationInput[] | NotificationRecipientUncheckedCreateWithoutNotificationInput[] + connectOrCreate?: NotificationRecipientCreateOrConnectWithoutNotificationInput | NotificationRecipientCreateOrConnectWithoutNotificationInput[] + createMany?: NotificationRecipientCreateManyNotificationInputEnvelope + connect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + } + + export type NotificationRecipientUncheckedCreateNestedManyWithoutNotificationInput = { + create?: XOR<NotificationRecipientCreateWithoutNotificationInput, NotificationRecipientUncheckedCreateWithoutNotificationInput> | NotificationRecipientCreateWithoutNotificationInput[] | NotificationRecipientUncheckedCreateWithoutNotificationInput[] + connectOrCreate?: NotificationRecipientCreateOrConnectWithoutNotificationInput | NotificationRecipientCreateOrConnectWithoutNotificationInput[] + createMany?: NotificationRecipientCreateManyNotificationInputEnvelope + connect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + } + + export type AdminUserUpdateOneWithoutSentNotificationsNestedInput = { + create?: XOR<AdminUserCreateWithoutSentNotificationsInput, AdminUserUncheckedCreateWithoutSentNotificationsInput> + connectOrCreate?: AdminUserCreateOrConnectWithoutSentNotificationsInput + upsert?: AdminUserUpsertWithoutSentNotificationsInput + disconnect?: AdminUserWhereInput | boolean + delete?: AdminUserWhereInput | boolean + connect?: AdminUserWhereUniqueInput + update?: XOR<XOR<AdminUserUpdateToOneWithWhereWithoutSentNotificationsInput, AdminUserUpdateWithoutSentNotificationsInput>, AdminUserUncheckedUpdateWithoutSentNotificationsInput> + } + + export type NotificationRecipientUpdateManyWithoutNotificationNestedInput = { + create?: XOR<NotificationRecipientCreateWithoutNotificationInput, NotificationRecipientUncheckedCreateWithoutNotificationInput> | NotificationRecipientCreateWithoutNotificationInput[] | NotificationRecipientUncheckedCreateWithoutNotificationInput[] + connectOrCreate?: NotificationRecipientCreateOrConnectWithoutNotificationInput | NotificationRecipientCreateOrConnectWithoutNotificationInput[] + upsert?: NotificationRecipientUpsertWithWhereUniqueWithoutNotificationInput | NotificationRecipientUpsertWithWhereUniqueWithoutNotificationInput[] + createMany?: NotificationRecipientCreateManyNotificationInputEnvelope + set?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + disconnect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + delete?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + connect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + update?: NotificationRecipientUpdateWithWhereUniqueWithoutNotificationInput | NotificationRecipientUpdateWithWhereUniqueWithoutNotificationInput[] + updateMany?: NotificationRecipientUpdateManyWithWhereWithoutNotificationInput | NotificationRecipientUpdateManyWithWhereWithoutNotificationInput[] + deleteMany?: NotificationRecipientScalarWhereInput | NotificationRecipientScalarWhereInput[] + } + + export type NotificationRecipientUncheckedUpdateManyWithoutNotificationNestedInput = { + create?: XOR<NotificationRecipientCreateWithoutNotificationInput, NotificationRecipientUncheckedCreateWithoutNotificationInput> | NotificationRecipientCreateWithoutNotificationInput[] | NotificationRecipientUncheckedCreateWithoutNotificationInput[] + connectOrCreate?: NotificationRecipientCreateOrConnectWithoutNotificationInput | NotificationRecipientCreateOrConnectWithoutNotificationInput[] + upsert?: NotificationRecipientUpsertWithWhereUniqueWithoutNotificationInput | NotificationRecipientUpsertWithWhereUniqueWithoutNotificationInput[] + createMany?: NotificationRecipientCreateManyNotificationInputEnvelope + set?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + disconnect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + delete?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + connect?: NotificationRecipientWhereUniqueInput | NotificationRecipientWhereUniqueInput[] + update?: NotificationRecipientUpdateWithWhereUniqueWithoutNotificationInput | NotificationRecipientUpdateWithWhereUniqueWithoutNotificationInput[] + updateMany?: NotificationRecipientUpdateManyWithWhereWithoutNotificationInput | NotificationRecipientUpdateManyWithWhereWithoutNotificationInput[] + deleteMany?: NotificationRecipientScalarWhereInput | NotificationRecipientScalarWhereInput[] + } + + export type NotificationCreateNestedOneWithoutRecipientsInput = { + create?: XOR<NotificationCreateWithoutRecipientsInput, NotificationUncheckedCreateWithoutRecipientsInput> + connectOrCreate?: NotificationCreateOrConnectWithoutRecipientsInput + connect?: NotificationWhereUniqueInput + } + + export type CustomerCreateNestedOneWithoutNotificationsInput = { + create?: XOR<CustomerCreateWithoutNotificationsInput, CustomerUncheckedCreateWithoutNotificationsInput> + connectOrCreate?: CustomerCreateOrConnectWithoutNotificationsInput + connect?: CustomerWhereUniqueInput + } + + export type NotificationUpdateOneRequiredWithoutRecipientsNestedInput = { + create?: XOR<NotificationCreateWithoutRecipientsInput, NotificationUncheckedCreateWithoutRecipientsInput> + connectOrCreate?: NotificationCreateOrConnectWithoutRecipientsInput + upsert?: NotificationUpsertWithoutRecipientsInput + connect?: NotificationWhereUniqueInput + update?: XOR<XOR<NotificationUpdateToOneWithWhereWithoutRecipientsInput, NotificationUpdateWithoutRecipientsInput>, NotificationUncheckedUpdateWithoutRecipientsInput> + } + + export type CustomerUpdateOneRequiredWithoutNotificationsNestedInput = { + create?: XOR<CustomerCreateWithoutNotificationsInput, CustomerUncheckedCreateWithoutNotificationsInput> + connectOrCreate?: CustomerCreateOrConnectWithoutNotificationsInput + upsert?: CustomerUpsertWithoutNotificationsInput + connect?: CustomerWhereUniqueInput + update?: XOR<XOR<CustomerUpdateToOneWithWhereWithoutNotificationsInput, CustomerUpdateWithoutNotificationsInput>, CustomerUncheckedUpdateWithoutNotificationsInput> + } + + export type CustomerCreateNestedOneWithoutActivityLogsInput = { + create?: XOR<CustomerCreateWithoutActivityLogsInput, CustomerUncheckedCreateWithoutActivityLogsInput> + connectOrCreate?: CustomerCreateOrConnectWithoutActivityLogsInput + connect?: CustomerWhereUniqueInput + } + + export type CustomerUpdateOneRequiredWithoutActivityLogsNestedInput = { + create?: XOR<CustomerCreateWithoutActivityLogsInput, CustomerUncheckedCreateWithoutActivityLogsInput> + connectOrCreate?: CustomerCreateOrConnectWithoutActivityLogsInput + upsert?: CustomerUpsertWithoutActivityLogsInput + connect?: CustomerWhereUniqueInput + update?: XOR<XOR<CustomerUpdateToOneWithWhereWithoutActivityLogsInput, CustomerUpdateWithoutActivityLogsInput>, CustomerUncheckedUpdateWithoutActivityLogsInput> + } + + export type AdminUserCreateNestedOneWithoutUploadedFilesInput = { + create?: XOR<AdminUserCreateWithoutUploadedFilesInput, AdminUserUncheckedCreateWithoutUploadedFilesInput> + connectOrCreate?: AdminUserCreateOrConnectWithoutUploadedFilesInput + connect?: AdminUserWhereUniqueInput + } + + export type CustomerCreateNestedManyWithoutAvatarFileInput = { + create?: XOR<CustomerCreateWithoutAvatarFileInput, CustomerUncheckedCreateWithoutAvatarFileInput> | CustomerCreateWithoutAvatarFileInput[] | CustomerUncheckedCreateWithoutAvatarFileInput[] + connectOrCreate?: CustomerCreateOrConnectWithoutAvatarFileInput | CustomerCreateOrConnectWithoutAvatarFileInput[] + createMany?: CustomerCreateManyAvatarFileInputEnvelope + connect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] + } + + export type CustomerUncheckedCreateNestedManyWithoutAvatarFileInput = { + create?: XOR<CustomerCreateWithoutAvatarFileInput, CustomerUncheckedCreateWithoutAvatarFileInput> | CustomerCreateWithoutAvatarFileInput[] | CustomerUncheckedCreateWithoutAvatarFileInput[] + connectOrCreate?: CustomerCreateOrConnectWithoutAvatarFileInput | CustomerCreateOrConnectWithoutAvatarFileInput[] + createMany?: CustomerCreateManyAvatarFileInputEnvelope + connect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] + } + + export type AdminUserUpdateOneWithoutUploadedFilesNestedInput = { + create?: XOR<AdminUserCreateWithoutUploadedFilesInput, AdminUserUncheckedCreateWithoutUploadedFilesInput> + connectOrCreate?: AdminUserCreateOrConnectWithoutUploadedFilesInput + upsert?: AdminUserUpsertWithoutUploadedFilesInput + disconnect?: AdminUserWhereInput | boolean + delete?: AdminUserWhereInput | boolean + connect?: AdminUserWhereUniqueInput + update?: XOR<XOR<AdminUserUpdateToOneWithWhereWithoutUploadedFilesInput, AdminUserUpdateWithoutUploadedFilesInput>, AdminUserUncheckedUpdateWithoutUploadedFilesInput> + } + + export type CustomerUpdateManyWithoutAvatarFileNestedInput = { + create?: XOR<CustomerCreateWithoutAvatarFileInput, CustomerUncheckedCreateWithoutAvatarFileInput> | CustomerCreateWithoutAvatarFileInput[] | CustomerUncheckedCreateWithoutAvatarFileInput[] + connectOrCreate?: CustomerCreateOrConnectWithoutAvatarFileInput | CustomerCreateOrConnectWithoutAvatarFileInput[] + upsert?: CustomerUpsertWithWhereUniqueWithoutAvatarFileInput | CustomerUpsertWithWhereUniqueWithoutAvatarFileInput[] + createMany?: CustomerCreateManyAvatarFileInputEnvelope + set?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] + disconnect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] + delete?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] + connect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] + update?: CustomerUpdateWithWhereUniqueWithoutAvatarFileInput | CustomerUpdateWithWhereUniqueWithoutAvatarFileInput[] + updateMany?: CustomerUpdateManyWithWhereWithoutAvatarFileInput | CustomerUpdateManyWithWhereWithoutAvatarFileInput[] + deleteMany?: CustomerScalarWhereInput | CustomerScalarWhereInput[] + } + + export type CustomerUncheckedUpdateManyWithoutAvatarFileNestedInput = { + create?: XOR<CustomerCreateWithoutAvatarFileInput, CustomerUncheckedCreateWithoutAvatarFileInput> | CustomerCreateWithoutAvatarFileInput[] | CustomerUncheckedCreateWithoutAvatarFileInput[] + connectOrCreate?: CustomerCreateOrConnectWithoutAvatarFileInput | CustomerCreateOrConnectWithoutAvatarFileInput[] + upsert?: CustomerUpsertWithWhereUniqueWithoutAvatarFileInput | CustomerUpsertWithWhereUniqueWithoutAvatarFileInput[] + createMany?: CustomerCreateManyAvatarFileInputEnvelope + set?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] + disconnect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] + delete?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] + connect?: CustomerWhereUniqueInput | CustomerWhereUniqueInput[] + update?: CustomerUpdateWithWhereUniqueWithoutAvatarFileInput | CustomerUpdateWithWhereUniqueWithoutAvatarFileInput[] + updateMany?: CustomerUpdateManyWithWhereWithoutAvatarFileInput | CustomerUpdateManyWithWhereWithoutAvatarFileInput[] + deleteMany?: CustomerScalarWhereInput | CustomerScalarWhereInput[] + } + export type NestedStringFilter<$PrismaModel = never> = { equals?: string | StringFieldRefInput<$PrismaModel> in?: string[] | ListStringFieldRefInput<$PrismaModel> @@ -31346,6 +52279,17 @@ export namespace Prisma { not?: NestedStringNullableFilter<$PrismaModel> | string | null } + export type NestedDecimalNullableFilter<$PrismaModel = never> = { + equals?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> | null + in?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null + notIn?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null + lt?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> + lte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> + gt?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> + gte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> + not?: NestedDecimalNullableFilter<$PrismaModel> | Decimal | DecimalJsLike | number | string | null + } + export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { equals?: string | StringFieldRefInput<$PrismaModel> in?: string[] | ListStringFieldRefInput<$PrismaModel> @@ -31402,14 +52346,7 @@ export namespace Prisma { not?: NestedIntNullableFilter<$PrismaModel> | number | null } - export type NestedEnumAdminRoleFilter<$PrismaModel = never> = { - equals?: $Enums.AdminRole | EnumAdminRoleFieldRefInput<$PrismaModel> - in?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> - notIn?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> - not?: NestedEnumAdminRoleFilter<$PrismaModel> | $Enums.AdminRole - } - - export type NestedDecimalNullableFilter<$PrismaModel = never> = { + export type NestedDecimalNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> | null in?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null notIn?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null @@ -31417,7 +52354,19 @@ export namespace Prisma { lte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> gt?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> gte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> - not?: NestedDecimalNullableFilter<$PrismaModel> | Decimal | DecimalJsLike | number | string | null + not?: NestedDecimalNullableWithAggregatesFilter<$PrismaModel> | Decimal | DecimalJsLike | number | string | null + _count?: NestedIntNullableFilter<$PrismaModel> + _avg?: NestedDecimalNullableFilter<$PrismaModel> + _sum?: NestedDecimalNullableFilter<$PrismaModel> + _min?: NestedDecimalNullableFilter<$PrismaModel> + _max?: NestedDecimalNullableFilter<$PrismaModel> + } + + export type NestedEnumAdminRoleFilter<$PrismaModel = never> = { + equals?: $Enums.AdminRole | EnumAdminRoleFieldRefInput<$PrismaModel> + in?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> + notIn?: $Enums.AdminRole[] | ListEnumAdminRoleFieldRefInput<$PrismaModel> + not?: NestedEnumAdminRoleFilter<$PrismaModel> | $Enums.AdminRole } export type NestedBoolFilter<$PrismaModel = never> = { @@ -31446,20 +52395,31 @@ export namespace Prisma { _max?: NestedEnumAdminRoleFilter<$PrismaModel> } - export type NestedDecimalNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> | null - in?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null - notIn?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> | null - lt?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> - lte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> - gt?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> - gte?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> - not?: NestedDecimalNullableWithAggregatesFilter<$PrismaModel> | Decimal | DecimalJsLike | number | string | null + export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | IntFieldRefInput<$PrismaModel> | null + in?: number[] | ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null + lt?: number | IntFieldRefInput<$PrismaModel> + lte?: number | IntFieldRefInput<$PrismaModel> + gt?: number | IntFieldRefInput<$PrismaModel> + gte?: number | IntFieldRefInput<$PrismaModel> + not?: NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null _count?: NestedIntNullableFilter<$PrismaModel> - _avg?: NestedDecimalNullableFilter<$PrismaModel> - _sum?: NestedDecimalNullableFilter<$PrismaModel> - _min?: NestedDecimalNullableFilter<$PrismaModel> - _max?: NestedDecimalNullableFilter<$PrismaModel> + _avg?: NestedFloatNullableFilter<$PrismaModel> + _sum?: NestedIntNullableFilter<$PrismaModel> + _min?: NestedIntNullableFilter<$PrismaModel> + _max?: NestedIntNullableFilter<$PrismaModel> + } + + export type NestedFloatNullableFilter<$PrismaModel = never> = { + equals?: number | FloatFieldRefInput<$PrismaModel> | null + in?: number[] | ListFloatFieldRefInput<$PrismaModel> | null + notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> | null + lt?: number | FloatFieldRefInput<$PrismaModel> + lte?: number | FloatFieldRefInput<$PrismaModel> + gt?: number | FloatFieldRefInput<$PrismaModel> + gte?: number | FloatFieldRefInput<$PrismaModel> + not?: NestedFloatNullableFilter<$PrismaModel> | number | null } export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { @@ -31484,6 +52444,13 @@ export namespace Prisma { _max?: NestedDateTimeFilter<$PrismaModel> } + export type NestedEnumCustomerKindFilter<$PrismaModel = never> = { + equals?: $Enums.CustomerKind | EnumCustomerKindFieldRefInput<$PrismaModel> + in?: $Enums.CustomerKind[] | ListEnumCustomerKindFieldRefInput<$PrismaModel> + notIn?: $Enums.CustomerKind[] | ListEnumCustomerKindFieldRefInput<$PrismaModel> + not?: NestedEnumCustomerKindFilter<$PrismaModel> | $Enums.CustomerKind + } + export type NestedDecimalFilter<$PrismaModel = never> = { equals?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> in?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> @@ -31502,6 +52469,16 @@ export namespace Prisma { not?: NestedEnumVerificationStepFilter<$PrismaModel> | $Enums.VerificationStep } + export type NestedEnumCustomerKindWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.CustomerKind | EnumCustomerKindFieldRefInput<$PrismaModel> + in?: $Enums.CustomerKind[] | ListEnumCustomerKindFieldRefInput<$PrismaModel> + notIn?: $Enums.CustomerKind[] | ListEnumCustomerKindFieldRefInput<$PrismaModel> + not?: NestedEnumCustomerKindWithAggregatesFilter<$PrismaModel> | $Enums.CustomerKind + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumCustomerKindFilter<$PrismaModel> + _max?: NestedEnumCustomerKindFilter<$PrismaModel> + } + export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = { equals?: Decimal | DecimalJsLike | number | string | DecimalFieldRefInput<$PrismaModel> in?: Decimal[] | DecimalJsLike[] | number[] | string[] | ListDecimalFieldRefInput<$PrismaModel> @@ -31555,6 +52532,13 @@ export namespace Prisma { not?: NestedFloatFilter<$PrismaModel> | number } + export type NestedEnumOrderChannelFilter<$PrismaModel = never> = { + equals?: $Enums.OrderChannel | EnumOrderChannelFieldRefInput<$PrismaModel> + in?: $Enums.OrderChannel[] | ListEnumOrderChannelFieldRefInput<$PrismaModel> + notIn?: $Enums.OrderChannel[] | ListEnumOrderChannelFieldRefInput<$PrismaModel> + not?: NestedEnumOrderChannelFilter<$PrismaModel> | $Enums.OrderChannel + } + export type NestedEnumOrderStatusFilter<$PrismaModel = never> = { equals?: $Enums.OrderStatus | EnumOrderStatusFieldRefInput<$PrismaModel> in?: $Enums.OrderStatus[] | ListEnumOrderStatusFieldRefInput<$PrismaModel> @@ -31573,6 +52557,16 @@ export namespace Prisma { not?: NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null } + export type NestedEnumOrderChannelWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.OrderChannel | EnumOrderChannelFieldRefInput<$PrismaModel> + in?: $Enums.OrderChannel[] | ListEnumOrderChannelFieldRefInput<$PrismaModel> + notIn?: $Enums.OrderChannel[] | ListEnumOrderChannelFieldRefInput<$PrismaModel> + not?: NestedEnumOrderChannelWithAggregatesFilter<$PrismaModel> | $Enums.OrderChannel + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumOrderChannelFilter<$PrismaModel> + _max?: NestedEnumOrderChannelFilter<$PrismaModel> + } + export type NestedEnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = { equals?: $Enums.OrderStatus | EnumOrderStatusFieldRefInput<$PrismaModel> in?: $Enums.OrderStatus[] | ListEnumOrderStatusFieldRefInput<$PrismaModel> @@ -31704,31 +52698,72 @@ export namespace Prisma { _max?: NestedEnumLedgerSourceTypeFilter<$PrismaModel> } - export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | IntFieldRefInput<$PrismaModel> | null - in?: number[] | ListIntFieldRefInput<$PrismaModel> | null - notIn?: number[] | ListIntFieldRefInput<$PrismaModel> | null - lt?: number | IntFieldRefInput<$PrismaModel> - lte?: number | IntFieldRefInput<$PrismaModel> - gt?: number | IntFieldRefInput<$PrismaModel> - gte?: number | IntFieldRefInput<$PrismaModel> - not?: NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null - _count?: NestedIntNullableFilter<$PrismaModel> - _avg?: NestedFloatNullableFilter<$PrismaModel> - _sum?: NestedIntNullableFilter<$PrismaModel> - _min?: NestedIntNullableFilter<$PrismaModel> - _max?: NestedIntNullableFilter<$PrismaModel> + export type NestedEnumCommentStatusFilter<$PrismaModel = never> = { + equals?: $Enums.CommentStatus | EnumCommentStatusFieldRefInput<$PrismaModel> + in?: $Enums.CommentStatus[] | ListEnumCommentStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.CommentStatus[] | ListEnumCommentStatusFieldRefInput<$PrismaModel> + not?: NestedEnumCommentStatusFilter<$PrismaModel> | $Enums.CommentStatus } - export type NestedFloatNullableFilter<$PrismaModel = never> = { - equals?: number | FloatFieldRefInput<$PrismaModel> | null - in?: number[] | ListFloatFieldRefInput<$PrismaModel> | null - notIn?: number[] | ListFloatFieldRefInput<$PrismaModel> | null - lt?: number | FloatFieldRefInput<$PrismaModel> - lte?: number | FloatFieldRefInput<$PrismaModel> - gt?: number | FloatFieldRefInput<$PrismaModel> - gte?: number | FloatFieldRefInput<$PrismaModel> - not?: NestedFloatNullableFilter<$PrismaModel> | number | null + export type NestedEnumCommentStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.CommentStatus | EnumCommentStatusFieldRefInput<$PrismaModel> + in?: $Enums.CommentStatus[] | ListEnumCommentStatusFieldRefInput<$PrismaModel> + notIn?: $Enums.CommentStatus[] | ListEnumCommentStatusFieldRefInput<$PrismaModel> + not?: NestedEnumCommentStatusWithAggregatesFilter<$PrismaModel> | $Enums.CommentStatus + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumCommentStatusFilter<$PrismaModel> + _max?: NestedEnumCommentStatusFilter<$PrismaModel> + } + + export type NestedEnumPromotionScopeFilter<$PrismaModel = never> = { + equals?: $Enums.PromotionScope | EnumPromotionScopeFieldRefInput<$PrismaModel> + in?: $Enums.PromotionScope[] | ListEnumPromotionScopeFieldRefInput<$PrismaModel> + notIn?: $Enums.PromotionScope[] | ListEnumPromotionScopeFieldRefInput<$PrismaModel> + not?: NestedEnumPromotionScopeFilter<$PrismaModel> | $Enums.PromotionScope + } + + export type NestedEnumPromotionUsageFilter<$PrismaModel = never> = { + equals?: $Enums.PromotionUsage | EnumPromotionUsageFieldRefInput<$PrismaModel> + in?: $Enums.PromotionUsage[] | ListEnumPromotionUsageFieldRefInput<$PrismaModel> + notIn?: $Enums.PromotionUsage[] | ListEnumPromotionUsageFieldRefInput<$PrismaModel> + not?: NestedEnumPromotionUsageFilter<$PrismaModel> | $Enums.PromotionUsage + } + + export type NestedEnumPromotionScopeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.PromotionScope | EnumPromotionScopeFieldRefInput<$PrismaModel> + in?: $Enums.PromotionScope[] | ListEnumPromotionScopeFieldRefInput<$PrismaModel> + notIn?: $Enums.PromotionScope[] | ListEnumPromotionScopeFieldRefInput<$PrismaModel> + not?: NestedEnumPromotionScopeWithAggregatesFilter<$PrismaModel> | $Enums.PromotionScope + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumPromotionScopeFilter<$PrismaModel> + _max?: NestedEnumPromotionScopeFilter<$PrismaModel> + } + + export type NestedEnumPromotionUsageWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.PromotionUsage | EnumPromotionUsageFieldRefInput<$PrismaModel> + in?: $Enums.PromotionUsage[] | ListEnumPromotionUsageFieldRefInput<$PrismaModel> + notIn?: $Enums.PromotionUsage[] | ListEnumPromotionUsageFieldRefInput<$PrismaModel> + not?: NestedEnumPromotionUsageWithAggregatesFilter<$PrismaModel> | $Enums.PromotionUsage + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumPromotionUsageFilter<$PrismaModel> + _max?: NestedEnumPromotionUsageFilter<$PrismaModel> + } + + export type NestedEnumMessageAudienceFilter<$PrismaModel = never> = { + equals?: $Enums.MessageAudience | EnumMessageAudienceFieldRefInput<$PrismaModel> + in?: $Enums.MessageAudience[] | ListEnumMessageAudienceFieldRefInput<$PrismaModel> + notIn?: $Enums.MessageAudience[] | ListEnumMessageAudienceFieldRefInput<$PrismaModel> + not?: NestedEnumMessageAudienceFilter<$PrismaModel> | $Enums.MessageAudience + } + + export type NestedEnumMessageAudienceWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.MessageAudience | EnumMessageAudienceFieldRefInput<$PrismaModel> + in?: $Enums.MessageAudience[] | ListEnumMessageAudienceFieldRefInput<$PrismaModel> + notIn?: $Enums.MessageAudience[] | ListEnumMessageAudienceFieldRefInput<$PrismaModel> + not?: NestedEnumMessageAudienceWithAggregatesFilter<$PrismaModel> | $Enums.MessageAudience + _count?: NestedIntFilter<$PrismaModel> + _min?: NestedEnumMessageAudienceFilter<$PrismaModel> + _max?: NestedEnumMessageAudienceFilter<$PrismaModel> } export type CustomerCreateWithoutCityInput = { @@ -31737,6 +52772,13 @@ export namespace Prisma { mobile: string nationalCode: string passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string fiatDebtRial?: Decimal | DecimalJsLike | number | string @@ -31744,15 +52786,22 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput orders?: OrderCreateNestedManyWithoutCustomerInput preOrders?: PreOrderCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput } export type CustomerUncheckedCreateWithoutCityInput = { @@ -31761,6 +52810,13 @@ export namespace Prisma { mobile: string nationalCode: string passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null referredByAgentId?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string @@ -31769,7 +52825,10 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput @@ -31777,6 +52836,10 @@ export namespace Prisma { preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput } export type CustomerCreateOrConnectWithoutCityInput = { @@ -31816,15 +52879,23 @@ export namespace Prisma { export type BranchCreateWithoutCityInput = { id?: string name: string + address?: string | null + phone?: string | null + isActive?: boolean adminUsers?: AdminUserCreateNestedManyWithoutBranchInput orders?: OrderCreateNestedManyWithoutBranchInput + allocations?: BranchAllocationCreateNestedManyWithoutBranchInput } export type BranchUncheckedCreateWithoutCityInput = { id?: string name: string + address?: string | null + phone?: string | null + isActive?: boolean adminUsers?: AdminUserUncheckedCreateNestedManyWithoutBranchInput orders?: OrderUncheckedCreateNestedManyWithoutBranchInput + allocations?: BranchAllocationUncheckedCreateNestedManyWithoutBranchInput } export type BranchCreateOrConnectWithoutCityInput = { @@ -31911,6 +52982,13 @@ export namespace Prisma { nationalCode?: StringFilter<"Customer"> | string passwordHash?: StringFilter<"Customer"> | string cityId?: StringNullableFilter<"Customer"> | string | null + kind?: EnumCustomerKindFilter<"Customer"> | $Enums.CustomerKind + phone?: StringNullableFilter<"Customer"> | string | null + address?: StringNullableFilter<"Customer"> | string | null + storeName?: StringNullableFilter<"Customer"> | string | null + pasazhName?: StringNullableFilter<"Customer"> | string | null + zone?: StringNullableFilter<"Customer"> | string | null + memberCode?: StringNullableFilter<"Customer"> | string | null referredByAgentId?: StringNullableFilter<"Customer"> | string | null goldCreditLimitGrams?: DecimalFilter<"Customer"> | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFilter<"Customer"> | Decimal | DecimalJsLike | number | string @@ -31919,7 +52997,10 @@ export namespace Prisma { nationalIdImageUrl?: StringNullableFilter<"Customer"> | string | null businessLicenseUrl?: StringNullableFilter<"Customer"> | string | null shopImageUrl?: StringNullableFilter<"Customer"> | string | null + avatarFileId?: StringNullableFilter<"Customer"> | string | null + canPlaceOrders?: BoolFilter<"Customer"> | boolean isActive?: BoolFilter<"Customer"> | boolean + isArchived?: BoolFilter<"Customer"> | boolean createdAt?: DateTimeFilter<"Customer"> | Date | string updatedAt?: DateTimeFilter<"Customer"> | Date | string } @@ -31973,6 +53054,9 @@ export namespace Prisma { NOT?: BranchScalarWhereInput | BranchScalarWhereInput[] id?: StringFilter<"Branch"> | string name?: StringFilter<"Branch"> | string + address?: StringNullableFilter<"Branch"> | string | null + phone?: StringNullableFilter<"Branch"> | string | null + isActive?: BoolFilter<"Branch"> | boolean cityId?: StringNullableFilter<"Branch"> | string | null } @@ -32014,18 +53098,47 @@ export namespace Prisma { updatedAt?: DateTimeFilter<"PreOrder"> | Date | string } + export type UserTypeCreateWithoutAdminUsersInput = { + id: number + title: string + isActive?: boolean + createdAt?: Date | string + permissions?: PermissionCreateNestedManyWithoutUserTypeInput + } + + export type UserTypeUncheckedCreateWithoutAdminUsersInput = { + id: number + title: string + isActive?: boolean + createdAt?: Date | string + permissions?: PermissionUncheckedCreateNestedManyWithoutUserTypeInput + } + + export type UserTypeCreateOrConnectWithoutAdminUsersInput = { + where: UserTypeWhereUniqueInput + create: XOR<UserTypeCreateWithoutAdminUsersInput, UserTypeUncheckedCreateWithoutAdminUsersInput> + } + export type BranchCreateWithoutAdminUsersInput = { id?: string name: string + address?: string | null + phone?: string | null + isActive?: boolean city?: CityCreateNestedOneWithoutBranchesInput orders?: OrderCreateNestedManyWithoutBranchInput + allocations?: BranchAllocationCreateNestedManyWithoutBranchInput } export type BranchUncheckedCreateWithoutAdminUsersInput = { id?: string name: string + address?: string | null + phone?: string | null + isActive?: boolean cityId?: string | null orders?: OrderUncheckedCreateNestedManyWithoutBranchInput + allocations?: BranchAllocationUncheckedCreateNestedManyWithoutBranchInput } export type BranchCreateOrConnectWithoutAdminUsersInput = { @@ -32039,6 +53152,13 @@ export namespace Prisma { mobile: string nationalCode: string passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string fiatDebtRial?: Decimal | DecimalJsLike | number | string @@ -32046,15 +53166,22 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string city?: CityCreateNestedOneWithoutCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput orders?: OrderCreateNestedManyWithoutCustomerInput preOrders?: PreOrderCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput } export type CustomerUncheckedCreateWithoutReferredByAgentInput = { @@ -32064,6 +53191,13 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string fiatDebtRial?: Decimal | DecimalJsLike | number | string @@ -32071,7 +53205,10 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput @@ -32079,6 +53216,10 @@ export namespace Prisma { preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput } export type CustomerCreateOrConnectWithoutReferredByAgentInput = { @@ -32091,6 +53232,60 @@ export namespace Prisma { skipDuplicates?: boolean } + export type WorkshopCreateWithoutSupervisorInput = { + id?: string + name: string + address?: string | null + phone?: string | null + isActive?: boolean + preOrders?: PreOrderCreateNestedManyWithoutWorkshopInput + } + + export type WorkshopUncheckedCreateWithoutSupervisorInput = { + id?: string + name: string + address?: string | null + phone?: string | null + isActive?: boolean + preOrders?: PreOrderUncheckedCreateNestedManyWithoutWorkshopInput + } + + export type WorkshopCreateOrConnectWithoutSupervisorInput = { + where: WorkshopWhereUniqueInput + create: XOR<WorkshopCreateWithoutSupervisorInput, WorkshopUncheckedCreateWithoutSupervisorInput> + } + + export type WorkshopCreateManySupervisorInputEnvelope = { + data: WorkshopCreateManySupervisorInput | WorkshopCreateManySupervisorInput[] + skipDuplicates?: boolean + } + + export type BranchAllocationCreateWithoutAllocatorAdminUserInput = { + id?: string + note?: string | null + createdAt?: Date | string + branch: BranchCreateNestedOneWithoutAllocationsInput + items?: BranchAllocationItemCreateNestedManyWithoutAllocationInput + } + + export type BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput = { + id?: string + branchId: string + note?: string | null + createdAt?: Date | string + items?: BranchAllocationItemUncheckedCreateNestedManyWithoutAllocationInput + } + + export type BranchAllocationCreateOrConnectWithoutAllocatorAdminUserInput = { + where: BranchAllocationWhereUniqueInput + create: XOR<BranchAllocationCreateWithoutAllocatorAdminUserInput, BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput> + } + + export type BranchAllocationCreateManyAllocatorAdminUserInputEnvelope = { + data: BranchAllocationCreateManyAllocatorAdminUserInput | BranchAllocationCreateManyAllocatorAdminUserInput[] + skipDuplicates?: boolean + } + export type LedgerEntryCreateWithoutPostedByAdminUserInput = { id?: string currency: $Enums.LedgerCurrency @@ -32101,6 +53296,14 @@ export namespace Prisma { pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null confirmed?: boolean confirmedAt?: Date | string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string customer: CustomerCreateNestedOneWithoutLedgerEntriesInput @@ -32119,6 +53322,14 @@ export namespace Prisma { orderId?: string | null confirmed?: boolean confirmedAt?: Date | string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string } @@ -32187,6 +53398,121 @@ export namespace Prisma { skipDuplicates?: boolean } + export type SmsMessageCreateWithoutSentByAdminUserInput = { + id?: string + audience: $Enums.MessageAudience + recipients?: string | null + body: string + sentCount?: number + createdAt?: Date | string + } + + export type SmsMessageUncheckedCreateWithoutSentByAdminUserInput = { + id?: string + audience: $Enums.MessageAudience + recipients?: string | null + body: string + sentCount?: number + createdAt?: Date | string + } + + export type SmsMessageCreateOrConnectWithoutSentByAdminUserInput = { + where: SmsMessageWhereUniqueInput + create: XOR<SmsMessageCreateWithoutSentByAdminUserInput, SmsMessageUncheckedCreateWithoutSentByAdminUserInput> + } + + export type SmsMessageCreateManySentByAdminUserInputEnvelope = { + data: SmsMessageCreateManySentByAdminUserInput | SmsMessageCreateManySentByAdminUserInput[] + skipDuplicates?: boolean + } + + export type NotificationCreateWithoutSentByAdminUserInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + createdAt?: Date | string + recipients?: NotificationRecipientCreateNestedManyWithoutNotificationInput + } + + export type NotificationUncheckedCreateWithoutSentByAdminUserInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + createdAt?: Date | string + recipients?: NotificationRecipientUncheckedCreateNestedManyWithoutNotificationInput + } + + export type NotificationCreateOrConnectWithoutSentByAdminUserInput = { + where: NotificationWhereUniqueInput + create: XOR<NotificationCreateWithoutSentByAdminUserInput, NotificationUncheckedCreateWithoutSentByAdminUserInput> + } + + export type NotificationCreateManySentByAdminUserInputEnvelope = { + data: NotificationCreateManySentByAdminUserInput | NotificationCreateManySentByAdminUserInput[] + skipDuplicates?: boolean + } + + export type UploadedFileCreateWithoutUploadedByAdminUserInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + createdAt?: Date | string + customerAvatars?: CustomerCreateNestedManyWithoutAvatarFileInput + } + + export type UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + createdAt?: Date | string + customerAvatars?: CustomerUncheckedCreateNestedManyWithoutAvatarFileInput + } + + export type UploadedFileCreateOrConnectWithoutUploadedByAdminUserInput = { + where: UploadedFileWhereUniqueInput + create: XOR<UploadedFileCreateWithoutUploadedByAdminUserInput, UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput> + } + + export type UploadedFileCreateManyUploadedByAdminUserInputEnvelope = { + data: UploadedFileCreateManyUploadedByAdminUserInput | UploadedFileCreateManyUploadedByAdminUserInput[] + skipDuplicates?: boolean + } + + export type UserTypeUpsertWithoutAdminUsersInput = { + update: XOR<UserTypeUpdateWithoutAdminUsersInput, UserTypeUncheckedUpdateWithoutAdminUsersInput> + create: XOR<UserTypeCreateWithoutAdminUsersInput, UserTypeUncheckedCreateWithoutAdminUsersInput> + where?: UserTypeWhereInput + } + + export type UserTypeUpdateToOneWithWhereWithoutAdminUsersInput = { + where?: UserTypeWhereInput + data: XOR<UserTypeUpdateWithoutAdminUsersInput, UserTypeUncheckedUpdateWithoutAdminUsersInput> + } + + export type UserTypeUpdateWithoutAdminUsersInput = { + id?: IntFieldUpdateOperationsInput | number + title?: StringFieldUpdateOperationsInput | string + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + permissions?: PermissionUpdateManyWithoutUserTypeNestedInput + } + + export type UserTypeUncheckedUpdateWithoutAdminUsersInput = { + id?: IntFieldUpdateOperationsInput | number + title?: StringFieldUpdateOperationsInput | string + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + permissions?: PermissionUncheckedUpdateManyWithoutUserTypeNestedInput + } + export type BranchUpsertWithoutAdminUsersInput = { update: XOR<BranchUpdateWithoutAdminUsersInput, BranchUncheckedUpdateWithoutAdminUsersInput> create: XOR<BranchCreateWithoutAdminUsersInput, BranchUncheckedCreateWithoutAdminUsersInput> @@ -32201,15 +53527,23 @@ export namespace Prisma { export type BranchUpdateWithoutAdminUsersInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean city?: CityUpdateOneWithoutBranchesNestedInput orders?: OrderUpdateManyWithoutBranchNestedInput + allocations?: BranchAllocationUpdateManyWithoutBranchNestedInput } export type BranchUncheckedUpdateWithoutAdminUsersInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean cityId?: NullableStringFieldUpdateOperationsInput | string | null orders?: OrderUncheckedUpdateManyWithoutBranchNestedInput + allocations?: BranchAllocationUncheckedUpdateManyWithoutBranchNestedInput } export type CustomerUpsertWithWhereUniqueWithoutReferredByAgentInput = { @@ -32228,6 +53562,61 @@ export namespace Prisma { data: XOR<CustomerUpdateManyMutationInput, CustomerUncheckedUpdateManyWithoutReferredByAgentInput> } + export type WorkshopUpsertWithWhereUniqueWithoutSupervisorInput = { + where: WorkshopWhereUniqueInput + update: XOR<WorkshopUpdateWithoutSupervisorInput, WorkshopUncheckedUpdateWithoutSupervisorInput> + create: XOR<WorkshopCreateWithoutSupervisorInput, WorkshopUncheckedCreateWithoutSupervisorInput> + } + + export type WorkshopUpdateWithWhereUniqueWithoutSupervisorInput = { + where: WorkshopWhereUniqueInput + data: XOR<WorkshopUpdateWithoutSupervisorInput, WorkshopUncheckedUpdateWithoutSupervisorInput> + } + + export type WorkshopUpdateManyWithWhereWithoutSupervisorInput = { + where: WorkshopScalarWhereInput + data: XOR<WorkshopUpdateManyMutationInput, WorkshopUncheckedUpdateManyWithoutSupervisorInput> + } + + export type WorkshopScalarWhereInput = { + AND?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] + OR?: WorkshopScalarWhereInput[] + NOT?: WorkshopScalarWhereInput | WorkshopScalarWhereInput[] + id?: StringFilter<"Workshop"> | string + name?: StringFilter<"Workshop"> | string + address?: StringNullableFilter<"Workshop"> | string | null + phone?: StringNullableFilter<"Workshop"> | string | null + supervisorId?: StringNullableFilter<"Workshop"> | string | null + isActive?: BoolFilter<"Workshop"> | boolean + } + + export type BranchAllocationUpsertWithWhereUniqueWithoutAllocatorAdminUserInput = { + where: BranchAllocationWhereUniqueInput + update: XOR<BranchAllocationUpdateWithoutAllocatorAdminUserInput, BranchAllocationUncheckedUpdateWithoutAllocatorAdminUserInput> + create: XOR<BranchAllocationCreateWithoutAllocatorAdminUserInput, BranchAllocationUncheckedCreateWithoutAllocatorAdminUserInput> + } + + export type BranchAllocationUpdateWithWhereUniqueWithoutAllocatorAdminUserInput = { + where: BranchAllocationWhereUniqueInput + data: XOR<BranchAllocationUpdateWithoutAllocatorAdminUserInput, BranchAllocationUncheckedUpdateWithoutAllocatorAdminUserInput> + } + + export type BranchAllocationUpdateManyWithWhereWithoutAllocatorAdminUserInput = { + where: BranchAllocationScalarWhereInput + data: XOR<BranchAllocationUpdateManyMutationInput, BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserInput> + } + + export type BranchAllocationScalarWhereInput = { + AND?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] + OR?: BranchAllocationScalarWhereInput[] + NOT?: BranchAllocationScalarWhereInput | BranchAllocationScalarWhereInput[] + id?: StringFilter<"BranchAllocation"> | string + branchId?: StringFilter<"BranchAllocation"> | string + allocatorAdminUserId?: StringNullableFilter<"BranchAllocation"> | string | null + note?: StringNullableFilter<"BranchAllocation"> | string | null + createdAt?: DateTimeFilter<"BranchAllocation"> | Date | string + } + export type LedgerEntryUpsertWithWhereUniqueWithoutPostedByAdminUserInput = { where: LedgerEntryWhereUniqueInput update: XOR<LedgerEntryUpdateWithoutPostedByAdminUserInput, LedgerEntryUncheckedUpdateWithoutPostedByAdminUserInput> @@ -32260,6 +53649,14 @@ export namespace Prisma { confirmed?: BoolFilter<"LedgerEntry"> | boolean confirmedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null postedByAdminUserId?: StringNullableFilter<"LedgerEntry"> | string | null + labName?: StringNullableFilter<"LedgerEntry"> | string | null + hallmark?: StringNullableFilter<"LedgerEntry"> | string | null + accountName?: StringNullableFilter<"LedgerEntry"> | string | null + bankName?: StringNullableFilter<"LedgerEntry"> | string | null + transferTo?: StringNullableFilter<"LedgerEntry"> | string | null + originalValue?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + priceRial?: DecimalNullableFilter<"LedgerEntry"> | Decimal | DecimalJsLike | number | string | null + receivedAt?: DateTimeNullableFilter<"LedgerEntry"> | Date | string | null note?: StringNullableFilter<"LedgerEntry"> | string | null createdAt?: DateTimeFilter<"LedgerEntry"> | Date | string } @@ -32321,10 +53718,99 @@ export namespace Prisma { createdAt?: DateTimeFilter<"PreOrderStatusEvent"> | Date | string } + export type SmsMessageUpsertWithWhereUniqueWithoutSentByAdminUserInput = { + where: SmsMessageWhereUniqueInput + update: XOR<SmsMessageUpdateWithoutSentByAdminUserInput, SmsMessageUncheckedUpdateWithoutSentByAdminUserInput> + create: XOR<SmsMessageCreateWithoutSentByAdminUserInput, SmsMessageUncheckedCreateWithoutSentByAdminUserInput> + } + + export type SmsMessageUpdateWithWhereUniqueWithoutSentByAdminUserInput = { + where: SmsMessageWhereUniqueInput + data: XOR<SmsMessageUpdateWithoutSentByAdminUserInput, SmsMessageUncheckedUpdateWithoutSentByAdminUserInput> + } + + export type SmsMessageUpdateManyWithWhereWithoutSentByAdminUserInput = { + where: SmsMessageScalarWhereInput + data: XOR<SmsMessageUpdateManyMutationInput, SmsMessageUncheckedUpdateManyWithoutSentByAdminUserInput> + } + + export type SmsMessageScalarWhereInput = { + AND?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] + OR?: SmsMessageScalarWhereInput[] + NOT?: SmsMessageScalarWhereInput | SmsMessageScalarWhereInput[] + id?: StringFilter<"SmsMessage"> | string + audience?: EnumMessageAudienceFilter<"SmsMessage"> | $Enums.MessageAudience + recipients?: StringNullableFilter<"SmsMessage"> | string | null + body?: StringFilter<"SmsMessage"> | string + sentCount?: IntFilter<"SmsMessage"> | number + sentByAdminUserId?: StringNullableFilter<"SmsMessage"> | string | null + createdAt?: DateTimeFilter<"SmsMessage"> | Date | string + } + + export type NotificationUpsertWithWhereUniqueWithoutSentByAdminUserInput = { + where: NotificationWhereUniqueInput + update: XOR<NotificationUpdateWithoutSentByAdminUserInput, NotificationUncheckedUpdateWithoutSentByAdminUserInput> + create: XOR<NotificationCreateWithoutSentByAdminUserInput, NotificationUncheckedCreateWithoutSentByAdminUserInput> + } + + export type NotificationUpdateWithWhereUniqueWithoutSentByAdminUserInput = { + where: NotificationWhereUniqueInput + data: XOR<NotificationUpdateWithoutSentByAdminUserInput, NotificationUncheckedUpdateWithoutSentByAdminUserInput> + } + + export type NotificationUpdateManyWithWhereWithoutSentByAdminUserInput = { + where: NotificationScalarWhereInput + data: XOR<NotificationUpdateManyMutationInput, NotificationUncheckedUpdateManyWithoutSentByAdminUserInput> + } + + export type NotificationScalarWhereInput = { + AND?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + OR?: NotificationScalarWhereInput[] + NOT?: NotificationScalarWhereInput | NotificationScalarWhereInput[] + id?: StringFilter<"Notification"> | string + title?: StringFilter<"Notification"> | string + body?: StringFilter<"Notification"> | string + audience?: EnumMessageAudienceFilter<"Notification"> | $Enums.MessageAudience + sentByAdminUserId?: StringNullableFilter<"Notification"> | string | null + createdAt?: DateTimeFilter<"Notification"> | Date | string + } + + export type UploadedFileUpsertWithWhereUniqueWithoutUploadedByAdminUserInput = { + where: UploadedFileWhereUniqueInput + update: XOR<UploadedFileUpdateWithoutUploadedByAdminUserInput, UploadedFileUncheckedUpdateWithoutUploadedByAdminUserInput> + create: XOR<UploadedFileCreateWithoutUploadedByAdminUserInput, UploadedFileUncheckedCreateWithoutUploadedByAdminUserInput> + } + + export type UploadedFileUpdateWithWhereUniqueWithoutUploadedByAdminUserInput = { + where: UploadedFileWhereUniqueInput + data: XOR<UploadedFileUpdateWithoutUploadedByAdminUserInput, UploadedFileUncheckedUpdateWithoutUploadedByAdminUserInput> + } + + export type UploadedFileUpdateManyWithWhereWithoutUploadedByAdminUserInput = { + where: UploadedFileScalarWhereInput + data: XOR<UploadedFileUpdateManyMutationInput, UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserInput> + } + + export type UploadedFileScalarWhereInput = { + AND?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] + OR?: UploadedFileScalarWhereInput[] + NOT?: UploadedFileScalarWhereInput | UploadedFileScalarWhereInput[] + id?: StringFilter<"UploadedFile"> | string + url?: StringFilter<"UploadedFile"> | string + originalName?: StringFilter<"UploadedFile"> | string + mimeType?: StringFilter<"UploadedFile"> | string + sizeBytes?: IntFilter<"UploadedFile"> | number + purpose?: StringNullableFilter<"UploadedFile"> | string | null + uploadedByAdminUserId?: StringNullableFilter<"UploadedFile"> | string | null + createdAt?: DateTimeFilter<"UploadedFile"> | Date | string + } + export type CityCreateWithoutCustomersInput = { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null addresses?: CustomerAddressCreateNestedManyWithoutCityInput branches?: BranchCreateNestedManyWithoutCityInput preOrders?: PreOrderCreateNestedManyWithoutCityInput @@ -32334,6 +53820,8 @@ export namespace Prisma { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCityInput branches?: BranchUncheckedCreateNestedManyWithoutCityInput preOrders?: PreOrderUncheckedCreateNestedManyWithoutCityInput @@ -32353,10 +53841,16 @@ export namespace Prisma { wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput branch?: BranchCreateNestedOneWithoutAdminUsersInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserUncheckedCreateWithoutReferredCustomersInput = { @@ -32365,13 +53859,19 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole + userTypeId?: number | null branchId?: string | null wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserCreateOrConnectWithoutReferredCustomersInput = { @@ -32379,6 +53879,33 @@ export namespace Prisma { create: XOR<AdminUserCreateWithoutReferredCustomersInput, AdminUserUncheckedCreateWithoutReferredCustomersInput> } + export type UploadedFileCreateWithoutCustomerAvatarsInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + createdAt?: Date | string + uploadedByAdminUser?: AdminUserCreateNestedOneWithoutUploadedFilesInput + } + + export type UploadedFileUncheckedCreateWithoutCustomerAvatarsInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + uploadedByAdminUserId?: string | null + createdAt?: Date | string + } + + export type UploadedFileCreateOrConnectWithoutCustomerAvatarsInput = { + where: UploadedFileWhereUniqueInput + create: XOR<UploadedFileCreateWithoutCustomerAvatarsInput, UploadedFileUncheckedCreateWithoutCustomerAvatarsInput> + } + export type CustomerAddressCreateWithoutCustomerInput = { id?: string addressLine: string @@ -32406,6 +53933,7 @@ export namespace Prisma { export type OrderCreateWithoutCustomerInput = { id?: string orderNumber: string + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -32425,6 +53953,7 @@ export namespace Prisma { id?: string orderNumber: string branchId?: string | null + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -32507,6 +54036,14 @@ export namespace Prisma { pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null confirmed?: boolean confirmedAt?: Date | string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string order?: OrderCreateNestedOneWithoutLedgerEntriesInput @@ -32525,6 +54062,14 @@ export namespace Prisma { confirmed?: boolean confirmedAt?: Date | string | null postedByAdminUserId?: string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string } @@ -32569,6 +54114,130 @@ export namespace Prisma { skipDuplicates?: boolean } + export type CommentCreateWithoutCustomerInput = { + id?: string + body: string + status?: $Enums.CommentStatus + createdAt?: Date | string + updatedAt?: Date | string + product: ProductCreateNestedOneWithoutCommentsInput + replyTo?: CommentCreateNestedOneWithoutRepliesInput + replies?: CommentCreateNestedManyWithoutReplyToInput + } + + export type CommentUncheckedCreateWithoutCustomerInput = { + id?: string + productId: string + body: string + status?: $Enums.CommentStatus + replyToId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + replies?: CommentUncheckedCreateNestedManyWithoutReplyToInput + } + + export type CommentCreateOrConnectWithoutCustomerInput = { + where: CommentWhereUniqueInput + create: XOR<CommentCreateWithoutCustomerInput, CommentUncheckedCreateWithoutCustomerInput> + } + + export type CommentCreateManyCustomerInputEnvelope = { + data: CommentCreateManyCustomerInput | CommentCreateManyCustomerInput[] + skipDuplicates?: boolean + } + + export type PromotionCreateWithoutCustomerInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string + product?: ProductCreateNestedOneWithoutPromotionsInput + category?: CategoryCreateNestedOneWithoutPromotionsInput + brand?: BrandCreateNestedOneWithoutPromotionsInput + } + + export type PromotionUncheckedCreateWithoutCustomerInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + productId?: string | null + categoryId?: string | null + brandId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type PromotionCreateOrConnectWithoutCustomerInput = { + where: PromotionWhereUniqueInput + create: XOR<PromotionCreateWithoutCustomerInput, PromotionUncheckedCreateWithoutCustomerInput> + } + + export type PromotionCreateManyCustomerInputEnvelope = { + data: PromotionCreateManyCustomerInput | PromotionCreateManyCustomerInput[] + skipDuplicates?: boolean + } + + export type NotificationRecipientCreateWithoutCustomerInput = { + id?: string + readAt?: Date | string | null + notification: NotificationCreateNestedOneWithoutRecipientsInput + } + + export type NotificationRecipientUncheckedCreateWithoutCustomerInput = { + id?: string + notificationId: string + readAt?: Date | string | null + } + + export type NotificationRecipientCreateOrConnectWithoutCustomerInput = { + where: NotificationRecipientWhereUniqueInput + create: XOR<NotificationRecipientCreateWithoutCustomerInput, NotificationRecipientUncheckedCreateWithoutCustomerInput> + } + + export type NotificationRecipientCreateManyCustomerInputEnvelope = { + data: NotificationRecipientCreateManyCustomerInput | NotificationRecipientCreateManyCustomerInput[] + skipDuplicates?: boolean + } + + export type CustomerActivityLogCreateWithoutCustomerInput = { + id?: string + action: string + detail?: string | null + createdAt?: Date | string + } + + export type CustomerActivityLogUncheckedCreateWithoutCustomerInput = { + id?: string + action: string + detail?: string | null + createdAt?: Date | string + } + + export type CustomerActivityLogCreateOrConnectWithoutCustomerInput = { + where: CustomerActivityLogWhereUniqueInput + create: XOR<CustomerActivityLogCreateWithoutCustomerInput, CustomerActivityLogUncheckedCreateWithoutCustomerInput> + } + + export type CustomerActivityLogCreateManyCustomerInputEnvelope = { + data: CustomerActivityLogCreateManyCustomerInput | CustomerActivityLogCreateManyCustomerInput[] + skipDuplicates?: boolean + } + export type CityUpsertWithoutCustomersInput = { update: XOR<CityUpdateWithoutCustomersInput, CityUncheckedUpdateWithoutCustomersInput> create: XOR<CityCreateWithoutCustomersInput, CityUncheckedCreateWithoutCustomersInput> @@ -32584,6 +54253,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null addresses?: CustomerAddressUpdateManyWithoutCityNestedInput branches?: BranchUpdateManyWithoutCityNestedInput preOrders?: PreOrderUpdateManyWithoutCityNestedInput @@ -32593,6 +54264,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null addresses?: CustomerAddressUncheckedUpdateManyWithoutCityNestedInput branches?: BranchUncheckedUpdateManyWithoutCityNestedInput preOrders?: PreOrderUncheckedUpdateManyWithoutCityNestedInput @@ -32618,10 +54291,16 @@ export namespace Prisma { wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput branch?: BranchUpdateOneWithoutAdminUsersNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutReferredCustomersInput = { @@ -32630,13 +54309,52 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput + } + + export type UploadedFileUpsertWithoutCustomerAvatarsInput = { + update: XOR<UploadedFileUpdateWithoutCustomerAvatarsInput, UploadedFileUncheckedUpdateWithoutCustomerAvatarsInput> + create: XOR<UploadedFileCreateWithoutCustomerAvatarsInput, UploadedFileUncheckedCreateWithoutCustomerAvatarsInput> + where?: UploadedFileWhereInput + } + + export type UploadedFileUpdateToOneWithWhereWithoutCustomerAvatarsInput = { + where?: UploadedFileWhereInput + data: XOR<UploadedFileUpdateWithoutCustomerAvatarsInput, UploadedFileUncheckedUpdateWithoutCustomerAvatarsInput> + } + + export type UploadedFileUpdateWithoutCustomerAvatarsInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + uploadedByAdminUser?: AdminUserUpdateOneWithoutUploadedFilesNestedInput + } + + export type UploadedFileUncheckedUpdateWithoutCustomerAvatarsInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + uploadedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } export type CustomerAddressUpsertWithWhereUniqueWithoutCustomerInput = { @@ -32679,6 +54397,7 @@ export namespace Prisma { orderNumber?: StringFilter<"Order"> | string customerId?: StringFilter<"Order"> | string branchId?: StringNullableFilter<"Order"> | string | null + channel?: EnumOrderChannelFilter<"Order"> | $Enums.OrderChannel status?: EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFilter<"Order"> | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFilter<"Order"> | Decimal | DecimalJsLike | number | string @@ -32751,12 +54470,140 @@ export namespace Prisma { isActive?: BoolFilter<"WalletBonus"> | boolean } + export type CommentUpsertWithWhereUniqueWithoutCustomerInput = { + where: CommentWhereUniqueInput + update: XOR<CommentUpdateWithoutCustomerInput, CommentUncheckedUpdateWithoutCustomerInput> + create: XOR<CommentCreateWithoutCustomerInput, CommentUncheckedCreateWithoutCustomerInput> + } + + export type CommentUpdateWithWhereUniqueWithoutCustomerInput = { + where: CommentWhereUniqueInput + data: XOR<CommentUpdateWithoutCustomerInput, CommentUncheckedUpdateWithoutCustomerInput> + } + + export type CommentUpdateManyWithWhereWithoutCustomerInput = { + where: CommentScalarWhereInput + data: XOR<CommentUpdateManyMutationInput, CommentUncheckedUpdateManyWithoutCustomerInput> + } + + export type CommentScalarWhereInput = { + AND?: CommentScalarWhereInput | CommentScalarWhereInput[] + OR?: CommentScalarWhereInput[] + NOT?: CommentScalarWhereInput | CommentScalarWhereInput[] + id?: StringFilter<"Comment"> | string + productId?: StringFilter<"Comment"> | string + customerId?: StringFilter<"Comment"> | string + body?: StringFilter<"Comment"> | string + status?: EnumCommentStatusFilter<"Comment"> | $Enums.CommentStatus + replyToId?: StringNullableFilter<"Comment"> | string | null + createdAt?: DateTimeFilter<"Comment"> | Date | string + updatedAt?: DateTimeFilter<"Comment"> | Date | string + } + + export type PromotionUpsertWithWhereUniqueWithoutCustomerInput = { + where: PromotionWhereUniqueInput + update: XOR<PromotionUpdateWithoutCustomerInput, PromotionUncheckedUpdateWithoutCustomerInput> + create: XOR<PromotionCreateWithoutCustomerInput, PromotionUncheckedCreateWithoutCustomerInput> + } + + export type PromotionUpdateWithWhereUniqueWithoutCustomerInput = { + where: PromotionWhereUniqueInput + data: XOR<PromotionUpdateWithoutCustomerInput, PromotionUncheckedUpdateWithoutCustomerInput> + } + + export type PromotionUpdateManyWithWhereWithoutCustomerInput = { + where: PromotionScalarWhereInput + data: XOR<PromotionUpdateManyMutationInput, PromotionUncheckedUpdateManyWithoutCustomerInput> + } + + export type PromotionScalarWhereInput = { + AND?: PromotionScalarWhereInput | PromotionScalarWhereInput[] + OR?: PromotionScalarWhereInput[] + NOT?: PromotionScalarWhereInput | PromotionScalarWhereInput[] + id?: StringFilter<"Promotion"> | string + title?: StringFilter<"Promotion"> | string + description?: StringNullableFilter<"Promotion"> | string | null + scope?: EnumPromotionScopeFilter<"Promotion"> | $Enums.PromotionScope + usage?: EnumPromotionUsageFilter<"Promotion"> | $Enums.PromotionUsage + discountPercent?: DecimalFilter<"Promotion"> | Decimal | DecimalJsLike | number | string + isActive?: BoolFilter<"Promotion"> | boolean + platform?: IntFilter<"Promotion"> | number + startsAt?: DateTimeNullableFilter<"Promotion"> | Date | string | null + endsAt?: DateTimeNullableFilter<"Promotion"> | Date | string | null + productId?: StringNullableFilter<"Promotion"> | string | null + categoryId?: StringNullableFilter<"Promotion"> | string | null + customerId?: StringNullableFilter<"Promotion"> | string | null + brandId?: StringNullableFilter<"Promotion"> | string | null + createdAt?: DateTimeFilter<"Promotion"> | Date | string + updatedAt?: DateTimeFilter<"Promotion"> | Date | string + } + + export type NotificationRecipientUpsertWithWhereUniqueWithoutCustomerInput = { + where: NotificationRecipientWhereUniqueInput + update: XOR<NotificationRecipientUpdateWithoutCustomerInput, NotificationRecipientUncheckedUpdateWithoutCustomerInput> + create: XOR<NotificationRecipientCreateWithoutCustomerInput, NotificationRecipientUncheckedCreateWithoutCustomerInput> + } + + export type NotificationRecipientUpdateWithWhereUniqueWithoutCustomerInput = { + where: NotificationRecipientWhereUniqueInput + data: XOR<NotificationRecipientUpdateWithoutCustomerInput, NotificationRecipientUncheckedUpdateWithoutCustomerInput> + } + + export type NotificationRecipientUpdateManyWithWhereWithoutCustomerInput = { + where: NotificationRecipientScalarWhereInput + data: XOR<NotificationRecipientUpdateManyMutationInput, NotificationRecipientUncheckedUpdateManyWithoutCustomerInput> + } + + export type NotificationRecipientScalarWhereInput = { + AND?: NotificationRecipientScalarWhereInput | NotificationRecipientScalarWhereInput[] + OR?: NotificationRecipientScalarWhereInput[] + NOT?: NotificationRecipientScalarWhereInput | NotificationRecipientScalarWhereInput[] + id?: StringFilter<"NotificationRecipient"> | string + notificationId?: StringFilter<"NotificationRecipient"> | string + customerId?: StringFilter<"NotificationRecipient"> | string + readAt?: DateTimeNullableFilter<"NotificationRecipient"> | Date | string | null + } + + export type CustomerActivityLogUpsertWithWhereUniqueWithoutCustomerInput = { + where: CustomerActivityLogWhereUniqueInput + update: XOR<CustomerActivityLogUpdateWithoutCustomerInput, CustomerActivityLogUncheckedUpdateWithoutCustomerInput> + create: XOR<CustomerActivityLogCreateWithoutCustomerInput, CustomerActivityLogUncheckedCreateWithoutCustomerInput> + } + + export type CustomerActivityLogUpdateWithWhereUniqueWithoutCustomerInput = { + where: CustomerActivityLogWhereUniqueInput + data: XOR<CustomerActivityLogUpdateWithoutCustomerInput, CustomerActivityLogUncheckedUpdateWithoutCustomerInput> + } + + export type CustomerActivityLogUpdateManyWithWhereWithoutCustomerInput = { + where: CustomerActivityLogScalarWhereInput + data: XOR<CustomerActivityLogUpdateManyMutationInput, CustomerActivityLogUncheckedUpdateManyWithoutCustomerInput> + } + + export type CustomerActivityLogScalarWhereInput = { + AND?: CustomerActivityLogScalarWhereInput | CustomerActivityLogScalarWhereInput[] + OR?: CustomerActivityLogScalarWhereInput[] + NOT?: CustomerActivityLogScalarWhereInput | CustomerActivityLogScalarWhereInput[] + id?: StringFilter<"CustomerActivityLog"> | string + customerId?: StringFilter<"CustomerActivityLog"> | string + action?: StringFilter<"CustomerActivityLog"> | string + detail?: StringNullableFilter<"CustomerActivityLog"> | string | null + createdAt?: DateTimeFilter<"CustomerActivityLog"> | Date | string + } + export type CustomerCreateWithoutAddressesInput = { id?: string fullName: string mobile: string nationalCode: string passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string fiatDebtRial?: Decimal | DecimalJsLike | number | string @@ -32764,15 +54611,22 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string city?: CityCreateNestedOneWithoutCustomersInput referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput orders?: OrderCreateNestedManyWithoutCustomerInput preOrders?: PreOrderCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput } export type CustomerUncheckedCreateWithoutAddressesInput = { @@ -32782,6 +54636,13 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null referredByAgentId?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string @@ -32790,13 +54651,20 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string orders?: OrderUncheckedCreateNestedManyWithoutCustomerInput preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput } export type CustomerCreateOrConnectWithoutAddressesInput = { @@ -32808,6 +54676,8 @@ export namespace Prisma { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null customers?: CustomerCreateNestedManyWithoutCityInput branches?: BranchCreateNestedManyWithoutCityInput preOrders?: PreOrderCreateNestedManyWithoutCityInput @@ -32817,6 +54687,8 @@ export namespace Prisma { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null customers?: CustomerUncheckedCreateNestedManyWithoutCityInput branches?: BranchUncheckedCreateNestedManyWithoutCityInput preOrders?: PreOrderUncheckedCreateNestedManyWithoutCityInput @@ -32844,6 +54716,13 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -32851,15 +54730,22 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string city?: CityUpdateOneWithoutCustomersNestedInput referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput orders?: OrderUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateWithoutAddressesInput = { @@ -32869,6 +54755,13 @@ export namespace Prisma { nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -32877,13 +54770,20 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string orders?: OrderUncheckedUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput } export type CityUpsertWithoutAddressesInput = { @@ -32901,6 +54801,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null customers?: CustomerUpdateManyWithoutCityNestedInput branches?: BranchUpdateManyWithoutCityNestedInput preOrders?: PreOrderUpdateManyWithoutCityNestedInput @@ -32910,6 +54812,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null customers?: CustomerUncheckedUpdateManyWithoutCityNestedInput branches?: BranchUncheckedUpdateManyWithoutCityNestedInput preOrders?: PreOrderUncheckedUpdateManyWithoutCityNestedInput @@ -32919,6 +54823,8 @@ export namespace Prisma { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null customers?: CustomerCreateNestedManyWithoutCityInput addresses?: CustomerAddressCreateNestedManyWithoutCityInput preOrders?: PreOrderCreateNestedManyWithoutCityInput @@ -32928,6 +54834,8 @@ export namespace Prisma { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null customers?: CustomerUncheckedCreateNestedManyWithoutCityInput addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCityInput preOrders?: PreOrderUncheckedCreateNestedManyWithoutCityInput @@ -32947,10 +54855,16 @@ export namespace Prisma { wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserUncheckedCreateWithoutBranchInput = { @@ -32959,13 +54873,19 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole + userTypeId?: number | null wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserCreateOrConnectWithoutBranchInput = { @@ -32981,6 +54901,7 @@ export namespace Prisma { export type OrderCreateWithoutBranchInput = { id?: string orderNumber: string + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -33000,6 +54921,7 @@ export namespace Prisma { id?: string orderNumber: string customerId: string + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -33024,6 +54946,32 @@ export namespace Prisma { skipDuplicates?: boolean } + export type BranchAllocationCreateWithoutBranchInput = { + id?: string + note?: string | null + createdAt?: Date | string + allocatorAdminUser?: AdminUserCreateNestedOneWithoutBranchAllocationsInput + items?: BranchAllocationItemCreateNestedManyWithoutAllocationInput + } + + export type BranchAllocationUncheckedCreateWithoutBranchInput = { + id?: string + allocatorAdminUserId?: string | null + note?: string | null + createdAt?: Date | string + items?: BranchAllocationItemUncheckedCreateNestedManyWithoutAllocationInput + } + + export type BranchAllocationCreateOrConnectWithoutBranchInput = { + where: BranchAllocationWhereUniqueInput + create: XOR<BranchAllocationCreateWithoutBranchInput, BranchAllocationUncheckedCreateWithoutBranchInput> + } + + export type BranchAllocationCreateManyBranchInputEnvelope = { + data: BranchAllocationCreateManyBranchInput | BranchAllocationCreateManyBranchInput[] + skipDuplicates?: boolean + } + export type CityUpsertWithoutBranchesInput = { update: XOR<CityUpdateWithoutBranchesInput, CityUncheckedUpdateWithoutBranchesInput> create: XOR<CityCreateWithoutBranchesInput, CityUncheckedCreateWithoutBranchesInput> @@ -33039,6 +54987,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null customers?: CustomerUpdateManyWithoutCityNestedInput addresses?: CustomerAddressUpdateManyWithoutCityNestedInput preOrders?: PreOrderUpdateManyWithoutCityNestedInput @@ -33048,6 +54998,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null customers?: CustomerUncheckedUpdateManyWithoutCityNestedInput addresses?: CustomerAddressUncheckedUpdateManyWithoutCityNestedInput preOrders?: PreOrderUncheckedUpdateManyWithoutCityNestedInput @@ -33078,6 +55030,7 @@ export namespace Prisma { mobile?: StringFilter<"AdminUser"> | string passwordHash?: StringFilter<"AdminUser"> | string role?: EnumAdminRoleFilter<"AdminUser"> | $Enums.AdminRole + userTypeId?: IntNullableFilter<"AdminUser"> | number | null branchId?: StringNullableFilter<"AdminUser"> | string | null wagePercent?: DecimalNullableFilter<"AdminUser"> | Decimal | DecimalJsLike | number | string | null isActive?: BoolFilter<"AdminUser"> | boolean @@ -33100,6 +55053,69 @@ export namespace Prisma { data: XOR<OrderUpdateManyMutationInput, OrderUncheckedUpdateManyWithoutBranchInput> } + export type BranchAllocationUpsertWithWhereUniqueWithoutBranchInput = { + where: BranchAllocationWhereUniqueInput + update: XOR<BranchAllocationUpdateWithoutBranchInput, BranchAllocationUncheckedUpdateWithoutBranchInput> + create: XOR<BranchAllocationCreateWithoutBranchInput, BranchAllocationUncheckedCreateWithoutBranchInput> + } + + export type BranchAllocationUpdateWithWhereUniqueWithoutBranchInput = { + where: BranchAllocationWhereUniqueInput + data: XOR<BranchAllocationUpdateWithoutBranchInput, BranchAllocationUncheckedUpdateWithoutBranchInput> + } + + export type BranchAllocationUpdateManyWithWhereWithoutBranchInput = { + where: BranchAllocationScalarWhereInput + data: XOR<BranchAllocationUpdateManyMutationInput, BranchAllocationUncheckedUpdateManyWithoutBranchInput> + } + + export type AdminUserCreateWithoutSupervisedWorkshopsInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput + branch?: BranchCreateNestedOneWithoutAdminUsersInput + referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput + } + + export type AdminUserUncheckedCreateWithoutSupervisedWorkshopsInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + userTypeId?: number | null + branchId?: string | null + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput + } + + export type AdminUserCreateOrConnectWithoutSupervisedWorkshopsInput = { + where: AdminUserWhereUniqueInput + create: XOR<AdminUserCreateWithoutSupervisedWorkshopsInput, AdminUserUncheckedCreateWithoutSupervisedWorkshopsInput> + } + export type PreOrderCreateWithoutWorkshopInput = { id?: string status?: $Enums.PreOrderStatus @@ -33148,6 +55164,59 @@ export namespace Prisma { skipDuplicates?: boolean } + export type AdminUserUpsertWithoutSupervisedWorkshopsInput = { + update: XOR<AdminUserUpdateWithoutSupervisedWorkshopsInput, AdminUserUncheckedUpdateWithoutSupervisedWorkshopsInput> + create: XOR<AdminUserCreateWithoutSupervisedWorkshopsInput, AdminUserUncheckedCreateWithoutSupervisedWorkshopsInput> + where?: AdminUserWhereInput + } + + export type AdminUserUpdateToOneWithWhereWithoutSupervisedWorkshopsInput = { + where?: AdminUserWhereInput + data: XOR<AdminUserUpdateWithoutSupervisedWorkshopsInput, AdminUserUncheckedUpdateWithoutSupervisedWorkshopsInput> + } + + export type AdminUserUpdateWithoutSupervisedWorkshopsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput + branch?: BranchUpdateOneWithoutAdminUsersNestedInput + referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput + } + + export type AdminUserUncheckedUpdateWithoutSupervisedWorkshopsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null + branchId?: NullableStringFieldUpdateOperationsInput | string | null + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput + } + export type PreOrderUpsertWithWhereUniqueWithoutWorkshopInput = { where: PreOrderWhereUniqueInput update: XOR<PreOrderUpdateWithoutWorkshopInput, PreOrderUncheckedUpdateWithoutWorkshopInput> @@ -33167,15 +55236,27 @@ export namespace Prisma { export type CategoryCreateWithoutChildrenInput = { id?: string title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null parent?: CategoryCreateNestedOneWithoutChildrenInput products?: ProductCreateNestedManyWithoutCategoryInput + promotions?: PromotionCreateNestedManyWithoutCategoryInput } export type CategoryUncheckedCreateWithoutChildrenInput = { id?: string title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null parentId?: string | null products?: ProductUncheckedCreateNestedManyWithoutCategoryInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCategoryInput } export type CategoryCreateOrConnectWithoutChildrenInput = { @@ -33186,15 +55267,27 @@ export namespace Prisma { export type CategoryCreateWithoutParentInput = { id?: string title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null children?: CategoryCreateNestedManyWithoutParentInput products?: ProductCreateNestedManyWithoutCategoryInput + promotions?: PromotionCreateNestedManyWithoutCategoryInput } export type CategoryUncheckedCreateWithoutParentInput = { id?: string title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null children?: CategoryUncheckedCreateNestedManyWithoutParentInput products?: ProductUncheckedCreateNestedManyWithoutCategoryInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCategoryInput } export type CategoryCreateOrConnectWithoutParentInput = { @@ -33211,12 +55304,17 @@ export namespace Prisma { id?: string title: string description?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string brand?: BrandCreateNestedOneWithoutProductsInput variants?: ProductVariantCreateNestedManyWithoutProductInput images?: ProductImageCreateNestedManyWithoutProductInput collections?: CollectionProductCreateNestedManyWithoutProductInput + comments?: CommentCreateNestedManyWithoutProductInput + promotions?: PromotionCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemCreateNestedManyWithoutProductInput } export type ProductUncheckedCreateWithoutCategoryInput = { @@ -33224,11 +55322,16 @@ export namespace Prisma { title: string description?: string | null brandId?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string variants?: ProductVariantUncheckedCreateNestedManyWithoutProductInput images?: ProductImageUncheckedCreateNestedManyWithoutProductInput collections?: CollectionProductUncheckedCreateNestedManyWithoutProductInput + comments?: CommentUncheckedCreateNestedManyWithoutProductInput + promotions?: PromotionUncheckedCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemUncheckedCreateNestedManyWithoutProductInput } export type ProductCreateOrConnectWithoutCategoryInput = { @@ -33241,6 +55344,52 @@ export namespace Prisma { skipDuplicates?: boolean } + export type PromotionCreateWithoutCategoryInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string + product?: ProductCreateNestedOneWithoutPromotionsInput + customer?: CustomerCreateNestedOneWithoutPromotionsInput + brand?: BrandCreateNestedOneWithoutPromotionsInput + } + + export type PromotionUncheckedCreateWithoutCategoryInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + productId?: string | null + customerId?: string | null + brandId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type PromotionCreateOrConnectWithoutCategoryInput = { + where: PromotionWhereUniqueInput + create: XOR<PromotionCreateWithoutCategoryInput, PromotionUncheckedCreateWithoutCategoryInput> + } + + export type PromotionCreateManyCategoryInputEnvelope = { + data: PromotionCreateManyCategoryInput | PromotionCreateManyCategoryInput[] + skipDuplicates?: boolean + } + export type CategoryUpsertWithoutChildrenInput = { update: XOR<CategoryUpdateWithoutChildrenInput, CategoryUncheckedUpdateWithoutChildrenInput> create: XOR<CategoryCreateWithoutChildrenInput, CategoryUncheckedCreateWithoutChildrenInput> @@ -33255,15 +55404,27 @@ export namespace Prisma { export type CategoryUpdateWithoutChildrenInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null parent?: CategoryUpdateOneWithoutChildrenNestedInput products?: ProductUpdateManyWithoutCategoryNestedInput + promotions?: PromotionUpdateManyWithoutCategoryNestedInput } export type CategoryUncheckedUpdateWithoutChildrenInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null parentId?: NullableStringFieldUpdateOperationsInput | string | null products?: ProductUncheckedUpdateManyWithoutCategoryNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCategoryNestedInput } export type CategoryUpsertWithWhereUniqueWithoutParentInput = { @@ -33288,6 +55449,11 @@ export namespace Prisma { NOT?: CategoryScalarWhereInput | CategoryScalarWhereInput[] id?: StringFilter<"Category"> | string title?: StringFilter<"Category"> | string + type?: IntFilter<"Category"> | number + imageUrl?: StringNullableFilter<"Category"> | string | null + iconUrl?: StringNullableFilter<"Category"> | string | null + metaTag?: StringNullableFilter<"Category"> | string | null + description?: StringNullableFilter<"Category"> | string | null parentId?: StringNullableFilter<"Category"> | string | null } @@ -33316,20 +55482,43 @@ export namespace Prisma { description?: StringNullableFilter<"Product"> | string | null categoryId?: StringNullableFilter<"Product"> | string | null brandId?: StringNullableFilter<"Product"> | string | null + productCode?: StringNullableFilter<"Product"> | string | null + showType?: IntFilter<"Product"> | number isActive?: BoolFilter<"Product"> | boolean createdAt?: DateTimeFilter<"Product"> | Date | string } + export type PromotionUpsertWithWhereUniqueWithoutCategoryInput = { + where: PromotionWhereUniqueInput + update: XOR<PromotionUpdateWithoutCategoryInput, PromotionUncheckedUpdateWithoutCategoryInput> + create: XOR<PromotionCreateWithoutCategoryInput, PromotionUncheckedCreateWithoutCategoryInput> + } + + export type PromotionUpdateWithWhereUniqueWithoutCategoryInput = { + where: PromotionWhereUniqueInput + data: XOR<PromotionUpdateWithoutCategoryInput, PromotionUncheckedUpdateWithoutCategoryInput> + } + + export type PromotionUpdateManyWithWhereWithoutCategoryInput = { + where: PromotionScalarWhereInput + data: XOR<PromotionUpdateManyMutationInput, PromotionUncheckedUpdateManyWithoutCategoryInput> + } + export type ProductCreateWithoutBrandInput = { id?: string title: string description?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string category?: CategoryCreateNestedOneWithoutProductsInput variants?: ProductVariantCreateNestedManyWithoutProductInput images?: ProductImageCreateNestedManyWithoutProductInput collections?: CollectionProductCreateNestedManyWithoutProductInput + comments?: CommentCreateNestedManyWithoutProductInput + promotions?: PromotionCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemCreateNestedManyWithoutProductInput } export type ProductUncheckedCreateWithoutBrandInput = { @@ -33337,11 +55526,16 @@ export namespace Prisma { title: string description?: string | null categoryId?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string variants?: ProductVariantUncheckedCreateNestedManyWithoutProductInput images?: ProductImageUncheckedCreateNestedManyWithoutProductInput collections?: CollectionProductUncheckedCreateNestedManyWithoutProductInput + comments?: CommentUncheckedCreateNestedManyWithoutProductInput + promotions?: PromotionUncheckedCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemUncheckedCreateNestedManyWithoutProductInput } export type ProductCreateOrConnectWithoutBrandInput = { @@ -33354,6 +55548,52 @@ export namespace Prisma { skipDuplicates?: boolean } + export type PromotionCreateWithoutBrandInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string + product?: ProductCreateNestedOneWithoutPromotionsInput + category?: CategoryCreateNestedOneWithoutPromotionsInput + customer?: CustomerCreateNestedOneWithoutPromotionsInput + } + + export type PromotionUncheckedCreateWithoutBrandInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + productId?: string | null + categoryId?: string | null + customerId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type PromotionCreateOrConnectWithoutBrandInput = { + where: PromotionWhereUniqueInput + create: XOR<PromotionCreateWithoutBrandInput, PromotionUncheckedCreateWithoutBrandInput> + } + + export type PromotionCreateManyBrandInputEnvelope = { + data: PromotionCreateManyBrandInput | PromotionCreateManyBrandInput[] + skipDuplicates?: boolean + } + export type ProductUpsertWithWhereUniqueWithoutBrandInput = { where: ProductWhereUniqueInput update: XOR<ProductUpdateWithoutBrandInput, ProductUncheckedUpdateWithoutBrandInput> @@ -33370,6 +55610,22 @@ export namespace Prisma { data: XOR<ProductUpdateManyMutationInput, ProductUncheckedUpdateManyWithoutBrandInput> } + export type PromotionUpsertWithWhereUniqueWithoutBrandInput = { + where: PromotionWhereUniqueInput + update: XOR<PromotionUpdateWithoutBrandInput, PromotionUncheckedUpdateWithoutBrandInput> + create: XOR<PromotionCreateWithoutBrandInput, PromotionUncheckedCreateWithoutBrandInput> + } + + export type PromotionUpdateWithWhereUniqueWithoutBrandInput = { + where: PromotionWhereUniqueInput + data: XOR<PromotionUpdateWithoutBrandInput, PromotionUncheckedUpdateWithoutBrandInput> + } + + export type PromotionUpdateManyWithWhereWithoutBrandInput = { + where: PromotionScalarWhereInput + data: XOR<PromotionUpdateManyMutationInput, PromotionUncheckedUpdateManyWithoutBrandInput> + } + export type CollectionProductCreateWithoutCollectionInput = { product: ProductCreateNestedOneWithoutCollectionsInput } @@ -33435,12 +55691,17 @@ export namespace Prisma { id?: string title: string description?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string category?: CategoryCreateNestedOneWithoutProductsInput brand?: BrandCreateNestedOneWithoutProductsInput variants?: ProductVariantCreateNestedManyWithoutProductInput images?: ProductImageCreateNestedManyWithoutProductInput + comments?: CommentCreateNestedManyWithoutProductInput + promotions?: PromotionCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemCreateNestedManyWithoutProductInput } export type ProductUncheckedCreateWithoutCollectionsInput = { @@ -33449,10 +55710,15 @@ export namespace Prisma { description?: string | null categoryId?: string | null brandId?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string variants?: ProductVariantUncheckedCreateNestedManyWithoutProductInput images?: ProductImageUncheckedCreateNestedManyWithoutProductInput + comments?: CommentUncheckedCreateNestedManyWithoutProductInput + promotions?: PromotionUncheckedCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemUncheckedCreateNestedManyWithoutProductInput } export type ProductCreateOrConnectWithoutCollectionsInput = { @@ -33500,12 +55766,17 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string category?: CategoryUpdateOneWithoutProductsNestedInput brand?: BrandUpdateOneWithoutProductsNestedInput variants?: ProductVariantUpdateManyWithoutProductNestedInput images?: ProductImageUpdateManyWithoutProductNestedInput + comments?: CommentUpdateManyWithoutProductNestedInput + promotions?: PromotionUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateWithoutCollectionsInput = { @@ -33514,24 +55785,41 @@ export namespace Prisma { description?: NullableStringFieldUpdateOperationsInput | string | null categoryId?: NullableStringFieldUpdateOperationsInput | string | null brandId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string variants?: ProductVariantUncheckedUpdateManyWithoutProductNestedInput images?: ProductImageUncheckedUpdateManyWithoutProductNestedInput + comments?: CommentUncheckedUpdateManyWithoutProductNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUncheckedUpdateManyWithoutProductNestedInput } export type CategoryCreateWithoutProductsInput = { id?: string title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null parent?: CategoryCreateNestedOneWithoutChildrenInput children?: CategoryCreateNestedManyWithoutParentInput + promotions?: PromotionCreateNestedManyWithoutCategoryInput } export type CategoryUncheckedCreateWithoutProductsInput = { id?: string title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null parentId?: string | null children?: CategoryUncheckedCreateNestedManyWithoutParentInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCategoryInput } export type CategoryCreateOrConnectWithoutProductsInput = { @@ -33542,11 +55830,13 @@ export namespace Prisma { export type BrandCreateWithoutProductsInput = { id?: string title: string + promotions?: PromotionCreateNestedManyWithoutBrandInput } export type BrandUncheckedCreateWithoutProductsInput = { id?: string title: string + promotions?: PromotionUncheckedCreateNestedManyWithoutBrandInput } export type BrandCreateOrConnectWithoutProductsInput = { @@ -33560,6 +55850,8 @@ export namespace Prisma { sku?: string | null rashWeightGrams: Decimal | DecimalJsLike | number | string defaultWagePercent: Decimal | DecimalJsLike | number | string + qty?: number + isPreOrder?: boolean isActive?: boolean orderItems?: OrderItemCreateNestedManyWithoutProductVariantInput } @@ -33570,6 +55862,8 @@ export namespace Prisma { sku?: string | null rashWeightGrams: Decimal | DecimalJsLike | number | string defaultWagePercent: Decimal | DecimalJsLike | number | string + qty?: number + isPreOrder?: boolean isActive?: boolean orderItems?: OrderItemUncheckedCreateNestedManyWithoutProductVariantInput } @@ -33624,6 +55918,106 @@ export namespace Prisma { skipDuplicates?: boolean } + export type CommentCreateWithoutProductInput = { + id?: string + body: string + status?: $Enums.CommentStatus + createdAt?: Date | string + updatedAt?: Date | string + customer: CustomerCreateNestedOneWithoutCommentsInput + replyTo?: CommentCreateNestedOneWithoutRepliesInput + replies?: CommentCreateNestedManyWithoutReplyToInput + } + + export type CommentUncheckedCreateWithoutProductInput = { + id?: string + customerId: string + body: string + status?: $Enums.CommentStatus + replyToId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + replies?: CommentUncheckedCreateNestedManyWithoutReplyToInput + } + + export type CommentCreateOrConnectWithoutProductInput = { + where: CommentWhereUniqueInput + create: XOR<CommentCreateWithoutProductInput, CommentUncheckedCreateWithoutProductInput> + } + + export type CommentCreateManyProductInputEnvelope = { + data: CommentCreateManyProductInput | CommentCreateManyProductInput[] + skipDuplicates?: boolean + } + + export type PromotionCreateWithoutProductInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string + category?: CategoryCreateNestedOneWithoutPromotionsInput + customer?: CustomerCreateNestedOneWithoutPromotionsInput + brand?: BrandCreateNestedOneWithoutPromotionsInput + } + + export type PromotionUncheckedCreateWithoutProductInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + categoryId?: string | null + customerId?: string | null + brandId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type PromotionCreateOrConnectWithoutProductInput = { + where: PromotionWhereUniqueInput + create: XOR<PromotionCreateWithoutProductInput, PromotionUncheckedCreateWithoutProductInput> + } + + export type PromotionCreateManyProductInputEnvelope = { + data: PromotionCreateManyProductInput | PromotionCreateManyProductInput[] + skipDuplicates?: boolean + } + + export type BranchAllocationItemCreateWithoutProductInput = { + id?: string + weightGrams?: Decimal | DecimalJsLike | number | string | null + allocation: BranchAllocationCreateNestedOneWithoutItemsInput + } + + export type BranchAllocationItemUncheckedCreateWithoutProductInput = { + id?: string + allocationId: string + weightGrams?: Decimal | DecimalJsLike | number | string | null + } + + export type BranchAllocationItemCreateOrConnectWithoutProductInput = { + where: BranchAllocationItemWhereUniqueInput + create: XOR<BranchAllocationItemCreateWithoutProductInput, BranchAllocationItemUncheckedCreateWithoutProductInput> + } + + export type BranchAllocationItemCreateManyProductInputEnvelope = { + data: BranchAllocationItemCreateManyProductInput | BranchAllocationItemCreateManyProductInput[] + skipDuplicates?: boolean + } + export type CategoryUpsertWithoutProductsInput = { update: XOR<CategoryUpdateWithoutProductsInput, CategoryUncheckedUpdateWithoutProductsInput> create: XOR<CategoryCreateWithoutProductsInput, CategoryUncheckedCreateWithoutProductsInput> @@ -33638,15 +56032,27 @@ export namespace Prisma { export type CategoryUpdateWithoutProductsInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null parent?: CategoryUpdateOneWithoutChildrenNestedInput children?: CategoryUpdateManyWithoutParentNestedInput + promotions?: PromotionUpdateManyWithoutCategoryNestedInput } export type CategoryUncheckedUpdateWithoutProductsInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null parentId?: NullableStringFieldUpdateOperationsInput | string | null children?: CategoryUncheckedUpdateManyWithoutParentNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCategoryNestedInput } export type BrandUpsertWithoutProductsInput = { @@ -33663,11 +56069,13 @@ export namespace Prisma { export type BrandUpdateWithoutProductsInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + promotions?: PromotionUpdateManyWithoutBrandNestedInput } export type BrandUncheckedUpdateWithoutProductsInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + promotions?: PromotionUncheckedUpdateManyWithoutBrandNestedInput } export type ProductVariantUpsertWithWhereUniqueWithoutProductInput = { @@ -33696,6 +56104,8 @@ export namespace Prisma { sku?: StringNullableFilter<"ProductVariant"> | string | null rashWeightGrams?: DecimalFilter<"ProductVariant"> | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFilter<"ProductVariant"> | Decimal | DecimalJsLike | number | string + qty?: IntFilter<"ProductVariant"> | number + isPreOrder?: BoolFilter<"ProductVariant"> | boolean isActive?: BoolFilter<"ProductVariant"> | boolean } @@ -33741,16 +56151,79 @@ export namespace Prisma { data: XOR<CollectionProductUpdateManyMutationInput, CollectionProductUncheckedUpdateManyWithoutProductInput> } + export type CommentUpsertWithWhereUniqueWithoutProductInput = { + where: CommentWhereUniqueInput + update: XOR<CommentUpdateWithoutProductInput, CommentUncheckedUpdateWithoutProductInput> + create: XOR<CommentCreateWithoutProductInput, CommentUncheckedCreateWithoutProductInput> + } + + export type CommentUpdateWithWhereUniqueWithoutProductInput = { + where: CommentWhereUniqueInput + data: XOR<CommentUpdateWithoutProductInput, CommentUncheckedUpdateWithoutProductInput> + } + + export type CommentUpdateManyWithWhereWithoutProductInput = { + where: CommentScalarWhereInput + data: XOR<CommentUpdateManyMutationInput, CommentUncheckedUpdateManyWithoutProductInput> + } + + export type PromotionUpsertWithWhereUniqueWithoutProductInput = { + where: PromotionWhereUniqueInput + update: XOR<PromotionUpdateWithoutProductInput, PromotionUncheckedUpdateWithoutProductInput> + create: XOR<PromotionCreateWithoutProductInput, PromotionUncheckedCreateWithoutProductInput> + } + + export type PromotionUpdateWithWhereUniqueWithoutProductInput = { + where: PromotionWhereUniqueInput + data: XOR<PromotionUpdateWithoutProductInput, PromotionUncheckedUpdateWithoutProductInput> + } + + export type PromotionUpdateManyWithWhereWithoutProductInput = { + where: PromotionScalarWhereInput + data: XOR<PromotionUpdateManyMutationInput, PromotionUncheckedUpdateManyWithoutProductInput> + } + + export type BranchAllocationItemUpsertWithWhereUniqueWithoutProductInput = { + where: BranchAllocationItemWhereUniqueInput + update: XOR<BranchAllocationItemUpdateWithoutProductInput, BranchAllocationItemUncheckedUpdateWithoutProductInput> + create: XOR<BranchAllocationItemCreateWithoutProductInput, BranchAllocationItemUncheckedCreateWithoutProductInput> + } + + export type BranchAllocationItemUpdateWithWhereUniqueWithoutProductInput = { + where: BranchAllocationItemWhereUniqueInput + data: XOR<BranchAllocationItemUpdateWithoutProductInput, BranchAllocationItemUncheckedUpdateWithoutProductInput> + } + + export type BranchAllocationItemUpdateManyWithWhereWithoutProductInput = { + where: BranchAllocationItemScalarWhereInput + data: XOR<BranchAllocationItemUpdateManyMutationInput, BranchAllocationItemUncheckedUpdateManyWithoutProductInput> + } + + export type BranchAllocationItemScalarWhereInput = { + AND?: BranchAllocationItemScalarWhereInput | BranchAllocationItemScalarWhereInput[] + OR?: BranchAllocationItemScalarWhereInput[] + NOT?: BranchAllocationItemScalarWhereInput | BranchAllocationItemScalarWhereInput[] + id?: StringFilter<"BranchAllocationItem"> | string + allocationId?: StringFilter<"BranchAllocationItem"> | string + productId?: StringFilter<"BranchAllocationItem"> | string + weightGrams?: DecimalNullableFilter<"BranchAllocationItem"> | Decimal | DecimalJsLike | number | string | null + } + export type ProductCreateWithoutImagesInput = { id?: string title: string description?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string category?: CategoryCreateNestedOneWithoutProductsInput brand?: BrandCreateNestedOneWithoutProductsInput variants?: ProductVariantCreateNestedManyWithoutProductInput collections?: CollectionProductCreateNestedManyWithoutProductInput + comments?: CommentCreateNestedManyWithoutProductInput + promotions?: PromotionCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemCreateNestedManyWithoutProductInput } export type ProductUncheckedCreateWithoutImagesInput = { @@ -33759,10 +56232,15 @@ export namespace Prisma { description?: string | null categoryId?: string | null brandId?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string variants?: ProductVariantUncheckedCreateNestedManyWithoutProductInput collections?: CollectionProductUncheckedCreateNestedManyWithoutProductInput + comments?: CommentUncheckedCreateNestedManyWithoutProductInput + promotions?: PromotionUncheckedCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemUncheckedCreateNestedManyWithoutProductInput } export type ProductCreateOrConnectWithoutImagesInput = { @@ -33785,12 +56263,17 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string category?: CategoryUpdateOneWithoutProductsNestedInput brand?: BrandUpdateOneWithoutProductsNestedInput variants?: ProductVariantUpdateManyWithoutProductNestedInput collections?: CollectionProductUpdateManyWithoutProductNestedInput + comments?: CommentUpdateManyWithoutProductNestedInput + promotions?: PromotionUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateWithoutImagesInput = { @@ -33799,22 +56282,32 @@ export namespace Prisma { description?: NullableStringFieldUpdateOperationsInput | string | null categoryId?: NullableStringFieldUpdateOperationsInput | string | null brandId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string variants?: ProductVariantUncheckedUpdateManyWithoutProductNestedInput collections?: CollectionProductUncheckedUpdateManyWithoutProductNestedInput + comments?: CommentUncheckedUpdateManyWithoutProductNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUncheckedUpdateManyWithoutProductNestedInput } export type ProductCreateWithoutVariantsInput = { id?: string title: string description?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string category?: CategoryCreateNestedOneWithoutProductsInput brand?: BrandCreateNestedOneWithoutProductsInput images?: ProductImageCreateNestedManyWithoutProductInput collections?: CollectionProductCreateNestedManyWithoutProductInput + comments?: CommentCreateNestedManyWithoutProductInput + promotions?: PromotionCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemCreateNestedManyWithoutProductInput } export type ProductUncheckedCreateWithoutVariantsInput = { @@ -33823,10 +56316,15 @@ export namespace Prisma { description?: string | null categoryId?: string | null brandId?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string images?: ProductImageUncheckedCreateNestedManyWithoutProductInput collections?: CollectionProductUncheckedCreateNestedManyWithoutProductInput + comments?: CommentUncheckedCreateNestedManyWithoutProductInput + promotions?: PromotionUncheckedCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemUncheckedCreateNestedManyWithoutProductInput } export type ProductCreateOrConnectWithoutVariantsInput = { @@ -33881,12 +56379,17 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string category?: CategoryUpdateOneWithoutProductsNestedInput brand?: BrandUpdateOneWithoutProductsNestedInput images?: ProductImageUpdateManyWithoutProductNestedInput collections?: CollectionProductUpdateManyWithoutProductNestedInput + comments?: CommentUpdateManyWithoutProductNestedInput + promotions?: PromotionUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateWithoutVariantsInput = { @@ -33895,10 +56398,15 @@ export namespace Prisma { description?: NullableStringFieldUpdateOperationsInput | string | null categoryId?: NullableStringFieldUpdateOperationsInput | string | null brandId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string images?: ProductImageUncheckedUpdateManyWithoutProductNestedInput collections?: CollectionProductUncheckedUpdateManyWithoutProductNestedInput + comments?: CommentUncheckedUpdateManyWithoutProductNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUncheckedUpdateManyWithoutProductNestedInput } export type OrderItemUpsertWithWhereUniqueWithoutProductVariantInput = { @@ -33938,6 +56446,13 @@ export namespace Prisma { mobile: string nationalCode: string passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string fiatDebtRial?: Decimal | DecimalJsLike | number | string @@ -33945,15 +56460,22 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string city?: CityCreateNestedOneWithoutCustomersInput referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput preOrders?: PreOrderCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput } export type CustomerUncheckedCreateWithoutOrdersInput = { @@ -33963,6 +56485,13 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null referredByAgentId?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string @@ -33971,13 +56500,20 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput } export type CustomerCreateOrConnectWithoutOrdersInput = { @@ -33988,15 +56524,23 @@ export namespace Prisma { export type BranchCreateWithoutOrdersInput = { id?: string name: string + address?: string | null + phone?: string | null + isActive?: boolean city?: CityCreateNestedOneWithoutBranchesInput adminUsers?: AdminUserCreateNestedManyWithoutBranchInput + allocations?: BranchAllocationCreateNestedManyWithoutBranchInput } export type BranchUncheckedCreateWithoutOrdersInput = { id?: string name: string + address?: string | null + phone?: string | null + isActive?: boolean cityId?: string | null adminUsers?: AdminUserUncheckedCreateNestedManyWithoutBranchInput + allocations?: BranchAllocationUncheckedCreateNestedManyWithoutBranchInput } export type BranchCreateOrConnectWithoutOrdersInput = { @@ -34074,6 +56618,14 @@ export namespace Prisma { pricePerGramRialAtEntry?: Decimal | DecimalJsLike | number | string | null confirmed?: boolean confirmedAt?: Date | string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string customer: CustomerCreateNestedOneWithoutLedgerEntriesInput @@ -34092,6 +56644,14 @@ export namespace Prisma { confirmed?: boolean confirmedAt?: Date | string | null postedByAdminUserId?: string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string } @@ -34166,6 +56726,13 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -34173,15 +56740,22 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string city?: CityUpdateOneWithoutCustomersNestedInput referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateWithoutOrdersInput = { @@ -34191,6 +56765,13 @@ export namespace Prisma { nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -34199,13 +56780,20 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput } export type BranchUpsertWithoutOrdersInput = { @@ -34222,15 +56810,23 @@ export namespace Prisma { export type BranchUpdateWithoutOrdersInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean city?: CityUpdateOneWithoutBranchesNestedInput adminUsers?: AdminUserUpdateManyWithoutBranchNestedInput + allocations?: BranchAllocationUpdateManyWithoutBranchNestedInput } export type BranchUncheckedUpdateWithoutOrdersInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean cityId?: NullableStringFieldUpdateOperationsInput | string | null adminUsers?: AdminUserUncheckedUpdateManyWithoutBranchNestedInput + allocations?: BranchAllocationUncheckedUpdateManyWithoutBranchNestedInput } export type OrderItemUpsertWithWhereUniqueWithoutOrderInput = { @@ -34333,6 +56929,7 @@ export namespace Prisma { export type OrderCreateWithoutItemsInput = { id?: string orderNumber: string + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -34353,6 +56950,7 @@ export namespace Prisma { orderNumber: string customerId: string branchId?: string | null + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -34377,6 +56975,8 @@ export namespace Prisma { sku?: string | null rashWeightGrams: Decimal | DecimalJsLike | number | string defaultWagePercent: Decimal | DecimalJsLike | number | string + qty?: number + isPreOrder?: boolean isActive?: boolean product: ProductCreateNestedOneWithoutVariantsInput } @@ -34388,6 +56988,8 @@ export namespace Prisma { sku?: string | null rashWeightGrams: Decimal | DecimalJsLike | number | string defaultWagePercent: Decimal | DecimalJsLike | number | string + qty?: number + isPreOrder?: boolean isActive?: boolean } @@ -34410,6 +57012,7 @@ export namespace Prisma { export type OrderUpdateWithoutItemsInput = { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -34430,6 +57033,7 @@ export namespace Prisma { orderNumber?: StringFieldUpdateOperationsInput | string customerId?: StringFieldUpdateOperationsInput | string branchId?: NullableStringFieldUpdateOperationsInput | string | null + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -34460,6 +57064,8 @@ export namespace Prisma { sku?: NullableStringFieldUpdateOperationsInput | string | null rashWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + qty?: IntFieldUpdateOperationsInput | number + isPreOrder?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean product?: ProductUpdateOneRequiredWithoutVariantsNestedInput } @@ -34471,12 +57077,15 @@ export namespace Prisma { sku?: NullableStringFieldUpdateOperationsInput | string | null rashWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + qty?: IntFieldUpdateOperationsInput | number + isPreOrder?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean } export type OrderCreateWithoutStatusEventsInput = { id?: string orderNumber: string + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -34497,6 +57106,7 @@ export namespace Prisma { orderNumber: string customerId: string branchId?: string | null + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -34524,10 +57134,16 @@ export namespace Prisma { wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput branch?: BranchCreateNestedOneWithoutAdminUsersInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserUncheckedCreateWithoutOrderStatusEventsInput = { @@ -34536,13 +57152,19 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole + userTypeId?: number | null branchId?: string | null wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserCreateOrConnectWithoutOrderStatusEventsInput = { @@ -34564,6 +57186,7 @@ export namespace Prisma { export type OrderUpdateWithoutStatusEventsInput = { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -34584,6 +57207,7 @@ export namespace Prisma { orderNumber?: StringFieldUpdateOperationsInput | string customerId?: StringFieldUpdateOperationsInput | string branchId?: NullableStringFieldUpdateOperationsInput | string | null + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -34617,10 +57241,16 @@ export namespace Prisma { wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput branch?: BranchUpdateOneWithoutAdminUsersNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutOrderStatusEventsInput = { @@ -34629,13 +57259,19 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput } export type CustomerCreateWithoutPreOrdersInput = { @@ -34644,6 +57280,13 @@ export namespace Prisma { mobile: string nationalCode: string passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string fiatDebtRial?: Decimal | DecimalJsLike | number | string @@ -34651,15 +57294,22 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string city?: CityCreateNestedOneWithoutCustomersInput referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput orders?: OrderCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput } export type CustomerUncheckedCreateWithoutPreOrdersInput = { @@ -34669,6 +57319,13 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null referredByAgentId?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string @@ -34677,13 +57334,20 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput orders?: OrderUncheckedCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput } export type CustomerCreateOrConnectWithoutPreOrdersInput = { @@ -34695,6 +57359,8 @@ export namespace Prisma { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null customers?: CustomerCreateNestedManyWithoutCityInput addresses?: CustomerAddressCreateNestedManyWithoutCityInput branches?: BranchCreateNestedManyWithoutCityInput @@ -34704,6 +57370,8 @@ export namespace Prisma { id?: string name: string province?: string | null + percent?: Decimal | DecimalJsLike | number | string | null + percentAux?: Decimal | DecimalJsLike | number | string | null customers?: CustomerUncheckedCreateNestedManyWithoutCityInput addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCityInput branches?: BranchUncheckedCreateNestedManyWithoutCityInput @@ -34717,12 +57385,18 @@ export namespace Prisma { export type WorkshopCreateWithoutPreOrdersInput = { id?: string name: string + address?: string | null + phone?: string | null isActive?: boolean + supervisor?: AdminUserCreateNestedOneWithoutSupervisedWorkshopsInput } export type WorkshopUncheckedCreateWithoutPreOrdersInput = { id?: string name: string + address?: string | null + phone?: string | null + supervisorId?: string | null isActive?: boolean } @@ -34734,6 +57408,7 @@ export namespace Prisma { export type OrderCreateWithoutConvertedFromPreOrderInput = { id?: string orderNumber: string + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -34754,6 +57429,7 @@ export namespace Prisma { orderNumber: string customerId: string branchId?: string | null + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -34815,6 +57491,13 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -34822,15 +57505,22 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string city?: CityUpdateOneWithoutCustomersNestedInput referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput orders?: OrderUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateWithoutPreOrdersInput = { @@ -34840,6 +57530,13 @@ export namespace Prisma { nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -34848,13 +57545,20 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput orders?: OrderUncheckedUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput } export type CityUpsertWithoutPreOrdersInput = { @@ -34872,6 +57576,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null customers?: CustomerUpdateManyWithoutCityNestedInput addresses?: CustomerAddressUpdateManyWithoutCityNestedInput branches?: BranchUpdateManyWithoutCityNestedInput @@ -34881,6 +57587,8 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string province?: NullableStringFieldUpdateOperationsInput | string | null + percent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + percentAux?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null customers?: CustomerUncheckedUpdateManyWithoutCityNestedInput addresses?: CustomerAddressUncheckedUpdateManyWithoutCityNestedInput branches?: BranchUncheckedUpdateManyWithoutCityNestedInput @@ -34900,12 +57608,18 @@ export namespace Prisma { export type WorkshopUpdateWithoutPreOrdersInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean + supervisor?: AdminUserUpdateOneWithoutSupervisedWorkshopsNestedInput } export type WorkshopUncheckedUpdateWithoutPreOrdersInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + supervisorId?: NullableStringFieldUpdateOperationsInput | string | null isActive?: BoolFieldUpdateOperationsInput | boolean } @@ -34923,6 +57637,7 @@ export namespace Prisma { export type OrderUpdateWithoutConvertedFromPreOrderInput = { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -34943,6 +57658,7 @@ export namespace Prisma { orderNumber?: StringFieldUpdateOperationsInput | string customerId?: StringFieldUpdateOperationsInput | string branchId?: NullableStringFieldUpdateOperationsInput | string | null + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35024,10 +57740,16 @@ export namespace Prisma { wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput branch?: BranchCreateNestedOneWithoutAdminUsersInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserUncheckedCreateWithoutPreOrderStatusEventsInput = { @@ -35036,13 +57758,19 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole + userTypeId?: number | null branchId?: string | null wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserCreateOrConnectWithoutPreOrderStatusEventsInput = { @@ -35119,10 +57847,16 @@ export namespace Prisma { wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput branch?: BranchUpdateOneWithoutAdminUsersNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutPreOrderStatusEventsInput = { @@ -35131,13 +57865,19 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput } export type CustomerCreateWithoutLedgerEntriesInput = { @@ -35146,6 +57886,13 @@ export namespace Prisma { mobile: string nationalCode: string passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string fiatDebtRial?: Decimal | DecimalJsLike | number | string @@ -35153,15 +57900,22 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string city?: CityCreateNestedOneWithoutCustomersInput referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput orders?: OrderCreateNestedManyWithoutCustomerInput preOrders?: PreOrderCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput } export type CustomerUncheckedCreateWithoutLedgerEntriesInput = { @@ -35171,6 +57925,13 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null referredByAgentId?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string @@ -35179,13 +57940,20 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput orders?: OrderUncheckedCreateNestedManyWithoutCustomerInput preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput } export type CustomerCreateOrConnectWithoutLedgerEntriesInput = { @@ -35196,6 +57964,7 @@ export namespace Prisma { export type OrderCreateWithoutLedgerEntriesInput = { id?: string orderNumber: string + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -35216,6 +57985,7 @@ export namespace Prisma { orderNumber: string customerId: string branchId?: string | null + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -35243,10 +58013,16 @@ export namespace Prisma { wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput branch?: BranchCreateNestedOneWithoutAdminUsersInput referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserUncheckedCreateWithoutPostedLedgerEntriesInput = { @@ -35255,13 +58031,19 @@ export namespace Prisma { mobile: string passwordHash: string role: $Enums.AdminRole + userTypeId?: number | null branchId?: string | null wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput } export type AdminUserCreateOrConnectWithoutPostedLedgerEntriesInput = { @@ -35286,6 +58068,13 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35293,15 +58082,22 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string city?: CityUpdateOneWithoutCustomersNestedInput referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput orders?: OrderUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateWithoutLedgerEntriesInput = { @@ -35311,6 +58107,13 @@ export namespace Prisma { nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35319,13 +58122,20 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput orders?: OrderUncheckedUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput } export type OrderUpsertWithoutLedgerEntriesInput = { @@ -35342,6 +58152,7 @@ export namespace Prisma { export type OrderUpdateWithoutLedgerEntriesInput = { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35362,6 +58173,7 @@ export namespace Prisma { orderNumber?: StringFieldUpdateOperationsInput | string customerId?: StringFieldUpdateOperationsInput | string branchId?: NullableStringFieldUpdateOperationsInput | string | null + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35395,10 +58207,16 @@ export namespace Prisma { wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput branch?: BranchUpdateOneWithoutAdminUsersNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutPostedLedgerEntriesInput = { @@ -35407,13 +58225,19 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null branchId?: NullableStringFieldUpdateOperationsInput | string | null wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput } export type CustomerCreateWithoutWalletBonusesInput = { @@ -35422,6 +58246,13 @@ export namespace Prisma { mobile: string nationalCode: string passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string fiatDebtRial?: Decimal | DecimalJsLike | number | string @@ -35429,15 +58260,22 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string city?: CityCreateNestedOneWithoutCustomersInput referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput orders?: OrderCreateNestedManyWithoutCustomerInput preOrders?: PreOrderCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput } export type CustomerUncheckedCreateWithoutWalletBonusesInput = { @@ -35447,6 +58285,13 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null referredByAgentId?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string @@ -35455,13 +58300,20 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput orders?: OrderUncheckedCreateNestedManyWithoutCustomerInput preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput } export type CustomerCreateOrConnectWithoutWalletBonusesInput = { @@ -35486,6 +58338,13 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35493,15 +58352,22 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string city?: CityUpdateOneWithoutCustomersNestedInput referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput orders?: OrderUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateWithoutWalletBonusesInput = { @@ -35511,6 +58377,13 @@ export namespace Prisma { nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35519,21 +58392,271 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput orders?: OrderUncheckedUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput } - export type CustomerCreateManyCityInput = { + export type PermissionCreateWithoutUserTypeInput = { + rid: string + } + + export type PermissionUncheckedCreateWithoutUserTypeInput = { + rid: string + } + + export type PermissionCreateOrConnectWithoutUserTypeInput = { + where: PermissionWhereUniqueInput + create: XOR<PermissionCreateWithoutUserTypeInput, PermissionUncheckedCreateWithoutUserTypeInput> + } + + export type PermissionCreateManyUserTypeInputEnvelope = { + data: PermissionCreateManyUserTypeInput | PermissionCreateManyUserTypeInput[] + skipDuplicates?: boolean + } + + export type AdminUserCreateWithoutUserTypeInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + branch?: BranchCreateNestedOneWithoutAdminUsersInput + referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput + } + + export type AdminUserUncheckedCreateWithoutUserTypeInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + branchId?: string | null + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput + } + + export type AdminUserCreateOrConnectWithoutUserTypeInput = { + where: AdminUserWhereUniqueInput + create: XOR<AdminUserCreateWithoutUserTypeInput, AdminUserUncheckedCreateWithoutUserTypeInput> + } + + export type AdminUserCreateManyUserTypeInputEnvelope = { + data: AdminUserCreateManyUserTypeInput | AdminUserCreateManyUserTypeInput[] + skipDuplicates?: boolean + } + + export type PermissionUpsertWithWhereUniqueWithoutUserTypeInput = { + where: PermissionWhereUniqueInput + update: XOR<PermissionUpdateWithoutUserTypeInput, PermissionUncheckedUpdateWithoutUserTypeInput> + create: XOR<PermissionCreateWithoutUserTypeInput, PermissionUncheckedCreateWithoutUserTypeInput> + } + + export type PermissionUpdateWithWhereUniqueWithoutUserTypeInput = { + where: PermissionWhereUniqueInput + data: XOR<PermissionUpdateWithoutUserTypeInput, PermissionUncheckedUpdateWithoutUserTypeInput> + } + + export type PermissionUpdateManyWithWhereWithoutUserTypeInput = { + where: PermissionScalarWhereInput + data: XOR<PermissionUpdateManyMutationInput, PermissionUncheckedUpdateManyWithoutUserTypeInput> + } + + export type PermissionScalarWhereInput = { + AND?: PermissionScalarWhereInput | PermissionScalarWhereInput[] + OR?: PermissionScalarWhereInput[] + NOT?: PermissionScalarWhereInput | PermissionScalarWhereInput[] + rid?: StringFilter<"Permission"> | string + userTypeId?: IntFilter<"Permission"> | number + } + + export type AdminUserUpsertWithWhereUniqueWithoutUserTypeInput = { + where: AdminUserWhereUniqueInput + update: XOR<AdminUserUpdateWithoutUserTypeInput, AdminUserUncheckedUpdateWithoutUserTypeInput> + create: XOR<AdminUserCreateWithoutUserTypeInput, AdminUserUncheckedCreateWithoutUserTypeInput> + } + + export type AdminUserUpdateWithWhereUniqueWithoutUserTypeInput = { + where: AdminUserWhereUniqueInput + data: XOR<AdminUserUpdateWithoutUserTypeInput, AdminUserUncheckedUpdateWithoutUserTypeInput> + } + + export type AdminUserUpdateManyWithWhereWithoutUserTypeInput = { + where: AdminUserScalarWhereInput + data: XOR<AdminUserUpdateManyMutationInput, AdminUserUncheckedUpdateManyWithoutUserTypeInput> + } + + export type UserTypeCreateWithoutPermissionsInput = { + id: number + title: string + isActive?: boolean + createdAt?: Date | string + adminUsers?: AdminUserCreateNestedManyWithoutUserTypeInput + } + + export type UserTypeUncheckedCreateWithoutPermissionsInput = { + id: number + title: string + isActive?: boolean + createdAt?: Date | string + adminUsers?: AdminUserUncheckedCreateNestedManyWithoutUserTypeInput + } + + export type UserTypeCreateOrConnectWithoutPermissionsInput = { + where: UserTypeWhereUniqueInput + create: XOR<UserTypeCreateWithoutPermissionsInput, UserTypeUncheckedCreateWithoutPermissionsInput> + } + + export type UserTypeUpsertWithoutPermissionsInput = { + update: XOR<UserTypeUpdateWithoutPermissionsInput, UserTypeUncheckedUpdateWithoutPermissionsInput> + create: XOR<UserTypeCreateWithoutPermissionsInput, UserTypeUncheckedCreateWithoutPermissionsInput> + where?: UserTypeWhereInput + } + + export type UserTypeUpdateToOneWithWhereWithoutPermissionsInput = { + where?: UserTypeWhereInput + data: XOR<UserTypeUpdateWithoutPermissionsInput, UserTypeUncheckedUpdateWithoutPermissionsInput> + } + + export type UserTypeUpdateWithoutPermissionsInput = { + id?: IntFieldUpdateOperationsInput | number + title?: StringFieldUpdateOperationsInput | string + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + adminUsers?: AdminUserUpdateManyWithoutUserTypeNestedInput + } + + export type UserTypeUncheckedUpdateWithoutPermissionsInput = { + id?: IntFieldUpdateOperationsInput | number + title?: StringFieldUpdateOperationsInput | string + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + adminUsers?: AdminUserUncheckedUpdateManyWithoutUserTypeNestedInput + } + + export type ProductCreateWithoutCommentsInput = { + id?: string + title: string + description?: string | null + productCode?: string | null + showType?: number + isActive?: boolean + createdAt?: Date | string + category?: CategoryCreateNestedOneWithoutProductsInput + brand?: BrandCreateNestedOneWithoutProductsInput + variants?: ProductVariantCreateNestedManyWithoutProductInput + images?: ProductImageCreateNestedManyWithoutProductInput + collections?: CollectionProductCreateNestedManyWithoutProductInput + promotions?: PromotionCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemCreateNestedManyWithoutProductInput + } + + export type ProductUncheckedCreateWithoutCommentsInput = { + id?: string + title: string + description?: string | null + categoryId?: string | null + brandId?: string | null + productCode?: string | null + showType?: number + isActive?: boolean + createdAt?: Date | string + variants?: ProductVariantUncheckedCreateNestedManyWithoutProductInput + images?: ProductImageUncheckedCreateNestedManyWithoutProductInput + collections?: CollectionProductUncheckedCreateNestedManyWithoutProductInput + promotions?: PromotionUncheckedCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemUncheckedCreateNestedManyWithoutProductInput + } + + export type ProductCreateOrConnectWithoutCommentsInput = { + where: ProductWhereUniqueInput + create: XOR<ProductCreateWithoutCommentsInput, ProductUncheckedCreateWithoutCommentsInput> + } + + export type CustomerCreateWithoutCommentsInput = { id?: string fullName: string mobile: string nationalCode: string passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + city?: CityCreateNestedOneWithoutCustomersInput + referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput + addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput + orders?: OrderCreateNestedManyWithoutCustomerInput + preOrders?: PreOrderCreateNestedManyWithoutCustomerInput + ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput + walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput + } + + export type CustomerUncheckedCreateWithoutCommentsInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null referredByAgentId?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string @@ -35542,7 +58665,1810 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput + orders?: OrderUncheckedCreateNestedManyWithoutCustomerInput + preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput + ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput + walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput + } + + export type CustomerCreateOrConnectWithoutCommentsInput = { + where: CustomerWhereUniqueInput + create: XOR<CustomerCreateWithoutCommentsInput, CustomerUncheckedCreateWithoutCommentsInput> + } + + export type CommentCreateWithoutRepliesInput = { + id?: string + body: string + status?: $Enums.CommentStatus + createdAt?: Date | string + updatedAt?: Date | string + product: ProductCreateNestedOneWithoutCommentsInput + customer: CustomerCreateNestedOneWithoutCommentsInput + replyTo?: CommentCreateNestedOneWithoutRepliesInput + } + + export type CommentUncheckedCreateWithoutRepliesInput = { + id?: string + productId: string + customerId: string + body: string + status?: $Enums.CommentStatus + replyToId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type CommentCreateOrConnectWithoutRepliesInput = { + where: CommentWhereUniqueInput + create: XOR<CommentCreateWithoutRepliesInput, CommentUncheckedCreateWithoutRepliesInput> + } + + export type CommentCreateWithoutReplyToInput = { + id?: string + body: string + status?: $Enums.CommentStatus + createdAt?: Date | string + updatedAt?: Date | string + product: ProductCreateNestedOneWithoutCommentsInput + customer: CustomerCreateNestedOneWithoutCommentsInput + replies?: CommentCreateNestedManyWithoutReplyToInput + } + + export type CommentUncheckedCreateWithoutReplyToInput = { + id?: string + productId: string + customerId: string + body: string + status?: $Enums.CommentStatus + createdAt?: Date | string + updatedAt?: Date | string + replies?: CommentUncheckedCreateNestedManyWithoutReplyToInput + } + + export type CommentCreateOrConnectWithoutReplyToInput = { + where: CommentWhereUniqueInput + create: XOR<CommentCreateWithoutReplyToInput, CommentUncheckedCreateWithoutReplyToInput> + } + + export type CommentCreateManyReplyToInputEnvelope = { + data: CommentCreateManyReplyToInput | CommentCreateManyReplyToInput[] + skipDuplicates?: boolean + } + + export type ProductUpsertWithoutCommentsInput = { + update: XOR<ProductUpdateWithoutCommentsInput, ProductUncheckedUpdateWithoutCommentsInput> + create: XOR<ProductCreateWithoutCommentsInput, ProductUncheckedCreateWithoutCommentsInput> + where?: ProductWhereInput + } + + export type ProductUpdateToOneWithWhereWithoutCommentsInput = { + where?: ProductWhereInput + data: XOR<ProductUpdateWithoutCommentsInput, ProductUncheckedUpdateWithoutCommentsInput> + } + + export type ProductUpdateWithoutCommentsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + category?: CategoryUpdateOneWithoutProductsNestedInput + brand?: BrandUpdateOneWithoutProductsNestedInput + variants?: ProductVariantUpdateManyWithoutProductNestedInput + images?: ProductImageUpdateManyWithoutProductNestedInput + collections?: CollectionProductUpdateManyWithoutProductNestedInput + promotions?: PromotionUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUpdateManyWithoutProductNestedInput + } + + export type ProductUncheckedUpdateWithoutCommentsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + variants?: ProductVariantUncheckedUpdateManyWithoutProductNestedInput + images?: ProductImageUncheckedUpdateManyWithoutProductNestedInput + collections?: CollectionProductUncheckedUpdateManyWithoutProductNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUncheckedUpdateManyWithoutProductNestedInput + } + + export type CustomerUpsertWithoutCommentsInput = { + update: XOR<CustomerUpdateWithoutCommentsInput, CustomerUncheckedUpdateWithoutCommentsInput> + create: XOR<CustomerCreateWithoutCommentsInput, CustomerUncheckedCreateWithoutCommentsInput> + where?: CustomerWhereInput + } + + export type CustomerUpdateToOneWithWhereWithoutCommentsInput = { + where?: CustomerWhereInput + data: XOR<CustomerUpdateWithoutCommentsInput, CustomerUncheckedUpdateWithoutCommentsInput> + } + + export type CustomerUpdateWithoutCommentsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + city?: CityUpdateOneWithoutCustomersNestedInput + referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput + addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput + orders?: OrderUpdateManyWithoutCustomerNestedInput + preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput + ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput + walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput + } + + export type CustomerUncheckedUpdateWithoutCommentsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput + orders?: OrderUncheckedUpdateManyWithoutCustomerNestedInput + preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput + ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput + walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput + } + + export type CommentUpsertWithoutRepliesInput = { + update: XOR<CommentUpdateWithoutRepliesInput, CommentUncheckedUpdateWithoutRepliesInput> + create: XOR<CommentCreateWithoutRepliesInput, CommentUncheckedCreateWithoutRepliesInput> + where?: CommentWhereInput + } + + export type CommentUpdateToOneWithWhereWithoutRepliesInput = { + where?: CommentWhereInput + data: XOR<CommentUpdateWithoutRepliesInput, CommentUncheckedUpdateWithoutRepliesInput> + } + + export type CommentUpdateWithoutRepliesInput = { + id?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + product?: ProductUpdateOneRequiredWithoutCommentsNestedInput + customer?: CustomerUpdateOneRequiredWithoutCommentsNestedInput + replyTo?: CommentUpdateOneWithoutRepliesNestedInput + } + + export type CommentUncheckedUpdateWithoutRepliesInput = { + id?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + replyToId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CommentUpsertWithWhereUniqueWithoutReplyToInput = { + where: CommentWhereUniqueInput + update: XOR<CommentUpdateWithoutReplyToInput, CommentUncheckedUpdateWithoutReplyToInput> + create: XOR<CommentCreateWithoutReplyToInput, CommentUncheckedCreateWithoutReplyToInput> + } + + export type CommentUpdateWithWhereUniqueWithoutReplyToInput = { + where: CommentWhereUniqueInput + data: XOR<CommentUpdateWithoutReplyToInput, CommentUncheckedUpdateWithoutReplyToInput> + } + + export type CommentUpdateManyWithWhereWithoutReplyToInput = { + where: CommentScalarWhereInput + data: XOR<CommentUpdateManyMutationInput, CommentUncheckedUpdateManyWithoutReplyToInput> + } + + export type ProductCreateWithoutPromotionsInput = { + id?: string + title: string + description?: string | null + productCode?: string | null + showType?: number + isActive?: boolean + createdAt?: Date | string + category?: CategoryCreateNestedOneWithoutProductsInput + brand?: BrandCreateNestedOneWithoutProductsInput + variants?: ProductVariantCreateNestedManyWithoutProductInput + images?: ProductImageCreateNestedManyWithoutProductInput + collections?: CollectionProductCreateNestedManyWithoutProductInput + comments?: CommentCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemCreateNestedManyWithoutProductInput + } + + export type ProductUncheckedCreateWithoutPromotionsInput = { + id?: string + title: string + description?: string | null + categoryId?: string | null + brandId?: string | null + productCode?: string | null + showType?: number + isActive?: boolean + createdAt?: Date | string + variants?: ProductVariantUncheckedCreateNestedManyWithoutProductInput + images?: ProductImageUncheckedCreateNestedManyWithoutProductInput + collections?: CollectionProductUncheckedCreateNestedManyWithoutProductInput + comments?: CommentUncheckedCreateNestedManyWithoutProductInput + allocationItems?: BranchAllocationItemUncheckedCreateNestedManyWithoutProductInput + } + + export type ProductCreateOrConnectWithoutPromotionsInput = { + where: ProductWhereUniqueInput + create: XOR<ProductCreateWithoutPromotionsInput, ProductUncheckedCreateWithoutPromotionsInput> + } + + export type CategoryCreateWithoutPromotionsInput = { + id?: string + title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null + parent?: CategoryCreateNestedOneWithoutChildrenInput + children?: CategoryCreateNestedManyWithoutParentInput + products?: ProductCreateNestedManyWithoutCategoryInput + } + + export type CategoryUncheckedCreateWithoutPromotionsInput = { + id?: string + title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null + parentId?: string | null + children?: CategoryUncheckedCreateNestedManyWithoutParentInput + products?: ProductUncheckedCreateNestedManyWithoutCategoryInput + } + + export type CategoryCreateOrConnectWithoutPromotionsInput = { + where: CategoryWhereUniqueInput + create: XOR<CategoryCreateWithoutPromotionsInput, CategoryUncheckedCreateWithoutPromotionsInput> + } + + export type CustomerCreateWithoutPromotionsInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + city?: CityCreateNestedOneWithoutCustomersInput + referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput + addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput + orders?: OrderCreateNestedManyWithoutCustomerInput + preOrders?: PreOrderCreateNestedManyWithoutCustomerInput + ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput + walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput + } + + export type CustomerUncheckedCreateWithoutPromotionsInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + referredByAgentId?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput + orders?: OrderUncheckedCreateNestedManyWithoutCustomerInput + preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput + ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput + walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput + } + + export type CustomerCreateOrConnectWithoutPromotionsInput = { + where: CustomerWhereUniqueInput + create: XOR<CustomerCreateWithoutPromotionsInput, CustomerUncheckedCreateWithoutPromotionsInput> + } + + export type BrandCreateWithoutPromotionsInput = { + id?: string + title: string + products?: ProductCreateNestedManyWithoutBrandInput + } + + export type BrandUncheckedCreateWithoutPromotionsInput = { + id?: string + title: string + products?: ProductUncheckedCreateNestedManyWithoutBrandInput + } + + export type BrandCreateOrConnectWithoutPromotionsInput = { + where: BrandWhereUniqueInput + create: XOR<BrandCreateWithoutPromotionsInput, BrandUncheckedCreateWithoutPromotionsInput> + } + + export type ProductUpsertWithoutPromotionsInput = { + update: XOR<ProductUpdateWithoutPromotionsInput, ProductUncheckedUpdateWithoutPromotionsInput> + create: XOR<ProductCreateWithoutPromotionsInput, ProductUncheckedCreateWithoutPromotionsInput> + where?: ProductWhereInput + } + + export type ProductUpdateToOneWithWhereWithoutPromotionsInput = { + where?: ProductWhereInput + data: XOR<ProductUpdateWithoutPromotionsInput, ProductUncheckedUpdateWithoutPromotionsInput> + } + + export type ProductUpdateWithoutPromotionsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + category?: CategoryUpdateOneWithoutProductsNestedInput + brand?: BrandUpdateOneWithoutProductsNestedInput + variants?: ProductVariantUpdateManyWithoutProductNestedInput + images?: ProductImageUpdateManyWithoutProductNestedInput + collections?: CollectionProductUpdateManyWithoutProductNestedInput + comments?: CommentUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUpdateManyWithoutProductNestedInput + } + + export type ProductUncheckedUpdateWithoutPromotionsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + variants?: ProductVariantUncheckedUpdateManyWithoutProductNestedInput + images?: ProductImageUncheckedUpdateManyWithoutProductNestedInput + collections?: CollectionProductUncheckedUpdateManyWithoutProductNestedInput + comments?: CommentUncheckedUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUncheckedUpdateManyWithoutProductNestedInput + } + + export type CategoryUpsertWithoutPromotionsInput = { + update: XOR<CategoryUpdateWithoutPromotionsInput, CategoryUncheckedUpdateWithoutPromotionsInput> + create: XOR<CategoryCreateWithoutPromotionsInput, CategoryUncheckedCreateWithoutPromotionsInput> + where?: CategoryWhereInput + } + + export type CategoryUpdateToOneWithWhereWithoutPromotionsInput = { + where?: CategoryWhereInput + data: XOR<CategoryUpdateWithoutPromotionsInput, CategoryUncheckedUpdateWithoutPromotionsInput> + } + + export type CategoryUpdateWithoutPromotionsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null + parent?: CategoryUpdateOneWithoutChildrenNestedInput + children?: CategoryUpdateManyWithoutParentNestedInput + products?: ProductUpdateManyWithoutCategoryNestedInput + } + + export type CategoryUncheckedUpdateWithoutPromotionsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null + parentId?: NullableStringFieldUpdateOperationsInput | string | null + children?: CategoryUncheckedUpdateManyWithoutParentNestedInput + products?: ProductUncheckedUpdateManyWithoutCategoryNestedInput + } + + export type CustomerUpsertWithoutPromotionsInput = { + update: XOR<CustomerUpdateWithoutPromotionsInput, CustomerUncheckedUpdateWithoutPromotionsInput> + create: XOR<CustomerCreateWithoutPromotionsInput, CustomerUncheckedCreateWithoutPromotionsInput> + where?: CustomerWhereInput + } + + export type CustomerUpdateToOneWithWhereWithoutPromotionsInput = { + where?: CustomerWhereInput + data: XOR<CustomerUpdateWithoutPromotionsInput, CustomerUncheckedUpdateWithoutPromotionsInput> + } + + export type CustomerUpdateWithoutPromotionsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + city?: CityUpdateOneWithoutCustomersNestedInput + referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput + addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput + orders?: OrderUpdateManyWithoutCustomerNestedInput + preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput + ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput + walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput + } + + export type CustomerUncheckedUpdateWithoutPromotionsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput + orders?: OrderUncheckedUpdateManyWithoutCustomerNestedInput + preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput + ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput + walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput + } + + export type BrandUpsertWithoutPromotionsInput = { + update: XOR<BrandUpdateWithoutPromotionsInput, BrandUncheckedUpdateWithoutPromotionsInput> + create: XOR<BrandCreateWithoutPromotionsInput, BrandUncheckedCreateWithoutPromotionsInput> + where?: BrandWhereInput + } + + export type BrandUpdateToOneWithWhereWithoutPromotionsInput = { + where?: BrandWhereInput + data: XOR<BrandUpdateWithoutPromotionsInput, BrandUncheckedUpdateWithoutPromotionsInput> + } + + export type BrandUpdateWithoutPromotionsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + products?: ProductUpdateManyWithoutBrandNestedInput + } + + export type BrandUncheckedUpdateWithoutPromotionsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + products?: ProductUncheckedUpdateManyWithoutBrandNestedInput + } + + export type BranchCreateWithoutAllocationsInput = { + id?: string + name: string + address?: string | null + phone?: string | null + isActive?: boolean + city?: CityCreateNestedOneWithoutBranchesInput + adminUsers?: AdminUserCreateNestedManyWithoutBranchInput + orders?: OrderCreateNestedManyWithoutBranchInput + } + + export type BranchUncheckedCreateWithoutAllocationsInput = { + id?: string + name: string + address?: string | null + phone?: string | null + isActive?: boolean + cityId?: string | null + adminUsers?: AdminUserUncheckedCreateNestedManyWithoutBranchInput + orders?: OrderUncheckedCreateNestedManyWithoutBranchInput + } + + export type BranchCreateOrConnectWithoutAllocationsInput = { + where: BranchWhereUniqueInput + create: XOR<BranchCreateWithoutAllocationsInput, BranchUncheckedCreateWithoutAllocationsInput> + } + + export type AdminUserCreateWithoutBranchAllocationsInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput + branch?: BranchCreateNestedOneWithoutAdminUsersInput + referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput + } + + export type AdminUserUncheckedCreateWithoutBranchAllocationsInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + userTypeId?: number | null + branchId?: string | null + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput + } + + export type AdminUserCreateOrConnectWithoutBranchAllocationsInput = { + where: AdminUserWhereUniqueInput + create: XOR<AdminUserCreateWithoutBranchAllocationsInput, AdminUserUncheckedCreateWithoutBranchAllocationsInput> + } + + export type BranchAllocationItemCreateWithoutAllocationInput = { + id?: string + weightGrams?: Decimal | DecimalJsLike | number | string | null + product: ProductCreateNestedOneWithoutAllocationItemsInput + } + + export type BranchAllocationItemUncheckedCreateWithoutAllocationInput = { + id?: string + productId: string + weightGrams?: Decimal | DecimalJsLike | number | string | null + } + + export type BranchAllocationItemCreateOrConnectWithoutAllocationInput = { + where: BranchAllocationItemWhereUniqueInput + create: XOR<BranchAllocationItemCreateWithoutAllocationInput, BranchAllocationItemUncheckedCreateWithoutAllocationInput> + } + + export type BranchAllocationItemCreateManyAllocationInputEnvelope = { + data: BranchAllocationItemCreateManyAllocationInput | BranchAllocationItemCreateManyAllocationInput[] + skipDuplicates?: boolean + } + + export type BranchUpsertWithoutAllocationsInput = { + update: XOR<BranchUpdateWithoutAllocationsInput, BranchUncheckedUpdateWithoutAllocationsInput> + create: XOR<BranchCreateWithoutAllocationsInput, BranchUncheckedCreateWithoutAllocationsInput> + where?: BranchWhereInput + } + + export type BranchUpdateToOneWithWhereWithoutAllocationsInput = { + where?: BranchWhereInput + data: XOR<BranchUpdateWithoutAllocationsInput, BranchUncheckedUpdateWithoutAllocationsInput> + } + + export type BranchUpdateWithoutAllocationsInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + city?: CityUpdateOneWithoutBranchesNestedInput + adminUsers?: AdminUserUpdateManyWithoutBranchNestedInput + orders?: OrderUpdateManyWithoutBranchNestedInput + } + + export type BranchUncheckedUpdateWithoutAllocationsInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + cityId?: NullableStringFieldUpdateOperationsInput | string | null + adminUsers?: AdminUserUncheckedUpdateManyWithoutBranchNestedInput + orders?: OrderUncheckedUpdateManyWithoutBranchNestedInput + } + + export type AdminUserUpsertWithoutBranchAllocationsInput = { + update: XOR<AdminUserUpdateWithoutBranchAllocationsInput, AdminUserUncheckedUpdateWithoutBranchAllocationsInput> + create: XOR<AdminUserCreateWithoutBranchAllocationsInput, AdminUserUncheckedCreateWithoutBranchAllocationsInput> + where?: AdminUserWhereInput + } + + export type AdminUserUpdateToOneWithWhereWithoutBranchAllocationsInput = { + where?: AdminUserWhereInput + data: XOR<AdminUserUpdateWithoutBranchAllocationsInput, AdminUserUncheckedUpdateWithoutBranchAllocationsInput> + } + + export type AdminUserUpdateWithoutBranchAllocationsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput + branch?: BranchUpdateOneWithoutAdminUsersNestedInput + referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput + } + + export type AdminUserUncheckedUpdateWithoutBranchAllocationsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null + branchId?: NullableStringFieldUpdateOperationsInput | string | null + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput + } + + export type BranchAllocationItemUpsertWithWhereUniqueWithoutAllocationInput = { + where: BranchAllocationItemWhereUniqueInput + update: XOR<BranchAllocationItemUpdateWithoutAllocationInput, BranchAllocationItemUncheckedUpdateWithoutAllocationInput> + create: XOR<BranchAllocationItemCreateWithoutAllocationInput, BranchAllocationItemUncheckedCreateWithoutAllocationInput> + } + + export type BranchAllocationItemUpdateWithWhereUniqueWithoutAllocationInput = { + where: BranchAllocationItemWhereUniqueInput + data: XOR<BranchAllocationItemUpdateWithoutAllocationInput, BranchAllocationItemUncheckedUpdateWithoutAllocationInput> + } + + export type BranchAllocationItemUpdateManyWithWhereWithoutAllocationInput = { + where: BranchAllocationItemScalarWhereInput + data: XOR<BranchAllocationItemUpdateManyMutationInput, BranchAllocationItemUncheckedUpdateManyWithoutAllocationInput> + } + + export type BranchAllocationCreateWithoutItemsInput = { + id?: string + note?: string | null + createdAt?: Date | string + branch: BranchCreateNestedOneWithoutAllocationsInput + allocatorAdminUser?: AdminUserCreateNestedOneWithoutBranchAllocationsInput + } + + export type BranchAllocationUncheckedCreateWithoutItemsInput = { + id?: string + branchId: string + allocatorAdminUserId?: string | null + note?: string | null + createdAt?: Date | string + } + + export type BranchAllocationCreateOrConnectWithoutItemsInput = { + where: BranchAllocationWhereUniqueInput + create: XOR<BranchAllocationCreateWithoutItemsInput, BranchAllocationUncheckedCreateWithoutItemsInput> + } + + export type ProductCreateWithoutAllocationItemsInput = { + id?: string + title: string + description?: string | null + productCode?: string | null + showType?: number + isActive?: boolean + createdAt?: Date | string + category?: CategoryCreateNestedOneWithoutProductsInput + brand?: BrandCreateNestedOneWithoutProductsInput + variants?: ProductVariantCreateNestedManyWithoutProductInput + images?: ProductImageCreateNestedManyWithoutProductInput + collections?: CollectionProductCreateNestedManyWithoutProductInput + comments?: CommentCreateNestedManyWithoutProductInput + promotions?: PromotionCreateNestedManyWithoutProductInput + } + + export type ProductUncheckedCreateWithoutAllocationItemsInput = { + id?: string + title: string + description?: string | null + categoryId?: string | null + brandId?: string | null + productCode?: string | null + showType?: number + isActive?: boolean + createdAt?: Date | string + variants?: ProductVariantUncheckedCreateNestedManyWithoutProductInput + images?: ProductImageUncheckedCreateNestedManyWithoutProductInput + collections?: CollectionProductUncheckedCreateNestedManyWithoutProductInput + comments?: CommentUncheckedCreateNestedManyWithoutProductInput + promotions?: PromotionUncheckedCreateNestedManyWithoutProductInput + } + + export type ProductCreateOrConnectWithoutAllocationItemsInput = { + where: ProductWhereUniqueInput + create: XOR<ProductCreateWithoutAllocationItemsInput, ProductUncheckedCreateWithoutAllocationItemsInput> + } + + export type BranchAllocationUpsertWithoutItemsInput = { + update: XOR<BranchAllocationUpdateWithoutItemsInput, BranchAllocationUncheckedUpdateWithoutItemsInput> + create: XOR<BranchAllocationCreateWithoutItemsInput, BranchAllocationUncheckedCreateWithoutItemsInput> + where?: BranchAllocationWhereInput + } + + export type BranchAllocationUpdateToOneWithWhereWithoutItemsInput = { + where?: BranchAllocationWhereInput + data: XOR<BranchAllocationUpdateWithoutItemsInput, BranchAllocationUncheckedUpdateWithoutItemsInput> + } + + export type BranchAllocationUpdateWithoutItemsInput = { + id?: StringFieldUpdateOperationsInput | string + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + branch?: BranchUpdateOneRequiredWithoutAllocationsNestedInput + allocatorAdminUser?: AdminUserUpdateOneWithoutBranchAllocationsNestedInput + } + + export type BranchAllocationUncheckedUpdateWithoutItemsInput = { + id?: StringFieldUpdateOperationsInput | string + branchId?: StringFieldUpdateOperationsInput | string + allocatorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type ProductUpsertWithoutAllocationItemsInput = { + update: XOR<ProductUpdateWithoutAllocationItemsInput, ProductUncheckedUpdateWithoutAllocationItemsInput> + create: XOR<ProductCreateWithoutAllocationItemsInput, ProductUncheckedCreateWithoutAllocationItemsInput> + where?: ProductWhereInput + } + + export type ProductUpdateToOneWithWhereWithoutAllocationItemsInput = { + where?: ProductWhereInput + data: XOR<ProductUpdateWithoutAllocationItemsInput, ProductUncheckedUpdateWithoutAllocationItemsInput> + } + + export type ProductUpdateWithoutAllocationItemsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + category?: CategoryUpdateOneWithoutProductsNestedInput + brand?: BrandUpdateOneWithoutProductsNestedInput + variants?: ProductVariantUpdateManyWithoutProductNestedInput + images?: ProductImageUpdateManyWithoutProductNestedInput + collections?: CollectionProductUpdateManyWithoutProductNestedInput + comments?: CommentUpdateManyWithoutProductNestedInput + promotions?: PromotionUpdateManyWithoutProductNestedInput + } + + export type ProductUncheckedUpdateWithoutAllocationItemsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + variants?: ProductVariantUncheckedUpdateManyWithoutProductNestedInput + images?: ProductImageUncheckedUpdateManyWithoutProductNestedInput + collections?: CollectionProductUncheckedUpdateManyWithoutProductNestedInput + comments?: CommentUncheckedUpdateManyWithoutProductNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutProductNestedInput + } + + export type AdminUserCreateWithoutSentSmsMessagesInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput + branch?: BranchCreateNestedOneWithoutAdminUsersInput + referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput + } + + export type AdminUserUncheckedCreateWithoutSentSmsMessagesInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + userTypeId?: number | null + branchId?: string | null + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput + } + + export type AdminUserCreateOrConnectWithoutSentSmsMessagesInput = { + where: AdminUserWhereUniqueInput + create: XOR<AdminUserCreateWithoutSentSmsMessagesInput, AdminUserUncheckedCreateWithoutSentSmsMessagesInput> + } + + export type AdminUserUpsertWithoutSentSmsMessagesInput = { + update: XOR<AdminUserUpdateWithoutSentSmsMessagesInput, AdminUserUncheckedUpdateWithoutSentSmsMessagesInput> + create: XOR<AdminUserCreateWithoutSentSmsMessagesInput, AdminUserUncheckedCreateWithoutSentSmsMessagesInput> + where?: AdminUserWhereInput + } + + export type AdminUserUpdateToOneWithWhereWithoutSentSmsMessagesInput = { + where?: AdminUserWhereInput + data: XOR<AdminUserUpdateWithoutSentSmsMessagesInput, AdminUserUncheckedUpdateWithoutSentSmsMessagesInput> + } + + export type AdminUserUpdateWithoutSentSmsMessagesInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput + branch?: BranchUpdateOneWithoutAdminUsersNestedInput + referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput + } + + export type AdminUserUncheckedUpdateWithoutSentSmsMessagesInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null + branchId?: NullableStringFieldUpdateOperationsInput | string | null + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput + } + + export type AdminUserCreateWithoutSentNotificationsInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput + branch?: BranchCreateNestedOneWithoutAdminUsersInput + referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileCreateNestedManyWithoutUploadedByAdminUserInput + } + + export type AdminUserUncheckedCreateWithoutSentNotificationsInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + userTypeId?: number | null + branchId?: string | null + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + uploadedFiles?: UploadedFileUncheckedCreateNestedManyWithoutUploadedByAdminUserInput + } + + export type AdminUserCreateOrConnectWithoutSentNotificationsInput = { + where: AdminUserWhereUniqueInput + create: XOR<AdminUserCreateWithoutSentNotificationsInput, AdminUserUncheckedCreateWithoutSentNotificationsInput> + } + + export type NotificationRecipientCreateWithoutNotificationInput = { + id?: string + readAt?: Date | string | null + customer: CustomerCreateNestedOneWithoutNotificationsInput + } + + export type NotificationRecipientUncheckedCreateWithoutNotificationInput = { + id?: string + customerId: string + readAt?: Date | string | null + } + + export type NotificationRecipientCreateOrConnectWithoutNotificationInput = { + where: NotificationRecipientWhereUniqueInput + create: XOR<NotificationRecipientCreateWithoutNotificationInput, NotificationRecipientUncheckedCreateWithoutNotificationInput> + } + + export type NotificationRecipientCreateManyNotificationInputEnvelope = { + data: NotificationRecipientCreateManyNotificationInput | NotificationRecipientCreateManyNotificationInput[] + skipDuplicates?: boolean + } + + export type AdminUserUpsertWithoutSentNotificationsInput = { + update: XOR<AdminUserUpdateWithoutSentNotificationsInput, AdminUserUncheckedUpdateWithoutSentNotificationsInput> + create: XOR<AdminUserCreateWithoutSentNotificationsInput, AdminUserUncheckedCreateWithoutSentNotificationsInput> + where?: AdminUserWhereInput + } + + export type AdminUserUpdateToOneWithWhereWithoutSentNotificationsInput = { + where?: AdminUserWhereInput + data: XOR<AdminUserUpdateWithoutSentNotificationsInput, AdminUserUncheckedUpdateWithoutSentNotificationsInput> + } + + export type AdminUserUpdateWithoutSentNotificationsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput + branch?: BranchUpdateOneWithoutAdminUsersNestedInput + referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput + } + + export type AdminUserUncheckedUpdateWithoutSentNotificationsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null + branchId?: NullableStringFieldUpdateOperationsInput | string | null + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput + } + + export type NotificationRecipientUpsertWithWhereUniqueWithoutNotificationInput = { + where: NotificationRecipientWhereUniqueInput + update: XOR<NotificationRecipientUpdateWithoutNotificationInput, NotificationRecipientUncheckedUpdateWithoutNotificationInput> + create: XOR<NotificationRecipientCreateWithoutNotificationInput, NotificationRecipientUncheckedCreateWithoutNotificationInput> + } + + export type NotificationRecipientUpdateWithWhereUniqueWithoutNotificationInput = { + where: NotificationRecipientWhereUniqueInput + data: XOR<NotificationRecipientUpdateWithoutNotificationInput, NotificationRecipientUncheckedUpdateWithoutNotificationInput> + } + + export type NotificationRecipientUpdateManyWithWhereWithoutNotificationInput = { + where: NotificationRecipientScalarWhereInput + data: XOR<NotificationRecipientUpdateManyMutationInput, NotificationRecipientUncheckedUpdateManyWithoutNotificationInput> + } + + export type NotificationCreateWithoutRecipientsInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + createdAt?: Date | string + sentByAdminUser?: AdminUserCreateNestedOneWithoutSentNotificationsInput + } + + export type NotificationUncheckedCreateWithoutRecipientsInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + sentByAdminUserId?: string | null + createdAt?: Date | string + } + + export type NotificationCreateOrConnectWithoutRecipientsInput = { + where: NotificationWhereUniqueInput + create: XOR<NotificationCreateWithoutRecipientsInput, NotificationUncheckedCreateWithoutRecipientsInput> + } + + export type CustomerCreateWithoutNotificationsInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + city?: CityCreateNestedOneWithoutCustomersInput + referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput + addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput + orders?: OrderCreateNestedManyWithoutCustomerInput + preOrders?: PreOrderCreateNestedManyWithoutCustomerInput + ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput + walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput + } + + export type CustomerUncheckedCreateWithoutNotificationsInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + referredByAgentId?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput + orders?: OrderUncheckedCreateNestedManyWithoutCustomerInput + preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput + ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput + walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput + } + + export type CustomerCreateOrConnectWithoutNotificationsInput = { + where: CustomerWhereUniqueInput + create: XOR<CustomerCreateWithoutNotificationsInput, CustomerUncheckedCreateWithoutNotificationsInput> + } + + export type NotificationUpsertWithoutRecipientsInput = { + update: XOR<NotificationUpdateWithoutRecipientsInput, NotificationUncheckedUpdateWithoutRecipientsInput> + create: XOR<NotificationCreateWithoutRecipientsInput, NotificationUncheckedCreateWithoutRecipientsInput> + where?: NotificationWhereInput + } + + export type NotificationUpdateToOneWithWhereWithoutRecipientsInput = { + where?: NotificationWhereInput + data: XOR<NotificationUpdateWithoutRecipientsInput, NotificationUncheckedUpdateWithoutRecipientsInput> + } + + export type NotificationUpdateWithoutRecipientsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + sentByAdminUser?: AdminUserUpdateOneWithoutSentNotificationsNestedInput + } + + export type NotificationUncheckedUpdateWithoutRecipientsInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + sentByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CustomerUpsertWithoutNotificationsInput = { + update: XOR<CustomerUpdateWithoutNotificationsInput, CustomerUncheckedUpdateWithoutNotificationsInput> + create: XOR<CustomerCreateWithoutNotificationsInput, CustomerUncheckedCreateWithoutNotificationsInput> + where?: CustomerWhereInput + } + + export type CustomerUpdateToOneWithWhereWithoutNotificationsInput = { + where?: CustomerWhereInput + data: XOR<CustomerUpdateWithoutNotificationsInput, CustomerUncheckedUpdateWithoutNotificationsInput> + } + + export type CustomerUpdateWithoutNotificationsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + city?: CityUpdateOneWithoutCustomersNestedInput + referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput + addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput + orders?: OrderUpdateManyWithoutCustomerNestedInput + preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput + ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput + walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput + } + + export type CustomerUncheckedUpdateWithoutNotificationsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput + orders?: OrderUncheckedUpdateManyWithoutCustomerNestedInput + preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput + ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput + walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput + } + + export type CustomerCreateWithoutActivityLogsInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + city?: CityCreateNestedOneWithoutCustomersInput + referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + avatarFile?: UploadedFileCreateNestedOneWithoutCustomerAvatarsInput + addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput + orders?: OrderCreateNestedManyWithoutCustomerInput + preOrders?: PreOrderCreateNestedManyWithoutCustomerInput + ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput + walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + } + + export type CustomerUncheckedCreateWithoutActivityLogsInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + referredByAgentId?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput + orders?: OrderUncheckedCreateNestedManyWithoutCustomerInput + preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput + ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput + walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + } + + export type CustomerCreateOrConnectWithoutActivityLogsInput = { + where: CustomerWhereUniqueInput + create: XOR<CustomerCreateWithoutActivityLogsInput, CustomerUncheckedCreateWithoutActivityLogsInput> + } + + export type CustomerUpsertWithoutActivityLogsInput = { + update: XOR<CustomerUpdateWithoutActivityLogsInput, CustomerUncheckedUpdateWithoutActivityLogsInput> + create: XOR<CustomerCreateWithoutActivityLogsInput, CustomerUncheckedCreateWithoutActivityLogsInput> + where?: CustomerWhereInput + } + + export type CustomerUpdateToOneWithWhereWithoutActivityLogsInput = { + where?: CustomerWhereInput + data: XOR<CustomerUpdateWithoutActivityLogsInput, CustomerUncheckedUpdateWithoutActivityLogsInput> + } + + export type CustomerUpdateWithoutActivityLogsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + city?: CityUpdateOneWithoutCustomersNestedInput + referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput + addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput + orders?: OrderUpdateManyWithoutCustomerNestedInput + preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput + ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput + walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + } + + export type CustomerUncheckedUpdateWithoutActivityLogsInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput + orders?: OrderUncheckedUpdateManyWithoutCustomerNestedInput + preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput + ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput + walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + } + + export type AdminUserCreateWithoutUploadedFilesInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + userType?: UserTypeCreateNestedOneWithoutAdminUsersInput + branch?: BranchCreateNestedOneWithoutAdminUsersInput + referredCustomers?: CustomerCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationCreateNestedManyWithoutAllocatorAdminUserInput + postedLedgerEntries?: LedgerEntryCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationCreateNestedManyWithoutSentByAdminUserInput + } + + export type AdminUserUncheckedCreateWithoutUploadedFilesInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + userTypeId?: number | null + branchId?: string | null + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + referredCustomers?: CustomerUncheckedCreateNestedManyWithoutReferredByAgentInput + supervisedWorkshops?: WorkshopUncheckedCreateNestedManyWithoutSupervisorInput + branchAllocations?: BranchAllocationUncheckedCreateNestedManyWithoutAllocatorAdminUserInput + postedLedgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutPostedByAdminUserInput + orderStatusEvents?: OrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedCreateNestedManyWithoutActorAdminUserInput + sentSmsMessages?: SmsMessageUncheckedCreateNestedManyWithoutSentByAdminUserInput + sentNotifications?: NotificationUncheckedCreateNestedManyWithoutSentByAdminUserInput + } + + export type AdminUserCreateOrConnectWithoutUploadedFilesInput = { + where: AdminUserWhereUniqueInput + create: XOR<AdminUserCreateWithoutUploadedFilesInput, AdminUserUncheckedCreateWithoutUploadedFilesInput> + } + + export type CustomerCreateWithoutAvatarFileInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + city?: CityCreateNestedOneWithoutCustomersInput + referredByAgent?: AdminUserCreateNestedOneWithoutReferredCustomersInput + addresses?: CustomerAddressCreateNestedManyWithoutCustomerInput + orders?: OrderCreateNestedManyWithoutCustomerInput + preOrders?: PreOrderCreateNestedManyWithoutCustomerInput + ledgerEntries?: LedgerEntryCreateNestedManyWithoutCustomerInput + walletBonuses?: WalletBonusCreateNestedManyWithoutCustomerInput + comments?: CommentCreateNestedManyWithoutCustomerInput + promotions?: PromotionCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogCreateNestedManyWithoutCustomerInput + } + + export type CustomerUncheckedCreateWithoutAvatarFileInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + referredByAgentId?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + addresses?: CustomerAddressUncheckedCreateNestedManyWithoutCustomerInput + orders?: OrderUncheckedCreateNestedManyWithoutCustomerInput + preOrders?: PreOrderUncheckedCreateNestedManyWithoutCustomerInput + ledgerEntries?: LedgerEntryUncheckedCreateNestedManyWithoutCustomerInput + walletBonuses?: WalletBonusUncheckedCreateNestedManyWithoutCustomerInput + comments?: CommentUncheckedCreateNestedManyWithoutCustomerInput + promotions?: PromotionUncheckedCreateNestedManyWithoutCustomerInput + notifications?: NotificationRecipientUncheckedCreateNestedManyWithoutCustomerInput + activityLogs?: CustomerActivityLogUncheckedCreateNestedManyWithoutCustomerInput + } + + export type CustomerCreateOrConnectWithoutAvatarFileInput = { + where: CustomerWhereUniqueInput + create: XOR<CustomerCreateWithoutAvatarFileInput, CustomerUncheckedCreateWithoutAvatarFileInput> + } + + export type CustomerCreateManyAvatarFileInputEnvelope = { + data: CustomerCreateManyAvatarFileInput | CustomerCreateManyAvatarFileInput[] + skipDuplicates?: boolean + } + + export type AdminUserUpsertWithoutUploadedFilesInput = { + update: XOR<AdminUserUpdateWithoutUploadedFilesInput, AdminUserUncheckedUpdateWithoutUploadedFilesInput> + create: XOR<AdminUserCreateWithoutUploadedFilesInput, AdminUserUncheckedCreateWithoutUploadedFilesInput> + where?: AdminUserWhereInput + } + + export type AdminUserUpdateToOneWithWhereWithoutUploadedFilesInput = { + where?: AdminUserWhereInput + data: XOR<AdminUserUpdateWithoutUploadedFilesInput, AdminUserUncheckedUpdateWithoutUploadedFilesInput> + } + + export type AdminUserUpdateWithoutUploadedFilesInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput + branch?: BranchUpdateOneWithoutAdminUsersNestedInput + referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + } + + export type AdminUserUncheckedUpdateWithoutUploadedFilesInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null + branchId?: NullableStringFieldUpdateOperationsInput | string | null + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + } + + export type CustomerUpsertWithWhereUniqueWithoutAvatarFileInput = { + where: CustomerWhereUniqueInput + update: XOR<CustomerUpdateWithoutAvatarFileInput, CustomerUncheckedUpdateWithoutAvatarFileInput> + create: XOR<CustomerCreateWithoutAvatarFileInput, CustomerUncheckedCreateWithoutAvatarFileInput> + } + + export type CustomerUpdateWithWhereUniqueWithoutAvatarFileInput = { + where: CustomerWhereUniqueInput + data: XOR<CustomerUpdateWithoutAvatarFileInput, CustomerUncheckedUpdateWithoutAvatarFileInput> + } + + export type CustomerUpdateManyWithWhereWithoutAvatarFileInput = { + where: CustomerScalarWhereInput + data: XOR<CustomerUpdateManyMutationInput, CustomerUncheckedUpdateManyWithoutAvatarFileInput> + } + + export type CustomerCreateManyCityInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + referredByAgentId?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string } @@ -35557,6 +60483,9 @@ export namespace Prisma { export type BranchCreateManyCityInput = { id?: string name: string + address?: string | null + phone?: string | null + isActive?: boolean } export type PreOrderCreateManyCityInput = { @@ -35583,6 +60512,13 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35590,15 +60526,22 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput orders?: OrderUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateWithoutCityInput = { @@ -35607,6 +60550,13 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35615,7 +60565,10 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput @@ -35623,6 +60576,10 @@ export namespace Prisma { preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateManyWithoutCityInput = { @@ -35631,6 +60588,13 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35639,7 +60603,10 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -35668,20 +60635,31 @@ export namespace Prisma { export type BranchUpdateWithoutCityInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean adminUsers?: AdminUserUpdateManyWithoutBranchNestedInput orders?: OrderUpdateManyWithoutBranchNestedInput + allocations?: BranchAllocationUpdateManyWithoutBranchNestedInput } export type BranchUncheckedUpdateWithoutCityInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean adminUsers?: AdminUserUncheckedUpdateManyWithoutBranchNestedInput orders?: OrderUncheckedUpdateManyWithoutBranchNestedInput + allocations?: BranchAllocationUncheckedUpdateManyWithoutBranchNestedInput } export type BranchUncheckedUpdateManyWithoutCityInput = { id?: StringFieldUpdateOperationsInput | string name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean } export type PreOrderUpdateWithoutCityInput = { @@ -35747,6 +60725,13 @@ export namespace Prisma { nationalCode: string passwordHash: string cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string goldDebtGrams?: Decimal | DecimalJsLike | number | string fiatDebtRial?: Decimal | DecimalJsLike | number | string @@ -35754,11 +60739,29 @@ export namespace Prisma { nationalIdImageUrl?: string | null businessLicenseUrl?: string | null shopImageUrl?: string | null + avatarFileId?: string | null + canPlaceOrders?: boolean isActive?: boolean + isArchived?: boolean createdAt?: Date | string updatedAt?: Date | string } + export type WorkshopCreateManySupervisorInput = { + id?: string + name: string + address?: string | null + phone?: string | null + isActive?: boolean + } + + export type BranchAllocationCreateManyAllocatorAdminUserInput = { + id?: string + branchId: string + note?: string | null + createdAt?: Date | string + } + export type LedgerEntryCreateManyPostedByAdminUserInput = { id?: string customerId: string @@ -35771,6 +60774,14 @@ export namespace Prisma { orderId?: string | null confirmed?: boolean confirmedAt?: Date | string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string } @@ -35792,12 +60803,46 @@ export namespace Prisma { createdAt?: Date | string } + export type SmsMessageCreateManySentByAdminUserInput = { + id?: string + audience: $Enums.MessageAudience + recipients?: string | null + body: string + sentCount?: number + createdAt?: Date | string + } + + export type NotificationCreateManySentByAdminUserInput = { + id?: string + title: string + body: string + audience?: $Enums.MessageAudience + createdAt?: Date | string + } + + export type UploadedFileCreateManyUploadedByAdminUserInput = { + id?: string + url: string + originalName: string + mimeType: string + sizeBytes: number + purpose?: string | null + createdAt?: Date | string + } + export type CustomerUpdateWithoutReferredByAgentInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string mobile?: StringFieldUpdateOperationsInput | string nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35805,15 +60850,22 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string city?: CityUpdateOneWithoutCustomersNestedInput + avatarFile?: UploadedFileUpdateOneWithoutCustomerAvatarsNestedInput addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput orders?: OrderUpdateManyWithoutCustomerNestedInput preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateWithoutReferredByAgentInput = { @@ -35823,6 +60875,13 @@ export namespace Prisma { nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35830,7 +60889,10 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput @@ -35838,6 +60900,10 @@ export namespace Prisma { preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateManyWithoutReferredByAgentInput = { @@ -35847,6 +60913,13 @@ export namespace Prisma { nationalCode?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -35854,11 +60927,63 @@ export namespace Prisma { nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + avatarFileId?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string } + export type WorkshopUpdateWithoutSupervisorInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + preOrders?: PreOrderUpdateManyWithoutWorkshopNestedInput + } + + export type WorkshopUncheckedUpdateWithoutSupervisorInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + preOrders?: PreOrderUncheckedUpdateManyWithoutWorkshopNestedInput + } + + export type WorkshopUncheckedUpdateManyWithoutSupervisorInput = { + id?: StringFieldUpdateOperationsInput | string + name?: StringFieldUpdateOperationsInput | string + address?: NullableStringFieldUpdateOperationsInput | string | null + phone?: NullableStringFieldUpdateOperationsInput | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + } + + export type BranchAllocationUpdateWithoutAllocatorAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + branch?: BranchUpdateOneRequiredWithoutAllocationsNestedInput + items?: BranchAllocationItemUpdateManyWithoutAllocationNestedInput + } + + export type BranchAllocationUncheckedUpdateWithoutAllocatorAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + branchId?: StringFieldUpdateOperationsInput | string + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + items?: BranchAllocationItemUncheckedUpdateManyWithoutAllocationNestedInput + } + + export type BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + branchId?: StringFieldUpdateOperationsInput | string + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + export type LedgerEntryUpdateWithoutPostedByAdminUserInput = { id?: StringFieldUpdateOperationsInput | string currency?: EnumLedgerCurrencyFieldUpdateOperationsInput | $Enums.LedgerCurrency @@ -35869,6 +60994,14 @@ export namespace Prisma { pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string customer?: CustomerUpdateOneRequiredWithoutLedgerEntriesNestedInput @@ -35887,6 +61020,14 @@ export namespace Prisma { orderId?: NullableStringFieldUpdateOperationsInput | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -35903,6 +61044,14 @@ export namespace Prisma { orderId?: NullableStringFieldUpdateOperationsInput | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -35958,6 +61107,91 @@ export namespace Prisma { createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } + export type SmsMessageUpdateWithoutSentByAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + recipients?: NullableStringFieldUpdateOperationsInput | string | null + body?: StringFieldUpdateOperationsInput | string + sentCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SmsMessageUncheckedUpdateWithoutSentByAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + recipients?: NullableStringFieldUpdateOperationsInput | string | null + body?: StringFieldUpdateOperationsInput | string + sentCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type SmsMessageUncheckedUpdateManyWithoutSentByAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + recipients?: NullableStringFieldUpdateOperationsInput | string | null + body?: StringFieldUpdateOperationsInput | string + sentCount?: IntFieldUpdateOperationsInput | number + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationUpdateWithoutSentByAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + recipients?: NotificationRecipientUpdateManyWithoutNotificationNestedInput + } + + export type NotificationUncheckedUpdateWithoutSentByAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + recipients?: NotificationRecipientUncheckedUpdateManyWithoutNotificationNestedInput + } + + export type NotificationUncheckedUpdateManyWithoutSentByAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + audience?: EnumMessageAudienceFieldUpdateOperationsInput | $Enums.MessageAudience + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type UploadedFileUpdateWithoutUploadedByAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + customerAvatars?: CustomerUpdateManyWithoutAvatarFileNestedInput + } + + export type UploadedFileUncheckedUpdateWithoutUploadedByAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + customerAvatars?: CustomerUncheckedUpdateManyWithoutAvatarFileNestedInput + } + + export type UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserInput = { + id?: StringFieldUpdateOperationsInput | string + url?: StringFieldUpdateOperationsInput | string + originalName?: StringFieldUpdateOperationsInput | string + mimeType?: StringFieldUpdateOperationsInput | string + sizeBytes?: IntFieldUpdateOperationsInput | number + purpose?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + export type CustomerAddressCreateManyCustomerInput = { id?: string cityId?: string | null @@ -35969,6 +61203,7 @@ export namespace Prisma { id?: string orderNumber: string branchId?: string | null + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -36009,6 +61244,14 @@ export namespace Prisma { confirmed?: boolean confirmedAt?: Date | string | null postedByAdminUserId?: string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string } @@ -36023,6 +61266,47 @@ export namespace Prisma { isActive?: boolean } + export type CommentCreateManyCustomerInput = { + id?: string + productId: string + body: string + status?: $Enums.CommentStatus + replyToId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type PromotionCreateManyCustomerInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + productId?: string | null + categoryId?: string | null + brandId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type NotificationRecipientCreateManyCustomerInput = { + id?: string + notificationId: string + readAt?: Date | string | null + } + + export type CustomerActivityLogCreateManyCustomerInput = { + id?: string + action: string + detail?: string | null + createdAt?: Date | string + } + export type CustomerAddressUpdateWithoutCustomerInput = { id?: StringFieldUpdateOperationsInput | string addressLine?: StringFieldUpdateOperationsInput | string @@ -36047,6 +61331,7 @@ export namespace Prisma { export type OrderUpdateWithoutCustomerInput = { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -36066,6 +61351,7 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string branchId?: NullableStringFieldUpdateOperationsInput | string | null + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -36084,6 +61370,7 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string branchId?: NullableStringFieldUpdateOperationsInput | string | null + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -36160,6 +61447,14 @@ export namespace Prisma { pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string order?: OrderUpdateOneWithoutLedgerEntriesNestedInput @@ -36178,6 +61473,14 @@ export namespace Prisma { confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -36194,6 +61497,14 @@ export namespace Prisma { confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -36228,12 +61539,138 @@ export namespace Prisma { isActive?: BoolFieldUpdateOperationsInput | boolean } + export type CommentUpdateWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + product?: ProductUpdateOneRequiredWithoutCommentsNestedInput + replyTo?: CommentUpdateOneWithoutRepliesNestedInput + replies?: CommentUpdateManyWithoutReplyToNestedInput + } + + export type CommentUncheckedUpdateWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + replyToId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + replies?: CommentUncheckedUpdateManyWithoutReplyToNestedInput + } + + export type CommentUncheckedUpdateManyWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + replyToId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionUpdateWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + product?: ProductUpdateOneWithoutPromotionsNestedInput + category?: CategoryUpdateOneWithoutPromotionsNestedInput + brand?: BrandUpdateOneWithoutPromotionsNestedInput + } + + export type PromotionUncheckedUpdateWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: NullableStringFieldUpdateOperationsInput | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionUncheckedUpdateManyWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: NullableStringFieldUpdateOperationsInput | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type NotificationRecipientUpdateWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + readAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + notification?: NotificationUpdateOneRequiredWithoutRecipientsNestedInput + } + + export type NotificationRecipientUncheckedUpdateWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + notificationId?: StringFieldUpdateOperationsInput | string + readAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type NotificationRecipientUncheckedUpdateManyWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + notificationId?: StringFieldUpdateOperationsInput | string + readAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type CustomerActivityLogUpdateWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + action?: StringFieldUpdateOperationsInput | string + detail?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CustomerActivityLogUncheckedUpdateWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + action?: StringFieldUpdateOperationsInput | string + detail?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CustomerActivityLogUncheckedUpdateManyWithoutCustomerInput = { + id?: StringFieldUpdateOperationsInput | string + action?: StringFieldUpdateOperationsInput | string + detail?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + export type AdminUserCreateManyBranchInput = { id?: string fullName: string mobile: string passwordHash: string role: $Enums.AdminRole + userTypeId?: number | null wagePercent?: Decimal | DecimalJsLike | number | string | null isActive?: boolean createdAt?: Date | string @@ -36243,6 +61680,7 @@ export namespace Prisma { id?: string orderNumber: string customerId: string + channel?: $Enums.OrderChannel status?: $Enums.OrderStatus totalGoldWeightGrams: Decimal | DecimalJsLike | number | string wageWeightGrams: Decimal | DecimalJsLike | number | string @@ -36253,6 +61691,13 @@ export namespace Prisma { updatedAt?: Date | string } + export type BranchAllocationCreateManyBranchInput = { + id?: string + allocatorAdminUserId?: string | null + note?: string | null + createdAt?: Date | string + } + export type AdminUserUpdateWithoutBranchInput = { id?: StringFieldUpdateOperationsInput | string fullName?: StringFieldUpdateOperationsInput | string @@ -36262,10 +61707,16 @@ export namespace Prisma { wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + userType?: UserTypeUpdateOneWithoutAdminUsersNestedInput referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput } export type AdminUserUncheckedUpdateWithoutBranchInput = { @@ -36274,13 +61725,19 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput } export type AdminUserUncheckedUpdateManyWithoutBranchInput = { @@ -36289,6 +61746,7 @@ export namespace Prisma { mobile?: StringFieldUpdateOperationsInput | string passwordHash?: StringFieldUpdateOperationsInput | string role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + userTypeId?: NullableIntFieldUpdateOperationsInput | number | null wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string @@ -36297,6 +61755,7 @@ export namespace Prisma { export type OrderUpdateWithoutBranchInput = { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -36316,6 +61775,7 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string customerId?: StringFieldUpdateOperationsInput | string + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -36334,6 +61794,7 @@ export namespace Prisma { id?: StringFieldUpdateOperationsInput | string orderNumber?: StringFieldUpdateOperationsInput | string customerId?: StringFieldUpdateOperationsInput | string + channel?: EnumOrderChannelFieldUpdateOperationsInput | $Enums.OrderChannel status?: EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus totalGoldWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string wageWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string @@ -36344,6 +61805,29 @@ export namespace Prisma { updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string } + export type BranchAllocationUpdateWithoutBranchInput = { + id?: StringFieldUpdateOperationsInput | string + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + allocatorAdminUser?: AdminUserUpdateOneWithoutBranchAllocationsNestedInput + items?: BranchAllocationItemUpdateManyWithoutAllocationNestedInput + } + + export type BranchAllocationUncheckedUpdateWithoutBranchInput = { + id?: StringFieldUpdateOperationsInput | string + allocatorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + items?: BranchAllocationItemUncheckedUpdateManyWithoutAllocationNestedInput + } + + export type BranchAllocationUncheckedUpdateManyWithoutBranchInput = { + id?: StringFieldUpdateOperationsInput | string + allocatorAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + note?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + export type PreOrderCreateManyWorkshopInput = { id?: string customerId: string @@ -36421,6 +61905,11 @@ export namespace Prisma { export type CategoryCreateManyParentInput = { id?: string title: string + type?: number + imageUrl?: string | null + iconUrl?: string | null + metaTag?: string | null + description?: string | null } export type ProductCreateManyCategoryInput = { @@ -36428,39 +61917,81 @@ export namespace Prisma { title: string description?: string | null brandId?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string } + export type PromotionCreateManyCategoryInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + productId?: string | null + customerId?: string | null + brandId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + export type CategoryUpdateWithoutParentInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null children?: CategoryUpdateManyWithoutParentNestedInput products?: ProductUpdateManyWithoutCategoryNestedInput + promotions?: PromotionUpdateManyWithoutCategoryNestedInput } export type CategoryUncheckedUpdateWithoutParentInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null children?: CategoryUncheckedUpdateManyWithoutParentNestedInput products?: ProductUncheckedUpdateManyWithoutCategoryNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCategoryNestedInput } export type CategoryUncheckedUpdateManyWithoutParentInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string + type?: IntFieldUpdateOperationsInput | number + imageUrl?: NullableStringFieldUpdateOperationsInput | string | null + iconUrl?: NullableStringFieldUpdateOperationsInput | string | null + metaTag?: NullableStringFieldUpdateOperationsInput | string | null + description?: NullableStringFieldUpdateOperationsInput | string | null } export type ProductUpdateWithoutCategoryInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string brand?: BrandUpdateOneWithoutProductsNestedInput variants?: ProductVariantUpdateManyWithoutProductNestedInput images?: ProductImageUpdateManyWithoutProductNestedInput collections?: CollectionProductUpdateManyWithoutProductNestedInput + comments?: CommentUpdateManyWithoutProductNestedInput + promotions?: PromotionUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateWithoutCategoryInput = { @@ -36468,11 +61999,16 @@ export namespace Prisma { title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null brandId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string variants?: ProductVariantUncheckedUpdateManyWithoutProductNestedInput images?: ProductImageUncheckedUpdateManyWithoutProductNestedInput collections?: CollectionProductUncheckedUpdateManyWithoutProductNestedInput + comments?: CommentUncheckedUpdateManyWithoutProductNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUncheckedUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateManyWithoutCategoryInput = { @@ -36480,29 +62016,110 @@ export namespace Prisma { title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null brandId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } + export type PromotionUpdateWithoutCategoryInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + product?: ProductUpdateOneWithoutPromotionsNestedInput + customer?: CustomerUpdateOneWithoutPromotionsNestedInput + brand?: BrandUpdateOneWithoutPromotionsNestedInput + } + + export type PromotionUncheckedUpdateWithoutCategoryInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: NullableStringFieldUpdateOperationsInput | string | null + customerId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionUncheckedUpdateManyWithoutCategoryInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: NullableStringFieldUpdateOperationsInput | string | null + customerId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + export type ProductCreateManyBrandInput = { id?: string title: string description?: string | null categoryId?: string | null + productCode?: string | null + showType?: number isActive?: boolean createdAt?: Date | string } + export type PromotionCreateManyBrandInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + productId?: string | null + categoryId?: string | null + customerId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + export type ProductUpdateWithoutBrandInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string category?: CategoryUpdateOneWithoutProductsNestedInput variants?: ProductVariantUpdateManyWithoutProductNestedInput images?: ProductImageUpdateManyWithoutProductNestedInput collections?: CollectionProductUpdateManyWithoutProductNestedInput + comments?: CommentUpdateManyWithoutProductNestedInput + promotions?: PromotionUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateWithoutBrandInput = { @@ -36510,11 +62127,16 @@ export namespace Prisma { title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null categoryId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string variants?: ProductVariantUncheckedUpdateManyWithoutProductNestedInput images?: ProductImageUncheckedUpdateManyWithoutProductNestedInput collections?: CollectionProductUncheckedUpdateManyWithoutProductNestedInput + comments?: CommentUncheckedUpdateManyWithoutProductNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutProductNestedInput + allocationItems?: BranchAllocationItemUncheckedUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateManyWithoutBrandInput = { @@ -36522,10 +62144,66 @@ export namespace Prisma { title?: StringFieldUpdateOperationsInput | string description?: NullableStringFieldUpdateOperationsInput | string | null categoryId?: NullableStringFieldUpdateOperationsInput | string | null + productCode?: NullableStringFieldUpdateOperationsInput | string | null + showType?: IntFieldUpdateOperationsInput | number isActive?: BoolFieldUpdateOperationsInput | boolean createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } + export type PromotionUpdateWithoutBrandInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + product?: ProductUpdateOneWithoutPromotionsNestedInput + category?: CategoryUpdateOneWithoutPromotionsNestedInput + customer?: CustomerUpdateOneWithoutPromotionsNestedInput + } + + export type PromotionUncheckedUpdateWithoutBrandInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: NullableStringFieldUpdateOperationsInput | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + customerId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionUncheckedUpdateManyWithoutBrandInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: NullableStringFieldUpdateOperationsInput | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + customerId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + export type CollectionProductCreateManyCollectionInput = { productId: string } @@ -36548,6 +62226,8 @@ export namespace Prisma { sku?: string | null rashWeightGrams: Decimal | DecimalJsLike | number | string defaultWagePercent: Decimal | DecimalJsLike | number | string + qty?: number + isPreOrder?: boolean isActive?: boolean } @@ -36561,12 +62241,48 @@ export namespace Prisma { collectionId: string } + export type CommentCreateManyProductInput = { + id?: string + customerId: string + body: string + status?: $Enums.CommentStatus + replyToId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type PromotionCreateManyProductInput = { + id?: string + title: string + description?: string | null + scope?: $Enums.PromotionScope + usage?: $Enums.PromotionUsage + discountPercent: Decimal | DecimalJsLike | number | string + isActive?: boolean + platform?: number + startsAt?: Date | string | null + endsAt?: Date | string | null + categoryId?: string | null + customerId?: string | null + brandId?: string | null + createdAt?: Date | string + updatedAt?: Date | string + } + + export type BranchAllocationItemCreateManyProductInput = { + id?: string + allocationId: string + weightGrams?: Decimal | DecimalJsLike | number | string | null + } + export type ProductVariantUpdateWithoutProductInput = { id?: StringFieldUpdateOperationsInput | string title?: StringFieldUpdateOperationsInput | string sku?: NullableStringFieldUpdateOperationsInput | string | null rashWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + qty?: IntFieldUpdateOperationsInput | number + isPreOrder?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean orderItems?: OrderItemUpdateManyWithoutProductVariantNestedInput } @@ -36577,6 +62293,8 @@ export namespace Prisma { sku?: NullableStringFieldUpdateOperationsInput | string | null rashWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + qty?: IntFieldUpdateOperationsInput | number + isPreOrder?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean orderItems?: OrderItemUncheckedUpdateManyWithoutProductVariantNestedInput } @@ -36587,6 +62305,8 @@ export namespace Prisma { sku?: NullableStringFieldUpdateOperationsInput | string | null rashWeightGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string defaultWagePercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + qty?: IntFieldUpdateOperationsInput | number + isPreOrder?: BoolFieldUpdateOperationsInput | boolean isActive?: BoolFieldUpdateOperationsInput | boolean } @@ -36620,6 +62340,110 @@ export namespace Prisma { collectionId?: StringFieldUpdateOperationsInput | string } + export type CommentUpdateWithoutProductInput = { + id?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + customer?: CustomerUpdateOneRequiredWithoutCommentsNestedInput + replyTo?: CommentUpdateOneWithoutRepliesNestedInput + replies?: CommentUpdateManyWithoutReplyToNestedInput + } + + export type CommentUncheckedUpdateWithoutProductInput = { + id?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + replyToId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + replies?: CommentUncheckedUpdateManyWithoutReplyToNestedInput + } + + export type CommentUncheckedUpdateManyWithoutProductInput = { + id?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + replyToId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionUpdateWithoutProductInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + category?: CategoryUpdateOneWithoutPromotionsNestedInput + customer?: CustomerUpdateOneWithoutPromotionsNestedInput + brand?: BrandUpdateOneWithoutPromotionsNestedInput + } + + export type PromotionUncheckedUpdateWithoutProductInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + customerId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type PromotionUncheckedUpdateManyWithoutProductInput = { + id?: StringFieldUpdateOperationsInput | string + title?: StringFieldUpdateOperationsInput | string + description?: NullableStringFieldUpdateOperationsInput | string | null + scope?: EnumPromotionScopeFieldUpdateOperationsInput | $Enums.PromotionScope + usage?: EnumPromotionUsageFieldUpdateOperationsInput | $Enums.PromotionUsage + discountPercent?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + isActive?: BoolFieldUpdateOperationsInput | boolean + platform?: IntFieldUpdateOperationsInput | number + startsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + endsAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + categoryId?: NullableStringFieldUpdateOperationsInput | string | null + customerId?: NullableStringFieldUpdateOperationsInput | string | null + brandId?: NullableStringFieldUpdateOperationsInput | string | null + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type BranchAllocationItemUpdateWithoutProductInput = { + id?: StringFieldUpdateOperationsInput | string + weightGrams?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + allocation?: BranchAllocationUpdateOneRequiredWithoutItemsNestedInput + } + + export type BranchAllocationItemUncheckedUpdateWithoutProductInput = { + id?: StringFieldUpdateOperationsInput | string + allocationId?: StringFieldUpdateOperationsInput | string + weightGrams?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + } + + export type BranchAllocationItemUncheckedUpdateManyWithoutProductInput = { + id?: StringFieldUpdateOperationsInput | string + allocationId?: StringFieldUpdateOperationsInput | string + weightGrams?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + } + export type OrderItemCreateManyProductVariantInput = { id?: string orderId: string @@ -36696,6 +62520,14 @@ export namespace Prisma { confirmed?: boolean confirmedAt?: Date | string | null postedByAdminUserId?: string | null + labName?: string | null + hallmark?: string | null + accountName?: string | null + bankName?: string | null + transferTo?: string | null + originalValue?: Decimal | DecimalJsLike | number | string | null + priceRial?: Decimal | DecimalJsLike | number | string | null + receivedAt?: Date | string | null note?: string | null createdAt?: Date | string } @@ -36770,6 +62602,14 @@ export namespace Prisma { pricePerGramRialAtEntry?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string customer?: CustomerUpdateOneRequiredWithoutLedgerEntriesNestedInput @@ -36788,6 +62628,14 @@ export namespace Prisma { confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -36804,6 +62652,14 @@ export namespace Prisma { confirmed?: BoolFieldUpdateOperationsInput | boolean confirmedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null postedByAdminUserId?: NullableStringFieldUpdateOperationsInput | string | null + labName?: NullableStringFieldUpdateOperationsInput | string | null + hallmark?: NullableStringFieldUpdateOperationsInput | string | null + accountName?: NullableStringFieldUpdateOperationsInput | string | null + bankName?: NullableStringFieldUpdateOperationsInput | string | null + transferTo?: NullableStringFieldUpdateOperationsInput | string | null + originalValue?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + priceRial?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + receivedAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null note?: NullableStringFieldUpdateOperationsInput | string | null createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } @@ -36840,6 +62696,312 @@ export namespace Prisma { createdAt?: DateTimeFieldUpdateOperationsInput | Date | string } + export type PermissionCreateManyUserTypeInput = { + rid: string + } + + export type AdminUserCreateManyUserTypeInput = { + id?: string + fullName: string + mobile: string + passwordHash: string + role: $Enums.AdminRole + branchId?: string | null + wagePercent?: Decimal | DecimalJsLike | number | string | null + isActive?: boolean + createdAt?: Date | string + } + + export type PermissionUpdateWithoutUserTypeInput = { + rid?: StringFieldUpdateOperationsInput | string + } + + export type PermissionUncheckedUpdateWithoutUserTypeInput = { + rid?: StringFieldUpdateOperationsInput | string + } + + export type PermissionUncheckedUpdateManyWithoutUserTypeInput = { + rid?: StringFieldUpdateOperationsInput | string + } + + export type AdminUserUpdateWithoutUserTypeInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + branch?: BranchUpdateOneWithoutAdminUsersNestedInput + referredCustomers?: CustomerUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUpdateManyWithoutAllocatorAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUpdateManyWithoutUploadedByAdminUserNestedInput + } + + export type AdminUserUncheckedUpdateWithoutUserTypeInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + branchId?: NullableStringFieldUpdateOperationsInput | string | null + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + referredCustomers?: CustomerUncheckedUpdateManyWithoutReferredByAgentNestedInput + supervisedWorkshops?: WorkshopUncheckedUpdateManyWithoutSupervisorNestedInput + branchAllocations?: BranchAllocationUncheckedUpdateManyWithoutAllocatorAdminUserNestedInput + postedLedgerEntries?: LedgerEntryUncheckedUpdateManyWithoutPostedByAdminUserNestedInput + orderStatusEvents?: OrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + preOrderStatusEvents?: PreOrderStatusEventUncheckedUpdateManyWithoutActorAdminUserNestedInput + sentSmsMessages?: SmsMessageUncheckedUpdateManyWithoutSentByAdminUserNestedInput + sentNotifications?: NotificationUncheckedUpdateManyWithoutSentByAdminUserNestedInput + uploadedFiles?: UploadedFileUncheckedUpdateManyWithoutUploadedByAdminUserNestedInput + } + + export type AdminUserUncheckedUpdateManyWithoutUserTypeInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + role?: EnumAdminRoleFieldUpdateOperationsInput | $Enums.AdminRole + branchId?: NullableStringFieldUpdateOperationsInput | string | null + wagePercent?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + isActive?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type CommentCreateManyReplyToInput = { + id?: string + productId: string + customerId: string + body: string + status?: $Enums.CommentStatus + createdAt?: Date | string + updatedAt?: Date | string + } + + export type CommentUpdateWithoutReplyToInput = { + id?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + product?: ProductUpdateOneRequiredWithoutCommentsNestedInput + customer?: CustomerUpdateOneRequiredWithoutCommentsNestedInput + replies?: CommentUpdateManyWithoutReplyToNestedInput + } + + export type CommentUncheckedUpdateWithoutReplyToInput = { + id?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + replies?: CommentUncheckedUpdateManyWithoutReplyToNestedInput + } + + export type CommentUncheckedUpdateManyWithoutReplyToInput = { + id?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + body?: StringFieldUpdateOperationsInput | string + status?: EnumCommentStatusFieldUpdateOperationsInput | $Enums.CommentStatus + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type BranchAllocationItemCreateManyAllocationInput = { + id?: string + productId: string + weightGrams?: Decimal | DecimalJsLike | number | string | null + } + + export type BranchAllocationItemUpdateWithoutAllocationInput = { + id?: StringFieldUpdateOperationsInput | string + weightGrams?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + product?: ProductUpdateOneRequiredWithoutAllocationItemsNestedInput + } + + export type BranchAllocationItemUncheckedUpdateWithoutAllocationInput = { + id?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + weightGrams?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + } + + export type BranchAllocationItemUncheckedUpdateManyWithoutAllocationInput = { + id?: StringFieldUpdateOperationsInput | string + productId?: StringFieldUpdateOperationsInput | string + weightGrams?: NullableDecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string | null + } + + export type NotificationRecipientCreateManyNotificationInput = { + id?: string + customerId: string + readAt?: Date | string | null + } + + export type NotificationRecipientUpdateWithoutNotificationInput = { + id?: StringFieldUpdateOperationsInput | string + readAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + customer?: CustomerUpdateOneRequiredWithoutNotificationsNestedInput + } + + export type NotificationRecipientUncheckedUpdateWithoutNotificationInput = { + id?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + readAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type NotificationRecipientUncheckedUpdateManyWithoutNotificationInput = { + id?: StringFieldUpdateOperationsInput | string + customerId?: StringFieldUpdateOperationsInput | string + readAt?: NullableDateTimeFieldUpdateOperationsInput | Date | string | null + } + + export type CustomerCreateManyAvatarFileInput = { + id?: string + fullName: string + mobile: string + nationalCode: string + passwordHash: string + cityId?: string | null + kind?: $Enums.CustomerKind + phone?: string | null + address?: string | null + storeName?: string | null + pasazhName?: string | null + zone?: string | null + memberCode?: string | null + referredByAgentId?: string | null + goldCreditLimitGrams?: Decimal | DecimalJsLike | number | string + goldDebtGrams?: Decimal | DecimalJsLike | number | string + fiatDebtRial?: Decimal | DecimalJsLike | number | string + verificationStep?: $Enums.VerificationStep + nationalIdImageUrl?: string | null + businessLicenseUrl?: string | null + shopImageUrl?: string | null + canPlaceOrders?: boolean + isActive?: boolean + isArchived?: boolean + createdAt?: Date | string + updatedAt?: Date | string + } + + export type CustomerUpdateWithoutAvatarFileInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + city?: CityUpdateOneWithoutCustomersNestedInput + referredByAgent?: AdminUserUpdateOneWithoutReferredCustomersNestedInput + addresses?: CustomerAddressUpdateManyWithoutCustomerNestedInput + orders?: OrderUpdateManyWithoutCustomerNestedInput + preOrders?: PreOrderUpdateManyWithoutCustomerNestedInput + ledgerEntries?: LedgerEntryUpdateManyWithoutCustomerNestedInput + walletBonuses?: WalletBonusUpdateManyWithoutCustomerNestedInput + comments?: CommentUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUpdateManyWithoutCustomerNestedInput + } + + export type CustomerUncheckedUpdateWithoutAvatarFileInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + addresses?: CustomerAddressUncheckedUpdateManyWithoutCustomerNestedInput + orders?: OrderUncheckedUpdateManyWithoutCustomerNestedInput + preOrders?: PreOrderUncheckedUpdateManyWithoutCustomerNestedInput + ledgerEntries?: LedgerEntryUncheckedUpdateManyWithoutCustomerNestedInput + walletBonuses?: WalletBonusUncheckedUpdateManyWithoutCustomerNestedInput + comments?: CommentUncheckedUpdateManyWithoutCustomerNestedInput + promotions?: PromotionUncheckedUpdateManyWithoutCustomerNestedInput + notifications?: NotificationRecipientUncheckedUpdateManyWithoutCustomerNestedInput + activityLogs?: CustomerActivityLogUncheckedUpdateManyWithoutCustomerNestedInput + } + + export type CustomerUncheckedUpdateManyWithoutAvatarFileInput = { + id?: StringFieldUpdateOperationsInput | string + fullName?: StringFieldUpdateOperationsInput | string + mobile?: StringFieldUpdateOperationsInput | string + nationalCode?: StringFieldUpdateOperationsInput | string + passwordHash?: StringFieldUpdateOperationsInput | string + cityId?: NullableStringFieldUpdateOperationsInput | string | null + kind?: EnumCustomerKindFieldUpdateOperationsInput | $Enums.CustomerKind + phone?: NullableStringFieldUpdateOperationsInput | string | null + address?: NullableStringFieldUpdateOperationsInput | string | null + storeName?: NullableStringFieldUpdateOperationsInput | string | null + pasazhName?: NullableStringFieldUpdateOperationsInput | string | null + zone?: NullableStringFieldUpdateOperationsInput | string | null + memberCode?: NullableStringFieldUpdateOperationsInput | string | null + referredByAgentId?: NullableStringFieldUpdateOperationsInput | string | null + goldCreditLimitGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + goldDebtGrams?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + fiatDebtRial?: DecimalFieldUpdateOperationsInput | Decimal | DecimalJsLike | number | string + verificationStep?: EnumVerificationStepFieldUpdateOperationsInput | $Enums.VerificationStep + nationalIdImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + businessLicenseUrl?: NullableStringFieldUpdateOperationsInput | string | null + shopImageUrl?: NullableStringFieldUpdateOperationsInput | string | null + canPlaceOrders?: BoolFieldUpdateOperationsInput | boolean + isActive?: BoolFieldUpdateOperationsInput | boolean + isArchived?: BoolFieldUpdateOperationsInput | boolean + createdAt?: DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: DateTimeFieldUpdateOperationsInput | Date | string + } + /** @@ -36893,6 +63055,26 @@ export namespace Prisma { * @deprecated Use PreOrderCountOutputTypeDefaultArgs instead */ export type PreOrderCountOutputTypeArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = PreOrderCountOutputTypeDefaultArgs<ExtArgs> + /** + * @deprecated Use UserTypeCountOutputTypeDefaultArgs instead + */ + export type UserTypeCountOutputTypeArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = UserTypeCountOutputTypeDefaultArgs<ExtArgs> + /** + * @deprecated Use CommentCountOutputTypeDefaultArgs instead + */ + export type CommentCountOutputTypeArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = CommentCountOutputTypeDefaultArgs<ExtArgs> + /** + * @deprecated Use BranchAllocationCountOutputTypeDefaultArgs instead + */ + export type BranchAllocationCountOutputTypeArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = BranchAllocationCountOutputTypeDefaultArgs<ExtArgs> + /** + * @deprecated Use NotificationCountOutputTypeDefaultArgs instead + */ + export type NotificationCountOutputTypeArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = NotificationCountOutputTypeDefaultArgs<ExtArgs> + /** + * @deprecated Use UploadedFileCountOutputTypeDefaultArgs instead + */ + export type UploadedFileCountOutputTypeArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = UploadedFileCountOutputTypeDefaultArgs<ExtArgs> /** * @deprecated Use CityDefaultArgs instead */ @@ -36977,6 +63159,62 @@ export namespace Prisma { * @deprecated Use WalletBonusDefaultArgs instead */ export type WalletBonusArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = WalletBonusDefaultArgs<ExtArgs> + /** + * @deprecated Use UserTypeDefaultArgs instead + */ + export type UserTypeArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = UserTypeDefaultArgs<ExtArgs> + /** + * @deprecated Use PermissionDefaultArgs instead + */ + export type PermissionArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = PermissionDefaultArgs<ExtArgs> + /** + * @deprecated Use CommentDefaultArgs instead + */ + export type CommentArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = CommentDefaultArgs<ExtArgs> + /** + * @deprecated Use SettingDefaultArgs instead + */ + export type SettingArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = SettingDefaultArgs<ExtArgs> + /** + * @deprecated Use PromotionDefaultArgs instead + */ + export type PromotionArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = PromotionDefaultArgs<ExtArgs> + /** + * @deprecated Use PromotionExclusionDefaultArgs instead + */ + export type PromotionExclusionArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = PromotionExclusionDefaultArgs<ExtArgs> + /** + * @deprecated Use BranchAllocationDefaultArgs instead + */ + export type BranchAllocationArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = BranchAllocationDefaultArgs<ExtArgs> + /** + * @deprecated Use BranchAllocationItemDefaultArgs instead + */ + export type BranchAllocationItemArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = BranchAllocationItemDefaultArgs<ExtArgs> + /** + * @deprecated Use SmsMessageDefaultArgs instead + */ + export type SmsMessageArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = SmsMessageDefaultArgs<ExtArgs> + /** + * @deprecated Use NotificationDefaultArgs instead + */ + export type NotificationArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = NotificationDefaultArgs<ExtArgs> + /** + * @deprecated Use NotificationRecipientDefaultArgs instead + */ + export type NotificationRecipientArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = NotificationRecipientDefaultArgs<ExtArgs> + /** + * @deprecated Use NewsletterSubscriberDefaultArgs instead + */ + export type NewsletterSubscriberArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = NewsletterSubscriberDefaultArgs<ExtArgs> + /** + * @deprecated Use CustomerActivityLogDefaultArgs instead + */ + export type CustomerActivityLogArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = CustomerActivityLogDefaultArgs<ExtArgs> + /** + * @deprecated Use UploadedFileDefaultArgs instead + */ + export type UploadedFileArgs<ExtArgs extends $Extensions.InternalArgs = $Extensions.DefaultArgs> = UploadedFileDefaultArgs<ExtArgs> /** * Batch Payload for updateMany & deleteMany & createMany diff --git a/apps/api/release/vendor/.prisma/client/index.js b/apps/api/release/vendor/.prisma/client/index.js index 0e46ef4..c1b8da4 100644 --- a/apps/api/release/vendor/.prisma/client/index.js +++ b/apps/api/release/vendor/.prisma/client/index.js @@ -94,7 +94,9 @@ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ exports.Prisma.CityScalarFieldEnum = { id: 'id', name: 'name', - province: 'province' + province: 'province', + percent: 'percent', + percentAux: 'percentAux' }; exports.Prisma.AdminUserScalarFieldEnum = { @@ -103,6 +105,7 @@ exports.Prisma.AdminUserScalarFieldEnum = { mobile: 'mobile', passwordHash: 'passwordHash', role: 'role', + userTypeId: 'userTypeId', branchId: 'branchId', wagePercent: 'wagePercent', isActive: 'isActive', @@ -116,6 +119,13 @@ exports.Prisma.CustomerScalarFieldEnum = { nationalCode: 'nationalCode', passwordHash: 'passwordHash', cityId: 'cityId', + kind: 'kind', + phone: 'phone', + address: 'address', + storeName: 'storeName', + pasazhName: 'pasazhName', + zone: 'zone', + memberCode: 'memberCode', referredByAgentId: 'referredByAgentId', goldCreditLimitGrams: 'goldCreditLimitGrams', goldDebtGrams: 'goldDebtGrams', @@ -124,7 +134,10 @@ exports.Prisma.CustomerScalarFieldEnum = { nationalIdImageUrl: 'nationalIdImageUrl', businessLicenseUrl: 'businessLicenseUrl', shopImageUrl: 'shopImageUrl', + avatarFileId: 'avatarFileId', + canPlaceOrders: 'canPlaceOrders', isActive: 'isActive', + isArchived: 'isArchived', createdAt: 'createdAt', updatedAt: 'updatedAt' }; @@ -140,18 +153,29 @@ exports.Prisma.CustomerAddressScalarFieldEnum = { exports.Prisma.BranchScalarFieldEnum = { id: 'id', name: 'name', + address: 'address', + phone: 'phone', + isActive: 'isActive', cityId: 'cityId' }; exports.Prisma.WorkshopScalarFieldEnum = { id: 'id', name: 'name', + address: 'address', + phone: 'phone', + supervisorId: 'supervisorId', isActive: 'isActive' }; exports.Prisma.CategoryScalarFieldEnum = { id: 'id', title: 'title', + type: 'type', + imageUrl: 'imageUrl', + iconUrl: 'iconUrl', + metaTag: 'metaTag', + description: 'description', parentId: 'parentId' }; @@ -178,6 +202,8 @@ exports.Prisma.ProductScalarFieldEnum = { description: 'description', categoryId: 'categoryId', brandId: 'brandId', + productCode: 'productCode', + showType: 'showType', isActive: 'isActive', createdAt: 'createdAt' }; @@ -196,6 +222,8 @@ exports.Prisma.ProductVariantScalarFieldEnum = { sku: 'sku', rashWeightGrams: 'rashWeightGrams', defaultWagePercent: 'defaultWagePercent', + qty: 'qty', + isPreOrder: 'isPreOrder', isActive: 'isActive' }; @@ -204,6 +232,7 @@ exports.Prisma.OrderScalarFieldEnum = { orderNumber: 'orderNumber', customerId: 'customerId', branchId: 'branchId', + channel: 'channel', status: 'status', totalGoldWeightGrams: 'totalGoldWeightGrams', wageWeightGrams: 'wageWeightGrams', @@ -277,6 +306,14 @@ exports.Prisma.LedgerEntryScalarFieldEnum = { confirmed: 'confirmed', confirmedAt: 'confirmedAt', postedByAdminUserId: 'postedByAdminUserId', + labName: 'labName', + hallmark: 'hallmark', + accountName: 'accountName', + bankName: 'bankName', + transferTo: 'transferTo', + originalValue: 'originalValue', + priceRial: 'priceRial', + receivedAt: 'receivedAt', note: 'note', createdAt: 'createdAt' }; @@ -300,6 +337,128 @@ exports.Prisma.WalletBonusScalarFieldEnum = { isActive: 'isActive' }; +exports.Prisma.UserTypeScalarFieldEnum = { + id: 'id', + title: 'title', + isActive: 'isActive', + createdAt: 'createdAt' +}; + +exports.Prisma.PermissionScalarFieldEnum = { + rid: 'rid', + userTypeId: 'userTypeId' +}; + +exports.Prisma.CommentScalarFieldEnum = { + id: 'id', + productId: 'productId', + customerId: 'customerId', + body: 'body', + status: 'status', + replyToId: 'replyToId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.SettingScalarFieldEnum = { + key: 'key', + value: 'value', + updatedAt: 'updatedAt' +}; + +exports.Prisma.PromotionScalarFieldEnum = { + id: 'id', + title: 'title', + description: 'description', + scope: 'scope', + usage: 'usage', + discountPercent: 'discountPercent', + isActive: 'isActive', + platform: 'platform', + startsAt: 'startsAt', + endsAt: 'endsAt', + productId: 'productId', + categoryId: 'categoryId', + customerId: 'customerId', + brandId: 'brandId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.PromotionExclusionScalarFieldEnum = { + id: 'id', + type: 'type', + itemId: 'itemId', + createdAt: 'createdAt' +}; + +exports.Prisma.BranchAllocationScalarFieldEnum = { + id: 'id', + branchId: 'branchId', + allocatorAdminUserId: 'allocatorAdminUserId', + note: 'note', + createdAt: 'createdAt' +}; + +exports.Prisma.BranchAllocationItemScalarFieldEnum = { + id: 'id', + allocationId: 'allocationId', + productId: 'productId', + weightGrams: 'weightGrams' +}; + +exports.Prisma.SmsMessageScalarFieldEnum = { + id: 'id', + audience: 'audience', + recipients: 'recipients', + body: 'body', + sentCount: 'sentCount', + sentByAdminUserId: 'sentByAdminUserId', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationScalarFieldEnum = { + id: 'id', + title: 'title', + body: 'body', + audience: 'audience', + sentByAdminUserId: 'sentByAdminUserId', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationRecipientScalarFieldEnum = { + id: 'id', + notificationId: 'notificationId', + customerId: 'customerId', + readAt: 'readAt' +}; + +exports.Prisma.NewsletterSubscriberScalarFieldEnum = { + id: 'id', + email: 'email', + mobile: 'mobile', + createdAt: 'createdAt' +}; + +exports.Prisma.CustomerActivityLogScalarFieldEnum = { + id: 'id', + customerId: 'customerId', + action: 'action', + detail: 'detail', + createdAt: 'createdAt' +}; + +exports.Prisma.UploadedFileScalarFieldEnum = { + id: 'id', + url: 'url', + originalName: 'originalName', + mimeType: 'mimeType', + sizeBytes: 'sizeBytes', + purpose: 'purpose', + uploadedByAdminUserId: 'uploadedByAdminUserId', + createdAt: 'createdAt' +}; + exports.Prisma.SortOrder = { asc: 'asc', desc: 'desc' @@ -332,6 +491,14 @@ exports.AdminRole = exports.$Enums.AdminRole = { ACCOUNTANT: 'ACCOUNTANT' }; +exports.CustomerKind = exports.$Enums.CustomerKind = { + SALES_AGENT: 'SALES_AGENT', + APP_SHOPKEEPER: 'APP_SHOPKEEPER', + WALK_IN_SHOPKEEPER: 'WALK_IN_SHOPKEEPER', + BANKER: 'BANKER', + WORKSHOP_SUPERVISOR: 'WORKSHOP_SUPERVISOR' +}; + exports.VerificationStep = exports.$Enums.VerificationStep = { UNVERIFIED: 'UNVERIFIED', STEP_ONE_SUBMITTED: 'STEP_ONE_SUBMITTED', @@ -339,6 +506,11 @@ exports.VerificationStep = exports.$Enums.VerificationStep = { VERIFIED: 'VERIFIED' }; +exports.OrderChannel = exports.$Enums.OrderChannel = { + RETAIL: 'RETAIL', + WHOLESALE: 'WHOLESALE' +}; + exports.OrderStatus = exports.$Enums.OrderStatus = { SUSPENDED: 'SUSPENDED', PLACED: 'PLACED', @@ -380,6 +552,33 @@ exports.LedgerSourceType = exports.$Enums.LedgerSourceType = { ADJUSTMENT: 'ADJUSTMENT' }; +exports.CommentStatus = exports.$Enums.CommentStatus = { + PENDING: 'PENDING', + APPROVED: 'APPROVED', + REJECTED: 'REJECTED' +}; + +exports.PromotionScope = exports.$Enums.PromotionScope = { + PRODUCT: 'PRODUCT', + CATEGORY: 'CATEGORY', + CUSTOMER: 'CUSTOMER', + BRAND: 'BRAND' +}; + +exports.PromotionUsage = exports.$Enums.PromotionUsage = { + ONCE: 'ONCE', + UNTIL_END_DATE: 'UNTIL_END_DATE' +}; + +exports.MessageAudience = exports.$Enums.MessageAudience = { + SINGLE_NUMBER: 'SINGLE_NUMBER', + MULTIPLE_NUMBERS: 'MULTIPLE_NUMBERS', + ALL_CUSTOMERS: 'ALL_CUSTOMERS', + WHOLESALE_CUSTOMERS: 'WHOLESALE_CUSTOMERS', + RETAIL_CUSTOMERS: 'RETAIL_CUSTOMERS', + SALES_AGENTS: 'SALES_AGENTS' +}; + exports.Prisma.ModelName = { City: 'City', AdminUser: 'AdminUser', @@ -401,7 +600,21 @@ exports.Prisma.ModelName = { PreOrderStatusEvent: 'PreOrderStatusEvent', LedgerEntry: 'LedgerEntry', GoldPriceQuote: 'GoldPriceQuote', - WalletBonus: 'WalletBonus' + WalletBonus: 'WalletBonus', + UserType: 'UserType', + Permission: 'Permission', + Comment: 'Comment', + Setting: 'Setting', + Promotion: 'Promotion', + PromotionExclusion: 'PromotionExclusion', + BranchAllocation: 'BranchAllocation', + BranchAllocationItem: 'BranchAllocationItem', + SmsMessage: 'SmsMessage', + Notification: 'Notification', + NotificationRecipient: 'NotificationRecipient', + NewsletterSubscriber: 'NewsletterSubscriber', + CustomerActivityLog: 'CustomerActivityLog', + UploadedFile: 'UploadedFile' }; /** * Create the Client @@ -414,7 +627,7 @@ const config = { "value": "prisma-client-js" }, "output": { - "value": "C:\\App\\gold-bank\\node_modules\\.pnpm\\@prisma+client@5.22.0_prisma@5.22.0\\node_modules\\@prisma\\client", + "value": "E:\\gold bank\\gold-banking-monorepo\\node_modules\\.pnpm\\@prisma+client@5.22.0_prisma@5.22.0\\node_modules\\@prisma\\client", "fromEnvVar": null }, "config": { @@ -432,7 +645,7 @@ const config = { } ], "previewFeatures": [], - "sourceFilePath": "C:\\App\\gold-bank\\apps\\api\\prisma\\schema.prisma" + "sourceFilePath": "E:\\gold bank\\gold-banking-monorepo\\apps\\api\\prisma\\schema.prisma" }, "relativeEnvPaths": { "rootEnvPath": null, @@ -454,8 +667,8 @@ const config = { } } }, - "inlineSchema": "// Gold Banking System — core schema\n// Canonical accounting model: legacy \"System A\" gram ledger (see migration notes).\n// The external \"Tahesab\" service is retired — LedgerEntry is the sole source of truth.\n// All money/weight fields use Decimal, never Float, to avoid rounding drift in debt math.\n\ngenerator client {\n provider = \"prisma-client-js\"\n // native = local Windows/macOS; debian-openssl-3.0.x = node:20-bookworm-slim (Arvan)\n binaryTargets = [\"native\", \"debian-openssl-3.0.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Enums\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AdminRole {\n SUPER_ADMIN\n SYSTEM_APPROVER // legacy: تایید مدیر سیستم\n SALES_EXPERT // legacy Customer.type=1, also acts as a referral \"reagent\"\n WORKSHOP_SUPERVISOR\n ACCOUNTANT\n}\n\nenum VerificationStep {\n UNVERIFIED\n STEP_ONE_SUBMITTED\n STEP_TWO_SUBMITTED\n VERIFIED\n}\n\nenum OrderStatus {\n SUSPENDED // credit limit (goldCreditLimitGrams) exceeded at placement\n PLACED\n ADMIN_APPROVED\n SOURCING\n PREPARING\n DELIVERED_TO_AGENT\n DELIVERED_TO_CUSTOMER // debt recognition point — mirrors legacy sts>4\n CANCELLED\n}\n\nenum PreOrderStatus {\n PLACED\n ADMIN_APPROVED\n WORKSHOP_APPROVED\n READY_TO_SHIP\n DELIVERED\n CANCELLED\n}\n\nenum LedgerCurrency {\n GOLD_GRAM\n RIAL\n}\n\nenum LedgerDirection {\n DEBIT // increases what the customer owes\n CREDIT // decreases what the customer owes\n}\n\nenum LedgerSourceType {\n ORDER_STOCK\n ORDER_PRE_ORDER\n REPAYMENT_MELTED_GOLD // karat-normalized: amount * karatPerMille / 750\n REPAYMENT_TRANSFER\n REPAYMENT_CHEQUE\n REPAYMENT_CASH // price-per-gram-normalized via pricePerGramRialAtEntry\n WALLET_BONUS\n ADJUSTMENT\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Identity\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel City {\n id String @id @default(cuid())\n name String\n province String?\n customers Customer[]\n addresses CustomerAddress[]\n branches Branch[]\n preOrders PreOrder[]\n}\n\nmodel AdminUser {\n id String @id @default(cuid())\n fullName String\n mobile String @unique\n passwordHash String\n role AdminRole\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n wagePercent Decimal? @db.Decimal(6, 3) // legacy Customer.percent, commission on referred orders\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n referredCustomers Customer[] @relation(\"ReferralAgent\")\n postedLedgerEntries LedgerEntry[]\n orderStatusEvents OrderStatusEvent[]\n preOrderStatusEvents PreOrderStatusEvent[]\n\n @@index([role])\n}\n\nmodel Customer {\n id String @id @default(cuid())\n fullName String\n mobile String @unique\n nationalCode String @unique\n passwordHash String\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n referredByAgentId String?\n referredByAgent AdminUser? @relation(\"ReferralAgent\", fields: [referredByAgentId], references: [id])\n\n // Credit limit + cached ledger balances (source of truth is LedgerEntry; these\n // are denormalized for fast reads and reconciled by a scheduled job).\n goldCreditLimitGrams Decimal @default(0) @db.Decimal(14, 4) // legacy gram_level\n goldDebtGrams Decimal @default(0) @db.Decimal(14, 4) // legacy remain\n fiatDebtRial Decimal @default(0) @db.Decimal(20, 2) // legacy rial_remain\n\n verificationStep VerificationStep @default(UNVERIFIED)\n nationalIdImageUrl String?\n businessLicenseUrl String?\n shopImageUrl String?\n\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n addresses CustomerAddress[]\n orders Order[]\n preOrders PreOrder[]\n ledgerEntries LedgerEntry[]\n walletBonuses WalletBonus[]\n\n @@index([referredByAgentId])\n}\n\nmodel CustomerAddress {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n addressLine String\n isDefault Boolean @default(false)\n}\n\nmodel Branch {\n id String @id @default(cuid())\n name String\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n adminUsers AdminUser[]\n orders Order[]\n}\n\nmodel Workshop {\n id String @id @default(cuid())\n name String\n isActive Boolean @default(true)\n preOrders PreOrder[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Catalog — item reference catalog\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Category {\n id String @id @default(cuid())\n title String\n parentId String?\n parent Category? @relation(\"CategoryTree\", fields: [parentId], references: [id])\n children Category[] @relation(\"CategoryTree\")\n products Product[]\n}\n\nmodel Brand {\n id String @id @default(cuid())\n title String\n products Product[]\n}\n\n/// Curated product groupings — replaces legacy \"Ciny/CinyProduct\" (a tagging\n/// feature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\nmodel Collection {\n id String @id @default(cuid())\n title String\n description String?\n isActive Boolean @default(true)\n products CollectionProduct[]\n}\n\nmodel CollectionProduct {\n collectionId String\n collection Collection @relation(fields: [collectionId], references: [id])\n productId String\n product Product @relation(fields: [productId], references: [id])\n\n @@id([collectionId, productId])\n}\n\nmodel Product {\n id String @id @default(cuid())\n title String\n description String?\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n variants ProductVariant[]\n images ProductImage[]\n collections CollectionProduct[]\n}\n\nmodel ProductImage {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n url String\n sortOrder Int @default(0)\n}\n\nmodel ProductVariant {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n title String\n sku String? @unique\n /// Base/raw weight before making charge (\"rash weight\").\n rashWeightGrams Decimal @db.Decimal(14, 4)\n /// Default making-charge percentage applied on top of rash weight.\n defaultWagePercent Decimal @db.Decimal(6, 3)\n isActive Boolean @default(true)\n\n orderItems OrderItem[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Orders — stock orders (debt-bearing)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Order {\n id String @id @default(cuid())\n orderNumber String @unique\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n status OrderStatus @default(PLACED)\n\n /// Total gold weight incl. wage across all items (\"allGram\" / order.w).\n totalGoldWeightGrams Decimal @db.Decimal(14, 4)\n /// Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\n wageWeightGrams Decimal @db.Decimal(14, 4)\n /// Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n\n isSuspendedOverCreditLimit Boolean @default(false)\n deliveredAt DateTime? // setting this is what triggers debt recognition\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n items OrderItem[]\n statusEvents OrderStatusEvent[]\n ledgerEntries LedgerEntry[]\n convertedFromPreOrder PreOrder?\n\n @@index([customerId])\n @@index([status])\n}\n\nmodel OrderItem {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n productVariantId String\n productVariant ProductVariant @relation(fields: [productVariantId], references: [id])\n quantity Int\n\n // Snapshots at order time — never re-read from ProductVariant after placement.\n rashWeightGramsSnapshot Decimal @db.Decimal(14, 4)\n wagePercentSnapshot Decimal @db.Decimal(6, 3)\n discountPercentSnapshot Decimal @default(0) @db.Decimal(6, 3)\n /// computed: rash*(1 + (wagePercent-discount)/100)\n computedWeightGrams Decimal @db.Decimal(14, 4)\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n}\n\nmodel OrderStatusEvent {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n fromStatus OrderStatus?\n toStatus OrderStatus\n note String?\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n createdAt DateTime @default(now())\n\n @@index([orderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Pre-orders — custom manufacturing requests (not debt-bearing until converted)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel PreOrder {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n workshopId String?\n workshop Workshop? @relation(fields: [workshopId], references: [id])\n status PreOrderStatus @default(PLACED)\n\n designImageUrl String?\n colorName String?\n sizeSpec String?\n stoneColor String?\n minaColor String?\n estimatedWeightGrams Decimal? @db.Decimal(14, 4)\n estimatedPriceRial Decimal? @db.Decimal(20, 2)\n description String?\n\n /// Once priced, an admin converts this into a real (debt-bearing) Order.\n convertedOrderId String? @unique\n convertedOrder Order? @relation(fields: [convertedOrderId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n statusEvents PreOrderStatusEvent[]\n\n @@index([customerId])\n}\n\nmodel PreOrderStatusEvent {\n id String @id @default(cuid())\n preOrderId String\n preOrder PreOrder @relation(fields: [preOrderId], references: [id])\n /// Field-level diff, e.g. {\"status\": {\"old\": \"PLACED\", \"new\": \"ADMIN_APPROVED\"}}\n changes Json\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n ipAddress String?\n createdAt DateTime @default(now())\n\n @@index([preOrderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting — the dual-currency ledger (core of the system)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel LedgerEntry {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n\n currency LedgerCurrency\n direction LedgerDirection\n sourceType LedgerSourceType\n /// Always positive; direction determines the sign applied to the customer balance.\n amount Decimal @db.Decimal(20, 4)\n\n /// Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\n karatPerMille Int?\n /// Gold price/gram at conversion time, for REPAYMENT_CASH.\n pricePerGramRialAtEntry Decimal? @db.Decimal(20, 2)\n\n orderId String?\n order Order? @relation(fields: [orderId], references: [id])\n\n /// Pending entries don't count toward the cached customer balance until confirmed.\n confirmed Boolean @default(false)\n confirmedAt DateTime?\n postedByAdminUserId String?\n postedByAdminUser AdminUser? @relation(fields: [postedByAdminUserId], references: [id])\n\n note String?\n createdAt DateTime @default(now())\n\n @@index([customerId, currency])\n @@index([orderId])\n}\n\n/// Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\nmodel GoldPriceQuote {\n id String @id @default(cuid())\n karatPerMille Int\n pricePerGramRial Decimal @db.Decimal(20, 2)\n source String\n quotedAt DateTime @default(now())\n\n @@index([karatPerMille, quotedAt])\n}\n\n/// Time-limited gold cashback bonus — replaces the legacy Rooyesh\\Wallet gold credit.\nmodel WalletBonus {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n orderId String?\n goldGrams Decimal @db.Decimal(14, 4)\n grantedAt DateTime @default(now())\n expiresAt DateTime\n consumedAt DateTime?\n isActive Boolean @default(true)\n\n @@index([customerId, isActive])\n}\n", - "inlineSchemaHash": "c0944da476bdb47884e1c9d2aeeb374e6077907fd89970148d89eff210dfe8ab", + "inlineSchema": "// Gold Banking System — core schema\n// Canonical accounting model: legacy \"System A\" gram ledger (see migration notes).\n// The external \"Tahesab\" service is retired — LedgerEntry is the sole source of truth.\n// All money/weight fields use Decimal, never Float, to avoid rounding drift in debt math.\n\ngenerator client {\n provider = \"prisma-client-js\"\n // native = local Windows/macOS; debian-openssl-3.0.x = node:20-bookworm-slim (Arvan)\n binaryTargets = [\"native\", \"debian-openssl-3.0.x\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Enums\n// ─────────────────────────────────────────────────────────────────────────\n\nenum AdminRole {\n SUPER_ADMIN\n SYSTEM_APPROVER // legacy: تایید مدیر سیستم\n SALES_EXPERT // legacy Customer.type=1, also acts as a referral \"reagent\"\n WORKSHOP_SUPERVISOR\n ACCOUNTANT\n}\n\n/// Legacy Customer.type — what kind of wholesale customer this is. Values and\n/// labels taken verbatim from bulkCustomer.vue's userTypes list.\nenum CustomerKind {\n SALES_AGENT // 1 کارشناس فروش\n APP_SHOPKEEPER // 2 مغازه دار اپلیکیشن\n WALK_IN_SHOPKEEPER // 3 مغازه دار حضوری\n BANKER // 4 بنکدار\n WORKSHOP_SUPERVISOR // 5 سرپرست کارگاه\n}\n\nenum VerificationStep {\n UNVERIFIED\n STEP_ONE_SUBMITTED\n STEP_TWO_SUBMITTED\n VERIFIED\n}\n\n/// Legacy kept retail and wholesale orders in two SEPARATE tables\n/// (orders_orders vs orders). The redesigned schema has one Order model, so the\n/// distinction lives here instead.\nenum OrderChannel {\n RETAIL // تک فروشی\n WHOLESALE // عمده فروشی\n}\n\nenum OrderStatus {\n SUSPENDED // credit limit (goldCreditLimitGrams) exceeded at placement\n PLACED\n ADMIN_APPROVED\n SOURCING\n PREPARING\n DELIVERED_TO_AGENT\n DELIVERED_TO_CUSTOMER // debt recognition point — mirrors legacy sts>4\n CANCELLED\n}\n\nenum PreOrderStatus {\n PLACED\n ADMIN_APPROVED\n WORKSHOP_APPROVED\n READY_TO_SHIP\n DELIVERED\n CANCELLED\n}\n\nenum LedgerCurrency {\n GOLD_GRAM\n RIAL\n}\n\nenum LedgerDirection {\n DEBIT // increases what the customer owes\n CREDIT // decreases what the customer owes\n}\n\nenum LedgerSourceType {\n ORDER_STOCK\n ORDER_PRE_ORDER\n REPAYMENT_MELTED_GOLD // karat-normalized: amount * karatPerMille / 750\n REPAYMENT_TRANSFER\n REPAYMENT_CHEQUE\n REPAYMENT_CASH // price-per-gram-normalized via pricePerGramRialAtEntry\n WALLET_BONUS\n ADJUSTMENT\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Identity\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel City {\n id String @id @default(cuid())\n name String\n province String?\n /// Legacy cities.percent / percent_aux — per-city wage surcharges the city\n /// screen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\n percent Decimal? @db.Decimal(6, 3)\n percentAux Decimal? @db.Decimal(6, 3)\n customers Customer[]\n addresses CustomerAddress[]\n branches Branch[]\n preOrders PreOrder[]\n}\n\nmodel AdminUser {\n id String @id @default(cuid())\n fullName String\n mobile String @unique\n passwordHash String\n role AdminRole\n /// Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\n /// the coarse `role` enum above is retained for the business rules that already\n /// switch on it. Nullable so existing seeded admins remain valid.\n userTypeId Int?\n userType UserType? @relation(fields: [userTypeId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n wagePercent Decimal? @db.Decimal(6, 3) // legacy Customer.percent, commission on referred orders\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n referredCustomers Customer[] @relation(\"ReferralAgent\")\n supervisedWorkshops Workshop[] @relation(\"WorkshopSupervisor\")\n branchAllocations BranchAllocation[] @relation(\"AllocationAuthor\")\n postedLedgerEntries LedgerEntry[]\n orderStatusEvents OrderStatusEvent[]\n preOrderStatusEvents PreOrderStatusEvent[]\n sentSmsMessages SmsMessage[] @relation(\"SmsAuthor\")\n sentNotifications Notification[] @relation(\"NotificationAuthor\")\n uploadedFiles UploadedFile[] @relation(\"FileUploader\")\n\n @@index([role])\n @@index([userTypeId])\n}\n\nmodel Customer {\n id String @id @default(cuid())\n fullName String\n mobile String @unique\n nationalCode String @unique\n passwordHash String\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n\n /// Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\n /// BankerList / ShopkeeperList screens filter on.\n kind CustomerKind @default(APP_SHOPKEEPER)\n\n /// Legacy contact + shop columns, shown on the wholesale customer form and as\n /// (hidden-by-default) columns in its grid.\n phone String?\n address String?\n storeName String?\n pasazhName String?\n zone String?\n /// Legacy mcode — the operator-assigned customer code.\n memberCode String?\n\n referredByAgentId String?\n referredByAgent AdminUser? @relation(\"ReferralAgent\", fields: [referredByAgentId], references: [id])\n\n // Credit limit + cached ledger balances (source of truth is LedgerEntry; these\n // are denormalized for fast reads and reconciled by a scheduled job).\n goldCreditLimitGrams Decimal @default(0) @db.Decimal(14, 4) // legacy gram_level\n goldDebtGrams Decimal @default(0) @db.Decimal(14, 4) // legacy remain\n fiatDebtRial Decimal @default(0) @db.Decimal(20, 2) // legacy rial_remain\n\n verificationStep VerificationStep @default(UNVERIFIED)\n nationalIdImageUrl String?\n businessLicenseUrl String?\n shopImageUrl String?\n\n /// Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\n /// form. Legacy stored an FK to its Image table and read it back as a nested\n /// `image: { id, image }`, so this is a relation, not a bare URL string.\n avatarFileId String?\n avatarFile UploadedFile? @relation(\"CustomerAvatar\", fields: [avatarFileId], references: [id])\n\n /// Legacy had TWO independent switches on a customer:\n /// sts -> may they place orders (this field)\n /// active -> is the account enabled (isActive, below)\n /// The port previously drove both from isActive; they are separate again.\n canPlaceOrders Boolean @default(true)\n\n isActive Boolean @default(true)\n /// Legacy archive flag — the archived list filtered on this, not on isActive.\n isArchived Boolean @default(false)\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n addresses CustomerAddress[]\n orders Order[]\n preOrders PreOrder[]\n ledgerEntries LedgerEntry[]\n walletBonuses WalletBonus[]\n comments Comment[]\n promotions Promotion[]\n notifications NotificationRecipient[]\n activityLogs CustomerActivityLog[]\n\n @@index([referredByAgentId])\n}\n\nmodel CustomerAddress {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n addressLine String\n isDefault Boolean @default(false)\n}\n\nmodel Branch {\n id String @id @default(cuid())\n name String\n /// Legacy Branch.address / phone — both are columns in the branch grid.\n address String?\n phone String?\n /// Legacy GET branch/active/{id} toggles this.\n isActive Boolean @default(true)\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n adminUsers AdminUser[]\n orders Order[]\n allocations BranchAllocation[]\n}\n\nmodel Workshop {\n id String @id @default(cuid())\n name String\n /// Legacy Workshop.address / phone — both are columns in the workshop grid.\n address String?\n phone String?\n /// The supervisor created alongside the workshop by the legacy Add form.\n supervisorId String?\n supervisor AdminUser? @relation(\"WorkshopSupervisor\", fields: [supervisorId], references: [id])\n isActive Boolean @default(true)\n preOrders PreOrder[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Catalog — item reference catalog\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Category {\n id String @id @default(cuid())\n title String\n /// Legacy Category.type — which storefront the category belongs to:\n /// 1 سایت | 2 اپلیکشن موبایل. Drives the \"type_str\" grid column.\n type Int @default(1)\n /// Legacy Category.image / icon — the grid renders the image, the storefront the icon.\n imageUrl String?\n iconUrl String?\n /// Legacy meta tag + description, used for SEO on the site categories.\n metaTag String?\n description String?\n parentId String?\n parent Category? @relation(\"CategoryTree\", fields: [parentId], references: [id])\n children Category[] @relation(\"CategoryTree\")\n products Product[]\n promotions Promotion[]\n}\n\nmodel Brand {\n id String @id @default(cuid())\n title String\n products Product[]\n promotions Promotion[]\n}\n\n/// Curated product groupings — replaces legacy \"Ciny/CinyProduct\" (a tagging\n/// feature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\nmodel Collection {\n id String @id @default(cuid())\n title String\n description String?\n isActive Boolean @default(true)\n products CollectionProduct[]\n}\n\nmodel CollectionProduct {\n collectionId String\n collection Collection @relation(fields: [collectionId], references: [id])\n productId String\n product Product @relation(fields: [productId], references: [id])\n\n @@id([collectionId, productId])\n}\n\nmodel Product {\n id String @id @default(cuid())\n title String\n description String?\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n /// Legacy Product.product_code — the human-facing SKU shown in the grid.\n productCode String? @unique\n /// Legacy Product.show_type: 1 site, 2 mobile, 3 both.\n showType Int @default(3)\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n variants ProductVariant[]\n images ProductImage[]\n collections CollectionProduct[]\n comments Comment[]\n promotions Promotion[]\n allocationItems BranchAllocationItem[]\n}\n\nmodel ProductImage {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n url String\n sortOrder Int @default(0)\n}\n\nmodel ProductVariant {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n title String\n sku String? @unique\n /// Base/raw weight before making charge (\"rash weight\").\n rashWeightGrams Decimal @db.Decimal(14, 4)\n /// Default making-charge percentage applied on top of rash weight.\n defaultWagePercent Decimal @db.Decimal(6, 3)\n /// Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\n /// qty 0 unless it is flagged pre-order, so both fields are required for that\n /// guard to work (see apps/admin-panel/src/stores/cart.ts).\n qty Int @default(0)\n /// Legacy is_pre_order: orderable even at zero stock.\n isPreOrder Boolean @default(false)\n isActive Boolean @default(true)\n\n orderItems OrderItem[]\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Orders — stock orders (debt-bearing)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Order {\n id String @id @default(cuid())\n orderNumber String @unique\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n branchId String?\n branch Branch? @relation(fields: [branchId], references: [id])\n /// Which sales channel placed this order — see OrderChannel.\n channel OrderChannel @default(RETAIL)\n status OrderStatus @default(PLACED)\n\n /// Total gold weight incl. wage across all items (\"allGram\" / order.w).\n totalGoldWeightGrams Decimal @db.Decimal(14, 4)\n /// Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\n wageWeightGrams Decimal @db.Decimal(14, 4)\n /// Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n\n isSuspendedOverCreditLimit Boolean @default(false)\n deliveredAt DateTime? // setting this is what triggers debt recognition\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n items OrderItem[]\n statusEvents OrderStatusEvent[]\n ledgerEntries LedgerEntry[]\n convertedFromPreOrder PreOrder?\n\n @@index([customerId])\n @@index([status])\n}\n\nmodel OrderItem {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n productVariantId String\n productVariant ProductVariant @relation(fields: [productVariantId], references: [id])\n quantity Int\n\n // Snapshots at order time — never re-read from ProductVariant after placement.\n rashWeightGramsSnapshot Decimal @db.Decimal(14, 4)\n wagePercentSnapshot Decimal @db.Decimal(6, 3)\n discountPercentSnapshot Decimal @default(0) @db.Decimal(6, 3)\n /// computed: rash*(1 + (wagePercent-discount)/100)\n computedWeightGrams Decimal @db.Decimal(14, 4)\n flatRialCharge Decimal @default(0) @db.Decimal(20, 2)\n}\n\nmodel OrderStatusEvent {\n id String @id @default(cuid())\n orderId String\n order Order @relation(fields: [orderId], references: [id])\n fromStatus OrderStatus?\n toStatus OrderStatus\n note String?\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n createdAt DateTime @default(now())\n\n @@index([orderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Pre-orders — custom manufacturing requests (not debt-bearing until converted)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel PreOrder {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n cityId String?\n city City? @relation(fields: [cityId], references: [id])\n workshopId String?\n workshop Workshop? @relation(fields: [workshopId], references: [id])\n status PreOrderStatus @default(PLACED)\n\n designImageUrl String?\n colorName String?\n sizeSpec String?\n stoneColor String?\n minaColor String?\n estimatedWeightGrams Decimal? @db.Decimal(14, 4)\n estimatedPriceRial Decimal? @db.Decimal(20, 2)\n description String?\n\n /// Once priced, an admin converts this into a real (debt-bearing) Order.\n convertedOrderId String? @unique\n convertedOrder Order? @relation(fields: [convertedOrderId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n statusEvents PreOrderStatusEvent[]\n\n @@index([customerId])\n}\n\nmodel PreOrderStatusEvent {\n id String @id @default(cuid())\n preOrderId String\n preOrder PreOrder @relation(fields: [preOrderId], references: [id])\n /// Field-level diff, e.g. {\"status\": {\"old\": \"PLACED\", \"new\": \"ADMIN_APPROVED\"}}\n changes Json\n actorAdminUserId String?\n actorAdminUser AdminUser? @relation(fields: [actorAdminUserId], references: [id])\n ipAddress String?\n createdAt DateTime @default(now())\n\n @@index([preOrderId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Accounting — the dual-currency ledger (core of the system)\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel LedgerEntry {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n\n currency LedgerCurrency\n direction LedgerDirection\n sourceType LedgerSourceType\n /// Always positive; direction determines the sign applied to the customer balance.\n amount Decimal @db.Decimal(20, 4)\n\n /// Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\n karatPerMille Int?\n /// Gold price/gram at conversion time, for REPAYMENT_CASH.\n pricePerGramRialAtEntry Decimal? @db.Decimal(20, 2)\n\n orderId String?\n order Order? @relation(fields: [orderId], references: [id])\n\n /// Pending entries don't count toward the cached customer balance until confirmed.\n confirmed Boolean @default(false)\n confirmedAt DateTime?\n postedByAdminUserId String?\n postedByAdminUser AdminUser? @relation(fields: [postedByAdminUserId], references: [id])\n\n /// Instrument metadata from the legacy \"cash\" document form. Which fields are\n /// filled depends on sourceType: a melted-gold receipt carries lab/hallmark and\n /// the pre-normalization weight, a cheque carries the account and bank, and a\n /// transfer carries its destination.\n /// Legacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\n labName String?\n hallmark String?\n accountName String?\n bankName String?\n transferTo String?\n /// Weight as handed over, BEFORE karat normalization (legacy original_value).\n originalValue Decimal? @db.Decimal(14, 4)\n /// Rial amount for cash/cheque documents (legacy price).\n priceRial Decimal? @db.Decimal(20, 2)\n receivedAt DateTime?\n\n note String?\n createdAt DateTime @default(now())\n\n @@index([customerId, currency])\n @@index([orderId])\n}\n\n/// Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\nmodel GoldPriceQuote {\n id String @id @default(cuid())\n karatPerMille Int\n pricePerGramRial Decimal @db.Decimal(20, 2)\n source String\n quotedAt DateTime @default(now())\n\n @@index([karatPerMille, quotedAt])\n}\n\n/// Time-limited gold cashback bonus — replaces the legacy Rooyesh\\Wallet gold credit.\nmodel WalletBonus {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n orderId String?\n goldGrams Decimal @db.Decimal(14, 4)\n grantedAt DateTime @default(now())\n expiresAt DateTime\n consumedAt DateTime?\n isActive Boolean @default(true)\n\n @@index([customerId, isActive])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Admin ACL — faithful port of the legacy granular permission model.\n//\n// Legacy (henza_server):\n// Schema::create('permission', function (Blueprint $table) {\n// $table->string('rid');\n// $table->integer('ut');\n// $table->primary(['rid' , 'ut']);\n// });\n//\n// Permissions attach to the USER TYPE (`ut`), never to an individual user, so\n// every admin of a given type shares one permission set. `ut` pointed at a row\n// in the legacy `config_static` lookup table; UserType is that table, narrowed\n// to the admin-user-type rows it was actually used for.\n//\n// A `rid` is a dotted permission id such as \"persons.list.client.omde\". The\n// frontend expands each stored rid into its ancestors at runtime via\n// checkParent() — see apps/admin-panel/src/stores/users.ts. Only the 58 leaf\n// rids the routers actually gate are seeded; ancestors are derived, not stored.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UserType {\n /// Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\n /// rows keep their legacy identity rather than getting new cuids.\n id Int @id\n title String\n isActive Boolean @default(true)\n createdAt DateTime @default(now())\n\n permissions Permission[]\n adminUsers AdminUser[]\n\n @@map(\"user_type\")\n}\n\nmodel Permission {\n /// Dotted permission id, e.g. \"order.list\", \"persons.list.client.omde\".\n rid String\n userTypeId Int\n userType UserType @relation(fields: [userTypeId], references: [id], onDelete: Cascade)\n\n /// Legacy's composite primary key (rid, ut), preserved exactly.\n @@id([rid, userTypeId])\n @@index([userTypeId])\n @@map(\"permission\")\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Product comments / reviews — legacy `comment` table (App\\Models\\Comment),\n// moderated from views/customer/Comments/Comments.vue.\n//\n// Legacy fillable: product_id, comment, reply_to, sts, customer_id\n// Legacy Comment::$STS = [1 => 'در انتظار تایید', 2 => 'تایید شده', 3 => 'رد شده']\n// which is represented here as an enum rather than a magic integer.\n// ─────────────────────────────────────────────────────────────────────────\n\nenum CommentStatus {\n PENDING // 1 — در انتظار تایید\n APPROVED // 2 — تایید شده\n REJECTED // 3 — رد شده\n}\n\nmodel Comment {\n id String @id @default(cuid())\n productId String\n product Product @relation(fields: [productId], references: [id])\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n body String\n status CommentStatus @default(PENDING)\n\n /// Legacy `reply_to`: a staff reply threads under the comment it answers.\n replyToId String?\n replyTo Comment? @relation(\"CommentReplies\", fields: [replyToId], references: [id])\n replies Comment[] @relation(\"CommentReplies\")\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([productId])\n @@index([customerId])\n @@index([status])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Settings — replaces legacy `config_static`, a key/value table the admin\n// panel read and wrote through endpoints like /wallet/config and\n// /const/__list__ut. Values are stored as JSON so a setting can hold a scalar,\n// an object, or the dynamic option lists legacy kept under `__list__*` keys.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel Setting {\n key String @id\n value Json\n updatedAt DateTime @updatedAt\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Promotions / discounts — legacy views/promotion/*, served by\n// PromotionController (`product/variant/promotion`). The redesigned schema had\n// no promotion concept at all; this models what the legacy forms actually\n// collect.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Legacy Promotion.type — what the discount is scoped to.\nenum PromotionScope {\n PRODUCT // 1 محصولات\n CATEGORY // 2 دسته بندی\n CUSTOMER // 3 مشتری\n BRAND // 4 برند\n}\n\n/// Legacy Promotion.use_only — how often a customer may redeem it.\nenum PromotionUsage {\n ONCE // 1 فقط یکبار\n UNTIL_END_DATE // 2 تا تاریخ پایان\n}\n\nmodel Promotion {\n id String @id @default(cuid())\n title String\n description String?\n scope PromotionScope @default(PRODUCT)\n usage PromotionUsage @default(ONCE)\n /// Percentage off, 0-100 (legacy discount_percent).\n discountPercent Decimal @db.Decimal(6, 3)\n isActive Boolean @default(true)\n /// Which storefront it shows on, mirroring Product.showType (legacy platform).\n platform Int @default(3)\n\n startsAt DateTime?\n endsAt DateTime?\n\n /// Exactly one of these is populated, per `scope`.\n productId String?\n product Product? @relation(fields: [productId], references: [id])\n categoryId String?\n category Category? @relation(fields: [categoryId], references: [id])\n customerId String?\n customer Customer? @relation(fields: [customerId], references: [id])\n brandId String?\n brand Brand? @relation(fields: [brandId], references: [id])\n\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n\n @@index([scope, isActive])\n}\n\n/// Legacy \"ignore\" table (views/offersIgnore) — specific products, categories,\n/// customers or brands excluded from the automatic discount engine.\n/// Legacy posts { type, item_id[] }: \"type\" reuses the promotion scope codes\n/// (1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \"itemId\" is the excluded row.\nmodel PromotionExclusion {\n id String @id @default(cuid())\n type Int\n itemId String\n createdAt DateTime @default(now())\n\n @@unique([type, itemId])\n @@index([type])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Branch stock allocation — legacy views/invoice/* (\"فاکتور انتقال\"), served by\n// BranchController as `branch/product`. Despite the screen being called an\n// invoice, it is not a sales document: it records which products head office\n// allocated to a branch, and who allocated them.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel BranchAllocation {\n id String @id @default(cuid())\n branchId String\n branch Branch @relation(fields: [branchId], references: [id])\n\n /// Legacy `allocator_user` — the admin who filed the allocation.\n allocatorAdminUserId String?\n allocatorAdminUser AdminUser? @relation(\"AllocationAuthor\", fields: [allocatorAdminUserId], references: [id])\n\n note String?\n createdAt DateTime @default(now())\n\n items BranchAllocationItem[]\n\n @@index([branchId])\n}\n\nmodel BranchAllocationItem {\n id String @id @default(cuid())\n allocationId String\n allocation BranchAllocation @relation(fields: [allocationId], references: [id], onDelete: Cascade)\n productId String\n product Product @relation(fields: [productId], references: [id])\n /// Weight snapshot at allocation time, so later catalog edits do not rewrite history.\n weightGrams Decimal? @db.Decimal(14, 4)\n\n @@unique([allocationId, productId])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Messaging + audit — legacy views/sms, views/notify, views/newsletters and\n// views/statics. None of these had a model in the redesigned schema.\n// ─────────────────────────────────────────────────────────────────────────\n\n/// Who an SMS or notification was aimed at. Legacy's sms/create offered these\n/// audiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\nenum MessageAudience {\n SINGLE_NUMBER // یک شماره\n MULTIPLE_NUMBERS // چند شماره\n ALL_CUSTOMERS // همه\n WHOLESALE_CUSTOMERS // عمده\n RETAIL_CUSTOMERS // تک\n SALES_AGENTS // کارشناسان فروش\n}\n\nmodel SmsMessage {\n id String @id @default(cuid())\n audience MessageAudience\n /// Comma-separated recipients for the SINGLE/MULTIPLE audiences.\n recipients String?\n body String\n /// How many numbers the send actually resolved to.\n sentCount Int @default(0)\n\n sentByAdminUserId String?\n sentByAdminUser AdminUser? @relation(\"SmsAuthor\", fields: [sentByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n\n @@index([createdAt])\n}\n\nmodel Notification {\n id String @id @default(cuid())\n title String\n body String\n audience MessageAudience @default(ALL_CUSTOMERS)\n\n sentByAdminUserId String?\n sentByAdminUser AdminUser? @relation(\"NotificationAuthor\", fields: [sentByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n\n recipients NotificationRecipient[]\n\n @@index([createdAt])\n}\n\n/// Per-customer delivery + read state — legacy `GET notify/read/{id}`.\nmodel NotificationRecipient {\n id String @id @default(cuid())\n notificationId String\n notification Notification @relation(fields: [notificationId], references: [id], onDelete: Cascade)\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n readAt DateTime?\n\n @@unique([notificationId, customerId])\n @@index([customerId, readAt])\n}\n\n/// Legacy views/newsletters — the mailing-list signups collected by the site.\nmodel NewsletterSubscriber {\n id String @id @default(cuid())\n email String?\n mobile String?\n createdAt DateTime @default(now())\n\n @@unique([email])\n @@unique([mobile])\n}\n\n/// Legacy views/statics — the customer activity log the \"آمار\" screen reads\n/// (`log/list/customer`, `log/ago/{customerId}`).\nmodel CustomerActivityLog {\n id String @id @default(cuid())\n customerId String\n customer Customer @relation(fields: [customerId], references: [id])\n /// Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\n action String\n detail String?\n createdAt DateTime @default(now())\n\n @@index([customerId, createdAt])\n}\n\n// ─────────────────────────────────────────────────────────────────────────\n// Uploads — replaces the legacy MyUpload / SingleUploadInput widgets, which\n// POSTed to a file endpoint and stored the returned URL on the owning record.\n// Ports of those forms currently take a URL by hand; this gives them a real\n// destination to upload to.\n// ─────────────────────────────────────────────────────────────────────────\n\nmodel UploadedFile {\n id String @id @default(cuid())\n /// Public URL the stored file is served from.\n url String\n originalName String\n mimeType String\n sizeBytes Int\n /// Free-form tag for what the file belongs to, e.g. 'product', 'category',\n /// 'customer.nationalId'. Kept loose so a new form needs no schema change.\n purpose String?\n\n uploadedByAdminUserId String?\n uploadedByAdminUser AdminUser? @relation(\"FileUploader\", fields: [uploadedByAdminUserId], references: [id])\n\n createdAt DateTime @default(now())\n customerAvatars Customer[] @relation(\"CustomerAvatar\")\n\n @@index([purpose])\n}\n", + "inlineSchemaHash": "4cc939ac6b5cd721518113b1d37a86a6f2cbfcc7f4466eff02a3535e7b385f45", "copyEngine": true } @@ -476,7 +689,7 @@ if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { config.isBundled = true } -config.runtimeDataModel = JSON.parse("{\"models\":{\"City\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"province\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branches\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"AdminUser\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminRole\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredCustomers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedLedgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Customer\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredByAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredByAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[\"referredByAgentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldCreditLimitGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldDebtGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fiatDebtRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"verificationStep\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"VerificationStep\",\"default\":\"UNVERIFIED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalIdImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"businessLicenseUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"shopImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"walletBonuses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"WalletBonus\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerAddress\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addressLine\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isDefault\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Branch\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Workshop\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Category\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Brand\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Collection\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Curated product groupings — replaces legacy \\\"Ciny/CinyProduct\\\" (a tagging\\\\nfeature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\"},\"CollectionProduct\":{\"dbName\":null,\"fields\":[{\"name\":\"collectionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collection\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Collection\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[\"collectionId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"collectionId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Product\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"images\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collections\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductImage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sortOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductVariant\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sku\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Base/raw weight before making charge (\\\"rash weight\\\").\"},{\"name\":\"defaultWagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Default making-charge percentage applied on top of rash weight.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Order\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"totalGoldWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Total gold weight incl. wage across all items (\\\"allGram\\\" / order.w).\"},{\"name\":\"wageWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\"},{\"name\":\"isSuspendedOverCreditLimit\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deliveredAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedFromPreOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariantId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariant\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[\"productVariantId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quantity\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGramsSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"computedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"computed: rash*(1 + (wagePercent-discount)/100)\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fromStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"toStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrder\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshopId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshop\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[\"workshopId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PreOrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"designImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"colorName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeSpec\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stoneColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"minaColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedPriceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Once priced, an admin converts this into a real (debt-bearing) Order.\"},{\"name\":\"convertedOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[\"convertedOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[\"preOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"changes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Field-level diff, e.g. {\\\"status\\\": {\\\"old\\\": \\\"PLACED\\\", \\\"new\\\": \\\"ADMIN_APPROVED\\\"}}\"},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"LedgerEntry\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"currency\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerCurrency\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"direction\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerDirection\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sourceType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerSourceType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"amount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Always positive; direction determines the sign applied to the customer balance.\"},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\"},{\"name\":\"pricePerGramRialAtEntry\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Gold price/gram at conversion time, for REPAYMENT_CASH.\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"confirmed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pending entries don't count toward the cached customer balance until confirmed.\"},{\"name\":\"confirmedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[\"postedByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"GoldPriceQuote\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pricePerGramRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"source\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quotedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\"},\"WalletBonus\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"grantedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Time-limited gold cashback bonus — replaces the legacy Rooyesh\\\\Wallet gold credit.\"}},\"enums\":{\"AdminRole\":{\"values\":[{\"name\":\"SUPER_ADMIN\",\"dbName\":null},{\"name\":\"SYSTEM_APPROVER\",\"dbName\":null},{\"name\":\"SALES_EXPERT\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"ACCOUNTANT\",\"dbName\":null}],\"dbName\":null},\"VerificationStep\":{\"values\":[{\"name\":\"UNVERIFIED\",\"dbName\":null},{\"name\":\"STEP_ONE_SUBMITTED\",\"dbName\":null},{\"name\":\"STEP_TWO_SUBMITTED\",\"dbName\":null},{\"name\":\"VERIFIED\",\"dbName\":null}],\"dbName\":null},\"OrderStatus\":{\"values\":[{\"name\":\"SUSPENDED\",\"dbName\":null},{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"SOURCING\",\"dbName\":null},{\"name\":\"PREPARING\",\"dbName\":null},{\"name\":\"DELIVERED_TO_AGENT\",\"dbName\":null},{\"name\":\"DELIVERED_TO_CUSTOMER\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"PreOrderStatus\":{\"values\":[{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"WORKSHOP_APPROVED\",\"dbName\":null},{\"name\":\"READY_TO_SHIP\",\"dbName\":null},{\"name\":\"DELIVERED\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"LedgerCurrency\":{\"values\":[{\"name\":\"GOLD_GRAM\",\"dbName\":null},{\"name\":\"RIAL\",\"dbName\":null}],\"dbName\":null},\"LedgerDirection\":{\"values\":[{\"name\":\"DEBIT\",\"dbName\":null},{\"name\":\"CREDIT\",\"dbName\":null}],\"dbName\":null},\"LedgerSourceType\":{\"values\":[{\"name\":\"ORDER_STOCK\",\"dbName\":null},{\"name\":\"ORDER_PRE_ORDER\",\"dbName\":null},{\"name\":\"REPAYMENT_MELTED_GOLD\",\"dbName\":null},{\"name\":\"REPAYMENT_TRANSFER\",\"dbName\":null},{\"name\":\"REPAYMENT_CHEQUE\",\"dbName\":null},{\"name\":\"REPAYMENT_CASH\",\"dbName\":null},{\"name\":\"WALLET_BONUS\",\"dbName\":null},{\"name\":\"ADJUSTMENT\",\"dbName\":null}],\"dbName\":null}},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"City\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"province\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"percent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy cities.percent / percent_aux — per-city wage surcharges the city\\\\nscreen edits through GET cities/get-percent/{id} and get-percent-aux/{id}.\"},{\"name\":\"percentAux\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branches\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"AdminUser\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"role\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminRole\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType);\\\\nthe coarse `role` enum above is retained for the business rules that already\\\\nswitch on it. Nullable so existing seeded admins remain valid.\"},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredCustomers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supervisedWorkshops\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchAllocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedLedgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderStatusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentSmsMessages\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"SmsMessage\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentNotifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedFiles\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"FileUploader\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Customer\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fullName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"passwordHash\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomer\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"kind\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CustomerKind\",\"default\":\"APP_SHOPKEEPER\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the\\\\nBankerList / ShopkeeperList screens filter on.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy contact + shop columns, shown on the wholesale customer form and as\\\\n(hidden-by-default) columns in its grid.\"},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"storeName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pasazhName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"zone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"memberCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy mcode — the operator-assigned customer code.\"},{\"name\":\"referredByAgentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"referredByAgent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"ReferralAgent\",\"relationFromFields\":[\"referredByAgentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldCreditLimitGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldDebtGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fiatDebtRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"verificationStep\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"VerificationStep\",\"default\":\"UNVERIFIED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nationalIdImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"businessLicenseUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"shopImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"avatarFileId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent\\\\nform. Legacy stored an FK to its Image table and read it back as a nested\\\\n`image: { id, image }`, so this is a relation, not a bare URL string.\"},{\"name\":\"avatarFile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UploadedFile\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[\"avatarFileId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"canPlaceOrders\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy had TWO independent switches on a customer:\\\\nsts -> may they place orders (this field)\\\\nactive -> is the account enabled (isActive, below)\\\\nThe port previously drove both from isActive; they are separate again.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isArchived\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy archive flag — the archived list filtered on this, not on isActive.\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"addresses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerAddress\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"walletBonuses\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"WalletBonus\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notifications\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"activityLogs\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CustomerActivityLog\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"CustomerAddress\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerAddress\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToCustomerAddress\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"addressLine\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isDefault\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Branch\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Branch.address / phone — both are columns in the branch grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy GET branch/active/{id} toggles this.\"},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"BranchToCity\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToBranch\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocations\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Workshop\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"address\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Workshop.address / phone — both are columns in the workshop grid.\"},{\"name\":\"phone\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"supervisorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"The supervisor created alongside the workshop by the legacy Add form.\"},{\"name\":\"supervisor\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"WorkshopSupervisor\",\"relationFromFields\":[\"supervisorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrders\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Category\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":1,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.type — which storefront the category belongs to:\\\\n1 سایت | 2 اپلیکشن موبایل. Drives the \\\"type_str\\\" grid column.\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Category.image / icon — the grid renders the image, the storefront the icon.\"},{\"name\":\"iconUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"metaTag\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy meta tag + description, used for SEO on the site categories.\"},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parentId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"parent\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[\"parentId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"children\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryTree\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Brand\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Collection\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"products\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Curated product groupings — replaces legacy \\\"Ciny/CinyProduct\\\" (a tagging\\\\nfeature, NOT a gold-price snapshot mechanism, despite the misleading legacy name).\"},\"CollectionProduct\":{\"dbName\":null,\"fields\":[{\"name\":\"collectionId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collection\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Collection\",\"relationName\":\"CollectionToCollectionProduct\",\"relationFromFields\":[\"collectionId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"collectionId\",\"productId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Product\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToProduct\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToProduct\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productCode\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.product_code — the human-facing SKU shown in the grid.\"},{\"name\":\"showType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy Product.show_type: 1 site, 2 mobile, 3 both.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"variants\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"images\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductImage\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"collections\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"CollectionProduct\",\"relationName\":\"CollectionProductToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"comments\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"promotions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Promotion\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductImage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductImage\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sortOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"ProductVariant\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToProductVariant\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sku\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Base/raw weight before making charge (\\\"rash weight\\\").\"},{\"name\":\"defaultWagePercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Default making-charge percentage applied on top of rash weight.\"},{\"name\":\"qty\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with\\\\nqty 0 unless it is flagged pre-order, so both fields are required for that\\\\nguard to work (see apps/admin-panel/src/stores/cart.ts).\"},{\"name\":\"isPreOrder\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy is_pre_order: orderable even at zero stock.\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderItems\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Order\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToOrder\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"channel\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderChannel\",\"default\":\"RETAIL\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which sales channel placed this order — see OrderChannel.\"},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"OrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"totalGoldWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Total gold weight incl. wage across all items (\\\"allGram\\\" / order.w).\"},{\"name\":\"wageWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pure making-charge weight component (totalGoldWeightGrams minus raw weight sum).\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Flat Rial charge independent of gold price (e.g. stones) — legacy rial_input.\"},{\"name\":\"isSuspendedOverCreditLimit\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"deliveredAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderItem\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatusEvent\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ledgerEntries\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerEntry\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedFromPreOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderItem\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariantId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productVariant\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"ProductVariant\",\"relationName\":\"OrderItemToProductVariant\",\"relationFromFields\":[\"productVariantId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quantity\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"rashWeightGramsSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"wagePercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercentSnapshot\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"computedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"computed: rash*(1 + (wagePercent-discount)/100)\"},{\"name\":\"flatRialCharge\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Decimal\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"OrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToOrderStatusEvent\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"fromStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"toStatus\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"OrderStatus\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrder\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPreOrder\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"cityId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"city\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"City\",\"relationName\":\"CityToPreOrder\",\"relationFromFields\":[\"cityId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshopId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"workshop\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Workshop\",\"relationName\":\"PreOrderToWorkshop\",\"relationFromFields\":[\"workshopId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PreOrderStatus\",\"default\":\"PLACED\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"designImageUrl\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"colorName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeSpec\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"stoneColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"minaColor\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedWeightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"estimatedPriceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"convertedOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Once priced, an admin converts this into a real (debt-bearing) Order.\"},{\"name\":\"convertedOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"OrderToPreOrder\",\"relationFromFields\":[\"convertedOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true},{\"name\":\"statusEvents\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrderStatusEvent\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PreOrderStatusEvent\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"preOrder\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"PreOrder\",\"relationName\":\"PreOrderToPreOrderStatusEvent\",\"relationFromFields\":[\"preOrderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"changes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Field-level diff, e.g. {\\\"status\\\": {\\\"old\\\": \\\"PLACED\\\", \\\"new\\\": \\\"ADMIN_APPROVED\\\"}}\"},{\"name\":\"actorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"actorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToPreOrderStatusEvent\",\"relationFromFields\":[\"actorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"ipAddress\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"LedgerEntry\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToLedgerEntry\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"currency\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerCurrency\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"direction\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerDirection\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sourceType\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"LedgerSourceType\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"amount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Always positive; direction determines the sign applied to the customer balance.\"},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Purity of the physical instrument, for REPAYMENT_MELTED_GOLD (e.g. 750, 916).\"},{\"name\":\"pricePerGramRialAtEntry\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Gold price/gram at conversion time, for REPAYMENT_CASH.\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"order\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Order\",\"relationName\":\"LedgerEntryToOrder\",\"relationFromFields\":[\"orderId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"confirmed\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":false,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Pending entries don't count toward the cached customer balance until confirmed.\"},{\"name\":\"confirmedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"postedByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToLedgerEntry\",\"relationFromFields\":[\"postedByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"labName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Instrument metadata from the legacy \\\"cash\\\" document form. Which fields are\\\\nfilled depends on sourceType: a melted-gold receipt carries lab/hallmark and\\\\nthe pre-normalization weight, a cheque carries the account and bank, and a\\\\ntransfer carries its destination.\\\\nLegacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date.\"},{\"name\":\"hallmark\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"accountName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bankName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"transferTo\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"originalValue\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight as handed over, BEFORE karat normalization (legacy original_value).\"},{\"name\":\"priceRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Rial amount for cash/cheque documents (legacy price).\"},{\"name\":\"receivedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"GoldPriceQuote\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"karatPerMille\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"pricePerGramRial\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"source\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"quotedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Replaces legacy WebServiceGold / ConfigStatic.gold_price — timestamped price feed.\"},\"WalletBonus\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToWalletBonus\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"orderId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"goldGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"grantedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"consumedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Time-limited gold cashback bonus — replaces the legacy Rooyesh\\\\Wallet gold credit.\"},\"UserType\":{\"dbName\":\"user_type\",\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded\\\\nrows keep their legacy identity rather than getting new cuids.\"},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"permissions\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Permission\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"adminUsers\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AdminUserToUserType\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Permission\":{\"dbName\":\"permission\",\"fields\":[{\"name\":\"rid\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Dotted permission id, e.g. \\\"order.list\\\", \\\"persons.list.client.omde\\\".\"},{\"name\":\"userTypeId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userType\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"UserType\",\"relationName\":\"PermissionToUserType\",\"relationFromFields\":[\"userTypeId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":{\"name\":null,\"fields\":[\"rid\",\"userTypeId\"]},\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Comment\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"CommentToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CommentToCustomer\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"status\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"CommentStatus\",\"default\":\"PENDING\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replyToId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `reply_to`: a staff reply threads under the comment it answers.\"},{\"name\":\"replyTo\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[\"replyToId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"replies\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Comment\",\"relationName\":\"CommentReplies\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Setting\":{\"dbName\":null,\"fields\":[{\"name\":\"key\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"value\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Promotion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"description\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"scope\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionScope\",\"default\":\"PRODUCT\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"usage\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"PromotionUsage\",\"default\":\"ONCE\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"discountPercent\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Percentage off, 0-100 (legacy discount_percent).\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Boolean\",\"default\":true,\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"platform\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":3,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Which storefront it shows on, mirroring Product.showType (legacy platform).\"},{\"name\":\"startsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"endsAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Exactly one of these is populated, per `scope`.\"},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"ProductToPromotion\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"category\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Category\",\"relationName\":\"CategoryToPromotion\",\"relationFromFields\":[\"categoryId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToPromotion\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brandId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"brand\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Brand\",\"relationName\":\"BrandToPromotion\",\"relationFromFields\":[\"brandId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":true}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"PromotionExclusion\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"type\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"itemId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"type\",\"itemId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"type\",\"itemId\"]}],\"isGenerated\":false,\"documentation\":\"Legacy \\\"ignore\\\" table (views/offersIgnore) — specific products, categories,\\\\ncustomers or brands excluded from the automatic discount engine.\\\\nLegacy posts { type, item_id[] }: \\\"type\\\" reuses the promotion scope codes\\\\n(1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and \\\"itemId\\\" is the excluded row.\"},\"BranchAllocation\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branchId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"branch\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Branch\",\"relationName\":\"BranchToBranchAllocation\",\"relationFromFields\":[\"branchId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocatorAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Legacy `allocator_user` — the admin who filed the allocation.\"},{\"name\":\"allocatorAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"AllocationAuthor\",\"relationFromFields\":[\"allocatorAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"note\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"items\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocationItem\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"BranchAllocationItem\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"allocation\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"BranchAllocation\",\"relationName\":\"BranchAllocationToBranchAllocationItem\",\"relationFromFields\":[\"allocationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"productId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"product\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Product\",\"relationName\":\"BranchAllocationItemToProduct\",\"relationFromFields\":[\"productId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"weightGrams\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Decimal\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Weight snapshot at allocation time, so later catalog edits do not rewrite history.\"}],\"primaryKey\":null,\"uniqueFields\":[[\"allocationId\",\"productId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"allocationId\",\"productId\"]}],\"isGenerated\":false},\"SmsMessage\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"MessageAudience\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Comma-separated recipients for the SINGLE/MULTIPLE audiences.\"},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentCount\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":0,\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"How many numbers the send actually resolved to.\"},{\"name\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"SmsAuthor\",\"relationFromFields\":[\"sentByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Notification\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"body\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"audience\",\"kind\":\"enum\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"MessageAudience\",\"default\":\"ALL_CUSTOMERS\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sentByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"NotificationAuthor\",\"relationFromFields\":[\"sentByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"recipients\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"NotificationRecipient\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"NotificationRecipient\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notificationId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"notification\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Notification\",\"relationName\":\"NotificationToNotificationRecipient\",\"relationFromFields\":[\"notificationId\"],\"relationToFields\":[\"id\"],\"relationOnDelete\":\"Cascade\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToNotificationRecipient\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"readAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"notificationId\",\"customerId\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"notificationId\",\"customerId\"]}],\"isGenerated\":false,\"documentation\":\"Per-customer delivery + read state — legacy `GET notify/read/{id}`.\"},\"NewsletterSubscriber\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"email\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mobile\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[[\"email\"],[\"mobile\"]],\"uniqueIndexes\":[{\"name\":null,\"fields\":[\"email\"]},{\"name\":null,\"fields\":[\"mobile\"]}],\"isGenerated\":false,\"documentation\":\"Legacy views/newsletters — the mailing-list signups collected by the site.\"},\"CustomerActivityLog\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customer\",\"kind\":\"object\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerToCustomerActivityLog\",\"relationFromFields\":[\"customerId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"action\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'.\"},{\"name\":\"detail\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false,\"documentation\":\"Legacy views/statics — the customer activity log the \\\"آمار\\\" screen reads\\\\n(`log/list/customer`, `log/ago/{customerId}`).\"},\"UploadedFile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":{\"name\":\"cuid\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"url\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Public URL the stored file is served from.\"},{\"name\":\"originalName\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"mimeType\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"sizeBytes\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"purpose\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"Free-form tag for what the file belongs to, e.g. 'product', 'category',\\\\n'customer.nationalId'. Kept loose so a new form needs no schema change.\"},{\"name\":\"uploadedByAdminUserId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uploadedByAdminUser\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"AdminUser\",\"relationName\":\"FileUploader\",\"relationFromFields\":[\"uploadedByAdminUserId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"customerAvatars\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Customer\",\"relationName\":\"CustomerAvatar\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{\"AdminRole\":{\"values\":[{\"name\":\"SUPER_ADMIN\",\"dbName\":null},{\"name\":\"SYSTEM_APPROVER\",\"dbName\":null},{\"name\":\"SALES_EXPERT\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null},{\"name\":\"ACCOUNTANT\",\"dbName\":null}],\"dbName\":null},\"CustomerKind\":{\"values\":[{\"name\":\"SALES_AGENT\",\"dbName\":null},{\"name\":\"APP_SHOPKEEPER\",\"dbName\":null},{\"name\":\"WALK_IN_SHOPKEEPER\",\"dbName\":null},{\"name\":\"BANKER\",\"dbName\":null},{\"name\":\"WORKSHOP_SUPERVISOR\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Customer.type — what kind of wholesale customer this is. Values and\\\\nlabels taken verbatim from bulkCustomer.vue's userTypes list.\"},\"VerificationStep\":{\"values\":[{\"name\":\"UNVERIFIED\",\"dbName\":null},{\"name\":\"STEP_ONE_SUBMITTED\",\"dbName\":null},{\"name\":\"STEP_TWO_SUBMITTED\",\"dbName\":null},{\"name\":\"VERIFIED\",\"dbName\":null}],\"dbName\":null},\"OrderChannel\":{\"values\":[{\"name\":\"RETAIL\",\"dbName\":null},{\"name\":\"WHOLESALE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy kept retail and wholesale orders in two SEPARATE tables\\\\n(orders_orders vs orders). The redesigned schema has one Order model, so the\\\\ndistinction lives here instead.\"},\"OrderStatus\":{\"values\":[{\"name\":\"SUSPENDED\",\"dbName\":null},{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"SOURCING\",\"dbName\":null},{\"name\":\"PREPARING\",\"dbName\":null},{\"name\":\"DELIVERED_TO_AGENT\",\"dbName\":null},{\"name\":\"DELIVERED_TO_CUSTOMER\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"PreOrderStatus\":{\"values\":[{\"name\":\"PLACED\",\"dbName\":null},{\"name\":\"ADMIN_APPROVED\",\"dbName\":null},{\"name\":\"WORKSHOP_APPROVED\",\"dbName\":null},{\"name\":\"READY_TO_SHIP\",\"dbName\":null},{\"name\":\"DELIVERED\",\"dbName\":null},{\"name\":\"CANCELLED\",\"dbName\":null}],\"dbName\":null},\"LedgerCurrency\":{\"values\":[{\"name\":\"GOLD_GRAM\",\"dbName\":null},{\"name\":\"RIAL\",\"dbName\":null}],\"dbName\":null},\"LedgerDirection\":{\"values\":[{\"name\":\"DEBIT\",\"dbName\":null},{\"name\":\"CREDIT\",\"dbName\":null}],\"dbName\":null},\"LedgerSourceType\":{\"values\":[{\"name\":\"ORDER_STOCK\",\"dbName\":null},{\"name\":\"ORDER_PRE_ORDER\",\"dbName\":null},{\"name\":\"REPAYMENT_MELTED_GOLD\",\"dbName\":null},{\"name\":\"REPAYMENT_TRANSFER\",\"dbName\":null},{\"name\":\"REPAYMENT_CHEQUE\",\"dbName\":null},{\"name\":\"REPAYMENT_CASH\",\"dbName\":null},{\"name\":\"WALLET_BONUS\",\"dbName\":null},{\"name\":\"ADJUSTMENT\",\"dbName\":null}],\"dbName\":null},\"CommentStatus\":{\"values\":[{\"name\":\"PENDING\",\"dbName\":null},{\"name\":\"APPROVED\",\"dbName\":null},{\"name\":\"REJECTED\",\"dbName\":null}],\"dbName\":null},\"PromotionScope\":{\"values\":[{\"name\":\"PRODUCT\",\"dbName\":null},{\"name\":\"CATEGORY\",\"dbName\":null},{\"name\":\"CUSTOMER\",\"dbName\":null},{\"name\":\"BRAND\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.type — what the discount is scoped to.\"},\"PromotionUsage\":{\"values\":[{\"name\":\"ONCE\",\"dbName\":null},{\"name\":\"UNTIL_END_DATE\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Legacy Promotion.use_only — how often a customer may redeem it.\"},\"MessageAudience\":{\"values\":[{\"name\":\"SINGLE_NUMBER\",\"dbName\":null},{\"name\":\"MULTIPLE_NUMBERS\",\"dbName\":null},{\"name\":\"ALL_CUSTOMERS\",\"dbName\":null},{\"name\":\"WHOLESALE_CUSTOMERS\",\"dbName\":null},{\"name\":\"RETAIL_CUSTOMERS\",\"dbName\":null},{\"name\":\"SALES_AGENTS\",\"dbName\":null}],\"dbName\":null,\"documentation\":\"Who an SMS or notification was aimed at. Legacy's sms/create offered these\\\\naudiences, each gated by its own rid (sms.create.all, .omde, .single, ...).\"}},\"types\":{}}") defineDmmfProperty(exports.Prisma, config.runtimeDataModel) config.engineWasm = undefined diff --git a/apps/api/release/vendor/.prisma/client/package.json b/apps/api/release/vendor/.prisma/client/package.json index df326de..441db24 100644 --- a/apps/api/release/vendor/.prisma/client/package.json +++ b/apps/api/release/vendor/.prisma/client/package.json @@ -1,5 +1,5 @@ { - "name": "prisma-client-d0d5db76aa59566edce744ecac2768fcb398c1a9f370089a45b9416272282fab", + "name": "prisma-client-9a5464add1bac751da0fd2476fcc0a15f434a77547c687bcb5959b29d451c62b", "main": "index.js", "types": "index.d.ts", "browser": "index-browser.js", diff --git a/apps/api/release/vendor/.prisma/client/schema.prisma b/apps/api/release/vendor/.prisma/client/schema.prisma index 03ab62d..6712b21 100644 --- a/apps/api/release/vendor/.prisma/client/schema.prisma +++ b/apps/api/release/vendor/.prisma/client/schema.prisma @@ -26,6 +26,16 @@ enum AdminRole { ACCOUNTANT } +/// Legacy Customer.type — what kind of wholesale customer this is. Values and +/// labels taken verbatim from bulkCustomer.vue's userTypes list. +enum CustomerKind { + SALES_AGENT // 1 کارشناس فروش + APP_SHOPKEEPER // 2 مغازه دار اپلیکیشن + WALK_IN_SHOPKEEPER // 3 مغازه دار حضوری + BANKER // 4 بنکدار + WORKSHOP_SUPERVISOR // 5 سرپرست کارگاه +} + enum VerificationStep { UNVERIFIED STEP_ONE_SUBMITTED @@ -33,6 +43,14 @@ enum VerificationStep { VERIFIED } +/// Legacy kept retail and wholesale orders in two SEPARATE tables +/// (orders_orders vs orders). The redesigned schema has one Order model, so the +/// distinction lives here instead. +enum OrderChannel { + RETAIL // تک فروشی + WHOLESALE // عمده فروشی +} + enum OrderStatus { SUSPENDED // credit limit (goldCreditLimitGrams) exceeded at placement PLACED @@ -79,13 +97,17 @@ enum LedgerSourceType { // ───────────────────────────────────────────────────────────────────────── model City { - id String @id @default(cuid()) - name String - province String? - customers Customer[] - addresses CustomerAddress[] - branches Branch[] - preOrders PreOrder[] + id String @id @default(cuid()) + name String + province String? + /// Legacy cities.percent / percent_aux — per-city wage surcharges the city + /// screen edits through GET cities/get-percent/{id} and get-percent-aux/{id}. + percent Decimal? @db.Decimal(6, 3) + percentAux Decimal? @db.Decimal(6, 3) + customers Customer[] + addresses CustomerAddress[] + branches Branch[] + preOrders PreOrder[] } model AdminUser { @@ -94,6 +116,11 @@ model AdminUser { mobile String @unique passwordHash String role AdminRole + /// Legacy `users.ut`. Granular ACL lives here (Permission rows hang off UserType); + /// the coarse `role` enum above is retained for the business rules that already + /// switch on it. Nullable so existing seeded admins remain valid. + userTypeId Int? + userType UserType? @relation(fields: [userTypeId], references: [id]) branchId String? branch Branch? @relation(fields: [branchId], references: [id]) wagePercent Decimal? @db.Decimal(6, 3) // legacy Customer.percent, commission on referred orders @@ -101,11 +128,17 @@ model AdminUser { createdAt DateTime @default(now()) referredCustomers Customer[] @relation("ReferralAgent") + supervisedWorkshops Workshop[] @relation("WorkshopSupervisor") + branchAllocations BranchAllocation[] @relation("AllocationAuthor") postedLedgerEntries LedgerEntry[] orderStatusEvents OrderStatusEvent[] preOrderStatusEvents PreOrderStatusEvent[] + sentSmsMessages SmsMessage[] @relation("SmsAuthor") + sentNotifications Notification[] @relation("NotificationAuthor") + uploadedFiles UploadedFile[] @relation("FileUploader") @@index([role]) + @@index([userTypeId]) } model Customer { @@ -117,6 +150,20 @@ model Customer { cityId String? city City? @relation(fields: [cityId], references: [id]) + /// Legacy Customer.type — distinguishes بنکدار from مغازه دار, which the + /// BankerList / ShopkeeperList screens filter on. + kind CustomerKind @default(APP_SHOPKEEPER) + + /// Legacy contact + shop columns, shown on the wholesale customer form and as + /// (hidden-by-default) columns in its grid. + phone String? + address String? + storeName String? + pasazhName String? + zone String? + /// Legacy mcode — the operator-assigned customer code. + memberCode String? + referredByAgentId String? referredByAgent AdminUser? @relation("ReferralAgent", fields: [referredByAgentId], references: [id]) @@ -131,15 +178,33 @@ model Customer { businessLicenseUrl String? shopImageUrl String? - isActive Boolean @default(true) - createdAt DateTime @default(now()) - updatedAt DateTime @updatedAt + /// Legacy `image_id` — the profile photo (عکس پروفایل) on the sales-agent + /// form. Legacy stored an FK to its Image table and read it back as a nested + /// `image: { id, image }`, so this is a relation, not a bare URL string. + avatarFileId String? + avatarFile UploadedFile? @relation("CustomerAvatar", fields: [avatarFileId], references: [id]) + + /// Legacy had TWO independent switches on a customer: + /// sts -> may they place orders (this field) + /// active -> is the account enabled (isActive, below) + /// The port previously drove both from isActive; they are separate again. + canPlaceOrders Boolean @default(true) + + isActive Boolean @default(true) + /// Legacy archive flag — the archived list filtered on this, not on isActive. + isArchived Boolean @default(false) + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt addresses CustomerAddress[] orders Order[] preOrders PreOrder[] ledgerEntries LedgerEntry[] walletBonuses WalletBonus[] + comments Comment[] + promotions Promotion[] + notifications NotificationRecipient[] + activityLogs CustomerActivityLog[] @@index([referredByAgentId]) } @@ -155,19 +220,31 @@ model CustomerAddress { } model Branch { - id String @id @default(cuid()) - name String - cityId String? - city City? @relation(fields: [cityId], references: [id]) - adminUsers AdminUser[] - orders Order[] + id String @id @default(cuid()) + name String + /// Legacy Branch.address / phone — both are columns in the branch grid. + address String? + phone String? + /// Legacy GET branch/active/{id} toggles this. + isActive Boolean @default(true) + cityId String? + city City? @relation(fields: [cityId], references: [id]) + adminUsers AdminUser[] + orders Order[] + allocations BranchAllocation[] } model Workshop { - id String @id @default(cuid()) - name String - isActive Boolean @default(true) - preOrders PreOrder[] + id String @id @default(cuid()) + name String + /// Legacy Workshop.address / phone — both are columns in the workshop grid. + address String? + phone String? + /// The supervisor created alongside the workshop by the legacy Add form. + supervisorId String? + supervisor AdminUser? @relation("WorkshopSupervisor", fields: [supervisorId], references: [id]) + isActive Boolean @default(true) + preOrders PreOrder[] } // ───────────────────────────────────────────────────────────────────────── @@ -175,18 +252,29 @@ model Workshop { // ───────────────────────────────────────────────────────────────────────── model Category { - id String @id @default(cuid()) - title String - parentId String? - parent Category? @relation("CategoryTree", fields: [parentId], references: [id]) - children Category[] @relation("CategoryTree") - products Product[] + id String @id @default(cuid()) + title String + /// Legacy Category.type — which storefront the category belongs to: + /// 1 سایت | 2 اپلیکشن موبایل. Drives the "type_str" grid column. + type Int @default(1) + /// Legacy Category.image / icon — the grid renders the image, the storefront the icon. + imageUrl String? + iconUrl String? + /// Legacy meta tag + description, used for SEO on the site categories. + metaTag String? + description String? + parentId String? + parent Category? @relation("CategoryTree", fields: [parentId], references: [id]) + children Category[] @relation("CategoryTree") + products Product[] + promotions Promotion[] } model Brand { - id String @id @default(cuid()) - title String - products Product[] + id String @id @default(cuid()) + title String + products Product[] + promotions Promotion[] } /// Curated product groupings — replaces legacy "Ciny/CinyProduct" (a tagging @@ -216,12 +304,19 @@ model Product { category Category? @relation(fields: [categoryId], references: [id]) brandId String? brand Brand? @relation(fields: [brandId], references: [id]) + /// Legacy Product.product_code — the human-facing SKU shown in the grid. + productCode String? @unique + /// Legacy Product.show_type: 1 site, 2 mobile, 3 both. + showType Int @default(3) isActive Boolean @default(true) createdAt DateTime @default(now()) - variants ProductVariant[] - images ProductImage[] - collections CollectionProduct[] + variants ProductVariant[] + images ProductImage[] + collections CollectionProduct[] + comments Comment[] + promotions Promotion[] + allocationItems BranchAllocationItem[] } model ProductImage { @@ -242,6 +337,12 @@ model ProductVariant { rashWeightGrams Decimal @db.Decimal(14, 4) /// Default making-charge percentage applied on top of rash weight. defaultWagePercent Decimal @db.Decimal(6, 3) + /// Legacy ProductVariant.qty — on-hand stock. The cart refuses a variant with + /// qty 0 unless it is flagged pre-order, so both fields are required for that + /// guard to work (see apps/admin-panel/src/stores/cart.ts). + qty Int @default(0) + /// Legacy is_pre_order: orderable even at zero stock. + isPreOrder Boolean @default(false) isActive Boolean @default(true) orderItems OrderItem[] @@ -252,13 +353,15 @@ model ProductVariant { // ───────────────────────────────────────────────────────────────────────── model Order { - id String @id @default(cuid()) - orderNumber String @unique + id String @id @default(cuid()) + orderNumber String @unique customerId String - customer Customer @relation(fields: [customerId], references: [id]) + customer Customer @relation(fields: [customerId], references: [id]) branchId String? - branch Branch? @relation(fields: [branchId], references: [id]) - status OrderStatus @default(PLACED) + branch Branch? @relation(fields: [branchId], references: [id]) + /// Which sales channel placed this order — see OrderChannel. + channel OrderChannel @default(RETAIL) + status OrderStatus @default(PLACED) /// Total gold weight incl. wage across all items ("allGram" / order.w). totalGoldWeightGrams Decimal @db.Decimal(14, 4) @@ -391,6 +494,22 @@ model LedgerEntry { postedByAdminUserId String? postedByAdminUser AdminUser? @relation(fields: [postedByAdminUserId], references: [id]) + /// Instrument metadata from the legacy "cash" document form. Which fields are + /// filled depends on sourceType: a melted-gold receipt carries lab/hallmark and + /// the pre-normalization weight, a cheque carries the account and bank, and a + /// transfer carries its destination. + /// Legacy columns: lab, ang, account_name, bank_name, to, original_value, recive_date. + labName String? + hallmark String? + accountName String? + bankName String? + transferTo String? + /// Weight as handed over, BEFORE karat normalization (legacy original_value). + originalValue Decimal? @db.Decimal(14, 4) + /// Rial amount for cash/cheque documents (legacy price). + priceRial Decimal? @db.Decimal(20, 2) + receivedAt DateTime? + note String? createdAt DateTime @default(now()) @@ -423,3 +542,316 @@ model WalletBonus { @@index([customerId, isActive]) } + +// ───────────────────────────────────────────────────────────────────────── +// Admin ACL — faithful port of the legacy granular permission model. +// +// Legacy (henza_server): +// Schema::create('permission', function (Blueprint $table) { +// $table->string('rid'); +// $table->integer('ut'); +// $table->primary(['rid' , 'ut']); +// }); +// +// Permissions attach to the USER TYPE (`ut`), never to an individual user, so +// every admin of a given type shares one permission set. `ut` pointed at a row +// in the legacy `config_static` lookup table; UserType is that table, narrowed +// to the admin-user-type rows it was actually used for. +// +// A `rid` is a dotted permission id such as "persons.list.client.omde". The +// frontend expands each stored rid into its ancestors at runtime via +// checkParent() — see apps/admin-panel/src/stores/users.ts. Only the 58 leaf +// rids the routers actually gate are seeded; ancestors are derived, not stored. +// ───────────────────────────────────────────────────────────────────────── + +model UserType { + /// Legacy `permission.ut` / `users.ut` — an integer, kept as the PK so seeded + /// rows keep their legacy identity rather than getting new cuids. + id Int @id + title String + isActive Boolean @default(true) + createdAt DateTime @default(now()) + + permissions Permission[] + adminUsers AdminUser[] + + @@map("user_type") +} + +model Permission { + /// Dotted permission id, e.g. "order.list", "persons.list.client.omde". + rid String + userTypeId Int + userType UserType @relation(fields: [userTypeId], references: [id], onDelete: Cascade) + + /// Legacy's composite primary key (rid, ut), preserved exactly. + @@id([rid, userTypeId]) + @@index([userTypeId]) + @@map("permission") +} + +// ───────────────────────────────────────────────────────────────────────── +// Product comments / reviews — legacy `comment` table (App\Models\Comment), +// moderated from views/customer/Comments/Comments.vue. +// +// Legacy fillable: product_id, comment, reply_to, sts, customer_id +// Legacy Comment::$STS = [1 => 'در انتظار تایید', 2 => 'تایید شده', 3 => 'رد شده'] +// which is represented here as an enum rather than a magic integer. +// ───────────────────────────────────────────────────────────────────────── + +enum CommentStatus { + PENDING // 1 — در انتظار تایید + APPROVED // 2 — تایید شده + REJECTED // 3 — رد شده +} + +model Comment { + id String @id @default(cuid()) + productId String + product Product @relation(fields: [productId], references: [id]) + customerId String + customer Customer @relation(fields: [customerId], references: [id]) + body String + status CommentStatus @default(PENDING) + + /// Legacy `reply_to`: a staff reply threads under the comment it answers. + replyToId String? + replyTo Comment? @relation("CommentReplies", fields: [replyToId], references: [id]) + replies Comment[] @relation("CommentReplies") + + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + @@index([productId]) + @@index([customerId]) + @@index([status]) +} + +// ───────────────────────────────────────────────────────────────────────── +// Settings — replaces legacy `config_static`, a key/value table the admin +// panel read and wrote through endpoints like /wallet/config and +// /const/__list__ut. Values are stored as JSON so a setting can hold a scalar, +// an object, or the dynamic option lists legacy kept under `__list__*` keys. +// ───────────────────────────────────────────────────────────────────────── + +model Setting { + key String @id + value Json + updatedAt DateTime @updatedAt +} + +// ───────────────────────────────────────────────────────────────────────── +// Promotions / discounts — legacy views/promotion/*, served by +// PromotionController (`product/variant/promotion`). The redesigned schema had +// no promotion concept at all; this models what the legacy forms actually +// collect. +// ───────────────────────────────────────────────────────────────────────── + +/// Legacy Promotion.type — what the discount is scoped to. +enum PromotionScope { + PRODUCT // 1 محصولات + CATEGORY // 2 دسته بندی + CUSTOMER // 3 مشتری + BRAND // 4 برند +} + +/// Legacy Promotion.use_only — how often a customer may redeem it. +enum PromotionUsage { + ONCE // 1 فقط یکبار + UNTIL_END_DATE // 2 تا تاریخ پایان +} + +model Promotion { + id String @id @default(cuid()) + title String + description String? + scope PromotionScope @default(PRODUCT) + usage PromotionUsage @default(ONCE) + /// Percentage off, 0-100 (legacy discount_percent). + discountPercent Decimal @db.Decimal(6, 3) + isActive Boolean @default(true) + /// Which storefront it shows on, mirroring Product.showType (legacy platform). + platform Int @default(3) + + startsAt DateTime? + endsAt DateTime? + + /// Exactly one of these is populated, per `scope`. + productId String? + product Product? @relation(fields: [productId], references: [id]) + categoryId String? + category Category? @relation(fields: [categoryId], references: [id]) + customerId String? + customer Customer? @relation(fields: [customerId], references: [id]) + brandId String? + brand Brand? @relation(fields: [brandId], references: [id]) + + createdAt DateTime @default(now()) + updatedAt DateTime @updatedAt + + @@index([scope, isActive]) +} + +/// Legacy "ignore" table (views/offersIgnore) — specific products, categories, +/// customers or brands excluded from the automatic discount engine. +/// Legacy posts { type, item_id[] }: "type" reuses the promotion scope codes +/// (1 محصولات | 2 دسته بندی | 3 مشتری | 4 برند) and "itemId" is the excluded row. +model PromotionExclusion { + id String @id @default(cuid()) + type Int + itemId String + createdAt DateTime @default(now()) + + @@unique([type, itemId]) + @@index([type]) +} + +// ───────────────────────────────────────────────────────────────────────── +// Branch stock allocation — legacy views/invoice/* ("فاکتور انتقال"), served by +// BranchController as `branch/product`. Despite the screen being called an +// invoice, it is not a sales document: it records which products head office +// allocated to a branch, and who allocated them. +// ───────────────────────────────────────────────────────────────────────── + +model BranchAllocation { + id String @id @default(cuid()) + branchId String + branch Branch @relation(fields: [branchId], references: [id]) + + /// Legacy `allocator_user` — the admin who filed the allocation. + allocatorAdminUserId String? + allocatorAdminUser AdminUser? @relation("AllocationAuthor", fields: [allocatorAdminUserId], references: [id]) + + note String? + createdAt DateTime @default(now()) + + items BranchAllocationItem[] + + @@index([branchId]) +} + +model BranchAllocationItem { + id String @id @default(cuid()) + allocationId String + allocation BranchAllocation @relation(fields: [allocationId], references: [id], onDelete: Cascade) + productId String + product Product @relation(fields: [productId], references: [id]) + /// Weight snapshot at allocation time, so later catalog edits do not rewrite history. + weightGrams Decimal? @db.Decimal(14, 4) + + @@unique([allocationId, productId]) +} + +// ───────────────────────────────────────────────────────────────────────── +// Messaging + audit — legacy views/sms, views/notify, views/newsletters and +// views/statics. None of these had a model in the redesigned schema. +// ───────────────────────────────────────────────────────────────────────── + +/// Who an SMS or notification was aimed at. Legacy's sms/create offered these +/// audiences, each gated by its own rid (sms.create.all, .omde, .single, ...). +enum MessageAudience { + SINGLE_NUMBER // یک شماره + MULTIPLE_NUMBERS // چند شماره + ALL_CUSTOMERS // همه + WHOLESALE_CUSTOMERS // عمده + RETAIL_CUSTOMERS // تک + SALES_AGENTS // کارشناسان فروش +} + +model SmsMessage { + id String @id @default(cuid()) + audience MessageAudience + /// Comma-separated recipients for the SINGLE/MULTIPLE audiences. + recipients String? + body String + /// How many numbers the send actually resolved to. + sentCount Int @default(0) + + sentByAdminUserId String? + sentByAdminUser AdminUser? @relation("SmsAuthor", fields: [sentByAdminUserId], references: [id]) + + createdAt DateTime @default(now()) + + @@index([createdAt]) +} + +model Notification { + id String @id @default(cuid()) + title String + body String + audience MessageAudience @default(ALL_CUSTOMERS) + + sentByAdminUserId String? + sentByAdminUser AdminUser? @relation("NotificationAuthor", fields: [sentByAdminUserId], references: [id]) + + createdAt DateTime @default(now()) + + recipients NotificationRecipient[] + + @@index([createdAt]) +} + +/// Per-customer delivery + read state — legacy `GET notify/read/{id}`. +model NotificationRecipient { + id String @id @default(cuid()) + notificationId String + notification Notification @relation(fields: [notificationId], references: [id], onDelete: Cascade) + customerId String + customer Customer @relation(fields: [customerId], references: [id]) + readAt DateTime? + + @@unique([notificationId, customerId]) + @@index([customerId, readAt]) +} + +/// Legacy views/newsletters — the mailing-list signups collected by the site. +model NewsletterSubscriber { + id String @id @default(cuid()) + email String? + mobile String? + createdAt DateTime @default(now()) + + @@unique([email]) + @@unique([mobile]) +} + +/// Legacy views/statics — the customer activity log the "آمار" screen reads +/// (`log/list/customer`, `log/ago/{customerId}`). +model CustomerActivityLog { + id String @id @default(cuid()) + customerId String + customer Customer @relation(fields: [customerId], references: [id]) + /// Free-form action key, e.g. 'login', 'order.placed', 'profile.updated'. + action String + detail String? + createdAt DateTime @default(now()) + + @@index([customerId, createdAt]) +} + +// ───────────────────────────────────────────────────────────────────────── +// Uploads — replaces the legacy MyUpload / SingleUploadInput widgets, which +// POSTed to a file endpoint and stored the returned URL on the owning record. +// Ports of those forms currently take a URL by hand; this gives them a real +// destination to upload to. +// ───────────────────────────────────────────────────────────────────────── + +model UploadedFile { + id String @id @default(cuid()) + /// Public URL the stored file is served from. + url String + originalName String + mimeType String + sizeBytes Int + /// Free-form tag for what the file belongs to, e.g. 'product', 'category', + /// 'customer.nationalId'. Kept loose so a new form needs no schema change. + purpose String? + + uploadedByAdminUserId String? + uploadedByAdminUser AdminUser? @relation("FileUploader", fields: [uploadedByAdminUserId], references: [id]) + + createdAt DateTime @default(now()) + customerAvatars Customer[] @relation("CustomerAvatar") + + @@index([purpose]) +} diff --git a/apps/api/release/vendor/.prisma/client/wasm.js b/apps/api/release/vendor/.prisma/client/wasm.js index 2152108..c9801a3 100644 --- a/apps/api/release/vendor/.prisma/client/wasm.js +++ b/apps/api/release/vendor/.prisma/client/wasm.js @@ -125,7 +125,9 @@ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({ exports.Prisma.CityScalarFieldEnum = { id: 'id', name: 'name', - province: 'province' + province: 'province', + percent: 'percent', + percentAux: 'percentAux' }; exports.Prisma.AdminUserScalarFieldEnum = { @@ -134,6 +136,7 @@ exports.Prisma.AdminUserScalarFieldEnum = { mobile: 'mobile', passwordHash: 'passwordHash', role: 'role', + userTypeId: 'userTypeId', branchId: 'branchId', wagePercent: 'wagePercent', isActive: 'isActive', @@ -147,6 +150,13 @@ exports.Prisma.CustomerScalarFieldEnum = { nationalCode: 'nationalCode', passwordHash: 'passwordHash', cityId: 'cityId', + kind: 'kind', + phone: 'phone', + address: 'address', + storeName: 'storeName', + pasazhName: 'pasazhName', + zone: 'zone', + memberCode: 'memberCode', referredByAgentId: 'referredByAgentId', goldCreditLimitGrams: 'goldCreditLimitGrams', goldDebtGrams: 'goldDebtGrams', @@ -155,7 +165,10 @@ exports.Prisma.CustomerScalarFieldEnum = { nationalIdImageUrl: 'nationalIdImageUrl', businessLicenseUrl: 'businessLicenseUrl', shopImageUrl: 'shopImageUrl', + avatarFileId: 'avatarFileId', + canPlaceOrders: 'canPlaceOrders', isActive: 'isActive', + isArchived: 'isArchived', createdAt: 'createdAt', updatedAt: 'updatedAt' }; @@ -171,18 +184,29 @@ exports.Prisma.CustomerAddressScalarFieldEnum = { exports.Prisma.BranchScalarFieldEnum = { id: 'id', name: 'name', + address: 'address', + phone: 'phone', + isActive: 'isActive', cityId: 'cityId' }; exports.Prisma.WorkshopScalarFieldEnum = { id: 'id', name: 'name', + address: 'address', + phone: 'phone', + supervisorId: 'supervisorId', isActive: 'isActive' }; exports.Prisma.CategoryScalarFieldEnum = { id: 'id', title: 'title', + type: 'type', + imageUrl: 'imageUrl', + iconUrl: 'iconUrl', + metaTag: 'metaTag', + description: 'description', parentId: 'parentId' }; @@ -209,6 +233,8 @@ exports.Prisma.ProductScalarFieldEnum = { description: 'description', categoryId: 'categoryId', brandId: 'brandId', + productCode: 'productCode', + showType: 'showType', isActive: 'isActive', createdAt: 'createdAt' }; @@ -227,6 +253,8 @@ exports.Prisma.ProductVariantScalarFieldEnum = { sku: 'sku', rashWeightGrams: 'rashWeightGrams', defaultWagePercent: 'defaultWagePercent', + qty: 'qty', + isPreOrder: 'isPreOrder', isActive: 'isActive' }; @@ -235,6 +263,7 @@ exports.Prisma.OrderScalarFieldEnum = { orderNumber: 'orderNumber', customerId: 'customerId', branchId: 'branchId', + channel: 'channel', status: 'status', totalGoldWeightGrams: 'totalGoldWeightGrams', wageWeightGrams: 'wageWeightGrams', @@ -308,6 +337,14 @@ exports.Prisma.LedgerEntryScalarFieldEnum = { confirmed: 'confirmed', confirmedAt: 'confirmedAt', postedByAdminUserId: 'postedByAdminUserId', + labName: 'labName', + hallmark: 'hallmark', + accountName: 'accountName', + bankName: 'bankName', + transferTo: 'transferTo', + originalValue: 'originalValue', + priceRial: 'priceRial', + receivedAt: 'receivedAt', note: 'note', createdAt: 'createdAt' }; @@ -331,6 +368,128 @@ exports.Prisma.WalletBonusScalarFieldEnum = { isActive: 'isActive' }; +exports.Prisma.UserTypeScalarFieldEnum = { + id: 'id', + title: 'title', + isActive: 'isActive', + createdAt: 'createdAt' +}; + +exports.Prisma.PermissionScalarFieldEnum = { + rid: 'rid', + userTypeId: 'userTypeId' +}; + +exports.Prisma.CommentScalarFieldEnum = { + id: 'id', + productId: 'productId', + customerId: 'customerId', + body: 'body', + status: 'status', + replyToId: 'replyToId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.SettingScalarFieldEnum = { + key: 'key', + value: 'value', + updatedAt: 'updatedAt' +}; + +exports.Prisma.PromotionScalarFieldEnum = { + id: 'id', + title: 'title', + description: 'description', + scope: 'scope', + usage: 'usage', + discountPercent: 'discountPercent', + isActive: 'isActive', + platform: 'platform', + startsAt: 'startsAt', + endsAt: 'endsAt', + productId: 'productId', + categoryId: 'categoryId', + customerId: 'customerId', + brandId: 'brandId', + createdAt: 'createdAt', + updatedAt: 'updatedAt' +}; + +exports.Prisma.PromotionExclusionScalarFieldEnum = { + id: 'id', + type: 'type', + itemId: 'itemId', + createdAt: 'createdAt' +}; + +exports.Prisma.BranchAllocationScalarFieldEnum = { + id: 'id', + branchId: 'branchId', + allocatorAdminUserId: 'allocatorAdminUserId', + note: 'note', + createdAt: 'createdAt' +}; + +exports.Prisma.BranchAllocationItemScalarFieldEnum = { + id: 'id', + allocationId: 'allocationId', + productId: 'productId', + weightGrams: 'weightGrams' +}; + +exports.Prisma.SmsMessageScalarFieldEnum = { + id: 'id', + audience: 'audience', + recipients: 'recipients', + body: 'body', + sentCount: 'sentCount', + sentByAdminUserId: 'sentByAdminUserId', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationScalarFieldEnum = { + id: 'id', + title: 'title', + body: 'body', + audience: 'audience', + sentByAdminUserId: 'sentByAdminUserId', + createdAt: 'createdAt' +}; + +exports.Prisma.NotificationRecipientScalarFieldEnum = { + id: 'id', + notificationId: 'notificationId', + customerId: 'customerId', + readAt: 'readAt' +}; + +exports.Prisma.NewsletterSubscriberScalarFieldEnum = { + id: 'id', + email: 'email', + mobile: 'mobile', + createdAt: 'createdAt' +}; + +exports.Prisma.CustomerActivityLogScalarFieldEnum = { + id: 'id', + customerId: 'customerId', + action: 'action', + detail: 'detail', + createdAt: 'createdAt' +}; + +exports.Prisma.UploadedFileScalarFieldEnum = { + id: 'id', + url: 'url', + originalName: 'originalName', + mimeType: 'mimeType', + sizeBytes: 'sizeBytes', + purpose: 'purpose', + uploadedByAdminUserId: 'uploadedByAdminUserId', + createdAt: 'createdAt' +}; + exports.Prisma.SortOrder = { asc: 'asc', desc: 'desc' @@ -363,6 +522,14 @@ exports.AdminRole = exports.$Enums.AdminRole = { ACCOUNTANT: 'ACCOUNTANT' }; +exports.CustomerKind = exports.$Enums.CustomerKind = { + SALES_AGENT: 'SALES_AGENT', + APP_SHOPKEEPER: 'APP_SHOPKEEPER', + WALK_IN_SHOPKEEPER: 'WALK_IN_SHOPKEEPER', + BANKER: 'BANKER', + WORKSHOP_SUPERVISOR: 'WORKSHOP_SUPERVISOR' +}; + exports.VerificationStep = exports.$Enums.VerificationStep = { UNVERIFIED: 'UNVERIFIED', STEP_ONE_SUBMITTED: 'STEP_ONE_SUBMITTED', @@ -370,6 +537,11 @@ exports.VerificationStep = exports.$Enums.VerificationStep = { VERIFIED: 'VERIFIED' }; +exports.OrderChannel = exports.$Enums.OrderChannel = { + RETAIL: 'RETAIL', + WHOLESALE: 'WHOLESALE' +}; + exports.OrderStatus = exports.$Enums.OrderStatus = { SUSPENDED: 'SUSPENDED', PLACED: 'PLACED', @@ -411,6 +583,33 @@ exports.LedgerSourceType = exports.$Enums.LedgerSourceType = { ADJUSTMENT: 'ADJUSTMENT' }; +exports.CommentStatus = exports.$Enums.CommentStatus = { + PENDING: 'PENDING', + APPROVED: 'APPROVED', + REJECTED: 'REJECTED' +}; + +exports.PromotionScope = exports.$Enums.PromotionScope = { + PRODUCT: 'PRODUCT', + CATEGORY: 'CATEGORY', + CUSTOMER: 'CUSTOMER', + BRAND: 'BRAND' +}; + +exports.PromotionUsage = exports.$Enums.PromotionUsage = { + ONCE: 'ONCE', + UNTIL_END_DATE: 'UNTIL_END_DATE' +}; + +exports.MessageAudience = exports.$Enums.MessageAudience = { + SINGLE_NUMBER: 'SINGLE_NUMBER', + MULTIPLE_NUMBERS: 'MULTIPLE_NUMBERS', + ALL_CUSTOMERS: 'ALL_CUSTOMERS', + WHOLESALE_CUSTOMERS: 'WHOLESALE_CUSTOMERS', + RETAIL_CUSTOMERS: 'RETAIL_CUSTOMERS', + SALES_AGENTS: 'SALES_AGENTS' +}; + exports.Prisma.ModelName = { City: 'City', AdminUser: 'AdminUser', @@ -432,7 +631,21 @@ exports.Prisma.ModelName = { PreOrderStatusEvent: 'PreOrderStatusEvent', LedgerEntry: 'LedgerEntry', GoldPriceQuote: 'GoldPriceQuote', - WalletBonus: 'WalletBonus' + WalletBonus: 'WalletBonus', + UserType: 'UserType', + Permission: 'Permission', + Comment: 'Comment', + Setting: 'Setting', + Promotion: 'Promotion', + PromotionExclusion: 'PromotionExclusion', + BranchAllocation: 'BranchAllocation', + BranchAllocationItem: 'BranchAllocationItem', + SmsMessage: 'SmsMessage', + Notification: 'Notification', + NotificationRecipient: 'NotificationRecipient', + NewsletterSubscriber: 'NewsletterSubscriber', + CustomerActivityLog: 'CustomerActivityLog', + UploadedFile: 'UploadedFile' }; /** diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index f0624fe..c1b8a5d 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -2,11 +2,19 @@ import 'reflect-metadata'; import { NestFactory } from '@nestjs/core'; import { ValidationPipe } from '@nestjs/common'; import { NestExpressApplication } from '@nestjs/platform-express'; -import { join } from 'node:path'; +import { extname, join } from 'node:path'; +import type { Response } from 'express'; import { AppModule } from './app.module'; import { prepareDatabase } from './prisma/bootstrap'; import { PrismaExceptionFilter } from './prisma/prisma-exception.filter'; +// serve-static's bundled `mime` version predates .avif, so it falls back to +// application/octet-stream — browsers still render the image (they sniff +// content), but a strict client or an <img> under some CSPs would not. +const EXTRA_MIME_TYPES: Record<string, string> = { + '.avif': 'image/avif', +}; + async function bootstrap() { await prepareDatabase(); @@ -21,6 +29,10 @@ async function bootstrap() { prefix: '/uploads/', index: false, dotfiles: 'deny', + setHeaders: (res: Response, path: string) => { + const mime = EXTRA_MIME_TYPES[extname(path).toLowerCase()]; + if (mime) res.setHeader('Content-Type', mime); + }, }); // Bind all interfaces explicitly so the container is reachable from nginx. await app.listen(process.env.PORT ?? 3000, '0.0.0.0'); diff --git a/apps/api/src/prisma/migrate.ts b/apps/api/src/prisma/migrate.ts index 88ba531..7e0429d 100644 --- a/apps/api/src/prisma/migrate.ts +++ b/apps/api/src/prisma/migrate.ts @@ -1,4 +1,4 @@ -import { existsSync, readdirSync, readFileSync } from 'fs'; +import { existsSync, readdirSync, readFileSync, statSync } from 'fs'; import { join } from 'path'; import { PrismaClient } from '@prisma/client'; @@ -105,11 +105,48 @@ export function splitSqlStatements(sql: string): string[] { return statements; } +/** + * Bug fixed here (was silently a no-op): this used to only look for flat + * `<name>.sql` files directly under prisma/migrations. Prisma's own CLI + * (`prisma migrate dev`) creates a FOLDER per migration instead + * (`<timestamp>_<name>/migration.sql`), which `readdirSync(...).filter(name + * => name.endsWith('.sql'))` never matches — a directory name doesn't end in + * ".sql". Every migration created the normal way was silently skipped; only + * a hand-added flat duplicate (prisma/migrations/0001_init.sql, now removed) + * ever ran. Both layouts are now discovered, sorted together by name so + * later migrations still apply after earlier ones regardless of shape. + */ +type MigrationFile = { name: string; path: string }; + +function discoverMigrationFiles(dir: string): MigrationFile[] { + const entries = readdirSync(dir); + const files: MigrationFile[] = []; + + for (const entry of entries) { + const full = join(dir, entry); + const stat = statSync(full); + + if (stat.isFile() && entry.endsWith('.sql')) { + files.push({ name: entry, path: full }); + continue; + } + + if (stat.isDirectory()) { + const sqlPath = join(full, 'migration.sql'); + if (existsSync(sqlPath)) { + // Tracked by the folder name (e.g. "20260910113720_first"), matching + // how Prisma's own _prisma_migrations table identifies a migration. + files.push({ name: entry, path: sqlPath }); + } + } + } + + return files.sort((a, b) => a.name.localeCompare(b.name)); +} + export async function runMigrations(prisma: PrismaClient): Promise<MigrationResult> { const dir = resolveMigrationsDir(); - const files = readdirSync(dir) - .filter((name) => name.endsWith('.sql')) - .sort(); + const files = discoverMigrationFiles(dir); const trackingExisted = await prisma.$queryRawUnsafe<{ exists: boolean }[]>( `SELECT EXISTS ( @@ -134,9 +171,9 @@ export async function runMigrations(prisma: PrismaClient): Promise<MigrationResu const applied: string[] = []; for (const file of files) { - if (appliedNames.has(file)) continue; + if (appliedNames.has(file.name)) continue; - const statements = splitSqlStatements(readFileSync(join(dir, file), 'utf8')); + const statements = splitSqlStatements(readFileSync(file.path, 'utf8')); await prisma.$transaction( async (tx) => { for (const statement of statements) { @@ -144,14 +181,14 @@ export async function runMigrations(prisma: PrismaClient): Promise<MigrationResu } await tx.$executeRawUnsafe( `INSERT INTO "${TRACKING_TABLE}" (name) VALUES ($1)`, - file, + file.name, ); }, // The baseline migration is hundreds of DDL statements; the 5s default is // not enough, especially against a remote database. { maxWait: 60_000, timeout: 600_000 }, ); - applied.push(file); + applied.push(file.name); } return { freshDatabase, applied }; diff --git a/docker-compose.yml b/docker-compose.yml index 7ff1e68..3b4a5c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -34,6 +34,12 @@ services: # No host ports — Dokploy/Traefik routes by domain to container port 3000 expose: - "3000" + # Uploaded files (product images, etc.) land in storage/uploads inside the + # container. Without a volume they vanish on every recreate/redeploy, and + # every UploadedFile/ProductImage row created before that would then point + # at a URL that 404s. + volumes: + - api_uploads:/app/storage/uploads restart: unless-stopped # The bare name "api" is ambiguous on Dokploy's shared network (other stacks # register it too), which made nginx dial the wrong containers. Use a unique alias. @@ -68,3 +74,4 @@ services: volumes: postgres_data: + api_uploads: