From b05048e62f5e43a3406dd1b9569d11f109689709 Mon Sep 17 00:00:00 2001 From: ahasani194 Date: Mon, 5 Jan 2026 18:35:08 +0330 Subject: [PATCH] feat(bank-accounts): add transaction retrieval and update service logic - Implemented a new endpoint to fetch transactions for a specific bank account. - Refactored the bank account service to streamline transaction handling and balance calculations. - Removed the bank account balance table and adjusted related logic in workflows and services. - Enhanced transaction mapping to include references to sales and purchase records. --- .../20260105090450_init/migration.sql | 11 + prisma/schema/bank.prisma | 11 - src/generated/prisma/browser.ts | 5 - src/generated/prisma/client.ts | 5 - src/generated/prisma/internal/class.ts | 14 +- .../prisma/internal/prismaNamespace.ts | 79 +- .../prisma/internal/prismaNamespaceBrowser.ts | 10 - src/generated/prisma/models.ts | 1 - src/generated/prisma/models/BankAccount.ts | 148 -- .../prisma/models/BankAccountBalance.ts | 1195 ----------------- .../bank-accounts/bank-accounts.controller.ts | 5 + .../bank-accounts/bank-accounts.service.ts | 157 ++- .../bank-accounts/bank-accounts.workflow.ts | 30 +- .../inventories/index/inventories.service.ts | 1 - 14 files changed, 147 insertions(+), 1525 deletions(-) create mode 100644 prisma/migrations/20260105090450_init/migration.sql delete mode 100644 src/generated/prisma/models/BankAccountBalance.ts diff --git a/prisma/migrations/20260105090450_init/migration.sql b/prisma/migrations/20260105090450_init/migration.sql new file mode 100644 index 0000000..7acc048 --- /dev/null +++ b/prisma/migrations/20260105090450_init/migration.sql @@ -0,0 +1,11 @@ +/* + Warnings: + + - You are about to drop the `Bank_Account_Balance` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropForeignKey +ALTER TABLE `Bank_Account_Balance` DROP FOREIGN KEY `Bank_Account_Balance_bankAccountId_fkey`; + +-- DropTable +DROP TABLE `Bank_Account_Balance`; diff --git a/prisma/schema/bank.prisma b/prisma/schema/bank.prisma index c2dba7a..d98d5ac 100644 --- a/prisma/schema/bank.prisma +++ b/prisma/schema/bank.prisma @@ -29,7 +29,6 @@ model BankAccount { inventoryBankAccounts InventoryBankAccount[] purchaseReceiptPayments PurchaseReceiptPayments[] bankAccountTransactions BankAccountTransaction[] - bankAccountBalances BankAccountBalance[] @@map("Bank_Accounts") } @@ -50,13 +49,3 @@ model BankAccountTransaction { @@index([bankAccountId]) @@map("Bank_Account_Transactions") } - -model BankAccountBalance { - bankAccountId Int @unique - balance Decimal @db.Decimal(15, 2) - updatedAt DateTime @updatedAt @db.Timestamp(0) - - bankAccount BankAccount @relation(fields: [bankAccountId], references: [id]) - - @@map("Bank_Account_Balance") -} diff --git a/src/generated/prisma/browser.ts b/src/generated/prisma/browser.ts index 9b97edd..c2576ff 100644 --- a/src/generated/prisma/browser.ts +++ b/src/generated/prisma/browser.ts @@ -52,11 +52,6 @@ export type BankAccount = Prisma.BankAccountModel * */ export type BankAccountTransaction = Prisma.BankAccountTransactionModel -/** - * Model BankAccountBalance - * - */ -export type BankAccountBalance = Prisma.BankAccountBalanceModel /** * Model Inventory * diff --git a/src/generated/prisma/client.ts b/src/generated/prisma/client.ts index 94636e4..f0be311 100644 --- a/src/generated/prisma/client.ts +++ b/src/generated/prisma/client.ts @@ -72,11 +72,6 @@ export type BankAccount = Prisma.BankAccountModel * */ export type BankAccountTransaction = Prisma.BankAccountTransactionModel -/** - * Model BankAccountBalance - * - */ -export type BankAccountBalance = Prisma.BankAccountBalanceModel /** * Model Inventory * diff --git a/src/generated/prisma/internal/class.ts b/src/generated/prisma/internal/class.ts index c1eaf37..81f4b0b 100644 --- a/src/generated/prisma/internal/class.ts +++ b/src/generated/prisma/internal/class.ts @@ -20,7 +20,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.2.0", "engineVersion": "0c8ef2ce45c83248ab3df073180d5eda9e8be7a3", "activeProvider": "mysql", - "inlineSchema": "model User {\n id Int @id @default(autoincrement())\n mobileNumber String @unique @db.Char(11)\n password String\n firstName String\n lastName String\n roleId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n refreshTokens RefreshToken[]\n role Role @relation(\"User_Role\", fields: [roleId], references: [id], onUpdate: NoAction)\n\n @@index([roleId], map: \"Users_roleId_fkey\")\n @@map(\"Users\")\n}\n\nmodel Role {\n id Int @id @default(autoincrement())\n name String @unique @db.VarChar(100)\n description String? @db.Text\n permissions Json?\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n users User[] @relation(\"User_Role\")\n\n @@map(\"Roles\")\n}\n\nmodel OtpCode {\n id Int @id @default(autoincrement())\n mobileNumber String @db.VarChar(20)\n code String @db.VarChar(10)\n used Boolean @default(false)\n expiresAt DateTime @db.Timestamp(0)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n @@index([mobileNumber])\n @@map(\"Otp_Codes\")\n}\n\nmodel RefreshToken {\n id Int @id @default(autoincrement())\n tokenHash String @db.VarChar(255)\n userId Int\n revoked Boolean @default(false)\n expiresAt DateTime @db.Timestamp(0)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n user User @relation(fields: [userId], references: [id])\n\n @@index([userId])\n @@map(\"Refresh_Tokens\")\n}\n\nmodel BankBranch {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n code String @unique() @db.VarChar(10)\n address String? @db.VarChar(500)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n bankId Int\n\n bank Bank @relation(\"bank_branches\", fields: [bankId], references: [id])\n bankAccounts BankAccount[] @relation(\"Bank_Accounts_branchId_fkey\")\n\n @@map(\"Bank_Branches\")\n}\n\nmodel BankAccount {\n id Int @id @default(autoincrement())\n accountNumber String? @unique @db.VarChar(20)\n cardNumber String? @unique @db.VarChar(16)\n name String @db.VarChar(255)\n iban String? @unique @db.VarChar(34)\n branchId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n branch BankBranch @relation(\"Bank_Accounts_branchId_fkey\", fields: [branchId], references: [id])\n inventoryBankAccounts InventoryBankAccount[]\n purchaseReceiptPayments PurchaseReceiptPayments[]\n bankAccountTransactions BankAccountTransaction[]\n bankAccountBalances BankAccountBalance[]\n\n @@map(\"Bank_Accounts\")\n}\n\nmodel BankAccountTransaction {\n id Int @id @default(autoincrement())\n bankAccountId Int\n type BankAccountTransactionType\n amount Decimal @db.Decimal(15, 2)\n balanceAfter Decimal @db.Decimal(15, 2)\n referenceId Int\n referenceType BankTransactionRefType\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])\n\n @@index([bankAccountId])\n @@map(\"Bank_Account_Transactions\")\n}\n\nmodel BankAccountBalance {\n bankAccountId Int @unique\n balance Decimal @db.Decimal(15, 2)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n\n bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])\n\n @@map(\"Bank_Account_Balance\")\n}\n\nenum OrderStatus {\n PENDING\n REJECTED\n CANCELED\n DONE\n}\n\nenum MovementType {\n IN\n OUT\n ADJUST\n}\n\nenum MovementReferenceType {\n PURCHASE\n SALES\n ADJUSTMENT\n INVENTORY_TRANSFER\n}\n\nenum PaymentMethodType {\n CASH\n CARD\n BANK\n CHECK\n OTHER\n}\n\nenum LedgerSourceType {\n PURCHASE\n PAYMENT\n ADJUSTMENT\n REFUND\n}\n\nenum PaymentType {\n PAYMENT\n REFUND\n}\n\nenum PurchaseReceiptStatus {\n UNPAID\n PARTIALLY_PAID\n PAID\n}\n\nenum BankAccountTransactionType {\n DEPOSIT\n WITHDRAWAL\n}\n\nenum BankTransactionRefType {\n PURCHASE_PAYMENT\n PURCHASE_REFUND\n POS_SALE\n POS_REFUND\n BANK_TRANSFER\n MANUAL_ADJUSTMENT\n}\n\nmodel Inventory {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n location String? @db.VarChar(255)\n isActive Boolean @default(true)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n isPointOfSale Boolean @default(false)\n inventoryTransfersFrom InventoryTransfer[] @relation(\"Inventory_From\")\n inventoryTransfersTo InventoryTransfer[] @relation(\"Inventory_To\")\n purchaseReceipts PurchaseReceipt[]\n stockAdjustments StockAdjustment[] @relation(\"Inventory_Stock_Adjustments\")\n stockBalances StockBalance[] @relation(\"StockBalance_inventory\")\n counterStockMovements StockMovement[] @relation(\"StockMovement_CounterInventory\")\n stockMovements StockMovement[] @relation(\"StockMovement_Inventory\")\n inventoryBankAccounts InventoryBankAccount[]\n stockReservations StockReservation[]\n\n @@map(\"Inventories\")\n}\n\nmodel InventoryBankAccount {\n inventoryId Int\n bankAccountId Int\n\n inventory Inventory @relation(fields: [inventoryId], references: [id])\n bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])\n posAccounts PosAccount[]\n purchaseReceiptPayments PurchaseReceiptPayments[]\n\n @@id([inventoryId, bankAccountId])\n @@index([bankAccountId])\n @@map(\"Inventory_Bank_Accounts\")\n}\n\nmodel PosAccount {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n code String @unique() @db.VarChar(10)\n description String? @db.VarChar(500)\n bankAccountId Int\n inventoryId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n inventoryBankAccount InventoryBankAccount @relation(fields: [inventoryId, bankAccountId], references: [inventoryId, bankAccountId])\n salesInvoices SalesInvoice[]\n\n @@index([inventoryId])\n @@map(\"Pos_Accounts\")\n}\n\nmodel InventoryTransfer {\n id Int @id @default(autoincrement())\n code String @unique @db.VarChar(100)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n fromInventoryId Int\n toInventoryId Int\n items InventoryTransferItem[] @relation(\"InventoryTransfer_Items\")\n fromInventory Inventory @relation(\"Inventory_From\", fields: [fromInventoryId], references: [id])\n toInventory Inventory @relation(\"Inventory_To\", fields: [toInventoryId], references: [id])\n\n @@index([fromInventoryId], map: \"Inventory_Transfers_fromInventoryId_fkey\")\n @@index([toInventoryId], map: \"Inventory_Transfers_toInventoryId_fkey\")\n @@map(\"Inventory_Transfers\")\n}\n\nmodel InventoryTransferItem {\n id Int @id @default(autoincrement())\n count Decimal @db.Decimal(10, 0)\n productId Int\n transferId Int\n product Product @relation(\"InventoryTransferItem_Product\", fields: [productId], references: [id])\n transfer InventoryTransfer @relation(\"InventoryTransfer_Items\", fields: [transferId], references: [id])\n\n @@index([productId], map: \"Inventory_Transfer_Items_productId_fkey\")\n @@index([transferId], map: \"Inventory_Transfer_Items_transferId_fkey\")\n @@map(\"Inventory_Transfer_Items\")\n}\n\nmodel Bank {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n shortName String @unique() @db.VarChar(3)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n bankBranches BankBranch[] @relation(\"bank_branches\")\n\n @@map(\"Banks\")\n}\n\nmodel Order {\n id Int @id @default(autoincrement())\n orderNumber String @unique @db.VarChar(100)\n status OrderStatus @default(PENDING)\n totalAmount Decimal @db.Decimal(15, 2)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n customerId Int?\n customer Customer? @relation(fields: [customerId], references: [id], onUpdate: NoAction)\n orderItems OrderItem[]\n\n @@index([customerId])\n @@map(\"Orders\")\n}\n\nmodel OrderItem {\n id Int @id @default(autoincrement())\n quantity Decimal @db.Decimal(10, 0)\n unitPrice Decimal @db.Decimal(15, 2)\n totalAmount Decimal @db.Decimal(15, 2)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n orderId Int\n productId Int\n\n order Order @relation(fields: [orderId], references: [id], onUpdate: NoAction)\n product Product @relation(fields: [productId], references: [id], onUpdate: NoAction)\n\n @@index([orderId])\n @@index([productId])\n @@map(\"Order_Items\")\n}\n\nmodel Customer {\n id Int @id @default(autoincrement())\n firstName String @db.VarChar(255)\n lastName String @db.VarChar(255)\n email String? @db.VarChar(255)\n mobileNumber String @unique @db.Char(11)\n address String? @db.Text\n city String? @db.VarChar(100)\n state String? @db.VarChar(100)\n country String? @db.VarChar(100)\n isActive Boolean @default(true)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n orders Order[] @relation()\n stockMovements StockMovement[] @relation()\n salesInvoices SalesInvoice[]\n\n @@map(\"Customers\")\n}\n\nmodel TriggerLog {\n id Int @id @default(autoincrement())\n message String @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n name String @db.Text\n\n @@map(\"Trigger_Logs\")\n}\n\nmodel ProductVariant {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n basePrice Decimal @db.Decimal(15, 2)\n salePrice Decimal @db.Decimal(15, 2)\n description String? @db.Text\n barcode String? @unique() @db.VarChar(100)\n imageUrl String? @db.VarChar(255)\n unit String? @db.VarChar(10)\n quantity Decimal? @default(0.00) @db.Decimal(10, 0)\n alertQuantity Decimal? @default(5.00) @db.Decimal(10, 0)\n isActive Boolean @default(true)\n isFeatured Boolean @default(false)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n productId Int\n product Product @relation(\"Product_Variant\", fields: [productId], references: [id], onUpdate: NoAction)\n\n @@index([productId], map: \"Product_Variants_productId_fkey\")\n @@map(\"Product_Variants\")\n}\n\nmodel Product {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n brandId Int?\n categoryId Int?\n salePrice Decimal @default(0.00) @db.Decimal(15, 0)\n minimumStockAlertLevel Decimal @default(1.00) @db.Decimal(10, 0)\n inventoryTransferItems InventoryTransferItem[] @relation(\"InventoryTransferItem_Product\")\n variants ProductVariant[] @relation(\"Product_Variant\")\n brand ProductBrand? @relation(\"Product_Brand\", fields: [brandId], references: [id], onUpdate: NoAction)\n category ProductCategory? @relation(\"Product_Category\", fields: [categoryId], references: [id], onUpdate: NoAction)\n purchaseReceiptItems PurchaseReceiptItem[] @relation(\"Product_PurchaseReceiptItems\")\n stockAdjustments StockAdjustment[] @relation(\"Product_Stock_Adjustments\")\n stockBalances StockBalance[] @relation(\"StockBalance_Product\")\n stockMovements StockMovement[] @relation(\"StockMovement_Product\")\n salesInvoiceItems SalesInvoiceItem[]\n stockReservations StockReservation[]\n orderItems OrderItem[]\n\n @@index([brandId], map: \"Products_brandId_fkey\")\n @@index([categoryId], map: \"Products_categoryId_fkey\")\n @@map(\"Products\")\n}\n\nmodel ProductBrand {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n imageUrl String? @db.VarChar(255)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n products Product[] @relation(\"Product_Brand\")\n\n @@map(\"Product_brands\")\n}\n\nmodel ProductCategory {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n imageUrl String? @db.VarChar(255)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n products Product[] @relation(\"Product_Category\")\n\n @@map(\"Product_categories\")\n}\n\nmodel PurchaseReceipt {\n id Int @id @default(autoincrement())\n code String @unique @db.VarChar(100)\n totalAmount Decimal @db.Decimal(15, 2)\n paidAmount Decimal @default(0.00) @db.Decimal(15, 2)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n status PurchaseReceiptStatus @default(UNPAID)\n supplierId Int\n inventoryId Int\n items PurchaseReceiptItem[] @relation(\"PurchaseReceipt_Items\")\n inventory Inventory @relation(fields: [inventoryId], references: [id])\n supplier Supplier @relation(fields: [supplierId], references: [id])\n payments PurchaseReceiptPayments[]\n\n @@index([inventoryId], map: \"Purchase_Receipts_inventoryId_fkey\")\n @@index([supplierId], map: \"Purchase_Receipts_supplierId_fkey\")\n @@map(\"Purchase_Receipts\")\n}\n\nmodel PurchaseReceiptItem {\n id Int @id @default(autoincrement())\n count Decimal @db.Decimal(10, 0)\n unitPrice Decimal @db.Decimal(15, 2)\n totalAmount Decimal @db.Decimal(15, 2)\n receiptId Int\n productId Int\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n product Product @relation(\"Product_PurchaseReceiptItems\", fields: [productId], references: [id])\n receipt PurchaseReceipt @relation(\"PurchaseReceipt_Items\", fields: [receiptId], references: [id])\n\n @@index([productId], map: \"Purchase_Receipt_Items_productId_fkey\")\n @@index([receiptId], map: \"Purchase_Receipt_Items_receiptId_fkey\")\n @@map(\"Purchase_Receipt_Items\")\n}\n\nmodel PurchaseReceiptPayments {\n id Int @id @default(autoincrement())\n amount Decimal @db.Decimal(15, 2)\n paymentMethod PaymentMethodType\n type PaymentType\n bankAccountId Int\n receiptId Int\n payedAt DateTime @db.Timestamp(0)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n receipt PurchaseReceipt @relation(fields: [receiptId], references: [id])\n bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])\n inventoryBankAccount InventoryBankAccount? @relation(fields: [inventoryBankAccountInventoryId, inventoryBankAccountBankAccountId], references: [inventoryId, bankAccountId])\n inventoryBankAccountInventoryId Int?\n inventoryBankAccountBankAccountId Int?\n\n @@index([receiptId], map: \"Purchase_Receipt_Payments_receiptId_fkey\")\n @@map(\"Purchase_Receipt_Payments\")\n}\n\nmodel SalesInvoice {\n id Int @id @default(autoincrement())\n code String @unique @db.VarChar(100)\n totalAmount Decimal @db.Decimal(15, 2)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n customerId Int?\n posAccountId Int\n customer Customer? @relation(fields: [customerId], references: [id])\n posAccount PosAccount @relation(fields: [posAccountId], references: [id])\n items SalesInvoiceItem[]\n salesInvoicePayments SalesInvoicePayment[]\n\n @@index([customerId])\n @@index([posAccountId])\n @@map(\"Sales_Invoices\")\n}\n\nmodel SalesInvoiceItem {\n id Int @id @default(autoincrement())\n count Decimal @db.Decimal(10, 0)\n unitPrice Decimal @default(0.00) @db.Decimal(15, 2)\n totalAmount Decimal @default(0.00) @db.Decimal(15, 2)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n invoiceId Int\n productId Int\n invoice SalesInvoice @relation(fields: [invoiceId], references: [id])\n product Product @relation(fields: [productId], references: [id])\n\n @@index([invoiceId])\n @@index([productId])\n @@map(\"Sales_Invoice_Items\")\n}\n\nmodel SalesInvoicePayment {\n id Int @id @default(autoincrement())\n invoiceId Int\n amount Decimal @db.Decimal(15, 2)\n paymentMethod PaymentMethodType\n paidAt DateTime\n createdAt DateTime @default(now())\n\n invoice SalesInvoice @relation(fields: [invoiceId], references: [id])\n\n @@index([invoiceId])\n @@map(\"Sales_Invoice_Payments\")\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../../src/generated/prisma\"\n moduleFormat = \"cjs\"\n}\n\ndatasource db {\n provider = \"mysql\"\n}\n\nmodel StockMovement {\n id Int @id @default(autoincrement())\n type MovementType\n quantity Decimal @db.Decimal(10, 0)\n unitPrice Decimal @db.Decimal(15, 2)\n totalCost Decimal @db.Decimal(15, 2)\n referenceType MovementReferenceType\n referenceId String\n createdAt DateTime @default(now()) @db.Timestamp(0)\n productId Int\n inventoryId Int\n avgCost Decimal @db.Decimal(15, 2)\n supplierId Int?\n remainedInStock Decimal @default(0.00) @db.Decimal(10, 0)\n counterInventoryId Int?\n customerId Int?\n counterInventory Inventory? @relation(\"StockMovement_CounterInventory\", fields: [counterInventoryId], references: [id])\n customer Customer? @relation(fields: [customerId], references: [id])\n inventory Inventory @relation(\"StockMovement_Inventory\", fields: [inventoryId], references: [id])\n product Product @relation(\"StockMovement_Product\", fields: [productId], references: [id])\n supplier Supplier? @relation(\"StockMovement_Supplier\", fields: [supplierId], references: [id])\n\n @@index([inventoryId], map: \"Stock_Movements_inventoryId_fkey\")\n @@index([productId], map: \"Stock_Movements_productId_fkey\")\n @@index([counterInventoryId], map: \"Stock_Movements_counterInventoryId_fkey\")\n @@index([customerId], map: \"Stock_Movements_customerId_fkey\")\n @@index([supplierId], map: \"Stock_Movements_supplierId_fkey\")\n @@map(\"Stock_Movements\")\n}\n\nmodel StockBalance {\n quantity Decimal @default(0.000) @db.Decimal(14, 3)\n totalCost Decimal @default(0.00) @db.Decimal(14, 2)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n avgCost Decimal @default(0.00) @db.Decimal(14, 2)\n inventoryId Int\n productId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n id Int @id @default(autoincrement())\n inventory Inventory @relation(\"StockBalance_inventory\", fields: [inventoryId], references: [id])\n product Product @relation(\"StockBalance_Product\", fields: [productId], references: [id])\n\n @@unique([productId, inventoryId])\n @@index([productId])\n @@index([inventoryId])\n @@map(\"Stock_Balance\")\n}\n\nmodel StockAdjustment {\n id Int @id @default(autoincrement())\n adjustedQuantity Decimal @db.Decimal(10, 0)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n productId Int\n inventoryId Int\n inventory Inventory @relation(\"Inventory_Stock_Adjustments\", fields: [inventoryId], references: [id])\n product Product @relation(\"Product_Stock_Adjustments\", fields: [productId], references: [id])\n\n @@index([inventoryId], map: \"Stock_Adjustments_inventoryId_fkey\")\n @@index([productId], map: \"Stock_Adjustments_productId_fkey\")\n @@map(\"Stock_Adjustments\")\n}\n\nmodel StockReservation {\n id Int @id @default(autoincrement())\n quantity Decimal @db.Decimal(10, 0)\n expiresAt DateTime @db.Timestamp(0)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n productId Int\n inventoryId Int\n orderId Int\n inventory Inventory @relation(fields: [inventoryId], references: [id])\n product Product @relation(fields: [productId], references: [id])\n\n @@index([inventoryId])\n @@index([productId])\n @@map(\"Stock_Reservations\")\n}\n\nmodel Supplier {\n id Int @id @default(autoincrement())\n firstName String @db.VarChar(255)\n lastName String @db.VarChar(255)\n email String? @db.VarChar(255)\n mobileNumber String @unique @db.Char(11)\n address String? @db.Text\n city String? @db.VarChar(100)\n state String? @db.VarChar(100)\n country String? @db.VarChar(100)\n isActive Boolean @default(true)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n stockMovements StockMovement[] @relation(\"StockMovement_Supplier\")\n receipts PurchaseReceipt[]\n ledger SupplierLedger[]\n\n @@map(\"Suppliers\")\n}\n\nmodel SupplierLedger {\n id Int @id @default(autoincrement())\n description String? @db.Text\n debit Decimal @default(0) @db.Decimal(15, 2)\n credit Decimal @default(0) @db.Decimal(15, 2)\n balance Decimal @db.Decimal(15, 2)\n sourceType LedgerSourceType\n sourceId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n supplierId Int\n supplier Supplier @relation(fields: [supplierId], references: [id])\n\n @@index([supplierId])\n @@map(\"Supplier_Ledger\")\n}\n", + "inlineSchema": "model User {\n id Int @id @default(autoincrement())\n mobileNumber String @unique @db.Char(11)\n password String\n firstName String\n lastName String\n roleId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n refreshTokens RefreshToken[]\n role Role @relation(\"User_Role\", fields: [roleId], references: [id], onUpdate: NoAction)\n\n @@index([roleId], map: \"Users_roleId_fkey\")\n @@map(\"Users\")\n}\n\nmodel Role {\n id Int @id @default(autoincrement())\n name String @unique @db.VarChar(100)\n description String? @db.Text\n permissions Json?\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n users User[] @relation(\"User_Role\")\n\n @@map(\"Roles\")\n}\n\nmodel OtpCode {\n id Int @id @default(autoincrement())\n mobileNumber String @db.VarChar(20)\n code String @db.VarChar(10)\n used Boolean @default(false)\n expiresAt DateTime @db.Timestamp(0)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n @@index([mobileNumber])\n @@map(\"Otp_Codes\")\n}\n\nmodel RefreshToken {\n id Int @id @default(autoincrement())\n tokenHash String @db.VarChar(255)\n userId Int\n revoked Boolean @default(false)\n expiresAt DateTime @db.Timestamp(0)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n user User @relation(fields: [userId], references: [id])\n\n @@index([userId])\n @@map(\"Refresh_Tokens\")\n}\n\nmodel BankBranch {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n code String @unique() @db.VarChar(10)\n address String? @db.VarChar(500)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n bankId Int\n\n bank Bank @relation(\"bank_branches\", fields: [bankId], references: [id])\n bankAccounts BankAccount[] @relation(\"Bank_Accounts_branchId_fkey\")\n\n @@map(\"Bank_Branches\")\n}\n\nmodel BankAccount {\n id Int @id @default(autoincrement())\n accountNumber String? @unique @db.VarChar(20)\n cardNumber String? @unique @db.VarChar(16)\n name String @db.VarChar(255)\n iban String? @unique @db.VarChar(34)\n branchId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n branch BankBranch @relation(\"Bank_Accounts_branchId_fkey\", fields: [branchId], references: [id])\n inventoryBankAccounts InventoryBankAccount[]\n purchaseReceiptPayments PurchaseReceiptPayments[]\n bankAccountTransactions BankAccountTransaction[]\n\n @@map(\"Bank_Accounts\")\n}\n\nmodel BankAccountTransaction {\n id Int @id @default(autoincrement())\n bankAccountId Int\n type BankAccountTransactionType\n amount Decimal @db.Decimal(15, 2)\n balanceAfter Decimal @db.Decimal(15, 2)\n referenceId Int\n referenceType BankTransactionRefType\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])\n\n @@index([bankAccountId])\n @@map(\"Bank_Account_Transactions\")\n}\n\nenum OrderStatus {\n PENDING\n REJECTED\n CANCELED\n DONE\n}\n\nenum MovementType {\n IN\n OUT\n ADJUST\n}\n\nenum MovementReferenceType {\n PURCHASE\n SALES\n ADJUSTMENT\n INVENTORY_TRANSFER\n}\n\nenum PaymentMethodType {\n CASH\n CARD\n BANK\n CHECK\n OTHER\n}\n\nenum LedgerSourceType {\n PURCHASE\n PAYMENT\n ADJUSTMENT\n REFUND\n}\n\nenum PaymentType {\n PAYMENT\n REFUND\n}\n\nenum PurchaseReceiptStatus {\n UNPAID\n PARTIALLY_PAID\n PAID\n}\n\nenum BankAccountTransactionType {\n DEPOSIT\n WITHDRAWAL\n}\n\nenum BankTransactionRefType {\n PURCHASE_PAYMENT\n PURCHASE_REFUND\n POS_SALE\n POS_REFUND\n BANK_TRANSFER\n MANUAL_ADJUSTMENT\n}\n\nmodel Inventory {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n location String? @db.VarChar(255)\n isActive Boolean @default(true)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n isPointOfSale Boolean @default(false)\n inventoryTransfersFrom InventoryTransfer[] @relation(\"Inventory_From\")\n inventoryTransfersTo InventoryTransfer[] @relation(\"Inventory_To\")\n purchaseReceipts PurchaseReceipt[]\n stockAdjustments StockAdjustment[] @relation(\"Inventory_Stock_Adjustments\")\n stockBalances StockBalance[] @relation(\"StockBalance_inventory\")\n counterStockMovements StockMovement[] @relation(\"StockMovement_CounterInventory\")\n stockMovements StockMovement[] @relation(\"StockMovement_Inventory\")\n inventoryBankAccounts InventoryBankAccount[]\n stockReservations StockReservation[]\n\n @@map(\"Inventories\")\n}\n\nmodel InventoryBankAccount {\n inventoryId Int\n bankAccountId Int\n\n inventory Inventory @relation(fields: [inventoryId], references: [id])\n bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])\n posAccounts PosAccount[]\n purchaseReceiptPayments PurchaseReceiptPayments[]\n\n @@id([inventoryId, bankAccountId])\n @@index([bankAccountId])\n @@map(\"Inventory_Bank_Accounts\")\n}\n\nmodel PosAccount {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n code String @unique() @db.VarChar(10)\n description String? @db.VarChar(500)\n bankAccountId Int\n inventoryId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n inventoryBankAccount InventoryBankAccount @relation(fields: [inventoryId, bankAccountId], references: [inventoryId, bankAccountId])\n salesInvoices SalesInvoice[]\n\n @@index([inventoryId])\n @@map(\"Pos_Accounts\")\n}\n\nmodel InventoryTransfer {\n id Int @id @default(autoincrement())\n code String @unique @db.VarChar(100)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n fromInventoryId Int\n toInventoryId Int\n items InventoryTransferItem[] @relation(\"InventoryTransfer_Items\")\n fromInventory Inventory @relation(\"Inventory_From\", fields: [fromInventoryId], references: [id])\n toInventory Inventory @relation(\"Inventory_To\", fields: [toInventoryId], references: [id])\n\n @@index([fromInventoryId], map: \"Inventory_Transfers_fromInventoryId_fkey\")\n @@index([toInventoryId], map: \"Inventory_Transfers_toInventoryId_fkey\")\n @@map(\"Inventory_Transfers\")\n}\n\nmodel InventoryTransferItem {\n id Int @id @default(autoincrement())\n count Decimal @db.Decimal(10, 0)\n productId Int\n transferId Int\n product Product @relation(\"InventoryTransferItem_Product\", fields: [productId], references: [id])\n transfer InventoryTransfer @relation(\"InventoryTransfer_Items\", fields: [transferId], references: [id])\n\n @@index([productId], map: \"Inventory_Transfer_Items_productId_fkey\")\n @@index([transferId], map: \"Inventory_Transfer_Items_transferId_fkey\")\n @@map(\"Inventory_Transfer_Items\")\n}\n\nmodel Bank {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n shortName String @unique() @db.VarChar(3)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n bankBranches BankBranch[] @relation(\"bank_branches\")\n\n @@map(\"Banks\")\n}\n\nmodel Order {\n id Int @id @default(autoincrement())\n orderNumber String @unique @db.VarChar(100)\n status OrderStatus @default(PENDING)\n totalAmount Decimal @db.Decimal(15, 2)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n customerId Int?\n customer Customer? @relation(fields: [customerId], references: [id], onUpdate: NoAction)\n orderItems OrderItem[]\n\n @@index([customerId])\n @@map(\"Orders\")\n}\n\nmodel OrderItem {\n id Int @id @default(autoincrement())\n quantity Decimal @db.Decimal(10, 0)\n unitPrice Decimal @db.Decimal(15, 2)\n totalAmount Decimal @db.Decimal(15, 2)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n orderId Int\n productId Int\n\n order Order @relation(fields: [orderId], references: [id], onUpdate: NoAction)\n product Product @relation(fields: [productId], references: [id], onUpdate: NoAction)\n\n @@index([orderId])\n @@index([productId])\n @@map(\"Order_Items\")\n}\n\nmodel Customer {\n id Int @id @default(autoincrement())\n firstName String @db.VarChar(255)\n lastName String @db.VarChar(255)\n email String? @db.VarChar(255)\n mobileNumber String @unique @db.Char(11)\n address String? @db.Text\n city String? @db.VarChar(100)\n state String? @db.VarChar(100)\n country String? @db.VarChar(100)\n isActive Boolean @default(true)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n orders Order[] @relation()\n stockMovements StockMovement[] @relation()\n salesInvoices SalesInvoice[]\n\n @@map(\"Customers\")\n}\n\nmodel TriggerLog {\n id Int @id @default(autoincrement())\n message String @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n name String @db.Text\n\n @@map(\"Trigger_Logs\")\n}\n\nmodel ProductVariant {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n basePrice Decimal @db.Decimal(15, 2)\n salePrice Decimal @db.Decimal(15, 2)\n description String? @db.Text\n barcode String? @unique() @db.VarChar(100)\n imageUrl String? @db.VarChar(255)\n unit String? @db.VarChar(10)\n quantity Decimal? @default(0.00) @db.Decimal(10, 0)\n alertQuantity Decimal? @default(5.00) @db.Decimal(10, 0)\n isActive Boolean @default(true)\n isFeatured Boolean @default(false)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n productId Int\n product Product @relation(\"Product_Variant\", fields: [productId], references: [id], onUpdate: NoAction)\n\n @@index([productId], map: \"Product_Variants_productId_fkey\")\n @@map(\"Product_Variants\")\n}\n\nmodel Product {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n description String? @db.Text\n sku String? @unique() @db.VarChar(100)\n barcode String? @unique() @db.VarChar(100)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n brandId Int?\n categoryId Int?\n salePrice Decimal @default(0.00) @db.Decimal(15, 0)\n minimumStockAlertLevel Decimal @default(1.00) @db.Decimal(10, 0)\n inventoryTransferItems InventoryTransferItem[] @relation(\"InventoryTransferItem_Product\")\n variants ProductVariant[] @relation(\"Product_Variant\")\n brand ProductBrand? @relation(\"Product_Brand\", fields: [brandId], references: [id], onUpdate: NoAction)\n category ProductCategory? @relation(\"Product_Category\", fields: [categoryId], references: [id], onUpdate: NoAction)\n purchaseReceiptItems PurchaseReceiptItem[] @relation(\"Product_PurchaseReceiptItems\")\n stockAdjustments StockAdjustment[] @relation(\"Product_Stock_Adjustments\")\n stockBalances StockBalance[] @relation(\"StockBalance_Product\")\n stockMovements StockMovement[] @relation(\"StockMovement_Product\")\n salesInvoiceItems SalesInvoiceItem[]\n stockReservations StockReservation[]\n orderItems OrderItem[]\n\n @@index([brandId], map: \"Products_brandId_fkey\")\n @@index([categoryId], map: \"Products_categoryId_fkey\")\n @@map(\"Products\")\n}\n\nmodel ProductBrand {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n imageUrl String? @db.VarChar(255)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n products Product[] @relation(\"Product_Brand\")\n\n @@map(\"Product_brands\")\n}\n\nmodel ProductCategory {\n id Int @id @default(autoincrement())\n name String @db.VarChar(100)\n description String? @db.Text\n imageUrl String? @db.VarChar(255)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n products Product[] @relation(\"Product_Category\")\n\n @@map(\"Product_categories\")\n}\n\nmodel PurchaseReceipt {\n id Int @id @default(autoincrement())\n code String @unique @db.VarChar(100)\n totalAmount Decimal @db.Decimal(15, 2)\n paidAmount Decimal @default(0.00) @db.Decimal(15, 2)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n status PurchaseReceiptStatus @default(UNPAID)\n supplierId Int\n inventoryId Int\n items PurchaseReceiptItem[] @relation(\"PurchaseReceipt_Items\")\n inventory Inventory @relation(fields: [inventoryId], references: [id])\n supplier Supplier @relation(fields: [supplierId], references: [id])\n payments PurchaseReceiptPayments[]\n\n @@index([inventoryId], map: \"Purchase_Receipts_inventoryId_fkey\")\n @@index([supplierId], map: \"Purchase_Receipts_supplierId_fkey\")\n @@map(\"Purchase_Receipts\")\n}\n\nmodel PurchaseReceiptItem {\n id Int @id @default(autoincrement())\n count Decimal @db.Decimal(10, 0)\n unitPrice Decimal @db.Decimal(15, 2)\n totalAmount Decimal @db.Decimal(15, 2)\n receiptId Int\n productId Int\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n product Product @relation(\"Product_PurchaseReceiptItems\", fields: [productId], references: [id])\n receipt PurchaseReceipt @relation(\"PurchaseReceipt_Items\", fields: [receiptId], references: [id])\n\n @@index([productId], map: \"Purchase_Receipt_Items_productId_fkey\")\n @@index([receiptId], map: \"Purchase_Receipt_Items_receiptId_fkey\")\n @@map(\"Purchase_Receipt_Items\")\n}\n\nmodel PurchaseReceiptPayments {\n id Int @id @default(autoincrement())\n amount Decimal @db.Decimal(15, 2)\n paymentMethod PaymentMethodType\n type PaymentType\n bankAccountId Int\n receiptId Int\n payedAt DateTime @db.Timestamp(0)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n receipt PurchaseReceipt @relation(fields: [receiptId], references: [id])\n bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])\n inventoryBankAccount InventoryBankAccount? @relation(fields: [inventoryBankAccountInventoryId, inventoryBankAccountBankAccountId], references: [inventoryId, bankAccountId])\n inventoryBankAccountInventoryId Int?\n inventoryBankAccountBankAccountId Int?\n\n @@index([receiptId], map: \"Purchase_Receipt_Payments_receiptId_fkey\")\n @@map(\"Purchase_Receipt_Payments\")\n}\n\nmodel SalesInvoice {\n id Int @id @default(autoincrement())\n code String @unique @db.VarChar(100)\n totalAmount Decimal @db.Decimal(15, 2)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n customerId Int?\n posAccountId Int\n customer Customer? @relation(fields: [customerId], references: [id])\n posAccount PosAccount @relation(fields: [posAccountId], references: [id])\n items SalesInvoiceItem[]\n salesInvoicePayments SalesInvoicePayment[]\n\n @@index([customerId])\n @@index([posAccountId])\n @@map(\"Sales_Invoices\")\n}\n\nmodel SalesInvoiceItem {\n id Int @id @default(autoincrement())\n count Decimal @db.Decimal(10, 0)\n unitPrice Decimal @default(0.00) @db.Decimal(15, 2)\n totalAmount Decimal @default(0.00) @db.Decimal(15, 2)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n invoiceId Int\n productId Int\n invoice SalesInvoice @relation(fields: [invoiceId], references: [id])\n product Product @relation(fields: [productId], references: [id])\n\n @@index([invoiceId])\n @@index([productId])\n @@map(\"Sales_Invoice_Items\")\n}\n\nmodel SalesInvoicePayment {\n id Int @id @default(autoincrement())\n invoiceId Int\n amount Decimal @db.Decimal(15, 2)\n paymentMethod PaymentMethodType\n paidAt DateTime\n createdAt DateTime @default(now())\n\n invoice SalesInvoice @relation(fields: [invoiceId], references: [id])\n\n @@index([invoiceId])\n @@map(\"Sales_Invoice_Payments\")\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../../src/generated/prisma\"\n moduleFormat = \"cjs\"\n}\n\ndatasource db {\n provider = \"mysql\"\n}\n\nmodel StockMovement {\n id Int @id @default(autoincrement())\n type MovementType\n quantity Decimal @db.Decimal(10, 0)\n unitPrice Decimal @db.Decimal(15, 2)\n totalCost Decimal @db.Decimal(15, 2)\n referenceType MovementReferenceType\n referenceId String\n createdAt DateTime @default(now()) @db.Timestamp(0)\n productId Int\n inventoryId Int\n avgCost Decimal @db.Decimal(15, 2)\n supplierId Int?\n remainedInStock Decimal @default(0.00) @db.Decimal(10, 0)\n counterInventoryId Int?\n customerId Int?\n counterInventory Inventory? @relation(\"StockMovement_CounterInventory\", fields: [counterInventoryId], references: [id])\n customer Customer? @relation(fields: [customerId], references: [id])\n inventory Inventory @relation(\"StockMovement_Inventory\", fields: [inventoryId], references: [id])\n product Product @relation(\"StockMovement_Product\", fields: [productId], references: [id])\n supplier Supplier? @relation(\"StockMovement_Supplier\", fields: [supplierId], references: [id])\n\n @@index([inventoryId], map: \"Stock_Movements_inventoryId_fkey\")\n @@index([productId], map: \"Stock_Movements_productId_fkey\")\n @@index([counterInventoryId], map: \"Stock_Movements_counterInventoryId_fkey\")\n @@index([customerId], map: \"Stock_Movements_customerId_fkey\")\n @@index([supplierId], map: \"Stock_Movements_supplierId_fkey\")\n @@map(\"Stock_Movements\")\n}\n\nmodel StockBalance {\n quantity Decimal @default(0.000) @db.Decimal(14, 3)\n totalCost Decimal @default(0.00) @db.Decimal(14, 2)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n avgCost Decimal @default(0.00) @db.Decimal(14, 2)\n inventoryId Int\n productId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n id Int @id @default(autoincrement())\n inventory Inventory @relation(\"StockBalance_inventory\", fields: [inventoryId], references: [id])\n product Product @relation(\"StockBalance_Product\", fields: [productId], references: [id])\n\n @@unique([productId, inventoryId])\n @@index([productId])\n @@index([inventoryId])\n @@map(\"Stock_Balance\")\n}\n\nmodel StockAdjustment {\n id Int @id @default(autoincrement())\n adjustedQuantity Decimal @db.Decimal(10, 0)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n productId Int\n inventoryId Int\n inventory Inventory @relation(\"Inventory_Stock_Adjustments\", fields: [inventoryId], references: [id])\n product Product @relation(\"Product_Stock_Adjustments\", fields: [productId], references: [id])\n\n @@index([inventoryId], map: \"Stock_Adjustments_inventoryId_fkey\")\n @@index([productId], map: \"Stock_Adjustments_productId_fkey\")\n @@map(\"Stock_Adjustments\")\n}\n\nmodel StockReservation {\n id Int @id @default(autoincrement())\n quantity Decimal @db.Decimal(10, 0)\n expiresAt DateTime @db.Timestamp(0)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n productId Int\n inventoryId Int\n orderId Int\n inventory Inventory @relation(fields: [inventoryId], references: [id])\n product Product @relation(fields: [productId], references: [id])\n\n @@index([inventoryId])\n @@index([productId])\n @@map(\"Stock_Reservations\")\n}\n\nmodel Supplier {\n id Int @id @default(autoincrement())\n firstName String @db.VarChar(255)\n lastName String @db.VarChar(255)\n email String? @db.VarChar(255)\n mobileNumber String @unique @db.Char(11)\n address String? @db.Text\n city String? @db.VarChar(100)\n state String? @db.VarChar(100)\n country String? @db.VarChar(100)\n isActive Boolean @default(true)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n stockMovements StockMovement[] @relation(\"StockMovement_Supplier\")\n receipts PurchaseReceipt[]\n ledger SupplierLedger[]\n\n @@map(\"Suppliers\")\n}\n\nmodel SupplierLedger {\n id Int @id @default(autoincrement())\n description String? @db.Text\n debit Decimal @default(0) @db.Decimal(15, 2)\n credit Decimal @default(0) @db.Decimal(15, 2)\n balance Decimal @db.Decimal(15, 2)\n sourceType LedgerSourceType\n sourceId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n supplierId Int\n supplier Supplier @relation(fields: [supplierId], references: [id])\n\n @@index([supplierId])\n @@map(\"Supplier_Ledger\")\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -28,7 +28,7 @@ const config: runtime.GetPrismaClientConfig = { } } -config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"roleId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"refreshTokens\",\"kind\":\"object\",\"type\":\"RefreshToken\",\"relationName\":\"RefreshTokenToUser\"},{\"name\":\"role\",\"kind\":\"object\",\"type\":\"Role\",\"relationName\":\"User_Role\"}],\"dbName\":\"Users\"},\"Role\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"permissions\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"users\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"User_Role\"}],\"dbName\":\"Roles\"},\"OtpCode\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"used\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"Otp_Codes\"},\"RefreshToken\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"tokenHash\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"revoked\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"RefreshTokenToUser\"}],\"dbName\":\"Refresh_Tokens\"},\"BankBranch\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bankId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"bank\",\"kind\":\"object\",\"type\":\"Bank\",\"relationName\":\"bank_branches\"},{\"name\":\"bankAccounts\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"Bank_Accounts_branchId_fkey\"}],\"dbName\":\"Bank_Branches\"},\"BankAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"accountNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"cardNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"iban\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"branchId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"branch\",\"kind\":\"object\",\"type\":\"BankBranch\",\"relationName\":\"Bank_Accounts_branchId_fkey\"},{\"name\":\"inventoryBankAccounts\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"BankAccountToInventoryBankAccount\"},{\"name\":\"purchaseReceiptPayments\",\"kind\":\"object\",\"type\":\"PurchaseReceiptPayments\",\"relationName\":\"BankAccountToPurchaseReceiptPayments\"},{\"name\":\"bankAccountTransactions\",\"kind\":\"object\",\"type\":\"BankAccountTransaction\",\"relationName\":\"BankAccountToBankAccountTransaction\"},{\"name\":\"bankAccountBalances\",\"kind\":\"object\",\"type\":\"BankAccountBalance\",\"relationName\":\"BankAccountToBankAccountBalance\"}],\"dbName\":\"Bank_Accounts\"},\"BankAccountTransaction\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"BankAccountTransactionType\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"balanceAfter\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"referenceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"referenceType\",\"kind\":\"enum\",\"type\":\"BankTransactionRefType\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bankAccount\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"BankAccountToBankAccountTransaction\"}],\"dbName\":\"Bank_Account_Transactions\"},\"BankAccountBalance\":{\"fields\":[{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"balance\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bankAccount\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"BankAccountToBankAccountBalance\"}],\"dbName\":\"Bank_Account_Balance\"},\"Inventory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"location\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"isPointOfSale\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"inventoryTransfersFrom\",\"kind\":\"object\",\"type\":\"InventoryTransfer\",\"relationName\":\"Inventory_From\"},{\"name\":\"inventoryTransfersTo\",\"kind\":\"object\",\"type\":\"InventoryTransfer\",\"relationName\":\"Inventory_To\"},{\"name\":\"purchaseReceipts\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"InventoryToPurchaseReceipt\"},{\"name\":\"stockAdjustments\",\"kind\":\"object\",\"type\":\"StockAdjustment\",\"relationName\":\"Inventory_Stock_Adjustments\"},{\"name\":\"stockBalances\",\"kind\":\"object\",\"type\":\"StockBalance\",\"relationName\":\"StockBalance_inventory\"},{\"name\":\"counterStockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_CounterInventory\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_Inventory\"},{\"name\":\"inventoryBankAccounts\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"InventoryToInventoryBankAccount\"},{\"name\":\"stockReservations\",\"kind\":\"object\",\"type\":\"StockReservation\",\"relationName\":\"InventoryToStockReservation\"}],\"dbName\":\"Inventories\"},\"InventoryBankAccount\":{\"fields\":[{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"InventoryToInventoryBankAccount\"},{\"name\":\"bankAccount\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"BankAccountToInventoryBankAccount\"},{\"name\":\"posAccounts\",\"kind\":\"object\",\"type\":\"PosAccount\",\"relationName\":\"InventoryBankAccountToPosAccount\"},{\"name\":\"purchaseReceiptPayments\",\"kind\":\"object\",\"type\":\"PurchaseReceiptPayments\",\"relationName\":\"InventoryBankAccountToPurchaseReceiptPayments\"}],\"dbName\":\"Inventory_Bank_Accounts\"},\"PosAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"inventoryBankAccount\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"InventoryBankAccountToPosAccount\"},{\"name\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"PosAccountToSalesInvoice\"}],\"dbName\":\"Pos_Accounts\"},\"InventoryTransfer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"fromInventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"toInventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"InventoryTransferItem\",\"relationName\":\"InventoryTransfer_Items\"},{\"name\":\"fromInventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_From\"},{\"name\":\"toInventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_To\"}],\"dbName\":\"Inventory_Transfers\"},\"InventoryTransferItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"transferId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"InventoryTransferItem_Product\"},{\"name\":\"transfer\",\"kind\":\"object\",\"type\":\"InventoryTransfer\",\"relationName\":\"InventoryTransfer_Items\"}],\"dbName\":\"Inventory_Transfer_Items\"},\"Bank\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"shortName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bankBranches\",\"kind\":\"object\",\"type\":\"BankBranch\",\"relationName\":\"bank_branches\"}],\"dbName\":\"Banks\"},\"Order\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"OrderStatus\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToOrder\"},{\"name\":\"orderItems\",\"kind\":\"object\",\"type\":\"OrderItem\",\"relationName\":\"OrderToOrderItem\"}],\"dbName\":\"Orders\"},\"OrderItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unitPrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"order\",\"kind\":\"object\",\"type\":\"Order\",\"relationName\":\"OrderToOrderItem\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"OrderItemToProduct\"}],\"dbName\":\"Order_Items\"},\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"city\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"state\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"country\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"orders\",\"kind\":\"object\",\"type\":\"Order\",\"relationName\":\"CustomerToOrder\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"CustomerToStockMovement\"},{\"name\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"CustomerToSalesInvoice\"}],\"dbName\":\"Customers\"},\"TriggerLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"Trigger_Logs\"},\"ProductVariant\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"basePrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"salePrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"unit\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"alertQuantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"isFeatured\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_Variant\"}],\"dbName\":\"Product_Variants\"},\"Product\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"brandId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"salePrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"minimumStockAlertLevel\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"inventoryTransferItems\",\"kind\":\"object\",\"type\":\"InventoryTransferItem\",\"relationName\":\"InventoryTransferItem_Product\"},{\"name\":\"variants\",\"kind\":\"object\",\"type\":\"ProductVariant\",\"relationName\":\"Product_Variant\"},{\"name\":\"brand\",\"kind\":\"object\",\"type\":\"ProductBrand\",\"relationName\":\"Product_Brand\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ProductCategory\",\"relationName\":\"Product_Category\"},{\"name\":\"purchaseReceiptItems\",\"kind\":\"object\",\"type\":\"PurchaseReceiptItem\",\"relationName\":\"Product_PurchaseReceiptItems\"},{\"name\":\"stockAdjustments\",\"kind\":\"object\",\"type\":\"StockAdjustment\",\"relationName\":\"Product_Stock_Adjustments\"},{\"name\":\"stockBalances\",\"kind\":\"object\",\"type\":\"StockBalance\",\"relationName\":\"StockBalance_Product\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_Product\"},{\"name\":\"salesInvoiceItems\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"ProductToSalesInvoiceItem\"},{\"name\":\"stockReservations\",\"kind\":\"object\",\"type\":\"StockReservation\",\"relationName\":\"ProductToStockReservation\"},{\"name\":\"orderItems\",\"kind\":\"object\",\"type\":\"OrderItem\",\"relationName\":\"OrderItemToProduct\"}],\"dbName\":\"Products\"},\"ProductBrand\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"products\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_Brand\"}],\"dbName\":\"Product_brands\"},\"ProductCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"products\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_Category\"}],\"dbName\":\"Product_categories\"},\"PurchaseReceipt\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"paidAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"PurchaseReceiptStatus\"},{\"name\":\"supplierId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"PurchaseReceiptItem\",\"relationName\":\"PurchaseReceipt_Items\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"InventoryToPurchaseReceipt\"},{\"name\":\"supplier\",\"kind\":\"object\",\"type\":\"Supplier\",\"relationName\":\"PurchaseReceiptToSupplier\"},{\"name\":\"payments\",\"kind\":\"object\",\"type\":\"PurchaseReceiptPayments\",\"relationName\":\"PurchaseReceiptToPurchaseReceiptPayments\"}],\"dbName\":\"Purchase_Receipts\"},\"PurchaseReceiptItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unitPrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"receiptId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_PurchaseReceiptItems\"},{\"name\":\"receipt\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"PurchaseReceipt_Items\"}],\"dbName\":\"Purchase_Receipt_Items\"},\"PurchaseReceiptPayments\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"paymentMethod\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"PaymentType\"},{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"receiptId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"payedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"receipt\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"PurchaseReceiptToPurchaseReceiptPayments\"},{\"name\":\"bankAccount\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"BankAccountToPurchaseReceiptPayments\"},{\"name\":\"inventoryBankAccount\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"InventoryBankAccountToPurchaseReceiptPayments\"},{\"name\":\"inventoryBankAccountInventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryBankAccountBankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":\"Purchase_Receipt_Payments\"},\"SalesInvoice\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"posAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"posAccount\",\"kind\":\"object\",\"type\":\"PosAccount\",\"relationName\":\"PosAccountToSalesInvoice\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"salesInvoicePayments\",\"kind\":\"object\",\"type\":\"SalesInvoicePayment\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"Sales_Invoices\"},\"SalesInvoiceItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unitPrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoiceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"ProductToSalesInvoiceItem\"}],\"dbName\":\"Sales_Invoice_Items\"},\"SalesInvoicePayment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"invoiceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"paymentMethod\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"name\":\"paidAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"Sales_Invoice_Payments\"},\"StockMovement\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"MovementType\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unitPrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"referenceType\",\"kind\":\"enum\",\"type\":\"MovementReferenceType\"},{\"name\":\"referenceId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"avgCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"supplierId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"remainedInStock\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"counterInventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"counterInventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"StockMovement_CounterInventory\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToStockMovement\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"StockMovement_Inventory\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"StockMovement_Product\"},{\"name\":\"supplier\",\"kind\":\"object\",\"type\":\"Supplier\",\"relationName\":\"StockMovement_Supplier\"}],\"dbName\":\"Stock_Movements\"},\"StockBalance\":{\"fields\":[{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"avgCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"StockBalance_inventory\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"StockBalance_Product\"}],\"dbName\":\"Stock_Balance\"},\"StockAdjustment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"adjustedQuantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_Stock_Adjustments\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_Stock_Adjustments\"}],\"dbName\":\"Stock_Adjustments\"},\"StockReservation\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"InventoryToStockReservation\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"ProductToStockReservation\"}],\"dbName\":\"Stock_Reservations\"},\"Supplier\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"city\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"state\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"country\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_Supplier\"},{\"name\":\"receipts\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"PurchaseReceiptToSupplier\"},{\"name\":\"ledger\",\"kind\":\"object\",\"type\":\"SupplierLedger\",\"relationName\":\"SupplierToSupplierLedger\"}],\"dbName\":\"Suppliers\"},\"SupplierLedger\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"debit\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"credit\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"balance\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"sourceType\",\"kind\":\"enum\",\"type\":\"LedgerSourceType\"},{\"name\":\"sourceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"supplierId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"supplier\",\"kind\":\"object\",\"type\":\"Supplier\",\"relationName\":\"SupplierToSupplierLedger\"}],\"dbName\":\"Supplier_Ledger\"}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"password\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"roleId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"refreshTokens\",\"kind\":\"object\",\"type\":\"RefreshToken\",\"relationName\":\"RefreshTokenToUser\"},{\"name\":\"role\",\"kind\":\"object\",\"type\":\"Role\",\"relationName\":\"User_Role\"}],\"dbName\":\"Users\"},\"Role\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"permissions\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"users\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"User_Role\"}],\"dbName\":\"Roles\"},\"OtpCode\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"used\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"Otp_Codes\"},\"RefreshToken\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"tokenHash\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"userId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"revoked\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"RefreshTokenToUser\"}],\"dbName\":\"Refresh_Tokens\"},\"BankBranch\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bankId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"bank\",\"kind\":\"object\",\"type\":\"Bank\",\"relationName\":\"bank_branches\"},{\"name\":\"bankAccounts\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"Bank_Accounts_branchId_fkey\"}],\"dbName\":\"Bank_Branches\"},\"BankAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"accountNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"cardNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"iban\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"branchId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"branch\",\"kind\":\"object\",\"type\":\"BankBranch\",\"relationName\":\"Bank_Accounts_branchId_fkey\"},{\"name\":\"inventoryBankAccounts\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"BankAccountToInventoryBankAccount\"},{\"name\":\"purchaseReceiptPayments\",\"kind\":\"object\",\"type\":\"PurchaseReceiptPayments\",\"relationName\":\"BankAccountToPurchaseReceiptPayments\"},{\"name\":\"bankAccountTransactions\",\"kind\":\"object\",\"type\":\"BankAccountTransaction\",\"relationName\":\"BankAccountToBankAccountTransaction\"}],\"dbName\":\"Bank_Accounts\"},\"BankAccountTransaction\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"BankAccountTransactionType\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"balanceAfter\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"referenceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"referenceType\",\"kind\":\"enum\",\"type\":\"BankTransactionRefType\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bankAccount\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"BankAccountToBankAccountTransaction\"}],\"dbName\":\"Bank_Account_Transactions\"},\"Inventory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"location\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"isPointOfSale\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"inventoryTransfersFrom\",\"kind\":\"object\",\"type\":\"InventoryTransfer\",\"relationName\":\"Inventory_From\"},{\"name\":\"inventoryTransfersTo\",\"kind\":\"object\",\"type\":\"InventoryTransfer\",\"relationName\":\"Inventory_To\"},{\"name\":\"purchaseReceipts\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"InventoryToPurchaseReceipt\"},{\"name\":\"stockAdjustments\",\"kind\":\"object\",\"type\":\"StockAdjustment\",\"relationName\":\"Inventory_Stock_Adjustments\"},{\"name\":\"stockBalances\",\"kind\":\"object\",\"type\":\"StockBalance\",\"relationName\":\"StockBalance_inventory\"},{\"name\":\"counterStockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_CounterInventory\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_Inventory\"},{\"name\":\"inventoryBankAccounts\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"InventoryToInventoryBankAccount\"},{\"name\":\"stockReservations\",\"kind\":\"object\",\"type\":\"StockReservation\",\"relationName\":\"InventoryToStockReservation\"}],\"dbName\":\"Inventories\"},\"InventoryBankAccount\":{\"fields\":[{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"InventoryToInventoryBankAccount\"},{\"name\":\"bankAccount\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"BankAccountToInventoryBankAccount\"},{\"name\":\"posAccounts\",\"kind\":\"object\",\"type\":\"PosAccount\",\"relationName\":\"InventoryBankAccountToPosAccount\"},{\"name\":\"purchaseReceiptPayments\",\"kind\":\"object\",\"type\":\"PurchaseReceiptPayments\",\"relationName\":\"InventoryBankAccountToPurchaseReceiptPayments\"}],\"dbName\":\"Inventory_Bank_Accounts\"},\"PosAccount\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"inventoryBankAccount\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"InventoryBankAccountToPosAccount\"},{\"name\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"PosAccountToSalesInvoice\"}],\"dbName\":\"Pos_Accounts\"},\"InventoryTransfer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"fromInventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"toInventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"InventoryTransferItem\",\"relationName\":\"InventoryTransfer_Items\"},{\"name\":\"fromInventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_From\"},{\"name\":\"toInventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_To\"}],\"dbName\":\"Inventory_Transfers\"},\"InventoryTransferItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"transferId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"InventoryTransferItem_Product\"},{\"name\":\"transfer\",\"kind\":\"object\",\"type\":\"InventoryTransfer\",\"relationName\":\"InventoryTransfer_Items\"}],\"dbName\":\"Inventory_Transfer_Items\"},\"Bank\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"shortName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bankBranches\",\"kind\":\"object\",\"type\":\"BankBranch\",\"relationName\":\"bank_branches\"}],\"dbName\":\"Banks\"},\"Order\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"OrderStatus\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToOrder\"},{\"name\":\"orderItems\",\"kind\":\"object\",\"type\":\"OrderItem\",\"relationName\":\"OrderToOrderItem\"}],\"dbName\":\"Orders\"},\"OrderItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unitPrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"order\",\"kind\":\"object\",\"type\":\"Order\",\"relationName\":\"OrderToOrderItem\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"OrderItemToProduct\"}],\"dbName\":\"Order_Items\"},\"Customer\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"city\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"state\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"country\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"orders\",\"kind\":\"object\",\"type\":\"Order\",\"relationName\":\"CustomerToOrder\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"CustomerToStockMovement\"},{\"name\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"CustomerToSalesInvoice\"}],\"dbName\":\"Customers\"},\"TriggerLog\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"message\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"Trigger_Logs\"},\"ProductVariant\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"basePrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"salePrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"unit\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"alertQuantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"isFeatured\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_Variant\"}],\"dbName\":\"Product_Variants\"},\"Product\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"brandId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"salePrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"minimumStockAlertLevel\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"inventoryTransferItems\",\"kind\":\"object\",\"type\":\"InventoryTransferItem\",\"relationName\":\"InventoryTransferItem_Product\"},{\"name\":\"variants\",\"kind\":\"object\",\"type\":\"ProductVariant\",\"relationName\":\"Product_Variant\"},{\"name\":\"brand\",\"kind\":\"object\",\"type\":\"ProductBrand\",\"relationName\":\"Product_Brand\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ProductCategory\",\"relationName\":\"Product_Category\"},{\"name\":\"purchaseReceiptItems\",\"kind\":\"object\",\"type\":\"PurchaseReceiptItem\",\"relationName\":\"Product_PurchaseReceiptItems\"},{\"name\":\"stockAdjustments\",\"kind\":\"object\",\"type\":\"StockAdjustment\",\"relationName\":\"Product_Stock_Adjustments\"},{\"name\":\"stockBalances\",\"kind\":\"object\",\"type\":\"StockBalance\",\"relationName\":\"StockBalance_Product\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_Product\"},{\"name\":\"salesInvoiceItems\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"ProductToSalesInvoiceItem\"},{\"name\":\"stockReservations\",\"kind\":\"object\",\"type\":\"StockReservation\",\"relationName\":\"ProductToStockReservation\"},{\"name\":\"orderItems\",\"kind\":\"object\",\"type\":\"OrderItem\",\"relationName\":\"OrderItemToProduct\"}],\"dbName\":\"Products\"},\"ProductBrand\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"products\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_Brand\"}],\"dbName\":\"Product_brands\"},\"ProductCategory\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"imageUrl\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"products\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_Category\"}],\"dbName\":\"Product_categories\"},\"PurchaseReceipt\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"paidAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"PurchaseReceiptStatus\"},{\"name\":\"supplierId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"PurchaseReceiptItem\",\"relationName\":\"PurchaseReceipt_Items\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"InventoryToPurchaseReceipt\"},{\"name\":\"supplier\",\"kind\":\"object\",\"type\":\"Supplier\",\"relationName\":\"PurchaseReceiptToSupplier\"},{\"name\":\"payments\",\"kind\":\"object\",\"type\":\"PurchaseReceiptPayments\",\"relationName\":\"PurchaseReceiptToPurchaseReceiptPayments\"}],\"dbName\":\"Purchase_Receipts\"},\"PurchaseReceiptItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unitPrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"receiptId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_PurchaseReceiptItems\"},{\"name\":\"receipt\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"PurchaseReceipt_Items\"}],\"dbName\":\"Purchase_Receipt_Items\"},\"PurchaseReceiptPayments\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"paymentMethod\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"PaymentType\"},{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"receiptId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"payedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"receipt\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"PurchaseReceiptToPurchaseReceiptPayments\"},{\"name\":\"bankAccount\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"BankAccountToPurchaseReceiptPayments\"},{\"name\":\"inventoryBankAccount\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"InventoryBankAccountToPurchaseReceiptPayments\"},{\"name\":\"inventoryBankAccountInventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryBankAccountBankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":\"Purchase_Receipt_Payments\"},\"SalesInvoice\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"posAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToSalesInvoice\"},{\"name\":\"posAccount\",\"kind\":\"object\",\"type\":\"PosAccount\",\"relationName\":\"PosAccountToSalesInvoice\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"salesInvoicePayments\",\"kind\":\"object\",\"type\":\"SalesInvoicePayment\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"Sales_Invoices\"},\"SalesInvoiceItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unitPrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoiceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoiceItem\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"ProductToSalesInvoiceItem\"}],\"dbName\":\"Sales_Invoice_Items\"},\"SalesInvoicePayment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"invoiceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"paymentMethod\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"name\":\"paidAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"invoice\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"SalesInvoiceToSalesInvoicePayment\"}],\"dbName\":\"Sales_Invoice_Payments\"},\"StockMovement\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"MovementType\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"unitPrice\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"referenceType\",\"kind\":\"enum\",\"type\":\"MovementReferenceType\"},{\"name\":\"referenceId\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"avgCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"supplierId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"remainedInStock\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"counterInventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"customerId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"counterInventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"StockMovement_CounterInventory\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"CustomerToStockMovement\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"StockMovement_Inventory\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"StockMovement_Product\"},{\"name\":\"supplier\",\"kind\":\"object\",\"type\":\"Supplier\",\"relationName\":\"StockMovement_Supplier\"}],\"dbName\":\"Stock_Movements\"},\"StockBalance\":{\"fields\":[{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"avgCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"StockBalance_inventory\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"StockBalance_Product\"}],\"dbName\":\"Stock_Balance\"},\"StockAdjustment\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"adjustedQuantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_Stock_Adjustments\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_Stock_Adjustments\"}],\"dbName\":\"Stock_Adjustments\"},\"StockReservation\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"InventoryToStockReservation\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"ProductToStockReservation\"}],\"dbName\":\"Stock_Reservations\"},\"Supplier\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"firstName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"lastName\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mobileNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"address\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"city\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"state\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"country\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"isActive\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"deletedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_Supplier\"},{\"name\":\"receipts\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"PurchaseReceiptToSupplier\"},{\"name\":\"ledger\",\"kind\":\"object\",\"type\":\"SupplierLedger\",\"relationName\":\"SupplierToSupplierLedger\"}],\"dbName\":\"Suppliers\"},\"SupplierLedger\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"debit\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"credit\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"balance\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"sourceType\",\"kind\":\"enum\",\"type\":\"LedgerSourceType\"},{\"name\":\"sourceId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"supplierId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"supplier\",\"kind\":\"object\",\"type\":\"Supplier\",\"relationName\":\"SupplierToSupplierLedger\"}],\"dbName\":\"Supplier_Ledger\"}},\"enums\":{},\"types\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') @@ -244,16 +244,6 @@ export interface PrismaClient< */ get bankAccountTransaction(): Prisma.BankAccountTransactionDelegate; - /** - * `prisma.bankAccountBalance`: Exposes CRUD operations for the **BankAccountBalance** model. - * Example usage: - * ```ts - * // Fetch zero or more BankAccountBalances - * const bankAccountBalances = await prisma.bankAccountBalance.findMany() - * ``` - */ - get bankAccountBalance(): Prisma.BankAccountBalanceDelegate; - /** * `prisma.inventory`: Exposes CRUD operations for the **Inventory** model. * Example usage: diff --git a/src/generated/prisma/internal/prismaNamespace.ts b/src/generated/prisma/internal/prismaNamespace.ts index 8a87048..d3fb9b6 100644 --- a/src/generated/prisma/internal/prismaNamespace.ts +++ b/src/generated/prisma/internal/prismaNamespace.ts @@ -391,7 +391,6 @@ export const ModelName = { BankBranch: 'BankBranch', BankAccount: 'BankAccount', BankAccountTransaction: 'BankAccountTransaction', - BankAccountBalance: 'BankAccountBalance', Inventory: 'Inventory', InventoryBankAccount: 'InventoryBankAccount', PosAccount: 'PosAccount', @@ -433,7 +432,7 @@ export type TypeMap - fields: Prisma.BankAccountBalanceFieldRefs - operations: { - findUnique: { - args: Prisma.BankAccountBalanceFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.BankAccountBalanceFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.BankAccountBalanceFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.BankAccountBalanceFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.BankAccountBalanceFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.BankAccountBalanceCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.BankAccountBalanceCreateManyArgs - result: BatchPayload - } - delete: { - args: Prisma.BankAccountBalanceDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.BankAccountBalanceUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.BankAccountBalanceDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.BankAccountBalanceUpdateManyArgs - result: BatchPayload - } - upsert: { - args: Prisma.BankAccountBalanceUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.BankAccountBalanceAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.BankAccountBalanceGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.BankAccountBalanceCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } Inventory: { payload: Prisma.$InventoryPayload fields: Prisma.InventoryFieldRefs @@ -2816,15 +2749,6 @@ export const BankAccountTransactionScalarFieldEnum = { export type BankAccountTransactionScalarFieldEnum = (typeof BankAccountTransactionScalarFieldEnum)[keyof typeof BankAccountTransactionScalarFieldEnum] -export const BankAccountBalanceScalarFieldEnum = { - bankAccountId: 'bankAccountId', - balance: 'balance', - updatedAt: 'updatedAt' -} as const - -export type BankAccountBalanceScalarFieldEnum = (typeof BankAccountBalanceScalarFieldEnum)[keyof typeof BankAccountBalanceScalarFieldEnum] - - export const InventoryScalarFieldEnum = { id: 'id', name: 'name', @@ -3684,7 +3608,6 @@ export type GlobalOmitConfig = { bankBranch?: Prisma.BankBranchOmit bankAccount?: Prisma.BankAccountOmit bankAccountTransaction?: Prisma.BankAccountTransactionOmit - bankAccountBalance?: Prisma.BankAccountBalanceOmit inventory?: Prisma.InventoryOmit inventoryBankAccount?: Prisma.InventoryBankAccountOmit posAccount?: Prisma.PosAccountOmit diff --git a/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/generated/prisma/internal/prismaNamespaceBrowser.ts index 15373d9..68e1516 100644 --- a/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -58,7 +58,6 @@ export const ModelName = { BankBranch: 'BankBranch', BankAccount: 'BankAccount', BankAccountTransaction: 'BankAccountTransaction', - BankAccountBalance: 'BankAccountBalance', Inventory: 'Inventory', InventoryBankAccount: 'InventoryBankAccount', PosAccount: 'PosAccount', @@ -199,15 +198,6 @@ export const BankAccountTransactionScalarFieldEnum = { export type BankAccountTransactionScalarFieldEnum = (typeof BankAccountTransactionScalarFieldEnum)[keyof typeof BankAccountTransactionScalarFieldEnum] -export const BankAccountBalanceScalarFieldEnum = { - bankAccountId: 'bankAccountId', - balance: 'balance', - updatedAt: 'updatedAt' -} as const - -export type BankAccountBalanceScalarFieldEnum = (typeof BankAccountBalanceScalarFieldEnum)[keyof typeof BankAccountBalanceScalarFieldEnum] - - export const InventoryScalarFieldEnum = { id: 'id', name: 'name', diff --git a/src/generated/prisma/models.ts b/src/generated/prisma/models.ts index 18f627e..2c6dea6 100644 --- a/src/generated/prisma/models.ts +++ b/src/generated/prisma/models.ts @@ -15,7 +15,6 @@ export type * from './models/RefreshToken.js' export type * from './models/BankBranch.js' export type * from './models/BankAccount.js' export type * from './models/BankAccountTransaction.js' -export type * from './models/BankAccountBalance.js' export type * from './models/Inventory.js' export type * from './models/InventoryBankAccount.js' export type * from './models/PosAccount.js' diff --git a/src/generated/prisma/models/BankAccount.ts b/src/generated/prisma/models/BankAccount.ts index 606fcc1..4dd80e8 100644 --- a/src/generated/prisma/models/BankAccount.ts +++ b/src/generated/prisma/models/BankAccount.ts @@ -256,7 +256,6 @@ export type BankAccountWhereInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter bankAccountTransactions?: Prisma.BankAccountTransactionListRelationFilter - bankAccountBalances?: Prisma.BankAccountBalanceListRelationFilter } export type BankAccountOrderByWithRelationInput = { @@ -273,7 +272,6 @@ export type BankAccountOrderByWithRelationInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountOrderByRelationAggregateInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsOrderByRelationAggregateInput bankAccountTransactions?: Prisma.BankAccountTransactionOrderByRelationAggregateInput - bankAccountBalances?: Prisma.BankAccountBalanceOrderByRelationAggregateInput _relevance?: Prisma.BankAccountOrderByRelevanceInput } @@ -294,7 +292,6 @@ export type BankAccountWhereUniqueInput = Prisma.AtLeast<{ inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter bankAccountTransactions?: Prisma.BankAccountTransactionListRelationFilter - bankAccountBalances?: Prisma.BankAccountBalanceListRelationFilter }, "id" | "accountNumber" | "cardNumber" | "iban"> export type BankAccountOrderByWithAggregationInput = { @@ -341,7 +338,6 @@ export type BankAccountCreateInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput bankAccountTransactions?: Prisma.BankAccountTransactionCreateNestedManyWithoutBankAccountInput - bankAccountBalances?: Prisma.BankAccountBalanceCreateNestedManyWithoutBankAccountInput } export type BankAccountUncheckedCreateInput = { @@ -357,7 +353,6 @@ export type BankAccountUncheckedCreateInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedCreateNestedManyWithoutBankAccountInput - bankAccountBalances?: Prisma.BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput } export type BankAccountUpdateInput = { @@ -372,7 +367,6 @@ export type BankAccountUpdateInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput bankAccountTransactions?: Prisma.BankAccountTransactionUpdateManyWithoutBankAccountNestedInput - bankAccountBalances?: Prisma.BankAccountBalanceUpdateManyWithoutBankAccountNestedInput } export type BankAccountUncheckedUpdateInput = { @@ -388,7 +382,6 @@ export type BankAccountUncheckedUpdateInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedUpdateManyWithoutBankAccountNestedInput - bankAccountBalances?: Prisma.BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput } export type BankAccountCreateManyInput = { @@ -548,20 +541,6 @@ export type BankAccountUpdateOneRequiredWithoutBankAccountTransactionsNestedInpu update?: Prisma.XOR, Prisma.BankAccountUncheckedUpdateWithoutBankAccountTransactionsInput> } -export type BankAccountCreateNestedOneWithoutBankAccountBalancesInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutBankAccountBalancesInput - connect?: Prisma.BankAccountWhereUniqueInput -} - -export type BankAccountUpdateOneRequiredWithoutBankAccountBalancesNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutBankAccountBalancesInput - upsert?: Prisma.BankAccountUpsertWithoutBankAccountBalancesInput - connect?: Prisma.BankAccountWhereUniqueInput - update?: Prisma.XOR, Prisma.BankAccountUncheckedUpdateWithoutBankAccountBalancesInput> -} - export type BankAccountCreateNestedOneWithoutInventoryBankAccountsInput = { create?: Prisma.XOR connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutInventoryBankAccountsInput @@ -601,7 +580,6 @@ export type BankAccountCreateWithoutBranchInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput bankAccountTransactions?: Prisma.BankAccountTransactionCreateNestedManyWithoutBankAccountInput - bankAccountBalances?: Prisma.BankAccountBalanceCreateNestedManyWithoutBankAccountInput } export type BankAccountUncheckedCreateWithoutBranchInput = { @@ -616,7 +594,6 @@ export type BankAccountUncheckedCreateWithoutBranchInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedCreateNestedManyWithoutBankAccountInput - bankAccountBalances?: Prisma.BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput } export type BankAccountCreateOrConnectWithoutBranchInput = { @@ -671,7 +648,6 @@ export type BankAccountCreateWithoutBankAccountTransactionsInput = { branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput - bankAccountBalances?: Prisma.BankAccountBalanceCreateNestedManyWithoutBankAccountInput } export type BankAccountUncheckedCreateWithoutBankAccountTransactionsInput = { @@ -686,7 +662,6 @@ export type BankAccountUncheckedCreateWithoutBankAccountTransactionsInput = { deletedAt?: Date | string | null inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput - bankAccountBalances?: Prisma.BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput } export type BankAccountCreateOrConnectWithoutBankAccountTransactionsInput = { @@ -716,7 +691,6 @@ export type BankAccountUpdateWithoutBankAccountTransactionsInput = { branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput - bankAccountBalances?: Prisma.BankAccountBalanceUpdateManyWithoutBankAccountNestedInput } export type BankAccountUncheckedUpdateWithoutBankAccountTransactionsInput = { @@ -731,81 +705,6 @@ export type BankAccountUncheckedUpdateWithoutBankAccountTransactionsInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput - bankAccountBalances?: Prisma.BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput -} - -export type BankAccountCreateWithoutBankAccountBalancesInput = { - accountNumber?: string | null - cardNumber?: string | null - name: string - iban?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput - inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput - bankAccountTransactions?: Prisma.BankAccountTransactionCreateNestedManyWithoutBankAccountInput -} - -export type BankAccountUncheckedCreateWithoutBankAccountBalancesInput = { - id?: number - accountNumber?: string | null - cardNumber?: string | null - name: string - iban?: string | null - branchId: number - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput - bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedCreateNestedManyWithoutBankAccountInput -} - -export type BankAccountCreateOrConnectWithoutBankAccountBalancesInput = { - where: Prisma.BankAccountWhereUniqueInput - create: Prisma.XOR -} - -export type BankAccountUpsertWithoutBankAccountBalancesInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.BankAccountWhereInput -} - -export type BankAccountUpdateToOneWithWhereWithoutBankAccountBalancesInput = { - where?: Prisma.BankAccountWhereInput - data: Prisma.XOR -} - -export type BankAccountUpdateWithoutBankAccountBalancesInput = { - accountNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - cardNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - name?: Prisma.StringFieldUpdateOperationsInput | string - iban?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput - bankAccountTransactions?: Prisma.BankAccountTransactionUpdateManyWithoutBankAccountNestedInput -} - -export type BankAccountUncheckedUpdateWithoutBankAccountBalancesInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - accountNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - cardNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - name?: Prisma.StringFieldUpdateOperationsInput | string - iban?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - branchId?: Prisma.IntFieldUpdateOperationsInput | number - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput - bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedUpdateManyWithoutBankAccountNestedInput } export type BankAccountCreateWithoutInventoryBankAccountsInput = { @@ -819,7 +718,6 @@ export type BankAccountCreateWithoutInventoryBankAccountsInput = { branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput bankAccountTransactions?: Prisma.BankAccountTransactionCreateNestedManyWithoutBankAccountInput - bankAccountBalances?: Prisma.BankAccountBalanceCreateNestedManyWithoutBankAccountInput } export type BankAccountUncheckedCreateWithoutInventoryBankAccountsInput = { @@ -834,7 +732,6 @@ export type BankAccountUncheckedCreateWithoutInventoryBankAccountsInput = { deletedAt?: Date | string | null purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedCreateNestedManyWithoutBankAccountInput - bankAccountBalances?: Prisma.BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput } export type BankAccountCreateOrConnectWithoutInventoryBankAccountsInput = { @@ -864,7 +761,6 @@ export type BankAccountUpdateWithoutInventoryBankAccountsInput = { branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput bankAccountTransactions?: Prisma.BankAccountTransactionUpdateManyWithoutBankAccountNestedInput - bankAccountBalances?: Prisma.BankAccountBalanceUpdateManyWithoutBankAccountNestedInput } export type BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput = { @@ -879,7 +775,6 @@ export type BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedUpdateManyWithoutBankAccountNestedInput - bankAccountBalances?: Prisma.BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput } export type BankAccountCreateWithoutPurchaseReceiptPaymentsInput = { @@ -893,7 +788,6 @@ export type BankAccountCreateWithoutPurchaseReceiptPaymentsInput = { branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput bankAccountTransactions?: Prisma.BankAccountTransactionCreateNestedManyWithoutBankAccountInput - bankAccountBalances?: Prisma.BankAccountBalanceCreateNestedManyWithoutBankAccountInput } export type BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput = { @@ -908,7 +802,6 @@ export type BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput = { deletedAt?: Date | string | null inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedCreateNestedManyWithoutBankAccountInput - bankAccountBalances?: Prisma.BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput } export type BankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput = { @@ -938,7 +831,6 @@ export type BankAccountUpdateWithoutPurchaseReceiptPaymentsInput = { branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput bankAccountTransactions?: Prisma.BankAccountTransactionUpdateManyWithoutBankAccountNestedInput - bankAccountBalances?: Prisma.BankAccountBalanceUpdateManyWithoutBankAccountNestedInput } export type BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput = { @@ -953,7 +845,6 @@ export type BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedUpdateManyWithoutBankAccountNestedInput - bankAccountBalances?: Prisma.BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput } export type BankAccountCreateManyBranchInput = { @@ -978,7 +869,6 @@ export type BankAccountUpdateWithoutBranchInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput bankAccountTransactions?: Prisma.BankAccountTransactionUpdateManyWithoutBankAccountNestedInput - bankAccountBalances?: Prisma.BankAccountBalanceUpdateManyWithoutBankAccountNestedInput } export type BankAccountUncheckedUpdateWithoutBranchInput = { @@ -993,7 +883,6 @@ export type BankAccountUncheckedUpdateWithoutBranchInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedUpdateManyWithoutBankAccountNestedInput - bankAccountBalances?: Prisma.BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput } export type BankAccountUncheckedUpdateManyWithoutBranchInput = { @@ -1016,14 +905,12 @@ export type BankAccountCountOutputType = { inventoryBankAccounts: number purchaseReceiptPayments: number bankAccountTransactions: number - bankAccountBalances: number } export type BankAccountCountOutputTypeSelect = { inventoryBankAccounts?: boolean | BankAccountCountOutputTypeCountInventoryBankAccountsArgs purchaseReceiptPayments?: boolean | BankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs bankAccountTransactions?: boolean | BankAccountCountOutputTypeCountBankAccountTransactionsArgs - bankAccountBalances?: boolean | BankAccountCountOutputTypeCountBankAccountBalancesArgs } /** @@ -1057,13 +944,6 @@ export type BankAccountCountOutputTypeCountBankAccountTransactionsArgs = { - where?: Prisma.BankAccountBalanceWhereInput -} - export type BankAccountSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean @@ -1079,7 +959,6 @@ export type BankAccountSelect purchaseReceiptPayments?: boolean | Prisma.BankAccount$purchaseReceiptPaymentsArgs bankAccountTransactions?: boolean | Prisma.BankAccount$bankAccountTransactionsArgs - bankAccountBalances?: boolean | Prisma.BankAccount$bankAccountBalancesArgs _count?: boolean | Prisma.BankAccountCountOutputTypeDefaultArgs }, ExtArgs["result"]["bankAccount"]> @@ -1103,7 +982,6 @@ export type BankAccountInclude purchaseReceiptPayments?: boolean | Prisma.BankAccount$purchaseReceiptPaymentsArgs bankAccountTransactions?: boolean | Prisma.BankAccount$bankAccountTransactionsArgs - bankAccountBalances?: boolean | Prisma.BankAccount$bankAccountBalancesArgs _count?: boolean | Prisma.BankAccountCountOutputTypeDefaultArgs } @@ -1114,7 +992,6 @@ export type $BankAccountPayload[] purchaseReceiptPayments: Prisma.$PurchaseReceiptPaymentsPayload[] bankAccountTransactions: Prisma.$BankAccountTransactionPayload[] - bankAccountBalances: Prisma.$BankAccountBalancePayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: number @@ -1470,7 +1347,6 @@ export interface Prisma__BankAccountClient = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> purchaseReceiptPayments = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> bankAccountTransactions = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> - bankAccountBalances = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -1923,30 +1799,6 @@ export type BankAccount$bankAccountTransactionsArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null - where?: Prisma.BankAccountBalanceWhereInput - orderBy?: Prisma.BankAccountBalanceOrderByWithRelationInput | Prisma.BankAccountBalanceOrderByWithRelationInput[] - cursor?: Prisma.BankAccountBalanceWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.BankAccountBalanceScalarFieldEnum | Prisma.BankAccountBalanceScalarFieldEnum[] -} - /** * BankAccount without action */ diff --git a/src/generated/prisma/models/BankAccountBalance.ts b/src/generated/prisma/models/BankAccountBalance.ts deleted file mode 100644 index c17f4d8..0000000 --- a/src/generated/prisma/models/BankAccountBalance.ts +++ /dev/null @@ -1,1195 +0,0 @@ - -/* !!! This is code generated by Prisma. Do not edit directly. !!! */ -/* eslint-disable */ -// biome-ignore-all lint: generated file -// @ts-nocheck -/* - * This file exports the `BankAccountBalance` model and its related types. - * - * 🟢 You can import this file directly. - */ -import type * as runtime from "@prisma/client/runtime/client" -import type * as $Enums from "../enums.js" -import type * as Prisma from "../internal/prismaNamespace.js" - -/** - * Model BankAccountBalance - * - */ -export type BankAccountBalanceModel = runtime.Types.Result.DefaultSelection - -export type AggregateBankAccountBalance = { - _count: BankAccountBalanceCountAggregateOutputType | null - _avg: BankAccountBalanceAvgAggregateOutputType | null - _sum: BankAccountBalanceSumAggregateOutputType | null - _min: BankAccountBalanceMinAggregateOutputType | null - _max: BankAccountBalanceMaxAggregateOutputType | null -} - -export type BankAccountBalanceAvgAggregateOutputType = { - bankAccountId: number | null - balance: runtime.Decimal | null -} - -export type BankAccountBalanceSumAggregateOutputType = { - bankAccountId: number | null - balance: runtime.Decimal | null -} - -export type BankAccountBalanceMinAggregateOutputType = { - bankAccountId: number | null - balance: runtime.Decimal | null - updatedAt: Date | null -} - -export type BankAccountBalanceMaxAggregateOutputType = { - bankAccountId: number | null - balance: runtime.Decimal | null - updatedAt: Date | null -} - -export type BankAccountBalanceCountAggregateOutputType = { - bankAccountId: number - balance: number - updatedAt: number - _all: number -} - - -export type BankAccountBalanceAvgAggregateInputType = { - bankAccountId?: true - balance?: true -} - -export type BankAccountBalanceSumAggregateInputType = { - bankAccountId?: true - balance?: true -} - -export type BankAccountBalanceMinAggregateInputType = { - bankAccountId?: true - balance?: true - updatedAt?: true -} - -export type BankAccountBalanceMaxAggregateInputType = { - bankAccountId?: true - balance?: true - updatedAt?: true -} - -export type BankAccountBalanceCountAggregateInputType = { - bankAccountId?: true - balance?: true - updatedAt?: true - _all?: true -} - -export type BankAccountBalanceAggregateArgs = { - /** - * Filter which BankAccountBalance to aggregate. - */ - where?: Prisma.BankAccountBalanceWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of BankAccountBalances to fetch. - */ - orderBy?: Prisma.BankAccountBalanceOrderByWithRelationInput | Prisma.BankAccountBalanceOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the start position - */ - cursor?: Prisma.BankAccountBalanceWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` BankAccountBalances 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` BankAccountBalances. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Count returned BankAccountBalances - **/ - _count?: true | BankAccountBalanceCountAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to average - **/ - _avg?: BankAccountBalanceAvgAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to sum - **/ - _sum?: BankAccountBalanceSumAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the minimum value - **/ - _min?: BankAccountBalanceMinAggregateInputType - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} - * - * Select which fields to find the maximum value - **/ - _max?: BankAccountBalanceMaxAggregateInputType -} - -export type GetBankAccountBalanceAggregateType = { - [P in keyof T & keyof AggregateBankAccountBalance]: P extends '_count' | 'count' - ? T[P] extends true - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType -} - - - - -export type BankAccountBalanceGroupByArgs = { - where?: Prisma.BankAccountBalanceWhereInput - orderBy?: Prisma.BankAccountBalanceOrderByWithAggregationInput | Prisma.BankAccountBalanceOrderByWithAggregationInput[] - by: Prisma.BankAccountBalanceScalarFieldEnum[] | Prisma.BankAccountBalanceScalarFieldEnum - having?: Prisma.BankAccountBalanceScalarWhereWithAggregatesInput - take?: number - skip?: number - _count?: BankAccountBalanceCountAggregateInputType | true - _avg?: BankAccountBalanceAvgAggregateInputType - _sum?: BankAccountBalanceSumAggregateInputType - _min?: BankAccountBalanceMinAggregateInputType - _max?: BankAccountBalanceMaxAggregateInputType -} - -export type BankAccountBalanceGroupByOutputType = { - bankAccountId: number - balance: runtime.Decimal - updatedAt: Date - _count: BankAccountBalanceCountAggregateOutputType | null - _avg: BankAccountBalanceAvgAggregateOutputType | null - _sum: BankAccountBalanceSumAggregateOutputType | null - _min: BankAccountBalanceMinAggregateOutputType | null - _max: BankAccountBalanceMaxAggregateOutputType | null -} - -type GetBankAccountBalanceGroupByPayload = Prisma.PrismaPromise< - Array< - Prisma.PickEnumerable & - { - [P in ((keyof T) & (keyof BankAccountBalanceGroupByOutputType))]: P extends '_count' - ? T[P] extends boolean - ? number - : Prisma.GetScalarType - : Prisma.GetScalarType - } - > - > - - - -export type BankAccountBalanceWhereInput = { - AND?: Prisma.BankAccountBalanceWhereInput | Prisma.BankAccountBalanceWhereInput[] - OR?: Prisma.BankAccountBalanceWhereInput[] - NOT?: Prisma.BankAccountBalanceWhereInput | Prisma.BankAccountBalanceWhereInput[] - bankAccountId?: Prisma.IntFilter<"BankAccountBalance"> | number - balance?: Prisma.DecimalFilter<"BankAccountBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeFilter<"BankAccountBalance"> | Date | string - bankAccount?: Prisma.XOR -} - -export type BankAccountBalanceOrderByWithRelationInput = { - bankAccountId?: Prisma.SortOrder - balance?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - bankAccount?: Prisma.BankAccountOrderByWithRelationInput -} - -export type BankAccountBalanceWhereUniqueInput = Prisma.AtLeast<{ - bankAccountId?: number - AND?: Prisma.BankAccountBalanceWhereInput | Prisma.BankAccountBalanceWhereInput[] - OR?: Prisma.BankAccountBalanceWhereInput[] - NOT?: Prisma.BankAccountBalanceWhereInput | Prisma.BankAccountBalanceWhereInput[] - balance?: Prisma.DecimalFilter<"BankAccountBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeFilter<"BankAccountBalance"> | Date | string - bankAccount?: Prisma.XOR -}, "bankAccountId"> - -export type BankAccountBalanceOrderByWithAggregationInput = { - bankAccountId?: Prisma.SortOrder - balance?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder - _count?: Prisma.BankAccountBalanceCountOrderByAggregateInput - _avg?: Prisma.BankAccountBalanceAvgOrderByAggregateInput - _max?: Prisma.BankAccountBalanceMaxOrderByAggregateInput - _min?: Prisma.BankAccountBalanceMinOrderByAggregateInput - _sum?: Prisma.BankAccountBalanceSumOrderByAggregateInput -} - -export type BankAccountBalanceScalarWhereWithAggregatesInput = { - AND?: Prisma.BankAccountBalanceScalarWhereWithAggregatesInput | Prisma.BankAccountBalanceScalarWhereWithAggregatesInput[] - OR?: Prisma.BankAccountBalanceScalarWhereWithAggregatesInput[] - NOT?: Prisma.BankAccountBalanceScalarWhereWithAggregatesInput | Prisma.BankAccountBalanceScalarWhereWithAggregatesInput[] - bankAccountId?: Prisma.IntWithAggregatesFilter<"BankAccountBalance"> | number - balance?: Prisma.DecimalWithAggregatesFilter<"BankAccountBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeWithAggregatesFilter<"BankAccountBalance"> | Date | string -} - -export type BankAccountBalanceCreateInput = { - balance: runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Date | string - bankAccount: Prisma.BankAccountCreateNestedOneWithoutBankAccountBalancesInput -} - -export type BankAccountBalanceUncheckedCreateInput = { - bankAccountId: number - balance: runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Date | string -} - -export type BankAccountBalanceUpdateInput = { - balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutBankAccountBalancesNestedInput -} - -export type BankAccountBalanceUncheckedUpdateInput = { - bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number - balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type BankAccountBalanceCreateManyInput = { - bankAccountId: number - balance: runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Date | string -} - -export type BankAccountBalanceUpdateManyMutationInput = { - balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type BankAccountBalanceUncheckedUpdateManyInput = { - bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number - balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type BankAccountBalanceListRelationFilter = { - every?: Prisma.BankAccountBalanceWhereInput - some?: Prisma.BankAccountBalanceWhereInput - none?: Prisma.BankAccountBalanceWhereInput -} - -export type BankAccountBalanceOrderByRelationAggregateInput = { - _count?: Prisma.SortOrder -} - -export type BankAccountBalanceCountOrderByAggregateInput = { - bankAccountId?: Prisma.SortOrder - balance?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type BankAccountBalanceAvgOrderByAggregateInput = { - bankAccountId?: Prisma.SortOrder - balance?: Prisma.SortOrder -} - -export type BankAccountBalanceMaxOrderByAggregateInput = { - bankAccountId?: Prisma.SortOrder - balance?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type BankAccountBalanceMinOrderByAggregateInput = { - bankAccountId?: Prisma.SortOrder - balance?: Prisma.SortOrder - updatedAt?: Prisma.SortOrder -} - -export type BankAccountBalanceSumOrderByAggregateInput = { - bankAccountId?: Prisma.SortOrder - balance?: Prisma.SortOrder -} - -export type BankAccountBalanceCreateNestedManyWithoutBankAccountInput = { - create?: Prisma.XOR | Prisma.BankAccountBalanceCreateWithoutBankAccountInput[] | Prisma.BankAccountBalanceUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.BankAccountBalanceCreateOrConnectWithoutBankAccountInput | Prisma.BankAccountBalanceCreateOrConnectWithoutBankAccountInput[] - createMany?: Prisma.BankAccountBalanceCreateManyBankAccountInputEnvelope - connect?: Prisma.BankAccountBalanceWhereUniqueInput | Prisma.BankAccountBalanceWhereUniqueInput[] -} - -export type BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput = { - create?: Prisma.XOR | Prisma.BankAccountBalanceCreateWithoutBankAccountInput[] | Prisma.BankAccountBalanceUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.BankAccountBalanceCreateOrConnectWithoutBankAccountInput | Prisma.BankAccountBalanceCreateOrConnectWithoutBankAccountInput[] - createMany?: Prisma.BankAccountBalanceCreateManyBankAccountInputEnvelope - connect?: Prisma.BankAccountBalanceWhereUniqueInput | Prisma.BankAccountBalanceWhereUniqueInput[] -} - -export type BankAccountBalanceUpdateManyWithoutBankAccountNestedInput = { - create?: Prisma.XOR | Prisma.BankAccountBalanceCreateWithoutBankAccountInput[] | Prisma.BankAccountBalanceUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.BankAccountBalanceCreateOrConnectWithoutBankAccountInput | Prisma.BankAccountBalanceCreateOrConnectWithoutBankAccountInput[] - upsert?: Prisma.BankAccountBalanceUpsertWithWhereUniqueWithoutBankAccountInput | Prisma.BankAccountBalanceUpsertWithWhereUniqueWithoutBankAccountInput[] - createMany?: Prisma.BankAccountBalanceCreateManyBankAccountInputEnvelope - set?: Prisma.BankAccountBalanceWhereUniqueInput | Prisma.BankAccountBalanceWhereUniqueInput[] - disconnect?: Prisma.BankAccountBalanceWhereUniqueInput | Prisma.BankAccountBalanceWhereUniqueInput[] - delete?: Prisma.BankAccountBalanceWhereUniqueInput | Prisma.BankAccountBalanceWhereUniqueInput[] - connect?: Prisma.BankAccountBalanceWhereUniqueInput | Prisma.BankAccountBalanceWhereUniqueInput[] - update?: Prisma.BankAccountBalanceUpdateWithWhereUniqueWithoutBankAccountInput | Prisma.BankAccountBalanceUpdateWithWhereUniqueWithoutBankAccountInput[] - updateMany?: Prisma.BankAccountBalanceUpdateManyWithWhereWithoutBankAccountInput | Prisma.BankAccountBalanceUpdateManyWithWhereWithoutBankAccountInput[] - deleteMany?: Prisma.BankAccountBalanceScalarWhereInput | Prisma.BankAccountBalanceScalarWhereInput[] -} - -export type BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput = { - create?: Prisma.XOR | Prisma.BankAccountBalanceCreateWithoutBankAccountInput[] | Prisma.BankAccountBalanceUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.BankAccountBalanceCreateOrConnectWithoutBankAccountInput | Prisma.BankAccountBalanceCreateOrConnectWithoutBankAccountInput[] - upsert?: Prisma.BankAccountBalanceUpsertWithWhereUniqueWithoutBankAccountInput | Prisma.BankAccountBalanceUpsertWithWhereUniqueWithoutBankAccountInput[] - createMany?: Prisma.BankAccountBalanceCreateManyBankAccountInputEnvelope - set?: Prisma.BankAccountBalanceWhereUniqueInput | Prisma.BankAccountBalanceWhereUniqueInput[] - disconnect?: Prisma.BankAccountBalanceWhereUniqueInput | Prisma.BankAccountBalanceWhereUniqueInput[] - delete?: Prisma.BankAccountBalanceWhereUniqueInput | Prisma.BankAccountBalanceWhereUniqueInput[] - connect?: Prisma.BankAccountBalanceWhereUniqueInput | Prisma.BankAccountBalanceWhereUniqueInput[] - update?: Prisma.BankAccountBalanceUpdateWithWhereUniqueWithoutBankAccountInput | Prisma.BankAccountBalanceUpdateWithWhereUniqueWithoutBankAccountInput[] - updateMany?: Prisma.BankAccountBalanceUpdateManyWithWhereWithoutBankAccountInput | Prisma.BankAccountBalanceUpdateManyWithWhereWithoutBankAccountInput[] - deleteMany?: Prisma.BankAccountBalanceScalarWhereInput | Prisma.BankAccountBalanceScalarWhereInput[] -} - -export type BankAccountBalanceCreateWithoutBankAccountInput = { - balance: runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Date | string -} - -export type BankAccountBalanceUncheckedCreateWithoutBankAccountInput = { - balance: runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Date | string -} - -export type BankAccountBalanceCreateOrConnectWithoutBankAccountInput = { - where: Prisma.BankAccountBalanceWhereUniqueInput - create: Prisma.XOR -} - -export type BankAccountBalanceCreateManyBankAccountInputEnvelope = { - data: Prisma.BankAccountBalanceCreateManyBankAccountInput | Prisma.BankAccountBalanceCreateManyBankAccountInput[] - skipDuplicates?: boolean -} - -export type BankAccountBalanceUpsertWithWhereUniqueWithoutBankAccountInput = { - where: Prisma.BankAccountBalanceWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR -} - -export type BankAccountBalanceUpdateWithWhereUniqueWithoutBankAccountInput = { - where: Prisma.BankAccountBalanceWhereUniqueInput - data: Prisma.XOR -} - -export type BankAccountBalanceUpdateManyWithWhereWithoutBankAccountInput = { - where: Prisma.BankAccountBalanceScalarWhereInput - data: Prisma.XOR -} - -export type BankAccountBalanceScalarWhereInput = { - AND?: Prisma.BankAccountBalanceScalarWhereInput | Prisma.BankAccountBalanceScalarWhereInput[] - OR?: Prisma.BankAccountBalanceScalarWhereInput[] - NOT?: Prisma.BankAccountBalanceScalarWhereInput | Prisma.BankAccountBalanceScalarWhereInput[] - bankAccountId?: Prisma.IntFilter<"BankAccountBalance"> | number - balance?: Prisma.DecimalFilter<"BankAccountBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeFilter<"BankAccountBalance"> | Date | string -} - -export type BankAccountBalanceCreateManyBankAccountInput = { - balance: runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Date | string -} - -export type BankAccountBalanceUpdateWithoutBankAccountInput = { - balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type BankAccountBalanceUncheckedUpdateWithoutBankAccountInput = { - balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - -export type BankAccountBalanceUncheckedUpdateManyWithoutBankAccountInput = { - balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string -} - - - -export type BankAccountBalanceSelect = runtime.Types.Extensions.GetSelect<{ - bankAccountId?: boolean - balance?: boolean - updatedAt?: boolean - bankAccount?: boolean | Prisma.BankAccountDefaultArgs -}, ExtArgs["result"]["bankAccountBalance"]> - - - -export type BankAccountBalanceSelectScalar = { - bankAccountId?: boolean - balance?: boolean - updatedAt?: boolean -} - -export type BankAccountBalanceOmit = runtime.Types.Extensions.GetOmit<"bankAccountId" | "balance" | "updatedAt", ExtArgs["result"]["bankAccountBalance"]> -export type BankAccountBalanceInclude = { - bankAccount?: boolean | Prisma.BankAccountDefaultArgs -} - -export type $BankAccountBalancePayload = { - name: "BankAccountBalance" - objects: { - bankAccount: Prisma.$BankAccountPayload - } - scalars: runtime.Types.Extensions.GetPayloadResult<{ - bankAccountId: number - balance: runtime.Decimal - updatedAt: Date - }, ExtArgs["result"]["bankAccountBalance"]> - composites: {} -} - -export type BankAccountBalanceGetPayload = runtime.Types.Result.GetResult - -export type BankAccountBalanceCountArgs = - Omit & { - select?: BankAccountBalanceCountAggregateInputType | true - } - -export interface BankAccountBalanceDelegate { - [K: symbol]: { types: Prisma.TypeMap['model']['BankAccountBalance'], meta: { name: 'BankAccountBalance' } } - /** - * Find zero or one BankAccountBalance that matches the filter. - * @param {BankAccountBalanceFindUniqueArgs} args - Arguments to find a BankAccountBalance - * @example - * // Get one BankAccountBalance - * const bankAccountBalance = await prisma.bankAccountBalance.findUnique({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__BankAccountBalanceClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find one BankAccountBalance that matches the filter or throw an error with `error.code='P2025'` - * if no matches were found. - * @param {BankAccountBalanceFindUniqueOrThrowArgs} args - Arguments to find a BankAccountBalance - * @example - * // Get one BankAccountBalance - * const bankAccountBalance = await prisma.bankAccountBalance.findUniqueOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__BankAccountBalanceClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find the first BankAccountBalance 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 {BankAccountBalanceFindFirstArgs} args - Arguments to find a BankAccountBalance - * @example - * // Get one BankAccountBalance - * const bankAccountBalance = await prisma.bankAccountBalance.findFirst({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__BankAccountBalanceClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - - /** - * Find the first BankAccountBalance 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 {BankAccountBalanceFindFirstOrThrowArgs} args - Arguments to find a BankAccountBalance - * @example - * // Get one BankAccountBalance - * const bankAccountBalance = await prisma.bankAccountBalance.findFirstOrThrow({ - * where: { - * // ... provide filter here - * } - * }) - */ - findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__BankAccountBalanceClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Find zero or more BankAccountBalances 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 {BankAccountBalanceFindManyArgs} args - Arguments to filter and select certain fields only. - * @example - * // Get all BankAccountBalances - * const bankAccountBalances = await prisma.bankAccountBalance.findMany() - * - * // Get first 10 BankAccountBalances - * const bankAccountBalances = await prisma.bankAccountBalance.findMany({ take: 10 }) - * - * // Only select the `bankAccountId` - * const bankAccountBalanceWithBankAccountIdOnly = await prisma.bankAccountBalance.findMany({ select: { bankAccountId: true } }) - * - */ - findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> - - /** - * Create a BankAccountBalance. - * @param {BankAccountBalanceCreateArgs} args - Arguments to create a BankAccountBalance. - * @example - * // Create one BankAccountBalance - * const BankAccountBalance = await prisma.bankAccountBalance.create({ - * data: { - * // ... data to create a BankAccountBalance - * } - * }) - * - */ - create(args: Prisma.SelectSubset>): Prisma.Prisma__BankAccountBalanceClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Create many BankAccountBalances. - * @param {BankAccountBalanceCreateManyArgs} args - Arguments to create many BankAccountBalances. - * @example - * // Create many BankAccountBalances - * const bankAccountBalance = await prisma.bankAccountBalance.createMany({ - * data: [ - * // ... provide data here - * ] - * }) - * - */ - createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Delete a BankAccountBalance. - * @param {BankAccountBalanceDeleteArgs} args - Arguments to delete one BankAccountBalance. - * @example - * // Delete one BankAccountBalance - * const BankAccountBalance = await prisma.bankAccountBalance.delete({ - * where: { - * // ... filter to delete one BankAccountBalance - * } - * }) - * - */ - delete(args: Prisma.SelectSubset>): Prisma.Prisma__BankAccountBalanceClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Update one BankAccountBalance. - * @param {BankAccountBalanceUpdateArgs} args - Arguments to update one BankAccountBalance. - * @example - * // Update one BankAccountBalance - * const bankAccountBalance = await prisma.bankAccountBalance.update({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - update(args: Prisma.SelectSubset>): Prisma.Prisma__BankAccountBalanceClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - /** - * Delete zero or more BankAccountBalances. - * @param {BankAccountBalanceDeleteManyArgs} args - Arguments to filter BankAccountBalances to delete. - * @example - * // Delete a few BankAccountBalances - * const { count } = await prisma.bankAccountBalance.deleteMany({ - * where: { - * // ... provide filter here - * } - * }) - * - */ - deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Update zero or more BankAccountBalances. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {BankAccountBalanceUpdateManyArgs} args - Arguments to update one or more rows. - * @example - * // Update many BankAccountBalances - * const bankAccountBalance = await prisma.bankAccountBalance.updateMany({ - * where: { - * // ... provide filter here - * }, - * data: { - * // ... provide data here - * } - * }) - * - */ - updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise - - /** - * Create or update one BankAccountBalance. - * @param {BankAccountBalanceUpsertArgs} args - Arguments to update or create a BankAccountBalance. - * @example - * // Update or create a BankAccountBalance - * const bankAccountBalance = await prisma.bankAccountBalance.upsert({ - * create: { - * // ... data to create a BankAccountBalance - * }, - * update: { - * // ... in case it already exists, update - * }, - * where: { - * // ... the filter for the BankAccountBalance we want to update - * } - * }) - */ - upsert(args: Prisma.SelectSubset>): Prisma.Prisma__BankAccountBalanceClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> - - - /** - * Count the number of BankAccountBalances. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {BankAccountBalanceCountArgs} args - Arguments to filter BankAccountBalances to count. - * @example - * // Count the number of BankAccountBalances - * const count = await prisma.bankAccountBalance.count({ - * where: { - * // ... the filter for the BankAccountBalances we want to count - * } - * }) - **/ - count( - args?: Prisma.Subset, - ): Prisma.PrismaPromise< - T extends runtime.Types.Utils.Record<'select', any> - ? T['select'] extends true - ? number - : Prisma.GetScalarType - : number - > - - /** - * Allows you to perform aggregations operations on a BankAccountBalance. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {BankAccountBalanceAggregateArgs} args - Select which aggregations you would like to apply and on what fields. - * @example - * // Ordered by age ascending - * // Where email contains prisma.io - * // Limited to the 10 users - * const aggregations = await prisma.user.aggregate({ - * _avg: { - * age: true, - * }, - * where: { - * email: { - * contains: "prisma.io", - * }, - * }, - * orderBy: { - * age: "asc", - * }, - * take: 10, - * }) - **/ - aggregate(args: Prisma.Subset): Prisma.PrismaPromise> - - /** - * Group by BankAccountBalance. - * Note, that providing `undefined` is treated as the value not being there. - * Read more here: https://pris.ly/d/null-undefined - * @param {BankAccountBalanceGroupByArgs} 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 BankAccountBalanceGroupByArgs, - HasSelectOrTake extends Prisma.Or< - Prisma.Extends<'skip', Prisma.Keys>, - Prisma.Extends<'take', Prisma.Keys> - >, - OrderByArg extends Prisma.True extends HasSelectOrTake - ? { orderBy: BankAccountBalanceGroupByArgs['orderBy'] } - : { orderBy?: BankAccountBalanceGroupByArgs['orderBy'] }, - OrderFields extends Prisma.ExcludeUnderscoreKeys>>, - ByFields extends Prisma.MaybeTupleToUnion, - ByValid extends Prisma.Has, - HavingFields extends Prisma.GetHavingFields, - HavingValid extends Prisma.Has, - ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, - InputErrors extends ByEmpty extends Prisma.True - ? `Error: "by" must not be empty.` - : HavingValid extends Prisma.False - ? { - [P in HavingFields]: P extends ByFields - ? never - : P extends string - ? `Error: Field "${P}" used in "having" needs to be provided in "by".` - : [ - Error, - 'Field ', - P, - ` in "having" needs to be provided in "by"`, - ] - }[HavingFields] - : 'take' extends Prisma.Keys - ? 'orderBy' extends Prisma.Keys - ? ByValid extends Prisma.True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "take", you also need to provide "orderBy"' - : 'skip' extends Prisma.Keys - ? 'orderBy' extends Prisma.Keys - ? ByValid extends Prisma.True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - : 'Error: If you provide "skip", you also need to provide "orderBy"' - : ByValid extends Prisma.True - ? {} - : { - [P in OrderFields]: P extends ByFields - ? never - : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` - }[OrderFields] - >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetBankAccountBalanceGroupByPayload : Prisma.PrismaPromise -/** - * Fields of the BankAccountBalance model - */ -readonly fields: BankAccountBalanceFieldRefs; -} - -/** - * The delegate class that acts as a "Promise-like" for BankAccountBalance. - * 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__BankAccountBalanceClient extends Prisma.PrismaPromise { - readonly [Symbol.toStringTag]: "PrismaPromise" - bankAccount = {}>(args?: Prisma.Subset>): Prisma.Prisma__BankAccountClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise - /** - * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The - * resolved value cannot be modified from the callback. - * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). - * @returns A Promise for the completion of the callback. - */ - finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise -} - - - - -/** - * Fields of the BankAccountBalance model - */ -export interface BankAccountBalanceFieldRefs { - readonly bankAccountId: Prisma.FieldRef<"BankAccountBalance", 'Int'> - readonly balance: Prisma.FieldRef<"BankAccountBalance", 'Decimal'> - readonly updatedAt: Prisma.FieldRef<"BankAccountBalance", 'DateTime'> -} - - -// Custom InputTypes -/** - * BankAccountBalance findUnique - */ -export type BankAccountBalanceFindUniqueArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null - /** - * Filter, which BankAccountBalance to fetch. - */ - where: Prisma.BankAccountBalanceWhereUniqueInput -} - -/** - * BankAccountBalance findUniqueOrThrow - */ -export type BankAccountBalanceFindUniqueOrThrowArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null - /** - * Filter, which BankAccountBalance to fetch. - */ - where: Prisma.BankAccountBalanceWhereUniqueInput -} - -/** - * BankAccountBalance findFirst - */ -export type BankAccountBalanceFindFirstArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null - /** - * Filter, which BankAccountBalance to fetch. - */ - where?: Prisma.BankAccountBalanceWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of BankAccountBalances to fetch. - */ - orderBy?: Prisma.BankAccountBalanceOrderByWithRelationInput | Prisma.BankAccountBalanceOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for BankAccountBalances. - */ - cursor?: Prisma.BankAccountBalanceWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` BankAccountBalances 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` BankAccountBalances. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of BankAccountBalances. - */ - distinct?: Prisma.BankAccountBalanceScalarFieldEnum | Prisma.BankAccountBalanceScalarFieldEnum[] -} - -/** - * BankAccountBalance findFirstOrThrow - */ -export type BankAccountBalanceFindFirstOrThrowArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null - /** - * Filter, which BankAccountBalance to fetch. - */ - where?: Prisma.BankAccountBalanceWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of BankAccountBalances to fetch. - */ - orderBy?: Prisma.BankAccountBalanceOrderByWithRelationInput | Prisma.BankAccountBalanceOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for searching for BankAccountBalances. - */ - cursor?: Prisma.BankAccountBalanceWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` BankAccountBalances 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` BankAccountBalances. - */ - skip?: number - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} - * - * Filter by unique combinations of BankAccountBalances. - */ - distinct?: Prisma.BankAccountBalanceScalarFieldEnum | Prisma.BankAccountBalanceScalarFieldEnum[] -} - -/** - * BankAccountBalance findMany - */ -export type BankAccountBalanceFindManyArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null - /** - * Filter, which BankAccountBalances to fetch. - */ - where?: Prisma.BankAccountBalanceWhereInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} - * - * Determine the order of BankAccountBalances to fetch. - */ - orderBy?: Prisma.BankAccountBalanceOrderByWithRelationInput | Prisma.BankAccountBalanceOrderByWithRelationInput[] - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} - * - * Sets the position for listing BankAccountBalances. - */ - cursor?: Prisma.BankAccountBalanceWhereUniqueInput - /** - * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} - * - * Take `±n` BankAccountBalances 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` BankAccountBalances. - */ - skip?: number - distinct?: Prisma.BankAccountBalanceScalarFieldEnum | Prisma.BankAccountBalanceScalarFieldEnum[] -} - -/** - * BankAccountBalance create - */ -export type BankAccountBalanceCreateArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null - /** - * The data needed to create a BankAccountBalance. - */ - data: Prisma.XOR -} - -/** - * BankAccountBalance createMany - */ -export type BankAccountBalanceCreateManyArgs = { - /** - * The data used to create many BankAccountBalances. - */ - data: Prisma.BankAccountBalanceCreateManyInput | Prisma.BankAccountBalanceCreateManyInput[] - skipDuplicates?: boolean -} - -/** - * BankAccountBalance update - */ -export type BankAccountBalanceUpdateArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null - /** - * The data needed to update a BankAccountBalance. - */ - data: Prisma.XOR - /** - * Choose, which BankAccountBalance to update. - */ - where: Prisma.BankAccountBalanceWhereUniqueInput -} - -/** - * BankAccountBalance updateMany - */ -export type BankAccountBalanceUpdateManyArgs = { - /** - * The data used to update BankAccountBalances. - */ - data: Prisma.XOR - /** - * Filter which BankAccountBalances to update - */ - where?: Prisma.BankAccountBalanceWhereInput - /** - * Limit how many BankAccountBalances to update. - */ - limit?: number -} - -/** - * BankAccountBalance upsert - */ -export type BankAccountBalanceUpsertArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null - /** - * The filter to search for the BankAccountBalance to update in case it exists. - */ - where: Prisma.BankAccountBalanceWhereUniqueInput - /** - * In case the BankAccountBalance found by the `where` argument doesn't exist, create a new BankAccountBalance with this data. - */ - create: Prisma.XOR - /** - * In case the BankAccountBalance was found with the provided `where` argument, update it with this data. - */ - update: Prisma.XOR -} - -/** - * BankAccountBalance delete - */ -export type BankAccountBalanceDeleteArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null - /** - * Filter which BankAccountBalance to delete. - */ - where: Prisma.BankAccountBalanceWhereUniqueInput -} - -/** - * BankAccountBalance deleteMany - */ -export type BankAccountBalanceDeleteManyArgs = { - /** - * Filter which BankAccountBalances to delete - */ - where?: Prisma.BankAccountBalanceWhereInput - /** - * Limit how many BankAccountBalances to delete. - */ - limit?: number -} - -/** - * BankAccountBalance without action - */ -export type BankAccountBalanceDefaultArgs = { - /** - * Select specific fields to fetch from the BankAccountBalance - */ - select?: Prisma.BankAccountBalanceSelect | null - /** - * Omit specific fields from the BankAccountBalance - */ - omit?: Prisma.BankAccountBalanceOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountBalanceInclude | null -} diff --git a/src/modules/bank-accounts/bank-accounts.controller.ts b/src/modules/bank-accounts/bank-accounts.controller.ts index c599dd3..897ebed 100644 --- a/src/modules/bank-accounts/bank-accounts.controller.ts +++ b/src/modules/bank-accounts/bank-accounts.controller.ts @@ -31,4 +31,9 @@ export class BankAccountsController { remove(@Param('id') id: string) { return this.bankAccountsService.remove(Number(id)) } + + @Get(':id/transactions') + getTransactions(@Param('id') id: string) { + return this.bankAccountsService.getTransactions(Number(id)) + } } diff --git a/src/modules/bank-accounts/bank-accounts.service.ts b/src/modules/bank-accounts/bank-accounts.service.ts index 4c60dff..9575408 100644 --- a/src/modules/bank-accounts/bank-accounts.service.ts +++ b/src/modules/bank-accounts/bank-accounts.service.ts @@ -1,49 +1,61 @@ import { Injectable } from '@nestjs/common' -import { withTransaction } from '../../common/database/transaction.helper' import { ResponseMapper } from '../../common/response/response-mapper' +import { BankTransactionRefType } from '../../generated/prisma/enums' import { PrismaService } from '../../prisma/prisma.service' @Injectable() export class BankAccountsService { constructor(private prisma: PrismaService) {} - async create(data: any) { - return withTransaction(this.prisma, async tx => { - const item = await tx.bankAccount.create({ data }) - await tx.bankAccountBalance.create({ - data: { - bankAccountId: item.id, - balance: 0, - }, - }) - return ResponseMapper.create(item) - }) - } - async findAll() { - const items = await this.prisma.bankAccount.findMany({ - include: { - branch: { - select: { - id: true, - name: true, - code: true, - bank: { - select: { id: true, name: true, shortName: true }, - }, + private readonly bankAccountQuery = { + include: { + branch: { + select: { + id: true, + name: true, + code: true, + bank: { + select: { id: true, name: true, shortName: true }, }, }, }, - omit: { - branchId: true, + bankAccountTransactions: { + take: 1, + select: { id: true, createdAt: true, balanceAfter: true }, + orderBy: { createdAt: 'desc' as const }, }, - }) - return ResponseMapper.list(items) + }, + omit: { + branchId: true, + }, + } + + async create(data: any) { + const item = await this.prisma.bankAccount.create({ data }) + return ResponseMapper.create(item) + } + + async findAll() { + const items = await this.prisma.bankAccount.findMany(this.bankAccountQuery) + const mappedData = items.map(({ bankAccountTransactions, ...rest }) => ({ + ...rest, + currentBalance: Number(bankAccountTransactions[0]?.balanceAfter || 0), + })) + + return ResponseMapper.list(mappedData) } async findOne(id: number) { - const item = await this.prisma.bankAccount.findUnique({ where: { id } }) - if (!item) return null - return ResponseMapper.single(item) + const item = await this.prisma.bankAccount.findUniqueOrThrow({ + ...this.bankAccountQuery, + where: { id }, + }) + + const { bankAccountTransactions, ...rest } = item + return ResponseMapper.single({ + ...rest, + currentBalance: Number(bankAccountTransactions[0]?.balanceAfter || 0), + }) } async update(id: number, data: any) { @@ -55,4 +67,87 @@ export class BankAccountsService { const item = await this.prisma.bankAccount.delete({ where: { id } }) return ResponseMapper.single(item) } + + async getTransactions(bankAccountId: number, page = 1, pageSize = 50) { + const query = { + where: { bankAccountId }, + orderBy: { createdAt: 'desc' as const }, + skip: (page - 1) * pageSize, + take: pageSize, + } + + const [items, count] = await this.prisma.$transaction([ + this.prisma.bankAccountTransaction.findMany({ + ...query, + omit: { bankAccountId: true }, + }), + this.prisma.bankAccountTransaction.count({ where: { bankAccountId } }), + ]) + + const PosReferenceIds = [] as number[] + const purchaseReferenceIds = [] as number[] + + items.forEach(({ referenceType, referenceId }) => { + if (referenceId && referenceType) { + if ( + referenceType === BankTransactionRefType.POS_SALE || + referenceType === BankTransactionRefType.POS_REFUND + ) { + PosReferenceIds.push(referenceId) + } else if ( + referenceType === BankTransactionRefType.PURCHASE_PAYMENT || + referenceType === BankTransactionRefType.PURCHASE_REFUND + ) { + purchaseReferenceIds.push(referenceId) + } + } + }) + + const posRecords = await this.prisma.salesInvoice.findMany({ + where: { id: { in: PosReferenceIds } }, + select: { + id: true, + code: true, + totalAmount: true, + posAccount: { + select: { id: true, name: true }, + }, + customer: { + select: { id: true, firstName: true, lastName: true }, + }, + }, + }) + + const purchaseRecords = await this.prisma.purchaseReceipt.findMany({ + where: { id: { in: purchaseReferenceIds } }, + select: { + id: true, + code: true, + totalAmount: true, + supplier: { + select: { id: true, firstName: true, lastName: true }, + }, + }, + }) + + const mappedItems = items.map(tx => { + let reference = null as any + if (tx.referenceId && tx.referenceType) { + if ( + tx.referenceType === BankTransactionRefType.POS_SALE || + tx.referenceType === BankTransactionRefType.POS_REFUND + ) { + reference = posRecords.find(r => r.id === tx.referenceId) || null + } else if ( + tx.referenceType === BankTransactionRefType.PURCHASE_PAYMENT || + tx.referenceType === BankTransactionRefType.PURCHASE_REFUND + ) { + reference = purchaseRecords.find(r => r.id === tx.referenceId) || null + } + } + return { ...tx, reference } + }) + + return ResponseMapper.paginate(mappedItems, count, page, pageSize) + } } diff --git a/src/modules/bank-accounts/bank-accounts.workflow.ts b/src/modules/bank-accounts/bank-accounts.workflow.ts index 0cd29be..798fa96 100644 --- a/src/modules/bank-accounts/bank-accounts.workflow.ts +++ b/src/modules/bank-accounts/bank-accounts.workflow.ts @@ -8,13 +8,13 @@ export class BankAccountsWorkflow { tx: Prisma.TransactionClient, payload: AddTransactionToBankAccountDto, ) { - const item = await tx.bankAccountBalance.findUnique({ + const item = await tx.bankAccountTransaction.findFirst({ where: { bankAccountId: payload.bankAccountId, }, }) - const balance = item ? Number(item.balance) : 0 + const balance = item ? Number(item?.balanceAfter) : 0 const newBalance = item ? payload.type === 'DEPOSIT' @@ -35,31 +35,5 @@ export class BankAccountsWorkflow { referenceType: payload.referenceType, }, }) - - console.log('first') - - const bankAccountBalanceItem = await tx.bankAccountBalance.findUnique({ - where: { - bankAccountId: payload.bankAccountId, - }, - }) - - if (!bankAccountBalanceItem) { - return await tx.bankAccountBalance.create({ - data: { - bankAccount: { connect: { id: payload.bankAccountId } }, - balance: newBalance, - }, - }) - } - - return await tx.bankAccountBalance.update({ - where: { - bankAccountId: payload.bankAccountId, - }, - data: { - balance: newBalance, - }, - }) } } diff --git a/src/modules/inventories/index/inventories.service.ts b/src/modules/inventories/index/inventories.service.ts index 6136619..9d385bf 100644 --- a/src/modules/inventories/index/inventories.service.ts +++ b/src/modules/inventories/index/inventories.service.ts @@ -89,7 +89,6 @@ export class InventoriesService { }, }) let info = null as any - console.log(movements) const mapped = movements.map(movement => { const { id, quantity, unitPrice, totalCost, avgCost, product } = movement