diff --git a/prisma/migrations/20251224172938_triggers/migration.sql b/prisma/migrations/20251224172938_triggers/migration.sql index 5ba5e78..07d06dc 100644 --- a/prisma/migrations/20251224172938_triggers/migration.sql +++ b/prisma/migrations/20251224172938_triggers/migration.sql @@ -28,13 +28,13 @@ DECLARE fromInv INT; -- OUT from source INSERT INTO Stock_Movements - (type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, cuonterInventoryId, createdAt, remainedInStock) + (type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock) VALUES ('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, toInv, NOW(), latestQuantityInOrigin-NEW.count); -- IN to destination INSERT INTO Stock_Movements - (type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, cuonterInventoryId, createdAt, remainedInStock) + (type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock) VALUES ('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, fromInv, NOW(), latestQuantityInOrigin-NEW.count); end; diff --git a/prisma/migrations/20251226161357_update/migration.sql b/prisma/migrations/20251226161357_update/migration.sql new file mode 100644 index 0000000..c648d71 --- /dev/null +++ b/prisma/migrations/20251226161357_update/migration.sql @@ -0,0 +1,158 @@ +/* +Warnings: + +- You are about to alter the column `count` on the `Inventory_Transfer_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`. +- You are about to alter the column `totalAmount` on the `Orders` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `basePrice` on the `Product_Variants` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `salePrice` on the `Product_Variants` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `quantity` on the `Product_Variants` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`. +- You are about to alter the column `alertQuantity` on the `Product_Variants` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`. +- You are about to alter the column `salePrice` on the `Products` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,0)`. +- You are about to alter the column `count` on the `Purchase_Receipt_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`. +- You are about to alter the column `fee` on the `Purchase_Receipt_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `total` on the `Purchase_Receipt_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `amount` on the `Purchase_Receipt_Payments` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to drop the column `isSettled` on the `Purchase_Receipts` table. All the data in the column will be lost. +- You are about to alter the column `totalAmount` on the `Purchase_Receipts` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `paidAmount` on the `Purchase_Receipts` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `count` on the `Sales_Invoice_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`. +- You are about to alter the column `fee` on the `Sales_Invoice_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `total` on the `Sales_Invoice_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `totalAmount` on the `Sales_Invoices` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `adjustedQuantity` on the `Stock_Adjustments` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`. +- You are about to alter the column `quantity` on the `Stock_Movements` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`. +- You are about to alter the column `fee` on the `Stock_Movements` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `totalCost` on the `Stock_Movements` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `avgCost` on the `Stock_Movements` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `remainedInStock` on the `Stock_Movements` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`. +- You are about to alter the column `debit` on the `Supplier_Ledger` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `credit` on the `Supplier_Ledger` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- You are about to alter the column `balance` on the `Supplier_Ledger` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`. +- A unique constraint covering the columns `[iban]` on the table `Bank_Accounts` will be added. If there are existing duplicate values, this will fail. +- Made the column `bankAccountId` on table `Pos_Accounts` required. This step will fail if there are existing NULL values in that column. +- Added the required column `inventoryId` to the `Purchase_Receipt_Payments` table without a default value. This is not possible if the table is not empty. +- Added the required column `type` to the `Purchase_Receipt_Payments` table without a default value. This is not possible if the table is not empty. +- Made the column `bankAccountId` on table `Purchase_Receipt_Payments` required. This step will fail if there are existing NULL values in that column. + +*/ +-- DropForeignKey +ALTER TABLE `Pos_Accounts` +DROP FOREIGN KEY `Pos_Accounts_bankAccountId_fkey`; + +-- DropForeignKey +ALTER TABLE `Pos_Accounts` +DROP FOREIGN KEY `Pos_Accounts_bankAccountId_inventoryId_fkey`; + +-- DropForeignKey +ALTER TABLE `Pos_Accounts` +DROP FOREIGN KEY `Pos_Accounts_inventoryId_fkey`; + +-- DropForeignKey +ALTER TABLE `Purchase_Receipt_Payments` +DROP FOREIGN KEY `Purchase_Receipt_Payments_bankAccountId_fkey`; + +-- DropIndex +DROP INDEX `Pos_Accounts_bankAccountId_inventoryId_fkey` ON `Pos_Accounts`; + +-- DropIndex +DROP INDEX `Purchase_Receipt_Payments_bankAccountId_fkey` ON `Purchase_Receipt_Payments`; + +-- AlterTable +ALTER TABLE `Inventory_Transfer_Items` +MODIFY `count` DECIMAL(10, 0) NOT NULL; + +-- AlterTable +ALTER TABLE `Orders` MODIFY `totalAmount` DECIMAL(15, 2) NOT NULL; + +-- AlterTable +ALTER TABLE `Pos_Accounts` MODIFY `bankAccountId` INTEGER NOT NULL; + +-- AlterTable +ALTER TABLE `Product_Variants` +MODIFY `basePrice` DECIMAL(15, 2) NOT NULL, +MODIFY `salePrice` DECIMAL(15, 2) NOT NULL, +MODIFY `quantity` DECIMAL(10, 0) NULL DEFAULT 0.00, +MODIFY `alertQuantity` DECIMAL(10, 0) NULL DEFAULT 5.00; + +-- AlterTable +ALTER TABLE `Products` +MODIFY `salePrice` DECIMAL(15, 0) NOT NULL DEFAULT 0.00; + +-- AlterTable +ALTER TABLE `Purchase_Receipt_Items` +MODIFY `count` DECIMAL(10, 0) NOT NULL, +MODIFY `fee` DECIMAL(15, 2) NOT NULL, +MODIFY `total` DECIMAL(15, 2) NOT NULL; + +-- AlterTable +ALTER TABLE `Purchase_Receipt_Payments` +ADD COLUMN `inventoryId` INTEGER NOT NULL, +ADD COLUMN `type` ENUM('PAYMENT', 'REFUND') NOT NULL, +MODIFY `amount` DECIMAL(15, 2) NOT NULL, +MODIFY `bankAccountId` INTEGER NOT NULL; + +-- AlterTable +ALTER TABLE `Purchase_Receipts` +DROP COLUMN `isSettled`, +ADD COLUMN `status` ENUM( + 'UNPAID', + 'PARTIALLY_PAID', + 'PAID' +) NOT NULL DEFAULT 'UNPAID', +MODIFY `totalAmount` DECIMAL(15, 2) NOT NULL, +MODIFY `paidAmount` DECIMAL(15, 2) NOT NULL DEFAULT 0.00; + +-- AlterTable +ALTER TABLE `Sales_Invoice_Items` +MODIFY `count` DECIMAL(10, 0) NOT NULL, +MODIFY `fee` DECIMAL(15, 2) NOT NULL, +MODIFY `total` DECIMAL(15, 2) NOT NULL; + +-- AlterTable +ALTER TABLE `Sales_Invoices` +MODIFY `totalAmount` DECIMAL(15, 2) NOT NULL; + +-- AlterTable +ALTER TABLE `Stock_Adjustments` +MODIFY `adjustedQuantity` DECIMAL(10, 0) NOT NULL; + +-- AlterTable +ALTER TABLE `Stock_Movements` +MODIFY `quantity` DECIMAL(10, 0) NOT NULL, +MODIFY `fee` DECIMAL(15, 2) NOT NULL, +MODIFY `totalCost` DECIMAL(15, 2) NOT NULL, +MODIFY `avgCost` DECIMAL(15, 2) NOT NULL, +MODIFY `remainedInStock` DECIMAL(10, 0) NOT NULL DEFAULT 0.00; + +-- AlterTable +ALTER TABLE `Supplier_Ledger` +MODIFY `debit` DECIMAL(15, 2) NOT NULL DEFAULT 0, +MODIFY `credit` DECIMAL(15, 2) NOT NULL DEFAULT 0, +MODIFY `balance` DECIMAL(15, 2) NOT NULL; + +-- CreateIndex +CREATE UNIQUE INDEX `Bank_Accounts_iban_key` ON `Bank_Accounts` (`iban`); + +-- AddForeignKey +ALTER TABLE `Pos_Accounts` +ADD CONSTRAINT `Pos_Accounts_inventoryId_bankAccountId_fkey` FOREIGN KEY ( + `inventoryId`, + `bankAccountId` +) REFERENCES `Inventory_Bank_Accounts` ( + `inventoryId`, + `bankAccountId` +) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Purchase_Receipt_Payments` +ADD CONSTRAINT `Purchase_Receipt_Payments_inventoryId_bankAccountId_fkey` FOREIGN KEY ( + `inventoryId`, + `bankAccountId` +) REFERENCES `Inventory_Bank_Accounts` ( + `inventoryId`, + `bankAccountId` +) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- RenameIndex +ALTER TABLE `Supplier_Ledger` +RENAME INDEX `Supplier_Ledger_supplierId_fkey` TO `Supplier_Ledger_supplierId_idx`; diff --git a/prisma/migrations/20251226183649_update/migration.sql b/prisma/migrations/20251226183649_update/migration.sql new file mode 100644 index 0000000..9d2672a --- /dev/null +++ b/prisma/migrations/20251226183649_update/migration.sql @@ -0,0 +1,2 @@ +-- CreateIndex +CREATE INDEX `Pos_Accounts_inventoryId_idx` ON `Pos_Accounts`(`inventoryId`); diff --git a/prisma/schema/bank.prisma b/prisma/schema/bank.prisma index d75c5ba..6733149 100644 --- a/prisma/schema/bank.prisma +++ b/prisma/schema/bank.prisma @@ -26,9 +26,7 @@ model BankAccount { deletedAt DateTime? @db.Timestamp(0) branch BankBranch @relation("Bank_Accounts_branchId_fkey", fields: [branchId], references: [id]) - purchaseReceiptPayments PurchaseReceiptPayments[] - posAccounts PosAccount[] - inventoryBankAccounts InventoryBankAccount[] @relation("Inventory_Bank_Accounts_bankAccountId_fkey") + inventoryBankAccounts InventoryBankAccount[] @@map("Bank_Accounts") } diff --git a/prisma/schema/enum.prisma b/prisma/schema/enum.prisma index 27545d7..af990fa 100644 --- a/prisma/schema/enum.prisma +++ b/prisma/schema/enum.prisma @@ -17,7 +17,7 @@ enum MovementReferenceType { INVENTORY_TRANSFER } -enum payment_method_type { +enum PaymentMethodType { CASH CARD BANK @@ -25,9 +25,20 @@ enum payment_method_type { OTHER } -enum ledgerSourceType { +enum LedgerSourceType { PURCHASE PAYMENT ADJUSTMENT REFUND } + +enum PaymentType { + PAYMENT + REFUND +} + +enum PurchaseReceiptStatus { + UNPAID + PARTIALLY_PAID + PAID +} diff --git a/prisma/schema/inventory.prisma b/prisma/schema/inventory.prisma index 636b8fe..23ac705 100644 --- a/prisma/schema/inventory.prisma +++ b/prisma/schema/inventory.prisma @@ -9,19 +9,48 @@ model Inventory { isPointOfSale Boolean @default(false) inventoryTransfersFrom InventoryTransfer[] @relation("Inventory_From") inventoryTransfersTo InventoryTransfer[] @relation("Inventory_To") - // productCharges ProductCharge[] @relation("Inventory_Product_Charges") purchaseReceipts PurchaseReceipt[] salesInvoices SalesInvoice[] @relation("Inventory_SalesInvoices") stockAdjustments StockAdjustment[] @relation("Inventory_Stock_Adjustments") stockBalances StockBalance[] @relation("StockBalance_inventory") counterStockMovements StockMovement[] @relation("StockMovement_CounterInventory") stockMovements StockMovement[] @relation("StockMovement_Inventory") - posAccounts PosAccount[] @relation("Inventory_PosAccounts") - inventoryBankAccounts InventoryBankAccount[] @relation("Inventory_Bank_Accounts_inventoryId_fkey") + inventoryBankAccounts InventoryBankAccount[] @@map("Inventories") } +model InventoryBankAccount { + inventoryId Int + bankAccountId Int + + inventory Inventory @relation(fields: [inventoryId], references: [id]) + bankAccount BankAccount @relation(fields: [bankAccountId], references: [id]) + posAccounts PosAccount[] + purchaseReceiptPayments PurchaseReceiptPayments[] + + @@id([inventoryId, bankAccountId]) + @@index([bankAccountId]) + @@map("Inventory_Bank_Accounts") +} + +model PosAccount { + id Int @id @default(autoincrement()) + name String @db.VarChar(255) + code String @unique() @db.VarChar(10) + description String? @db.VarChar(500) + bankAccountId Int + inventoryId Int + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) + + inventoryBankAccount InventoryBankAccount @relation(fields: [inventoryId, bankAccountId], references: [inventoryId, bankAccountId]) + + @@index([inventoryId]) + @@map("Pos_Accounts") +} + model InventoryTransfer { id Int @id @default(autoincrement()) code String @unique @db.VarChar(100) @@ -40,7 +69,7 @@ model InventoryTransfer { model InventoryTransferItem { id Int @id @default(autoincrement()) - count Decimal @db.Decimal(10, 2) + count Decimal @db.Decimal(10, 0) productId Int transferId Int product Product @relation("InventoryTransferItem_Product", fields: [productId], references: [id]) @@ -50,34 +79,3 @@ model InventoryTransferItem { @@index([transferId], map: "Inventory_Transfer_Items_transferId_fkey") @@map("Inventory_Transfer_Items") } - -model InventoryBankAccount { - inventoryId Int - bankAccountId Int - - inventory Inventory @relation("Inventory_Bank_Accounts_inventoryId_fkey", fields: [inventoryId], references: [id]) - bankAccount BankAccount @relation("Inventory_Bank_Accounts_bankAccountId_fkey", fields: [bankAccountId], references: [id]) - posAccounts PosAccount[] @relation("Pos_Accounts_inventoryBankAccountId_fkey") - - @@id([inventoryId, bankAccountId]) - @@index([bankAccountId]) - @@map("Inventory_Bank_Accounts") -} - -model PosAccount { - id Int @id @default(autoincrement()) - name String @db.VarChar(255) - code String @unique() @db.VarChar(10) - description String? @db.VarChar(500) - bankAccountId Int - inventoryId Int - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) - - inventory Inventory @relation("Inventory_PosAccounts", fields: [inventoryId], references: [id]) - inventoryBankAccount InventoryBankAccount? @relation("Pos_Accounts_inventoryBankAccountId_fkey", fields: [bankAccountId, inventoryId], references: [bankAccountId, inventoryId]) - bankAccount BankAccount? @relation(fields: [bankAccountId], references: [id]) - - @@map("Pos_Accounts") -} diff --git a/prisma/schema/others.prisma b/prisma/schema/others.prisma index 637d6a4..cc3c7aa 100644 --- a/prisma/schema/others.prisma +++ b/prisma/schema/others.prisma @@ -1,41 +1,3 @@ -model Supplier { - id Int @id @default(autoincrement()) - firstName String @db.VarChar(255) - lastName String @db.VarChar(255) - email String? @db.VarChar(255) - mobileNumber String @unique @db.Char(11) - address String? @db.Text - city String? @db.VarChar(100) - state String? @db.VarChar(100) - country String? @db.VarChar(100) - isActive Boolean @default(true) - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) - purchaseReceipts PurchaseReceipt[] - stockMovements StockMovement[] @relation("StockMovement_Supplier") - supplierLedgers SupplierLedger[] - - @@map("Suppliers") -} - -model SupplierLedger { - id Int @id @default(autoincrement()) - description String? @db.Text - debit Decimal @db.Decimal(10, 2) - credit Decimal @db.Decimal(10, 2) - balance Decimal @db.Decimal(10, 2) - sourceType ledgerSourceType - sourceId Int - createdAt DateTime @default(now()) @db.Timestamp(0) - - supplierId Int - supplier Supplier @relation(fields: [supplierId], references: [id]) - - @@index([supplierId], map: "Supplier_Ledger_supplierId_fkey") - @@map("Supplier_Ledger") -} - model Customer { id Int @id @default(autoincrement()) firstName String @db.VarChar(255) @@ -58,17 +20,17 @@ model Customer { } model Order { - id Int @id @default(autoincrement()) - orderNumber String @unique @db.VarChar(100) - status OrderStatus @default(PENDING) - paymentMethod payment_method_type @default(CARD) - totalAmount Decimal @db.Decimal(10, 2) - description String? @db.Text - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) + id Int @id @default(autoincrement()) + orderNumber String @unique @db.VarChar(100) + status OrderStatus @default(PENDING) + paymentMethod PaymentMethodType @default(CARD) + totalAmount Decimal @db.Decimal(15, 2) + description String? @db.Text + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) customerId Int - customer Customer @relation("Customer_Orders", fields: [customerId], references: [id], onUpdate: NoAction) + customer Customer @relation("Customer_Orders", fields: [customerId], references: [id], onUpdate: NoAction) @@index([customerId], map: "Orders_customerId_fkey") @@map("Orders") @@ -77,7 +39,7 @@ model Order { model SalesInvoice { id Int @id @default(autoincrement()) code String @unique @db.VarChar(100) - totalAmount Decimal @db.Decimal(10, 2) + totalAmount Decimal @db.Decimal(15, 2) description String? @db.Text createdAt DateTime @default(now()) @db.Timestamp(0) updatedAt DateTime @updatedAt @db.Timestamp(0) @@ -94,9 +56,9 @@ model SalesInvoice { model SalesInvoiceItem { id Int @id @default(autoincrement()) - count Decimal @db.Decimal(10, 2) - fee Decimal @db.Decimal(10, 2) - total Decimal @db.Decimal(10, 2) + count Decimal @db.Decimal(10, 0) + fee Decimal @db.Decimal(15, 2) + total Decimal @db.Decimal(15, 2) createdAt DateTime @default(now()) @db.Timestamp(0) invoiceId Int productId Int diff --git a/prisma/schema/product.prisma b/prisma/schema/product.prisma index ca7b0f0..6c91d2c 100644 --- a/prisma/schema/product.prisma +++ b/prisma/schema/product.prisma @@ -1,14 +1,14 @@ model ProductVariant { id Int @id @default(autoincrement()) name String @db.VarChar(255) - basePrice Decimal @db.Decimal(10, 2) - salePrice Decimal @db.Decimal(10, 2) + basePrice Decimal @db.Decimal(15, 2) + salePrice Decimal @db.Decimal(15, 2) description String? @db.Text barcode String? @unique(map: "products_barcode_unique") @db.VarChar(100) imageUrl String? @db.VarChar(255) unit String? @db.VarChar(10) - quantity Decimal? @default(0.00) @db.Decimal(10, 2) - alertQuantity Decimal? @default(5.00) @db.Decimal(10, 2) + quantity Decimal? @default(0.00) @db.Decimal(10, 0) + alertQuantity Decimal? @default(5.00) @db.Decimal(10, 0) isActive Boolean @default(true) isFeatured Boolean @default(false) createdAt DateTime @default(now()) @db.Timestamp(0) @@ -32,7 +32,7 @@ model Product { deletedAt DateTime? @db.Timestamp(0) brandId Int? categoryId Int? - salePrice Decimal @default(0.00) @db.Decimal(10, 2) + salePrice Decimal @default(0.00) @db.Decimal(15, 0) inventoryTransferItems InventoryTransferItem[] @relation("InventoryTransferItem_Product") // productCharges ProductCharge[] @relation("Product_Charges") variants ProductVariant[] @relation("Product_Variant") diff --git a/prisma/schema/purchase.prisma b/prisma/schema/purchase.prisma index ea449ba..2081460 100644 --- a/prisma/schema/purchase.prisma +++ b/prisma/schema/purchase.prisma @@ -1,18 +1,18 @@ model PurchaseReceipt { - id Int @id @default(autoincrement()) - code String @unique @db.VarChar(100) - totalAmount Decimal @db.Decimal(10, 2) - paidAmount Decimal @default(0.00) @db.Decimal(10, 2) - isSettled Boolean @default(false) - description String? @db.Text - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - supplierId Int - inventoryId Int - items PurchaseReceiptItem[] @relation("PurchaseReceipt_Items") - inventory Inventory @relation(fields: [inventoryId], references: [id]) - supplier Supplier @relation(fields: [supplierId], references: [id]) - purchaseReceiptPayments PurchaseReceiptPayments[] + id Int @id @default(autoincrement()) + code String @unique @db.VarChar(100) + totalAmount Decimal @db.Decimal(15, 2) + paidAmount Decimal @default(0.00) @db.Decimal(15, 2) + description String? @db.Text + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + status PurchaseReceiptStatus @default(UNPAID) + supplierId Int + inventoryId Int + items PurchaseReceiptItem[] @relation("PurchaseReceipt_Items") + inventory Inventory @relation(fields: [inventoryId], references: [id]) + supplier Supplier @relation(fields: [supplierId], references: [id]) + payments PurchaseReceiptPayments[] @@index([inventoryId], map: "Purchase_Receipts_inventoryId_fkey") @@index([supplierId], map: "Purchase_Receipts_supplierId_fkey") @@ -21,9 +21,9 @@ model PurchaseReceipt { model PurchaseReceiptItem { id Int @id @default(autoincrement()) - count Decimal @db.Decimal(10, 2) - fee Decimal @db.Decimal(10, 2) - total Decimal @db.Decimal(10, 2) + count Decimal @db.Decimal(10, 0) + fee Decimal @db.Decimal(15, 2) + total Decimal @db.Decimal(15, 2) description String? @db.Text createdAt DateTime @default(now()) @db.Timestamp(0) receiptId Int @@ -37,19 +37,20 @@ model PurchaseReceiptItem { } model PurchaseReceiptPayments { - id Int @id @default(autoincrement()) - amount Decimal @db.Decimal(10, 2) - paymentMethod payment_method_type - bankAccountId Int? - description String? @db.Text - payedAt DateTime @db.Timestamp(0) + id Int @id @default(autoincrement()) + amount Decimal @db.Decimal(15, 2) + paymentMethod PaymentMethodType + type PaymentType + bankAccountId Int + inventoryId Int + description String? @db.Text + payedAt DateTime @db.Timestamp(0) receiptId Int - createdAt DateTime @default(now()) @db.Timestamp(0) + createdAt DateTime @default(now()) @db.Timestamp(0) - purchaseReceipt PurchaseReceipt @relation(fields: [receiptId], references: [id]) - bankAccount BankAccount? @relation(fields: [bankAccountId], references: [id]) + purchaseReceipt PurchaseReceipt @relation(fields: [receiptId], references: [id]) + inventoryBankAccount InventoryBankAccount @relation(fields: [inventoryId, bankAccountId], references: [inventoryId, bankAccountId]) @@index([receiptId], map: "Purchase_Receipt_Payments_receiptId_fkey") - @@index([bankAccountId], map: "Purchase_Receipt_Payments_bankAccountId_fkey") @@map("Purchase_Receipt_Payments") } diff --git a/prisma/schema/stock.prisma b/prisma/schema/stock.prisma index ae275e6..f38ab7e 100644 --- a/prisma/schema/stock.prisma +++ b/prisma/schema/stock.prisma @@ -1,17 +1,17 @@ model StockMovement { id Int @id @default(autoincrement()) type MovementType - quantity Decimal @db.Decimal(10, 2) - fee Decimal @db.Decimal(10, 2) - totalCost Decimal @db.Decimal(10, 2) + quantity Decimal @db.Decimal(10, 0) + fee Decimal @db.Decimal(15, 2) + totalCost Decimal @db.Decimal(15, 2) referenceType MovementReferenceType referenceId String createdAt DateTime @default(now()) @db.Timestamp(0) productId Int inventoryId Int - avgCost Decimal @db.Decimal(10, 2) + avgCost Decimal @db.Decimal(15, 2) supplierId Int? - remainedInStock Decimal @default(0.00) @db.Decimal(10, 2) + remainedInStock Decimal @default(0.00) @db.Decimal(10, 0) counterInventoryId Int? customerId Int? counterInventory Inventory? @relation("StockMovement_CounterInventory", fields: [counterInventoryId], references: [id]) @@ -48,7 +48,7 @@ model StockBalance { model StockAdjustment { id Int @id @default(autoincrement()) - adjustedQuantity Decimal @db.Decimal(10, 2) + adjustedQuantity Decimal @db.Decimal(10, 0) createdAt DateTime @default(now()) @db.Timestamp(0) productId Int inventoryId Int diff --git a/prisma/schema/supplier.prisma b/prisma/schema/supplier.prisma new file mode 100644 index 0000000..65ee074 --- /dev/null +++ b/prisma/schema/supplier.prisma @@ -0,0 +1,37 @@ +model Supplier { + id Int @id @default(autoincrement()) + firstName String @db.VarChar(255) + lastName String @db.VarChar(255) + email String? @db.VarChar(255) + mobileNumber String @unique @db.Char(11) + address String? @db.Text + city String? @db.VarChar(100) + state String? @db.VarChar(100) + country String? @db.VarChar(100) + isActive Boolean @default(true) + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) + stockMovements StockMovement[] @relation("StockMovement_Supplier") + receipts PurchaseReceipt[] + ledger SupplierLedger[] + + @@map("Suppliers") +} + +model SupplierLedger { + id Int @id @default(autoincrement()) + description String? @db.Text + debit Decimal @default(0) @db.Decimal(15, 2) + credit Decimal @default(0) @db.Decimal(15, 2) + balance Decimal @db.Decimal(15, 2) + sourceType LedgerSourceType + sourceId Int + createdAt DateTime @default(now()) @db.Timestamp(0) + + supplierId Int + supplier Supplier @relation(fields: [supplierId], references: [id]) + + @@index([supplierId]) + @@map("Supplier_Ledger") +} diff --git a/prisma/seed.ts b/prisma/seed.ts index 4be71e7..b0a4f8e 100644 --- a/prisma/seed.ts +++ b/prisma/seed.ts @@ -1,304 +1,353 @@ import { prisma } from '../src/lib/prisma' -import { PurchaseReceiptsService } from '../src/purchase-receipts/purchase-receipts.service' async function main() { - // if ((await prisma.role.count()) === 0) { - // await prisma.role.upsert({ - // where: { id: 0, name: 'Admin' }, - // update: {}, - // create: { - // name: 'Admin', - // }, - // }) - // } + if ((await prisma.role.count()) === 0) { + await prisma.role.upsert({ + where: { id: 0, name: 'Admin' }, + update: {}, + create: { + name: 'Admin', + }, + }) + } - // if ((await prisma.user.count()) === 0) { - // const adminRole = await prisma.role.findUnique({ where: { name: 'Admin' } }) - // if (!adminRole) { - // return - // } - // await prisma.user.upsert({ - // where: { id: 1, firstName: 'عباس', lastName: 'حسنی' }, - // update: {}, - // create: { - // firstName: 'عباس', - // lastName: 'حسنی', - // roleId: adminRole.id, - // mobileNumber: '09120258156', - // password: '12345678', - // }, - // }) - // } + if ((await prisma.user.count()) === 0) { + const adminRole = await prisma.role.findUnique({ where: { name: 'Admin' } }) + if (!adminRole) { + return + } + await prisma.user.upsert({ + where: { id: 1, firstName: 'عباس', lastName: 'حسنی' }, + update: {}, + create: { + firstName: 'عباس', + lastName: 'حسنی', + roleId: adminRole.id, + mobileNumber: '09120258156', + password: '12345678', + }, + }) + } - // if ((await prisma.inventory.count()) === 0) { - // await prisma.inventory.createMany({ - // data: [ - // { name: 'انبار مرکزی', location: 'تهران', isPointOfSale: false, isActive: true }, - // { - // name: 'فروشگاه حضوری', - // location: 'مرکز شهر', - // isPointOfSale: true, - // isActive: true, - // }, - // { - // name: 'فروشگاه اینترنتی', - // location: 'مرکز شهر', - // isPointOfSale: true, - // isActive: true, - // }, - // ], - // }) - // } + if ((await prisma.inventory.count()) === 0) { + await prisma.inventory.createMany({ + data: [ + { name: 'انبار مرکزی', location: 'تهران', isPointOfSale: false, isActive: true }, + { + name: 'فروشگاه حضوری', + location: 'مرکز شهر', + isPointOfSale: true, + isActive: true, + }, + { + name: 'فروشگاه اینترنتی', + location: 'مرکز شهر', + isPointOfSale: true, + isActive: true, + }, + ], + }) + } - // if ((await prisma.productCategory.count()) === 0) { - // await prisma.productCategory.createMany({ - // data: Array.from({ length: 10 }, (_, i) => ({ name: `دسته‌ی ${i + 1}` })), - // }) - // } + if ((await prisma.productCategory.count()) === 0) { + await prisma.productCategory.createMany({ + data: Array.from({ length: 10 }, (_, i) => ({ name: `دسته‌ی ${i + 1}` })), + }) + } - // if ((await prisma.productBrand.count()) === 0) { - // await prisma.productBrand.createMany({ - // data: Array.from({ length: 10 }, (_, i) => ({ name: `برند ${i + 1}` })), - // }) - // } + if ((await prisma.productBrand.count()) === 0) { + await prisma.productBrand.createMany({ + data: Array.from({ length: 10 }, (_, i) => ({ name: `برند ${i + 1}` })), + }) + } - // if ((await prisma.supplier.count()) === 0) { - // await prisma.supplier.createMany({ - // data: Array.from({ length: 9 }, (_, i) => ({ - // firstName: 'تامین‌', - // lastName: `کننده ${i + 1}`, - // mobileNumber: `0912000000${i + 1}`, - // email: `supplier${i + 1}@example.com`, - // })), - // }) - // } - - // if ((await prisma.customer.count()) === 0) { - // await prisma.customer.createMany({ - // data: Array.from({ length: 5 }, (_, i) => ({ - // firstName: 'مشتری', - // lastName: `${i + 1}`, - // mobileNumber: `0913000000${i + 1}`, - // email: `customer${i + 1}@example.com`, - // })), - // }) - // } - - // if ((await prisma.product.count()) === 0) { - // const categories = await prisma.productCategory.findMany() - // const brands = await prisma.productBrand.findMany() - // await prisma.product.createMany({ - // data: Array.from({ length: 100 }, (_, i) => ({ - // name: `کالای ${i + 1}`, - // sku: `SKU-${1000 + i + 1}`, - // salePrice: parseInt((Math.random() * (100 - 10) + 10).toString()) * 10000, - // categoryId: categories[i % categories.length].id, - // brandId: brands[i % brands.length].id, - // })), - // }) - // } - - // if ((await prisma.bank.count()) === 0) { - // await prisma.bank.createMany({ - // data: [ - // { - // name: 'آینده', - // shortName: 'ain', - // }, - // { - // name: 'ایران زمین', - // shortName: 'irz', - // }, - // { - // name: 'اقتصاد نوین', - // shortName: 'eqn', - // }, - // { - // name: 'انصار', - // shortName: 'ans', - // }, - // { - // name: 'پاسارگاد', - // shortName: 'pas', - // }, - // { - // name: 'پارسیان', - // shortName: 'prs', - // }, - // { - // name: 'پست‌ بانک ایران', - // shortName: 'pbi', - // }, - // { - // name: 'تجارت', - // shortName: 'tej', - // }, - // { - // name: 'توسعه تعاون', - // shortName: 'tav', - // }, - // { - // name: 'توسعه صادرات', - // shortName: 'tes', - // }, - // { - // name: 'حکمت ایرانیان', - // shortName: 'hek', - // }, - // { - // name: 'رفاه کارگران', - // shortName: 'ref', - // }, - // { - // name: 'قرض‌الحسنه رسالت', - // shortName: 'res', - // }, - // { - // name: 'قرض‌الحسنه مهر ایران', - // shortName: 'meh', - // }, - // { - // name: 'قوامین', - // shortName: 'qva', - // }, - // { - // name: 'کشاورزی', - // shortName: 'kes', - // }, - // { - // name: 'کوثر', - // shortName: 'kos', - // }, - // { - // name: 'دی', - // shortName: 'diy', - // }, - // { - // name: 'صنعت و معدن', - // shortName: 'san', - // }, - // { - // name: 'سینا', - // shortName: 'sin', - // }, - // { - // name: 'سرمایه', - // shortName: 'sar', - // }, - // { - // name: 'سپه', - // shortName: 'sep', - // }, - // { - // name: 'شهر', - // shortName: 'shr', - // }, - // { - // name: 'صادرات ایران', - // shortName: 'sir', - // }, - // { - // name: 'سامان', - // shortName: 'sam', - // }, - // { - // name: 'مرکزی', - // shortName: 'mar', - // }, - // { - // name: 'مسکن', - // shortName: 'mas', - // }, - // { - // name: 'ملت', - // shortName: 'mel', - // }, - // { - // name: 'ملی ایران', - // shortName: 'mli', - // }, - // { - // name: 'مهر اقتصاد', - // shortName: 'meg', - // }, - // { - // name: 'کارآفرین', - // shortName: 'kar', - // }, - // { - // name: 'تات', - // shortName: 'tat', - // }, - // ], - // }) - // } - - // if ((await prisma.bankBranch.count()) === 0) { - // await prisma.bankBranch.createMany({ - // data: [ - // { - // bankId: 1, - // name: 'شعبه مرکزی', - // code: '001', - // }, - // { - // bankId: 2, - // name: 'شعبه مرکزی', - // code: '002', - // }, - // { - // bankId: 1, - // name: 'شعبه ونک', - // code: '003', - // }, - // ], - // }) - // } - - // if ((await prisma.bankAccount.count()) === 0) { - // await prisma.bankAccount.createMany({ - // data: [ - // { - // branchId: 4, - // accountNumber: '1234567890', - // name: 'حساب اصلی آینده', - // iban: 'IR000123456789012345678901', - // }, - // { - // branchId: 5, - // accountNumber: '0987654321', - // name: 'حساب اصلی ایران زمین', - // iban: 'IR000987654321098765432109', - // }, - // { - // branchId: 6, - // accountNumber: '1122334455', - // name: 'حساب ونک آینده', - // iban: 'IR000112233445566778899001', - // }, - // ], - // }) - // } - // // Seed purchase, transfer, and sales transactions - const inventories = await prisma.inventory.findMany() - const products = await prisma.product.findMany({ take: 5 }) // select 5 products for demo - const supplier = await prisma.supplier.findFirst() - const customers = await prisma.customer.findMany({ take: 2 }) - if (supplier && customers.length > 0) { - PurchaseReceiptsService.prototype.create({ - code: '123123', - inventoryId: inventories[0].id, - supplierId: supplier.id, - paidAmount: 0, - totalAmount: products.reduce((acc, a) => (acc += Number(a.salePrice) * 10), 0), - items: products.map(product => ({ - productId: product.id, - count: 10, - fee: Number(product.salePrice), - total: 10 * Number(product.salePrice), + if ((await prisma.supplier.count()) === 0) { + await prisma.supplier.createMany({ + data: Array.from({ length: 9 }, (_, i) => ({ + firstName: 'تامین‌', + lastName: `کننده ${i + 1}`, + mobileNumber: `0912000000${i + 1}`, + email: `supplier${i + 1}@example.com`, })), }) } + + if ((await prisma.customer.count()) === 0) { + await prisma.customer.createMany({ + data: Array.from({ length: 5 }, (_, i) => ({ + firstName: 'مشتری', + lastName: `${i + 1}`, + mobileNumber: `0913000000${i + 1}`, + email: `customer${i + 1}@example.com`, + })), + }) + } + + if ((await prisma.product.count()) === 0) { + const categories = await prisma.productCategory.findMany() + const brands = await prisma.productBrand.findMany() + await prisma.product.createMany({ + data: Array.from({ length: 100 }, (_, i) => ({ + name: `کالای ${i + 1}`, + sku: `SKU-${1000 + i + 1}`, + salePrice: parseInt((Math.random() * (100 - 10) + 10).toString()) * 10000, + categoryId: categories[i % categories.length].id, + brandId: brands[i % brands.length].id, + })), + }) + } + + if ((await prisma.bank.count()) === 0) { + await prisma.bank.createMany({ + data: [ + { + name: 'آینده', + shortName: 'ain', + }, + { + name: 'ایران زمین', + shortName: 'irz', + }, + { + name: 'اقتصاد نوین', + shortName: 'eqn', + }, + { + name: 'انصار', + shortName: 'ans', + }, + { + name: 'پاسارگاد', + shortName: 'pas', + }, + { + name: 'پارسیان', + shortName: 'prs', + }, + { + name: 'پست‌ بانک ایران', + shortName: 'pbi', + }, + { + name: 'تجارت', + shortName: 'tej', + }, + { + name: 'توسعه تعاون', + shortName: 'tav', + }, + { + name: 'توسعه صادرات', + shortName: 'tes', + }, + { + name: 'حکمت ایرانیان', + shortName: 'hek', + }, + { + name: 'رفاه کارگران', + shortName: 'ref', + }, + { + name: 'قرض‌الحسنه رسالت', + shortName: 'res', + }, + { + name: 'قرض‌الحسنه مهر ایران', + shortName: 'meh', + }, + { + name: 'قوامین', + shortName: 'qva', + }, + { + name: 'کشاورزی', + shortName: 'kes', + }, + { + name: 'کوثر', + shortName: 'kos', + }, + { + name: 'دی', + shortName: 'diy', + }, + { + name: 'صنعت و معدن', + shortName: 'san', + }, + { + name: 'سینا', + shortName: 'sin', + }, + { + name: 'سرمایه', + shortName: 'sar', + }, + { + name: 'سپه', + shortName: 'sep', + }, + { + name: 'شهر', + shortName: 'shr', + }, + { + name: 'صادرات ایران', + shortName: 'sir', + }, + { + name: 'سامان', + shortName: 'sam', + }, + { + name: 'مرکزی', + shortName: 'mar', + }, + { + name: 'مسکن', + shortName: 'mas', + }, + { + name: 'ملت', + shortName: 'mel', + }, + { + name: 'ملی ایران', + shortName: 'mli', + }, + { + name: 'مهر اقتصاد', + shortName: 'meg', + }, + { + name: 'کارآفرین', + shortName: 'kar', + }, + { + name: 'تات', + shortName: 'tat', + }, + ], + }) + } + + if ((await prisma.bankBranch.count()) === 0) { + await prisma.bankBranch.createMany({ + data: [ + { + bankId: 1, + name: 'شعبه مرکزی', + code: '001', + }, + { + bankId: 2, + name: 'شعبه مرکزی', + code: '002', + }, + { + bankId: 1, + name: 'شعبه ونک', + code: '003', + }, + ], + }) + } + + if ((await prisma.bankAccount.count()) === 0) { + await prisma.bankAccount.createMany({ + data: [ + { + branchId: 1, + accountNumber: '1234567890', + name: 'حساب اصلی آینده', + iban: 'IR000123456789012345678901', + }, + { + branchId: 2, + accountNumber: '0987654321', + name: 'حساب اصلی ایران زمین', + iban: 'IR000987654321098765432109', + }, + { + branchId: 3, + accountNumber: '1122334455', + name: 'حساب ونک آینده', + iban: 'IR000112233445566778899001', + }, + ], + }) + } + + // if ((await prisma.inventoryBankAccount.count()) === 0) { + // const inventories = await prisma.inventory.findMany() + // const bankAccounts = await prisma.bankAccount.findMany() + + // // Assign bank accounts to inventories + // const inventoryBankAccounts = [] + // for (let i = 0; i < inventories.length; i++) { + // const inventory = inventories[i] + // const bankAccount = bankAccounts[i % bankAccounts.length] // Cycle through bank accounts + // inventoryBankAccounts.push({ + // inventoryId: inventory.id, + // bankAccountId: bankAccount.id, + // }) + // } + + // await prisma.inventoryBankAccount.createMany({ + // data: inventoryBankAccounts, + // }) + // } + + // if ((await prisma.posAccount.count()) === 0) { + // const inventories = await prisma.inventory.findMany({ + // where: { isPointOfSale: true }, + // }) + // const inventoryBankAccounts = await prisma.inventoryBankAccount.findMany() + + // const posAccounts = [] + // for (let i = 0; i < inventories.length; i++) { + // const inventory = inventories[i] + // // Find a bank account assigned to this inventory + // const inventoryBankAccount = inventoryBankAccounts.find( + // iba => iba.inventoryId === inventory.id, + // ) + // if (inventoryBankAccount) { + // posAccounts.push({ + // name: `پوز ${inventory.name}`, + // code: `POS${(i + 1).toString().padStart(3, '0')}`, + // description: `پوز فروشگاه ${inventory.name}`, + // inventoryId: inventory.id, + // bankAccountId: inventoryBankAccount.bankAccountId, + // }) + // } + // } + + // await prisma.posAccount.createMany({ + // data: posAccounts, + // }) + // } + + // Seed purchase, transfer, and sales transactions + // const inventories = await prisma.inventory.findMany() + // const products = await prisma.product.findMany({ take: 5 }) // select 5 products for demo + // const supplier = await prisma.supplier.findFirst() + // const customers = await prisma.customer.findMany({ take: 2 }) + // if (supplier && customers.length > 0) { + // PurchaseReceiptsService.prototype.create({ + // code: '123123', + // inventoryId: inventories[0].id, + // supplierId: supplier.id, + // paidAmount: 0, + // totalAmount: products.reduce((acc, a) => (acc += Number(a.salePrice) * 10), 0), + // items: products.map(product => ({ + // productId: product.id, + // count: 10, + // fee: Number(product.salePrice), + // total: 10 * Number(product.salePrice), + // })), + // }) + // } } main() diff --git a/prisma/triggers/dump_triggers.sql b/prisma/triggers/dump_triggers.sql index 2c20368..44d9fb2 100644 --- a/prisma/triggers/dump_triggers.sql +++ b/prisma/triggers/dump_triggers.sql @@ -1,5 +1,5 @@ -- AUTO-GENERATED MYSQL TRIGGER DUMP --- Generated at: 2025-12-22T15:32:20.184Z +-- Generated at: 2025-12-26T18:34:53.930Z -- ------------------------------------------ -- Trigger: trg_transfer_item_after_insert @@ -7,7 +7,6 @@ -- Table: Inventory_Transfer_Items -- ------------------------------------------ DROP TRIGGER IF EXISTS `trg_transfer_item_after_insert`; - CREATE DEFINER=`pos`@`%` TRIGGER `trg_transfer_item_after_insert` AFTER INSERT ON `Inventory_Transfer_Items` FOR EACH ROW begin DECLARE fromInv INT; @@ -28,13 +27,13 @@ DECLARE fromInv INT; -- OUT from source INSERT INTO Stock_Movements - (type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, cuonterInventoryId, createdAt, remainedInStock) + (type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock) VALUES ('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, toInv, NOW(), latestQuantityInOrigin-NEW.count); -- IN to destination INSERT INTO Stock_Movements - (type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, cuonterInventoryId, createdAt, remainedInStock) + (type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock) VALUES ('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, fromInv, NOW(), latestQuantityInOrigin-NEW.count); end; @@ -45,7 +44,6 @@ end; -- Table: Purchase_Receipt_Items -- ------------------------------------------ DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_insert`; - CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_insert` AFTER INSERT ON `Purchase_Receipt_Items` FOR EACH ROW BEGIN DECLARE latestQuantity DECIMAL(10, 2) DEFAULT 0; DECLARE invId INT; @@ -102,13 +100,177 @@ DECLARE invId INT; END; +-- ------------------------------------------ +-- Trigger: trg_pr_payment_before_insert +-- Event: INSERT +-- Table: Purchase_Receipt_Payments +-- ------------------------------------------ +DROP TRIGGER IF EXISTS `trg_pr_payment_before_insert`; +CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_before_insert` BEFORE INSERT ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN + DECLARE receiptTotal DECIMAL(14,2); + DECLARE paid DECIMAL(14,2); + + SELECT totalAmount, paidAmount + INTO receiptTotal, paid + FROM Purchase_Receipts + WHERE id = NEW.receiptId + FOR UPDATE; + + IF NEW.type = 'PAYMENT' AND paid + NEW.amount > receiptTotal THEN + SIGNAL SQLSTATE '45000' + SET MESSAGE_TEXT = 'مجموع مبلغ پرداختی بیشتر از مبلغ فاکتور است.'; + END IF; +END; + +-- ------------------------------------------ +-- Trigger: trg_pr_payment_after_insert +-- Event: INSERT +-- Table: Purchase_Receipt_Payments +-- ------------------------------------------ +DROP TRIGGER IF EXISTS `trg_pr_payment_after_insert`; +CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_after_insert` AFTER INSERT ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN + DECLARE receiptTotal DECIMAL(14,2); + DECLARE newPaid DECIMAL(14,2); + DECLARE supplierId INT; + DECLARE lastBalance DECIMAL(14,2); + + -- Lock receipt row + SELECT totalAmount, paidAmount, supplierId + INTO receiptTotal, newPaid, supplierId + FROM Purchase_Receipts + WHERE id = NEW.receiptId + FOR UPDATE; + + -- Apply payment or refund + IF NEW.type = 'PAYMENT' THEN + SET newPaid = newPaid + NEW.amount; + ELSE + SET newPaid = newPaid - NEW.amount; + END IF; + + -- Update receipt + UPDATE Purchase_Receipts + SET + paidAmount = newPaid, + status = + CASE + WHEN newPaid = 0 THEN 'UNPAID' + WHEN newPaid < receiptTotal THEN 'PARTIALLY_PAID' + ELSE 'PAID' + END + WHERE id = NEW.receiptId; + + -- Get last supplier balance + SELECT IFNULL(balance, 0) + INTO lastBalance + FROM Supplier_Ledger + WHERE supplierId = supplierId + ORDER BY id DESC + LIMIT 1; + + -- Insert supplier ledger + INSERT INTO Supplier_Ledger + ( + supplierId, + debit, + credit, + balance, + sourceType, + sourceId, + createdAt + ) + VALUES + ( + supplierId, + IF(NEW.type = 'REFUND', NEW.amount, 0), + IF(NEW.type = 'PAYMENT', NEW.amount, 0), + lastBalance + + IF(NEW.type = 'PAYMENT', NEW.amount, 0) + - IF(NEW.type = 'REFUND', NEW.amount, 0), + 'PURCHASE_PAYMENT', + NEW.id, + NOW() + ); +END; + +-- ------------------------------------------ +-- Trigger: trg_pr_payment_after_delete +-- Event: DELETE +-- Table: Purchase_Receipt_Payments +-- ------------------------------------------ +DROP TRIGGER IF EXISTS `trg_pr_payment_after_delete`; +CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_after_delete` AFTER DELETE ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN + DECLARE receiptTotal DECIMAL(14,2); + DECLARE newPaid DECIMAL(14,2); + + SELECT totalAmount, paidAmount + INTO receiptTotal, newPaid + FROM Purchase_Receipts + WHERE id = OLD.receiptId + FOR UPDATE; + + IF OLD.type = 'PAYMENT' THEN + SET newPaid = newPaid - OLD.amount; + ELSE + SET newPaid = newPaid + OLD.amount; + END IF; + + UPDATE Purchase_Receipts + SET + paidAmount = newPaid, + status = + CASE + WHEN newPaid = 0 THEN 'UNPAID' + WHEN newPaid < receiptTotal THEN 'PARTIALLY_PAID' + ELSE 'PAID' + END + WHERE id = OLD.receiptId; +END; + +-- ------------------------------------------ +-- Trigger: trg_purchase_receipt_after_insert +-- Event: INSERT +-- Table: Purchase_Receipts +-- ------------------------------------------ +DROP TRIGGER IF EXISTS `trg_purchase_receipt_after_insert`; +CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_after_insert` AFTER INSERT ON `Purchase_Receipts` FOR EACH ROW BEGIN + DECLARE lastBalance DECIMAL(14,2) DEFAULT 0; + + SELECT COALESCE(balance, 0) + INTO lastBalance + FROM Supplier_Ledger + WHERE supplierId = NEW.supplierId + ORDER BY id DESC + LIMIT 1; + + INSERT INTO Supplier_Ledger + ( + supplierId, + debit, + credit, + balance, + sourceType, + sourceId, + createdAt + ) + VALUES + ( + NEW.supplierId, + NEW.totalAmount, + 0, + lastBalance - NEW.totalAmount, + 'PURCHASE', + NEW.id, + NOW() + ); +END; + -- ------------------------------------------ -- Trigger: trg_sales_invoice_items_before_insert -- Event: INSERT -- Table: Sales_Invoice_Items -- ------------------------------------------ DROP TRIGGER IF EXISTS `trg_sales_invoice_items_before_insert`; - CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_before_insert` BEFORE INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin DECLARE current_stock DECIMAL(10, 2); DECLARE inventory_id INT; @@ -138,7 +300,6 @@ end; -- Table: Sales_Invoice_Items -- ------------------------------------------ DROP TRIGGER IF EXISTS `trg_sales_invoice_items_after_insert`; - CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_after_insert` AFTER INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin DECLARE current_stock DECIMAL(10, 2); DECLARE inventory_id INT; @@ -199,7 +360,6 @@ END; -- Table: Stock_Movements -- ------------------------------------------ DROP TRIGGER IF EXISTS `trg_stock_transfer`; - CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_transfer` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'INVENTORY_TRANSFER' THEN IF NEW.type = 'IN' THEN INSERT INTO Stock_Balance ( @@ -282,7 +442,6 @@ END; -- Table: Stock_Movements -- ------------------------------------------ DROP TRIGGER IF EXISTS `trg_stock_purchase_insert`; - CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'PURCHASE' THEN INSERT INTO @@ -317,7 +476,6 @@ END; -- Table: Stock_Movements -- ------------------------------------------ DROP TRIGGER IF EXISTS `trg_stock_sale_insert`; - CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'SALES' THEN INSERT INTO @@ -345,3 +503,4 @@ ON DUPLICATE KEY UPDATE END IF; END; + diff --git a/src/generated/prisma/browser.ts b/src/generated/prisma/browser.ts index f68d8c0..71884f6 100644 --- a/src/generated/prisma/browser.ts +++ b/src/generated/prisma/browser.ts @@ -52,16 +52,6 @@ export type BankAccount = Prisma.BankAccountModel * */ export type Inventory = Prisma.InventoryModel -/** - * Model InventoryTransfer - * - */ -export type InventoryTransfer = Prisma.InventoryTransferModel -/** - * Model InventoryTransferItem - * - */ -export type InventoryTransferItem = Prisma.InventoryTransferItemModel /** * Model InventoryBankAccount * @@ -72,21 +62,21 @@ export type InventoryBankAccount = Prisma.InventoryBankAccountModel * */ export type PosAccount = Prisma.PosAccountModel +/** + * Model InventoryTransfer + * + */ +export type InventoryTransfer = Prisma.InventoryTransferModel +/** + * Model InventoryTransferItem + * + */ +export type InventoryTransferItem = Prisma.InventoryTransferItemModel /** * Model Bank * */ export type Bank = Prisma.BankModel -/** - * Model Supplier - * - */ -export type Supplier = Prisma.SupplierModel -/** - * Model SupplierLedger - * - */ -export type SupplierLedger = Prisma.SupplierLedgerModel /** * Model Customer * @@ -162,3 +152,13 @@ export type StockBalance = Prisma.StockBalanceModel * */ export type StockAdjustment = Prisma.StockAdjustmentModel +/** + * Model Supplier + * + */ +export type Supplier = Prisma.SupplierModel +/** + * Model SupplierLedger + * + */ +export type SupplierLedger = Prisma.SupplierLedgerModel diff --git a/src/generated/prisma/client.ts b/src/generated/prisma/client.ts index 7a66bf5..68984c6 100644 --- a/src/generated/prisma/client.ts +++ b/src/generated/prisma/client.ts @@ -72,16 +72,6 @@ export type BankAccount = Prisma.BankAccountModel * */ export type Inventory = Prisma.InventoryModel -/** - * Model InventoryTransfer - * - */ -export type InventoryTransfer = Prisma.InventoryTransferModel -/** - * Model InventoryTransferItem - * - */ -export type InventoryTransferItem = Prisma.InventoryTransferItemModel /** * Model InventoryBankAccount * @@ -92,21 +82,21 @@ export type InventoryBankAccount = Prisma.InventoryBankAccountModel * */ export type PosAccount = Prisma.PosAccountModel +/** + * Model InventoryTransfer + * + */ +export type InventoryTransfer = Prisma.InventoryTransferModel +/** + * Model InventoryTransferItem + * + */ +export type InventoryTransferItem = Prisma.InventoryTransferItemModel /** * Model Bank * */ export type Bank = Prisma.BankModel -/** - * Model Supplier - * - */ -export type Supplier = Prisma.SupplierModel -/** - * Model SupplierLedger - * - */ -export type SupplierLedger = Prisma.SupplierLedgerModel /** * Model Customer * @@ -182,3 +172,13 @@ export type StockBalance = Prisma.StockBalanceModel * */ export type StockAdjustment = Prisma.StockAdjustmentModel +/** + * Model Supplier + * + */ +export type Supplier = Prisma.SupplierModel +/** + * Model SupplierLedger + * + */ +export type SupplierLedger = Prisma.SupplierLedgerModel diff --git a/src/generated/prisma/commonInputTypes.ts b/src/generated/prisma/commonInputTypes.ts index b19f3b7..2266cc1 100644 --- a/src/generated/prisma/commonInputTypes.ts +++ b/src/generated/prisma/commonInputTypes.ts @@ -253,23 +253,6 @@ export type DecimalWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDecimalFilter<$PrismaModel> } -export type EnumledgerSourceTypeFilter<$PrismaModel = never> = { - equals?: $Enums.ledgerSourceType | Prisma.EnumledgerSourceTypeFieldRefInput<$PrismaModel> - in?: $Enums.ledgerSourceType[] - notIn?: $Enums.ledgerSourceType[] - not?: Prisma.NestedEnumledgerSourceTypeFilter<$PrismaModel> | $Enums.ledgerSourceType -} - -export type EnumledgerSourceTypeWithAggregatesFilter<$PrismaModel = never> = { - equals?: $Enums.ledgerSourceType | Prisma.EnumledgerSourceTypeFieldRefInput<$PrismaModel> - in?: $Enums.ledgerSourceType[] - notIn?: $Enums.ledgerSourceType[] - not?: Prisma.NestedEnumledgerSourceTypeWithAggregatesFilter<$PrismaModel> | $Enums.ledgerSourceType - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedEnumledgerSourceTypeFilter<$PrismaModel> - _max?: Prisma.NestedEnumledgerSourceTypeFilter<$PrismaModel> -} - export type EnumOrderStatusFilter<$PrismaModel = never> = { equals?: $Enums.OrderStatus | Prisma.EnumOrderStatusFieldRefInput<$PrismaModel> in?: $Enums.OrderStatus[] @@ -277,11 +260,11 @@ export type EnumOrderStatusFilter<$PrismaModel = never> = { not?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> | $Enums.OrderStatus } -export type Enumpayment_method_typeFilter<$PrismaModel = never> = { - equals?: $Enums.payment_method_type | Prisma.Enumpayment_method_typeFieldRefInput<$PrismaModel> - in?: $Enums.payment_method_type[] - notIn?: $Enums.payment_method_type[] - not?: Prisma.NestedEnumpayment_method_typeFilter<$PrismaModel> | $Enums.payment_method_type +export type EnumPaymentMethodTypeFilter<$PrismaModel = never> = { + equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel> + in?: $Enums.PaymentMethodType[] + notIn?: $Enums.PaymentMethodType[] + not?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> | $Enums.PaymentMethodType } export type EnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = { @@ -294,14 +277,14 @@ export type EnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> } -export type Enumpayment_method_typeWithAggregatesFilter<$PrismaModel = never> = { - equals?: $Enums.payment_method_type | Prisma.Enumpayment_method_typeFieldRefInput<$PrismaModel> - in?: $Enums.payment_method_type[] - notIn?: $Enums.payment_method_type[] - not?: Prisma.NestedEnumpayment_method_typeWithAggregatesFilter<$PrismaModel> | $Enums.payment_method_type +export type EnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel> + in?: $Enums.PaymentMethodType[] + notIn?: $Enums.PaymentMethodType[] + not?: Prisma.NestedEnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel> | $Enums.PaymentMethodType _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedEnumpayment_method_typeFilter<$PrismaModel> - _max?: Prisma.NestedEnumpayment_method_typeFilter<$PrismaModel> + _min?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> } export type IntNullableFilter<$PrismaModel = never> = { @@ -358,6 +341,40 @@ export type DecimalNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDecimalNullableFilter<$PrismaModel> } +export type EnumPurchaseReceiptStatusFilter<$PrismaModel = never> = { + equals?: $Enums.PurchaseReceiptStatus | Prisma.EnumPurchaseReceiptStatusFieldRefInput<$PrismaModel> + in?: $Enums.PurchaseReceiptStatus[] + notIn?: $Enums.PurchaseReceiptStatus[] + not?: Prisma.NestedEnumPurchaseReceiptStatusFilter<$PrismaModel> | $Enums.PurchaseReceiptStatus +} + +export type EnumPurchaseReceiptStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.PurchaseReceiptStatus | Prisma.EnumPurchaseReceiptStatusFieldRefInput<$PrismaModel> + in?: $Enums.PurchaseReceiptStatus[] + notIn?: $Enums.PurchaseReceiptStatus[] + not?: Prisma.NestedEnumPurchaseReceiptStatusWithAggregatesFilter<$PrismaModel> | $Enums.PurchaseReceiptStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumPurchaseReceiptStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumPurchaseReceiptStatusFilter<$PrismaModel> +} + +export type EnumPaymentTypeFilter<$PrismaModel = never> = { + equals?: $Enums.PaymentType | Prisma.EnumPaymentTypeFieldRefInput<$PrismaModel> + in?: $Enums.PaymentType[] + notIn?: $Enums.PaymentType[] + not?: Prisma.NestedEnumPaymentTypeFilter<$PrismaModel> | $Enums.PaymentType +} + +export type EnumPaymentTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.PaymentType | Prisma.EnumPaymentTypeFieldRefInput<$PrismaModel> + in?: $Enums.PaymentType[] + notIn?: $Enums.PaymentType[] + not?: Prisma.NestedEnumPaymentTypeWithAggregatesFilter<$PrismaModel> | $Enums.PaymentType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumPaymentTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumPaymentTypeFilter<$PrismaModel> +} + export type EnumMovementTypeFilter<$PrismaModel = never> = { equals?: $Enums.MovementType | Prisma.EnumMovementTypeFieldRefInput<$PrismaModel> in?: $Enums.MovementType[] @@ -392,6 +409,23 @@ export type EnumMovementReferenceTypeWithAggregatesFilter<$PrismaModel = never> _max?: Prisma.NestedEnumMovementReferenceTypeFilter<$PrismaModel> } +export type EnumLedgerSourceTypeFilter<$PrismaModel = never> = { + equals?: $Enums.LedgerSourceType | Prisma.EnumLedgerSourceTypeFieldRefInput<$PrismaModel> + in?: $Enums.LedgerSourceType[] + notIn?: $Enums.LedgerSourceType[] + not?: Prisma.NestedEnumLedgerSourceTypeFilter<$PrismaModel> | $Enums.LedgerSourceType +} + +export type EnumLedgerSourceTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.LedgerSourceType | Prisma.EnumLedgerSourceTypeFieldRefInput<$PrismaModel> + in?: $Enums.LedgerSourceType[] + notIn?: $Enums.LedgerSourceType[] + not?: Prisma.NestedEnumLedgerSourceTypeWithAggregatesFilter<$PrismaModel> | $Enums.LedgerSourceType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumLedgerSourceTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumLedgerSourceTypeFilter<$PrismaModel> +} + export type NestedIntFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> in?: number[] @@ -621,23 +655,6 @@ export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDecimalFilter<$PrismaModel> } -export type NestedEnumledgerSourceTypeFilter<$PrismaModel = never> = { - equals?: $Enums.ledgerSourceType | Prisma.EnumledgerSourceTypeFieldRefInput<$PrismaModel> - in?: $Enums.ledgerSourceType[] - notIn?: $Enums.ledgerSourceType[] - not?: Prisma.NestedEnumledgerSourceTypeFilter<$PrismaModel> | $Enums.ledgerSourceType -} - -export type NestedEnumledgerSourceTypeWithAggregatesFilter<$PrismaModel = never> = { - equals?: $Enums.ledgerSourceType | Prisma.EnumledgerSourceTypeFieldRefInput<$PrismaModel> - in?: $Enums.ledgerSourceType[] - notIn?: $Enums.ledgerSourceType[] - not?: Prisma.NestedEnumledgerSourceTypeWithAggregatesFilter<$PrismaModel> | $Enums.ledgerSourceType - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedEnumledgerSourceTypeFilter<$PrismaModel> - _max?: Prisma.NestedEnumledgerSourceTypeFilter<$PrismaModel> -} - export type NestedEnumOrderStatusFilter<$PrismaModel = never> = { equals?: $Enums.OrderStatus | Prisma.EnumOrderStatusFieldRefInput<$PrismaModel> in?: $Enums.OrderStatus[] @@ -645,11 +662,11 @@ export type NestedEnumOrderStatusFilter<$PrismaModel = never> = { not?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> | $Enums.OrderStatus } -export type NestedEnumpayment_method_typeFilter<$PrismaModel = never> = { - equals?: $Enums.payment_method_type | Prisma.Enumpayment_method_typeFieldRefInput<$PrismaModel> - in?: $Enums.payment_method_type[] - notIn?: $Enums.payment_method_type[] - not?: Prisma.NestedEnumpayment_method_typeFilter<$PrismaModel> | $Enums.payment_method_type +export type NestedEnumPaymentMethodTypeFilter<$PrismaModel = never> = { + equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel> + in?: $Enums.PaymentMethodType[] + notIn?: $Enums.PaymentMethodType[] + not?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> | $Enums.PaymentMethodType } export type NestedEnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = { @@ -662,14 +679,14 @@ export type NestedEnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> } -export type NestedEnumpayment_method_typeWithAggregatesFilter<$PrismaModel = never> = { - equals?: $Enums.payment_method_type | Prisma.Enumpayment_method_typeFieldRefInput<$PrismaModel> - in?: $Enums.payment_method_type[] - notIn?: $Enums.payment_method_type[] - not?: Prisma.NestedEnumpayment_method_typeWithAggregatesFilter<$PrismaModel> | $Enums.payment_method_type +export type NestedEnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel> + in?: $Enums.PaymentMethodType[] + notIn?: $Enums.PaymentMethodType[] + not?: Prisma.NestedEnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel> | $Enums.PaymentMethodType _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedEnumpayment_method_typeFilter<$PrismaModel> - _max?: Prisma.NestedEnumpayment_method_typeFilter<$PrismaModel> + _min?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> } export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { @@ -726,6 +743,40 @@ export type NestedDecimalNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDecimalNullableFilter<$PrismaModel> } +export type NestedEnumPurchaseReceiptStatusFilter<$PrismaModel = never> = { + equals?: $Enums.PurchaseReceiptStatus | Prisma.EnumPurchaseReceiptStatusFieldRefInput<$PrismaModel> + in?: $Enums.PurchaseReceiptStatus[] + notIn?: $Enums.PurchaseReceiptStatus[] + not?: Prisma.NestedEnumPurchaseReceiptStatusFilter<$PrismaModel> | $Enums.PurchaseReceiptStatus +} + +export type NestedEnumPurchaseReceiptStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.PurchaseReceiptStatus | Prisma.EnumPurchaseReceiptStatusFieldRefInput<$PrismaModel> + in?: $Enums.PurchaseReceiptStatus[] + notIn?: $Enums.PurchaseReceiptStatus[] + not?: Prisma.NestedEnumPurchaseReceiptStatusWithAggregatesFilter<$PrismaModel> | $Enums.PurchaseReceiptStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumPurchaseReceiptStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumPurchaseReceiptStatusFilter<$PrismaModel> +} + +export type NestedEnumPaymentTypeFilter<$PrismaModel = never> = { + equals?: $Enums.PaymentType | Prisma.EnumPaymentTypeFieldRefInput<$PrismaModel> + in?: $Enums.PaymentType[] + notIn?: $Enums.PaymentType[] + not?: Prisma.NestedEnumPaymentTypeFilter<$PrismaModel> | $Enums.PaymentType +} + +export type NestedEnumPaymentTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.PaymentType | Prisma.EnumPaymentTypeFieldRefInput<$PrismaModel> + in?: $Enums.PaymentType[] + notIn?: $Enums.PaymentType[] + not?: Prisma.NestedEnumPaymentTypeWithAggregatesFilter<$PrismaModel> | $Enums.PaymentType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumPaymentTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumPaymentTypeFilter<$PrismaModel> +} + export type NestedEnumMovementTypeFilter<$PrismaModel = never> = { equals?: $Enums.MovementType | Prisma.EnumMovementTypeFieldRefInput<$PrismaModel> in?: $Enums.MovementType[] @@ -760,4 +811,21 @@ export type NestedEnumMovementReferenceTypeWithAggregatesFilter<$PrismaModel = n _max?: Prisma.NestedEnumMovementReferenceTypeFilter<$PrismaModel> } +export type NestedEnumLedgerSourceTypeFilter<$PrismaModel = never> = { + equals?: $Enums.LedgerSourceType | Prisma.EnumLedgerSourceTypeFieldRefInput<$PrismaModel> + in?: $Enums.LedgerSourceType[] + notIn?: $Enums.LedgerSourceType[] + not?: Prisma.NestedEnumLedgerSourceTypeFilter<$PrismaModel> | $Enums.LedgerSourceType +} + +export type NestedEnumLedgerSourceTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.LedgerSourceType | Prisma.EnumLedgerSourceTypeFieldRefInput<$PrismaModel> + in?: $Enums.LedgerSourceType[] + notIn?: $Enums.LedgerSourceType[] + not?: Prisma.NestedEnumLedgerSourceTypeWithAggregatesFilter<$PrismaModel> | $Enums.LedgerSourceType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumLedgerSourceTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumLedgerSourceTypeFilter<$PrismaModel> +} + diff --git a/src/generated/prisma/enums.ts b/src/generated/prisma/enums.ts index 3e25a82..d80f886 100644 --- a/src/generated/prisma/enums.ts +++ b/src/generated/prisma/enums.ts @@ -37,7 +37,7 @@ export const MovementReferenceType = { export type MovementReferenceType = (typeof MovementReferenceType)[keyof typeof MovementReferenceType] -export const payment_method_type = { +export const PaymentMethodType = { CASH: 'CASH', CARD: 'CARD', BANK: 'BANK', @@ -45,14 +45,31 @@ export const payment_method_type = { OTHER: 'OTHER' } as const -export type payment_method_type = (typeof payment_method_type)[keyof typeof payment_method_type] +export type PaymentMethodType = (typeof PaymentMethodType)[keyof typeof PaymentMethodType] -export const ledgerSourceType = { +export const LedgerSourceType = { PURCHASE: 'PURCHASE', PAYMENT: 'PAYMENT', ADJUSTMENT: 'ADJUSTMENT', REFUND: 'REFUND' } as const -export type ledgerSourceType = (typeof ledgerSourceType)[keyof typeof ledgerSourceType] +export type LedgerSourceType = (typeof LedgerSourceType)[keyof typeof LedgerSourceType] + + +export const PaymentType = { + PAYMENT: 'PAYMENT', + REFUND: 'REFUND' +} as const + +export type PaymentType = (typeof PaymentType)[keyof typeof PaymentType] + + +export const PurchaseReceiptStatus = { + UNPAID: 'UNPAID', + PARTIALLY_PAID: 'PARTIALLY_PAID', + PAID: 'PAID' +} as const + +export type PurchaseReceiptStatus = (typeof PurchaseReceiptStatus)[keyof typeof PurchaseReceiptStatus] diff --git a/src/generated/prisma/internal/class.ts b/src/generated/prisma/internal/class.ts index d45fcb1..a502204 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.1.0", "engineVersion": "ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba", "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 purchaseReceiptPayments PurchaseReceiptPayments[]\n posAccounts PosAccount[]\n inventoryBankAccounts InventoryBankAccount[] @relation(\"Inventory_Bank_Accounts_bankAccountId_fkey\")\n\n @@map(\"Bank_Accounts\")\n}\n\nenum OrderStatus {\n PENDING\n REJECT\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 payment_method_type {\n CASH\n CARD\n BANK\n CHECK\n OTHER\n}\n\nenum ledgerSourceType {\n PURCHASE\n PAYMENT\n ADJUSTMENT\n REFUND\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 // productCharges ProductCharge[] @relation(\"Inventory_Product_Charges\")\n purchaseReceipts PurchaseReceipt[]\n salesInvoices SalesInvoice[] @relation(\"Inventory_SalesInvoices\")\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 posAccounts PosAccount[] @relation(\"Inventory_PosAccounts\")\n inventoryBankAccounts InventoryBankAccount[] @relation(\"Inventory_Bank_Accounts_inventoryId_fkey\")\n\n @@map(\"Inventories\")\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, 2)\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 InventoryBankAccount {\n inventoryId Int\n bankAccountId Int\n\n inventory Inventory @relation(\"Inventory_Bank_Accounts_inventoryId_fkey\", fields: [inventoryId], references: [id])\n bankAccount BankAccount @relation(\"Inventory_Bank_Accounts_bankAccountId_fkey\", fields: [bankAccountId], references: [id])\n posAccounts PosAccount[] @relation(\"Pos_Accounts_inventoryBankAccountId_fkey\")\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 inventory Inventory @relation(\"Inventory_PosAccounts\", fields: [inventoryId], references: [id])\n inventoryBankAccount InventoryBankAccount? @relation(\"Pos_Accounts_inventoryBankAccountId_fkey\", fields: [bankAccountId, inventoryId], references: [bankAccountId, inventoryId])\n bankAccount BankAccount? @relation(fields: [bankAccountId], references: [id])\n\n @@map(\"Pos_Accounts\")\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 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 purchaseReceipts PurchaseReceipt[]\n stockMovements StockMovement[] @relation(\"StockMovement_Supplier\")\n supplierLedgers SupplierLedger[]\n\n @@map(\"Suppliers\")\n}\n\nmodel SupplierLedger {\n id Int @id @default(autoincrement())\n description String? @db.Text\n debit Decimal @db.Decimal(10, 2)\n credit Decimal @db.Decimal(10, 2)\n balance Decimal @db.Decimal(10, 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], map: \"Supplier_Ledger_supplierId_fkey\")\n @@map(\"Supplier_Ledger\")\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(\"Customer_Orders\")\n salesInvoices SalesInvoice[] @relation(\"Customer_Sales_Invoices\")\n stockMovements StockMovement[] @relation(\"StockMovement_Customer\")\n\n @@map(\"Customers\")\n}\n\nmodel Order {\n id Int @id @default(autoincrement())\n orderNumber String @unique @db.VarChar(100)\n status OrderStatus @default(PENDING)\n paymentMethod payment_method_type @default(CARD)\n totalAmount Decimal @db.Decimal(10, 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(\"Customer_Orders\", fields: [customerId], references: [id], onUpdate: NoAction)\n\n @@index([customerId], map: \"Orders_customerId_fkey\")\n @@map(\"Orders\")\n}\n\nmodel SalesInvoice {\n id Int @id @default(autoincrement())\n code String @unique @db.VarChar(100)\n totalAmount Decimal @db.Decimal(10, 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 inventoryId Int\n items SalesInvoiceItem[] @relation(\"SalesInvoice_Items\")\n customer Customer? @relation(\"Customer_Sales_Invoices\", fields: [customerId], references: [id])\n inventory Inventory @relation(\"Inventory_SalesInvoices\", fields: [inventoryId], references: [id])\n\n @@index([inventoryId], map: \"Sales_Invoices_inventoryId_fkey\")\n @@index([customerId], map: \"Sales_Invoices_customerId_fkey\")\n @@map(\"Sales_Invoices\")\n}\n\nmodel SalesInvoiceItem {\n id Int @id @default(autoincrement())\n count Decimal @db.Decimal(10, 2)\n fee Decimal @db.Decimal(10, 2)\n total Decimal @db.Decimal(10, 2)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n invoiceId Int\n productId Int\n invoice SalesInvoice @relation(\"SalesInvoice_Items\", fields: [invoiceId], references: [id])\n product Product @relation(\"Product_SalesInvoiceItems\", fields: [productId], references: [id])\n\n @@index([invoiceId], map: \"Sales_Invoice_Items_invoiceId_fkey\")\n @@index([productId], map: \"Sales_Invoice_Items_productId_fkey\")\n @@map(\"Sales_Invoice_Items\")\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(10, 2)\n salePrice Decimal @db.Decimal(10, 2)\n description String? @db.Text\n barcode String? @unique(map: \"products_barcode_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, 2)\n alertQuantity Decimal? @default(5.00) @db.Decimal(10, 2)\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(map: \"products_sku_unique\") @db.VarChar(100)\n barcode String? @unique(map: \"products_barcode_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(10, 2)\n inventoryTransferItems InventoryTransferItem[] @relation(\"InventoryTransferItem_Product\")\n // productCharges ProductCharge[] @relation(\"Product_Charges\")\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 salesInvoiceItems SalesInvoiceItem[] @relation(\"Product_SalesInvoiceItems\")\n stockAdjustments StockAdjustment[] @relation(\"Product_Stock_Adjustments\")\n stockBalances StockBalance[] @relation(\"StockBalance_Product\")\n stockMovements StockMovement[] @relation(\"StockMovement_Product\")\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(10, 2)\n paidAmount Decimal @default(0.00) @db.Decimal(10, 2)\n isSettled Boolean @default(false)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\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 purchaseReceiptPayments 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, 2)\n fee Decimal @db.Decimal(10, 2)\n total Decimal @db.Decimal(10, 2)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n receiptId Int\n productId Int\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(10, 2)\n paymentMethod payment_method_type\n bankAccountId Int?\n description String? @db.Text\n payedAt DateTime @db.Timestamp(0)\n receiptId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n purchaseReceipt PurchaseReceipt @relation(fields: [receiptId], references: [id])\n bankAccount BankAccount? @relation(fields: [bankAccountId], references: [id])\n\n @@index([receiptId], map: \"Purchase_Receipt_Payments_receiptId_fkey\")\n @@index([bankAccountId], map: \"Purchase_Receipt_Payments_bankAccountId_fkey\")\n @@map(\"Purchase_Receipt_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, 2)\n fee Decimal @db.Decimal(10, 2)\n totalCost Decimal @db.Decimal(10, 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(10, 2)\n supplierId Int?\n remainedInStock Decimal @default(0.00) @db.Decimal(10, 2)\n counterInventoryId Int?\n customerId Int?\n counterInventory Inventory? @relation(\"StockMovement_CounterInventory\", fields: [counterInventoryId], references: [id])\n customer Customer? @relation(\"StockMovement_Customer\", 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, 2)\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", + "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\n @@map(\"Bank_Accounts\")\n}\n\nenum OrderStatus {\n PENDING\n REJECT\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\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 salesInvoices SalesInvoice[] @relation(\"Inventory_SalesInvoices\")\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\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\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 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(\"Customer_Orders\")\n salesInvoices SalesInvoice[] @relation(\"Customer_Sales_Invoices\")\n stockMovements StockMovement[] @relation(\"StockMovement_Customer\")\n\n @@map(\"Customers\")\n}\n\nmodel Order {\n id Int @id @default(autoincrement())\n orderNumber String @unique @db.VarChar(100)\n status OrderStatus @default(PENDING)\n paymentMethod PaymentMethodType @default(CARD)\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(\"Customer_Orders\", fields: [customerId], references: [id], onUpdate: NoAction)\n\n @@index([customerId], map: \"Orders_customerId_fkey\")\n @@map(\"Orders\")\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 inventoryId Int\n items SalesInvoiceItem[] @relation(\"SalesInvoice_Items\")\n customer Customer? @relation(\"Customer_Sales_Invoices\", fields: [customerId], references: [id])\n inventory Inventory @relation(\"Inventory_SalesInvoices\", fields: [inventoryId], references: [id])\n\n @@index([inventoryId], map: \"Sales_Invoices_inventoryId_fkey\")\n @@index([customerId], map: \"Sales_Invoices_customerId_fkey\")\n @@map(\"Sales_Invoices\")\n}\n\nmodel SalesInvoiceItem {\n id Int @id @default(autoincrement())\n count Decimal @db.Decimal(10, 0)\n fee Decimal @db.Decimal(15, 2)\n total Decimal @db.Decimal(15, 2)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n invoiceId Int\n productId Int\n invoice SalesInvoice @relation(\"SalesInvoice_Items\", fields: [invoiceId], references: [id])\n product Product @relation(\"Product_SalesInvoiceItems\", fields: [productId], references: [id])\n\n @@index([invoiceId], map: \"Sales_Invoice_Items_invoiceId_fkey\")\n @@index([productId], map: \"Sales_Invoice_Items_productId_fkey\")\n @@map(\"Sales_Invoice_Items\")\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(map: \"products_barcode_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(map: \"products_sku_unique\") @db.VarChar(100)\n barcode String? @unique(map: \"products_barcode_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 inventoryTransferItems InventoryTransferItem[] @relation(\"InventoryTransferItem_Product\")\n // productCharges ProductCharge[] @relation(\"Product_Charges\")\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 salesInvoiceItems SalesInvoiceItem[] @relation(\"Product_SalesInvoiceItems\")\n stockAdjustments StockAdjustment[] @relation(\"Product_Stock_Adjustments\")\n stockBalances StockBalance[] @relation(\"StockBalance_Product\")\n stockMovements StockMovement[] @relation(\"StockMovement_Product\")\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 fee Decimal @db.Decimal(15, 2)\n total Decimal @db.Decimal(15, 2)\n description String? @db.Text\n createdAt DateTime @default(now()) @db.Timestamp(0)\n receiptId Int\n productId Int\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 inventoryId Int\n description String? @db.Text\n payedAt DateTime @db.Timestamp(0)\n receiptId Int\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n purchaseReceipt PurchaseReceipt @relation(fields: [receiptId], references: [id])\n inventoryBankAccount InventoryBankAccount @relation(fields: [inventoryId, bankAccountId], references: [inventoryId, bankAccountId])\n\n @@index([receiptId], map: \"Purchase_Receipt_Payments_receiptId_fkey\")\n @@map(\"Purchase_Receipt_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 fee 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(\"StockMovement_Customer\", 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 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\":\"purchaseReceiptPayments\",\"kind\":\"object\",\"type\":\"PurchaseReceiptPayments\",\"relationName\":\"BankAccountToPurchaseReceiptPayments\"},{\"name\":\"posAccounts\",\"kind\":\"object\",\"type\":\"PosAccount\",\"relationName\":\"BankAccountToPosAccount\"},{\"name\":\"inventoryBankAccounts\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"Inventory_Bank_Accounts_bankAccountId_fkey\"}],\"dbName\":\"Bank_Accounts\"},\"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\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"Inventory_SalesInvoices\"},{\"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\":\"posAccounts\",\"kind\":\"object\",\"type\":\"PosAccount\",\"relationName\":\"Inventory_PosAccounts\"},{\"name\":\"inventoryBankAccounts\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"Inventory_Bank_Accounts_inventoryId_fkey\"}],\"dbName\":\"Inventories\"},\"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\"},\"InventoryBankAccount\":{\"fields\":[{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_Bank_Accounts_inventoryId_fkey\"},{\"name\":\"bankAccount\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"Inventory_Bank_Accounts_bankAccountId_fkey\"},{\"name\":\"posAccounts\",\"kind\":\"object\",\"type\":\"PosAccount\",\"relationName\":\"Pos_Accounts_inventoryBankAccountId_fkey\"}],\"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\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_PosAccounts\"},{\"name\":\"inventoryBankAccount\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"Pos_Accounts_inventoryBankAccountId_fkey\"},{\"name\":\"bankAccount\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"BankAccountToPosAccount\"}],\"dbName\":\"Pos_Accounts\"},\"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\"},\"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\":\"purchaseReceipts\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"PurchaseReceiptToSupplier\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_Supplier\"},{\"name\":\"supplierLedgers\",\"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\"},\"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\":\"Customer_Orders\"},{\"name\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"Customer_Sales_Invoices\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_Customer\"}],\"dbName\":\"Customers\"},\"Order\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"OrderStatus\"},{\"name\":\"paymentMethod\",\"kind\":\"enum\",\"type\":\"payment_method_type\"},{\"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\":\"Customer_Orders\"}],\"dbName\":\"Orders\"},\"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\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoice_Items\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"Customer_Sales_Invoices\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_SalesInvoices\"}],\"dbName\":\"Sales_Invoices\"},\"SalesInvoiceItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"fee\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"total\",\"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\":\"SalesInvoice_Items\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_SalesInvoiceItems\"}],\"dbName\":\"Sales_Invoice_Items\"},\"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\":\"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\":\"salesInvoiceItems\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"Product_SalesInvoiceItems\"},{\"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\"}],\"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\":\"isSettled\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"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\":\"purchaseReceiptPayments\",\"kind\":\"object\",\"type\":\"PurchaseReceiptPayments\",\"relationName\":\"PurchaseReceiptToPurchaseReceiptPayments\"}],\"dbName\":\"Purchase_Receipts\"},\"PurchaseReceiptItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"fee\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"total\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"receiptId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"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\":\"payment_method_type\"},{\"name\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"payedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"receiptId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"purchaseReceipt\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"PurchaseReceiptToPurchaseReceiptPayments\"},{\"name\":\"bankAccount\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"BankAccountToPurchaseReceiptPayments\"}],\"dbName\":\"Purchase_Receipt_Payments\"},\"StockMovement\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"MovementType\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"fee\",\"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\":\"StockMovement_Customer\"},{\"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\"}},\"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\"}],\"dbName\":\"Bank_Accounts\"},\"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\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"Inventory_SalesInvoices\"},{\"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\"}],\"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\"}],\"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\"},\"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\":\"Customer_Orders\"},{\"name\":\"salesInvoices\",\"kind\":\"object\",\"type\":\"SalesInvoice\",\"relationName\":\"Customer_Sales_Invoices\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_Customer\"}],\"dbName\":\"Customers\"},\"Order\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"orderNumber\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"status\",\"kind\":\"enum\",\"type\":\"OrderStatus\"},{\"name\":\"paymentMethod\",\"kind\":\"enum\",\"type\":\"PaymentMethodType\"},{\"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\":\"Customer_Orders\"}],\"dbName\":\"Orders\"},\"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\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoice_Items\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"Customer_Sales_Invoices\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_SalesInvoices\"}],\"dbName\":\"Sales_Invoices\"},\"SalesInvoiceItem\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"fee\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"total\",\"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\":\"SalesInvoice_Items\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_SalesInvoiceItems\"}],\"dbName\":\"Sales_Invoice_Items\"},\"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\":\"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\":\"salesInvoiceItems\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"Product_SalesInvoiceItems\"},{\"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\"}],\"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\":\"fee\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"total\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"receiptId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"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\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"payedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"receiptId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"purchaseReceipt\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"PurchaseReceiptToPurchaseReceiptPayments\"},{\"name\":\"inventoryBankAccount\",\"kind\":\"object\",\"type\":\"InventoryBankAccount\",\"relationName\":\"InventoryBankAccountToPurchaseReceiptPayments\"}],\"dbName\":\"Purchase_Receipt_Payments\"},\"StockMovement\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"MovementType\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"fee\",\"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\":\"StockMovement_Customer\"},{\"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\"},\"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,26 +244,6 @@ export interface PrismaClient< */ get inventory(): Prisma.InventoryDelegate; - /** - * `prisma.inventoryTransfer`: Exposes CRUD operations for the **InventoryTransfer** model. - * Example usage: - * ```ts - * // Fetch zero or more InventoryTransfers - * const inventoryTransfers = await prisma.inventoryTransfer.findMany() - * ``` - */ - get inventoryTransfer(): Prisma.InventoryTransferDelegate; - - /** - * `prisma.inventoryTransferItem`: Exposes CRUD operations for the **InventoryTransferItem** model. - * Example usage: - * ```ts - * // Fetch zero or more InventoryTransferItems - * const inventoryTransferItems = await prisma.inventoryTransferItem.findMany() - * ``` - */ - get inventoryTransferItem(): Prisma.InventoryTransferItemDelegate; - /** * `prisma.inventoryBankAccount`: Exposes CRUD operations for the **InventoryBankAccount** model. * Example usage: @@ -284,6 +264,26 @@ export interface PrismaClient< */ get posAccount(): Prisma.PosAccountDelegate; + /** + * `prisma.inventoryTransfer`: Exposes CRUD operations for the **InventoryTransfer** model. + * Example usage: + * ```ts + * // Fetch zero or more InventoryTransfers + * const inventoryTransfers = await prisma.inventoryTransfer.findMany() + * ``` + */ + get inventoryTransfer(): Prisma.InventoryTransferDelegate; + + /** + * `prisma.inventoryTransferItem`: Exposes CRUD operations for the **InventoryTransferItem** model. + * Example usage: + * ```ts + * // Fetch zero or more InventoryTransferItems + * const inventoryTransferItems = await prisma.inventoryTransferItem.findMany() + * ``` + */ + get inventoryTransferItem(): Prisma.InventoryTransferItemDelegate; + /** * `prisma.bank`: Exposes CRUD operations for the **Bank** model. * Example usage: @@ -294,26 +294,6 @@ export interface PrismaClient< */ get bank(): Prisma.BankDelegate; - /** - * `prisma.supplier`: Exposes CRUD operations for the **Supplier** model. - * Example usage: - * ```ts - * // Fetch zero or more Suppliers - * const suppliers = await prisma.supplier.findMany() - * ``` - */ - get supplier(): Prisma.SupplierDelegate; - - /** - * `prisma.supplierLedger`: Exposes CRUD operations for the **SupplierLedger** model. - * Example usage: - * ```ts - * // Fetch zero or more SupplierLedgers - * const supplierLedgers = await prisma.supplierLedger.findMany() - * ``` - */ - get supplierLedger(): Prisma.SupplierLedgerDelegate; - /** * `prisma.customer`: Exposes CRUD operations for the **Customer** model. * Example usage: @@ -463,6 +443,26 @@ export interface PrismaClient< * ``` */ get stockAdjustment(): Prisma.StockAdjustmentDelegate; + + /** + * `prisma.supplier`: Exposes CRUD operations for the **Supplier** model. + * Example usage: + * ```ts + * // Fetch zero or more Suppliers + * const suppliers = await prisma.supplier.findMany() + * ``` + */ + get supplier(): Prisma.SupplierDelegate; + + /** + * `prisma.supplierLedger`: Exposes CRUD operations for the **SupplierLedger** model. + * Example usage: + * ```ts + * // Fetch zero or more SupplierLedgers + * const supplierLedgers = await prisma.supplierLedger.findMany() + * ``` + */ + get supplierLedger(): Prisma.SupplierLedgerDelegate; } export function getPrismaClientClass(): PrismaClientConstructor { diff --git a/src/generated/prisma/internal/prismaNamespace.ts b/src/generated/prisma/internal/prismaNamespace.ts index 2866fff..8b814f8 100644 --- a/src/generated/prisma/internal/prismaNamespace.ts +++ b/src/generated/prisma/internal/prismaNamespace.ts @@ -391,13 +391,11 @@ export const ModelName = { BankBranch: 'BankBranch', BankAccount: 'BankAccount', Inventory: 'Inventory', - InventoryTransfer: 'InventoryTransfer', - InventoryTransferItem: 'InventoryTransferItem', InventoryBankAccount: 'InventoryBankAccount', PosAccount: 'PosAccount', + InventoryTransfer: 'InventoryTransfer', + InventoryTransferItem: 'InventoryTransferItem', Bank: 'Bank', - Supplier: 'Supplier', - SupplierLedger: 'SupplierLedger', Customer: 'Customer', Order: 'Order', SalesInvoice: 'SalesInvoice', @@ -412,7 +410,9 @@ export const ModelName = { PurchaseReceiptPayments: 'PurchaseReceiptPayments', StockMovement: 'StockMovement', StockBalance: 'StockBalance', - StockAdjustment: 'StockAdjustment' + StockAdjustment: 'StockAdjustment', + Supplier: 'Supplier', + SupplierLedger: 'SupplierLedger' } as const export type ModelName = (typeof ModelName)[keyof typeof ModelName] @@ -428,7 +428,7 @@ export type TypeMap - fields: Prisma.InventoryTransferFieldRefs - operations: { - findUnique: { - args: Prisma.InventoryTransferFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.InventoryTransferFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.InventoryTransferFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.InventoryTransferFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.InventoryTransferFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.InventoryTransferCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.InventoryTransferCreateManyArgs - result: BatchPayload - } - delete: { - args: Prisma.InventoryTransferDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.InventoryTransferUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.InventoryTransferDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.InventoryTransferUpdateManyArgs - result: BatchPayload - } - upsert: { - args: Prisma.InventoryTransferUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.InventoryTransferAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.InventoryTransferGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.InventoryTransferCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } - InventoryTransferItem: { - payload: Prisma.$InventoryTransferItemPayload - fields: Prisma.InventoryTransferItemFieldRefs - operations: { - findUnique: { - args: Prisma.InventoryTransferItemFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.InventoryTransferItemFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.InventoryTransferItemFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.InventoryTransferItemFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.InventoryTransferItemFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.InventoryTransferItemCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.InventoryTransferItemCreateManyArgs - result: BatchPayload - } - delete: { - args: Prisma.InventoryTransferItemDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.InventoryTransferItemUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.InventoryTransferItemDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.InventoryTransferItemUpdateManyArgs - result: BatchPayload - } - upsert: { - args: Prisma.InventoryTransferItemUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.InventoryTransferItemAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.InventoryTransferItemGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.InventoryTransferItemCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } InventoryBankAccount: { payload: Prisma.$InventoryBankAccountPayload fields: Prisma.InventoryBankAccountFieldRefs @@ -1158,6 +1026,138 @@ export type TypeMap + fields: Prisma.InventoryTransferFieldRefs + operations: { + findUnique: { + args: Prisma.InventoryTransferFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.InventoryTransferFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.InventoryTransferFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.InventoryTransferFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.InventoryTransferFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.InventoryTransferCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.InventoryTransferCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.InventoryTransferDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.InventoryTransferUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.InventoryTransferDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.InventoryTransferUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.InventoryTransferUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.InventoryTransferAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.InventoryTransferGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.InventoryTransferCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + InventoryTransferItem: { + payload: Prisma.$InventoryTransferItemPayload + fields: Prisma.InventoryTransferItemFieldRefs + operations: { + findUnique: { + args: Prisma.InventoryTransferItemFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.InventoryTransferItemFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.InventoryTransferItemFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.InventoryTransferItemFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.InventoryTransferItemFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.InventoryTransferItemCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.InventoryTransferItemCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.InventoryTransferItemDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.InventoryTransferItemUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.InventoryTransferItemDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.InventoryTransferItemUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.InventoryTransferItemUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.InventoryTransferItemAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.InventoryTransferItemGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.InventoryTransferItemCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } Bank: { payload: Prisma.$BankPayload fields: Prisma.BankFieldRefs @@ -1224,138 +1224,6 @@ export type TypeMap - fields: Prisma.SupplierFieldRefs - operations: { - findUnique: { - args: Prisma.SupplierFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.SupplierFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.SupplierFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.SupplierFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.SupplierFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.SupplierCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.SupplierCreateManyArgs - result: BatchPayload - } - delete: { - args: Prisma.SupplierDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.SupplierUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.SupplierDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.SupplierUpdateManyArgs - result: BatchPayload - } - upsert: { - args: Prisma.SupplierUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.SupplierAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.SupplierGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.SupplierCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } - SupplierLedger: { - payload: Prisma.$SupplierLedgerPayload - fields: Prisma.SupplierLedgerFieldRefs - operations: { - findUnique: { - args: Prisma.SupplierLedgerFindUniqueArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findUniqueOrThrow: { - args: Prisma.SupplierLedgerFindUniqueOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findFirst: { - args: Prisma.SupplierLedgerFindFirstArgs - result: runtime.Types.Utils.PayloadToResult | null - } - findFirstOrThrow: { - args: Prisma.SupplierLedgerFindFirstOrThrowArgs - result: runtime.Types.Utils.PayloadToResult - } - findMany: { - args: Prisma.SupplierLedgerFindManyArgs - result: runtime.Types.Utils.PayloadToResult[] - } - create: { - args: Prisma.SupplierLedgerCreateArgs - result: runtime.Types.Utils.PayloadToResult - } - createMany: { - args: Prisma.SupplierLedgerCreateManyArgs - result: BatchPayload - } - delete: { - args: Prisma.SupplierLedgerDeleteArgs - result: runtime.Types.Utils.PayloadToResult - } - update: { - args: Prisma.SupplierLedgerUpdateArgs - result: runtime.Types.Utils.PayloadToResult - } - deleteMany: { - args: Prisma.SupplierLedgerDeleteManyArgs - result: BatchPayload - } - updateMany: { - args: Prisma.SupplierLedgerUpdateManyArgs - result: BatchPayload - } - upsert: { - args: Prisma.SupplierLedgerUpsertArgs - result: runtime.Types.Utils.PayloadToResult - } - aggregate: { - args: Prisma.SupplierLedgerAggregateArgs - result: runtime.Types.Utils.Optional - } - groupBy: { - args: Prisma.SupplierLedgerGroupByArgs - result: runtime.Types.Utils.Optional[] - } - count: { - args: Prisma.SupplierLedgerCountArgs - result: runtime.Types.Utils.Optional | number - } - } - } Customer: { payload: Prisma.$CustomerPayload fields: Prisma.CustomerFieldRefs @@ -2346,6 +2214,138 @@ export type TypeMap + fields: Prisma.SupplierFieldRefs + operations: { + findUnique: { + args: Prisma.SupplierFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.SupplierFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.SupplierFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.SupplierFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.SupplierFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.SupplierCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.SupplierCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.SupplierDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.SupplierUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.SupplierDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.SupplierUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.SupplierUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.SupplierAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.SupplierGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.SupplierCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + SupplierLedger: { + payload: Prisma.$SupplierLedgerPayload + fields: Prisma.SupplierLedgerFieldRefs + operations: { + findUnique: { + args: Prisma.SupplierLedgerFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.SupplierLedgerFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.SupplierLedgerFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.SupplierLedgerFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.SupplierLedgerFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.SupplierLedgerCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.SupplierLedgerCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.SupplierLedgerDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.SupplierLedgerUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.SupplierLedgerDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.SupplierLedgerUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.SupplierLedgerUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.SupplierLedgerAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.SupplierLedgerGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.SupplierLedgerCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } } } & { other: { @@ -2480,28 +2480,6 @@ export const InventoryScalarFieldEnum = { export type InventoryScalarFieldEnum = (typeof InventoryScalarFieldEnum)[keyof typeof InventoryScalarFieldEnum] -export const InventoryTransferScalarFieldEnum = { - id: 'id', - code: 'code', - description: 'description', - createdAt: 'createdAt', - fromInventoryId: 'fromInventoryId', - toInventoryId: 'toInventoryId' -} as const - -export type InventoryTransferScalarFieldEnum = (typeof InventoryTransferScalarFieldEnum)[keyof typeof InventoryTransferScalarFieldEnum] - - -export const InventoryTransferItemScalarFieldEnum = { - id: 'id', - count: 'count', - productId: 'productId', - transferId: 'transferId' -} as const - -export type InventoryTransferItemScalarFieldEnum = (typeof InventoryTransferItemScalarFieldEnum)[keyof typeof InventoryTransferItemScalarFieldEnum] - - export const InventoryBankAccountScalarFieldEnum = { inventoryId: 'inventoryId', bankAccountId: 'bankAccountId' @@ -2525,6 +2503,28 @@ export const PosAccountScalarFieldEnum = { export type PosAccountScalarFieldEnum = (typeof PosAccountScalarFieldEnum)[keyof typeof PosAccountScalarFieldEnum] +export const InventoryTransferScalarFieldEnum = { + id: 'id', + code: 'code', + description: 'description', + createdAt: 'createdAt', + fromInventoryId: 'fromInventoryId', + toInventoryId: 'toInventoryId' +} as const + +export type InventoryTransferScalarFieldEnum = (typeof InventoryTransferScalarFieldEnum)[keyof typeof InventoryTransferScalarFieldEnum] + + +export const InventoryTransferItemScalarFieldEnum = { + id: 'id', + count: 'count', + productId: 'productId', + transferId: 'transferId' +} as const + +export type InventoryTransferItemScalarFieldEnum = (typeof InventoryTransferItemScalarFieldEnum)[keyof typeof InventoryTransferItemScalarFieldEnum] + + export const BankScalarFieldEnum = { id: 'id', name: 'name', @@ -2537,40 +2537,6 @@ export const BankScalarFieldEnum = { export type BankScalarFieldEnum = (typeof BankScalarFieldEnum)[keyof typeof BankScalarFieldEnum] -export const SupplierScalarFieldEnum = { - id: 'id', - firstName: 'firstName', - lastName: 'lastName', - email: 'email', - mobileNumber: 'mobileNumber', - address: 'address', - city: 'city', - state: 'state', - country: 'country', - isActive: 'isActive', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt' -} as const - -export type SupplierScalarFieldEnum = (typeof SupplierScalarFieldEnum)[keyof typeof SupplierScalarFieldEnum] - - -export const SupplierLedgerScalarFieldEnum = { - id: 'id', - description: 'description', - debit: 'debit', - credit: 'credit', - balance: 'balance', - sourceType: 'sourceType', - sourceId: 'sourceId', - createdAt: 'createdAt', - supplierId: 'supplierId' -} as const - -export type SupplierLedgerScalarFieldEnum = (typeof SupplierLedgerScalarFieldEnum)[keyof typeof SupplierLedgerScalarFieldEnum] - - export const CustomerScalarFieldEnum = { id: 'id', firstName: 'firstName', @@ -2713,10 +2679,10 @@ export const PurchaseReceiptScalarFieldEnum = { code: 'code', totalAmount: 'totalAmount', paidAmount: 'paidAmount', - isSettled: 'isSettled', description: 'description', createdAt: 'createdAt', updatedAt: 'updatedAt', + status: 'status', supplierId: 'supplierId', inventoryId: 'inventoryId' } as const @@ -2742,7 +2708,9 @@ export const PurchaseReceiptPaymentsScalarFieldEnum = { id: 'id', amount: 'amount', paymentMethod: 'paymentMethod', + type: 'type', bankAccountId: 'bankAccountId', + inventoryId: 'inventoryId', description: 'description', payedAt: 'payedAt', receiptId: 'receiptId', @@ -2798,6 +2766,40 @@ export const StockAdjustmentScalarFieldEnum = { export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldEnum)[keyof typeof StockAdjustmentScalarFieldEnum] +export const SupplierScalarFieldEnum = { + id: 'id', + firstName: 'firstName', + lastName: 'lastName', + email: 'email', + mobileNumber: 'mobileNumber', + address: 'address', + city: 'city', + state: 'state', + country: 'country', + isActive: 'isActive', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + deletedAt: 'deletedAt' +} as const + +export type SupplierScalarFieldEnum = (typeof SupplierScalarFieldEnum)[keyof typeof SupplierScalarFieldEnum] + + +export const SupplierLedgerScalarFieldEnum = { + id: 'id', + description: 'description', + debit: 'debit', + credit: 'credit', + balance: 'balance', + sourceType: 'sourceType', + sourceId: 'sourceId', + createdAt: 'createdAt', + supplierId: 'supplierId' +} as const + +export type SupplierLedgerScalarFieldEnum = (typeof SupplierLedgerScalarFieldEnum)[keyof typeof SupplierLedgerScalarFieldEnum] + + export const SortOrder = { asc: 'asc', desc: 'desc' @@ -2899,14 +2901,6 @@ export const InventoryOrderByRelevanceFieldEnum = { export type InventoryOrderByRelevanceFieldEnum = (typeof InventoryOrderByRelevanceFieldEnum)[keyof typeof InventoryOrderByRelevanceFieldEnum] -export const InventoryTransferOrderByRelevanceFieldEnum = { - code: 'code', - description: 'description' -} as const - -export type InventoryTransferOrderByRelevanceFieldEnum = (typeof InventoryTransferOrderByRelevanceFieldEnum)[keyof typeof InventoryTransferOrderByRelevanceFieldEnum] - - export const PosAccountOrderByRelevanceFieldEnum = { name: 'name', code: 'code', @@ -2916,6 +2910,14 @@ export const PosAccountOrderByRelevanceFieldEnum = { export type PosAccountOrderByRelevanceFieldEnum = (typeof PosAccountOrderByRelevanceFieldEnum)[keyof typeof PosAccountOrderByRelevanceFieldEnum] +export const InventoryTransferOrderByRelevanceFieldEnum = { + code: 'code', + description: 'description' +} as const + +export type InventoryTransferOrderByRelevanceFieldEnum = (typeof InventoryTransferOrderByRelevanceFieldEnum)[keyof typeof InventoryTransferOrderByRelevanceFieldEnum] + + export const BankOrderByRelevanceFieldEnum = { name: 'name', shortName: 'shortName' @@ -2924,27 +2926,6 @@ export const BankOrderByRelevanceFieldEnum = { export type BankOrderByRelevanceFieldEnum = (typeof BankOrderByRelevanceFieldEnum)[keyof typeof BankOrderByRelevanceFieldEnum] -export const SupplierOrderByRelevanceFieldEnum = { - firstName: 'firstName', - lastName: 'lastName', - email: 'email', - mobileNumber: 'mobileNumber', - address: 'address', - city: 'city', - state: 'state', - country: 'country' -} as const - -export type SupplierOrderByRelevanceFieldEnum = (typeof SupplierOrderByRelevanceFieldEnum)[keyof typeof SupplierOrderByRelevanceFieldEnum] - - -export const SupplierLedgerOrderByRelevanceFieldEnum = { - description: 'description' -} as const - -export type SupplierLedgerOrderByRelevanceFieldEnum = (typeof SupplierLedgerOrderByRelevanceFieldEnum)[keyof typeof SupplierLedgerOrderByRelevanceFieldEnum] - - export const CustomerOrderByRelevanceFieldEnum = { firstName: 'firstName', lastName: 'lastName', @@ -3051,6 +3032,27 @@ export const StockMovementOrderByRelevanceFieldEnum = { export type StockMovementOrderByRelevanceFieldEnum = (typeof StockMovementOrderByRelevanceFieldEnum)[keyof typeof StockMovementOrderByRelevanceFieldEnum] +export const SupplierOrderByRelevanceFieldEnum = { + firstName: 'firstName', + lastName: 'lastName', + email: 'email', + mobileNumber: 'mobileNumber', + address: 'address', + city: 'city', + state: 'state', + country: 'country' +} as const + +export type SupplierOrderByRelevanceFieldEnum = (typeof SupplierOrderByRelevanceFieldEnum)[keyof typeof SupplierOrderByRelevanceFieldEnum] + + +export const SupplierLedgerOrderByRelevanceFieldEnum = { + description: 'description' +} as const + +export type SupplierLedgerOrderByRelevanceFieldEnum = (typeof SupplierLedgerOrderByRelevanceFieldEnum)[keyof typeof SupplierLedgerOrderByRelevanceFieldEnum] + + /** * Field references @@ -3106,13 +3108,6 @@ export type DecimalFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, -/** - * Reference to a field of type 'ledgerSourceType' - */ -export type EnumledgerSourceTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'ledgerSourceType'> - - - /** * Reference to a field of type 'OrderStatus' */ @@ -3121,9 +3116,23 @@ export type EnumOrderStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$Pris /** - * Reference to a field of type 'payment_method_type' + * Reference to a field of type 'PaymentMethodType' */ -export type Enumpayment_method_typeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'payment_method_type'> +export type EnumPaymentMethodTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'PaymentMethodType'> + + + +/** + * Reference to a field of type 'PurchaseReceiptStatus' + */ +export type EnumPurchaseReceiptStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'PurchaseReceiptStatus'> + + + +/** + * Reference to a field of type 'PaymentType' + */ +export type EnumPaymentTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'PaymentType'> @@ -3141,6 +3150,13 @@ export type EnumMovementReferenceTypeFieldRefInput<$PrismaModel> = FieldRefInput +/** + * Reference to a field of type 'LedgerSourceType' + */ +export type EnumLedgerSourceTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'LedgerSourceType'> + + + /** * Reference to a field of type 'Float' */ @@ -3249,13 +3265,11 @@ export type GlobalOmitConfig = { bankBranch?: Prisma.BankBranchOmit bankAccount?: Prisma.BankAccountOmit inventory?: Prisma.InventoryOmit - inventoryTransfer?: Prisma.InventoryTransferOmit - inventoryTransferItem?: Prisma.InventoryTransferItemOmit inventoryBankAccount?: Prisma.InventoryBankAccountOmit posAccount?: Prisma.PosAccountOmit + inventoryTransfer?: Prisma.InventoryTransferOmit + inventoryTransferItem?: Prisma.InventoryTransferItemOmit bank?: Prisma.BankOmit - supplier?: Prisma.SupplierOmit - supplierLedger?: Prisma.SupplierLedgerOmit customer?: Prisma.CustomerOmit order?: Prisma.OrderOmit salesInvoice?: Prisma.SalesInvoiceOmit @@ -3271,6 +3285,8 @@ export type GlobalOmitConfig = { stockMovement?: Prisma.StockMovementOmit stockBalance?: Prisma.StockBalanceOmit stockAdjustment?: Prisma.StockAdjustmentOmit + supplier?: Prisma.SupplierOmit + supplierLedger?: Prisma.SupplierLedgerOmit } /* Types for Logging */ diff --git a/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/generated/prisma/internal/prismaNamespaceBrowser.ts index a2a6610..27b452b 100644 --- a/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -58,13 +58,11 @@ export const ModelName = { BankBranch: 'BankBranch', BankAccount: 'BankAccount', Inventory: 'Inventory', - InventoryTransfer: 'InventoryTransfer', - InventoryTransferItem: 'InventoryTransferItem', InventoryBankAccount: 'InventoryBankAccount', PosAccount: 'PosAccount', + InventoryTransfer: 'InventoryTransfer', + InventoryTransferItem: 'InventoryTransferItem', Bank: 'Bank', - Supplier: 'Supplier', - SupplierLedger: 'SupplierLedger', Customer: 'Customer', Order: 'Order', SalesInvoice: 'SalesInvoice', @@ -79,7 +77,9 @@ export const ModelName = { PurchaseReceiptPayments: 'PurchaseReceiptPayments', StockMovement: 'StockMovement', StockBalance: 'StockBalance', - StockAdjustment: 'StockAdjustment' + StockAdjustment: 'StockAdjustment', + Supplier: 'Supplier', + SupplierLedger: 'SupplierLedger' } as const export type ModelName = (typeof ModelName)[keyof typeof ModelName] @@ -193,28 +193,6 @@ export const InventoryScalarFieldEnum = { export type InventoryScalarFieldEnum = (typeof InventoryScalarFieldEnum)[keyof typeof InventoryScalarFieldEnum] -export const InventoryTransferScalarFieldEnum = { - id: 'id', - code: 'code', - description: 'description', - createdAt: 'createdAt', - fromInventoryId: 'fromInventoryId', - toInventoryId: 'toInventoryId' -} as const - -export type InventoryTransferScalarFieldEnum = (typeof InventoryTransferScalarFieldEnum)[keyof typeof InventoryTransferScalarFieldEnum] - - -export const InventoryTransferItemScalarFieldEnum = { - id: 'id', - count: 'count', - productId: 'productId', - transferId: 'transferId' -} as const - -export type InventoryTransferItemScalarFieldEnum = (typeof InventoryTransferItemScalarFieldEnum)[keyof typeof InventoryTransferItemScalarFieldEnum] - - export const InventoryBankAccountScalarFieldEnum = { inventoryId: 'inventoryId', bankAccountId: 'bankAccountId' @@ -238,6 +216,28 @@ export const PosAccountScalarFieldEnum = { export type PosAccountScalarFieldEnum = (typeof PosAccountScalarFieldEnum)[keyof typeof PosAccountScalarFieldEnum] +export const InventoryTransferScalarFieldEnum = { + id: 'id', + code: 'code', + description: 'description', + createdAt: 'createdAt', + fromInventoryId: 'fromInventoryId', + toInventoryId: 'toInventoryId' +} as const + +export type InventoryTransferScalarFieldEnum = (typeof InventoryTransferScalarFieldEnum)[keyof typeof InventoryTransferScalarFieldEnum] + + +export const InventoryTransferItemScalarFieldEnum = { + id: 'id', + count: 'count', + productId: 'productId', + transferId: 'transferId' +} as const + +export type InventoryTransferItemScalarFieldEnum = (typeof InventoryTransferItemScalarFieldEnum)[keyof typeof InventoryTransferItemScalarFieldEnum] + + export const BankScalarFieldEnum = { id: 'id', name: 'name', @@ -250,40 +250,6 @@ export const BankScalarFieldEnum = { export type BankScalarFieldEnum = (typeof BankScalarFieldEnum)[keyof typeof BankScalarFieldEnum] -export const SupplierScalarFieldEnum = { - id: 'id', - firstName: 'firstName', - lastName: 'lastName', - email: 'email', - mobileNumber: 'mobileNumber', - address: 'address', - city: 'city', - state: 'state', - country: 'country', - isActive: 'isActive', - createdAt: 'createdAt', - updatedAt: 'updatedAt', - deletedAt: 'deletedAt' -} as const - -export type SupplierScalarFieldEnum = (typeof SupplierScalarFieldEnum)[keyof typeof SupplierScalarFieldEnum] - - -export const SupplierLedgerScalarFieldEnum = { - id: 'id', - description: 'description', - debit: 'debit', - credit: 'credit', - balance: 'balance', - sourceType: 'sourceType', - sourceId: 'sourceId', - createdAt: 'createdAt', - supplierId: 'supplierId' -} as const - -export type SupplierLedgerScalarFieldEnum = (typeof SupplierLedgerScalarFieldEnum)[keyof typeof SupplierLedgerScalarFieldEnum] - - export const CustomerScalarFieldEnum = { id: 'id', firstName: 'firstName', @@ -426,10 +392,10 @@ export const PurchaseReceiptScalarFieldEnum = { code: 'code', totalAmount: 'totalAmount', paidAmount: 'paidAmount', - isSettled: 'isSettled', description: 'description', createdAt: 'createdAt', updatedAt: 'updatedAt', + status: 'status', supplierId: 'supplierId', inventoryId: 'inventoryId' } as const @@ -455,7 +421,9 @@ export const PurchaseReceiptPaymentsScalarFieldEnum = { id: 'id', amount: 'amount', paymentMethod: 'paymentMethod', + type: 'type', bankAccountId: 'bankAccountId', + inventoryId: 'inventoryId', description: 'description', payedAt: 'payedAt', receiptId: 'receiptId', @@ -511,6 +479,40 @@ export const StockAdjustmentScalarFieldEnum = { export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldEnum)[keyof typeof StockAdjustmentScalarFieldEnum] +export const SupplierScalarFieldEnum = { + id: 'id', + firstName: 'firstName', + lastName: 'lastName', + email: 'email', + mobileNumber: 'mobileNumber', + address: 'address', + city: 'city', + state: 'state', + country: 'country', + isActive: 'isActive', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + deletedAt: 'deletedAt' +} as const + +export type SupplierScalarFieldEnum = (typeof SupplierScalarFieldEnum)[keyof typeof SupplierScalarFieldEnum] + + +export const SupplierLedgerScalarFieldEnum = { + id: 'id', + description: 'description', + debit: 'debit', + credit: 'credit', + balance: 'balance', + sourceType: 'sourceType', + sourceId: 'sourceId', + createdAt: 'createdAt', + supplierId: 'supplierId' +} as const + +export type SupplierLedgerScalarFieldEnum = (typeof SupplierLedgerScalarFieldEnum)[keyof typeof SupplierLedgerScalarFieldEnum] + + export const SortOrder = { asc: 'asc', desc: 'desc' @@ -612,14 +614,6 @@ export const InventoryOrderByRelevanceFieldEnum = { export type InventoryOrderByRelevanceFieldEnum = (typeof InventoryOrderByRelevanceFieldEnum)[keyof typeof InventoryOrderByRelevanceFieldEnum] -export const InventoryTransferOrderByRelevanceFieldEnum = { - code: 'code', - description: 'description' -} as const - -export type InventoryTransferOrderByRelevanceFieldEnum = (typeof InventoryTransferOrderByRelevanceFieldEnum)[keyof typeof InventoryTransferOrderByRelevanceFieldEnum] - - export const PosAccountOrderByRelevanceFieldEnum = { name: 'name', code: 'code', @@ -629,6 +623,14 @@ export const PosAccountOrderByRelevanceFieldEnum = { export type PosAccountOrderByRelevanceFieldEnum = (typeof PosAccountOrderByRelevanceFieldEnum)[keyof typeof PosAccountOrderByRelevanceFieldEnum] +export const InventoryTransferOrderByRelevanceFieldEnum = { + code: 'code', + description: 'description' +} as const + +export type InventoryTransferOrderByRelevanceFieldEnum = (typeof InventoryTransferOrderByRelevanceFieldEnum)[keyof typeof InventoryTransferOrderByRelevanceFieldEnum] + + export const BankOrderByRelevanceFieldEnum = { name: 'name', shortName: 'shortName' @@ -637,27 +639,6 @@ export const BankOrderByRelevanceFieldEnum = { export type BankOrderByRelevanceFieldEnum = (typeof BankOrderByRelevanceFieldEnum)[keyof typeof BankOrderByRelevanceFieldEnum] -export const SupplierOrderByRelevanceFieldEnum = { - firstName: 'firstName', - lastName: 'lastName', - email: 'email', - mobileNumber: 'mobileNumber', - address: 'address', - city: 'city', - state: 'state', - country: 'country' -} as const - -export type SupplierOrderByRelevanceFieldEnum = (typeof SupplierOrderByRelevanceFieldEnum)[keyof typeof SupplierOrderByRelevanceFieldEnum] - - -export const SupplierLedgerOrderByRelevanceFieldEnum = { - description: 'description' -} as const - -export type SupplierLedgerOrderByRelevanceFieldEnum = (typeof SupplierLedgerOrderByRelevanceFieldEnum)[keyof typeof SupplierLedgerOrderByRelevanceFieldEnum] - - export const CustomerOrderByRelevanceFieldEnum = { firstName: 'firstName', lastName: 'lastName', @@ -763,3 +744,24 @@ export const StockMovementOrderByRelevanceFieldEnum = { export type StockMovementOrderByRelevanceFieldEnum = (typeof StockMovementOrderByRelevanceFieldEnum)[keyof typeof StockMovementOrderByRelevanceFieldEnum] + +export const SupplierOrderByRelevanceFieldEnum = { + firstName: 'firstName', + lastName: 'lastName', + email: 'email', + mobileNumber: 'mobileNumber', + address: 'address', + city: 'city', + state: 'state', + country: 'country' +} as const + +export type SupplierOrderByRelevanceFieldEnum = (typeof SupplierOrderByRelevanceFieldEnum)[keyof typeof SupplierOrderByRelevanceFieldEnum] + + +export const SupplierLedgerOrderByRelevanceFieldEnum = { + description: 'description' +} as const + +export type SupplierLedgerOrderByRelevanceFieldEnum = (typeof SupplierLedgerOrderByRelevanceFieldEnum)[keyof typeof SupplierLedgerOrderByRelevanceFieldEnum] + diff --git a/src/generated/prisma/models.ts b/src/generated/prisma/models.ts index 7d525f0..ba58fa6 100644 --- a/src/generated/prisma/models.ts +++ b/src/generated/prisma/models.ts @@ -15,13 +15,11 @@ export type * from './models/RefreshToken.js' export type * from './models/BankBranch.js' export type * from './models/BankAccount.js' export type * from './models/Inventory.js' -export type * from './models/InventoryTransfer.js' -export type * from './models/InventoryTransferItem.js' export type * from './models/InventoryBankAccount.js' export type * from './models/PosAccount.js' +export type * from './models/InventoryTransfer.js' +export type * from './models/InventoryTransferItem.js' export type * from './models/Bank.js' -export type * from './models/Supplier.js' -export type * from './models/SupplierLedger.js' export type * from './models/Customer.js' export type * from './models/Order.js' export type * from './models/SalesInvoice.js' @@ -37,4 +35,6 @@ export type * from './models/PurchaseReceiptPayments.js' export type * from './models/StockMovement.js' export type * from './models/StockBalance.js' export type * from './models/StockAdjustment.js' +export type * from './models/Supplier.js' +export type * from './models/SupplierLedger.js' export type * from './commonInputTypes.js' \ No newline at end of file diff --git a/src/generated/prisma/models/BankAccount.ts b/src/generated/prisma/models/BankAccount.ts index 1232857..a99f115 100644 --- a/src/generated/prisma/models/BankAccount.ts +++ b/src/generated/prisma/models/BankAccount.ts @@ -253,8 +253,6 @@ export type BankAccountWhereInput = { updatedAt?: Prisma.DateTimeFilter<"BankAccount"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"BankAccount"> | Date | string | null branch?: Prisma.XOR - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter - posAccounts?: Prisma.PosAccountListRelationFilter inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter } @@ -269,8 +267,6 @@ export type BankAccountOrderByWithRelationInput = { updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder branch?: Prisma.BankBranchOrderByWithRelationInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsOrderByRelationAggregateInput - posAccounts?: Prisma.PosAccountOrderByRelationAggregateInput inventoryBankAccounts?: Prisma.InventoryBankAccountOrderByRelationAggregateInput _relevance?: Prisma.BankAccountOrderByRelevanceInput } @@ -289,8 +285,6 @@ export type BankAccountWhereUniqueInput = Prisma.AtLeast<{ updatedAt?: Prisma.DateTimeFilter<"BankAccount"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"BankAccount"> | Date | string | null branch?: Prisma.XOR - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter - posAccounts?: Prisma.PosAccountListRelationFilter inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter }, "id" | "accountNumber" | "cardNumber" | "iban"> @@ -335,8 +329,6 @@ export type BankAccountCreateInput = { updatedAt?: Date | string deletedAt?: Date | string | null branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput } @@ -350,8 +342,6 @@ export type BankAccountUncheckedCreateInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput } @@ -364,8 +354,6 @@ export type BankAccountUpdateInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput } @@ -379,8 +367,6 @@ export type BankAccountUncheckedUpdateInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput } @@ -485,11 +471,6 @@ export type BankAccountScalarRelationFilter = { isNot?: Prisma.BankAccountWhereInput } -export type BankAccountNullableScalarRelationFilter = { - is?: Prisma.BankAccountWhereInput | null - isNot?: Prisma.BankAccountWhereInput | null -} - export type BankAccountCreateNestedManyWithoutBranchInput = { create?: Prisma.XOR | Prisma.BankAccountCreateWithoutBranchInput[] | Prisma.BankAccountUncheckedCreateWithoutBranchInput[] connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutBranchInput | Prisma.BankAccountCreateOrConnectWithoutBranchInput[] @@ -546,38 +527,6 @@ export type BankAccountUpdateOneRequiredWithoutInventoryBankAccountsNestedInput update?: Prisma.XOR, Prisma.BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput> } -export type BankAccountCreateNestedOneWithoutPosAccountsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutPosAccountsInput - connect?: Prisma.BankAccountWhereUniqueInput -} - -export type BankAccountUpdateOneWithoutPosAccountsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutPosAccountsInput - upsert?: Prisma.BankAccountUpsertWithoutPosAccountsInput - disconnect?: Prisma.BankAccountWhereInput | boolean - delete?: Prisma.BankAccountWhereInput | boolean - connect?: Prisma.BankAccountWhereUniqueInput - update?: Prisma.XOR, Prisma.BankAccountUncheckedUpdateWithoutPosAccountsInput> -} - -export type BankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput - connect?: Prisma.BankAccountWhereUniqueInput -} - -export type BankAccountUpdateOneWithoutPurchaseReceiptPaymentsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput - upsert?: Prisma.BankAccountUpsertWithoutPurchaseReceiptPaymentsInput - disconnect?: Prisma.BankAccountWhereInput | boolean - delete?: Prisma.BankAccountWhereInput | boolean - connect?: Prisma.BankAccountWhereUniqueInput - update?: Prisma.XOR, Prisma.BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput> -} - export type BankAccountCreateWithoutBranchInput = { accountNumber?: string | null cardNumber?: string | null @@ -586,8 +535,6 @@ export type BankAccountCreateWithoutBranchInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput } @@ -600,8 +547,6 @@ export type BankAccountUncheckedCreateWithoutBranchInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput } @@ -655,8 +600,6 @@ export type BankAccountCreateWithoutInventoryBankAccountsInput = { updatedAt?: Date | string deletedAt?: Date | string | null branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutBankAccountInput } export type BankAccountUncheckedCreateWithoutInventoryBankAccountsInput = { @@ -669,8 +612,6 @@ export type BankAccountUncheckedCreateWithoutInventoryBankAccountsInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutBankAccountInput } export type BankAccountCreateOrConnectWithoutInventoryBankAccountsInput = { @@ -698,8 +639,6 @@ export type BankAccountUpdateWithoutInventoryBankAccountsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutBankAccountNestedInput } export type BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput = { @@ -712,148 +651,6 @@ export type BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutBankAccountNestedInput -} - -export type BankAccountCreateWithoutPosAccountsInput = { - accountNumber?: string | null - cardNumber?: string | null - name: string - iban?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput - inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput -} - -export type BankAccountUncheckedCreateWithoutPosAccountsInput = { - 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 - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput -} - -export type BankAccountCreateOrConnectWithoutPosAccountsInput = { - where: Prisma.BankAccountWhereUniqueInput - create: Prisma.XOR -} - -export type BankAccountUpsertWithoutPosAccountsInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.BankAccountWhereInput -} - -export type BankAccountUpdateToOneWithWhereWithoutPosAccountsInput = { - where?: Prisma.BankAccountWhereInput - data: Prisma.XOR -} - -export type BankAccountUpdateWithoutPosAccountsInput = { - 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 - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput -} - -export type BankAccountUncheckedUpdateWithoutPosAccountsInput = { - 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 - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput -} - -export type BankAccountCreateWithoutPurchaseReceiptPaymentsInput = { - accountNumber?: string | null - cardNumber?: string | null - name: string - iban?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutBankAccountInput - inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput -} - -export type BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput = { - 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 - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutBankAccountInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput -} - -export type BankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput = { - where: Prisma.BankAccountWhereUniqueInput - create: Prisma.XOR -} - -export type BankAccountUpsertWithoutPurchaseReceiptPaymentsInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.BankAccountWhereInput -} - -export type BankAccountUpdateToOneWithWhereWithoutPurchaseReceiptPaymentsInput = { - where?: Prisma.BankAccountWhereInput - data: Prisma.XOR -} - -export type BankAccountUpdateWithoutPurchaseReceiptPaymentsInput = { - 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 - posAccounts?: Prisma.PosAccountUpdateManyWithoutBankAccountNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput -} - -export type BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput = { - 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 - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutBankAccountNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput } export type BankAccountCreateManyBranchInput = { @@ -875,8 +672,6 @@ export type BankAccountUpdateWithoutBranchInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput } @@ -889,8 +684,6 @@ export type BankAccountUncheckedUpdateWithoutBranchInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput } @@ -911,14 +704,10 @@ export type BankAccountUncheckedUpdateManyWithoutBranchInput = { */ export type BankAccountCountOutputType = { - purchaseReceiptPayments: number - posAccounts: number inventoryBankAccounts: number } export type BankAccountCountOutputTypeSelect = { - purchaseReceiptPayments?: boolean | BankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs - posAccounts?: boolean | BankAccountCountOutputTypeCountPosAccountsArgs inventoryBankAccounts?: boolean | BankAccountCountOutputTypeCountInventoryBankAccountsArgs } @@ -932,20 +721,6 @@ export type BankAccountCountOutputTypeDefaultArgs | null } -/** - * BankAccountCountOutputType without action - */ -export type BankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs = { - where?: Prisma.PurchaseReceiptPaymentsWhereInput -} - -/** - * BankAccountCountOutputType without action - */ -export type BankAccountCountOutputTypeCountPosAccountsArgs = { - where?: Prisma.PosAccountWhereInput -} - /** * BankAccountCountOutputType without action */ @@ -965,8 +740,6 @@ export type BankAccountSelect - purchaseReceiptPayments?: boolean | Prisma.BankAccount$purchaseReceiptPaymentsArgs - posAccounts?: boolean | Prisma.BankAccount$posAccountsArgs inventoryBankAccounts?: boolean | Prisma.BankAccount$inventoryBankAccountsArgs _count?: boolean | Prisma.BankAccountCountOutputTypeDefaultArgs }, ExtArgs["result"]["bankAccount"]> @@ -988,8 +761,6 @@ export type BankAccountSelectScalar = { export type BankAccountOmit = runtime.Types.Extensions.GetOmit<"id" | "accountNumber" | "cardNumber" | "name" | "iban" | "branchId" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["bankAccount"]> export type BankAccountInclude = { branch?: boolean | Prisma.BankBranchDefaultArgs - purchaseReceiptPayments?: boolean | Prisma.BankAccount$purchaseReceiptPaymentsArgs - posAccounts?: boolean | Prisma.BankAccount$posAccountsArgs inventoryBankAccounts?: boolean | Prisma.BankAccount$inventoryBankAccountsArgs _count?: boolean | Prisma.BankAccountCountOutputTypeDefaultArgs } @@ -998,8 +769,6 @@ export type $BankAccountPayload - purchaseReceiptPayments: Prisma.$PurchaseReceiptPaymentsPayload[] - posAccounts: Prisma.$PosAccountPayload[] inventoryBankAccounts: Prisma.$InventoryBankAccountPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ @@ -1353,8 +1122,6 @@ readonly fields: BankAccountFieldRefs; export interface Prisma__BankAccountClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" branch = {}>(args?: Prisma.Subset>): Prisma.Prisma__BankBranchClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> - purchaseReceiptPayments = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> - posAccounts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> inventoryBankAccounts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. @@ -1736,54 +1503,6 @@ export type BankAccountDeleteManyArgs = { - /** - * Select specific fields to fetch from the PurchaseReceiptPayments - */ - select?: Prisma.PurchaseReceiptPaymentsSelect | null - /** - * Omit specific fields from the PurchaseReceiptPayments - */ - omit?: Prisma.PurchaseReceiptPaymentsOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.PurchaseReceiptPaymentsInclude | null - where?: Prisma.PurchaseReceiptPaymentsWhereInput - orderBy?: Prisma.PurchaseReceiptPaymentsOrderByWithRelationInput | Prisma.PurchaseReceiptPaymentsOrderByWithRelationInput[] - cursor?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.PurchaseReceiptPaymentsScalarFieldEnum | Prisma.PurchaseReceiptPaymentsScalarFieldEnum[] -} - -/** - * BankAccount.posAccounts - */ -export type BankAccount$posAccountsArgs = { - /** - * Select specific fields to fetch from the PosAccount - */ - select?: Prisma.PosAccountSelect | null - /** - * Omit specific fields from the PosAccount - */ - omit?: Prisma.PosAccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.PosAccountInclude | null - where?: Prisma.PosAccountWhereInput - orderBy?: Prisma.PosAccountOrderByWithRelationInput | Prisma.PosAccountOrderByWithRelationInput[] - cursor?: Prisma.PosAccountWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.PosAccountScalarFieldEnum | Prisma.PosAccountScalarFieldEnum[] -} - /** * BankAccount.inventoryBankAccounts */ diff --git a/src/generated/prisma/models/Inventory.ts b/src/generated/prisma/models/Inventory.ts index a038c6d..621d743 100644 --- a/src/generated/prisma/models/Inventory.ts +++ b/src/generated/prisma/models/Inventory.ts @@ -248,7 +248,6 @@ export type InventoryWhereInput = { stockBalances?: Prisma.StockBalanceListRelationFilter counterStockMovements?: Prisma.StockMovementListRelationFilter stockMovements?: Prisma.StockMovementListRelationFilter - posAccounts?: Prisma.PosAccountListRelationFilter inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter } @@ -269,7 +268,6 @@ export type InventoryOrderByWithRelationInput = { stockBalances?: Prisma.StockBalanceOrderByRelationAggregateInput counterStockMovements?: Prisma.StockMovementOrderByRelationAggregateInput stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput - posAccounts?: Prisma.PosAccountOrderByRelationAggregateInput inventoryBankAccounts?: Prisma.InventoryBankAccountOrderByRelationAggregateInput _relevance?: Prisma.InventoryOrderByRelevanceInput } @@ -294,7 +292,6 @@ export type InventoryWhereUniqueInput = Prisma.AtLeast<{ stockBalances?: Prisma.StockBalanceListRelationFilter counterStockMovements?: Prisma.StockMovementListRelationFilter stockMovements?: Prisma.StockMovementListRelationFilter - posAccounts?: Prisma.PosAccountListRelationFilter inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter }, "id"> @@ -344,7 +341,6 @@ export type InventoryCreateInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -365,7 +361,6 @@ export type InventoryUncheckedCreateInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -385,7 +380,6 @@ export type InventoryUpdateInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -406,7 +400,6 @@ export type InventoryUncheckedUpdateInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -499,6 +492,20 @@ export type InventoryNullableScalarRelationFilter = { isNot?: Prisma.InventoryWhereInput | null } +export type InventoryCreateNestedOneWithoutInventoryBankAccountsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryBankAccountsInput + connect?: Prisma.InventoryWhereUniqueInput +} + +export type InventoryUpdateOneRequiredWithoutInventoryBankAccountsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryBankAccountsInput + upsert?: Prisma.InventoryUpsertWithoutInventoryBankAccountsInput + connect?: Prisma.InventoryWhereUniqueInput + update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutInventoryBankAccountsInput> +} + export type InventoryCreateNestedOneWithoutInventoryTransfersFromInput = { create?: Prisma.XOR connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryTransfersFromInput @@ -527,34 +534,6 @@ export type InventoryUpdateOneRequiredWithoutInventoryTransfersToNestedInput = { update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutInventoryTransfersToInput> } -export type InventoryCreateNestedOneWithoutInventoryBankAccountsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryBankAccountsInput - connect?: Prisma.InventoryWhereUniqueInput -} - -export type InventoryUpdateOneRequiredWithoutInventoryBankAccountsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryBankAccountsInput - upsert?: Prisma.InventoryUpsertWithoutInventoryBankAccountsInput - connect?: Prisma.InventoryWhereUniqueInput - update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutInventoryBankAccountsInput> -} - -export type InventoryCreateNestedOneWithoutPosAccountsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutPosAccountsInput - connect?: Prisma.InventoryWhereUniqueInput -} - -export type InventoryUpdateOneRequiredWithoutPosAccountsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutPosAccountsInput - upsert?: Prisma.InventoryUpsertWithoutPosAccountsInput - connect?: Prisma.InventoryWhereUniqueInput - update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutPosAccountsInput> -} - export type InventoryCreateNestedOneWithoutSalesInvoicesInput = { create?: Prisma.XOR connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutSalesInvoicesInput @@ -641,194 +620,6 @@ export type InventoryUpdateOneRequiredWithoutStockAdjustmentsNestedInput = { update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutStockAdjustmentsInput> } -export type InventoryCreateWithoutInventoryTransfersFromInput = { - name: string - location?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - isPointOfSale?: boolean - inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput - purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput - salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput - stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput - stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput - counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput - stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput - inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput -} - -export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = { - id?: number - name: string - location?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - isPointOfSale?: boolean - inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput - purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput - salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput - stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput - stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput - counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput - stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput -} - -export type InventoryCreateOrConnectWithoutInventoryTransfersFromInput = { - where: Prisma.InventoryWhereUniqueInput - create: Prisma.XOR -} - -export type InventoryCreateWithoutInventoryTransfersToInput = { - name: string - location?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - isPointOfSale?: boolean - inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput - purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput - salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput - stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput - stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput - counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput - stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput - inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput -} - -export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = { - id?: number - name: string - location?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - isPointOfSale?: boolean - inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput - purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput - salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput - stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput - stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput - counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput - stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput -} - -export type InventoryCreateOrConnectWithoutInventoryTransfersToInput = { - where: Prisma.InventoryWhereUniqueInput - create: Prisma.XOR -} - -export type InventoryUpsertWithoutInventoryTransfersFromInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.InventoryWhereInput -} - -export type InventoryUpdateToOneWithWhereWithoutInventoryTransfersFromInput = { - where?: Prisma.InventoryWhereInput - data: Prisma.XOR -} - -export type InventoryUpdateWithoutInventoryTransfersFromInput = { - name?: Prisma.StringFieldUpdateOperationsInput | string - location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput - purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput - salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput - stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput - stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput - counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput - stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput -} - -export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - name?: Prisma.StringFieldUpdateOperationsInput | string - location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput - purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput - salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput - stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput - stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput - counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput - stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput -} - -export type InventoryUpsertWithoutInventoryTransfersToInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.InventoryWhereInput -} - -export type InventoryUpdateToOneWithWhereWithoutInventoryTransfersToInput = { - where?: Prisma.InventoryWhereInput - data: Prisma.XOR -} - -export type InventoryUpdateWithoutInventoryTransfersToInput = { - name?: Prisma.StringFieldUpdateOperationsInput | string - location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput - purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput - salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput - stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput - stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput - counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput - stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput -} - -export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - name?: Prisma.StringFieldUpdateOperationsInput | string - location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput - purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput - salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput - stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput - stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput - counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput - stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput -} - export type InventoryCreateWithoutInventoryBankAccountsInput = { name: string location?: string | null @@ -845,7 +636,6 @@ export type InventoryCreateWithoutInventoryBankAccountsInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput } export type InventoryUncheckedCreateWithoutInventoryBankAccountsInput = { @@ -865,7 +655,6 @@ export type InventoryUncheckedCreateWithoutInventoryBankAccountsInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput } export type InventoryCreateOrConnectWithoutInventoryBankAccountsInput = { @@ -900,7 +689,6 @@ export type InventoryUpdateWithoutInventoryBankAccountsInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput } export type InventoryUncheckedUpdateWithoutInventoryBankAccountsInput = { @@ -920,10 +708,9 @@ export type InventoryUncheckedUpdateWithoutInventoryBankAccountsInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput } -export type InventoryCreateWithoutPosAccountsInput = { +export type InventoryCreateWithoutInventoryTransfersFromInput = { name: string location?: string | null isActive?: boolean @@ -931,7 +718,6 @@ export type InventoryCreateWithoutPosAccountsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput @@ -942,7 +728,7 @@ export type InventoryCreateWithoutPosAccountsInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } -export type InventoryUncheckedCreateWithoutPosAccountsInput = { +export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = { id?: number name: string location?: string | null @@ -951,7 +737,6 @@ export type InventoryUncheckedCreateWithoutPosAccountsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput @@ -962,23 +747,65 @@ export type InventoryUncheckedCreateWithoutPosAccountsInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } -export type InventoryCreateOrConnectWithoutPosAccountsInput = { +export type InventoryCreateOrConnectWithoutInventoryTransfersFromInput = { where: Prisma.InventoryWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type InventoryUpsertWithoutPosAccountsInput = { - update: Prisma.XOR - create: Prisma.XOR +export type InventoryCreateWithoutInventoryTransfersToInput = { + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + isPointOfSale?: boolean + inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput + stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput + counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput + inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput +} + +export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = { + id?: number + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + isPointOfSale?: boolean + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput + stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput + counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput + inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput +} + +export type InventoryCreateOrConnectWithoutInventoryTransfersToInput = { + where: Prisma.InventoryWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryUpsertWithoutInventoryTransfersFromInput = { + update: Prisma.XOR + create: Prisma.XOR where?: Prisma.InventoryWhereInput } -export type InventoryUpdateToOneWithWhereWithoutPosAccountsInput = { +export type InventoryUpdateToOneWithWhereWithoutInventoryTransfersFromInput = { where?: Prisma.InventoryWhereInput - data: Prisma.XOR + data: Prisma.XOR } -export type InventoryUpdateWithoutPosAccountsInput = { +export type InventoryUpdateWithoutInventoryTransfersFromInput = { name?: Prisma.StringFieldUpdateOperationsInput | string location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean @@ -986,7 +813,6 @@ export type InventoryUpdateWithoutPosAccountsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput @@ -997,7 +823,55 @@ export type InventoryUpdateWithoutPosAccountsInput = { inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } -export type InventoryUncheckedUpdateWithoutPosAccountsInput = { +export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput + stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput + counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput + inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput +} + +export type InventoryUpsertWithoutInventoryTransfersToInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.InventoryWhereInput +} + +export type InventoryUpdateToOneWithWhereWithoutInventoryTransfersToInput = { + where?: Prisma.InventoryWhereInput + data: Prisma.XOR +} + +export type InventoryUpdateWithoutInventoryTransfersToInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean + inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput + stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput + counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput + inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput +} + +export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = { id?: Prisma.IntFieldUpdateOperationsInput | number name?: Prisma.StringFieldUpdateOperationsInput | string location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null @@ -1007,7 +881,6 @@ export type InventoryUncheckedUpdateWithoutPosAccountsInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput - inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput @@ -1032,7 +905,6 @@ export type InventoryCreateWithoutSalesInvoicesInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1052,7 +924,6 @@ export type InventoryUncheckedCreateWithoutSalesInvoicesInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1087,7 +958,6 @@ export type InventoryUpdateWithoutSalesInvoicesInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1107,7 +977,6 @@ export type InventoryUncheckedUpdateWithoutSalesInvoicesInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1126,7 +995,6 @@ export type InventoryCreateWithoutPurchaseReceiptsInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1146,7 +1014,6 @@ export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1181,7 +1048,6 @@ export type InventoryUpdateWithoutPurchaseReceiptsInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1201,7 +1067,6 @@ export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1220,7 +1085,6 @@ export type InventoryCreateWithoutCounterStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1240,7 +1104,6 @@ export type InventoryUncheckedCreateWithoutCounterStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1264,7 +1127,6 @@ export type InventoryCreateWithoutStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1284,7 +1146,6 @@ export type InventoryUncheckedCreateWithoutStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1319,7 +1180,6 @@ export type InventoryUpdateWithoutCounterStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1339,7 +1199,6 @@ export type InventoryUncheckedUpdateWithoutCounterStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1369,7 +1228,6 @@ export type InventoryUpdateWithoutStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1389,7 +1247,6 @@ export type InventoryUncheckedUpdateWithoutStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1408,7 +1265,6 @@ export type InventoryCreateWithoutStockBalancesInput = { stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1428,7 +1284,6 @@ export type InventoryUncheckedCreateWithoutStockBalancesInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1463,7 +1318,6 @@ export type InventoryUpdateWithoutStockBalancesInput = { stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1483,7 +1337,6 @@ export type InventoryUncheckedUpdateWithoutStockBalancesInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1502,7 +1355,6 @@ export type InventoryCreateWithoutStockAdjustmentsInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1522,7 +1374,6 @@ export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1557,7 +1408,6 @@ export type InventoryUpdateWithoutStockAdjustmentsInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1577,7 +1427,6 @@ export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1595,7 +1444,6 @@ export type InventoryCountOutputType = { stockBalances: number counterStockMovements: number stockMovements: number - posAccounts: number inventoryBankAccounts: number } @@ -1608,7 +1456,6 @@ export type InventoryCountOutputTypeSelect = { - where?: Prisma.PosAccountWhereInput -} - /** * InventoryCountOutputType without action */ @@ -1710,7 +1550,6 @@ export type InventorySelect counterStockMovements?: boolean | Prisma.Inventory$counterStockMovementsArgs stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs - posAccounts?: boolean | Prisma.Inventory$posAccountsArgs inventoryBankAccounts?: boolean | Prisma.Inventory$inventoryBankAccountsArgs _count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs }, ExtArgs["result"]["inventory"]> @@ -1738,7 +1577,6 @@ export type InventoryInclude counterStockMovements?: boolean | Prisma.Inventory$counterStockMovementsArgs stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs - posAccounts?: boolean | Prisma.Inventory$posAccountsArgs inventoryBankAccounts?: boolean | Prisma.Inventory$inventoryBankAccountsArgs _count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs } @@ -1754,7 +1592,6 @@ export type $InventoryPayload[] counterStockMovements: Prisma.$StockMovementPayload[] stockMovements: Prisma.$StockMovementPayload[] - posAccounts: Prisma.$PosAccountPayload[] inventoryBankAccounts: Prisma.$InventoryBankAccountPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ @@ -2114,7 +1951,6 @@ export interface Prisma__InventoryClient = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> counterStockMovements = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> stockMovements = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> - posAccounts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> inventoryBankAccounts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. @@ -2687,30 +2523,6 @@ export type Inventory$stockMovementsArgs = { - /** - * Select specific fields to fetch from the PosAccount - */ - select?: Prisma.PosAccountSelect | null - /** - * Omit specific fields from the PosAccount - */ - omit?: Prisma.PosAccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.PosAccountInclude | null - where?: Prisma.PosAccountWhereInput - orderBy?: Prisma.PosAccountOrderByWithRelationInput | Prisma.PosAccountOrderByWithRelationInput[] - cursor?: Prisma.PosAccountWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.PosAccountScalarFieldEnum | Prisma.PosAccountScalarFieldEnum[] -} - /** * Inventory.inventoryBankAccounts */ diff --git a/src/generated/prisma/models/InventoryBankAccount.ts b/src/generated/prisma/models/InventoryBankAccount.ts index 4953646..3d1c500 100644 --- a/src/generated/prisma/models/InventoryBankAccount.ts +++ b/src/generated/prisma/models/InventoryBankAccount.ts @@ -199,6 +199,7 @@ export type InventoryBankAccountWhereInput = { inventory?: Prisma.XOR bankAccount?: Prisma.XOR posAccounts?: Prisma.PosAccountListRelationFilter + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter } export type InventoryBankAccountOrderByWithRelationInput = { @@ -207,6 +208,7 @@ export type InventoryBankAccountOrderByWithRelationInput = { inventory?: Prisma.InventoryOrderByWithRelationInput bankAccount?: Prisma.BankAccountOrderByWithRelationInput posAccounts?: Prisma.PosAccountOrderByRelationAggregateInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsOrderByRelationAggregateInput } export type InventoryBankAccountWhereUniqueInput = Prisma.AtLeast<{ @@ -219,6 +221,7 @@ export type InventoryBankAccountWhereUniqueInput = Prisma.AtLeast<{ inventory?: Prisma.XOR bankAccount?: Prisma.XOR posAccounts?: Prisma.PosAccountListRelationFilter + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter }, "inventoryId_bankAccountId"> export type InventoryBankAccountOrderByWithAggregationInput = { @@ -243,24 +246,28 @@ export type InventoryBankAccountCreateInput = { inventory: Prisma.InventoryCreateNestedOneWithoutInventoryBankAccountsInput bankAccount: Prisma.BankAccountCreateNestedOneWithoutInventoryBankAccountsInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryBankAccountInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutInventoryBankAccountInput } export type InventoryBankAccountUncheckedCreateInput = { inventoryId: number bankAccountId: number posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryBankAccountInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutInventoryBankAccountInput } export type InventoryBankAccountUpdateInput = { inventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryBankAccountsNestedInput bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutInventoryBankAccountsNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryBankAccountNestedInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutInventoryBankAccountNestedInput } export type InventoryBankAccountUncheckedUpdateInput = { inventoryId?: Prisma.IntFieldUpdateOperationsInput | number bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryBankAccountNestedInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountNestedInput } export type InventoryBankAccountCreateManyInput = { @@ -317,9 +324,9 @@ export type InventoryBankAccountSumOrderByAggregateInput = { bankAccountId?: Prisma.SortOrder } -export type InventoryBankAccountNullableScalarRelationFilter = { - is?: Prisma.InventoryBankAccountWhereInput | null - isNot?: Prisma.InventoryBankAccountWhereInput | null +export type InventoryBankAccountScalarRelationFilter = { + is?: Prisma.InventoryBankAccountWhereInput + isNot?: Prisma.InventoryBankAccountWhereInput } export type InventoryBankAccountCreateNestedManyWithoutBankAccountInput = { @@ -412,24 +419,38 @@ export type InventoryBankAccountCreateNestedOneWithoutPosAccountsInput = { connect?: Prisma.InventoryBankAccountWhereUniqueInput } -export type InventoryBankAccountUpdateOneWithoutPosAccountsNestedInput = { +export type InventoryBankAccountUpdateOneRequiredWithoutPosAccountsNestedInput = { create?: Prisma.XOR connectOrCreate?: Prisma.InventoryBankAccountCreateOrConnectWithoutPosAccountsInput upsert?: Prisma.InventoryBankAccountUpsertWithoutPosAccountsInput - disconnect?: Prisma.InventoryBankAccountWhereInput | boolean - delete?: Prisma.InventoryBankAccountWhereInput | boolean connect?: Prisma.InventoryBankAccountWhereUniqueInput update?: Prisma.XOR, Prisma.InventoryBankAccountUncheckedUpdateWithoutPosAccountsInput> } +export type InventoryBankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryBankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput + connect?: Prisma.InventoryBankAccountWhereUniqueInput +} + +export type InventoryBankAccountUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryBankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput + upsert?: Prisma.InventoryBankAccountUpsertWithoutPurchaseReceiptPaymentsInput + connect?: Prisma.InventoryBankAccountWhereUniqueInput + update?: Prisma.XOR, Prisma.InventoryBankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput> +} + export type InventoryBankAccountCreateWithoutBankAccountInput = { inventory: Prisma.InventoryCreateNestedOneWithoutInventoryBankAccountsInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryBankAccountInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutInventoryBankAccountInput } export type InventoryBankAccountUncheckedCreateWithoutBankAccountInput = { inventoryId: number posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryBankAccountInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutInventoryBankAccountInput } export type InventoryBankAccountCreateOrConnectWithoutBankAccountInput = { @@ -469,11 +490,13 @@ export type InventoryBankAccountScalarWhereInput = { export type InventoryBankAccountCreateWithoutInventoryInput = { bankAccount: Prisma.BankAccountCreateNestedOneWithoutInventoryBankAccountsInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryBankAccountInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutInventoryBankAccountInput } export type InventoryBankAccountUncheckedCreateWithoutInventoryInput = { bankAccountId: number posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryBankAccountInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutInventoryBankAccountInput } export type InventoryBankAccountCreateOrConnectWithoutInventoryInput = { @@ -505,11 +528,13 @@ export type InventoryBankAccountUpdateManyWithWhereWithoutInventoryInput = { export type InventoryBankAccountCreateWithoutPosAccountsInput = { inventory: Prisma.InventoryCreateNestedOneWithoutInventoryBankAccountsInput bankAccount: Prisma.BankAccountCreateNestedOneWithoutInventoryBankAccountsInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutInventoryBankAccountInput } export type InventoryBankAccountUncheckedCreateWithoutPosAccountsInput = { inventoryId: number bankAccountId: number + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutInventoryBankAccountInput } export type InventoryBankAccountCreateOrConnectWithoutPosAccountsInput = { @@ -531,11 +556,53 @@ export type InventoryBankAccountUpdateToOneWithWhereWithoutPosAccountsInput = { export type InventoryBankAccountUpdateWithoutPosAccountsInput = { inventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryBankAccountsNestedInput bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutInventoryBankAccountsNestedInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutInventoryBankAccountNestedInput } export type InventoryBankAccountUncheckedUpdateWithoutPosAccountsInput = { inventoryId?: Prisma.IntFieldUpdateOperationsInput | number bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountNestedInput +} + +export type InventoryBankAccountCreateWithoutPurchaseReceiptPaymentsInput = { + inventory: Prisma.InventoryCreateNestedOneWithoutInventoryBankAccountsInput + bankAccount: Prisma.BankAccountCreateNestedOneWithoutInventoryBankAccountsInput + posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryBankAccountInput +} + +export type InventoryBankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput = { + inventoryId: number + bankAccountId: number + posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryBankAccountInput +} + +export type InventoryBankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput = { + where: Prisma.InventoryBankAccountWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryBankAccountUpsertWithoutPurchaseReceiptPaymentsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.InventoryBankAccountWhereInput +} + +export type InventoryBankAccountUpdateToOneWithWhereWithoutPurchaseReceiptPaymentsInput = { + where?: Prisma.InventoryBankAccountWhereInput + data: Prisma.XOR +} + +export type InventoryBankAccountUpdateWithoutPurchaseReceiptPaymentsInput = { + inventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryBankAccountsNestedInput + bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutInventoryBankAccountsNestedInput + posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryBankAccountNestedInput +} + +export type InventoryBankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput = { + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number + posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryBankAccountNestedInput } export type InventoryBankAccountCreateManyBankAccountInput = { @@ -545,11 +612,13 @@ export type InventoryBankAccountCreateManyBankAccountInput = { export type InventoryBankAccountUpdateWithoutBankAccountInput = { inventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryBankAccountsNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryBankAccountNestedInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutInventoryBankAccountNestedInput } export type InventoryBankAccountUncheckedUpdateWithoutBankAccountInput = { inventoryId?: Prisma.IntFieldUpdateOperationsInput | number posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryBankAccountNestedInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountNestedInput } export type InventoryBankAccountUncheckedUpdateManyWithoutBankAccountInput = { @@ -563,11 +632,13 @@ export type InventoryBankAccountCreateManyInventoryInput = { export type InventoryBankAccountUpdateWithoutInventoryInput = { bankAccount?: Prisma.BankAccountUpdateOneRequiredWithoutInventoryBankAccountsNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryBankAccountNestedInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutInventoryBankAccountNestedInput } export type InventoryBankAccountUncheckedUpdateWithoutInventoryInput = { bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryBankAccountNestedInput + purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountNestedInput } export type InventoryBankAccountUncheckedUpdateManyWithoutInventoryInput = { @@ -581,10 +652,12 @@ export type InventoryBankAccountUncheckedUpdateManyWithoutInventoryInput = { export type InventoryBankAccountCountOutputType = { posAccounts: number + purchaseReceiptPayments: number } export type InventoryBankAccountCountOutputTypeSelect = { posAccounts?: boolean | InventoryBankAccountCountOutputTypeCountPosAccountsArgs + purchaseReceiptPayments?: boolean | InventoryBankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs } /** @@ -604,6 +677,13 @@ export type InventoryBankAccountCountOutputTypeCountPosAccountsArgs = { + where?: Prisma.PurchaseReceiptPaymentsWhereInput +} + export type InventoryBankAccountSelect = runtime.Types.Extensions.GetSelect<{ inventoryId?: boolean @@ -611,6 +691,7 @@ export type InventoryBankAccountSelect bankAccount?: boolean | Prisma.BankAccountDefaultArgs posAccounts?: boolean | Prisma.InventoryBankAccount$posAccountsArgs + purchaseReceiptPayments?: boolean | Prisma.InventoryBankAccount$purchaseReceiptPaymentsArgs _count?: boolean | Prisma.InventoryBankAccountCountOutputTypeDefaultArgs }, ExtArgs["result"]["inventoryBankAccount"]> @@ -626,6 +707,7 @@ export type InventoryBankAccountInclude bankAccount?: boolean | Prisma.BankAccountDefaultArgs posAccounts?: boolean | Prisma.InventoryBankAccount$posAccountsArgs + purchaseReceiptPayments?: boolean | Prisma.InventoryBankAccount$purchaseReceiptPaymentsArgs _count?: boolean | Prisma.InventoryBankAccountCountOutputTypeDefaultArgs } @@ -635,6 +717,7 @@ export type $InventoryBankAccountPayload bankAccount: Prisma.$BankAccountPayload posAccounts: Prisma.$PosAccountPayload[] + purchaseReceiptPayments: Prisma.$PurchaseReceiptPaymentsPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ inventoryId: number @@ -982,6 +1065,7 @@ export interface Prisma__InventoryBankAccountClient = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> bankAccount = {}>(args?: Prisma.Subset>): Prisma.Prisma__BankAccountClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> posAccounts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + purchaseReceiptPayments = {}>(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. @@ -1379,6 +1463,30 @@ export type InventoryBankAccount$posAccountsArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptPayments + */ + select?: Prisma.PurchaseReceiptPaymentsSelect | null + /** + * Omit specific fields from the PurchaseReceiptPayments + */ + omit?: Prisma.PurchaseReceiptPaymentsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptPaymentsInclude | null + where?: Prisma.PurchaseReceiptPaymentsWhereInput + orderBy?: Prisma.PurchaseReceiptPaymentsOrderByWithRelationInput | Prisma.PurchaseReceiptPaymentsOrderByWithRelationInput[] + cursor?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PurchaseReceiptPaymentsScalarFieldEnum | Prisma.PurchaseReceiptPaymentsScalarFieldEnum[] +} + /** * InventoryBankAccount without action */ diff --git a/src/generated/prisma/models/Order.ts b/src/generated/prisma/models/Order.ts index 55bef43..74d4d1a 100644 --- a/src/generated/prisma/models/Order.ts +++ b/src/generated/prisma/models/Order.ts @@ -42,7 +42,7 @@ export type OrderMinAggregateOutputType = { id: number | null orderNumber: string | null status: $Enums.OrderStatus | null - paymentMethod: $Enums.payment_method_type | null + paymentMethod: $Enums.PaymentMethodType | null totalAmount: runtime.Decimal | null description: string | null createdAt: Date | null @@ -55,7 +55,7 @@ export type OrderMaxAggregateOutputType = { id: number | null orderNumber: string | null status: $Enums.OrderStatus | null - paymentMethod: $Enums.payment_method_type | null + paymentMethod: $Enums.PaymentMethodType | null totalAmount: runtime.Decimal | null description: string | null createdAt: Date | null @@ -221,7 +221,7 @@ export type OrderGroupByOutputType = { id: number orderNumber: string status: $Enums.OrderStatus - paymentMethod: $Enums.payment_method_type + paymentMethod: $Enums.PaymentMethodType totalAmount: runtime.Decimal description: string | null createdAt: Date @@ -257,7 +257,7 @@ export type OrderWhereInput = { id?: Prisma.IntFilter<"Order"> | number orderNumber?: Prisma.StringFilter<"Order"> | string status?: Prisma.EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeFilter<"Order"> | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"Order"> | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.StringNullableFilter<"Order"> | string | null createdAt?: Prisma.DateTimeFilter<"Order"> | Date | string @@ -289,7 +289,7 @@ export type OrderWhereUniqueInput = Prisma.AtLeast<{ OR?: Prisma.OrderWhereInput[] NOT?: Prisma.OrderWhereInput | Prisma.OrderWhereInput[] status?: Prisma.EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeFilter<"Order"> | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"Order"> | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.StringNullableFilter<"Order"> | string | null createdAt?: Prisma.DateTimeFilter<"Order"> | Date | string @@ -324,7 +324,7 @@ export type OrderScalarWhereWithAggregatesInput = { id?: Prisma.IntWithAggregatesFilter<"Order"> | number orderNumber?: Prisma.StringWithAggregatesFilter<"Order"> | string status?: Prisma.EnumOrderStatusWithAggregatesFilter<"Order"> | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeWithAggregatesFilter<"Order"> | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeWithAggregatesFilter<"Order"> | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalWithAggregatesFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.StringNullableWithAggregatesFilter<"Order"> | string | null createdAt?: Prisma.DateTimeWithAggregatesFilter<"Order"> | Date | string @@ -336,7 +336,7 @@ export type OrderScalarWhereWithAggregatesInput = { export type OrderCreateInput = { orderNumber: string status?: $Enums.OrderStatus - paymentMethod?: $Enums.payment_method_type + paymentMethod?: $Enums.PaymentMethodType totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null createdAt?: Date | string @@ -349,7 +349,7 @@ export type OrderUncheckedCreateInput = { id?: number orderNumber: string status?: $Enums.OrderStatus - paymentMethod?: $Enums.payment_method_type + paymentMethod?: $Enums.PaymentMethodType totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null createdAt?: Date | string @@ -361,7 +361,7 @@ export type OrderUncheckedCreateInput = { export type OrderUpdateInput = { orderNumber?: Prisma.StringFieldUpdateOperationsInput | string status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -374,7 +374,7 @@ export type OrderUncheckedUpdateInput = { id?: Prisma.IntFieldUpdateOperationsInput | number orderNumber?: Prisma.StringFieldUpdateOperationsInput | string status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -387,7 +387,7 @@ export type OrderCreateManyInput = { id?: number orderNumber: string status?: $Enums.OrderStatus - paymentMethod?: $Enums.payment_method_type + paymentMethod?: $Enums.PaymentMethodType totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null createdAt?: Date | string @@ -399,7 +399,7 @@ export type OrderCreateManyInput = { export type OrderUpdateManyMutationInput = { orderNumber?: Prisma.StringFieldUpdateOperationsInput | string status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -411,7 +411,7 @@ export type OrderUncheckedUpdateManyInput = { id?: Prisma.IntFieldUpdateOperationsInput | number orderNumber?: Prisma.StringFieldUpdateOperationsInput | string status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -533,14 +533,14 @@ export type EnumOrderStatusFieldUpdateOperationsInput = { set?: $Enums.OrderStatus } -export type Enumpayment_method_typeFieldUpdateOperationsInput = { - set?: $Enums.payment_method_type +export type EnumPaymentMethodTypeFieldUpdateOperationsInput = { + set?: $Enums.PaymentMethodType } export type OrderCreateWithoutCustomerInput = { orderNumber: string status?: $Enums.OrderStatus - paymentMethod?: $Enums.payment_method_type + paymentMethod?: $Enums.PaymentMethodType totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null createdAt?: Date | string @@ -552,7 +552,7 @@ export type OrderUncheckedCreateWithoutCustomerInput = { id?: number orderNumber: string status?: $Enums.OrderStatus - paymentMethod?: $Enums.payment_method_type + paymentMethod?: $Enums.PaymentMethodType totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null createdAt?: Date | string @@ -593,7 +593,7 @@ export type OrderScalarWhereInput = { id?: Prisma.IntFilter<"Order"> | number orderNumber?: Prisma.StringFilter<"Order"> | string status?: Prisma.EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeFilter<"Order"> | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"Order"> | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.StringNullableFilter<"Order"> | string | null createdAt?: Prisma.DateTimeFilter<"Order"> | Date | string @@ -606,7 +606,7 @@ export type OrderCreateManyCustomerInput = { id?: number orderNumber: string status?: $Enums.OrderStatus - paymentMethod?: $Enums.payment_method_type + paymentMethod?: $Enums.PaymentMethodType totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string description?: string | null createdAt?: Date | string @@ -617,7 +617,7 @@ export type OrderCreateManyCustomerInput = { export type OrderUpdateWithoutCustomerInput = { orderNumber?: Prisma.StringFieldUpdateOperationsInput | string status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -629,7 +629,7 @@ export type OrderUncheckedUpdateWithoutCustomerInput = { id?: Prisma.IntFieldUpdateOperationsInput | number orderNumber?: Prisma.StringFieldUpdateOperationsInput | string status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -641,7 +641,7 @@ export type OrderUncheckedUpdateManyWithoutCustomerInput = { id?: Prisma.IntFieldUpdateOperationsInput | number orderNumber?: Prisma.StringFieldUpdateOperationsInput | string status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -694,7 +694,7 @@ export type $OrderPayload readonly orderNumber: Prisma.FieldRef<"Order", 'String'> readonly status: Prisma.FieldRef<"Order", 'OrderStatus'> - readonly paymentMethod: Prisma.FieldRef<"Order", 'payment_method_type'> + readonly paymentMethod: Prisma.FieldRef<"Order", 'PaymentMethodType'> readonly totalAmount: Prisma.FieldRef<"Order", 'Decimal'> readonly description: Prisma.FieldRef<"Order", 'String'> readonly createdAt: Prisma.FieldRef<"Order", 'DateTime'> diff --git a/src/generated/prisma/models/PosAccount.ts b/src/generated/prisma/models/PosAccount.ts index d51ddb9..8d2bdad 100644 --- a/src/generated/prisma/models/PosAccount.ts +++ b/src/generated/prisma/models/PosAccount.ts @@ -256,9 +256,7 @@ export type PosAccountWhereInput = { createdAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string updatedAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"PosAccount"> | Date | string | null - inventory?: Prisma.XOR - inventoryBankAccount?: Prisma.XOR | null - bankAccount?: Prisma.XOR | null + inventoryBankAccount?: Prisma.XOR } export type PosAccountOrderByWithRelationInput = { @@ -271,9 +269,7 @@ export type PosAccountOrderByWithRelationInput = { createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder - inventory?: Prisma.InventoryOrderByWithRelationInput inventoryBankAccount?: Prisma.InventoryBankAccountOrderByWithRelationInput - bankAccount?: Prisma.BankAccountOrderByWithRelationInput _relevance?: Prisma.PosAccountOrderByRelevanceInput } @@ -290,9 +286,7 @@ export type PosAccountWhereUniqueInput = Prisma.AtLeast<{ createdAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string updatedAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"PosAccount"> | Date | string | null - inventory?: Prisma.XOR - inventoryBankAccount?: Prisma.XOR | null - bankAccount?: Prisma.XOR | null + inventoryBankAccount?: Prisma.XOR }, "id" | "code"> export type PosAccountOrderByWithAggregationInput = { @@ -334,9 +328,7 @@ export type PosAccountCreateInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - inventory: Prisma.InventoryCreateNestedOneWithoutPosAccountsInput - inventoryBankAccount?: Prisma.InventoryBankAccountCreateNestedOneWithoutPosAccountsInput - bankAccount?: Prisma.BankAccountCreateNestedOneWithoutPosAccountsInput + inventoryBankAccount: Prisma.InventoryBankAccountCreateNestedOneWithoutPosAccountsInput } export type PosAccountUncheckedCreateInput = { @@ -358,9 +350,7 @@ export type PosAccountUpdateInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventory?: Prisma.InventoryUpdateOneRequiredWithoutPosAccountsNestedInput - inventoryBankAccount?: Prisma.InventoryBankAccountUpdateOneWithoutPosAccountsNestedInput - bankAccount?: Prisma.BankAccountUpdateOneWithoutPosAccountsNestedInput + inventoryBankAccount?: Prisma.InventoryBankAccountUpdateOneRequiredWithoutPosAccountsNestedInput } export type PosAccountUncheckedUpdateInput = { @@ -472,90 +462,6 @@ export type PosAccountSumOrderByAggregateInput = { inventoryId?: Prisma.SortOrder } -export type PosAccountCreateNestedManyWithoutBankAccountInput = { - create?: Prisma.XOR | Prisma.PosAccountCreateWithoutBankAccountInput[] | Prisma.PosAccountUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.PosAccountCreateOrConnectWithoutBankAccountInput | Prisma.PosAccountCreateOrConnectWithoutBankAccountInput[] - createMany?: Prisma.PosAccountCreateManyBankAccountInputEnvelope - connect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] -} - -export type PosAccountUncheckedCreateNestedManyWithoutBankAccountInput = { - create?: Prisma.XOR | Prisma.PosAccountCreateWithoutBankAccountInput[] | Prisma.PosAccountUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.PosAccountCreateOrConnectWithoutBankAccountInput | Prisma.PosAccountCreateOrConnectWithoutBankAccountInput[] - createMany?: Prisma.PosAccountCreateManyBankAccountInputEnvelope - connect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] -} - -export type PosAccountUpdateManyWithoutBankAccountNestedInput = { - create?: Prisma.XOR | Prisma.PosAccountCreateWithoutBankAccountInput[] | Prisma.PosAccountUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.PosAccountCreateOrConnectWithoutBankAccountInput | Prisma.PosAccountCreateOrConnectWithoutBankAccountInput[] - upsert?: Prisma.PosAccountUpsertWithWhereUniqueWithoutBankAccountInput | Prisma.PosAccountUpsertWithWhereUniqueWithoutBankAccountInput[] - createMany?: Prisma.PosAccountCreateManyBankAccountInputEnvelope - set?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - disconnect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - delete?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - connect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - update?: Prisma.PosAccountUpdateWithWhereUniqueWithoutBankAccountInput | Prisma.PosAccountUpdateWithWhereUniqueWithoutBankAccountInput[] - updateMany?: Prisma.PosAccountUpdateManyWithWhereWithoutBankAccountInput | Prisma.PosAccountUpdateManyWithWhereWithoutBankAccountInput[] - deleteMany?: Prisma.PosAccountScalarWhereInput | Prisma.PosAccountScalarWhereInput[] -} - -export type PosAccountUncheckedUpdateManyWithoutBankAccountNestedInput = { - create?: Prisma.XOR | Prisma.PosAccountCreateWithoutBankAccountInput[] | Prisma.PosAccountUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.PosAccountCreateOrConnectWithoutBankAccountInput | Prisma.PosAccountCreateOrConnectWithoutBankAccountInput[] - upsert?: Prisma.PosAccountUpsertWithWhereUniqueWithoutBankAccountInput | Prisma.PosAccountUpsertWithWhereUniqueWithoutBankAccountInput[] - createMany?: Prisma.PosAccountCreateManyBankAccountInputEnvelope - set?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - disconnect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - delete?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - connect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - update?: Prisma.PosAccountUpdateWithWhereUniqueWithoutBankAccountInput | Prisma.PosAccountUpdateWithWhereUniqueWithoutBankAccountInput[] - updateMany?: Prisma.PosAccountUpdateManyWithWhereWithoutBankAccountInput | Prisma.PosAccountUpdateManyWithWhereWithoutBankAccountInput[] - deleteMany?: Prisma.PosAccountScalarWhereInput | Prisma.PosAccountScalarWhereInput[] -} - -export type PosAccountCreateNestedManyWithoutInventoryInput = { - create?: Prisma.XOR | Prisma.PosAccountCreateWithoutInventoryInput[] | Prisma.PosAccountUncheckedCreateWithoutInventoryInput[] - connectOrCreate?: Prisma.PosAccountCreateOrConnectWithoutInventoryInput | Prisma.PosAccountCreateOrConnectWithoutInventoryInput[] - createMany?: Prisma.PosAccountCreateManyInventoryInputEnvelope - connect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] -} - -export type PosAccountUncheckedCreateNestedManyWithoutInventoryInput = { - create?: Prisma.XOR | Prisma.PosAccountCreateWithoutInventoryInput[] | Prisma.PosAccountUncheckedCreateWithoutInventoryInput[] - connectOrCreate?: Prisma.PosAccountCreateOrConnectWithoutInventoryInput | Prisma.PosAccountCreateOrConnectWithoutInventoryInput[] - createMany?: Prisma.PosAccountCreateManyInventoryInputEnvelope - connect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] -} - -export type PosAccountUpdateManyWithoutInventoryNestedInput = { - create?: Prisma.XOR | Prisma.PosAccountCreateWithoutInventoryInput[] | Prisma.PosAccountUncheckedCreateWithoutInventoryInput[] - connectOrCreate?: Prisma.PosAccountCreateOrConnectWithoutInventoryInput | Prisma.PosAccountCreateOrConnectWithoutInventoryInput[] - upsert?: Prisma.PosAccountUpsertWithWhereUniqueWithoutInventoryInput | Prisma.PosAccountUpsertWithWhereUniqueWithoutInventoryInput[] - createMany?: Prisma.PosAccountCreateManyInventoryInputEnvelope - set?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - disconnect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - delete?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - connect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - update?: Prisma.PosAccountUpdateWithWhereUniqueWithoutInventoryInput | Prisma.PosAccountUpdateWithWhereUniqueWithoutInventoryInput[] - updateMany?: Prisma.PosAccountUpdateManyWithWhereWithoutInventoryInput | Prisma.PosAccountUpdateManyWithWhereWithoutInventoryInput[] - deleteMany?: Prisma.PosAccountScalarWhereInput | Prisma.PosAccountScalarWhereInput[] -} - -export type PosAccountUncheckedUpdateManyWithoutInventoryNestedInput = { - create?: Prisma.XOR | Prisma.PosAccountCreateWithoutInventoryInput[] | Prisma.PosAccountUncheckedCreateWithoutInventoryInput[] - connectOrCreate?: Prisma.PosAccountCreateOrConnectWithoutInventoryInput | Prisma.PosAccountCreateOrConnectWithoutInventoryInput[] - upsert?: Prisma.PosAccountUpsertWithWhereUniqueWithoutInventoryInput | Prisma.PosAccountUpsertWithWhereUniqueWithoutInventoryInput[] - createMany?: Prisma.PosAccountCreateManyInventoryInputEnvelope - set?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - disconnect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - delete?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - connect?: Prisma.PosAccountWhereUniqueInput | Prisma.PosAccountWhereUniqueInput[] - update?: Prisma.PosAccountUpdateWithWhereUniqueWithoutInventoryInput | Prisma.PosAccountUpdateWithWhereUniqueWithoutInventoryInput[] - updateMany?: Prisma.PosAccountUpdateManyWithWhereWithoutInventoryInput | Prisma.PosAccountUpdateManyWithWhereWithoutInventoryInput[] - deleteMany?: Prisma.PosAccountScalarWhereInput | Prisma.PosAccountScalarWhereInput[] -} - export type PosAccountCreateNestedManyWithoutInventoryBankAccountInput = { create?: Prisma.XOR | Prisma.PosAccountCreateWithoutInventoryBankAccountInput[] | Prisma.PosAccountUncheckedCreateWithoutInventoryBankAccountInput[] connectOrCreate?: Prisma.PosAccountCreateOrConnectWithoutInventoryBankAccountInput | Prisma.PosAccountCreateOrConnectWithoutInventoryBankAccountInput[] @@ -598,117 +504,6 @@ export type PosAccountUncheckedUpdateManyWithoutInventoryBankAccountNestedInput deleteMany?: Prisma.PosAccountScalarWhereInput | Prisma.PosAccountScalarWhereInput[] } -export type PosAccountCreateWithoutBankAccountInput = { - name: string - code: string - description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - inventory: Prisma.InventoryCreateNestedOneWithoutPosAccountsInput - inventoryBankAccount?: Prisma.InventoryBankAccountCreateNestedOneWithoutPosAccountsInput -} - -export type PosAccountUncheckedCreateWithoutBankAccountInput = { - id?: number - name: string - code: string - description?: string | null - inventoryId: number - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null -} - -export type PosAccountCreateOrConnectWithoutBankAccountInput = { - where: Prisma.PosAccountWhereUniqueInput - create: Prisma.XOR -} - -export type PosAccountCreateManyBankAccountInputEnvelope = { - data: Prisma.PosAccountCreateManyBankAccountInput | Prisma.PosAccountCreateManyBankAccountInput[] - skipDuplicates?: boolean -} - -export type PosAccountUpsertWithWhereUniqueWithoutBankAccountInput = { - where: Prisma.PosAccountWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR -} - -export type PosAccountUpdateWithWhereUniqueWithoutBankAccountInput = { - where: Prisma.PosAccountWhereUniqueInput - data: Prisma.XOR -} - -export type PosAccountUpdateManyWithWhereWithoutBankAccountInput = { - where: Prisma.PosAccountScalarWhereInput - data: Prisma.XOR -} - -export type PosAccountScalarWhereInput = { - AND?: Prisma.PosAccountScalarWhereInput | Prisma.PosAccountScalarWhereInput[] - OR?: Prisma.PosAccountScalarWhereInput[] - NOT?: Prisma.PosAccountScalarWhereInput | Prisma.PosAccountScalarWhereInput[] - id?: Prisma.IntFilter<"PosAccount"> | number - name?: Prisma.StringFilter<"PosAccount"> | string - code?: Prisma.StringFilter<"PosAccount"> | string - description?: Prisma.StringNullableFilter<"PosAccount"> | string | null - bankAccountId?: Prisma.IntFilter<"PosAccount"> | number - inventoryId?: Prisma.IntFilter<"PosAccount"> | number - createdAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"PosAccount"> | Date | string | null -} - -export type PosAccountCreateWithoutInventoryInput = { - name: string - code: string - description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - inventoryBankAccount?: Prisma.InventoryBankAccountCreateNestedOneWithoutPosAccountsInput - bankAccount?: Prisma.BankAccountCreateNestedOneWithoutPosAccountsInput -} - -export type PosAccountUncheckedCreateWithoutInventoryInput = { - id?: number - name: string - code: string - description?: string | null - bankAccountId: number - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null -} - -export type PosAccountCreateOrConnectWithoutInventoryInput = { - where: Prisma.PosAccountWhereUniqueInput - create: Prisma.XOR -} - -export type PosAccountCreateManyInventoryInputEnvelope = { - data: Prisma.PosAccountCreateManyInventoryInput | Prisma.PosAccountCreateManyInventoryInput[] - skipDuplicates?: boolean -} - -export type PosAccountUpsertWithWhereUniqueWithoutInventoryInput = { - where: Prisma.PosAccountWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR -} - -export type PosAccountUpdateWithWhereUniqueWithoutInventoryInput = { - where: Prisma.PosAccountWhereUniqueInput - data: Prisma.XOR -} - -export type PosAccountUpdateManyWithWhereWithoutInventoryInput = { - where: Prisma.PosAccountScalarWhereInput - data: Prisma.XOR -} - export type PosAccountCreateWithoutInventoryBankAccountInput = { name: string code: string @@ -716,8 +511,6 @@ export type PosAccountCreateWithoutInventoryBankAccountInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - inventory: Prisma.InventoryCreateNestedOneWithoutPosAccountsInput - bankAccount?: Prisma.BankAccountCreateNestedOneWithoutPosAccountsInput } export type PosAccountUncheckedCreateWithoutInventoryBankAccountInput = { @@ -756,92 +549,19 @@ export type PosAccountUpdateManyWithWhereWithoutInventoryBankAccountInput = { data: Prisma.XOR } -export type PosAccountCreateManyBankAccountInput = { - id?: number - name: string - code: string - description?: string | null - inventoryId: number - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null -} - -export type PosAccountUpdateWithoutBankAccountInput = { - name?: Prisma.StringFieldUpdateOperationsInput | string - code?: Prisma.StringFieldUpdateOperationsInput | string - description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventory?: Prisma.InventoryUpdateOneRequiredWithoutPosAccountsNestedInput - inventoryBankAccount?: Prisma.InventoryBankAccountUpdateOneWithoutPosAccountsNestedInput -} - -export type PosAccountUncheckedUpdateWithoutBankAccountInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - name?: Prisma.StringFieldUpdateOperationsInput | string - code?: Prisma.StringFieldUpdateOperationsInput | string - description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - inventoryId?: Prisma.IntFieldUpdateOperationsInput | number - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null -} - -export type PosAccountUncheckedUpdateManyWithoutBankAccountInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - name?: Prisma.StringFieldUpdateOperationsInput | string - code?: Prisma.StringFieldUpdateOperationsInput | string - description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - inventoryId?: Prisma.IntFieldUpdateOperationsInput | number - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null -} - -export type PosAccountCreateManyInventoryInput = { - id?: number - name: string - code: string - description?: string | null - bankAccountId: number - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null -} - -export type PosAccountUpdateWithoutInventoryInput = { - name?: Prisma.StringFieldUpdateOperationsInput | string - code?: Prisma.StringFieldUpdateOperationsInput | string - description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventoryBankAccount?: Prisma.InventoryBankAccountUpdateOneWithoutPosAccountsNestedInput - bankAccount?: Prisma.BankAccountUpdateOneWithoutPosAccountsNestedInput -} - -export type PosAccountUncheckedUpdateWithoutInventoryInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - name?: Prisma.StringFieldUpdateOperationsInput | string - code?: Prisma.StringFieldUpdateOperationsInput | string - description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null -} - -export type PosAccountUncheckedUpdateManyWithoutInventoryInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - name?: Prisma.StringFieldUpdateOperationsInput | string - code?: Prisma.StringFieldUpdateOperationsInput | string - description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +export type PosAccountScalarWhereInput = { + AND?: Prisma.PosAccountScalarWhereInput | Prisma.PosAccountScalarWhereInput[] + OR?: Prisma.PosAccountScalarWhereInput[] + NOT?: Prisma.PosAccountScalarWhereInput | Prisma.PosAccountScalarWhereInput[] + id?: Prisma.IntFilter<"PosAccount"> | number + name?: Prisma.StringFilter<"PosAccount"> | string + code?: Prisma.StringFilter<"PosAccount"> | string + description?: Prisma.StringNullableFilter<"PosAccount"> | string | null + bankAccountId?: Prisma.IntFilter<"PosAccount"> | number + inventoryId?: Prisma.IntFilter<"PosAccount"> | number + createdAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"PosAccount"> | Date | string | null } export type PosAccountCreateManyInventoryBankAccountInput = { @@ -861,8 +581,6 @@ export type PosAccountUpdateWithoutInventoryBankAccountInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventory?: Prisma.InventoryUpdateOneRequiredWithoutPosAccountsNestedInput - bankAccount?: Prisma.BankAccountUpdateOneWithoutPosAccountsNestedInput } export type PosAccountUncheckedUpdateWithoutInventoryBankAccountInput = { @@ -897,9 +615,7 @@ export type PosAccountSelect - inventoryBankAccount?: boolean | Prisma.PosAccount$inventoryBankAccountArgs - bankAccount?: boolean | Prisma.PosAccount$bankAccountArgs + inventoryBankAccount?: boolean | Prisma.InventoryBankAccountDefaultArgs }, ExtArgs["result"]["posAccount"]> @@ -918,17 +634,13 @@ export type PosAccountSelectScalar = { export type PosAccountOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "code" | "description" | "bankAccountId" | "inventoryId" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["posAccount"]> export type PosAccountInclude = { - inventory?: boolean | Prisma.InventoryDefaultArgs - inventoryBankAccount?: boolean | Prisma.PosAccount$inventoryBankAccountArgs - bankAccount?: boolean | Prisma.PosAccount$bankAccountArgs + inventoryBankAccount?: boolean | Prisma.InventoryBankAccountDefaultArgs } export type $PosAccountPayload = { name: "PosAccount" objects: { - inventory: Prisma.$InventoryPayload - inventoryBankAccount: Prisma.$InventoryBankAccountPayload | null - bankAccount: Prisma.$BankAccountPayload | null + inventoryBankAccount: Prisma.$InventoryBankAccountPayload } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: number @@ -1280,9 +992,7 @@ readonly fields: PosAccountFieldRefs; */ export interface Prisma__PosAccountClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" - inventory = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> - inventoryBankAccount = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryBankAccountClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> - bankAccount = {}>(args?: Prisma.Subset>): Prisma.Prisma__BankAccountClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + inventoryBankAccount = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryBankAccountClient, 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. @@ -1663,44 +1373,6 @@ export type PosAccountDeleteManyArgs = { - /** - * Select specific fields to fetch from the InventoryBankAccount - */ - select?: Prisma.InventoryBankAccountSelect | null - /** - * Omit specific fields from the InventoryBankAccount - */ - omit?: Prisma.InventoryBankAccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.InventoryBankAccountInclude | null - where?: Prisma.InventoryBankAccountWhereInput -} - -/** - * PosAccount.bankAccount - */ -export type PosAccount$bankAccountArgs = { - /** - * Select specific fields to fetch from the BankAccount - */ - select?: Prisma.BankAccountSelect | null - /** - * Omit specific fields from the BankAccount - */ - omit?: Prisma.BankAccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountInclude | null - where?: Prisma.BankAccountWhereInput -} - /** * PosAccount without action */ diff --git a/src/generated/prisma/models/PurchaseReceipt.ts b/src/generated/prisma/models/PurchaseReceipt.ts index 8303749..b818afa 100644 --- a/src/generated/prisma/models/PurchaseReceipt.ts +++ b/src/generated/prisma/models/PurchaseReceipt.ts @@ -47,10 +47,10 @@ export type PurchaseReceiptMinAggregateOutputType = { code: string | null totalAmount: runtime.Decimal | null paidAmount: runtime.Decimal | null - isSettled: boolean | null description: string | null createdAt: Date | null updatedAt: Date | null + status: $Enums.PurchaseReceiptStatus | null supplierId: number | null inventoryId: number | null } @@ -60,10 +60,10 @@ export type PurchaseReceiptMaxAggregateOutputType = { code: string | null totalAmount: runtime.Decimal | null paidAmount: runtime.Decimal | null - isSettled: boolean | null description: string | null createdAt: Date | null updatedAt: Date | null + status: $Enums.PurchaseReceiptStatus | null supplierId: number | null inventoryId: number | null } @@ -73,10 +73,10 @@ export type PurchaseReceiptCountAggregateOutputType = { code: number totalAmount: number paidAmount: number - isSettled: number description: number createdAt: number updatedAt: number + status: number supplierId: number inventoryId: number _all: number @@ -104,10 +104,10 @@ export type PurchaseReceiptMinAggregateInputType = { code?: true totalAmount?: true paidAmount?: true - isSettled?: true description?: true createdAt?: true updatedAt?: true + status?: true supplierId?: true inventoryId?: true } @@ -117,10 +117,10 @@ export type PurchaseReceiptMaxAggregateInputType = { code?: true totalAmount?: true paidAmount?: true - isSettled?: true description?: true createdAt?: true updatedAt?: true + status?: true supplierId?: true inventoryId?: true } @@ -130,10 +130,10 @@ export type PurchaseReceiptCountAggregateInputType = { code?: true totalAmount?: true paidAmount?: true - isSettled?: true description?: true createdAt?: true updatedAt?: true + status?: true supplierId?: true inventoryId?: true _all?: true @@ -230,10 +230,10 @@ export type PurchaseReceiptGroupByOutputType = { code: string totalAmount: runtime.Decimal paidAmount: runtime.Decimal - isSettled: boolean description: string | null createdAt: Date updatedAt: Date + status: $Enums.PurchaseReceiptStatus supplierId: number inventoryId: number _count: PurchaseReceiptCountAggregateOutputType | null @@ -266,16 +266,16 @@ export type PurchaseReceiptWhereInput = { code?: Prisma.StringFilter<"PurchaseReceipt"> | string totalAmount?: Prisma.DecimalFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFilter<"PurchaseReceipt"> | boolean description?: Prisma.StringNullableFilter<"PurchaseReceipt"> | string | null createdAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string updatedAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFilter<"PurchaseReceipt"> | $Enums.PurchaseReceiptStatus supplierId?: Prisma.IntFilter<"PurchaseReceipt"> | number inventoryId?: Prisma.IntFilter<"PurchaseReceipt"> | number items?: Prisma.PurchaseReceiptItemListRelationFilter inventory?: Prisma.XOR supplier?: Prisma.XOR - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter + payments?: Prisma.PurchaseReceiptPaymentsListRelationFilter } export type PurchaseReceiptOrderByWithRelationInput = { @@ -283,16 +283,16 @@ export type PurchaseReceiptOrderByWithRelationInput = { code?: Prisma.SortOrder totalAmount?: Prisma.SortOrder paidAmount?: Prisma.SortOrder - isSettled?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + status?: Prisma.SortOrder supplierId?: Prisma.SortOrder inventoryId?: Prisma.SortOrder items?: Prisma.PurchaseReceiptItemOrderByRelationAggregateInput inventory?: Prisma.InventoryOrderByWithRelationInput supplier?: Prisma.SupplierOrderByWithRelationInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsOrderByRelationAggregateInput + payments?: Prisma.PurchaseReceiptPaymentsOrderByRelationAggregateInput _relevance?: Prisma.PurchaseReceiptOrderByRelevanceInput } @@ -304,16 +304,16 @@ export type PurchaseReceiptWhereUniqueInput = Prisma.AtLeast<{ NOT?: Prisma.PurchaseReceiptWhereInput | Prisma.PurchaseReceiptWhereInput[] totalAmount?: Prisma.DecimalFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFilter<"PurchaseReceipt"> | boolean description?: Prisma.StringNullableFilter<"PurchaseReceipt"> | string | null createdAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string updatedAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFilter<"PurchaseReceipt"> | $Enums.PurchaseReceiptStatus supplierId?: Prisma.IntFilter<"PurchaseReceipt"> | number inventoryId?: Prisma.IntFilter<"PurchaseReceipt"> | number items?: Prisma.PurchaseReceiptItemListRelationFilter inventory?: Prisma.XOR supplier?: Prisma.XOR - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter + payments?: Prisma.PurchaseReceiptPaymentsListRelationFilter }, "id" | "code"> export type PurchaseReceiptOrderByWithAggregationInput = { @@ -321,10 +321,10 @@ export type PurchaseReceiptOrderByWithAggregationInput = { code?: Prisma.SortOrder totalAmount?: Prisma.SortOrder paidAmount?: Prisma.SortOrder - isSettled?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + status?: Prisma.SortOrder supplierId?: Prisma.SortOrder inventoryId?: Prisma.SortOrder _count?: Prisma.PurchaseReceiptCountOrderByAggregateInput @@ -342,10 +342,10 @@ export type PurchaseReceiptScalarWhereWithAggregatesInput = { code?: Prisma.StringWithAggregatesFilter<"PurchaseReceipt"> | string totalAmount?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolWithAggregatesFilter<"PurchaseReceipt"> | boolean description?: Prisma.StringNullableWithAggregatesFilter<"PurchaseReceipt"> | string | null createdAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceipt"> | Date | string updatedAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceipt"> | Date | string + status?: Prisma.EnumPurchaseReceiptStatusWithAggregatesFilter<"PurchaseReceipt"> | $Enums.PurchaseReceiptStatus supplierId?: Prisma.IntWithAggregatesFilter<"PurchaseReceipt"> | number inventoryId?: Prisma.IntWithAggregatesFilter<"PurchaseReceipt"> | number } @@ -354,14 +354,14 @@ export type PurchaseReceiptCreateInput = { code: string totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean description?: string | null createdAt?: Date | string updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput - supplier: Prisma.SupplierCreateNestedOneWithoutPurchaseReceiptsInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput + supplier: Prisma.SupplierCreateNestedOneWithoutReceiptsInput + payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput } export type PurchaseReceiptUncheckedCreateInput = { @@ -369,28 +369,28 @@ export type PurchaseReceiptUncheckedCreateInput = { code: string totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean description?: string | null createdAt?: Date | string updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus supplierId: number inventoryId: number items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput + payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput } export type PurchaseReceiptUpdateInput = { code?: Prisma.StringFieldUpdateOperationsInput | string totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput - supplier?: Prisma.SupplierUpdateOneRequiredWithoutPurchaseReceiptsNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutReceiptsNestedInput + payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput } export type PurchaseReceiptUncheckedUpdateInput = { @@ -398,14 +398,14 @@ export type PurchaseReceiptUncheckedUpdateInput = { code?: Prisma.StringFieldUpdateOperationsInput | string totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus supplierId?: Prisma.IntFieldUpdateOperationsInput | number inventoryId?: Prisma.IntFieldUpdateOperationsInput | number items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput + payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput } export type PurchaseReceiptCreateManyInput = { @@ -413,10 +413,10 @@ export type PurchaseReceiptCreateManyInput = { code: string totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean description?: string | null createdAt?: Date | string updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus supplierId: number inventoryId: number } @@ -425,10 +425,10 @@ export type PurchaseReceiptUpdateManyMutationInput = { code?: Prisma.StringFieldUpdateOperationsInput | string totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus } export type PurchaseReceiptUncheckedUpdateManyInput = { @@ -436,10 +436,10 @@ export type PurchaseReceiptUncheckedUpdateManyInput = { code?: Prisma.StringFieldUpdateOperationsInput | string totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus supplierId?: Prisma.IntFieldUpdateOperationsInput | number inventoryId?: Prisma.IntFieldUpdateOperationsInput | number } @@ -465,10 +465,10 @@ export type PurchaseReceiptCountOrderByAggregateInput = { code?: Prisma.SortOrder totalAmount?: Prisma.SortOrder paidAmount?: Prisma.SortOrder - isSettled?: Prisma.SortOrder description?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + status?: Prisma.SortOrder supplierId?: Prisma.SortOrder inventoryId?: Prisma.SortOrder } @@ -486,10 +486,10 @@ export type PurchaseReceiptMaxOrderByAggregateInput = { code?: Prisma.SortOrder totalAmount?: Prisma.SortOrder paidAmount?: Prisma.SortOrder - isSettled?: Prisma.SortOrder description?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + status?: Prisma.SortOrder supplierId?: Prisma.SortOrder inventoryId?: Prisma.SortOrder } @@ -499,10 +499,10 @@ export type PurchaseReceiptMinOrderByAggregateInput = { code?: Prisma.SortOrder totalAmount?: Prisma.SortOrder paidAmount?: Prisma.SortOrder - isSettled?: Prisma.SortOrder description?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + status?: Prisma.SortOrder supplierId?: Prisma.SortOrder inventoryId?: Prisma.SortOrder } @@ -562,6 +562,38 @@ export type PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput = { deleteMany?: Prisma.PurchaseReceiptScalarWhereInput | Prisma.PurchaseReceiptScalarWhereInput[] } +export type EnumPurchaseReceiptStatusFieldUpdateOperationsInput = { + set?: $Enums.PurchaseReceiptStatus +} + +export type PurchaseReceiptCreateNestedOneWithoutItemsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutItemsInput + connect?: Prisma.PurchaseReceiptWhereUniqueInput +} + +export type PurchaseReceiptUpdateOneRequiredWithoutItemsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutItemsInput + upsert?: Prisma.PurchaseReceiptUpsertWithoutItemsInput + connect?: Prisma.PurchaseReceiptWhereUniqueInput + update?: Prisma.XOR, Prisma.PurchaseReceiptUncheckedUpdateWithoutItemsInput> +} + +export type PurchaseReceiptCreateNestedOneWithoutPaymentsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutPaymentsInput + connect?: Prisma.PurchaseReceiptWhereUniqueInput +} + +export type PurchaseReceiptUpdateOneRequiredWithoutPaymentsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutPaymentsInput + upsert?: Prisma.PurchaseReceiptUpsertWithoutPaymentsInput + connect?: Prisma.PurchaseReceiptWhereUniqueInput + update?: Prisma.XOR, Prisma.PurchaseReceiptUncheckedUpdateWithoutPaymentsInput> +} + export type PurchaseReceiptCreateNestedManyWithoutSupplierInput = { create?: Prisma.XOR | Prisma.PurchaseReceiptCreateWithoutSupplierInput[] | Prisma.PurchaseReceiptUncheckedCreateWithoutSupplierInput[] connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutSupplierInput | Prisma.PurchaseReceiptCreateOrConnectWithoutSupplierInput[] @@ -604,45 +636,17 @@ export type PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput = { deleteMany?: Prisma.PurchaseReceiptScalarWhereInput | Prisma.PurchaseReceiptScalarWhereInput[] } -export type PurchaseReceiptCreateNestedOneWithoutItemsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutItemsInput - connect?: Prisma.PurchaseReceiptWhereUniqueInput -} - -export type PurchaseReceiptUpdateOneRequiredWithoutItemsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutItemsInput - upsert?: Prisma.PurchaseReceiptUpsertWithoutItemsInput - connect?: Prisma.PurchaseReceiptWhereUniqueInput - update?: Prisma.XOR, Prisma.PurchaseReceiptUncheckedUpdateWithoutItemsInput> -} - -export type PurchaseReceiptCreateNestedOneWithoutPurchaseReceiptPaymentsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutPurchaseReceiptPaymentsInput - connect?: Prisma.PurchaseReceiptWhereUniqueInput -} - -export type PurchaseReceiptUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutPurchaseReceiptPaymentsInput - upsert?: Prisma.PurchaseReceiptUpsertWithoutPurchaseReceiptPaymentsInput - connect?: Prisma.PurchaseReceiptWhereUniqueInput - update?: Prisma.XOR, Prisma.PurchaseReceiptUncheckedUpdateWithoutPurchaseReceiptPaymentsInput> -} - export type PurchaseReceiptCreateWithoutInventoryInput = { code: string totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean description?: string | null createdAt?: Date | string updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput - supplier: Prisma.SupplierCreateNestedOneWithoutPurchaseReceiptsInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput + supplier: Prisma.SupplierCreateNestedOneWithoutReceiptsInput + payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput } export type PurchaseReceiptUncheckedCreateWithoutInventoryInput = { @@ -650,13 +654,13 @@ export type PurchaseReceiptUncheckedCreateWithoutInventoryInput = { code: string totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean description?: string | null createdAt?: Date | string updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus supplierId: number items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput + payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput } export type PurchaseReceiptCreateOrConnectWithoutInventoryInput = { @@ -693,25 +697,165 @@ export type PurchaseReceiptScalarWhereInput = { code?: Prisma.StringFilter<"PurchaseReceipt"> | string totalAmount?: Prisma.DecimalFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFilter<"PurchaseReceipt"> | boolean description?: Prisma.StringNullableFilter<"PurchaseReceipt"> | string | null createdAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string updatedAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFilter<"PurchaseReceipt"> | $Enums.PurchaseReceiptStatus supplierId?: Prisma.IntFilter<"PurchaseReceipt"> | number inventoryId?: Prisma.IntFilter<"PurchaseReceipt"> | number } +export type PurchaseReceiptCreateWithoutItemsInput = { + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus + inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput + supplier: Prisma.SupplierCreateNestedOneWithoutReceiptsInput + payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput +} + +export type PurchaseReceiptUncheckedCreateWithoutItemsInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus + supplierId: number + inventoryId: number + payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput +} + +export type PurchaseReceiptCreateOrConnectWithoutItemsInput = { + where: Prisma.PurchaseReceiptWhereUniqueInput + create: Prisma.XOR +} + +export type PurchaseReceiptUpsertWithoutItemsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.PurchaseReceiptWhereInput +} + +export type PurchaseReceiptUpdateToOneWithWhereWithoutItemsInput = { + where?: Prisma.PurchaseReceiptWhereInput + data: Prisma.XOR +} + +export type PurchaseReceiptUpdateWithoutItemsInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus + inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutReceiptsNestedInput + payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput +} + +export type PurchaseReceiptUncheckedUpdateWithoutItemsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus + supplierId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput +} + +export type PurchaseReceiptCreateWithoutPaymentsInput = { + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus + items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput + inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput + supplier: Prisma.SupplierCreateNestedOneWithoutReceiptsInput +} + +export type PurchaseReceiptUncheckedCreateWithoutPaymentsInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus + supplierId: number + inventoryId: number + items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput +} + +export type PurchaseReceiptCreateOrConnectWithoutPaymentsInput = { + where: Prisma.PurchaseReceiptWhereUniqueInput + create: Prisma.XOR +} + +export type PurchaseReceiptUpsertWithoutPaymentsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.PurchaseReceiptWhereInput +} + +export type PurchaseReceiptUpdateToOneWithWhereWithoutPaymentsInput = { + where?: Prisma.PurchaseReceiptWhereInput + data: Prisma.XOR +} + +export type PurchaseReceiptUpdateWithoutPaymentsInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus + items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput + inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutReceiptsNestedInput +} + +export type PurchaseReceiptUncheckedUpdateWithoutPaymentsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus + supplierId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput +} + export type PurchaseReceiptCreateWithoutSupplierInput = { code: string totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean description?: string | null createdAt?: Date | string updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput + payments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput } export type PurchaseReceiptUncheckedCreateWithoutSupplierInput = { @@ -719,13 +863,13 @@ export type PurchaseReceiptUncheckedCreateWithoutSupplierInput = { code: string totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean description?: string | null createdAt?: Date | string updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus inventoryId: number items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput + payments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput } export type PurchaseReceiptCreateOrConnectWithoutSupplierInput = { @@ -754,155 +898,15 @@ export type PurchaseReceiptUpdateManyWithWhereWithoutSupplierInput = { data: Prisma.XOR } -export type PurchaseReceiptCreateWithoutItemsInput = { - code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string - paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean - description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput - supplier: Prisma.SupplierCreateNestedOneWithoutPurchaseReceiptsInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutPurchaseReceiptInput -} - -export type PurchaseReceiptUncheckedCreateWithoutItemsInput = { - id?: number - code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string - paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean - description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - supplierId: number - inventoryId: number - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutPurchaseReceiptInput -} - -export type PurchaseReceiptCreateOrConnectWithoutItemsInput = { - where: Prisma.PurchaseReceiptWhereUniqueInput - create: Prisma.XOR -} - -export type PurchaseReceiptUpsertWithoutItemsInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.PurchaseReceiptWhereInput -} - -export type PurchaseReceiptUpdateToOneWithWhereWithoutItemsInput = { - where?: Prisma.PurchaseReceiptWhereInput - data: Prisma.XOR -} - -export type PurchaseReceiptUpdateWithoutItemsInput = { - code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean - description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput - supplier?: Prisma.SupplierUpdateOneRequiredWithoutPurchaseReceiptsNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput -} - -export type PurchaseReceiptUncheckedUpdateWithoutItemsInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean - description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - supplierId?: Prisma.IntFieldUpdateOperationsInput | number - inventoryId?: Prisma.IntFieldUpdateOperationsInput | number - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput -} - -export type PurchaseReceiptCreateWithoutPurchaseReceiptPaymentsInput = { - code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string - paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean - description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput - inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput - supplier: Prisma.SupplierCreateNestedOneWithoutPurchaseReceiptsInput -} - -export type PurchaseReceiptUncheckedCreateWithoutPurchaseReceiptPaymentsInput = { - id?: number - code: string - totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string - paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean - description?: string | null - createdAt?: Date | string - updatedAt?: Date | string - supplierId: number - inventoryId: number - items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput -} - -export type PurchaseReceiptCreateOrConnectWithoutPurchaseReceiptPaymentsInput = { - where: Prisma.PurchaseReceiptWhereUniqueInput - create: Prisma.XOR -} - -export type PurchaseReceiptUpsertWithoutPurchaseReceiptPaymentsInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.PurchaseReceiptWhereInput -} - -export type PurchaseReceiptUpdateToOneWithWhereWithoutPurchaseReceiptPaymentsInput = { - where?: Prisma.PurchaseReceiptWhereInput - data: Prisma.XOR -} - -export type PurchaseReceiptUpdateWithoutPurchaseReceiptPaymentsInput = { - code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean - description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput - inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput - supplier?: Prisma.SupplierUpdateOneRequiredWithoutPurchaseReceiptsNestedInput -} - -export type PurchaseReceiptUncheckedUpdateWithoutPurchaseReceiptPaymentsInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - code?: Prisma.StringFieldUpdateOperationsInput | string - totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean - description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - supplierId?: Prisma.IntFieldUpdateOperationsInput | number - inventoryId?: Prisma.IntFieldUpdateOperationsInput | number - items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput -} - export type PurchaseReceiptCreateManyInventoryInput = { id?: number code: string totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean description?: string | null createdAt?: Date | string updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus supplierId: number } @@ -910,13 +914,13 @@ export type PurchaseReceiptUpdateWithoutInventoryInput = { code?: Prisma.StringFieldUpdateOperationsInput | string totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput - supplier?: Prisma.SupplierUpdateOneRequiredWithoutPurchaseReceiptsNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutReceiptsNestedInput + payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput } export type PurchaseReceiptUncheckedUpdateWithoutInventoryInput = { @@ -924,13 +928,13 @@ export type PurchaseReceiptUncheckedUpdateWithoutInventoryInput = { code?: Prisma.StringFieldUpdateOperationsInput | string totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus supplierId?: Prisma.IntFieldUpdateOperationsInput | number items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput + payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput } export type PurchaseReceiptUncheckedUpdateManyWithoutInventoryInput = { @@ -938,10 +942,10 @@ export type PurchaseReceiptUncheckedUpdateManyWithoutInventoryInput = { code?: Prisma.StringFieldUpdateOperationsInput | string totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus supplierId?: Prisma.IntFieldUpdateOperationsInput | number } @@ -950,10 +954,10 @@ export type PurchaseReceiptCreateManySupplierInput = { code: string totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: boolean description?: string | null createdAt?: Date | string updatedAt?: Date | string + status?: $Enums.PurchaseReceiptStatus inventoryId: number } @@ -961,13 +965,13 @@ export type PurchaseReceiptUpdateWithoutSupplierInput = { code?: Prisma.StringFieldUpdateOperationsInput | string totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput + payments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutPurchaseReceiptNestedInput } export type PurchaseReceiptUncheckedUpdateWithoutSupplierInput = { @@ -975,13 +979,13 @@ export type PurchaseReceiptUncheckedUpdateWithoutSupplierInput = { code?: Prisma.StringFieldUpdateOperationsInput | string totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus inventoryId?: Prisma.IntFieldUpdateOperationsInput | number items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput - purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput + payments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNestedInput } export type PurchaseReceiptUncheckedUpdateManyWithoutSupplierInput = { @@ -989,10 +993,10 @@ export type PurchaseReceiptUncheckedUpdateManyWithoutSupplierInput = { code?: Prisma.StringFieldUpdateOperationsInput | string totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string paidAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + status?: Prisma.EnumPurchaseReceiptStatusFieldUpdateOperationsInput | $Enums.PurchaseReceiptStatus inventoryId?: Prisma.IntFieldUpdateOperationsInput | number } @@ -1003,12 +1007,12 @@ export type PurchaseReceiptUncheckedUpdateManyWithoutSupplierInput = { export type PurchaseReceiptCountOutputType = { items: number - purchaseReceiptPayments: number + payments: number } export type PurchaseReceiptCountOutputTypeSelect = { items?: boolean | PurchaseReceiptCountOutputTypeCountItemsArgs - purchaseReceiptPayments?: boolean | PurchaseReceiptCountOutputTypeCountPurchaseReceiptPaymentsArgs + payments?: boolean | PurchaseReceiptCountOutputTypeCountPaymentsArgs } /** @@ -1031,7 +1035,7 @@ export type PurchaseReceiptCountOutputTypeCountItemsArgs = { +export type PurchaseReceiptCountOutputTypeCountPaymentsArgs = { where?: Prisma.PurchaseReceiptPaymentsWhereInput } @@ -1041,16 +1045,16 @@ export type PurchaseReceiptSelect inventory?: boolean | Prisma.InventoryDefaultArgs supplier?: boolean | Prisma.SupplierDefaultArgs - purchaseReceiptPayments?: boolean | Prisma.PurchaseReceipt$purchaseReceiptPaymentsArgs + payments?: boolean | Prisma.PurchaseReceipt$paymentsArgs _count?: boolean | Prisma.PurchaseReceiptCountOutputTypeDefaultArgs }, ExtArgs["result"]["purchaseReceipt"]> @@ -1061,20 +1065,20 @@ export type PurchaseReceiptSelectScalar = { code?: boolean totalAmount?: boolean paidAmount?: boolean - isSettled?: boolean description?: boolean createdAt?: boolean updatedAt?: boolean + status?: boolean supplierId?: boolean inventoryId?: boolean } -export type PurchaseReceiptOmit = runtime.Types.Extensions.GetOmit<"id" | "code" | "totalAmount" | "paidAmount" | "isSettled" | "description" | "createdAt" | "updatedAt" | "supplierId" | "inventoryId", ExtArgs["result"]["purchaseReceipt"]> +export type PurchaseReceiptOmit = runtime.Types.Extensions.GetOmit<"id" | "code" | "totalAmount" | "paidAmount" | "description" | "createdAt" | "updatedAt" | "status" | "supplierId" | "inventoryId", ExtArgs["result"]["purchaseReceipt"]> export type PurchaseReceiptInclude = { items?: boolean | Prisma.PurchaseReceipt$itemsArgs inventory?: boolean | Prisma.InventoryDefaultArgs supplier?: boolean | Prisma.SupplierDefaultArgs - purchaseReceiptPayments?: boolean | Prisma.PurchaseReceipt$purchaseReceiptPaymentsArgs + payments?: boolean | Prisma.PurchaseReceipt$paymentsArgs _count?: boolean | Prisma.PurchaseReceiptCountOutputTypeDefaultArgs } @@ -1084,17 +1088,17 @@ export type $PurchaseReceiptPayload[] inventory: Prisma.$InventoryPayload supplier: Prisma.$SupplierPayload - purchaseReceiptPayments: Prisma.$PurchaseReceiptPaymentsPayload[] + payments: Prisma.$PurchaseReceiptPaymentsPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: number code: string totalAmount: runtime.Decimal paidAmount: runtime.Decimal - isSettled: boolean description: string | null createdAt: Date updatedAt: Date + status: $Enums.PurchaseReceiptStatus supplierId: number inventoryId: number }, ExtArgs["result"]["purchaseReceipt"]> @@ -1440,7 +1444,7 @@ export interface Prisma__PurchaseReceiptClient = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> inventory = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> supplier = {}>(args?: Prisma.Subset>): Prisma.Prisma__SupplierClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> - purchaseReceiptPayments = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + payments = {}>(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. @@ -1474,10 +1478,10 @@ export interface PurchaseReceiptFieldRefs { readonly code: Prisma.FieldRef<"PurchaseReceipt", 'String'> readonly totalAmount: Prisma.FieldRef<"PurchaseReceipt", 'Decimal'> readonly paidAmount: Prisma.FieldRef<"PurchaseReceipt", 'Decimal'> - readonly isSettled: Prisma.FieldRef<"PurchaseReceipt", 'Boolean'> readonly description: Prisma.FieldRef<"PurchaseReceipt", 'String'> readonly createdAt: Prisma.FieldRef<"PurchaseReceipt", 'DateTime'> readonly updatedAt: Prisma.FieldRef<"PurchaseReceipt", 'DateTime'> + readonly status: Prisma.FieldRef<"PurchaseReceipt", 'PurchaseReceiptStatus'> readonly supplierId: Prisma.FieldRef<"PurchaseReceipt", 'Int'> readonly inventoryId: Prisma.FieldRef<"PurchaseReceipt", 'Int'> } @@ -1847,9 +1851,9 @@ export type PurchaseReceipt$itemsArgs = { +export type PurchaseReceipt$paymentsArgs = { /** * Select specific fields to fetch from the PurchaseReceiptPayments */ diff --git a/src/generated/prisma/models/PurchaseReceiptPayments.ts b/src/generated/prisma/models/PurchaseReceiptPayments.ts index fdf6481..157fed7 100644 --- a/src/generated/prisma/models/PurchaseReceiptPayments.ts +++ b/src/generated/prisma/models/PurchaseReceiptPayments.ts @@ -30,6 +30,7 @@ export type PurchaseReceiptPaymentsAvgAggregateOutputType = { id: number | null amount: runtime.Decimal | null bankAccountId: number | null + inventoryId: number | null receiptId: number | null } @@ -37,14 +38,17 @@ export type PurchaseReceiptPaymentsSumAggregateOutputType = { id: number | null amount: runtime.Decimal | null bankAccountId: number | null + inventoryId: number | null receiptId: number | null } export type PurchaseReceiptPaymentsMinAggregateOutputType = { id: number | null amount: runtime.Decimal | null - paymentMethod: $Enums.payment_method_type | null + paymentMethod: $Enums.PaymentMethodType | null + type: $Enums.PaymentType | null bankAccountId: number | null + inventoryId: number | null description: string | null payedAt: Date | null receiptId: number | null @@ -54,8 +58,10 @@ export type PurchaseReceiptPaymentsMinAggregateOutputType = { export type PurchaseReceiptPaymentsMaxAggregateOutputType = { id: number | null amount: runtime.Decimal | null - paymentMethod: $Enums.payment_method_type | null + paymentMethod: $Enums.PaymentMethodType | null + type: $Enums.PaymentType | null bankAccountId: number | null + inventoryId: number | null description: string | null payedAt: Date | null receiptId: number | null @@ -66,7 +72,9 @@ export type PurchaseReceiptPaymentsCountAggregateOutputType = { id: number amount: number paymentMethod: number + type: number bankAccountId: number + inventoryId: number description: number payedAt: number receiptId: number @@ -79,6 +87,7 @@ export type PurchaseReceiptPaymentsAvgAggregateInputType = { id?: true amount?: true bankAccountId?: true + inventoryId?: true receiptId?: true } @@ -86,6 +95,7 @@ export type PurchaseReceiptPaymentsSumAggregateInputType = { id?: true amount?: true bankAccountId?: true + inventoryId?: true receiptId?: true } @@ -93,7 +103,9 @@ export type PurchaseReceiptPaymentsMinAggregateInputType = { id?: true amount?: true paymentMethod?: true + type?: true bankAccountId?: true + inventoryId?: true description?: true payedAt?: true receiptId?: true @@ -104,7 +116,9 @@ export type PurchaseReceiptPaymentsMaxAggregateInputType = { id?: true amount?: true paymentMethod?: true + type?: true bankAccountId?: true + inventoryId?: true description?: true payedAt?: true receiptId?: true @@ -115,7 +129,9 @@ export type PurchaseReceiptPaymentsCountAggregateInputType = { id?: true amount?: true paymentMethod?: true + type?: true bankAccountId?: true + inventoryId?: true description?: true payedAt?: true receiptId?: true @@ -212,8 +228,10 @@ export type PurchaseReceiptPaymentsGroupByArgs | number amount?: Prisma.DecimalFilter<"PurchaseReceiptPayments"> | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFilter<"PurchaseReceiptPayments"> | $Enums.payment_method_type - bankAccountId?: Prisma.IntNullableFilter<"PurchaseReceiptPayments"> | number | null + paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentType + bankAccountId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number + inventoryId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null payedAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string receiptId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string purchaseReceipt?: Prisma.XOR - bankAccount?: Prisma.XOR | null + inventoryBankAccount?: Prisma.XOR } export type PurchaseReceiptPaymentsOrderByWithRelationInput = { id?: Prisma.SortOrder amount?: Prisma.SortOrder paymentMethod?: Prisma.SortOrder - bankAccountId?: Prisma.SortOrderInput | Prisma.SortOrder + type?: Prisma.SortOrder + bankAccountId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder payedAt?: Prisma.SortOrder receiptId?: Prisma.SortOrder createdAt?: Prisma.SortOrder purchaseReceipt?: Prisma.PurchaseReceiptOrderByWithRelationInput - bankAccount?: Prisma.BankAccountOrderByWithRelationInput + inventoryBankAccount?: Prisma.InventoryBankAccountOrderByWithRelationInput _relevance?: Prisma.PurchaseReceiptPaymentsOrderByRelevanceInput } @@ -276,21 +298,25 @@ export type PurchaseReceiptPaymentsWhereUniqueInput = Prisma.AtLeast<{ OR?: Prisma.PurchaseReceiptPaymentsWhereInput[] NOT?: Prisma.PurchaseReceiptPaymentsWhereInput | Prisma.PurchaseReceiptPaymentsWhereInput[] amount?: Prisma.DecimalFilter<"PurchaseReceiptPayments"> | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFilter<"PurchaseReceiptPayments"> | $Enums.payment_method_type - bankAccountId?: Prisma.IntNullableFilter<"PurchaseReceiptPayments"> | number | null + paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentType + bankAccountId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number + inventoryId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null payedAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string receiptId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string purchaseReceipt?: Prisma.XOR - bankAccount?: Prisma.XOR | null + inventoryBankAccount?: Prisma.XOR }, "id"> export type PurchaseReceiptPaymentsOrderByWithAggregationInput = { id?: Prisma.SortOrder amount?: Prisma.SortOrder paymentMethod?: Prisma.SortOrder - bankAccountId?: Prisma.SortOrderInput | Prisma.SortOrder + type?: Prisma.SortOrder + bankAccountId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder payedAt?: Prisma.SortOrder receiptId?: Prisma.SortOrder @@ -308,8 +334,10 @@ export type PurchaseReceiptPaymentsScalarWhereWithAggregatesInput = { NOT?: Prisma.PurchaseReceiptPaymentsScalarWhereWithAggregatesInput | Prisma.PurchaseReceiptPaymentsScalarWhereWithAggregatesInput[] id?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptPayments"> | number amount?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceiptPayments"> | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeWithAggregatesFilter<"PurchaseReceiptPayments"> | $Enums.payment_method_type - bankAccountId?: Prisma.IntNullableWithAggregatesFilter<"PurchaseReceiptPayments"> | number | null + paymentMethod?: Prisma.EnumPaymentMethodTypeWithAggregatesFilter<"PurchaseReceiptPayments"> | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeWithAggregatesFilter<"PurchaseReceiptPayments"> | $Enums.PaymentType + bankAccountId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptPayments"> | number + inventoryId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptPayments"> | number description?: Prisma.StringNullableWithAggregatesFilter<"PurchaseReceiptPayments"> | string | null payedAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceiptPayments"> | Date | string receiptId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptPayments"> | number @@ -318,19 +346,22 @@ export type PurchaseReceiptPaymentsScalarWhereWithAggregatesInput = { export type PurchaseReceiptPaymentsCreateInput = { amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.payment_method_type + paymentMethod: $Enums.PaymentMethodType + type: $Enums.PaymentType description?: string | null payedAt: Date | string createdAt?: Date | string - purchaseReceipt: Prisma.PurchaseReceiptCreateNestedOneWithoutPurchaseReceiptPaymentsInput - bankAccount?: Prisma.BankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput + purchaseReceipt: Prisma.PurchaseReceiptCreateNestedOneWithoutPaymentsInput + inventoryBankAccount: Prisma.InventoryBankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput } export type PurchaseReceiptPaymentsUncheckedCreateInput = { id?: number amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.payment_method_type - bankAccountId?: number | null + paymentMethod: $Enums.PaymentMethodType + type: $Enums.PaymentType + bankAccountId: number + inventoryId: number description?: string | null payedAt: Date | string receiptId: number @@ -339,19 +370,22 @@ export type PurchaseReceiptPaymentsUncheckedCreateInput = { export type PurchaseReceiptPaymentsUpdateInput = { amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - purchaseReceipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput - bankAccount?: Prisma.BankAccountUpdateOneWithoutPurchaseReceiptPaymentsNestedInput + purchaseReceipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutPaymentsNestedInput + inventoryBankAccount?: Prisma.InventoryBankAccountUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput } export type PurchaseReceiptPaymentsUncheckedUpdateInput = { id?: Prisma.IntFieldUpdateOperationsInput | number amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType + bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string receiptId?: Prisma.IntFieldUpdateOperationsInput | number @@ -361,8 +395,10 @@ export type PurchaseReceiptPaymentsUncheckedUpdateInput = { export type PurchaseReceiptPaymentsCreateManyInput = { id?: number amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.payment_method_type - bankAccountId?: number | null + paymentMethod: $Enums.PaymentMethodType + type: $Enums.PaymentType + bankAccountId: number + inventoryId: number description?: string | null payedAt: Date | string receiptId: number @@ -371,7 +407,8 @@ export type PurchaseReceiptPaymentsCreateManyInput = { export type PurchaseReceiptPaymentsUpdateManyMutationInput = { amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -380,8 +417,10 @@ export type PurchaseReceiptPaymentsUpdateManyMutationInput = { export type PurchaseReceiptPaymentsUncheckedUpdateManyInput = { id?: Prisma.IntFieldUpdateOperationsInput | number amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType + bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string receiptId?: Prisma.IntFieldUpdateOperationsInput | number @@ -408,7 +447,9 @@ export type PurchaseReceiptPaymentsCountOrderByAggregateInput = { id?: Prisma.SortOrder amount?: Prisma.SortOrder paymentMethod?: Prisma.SortOrder + type?: Prisma.SortOrder bankAccountId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder description?: Prisma.SortOrder payedAt?: Prisma.SortOrder receiptId?: Prisma.SortOrder @@ -419,6 +460,7 @@ export type PurchaseReceiptPaymentsAvgOrderByAggregateInput = { id?: Prisma.SortOrder amount?: Prisma.SortOrder bankAccountId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder receiptId?: Prisma.SortOrder } @@ -426,7 +468,9 @@ export type PurchaseReceiptPaymentsMaxOrderByAggregateInput = { id?: Prisma.SortOrder amount?: Prisma.SortOrder paymentMethod?: Prisma.SortOrder + type?: Prisma.SortOrder bankAccountId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder description?: Prisma.SortOrder payedAt?: Prisma.SortOrder receiptId?: Prisma.SortOrder @@ -437,7 +481,9 @@ export type PurchaseReceiptPaymentsMinOrderByAggregateInput = { id?: Prisma.SortOrder amount?: Prisma.SortOrder paymentMethod?: Prisma.SortOrder + type?: Prisma.SortOrder bankAccountId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder description?: Prisma.SortOrder payedAt?: Prisma.SortOrder receiptId?: Prisma.SortOrder @@ -448,48 +494,49 @@ export type PurchaseReceiptPaymentsSumOrderByAggregateInput = { id?: Prisma.SortOrder amount?: Prisma.SortOrder bankAccountId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder receiptId?: Prisma.SortOrder } -export type PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput = { - create?: Prisma.XOR | Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput[] - createMany?: Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInputEnvelope +export type PurchaseReceiptPaymentsCreateNestedManyWithoutInventoryBankAccountInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput[] + connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput[] + createMany?: Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInputEnvelope connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[] } -export type PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput = { - create?: Prisma.XOR | Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput[] - createMany?: Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInputEnvelope +export type PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutInventoryBankAccountInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput[] + connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput[] + createMany?: Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInputEnvelope connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[] } -export type PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput = { - create?: Prisma.XOR | Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput[] - upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutBankAccountInput[] - createMany?: Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInputEnvelope +export type PurchaseReceiptPaymentsUpdateManyWithoutInventoryBankAccountNestedInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput[] + connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput[] + upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutInventoryBankAccountInput[] + createMany?: Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInputEnvelope set?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[] disconnect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[] delete?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[] connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[] - update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutBankAccountInput[] - updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutBankAccountInput[] + update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutInventoryBankAccountInput[] + updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutInventoryBankAccountInput[] deleteMany?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[] } -export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput = { - create?: Prisma.XOR | Prisma.PurchaseReceiptPaymentsCreateWithoutBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput[] - connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput[] - upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutBankAccountInput[] - createMany?: Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInputEnvelope +export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountNestedInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput[] | Prisma.PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput[] + connectOrCreate?: Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput[] + upsert?: Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutInventoryBankAccountInput[] + createMany?: Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInputEnvelope set?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[] disconnect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[] delete?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[] connect?: Prisma.PurchaseReceiptPaymentsWhereUniqueInput | Prisma.PurchaseReceiptPaymentsWhereUniqueInput[] - update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutBankAccountInput[] - updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutBankAccountInput[] + update?: Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutInventoryBankAccountInput[] + updateMany?: Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsUpdateManyWithWhereWithoutInventoryBankAccountInput[] deleteMany?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[] } @@ -535,49 +582,55 @@ export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptNest deleteMany?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[] } -export type PurchaseReceiptPaymentsCreateWithoutBankAccountInput = { +export type EnumPaymentTypeFieldUpdateOperationsInput = { + set?: $Enums.PaymentType +} + +export type PurchaseReceiptPaymentsCreateWithoutInventoryBankAccountInput = { amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.payment_method_type + paymentMethod: $Enums.PaymentMethodType + type: $Enums.PaymentType description?: string | null payedAt: Date | string createdAt?: Date | string - purchaseReceipt: Prisma.PurchaseReceiptCreateNestedOneWithoutPurchaseReceiptPaymentsInput + purchaseReceipt: Prisma.PurchaseReceiptCreateNestedOneWithoutPaymentsInput } -export type PurchaseReceiptPaymentsUncheckedCreateWithoutBankAccountInput = { +export type PurchaseReceiptPaymentsUncheckedCreateWithoutInventoryBankAccountInput = { id?: number amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.payment_method_type + paymentMethod: $Enums.PaymentMethodType + type: $Enums.PaymentType description?: string | null payedAt: Date | string receiptId: number createdAt?: Date | string } -export type PurchaseReceiptPaymentsCreateOrConnectWithoutBankAccountInput = { +export type PurchaseReceiptPaymentsCreateOrConnectWithoutInventoryBankAccountInput = { where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type PurchaseReceiptPaymentsCreateManyBankAccountInputEnvelope = { - data: Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateManyBankAccountInput[] +export type PurchaseReceiptPaymentsCreateManyInventoryBankAccountInputEnvelope = { + data: Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInput | Prisma.PurchaseReceiptPaymentsCreateManyInventoryBankAccountInput[] skipDuplicates?: boolean } -export type PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutBankAccountInput = { +export type PurchaseReceiptPaymentsUpsertWithWhereUniqueWithoutInventoryBankAccountInput = { where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR + update: Prisma.XOR + create: Prisma.XOR } -export type PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutBankAccountInput = { +export type PurchaseReceiptPaymentsUpdateWithWhereUniqueWithoutInventoryBankAccountInput = { where: Prisma.PurchaseReceiptPaymentsWhereUniqueInput - data: Prisma.XOR + data: Prisma.XOR } -export type PurchaseReceiptPaymentsUpdateManyWithWhereWithoutBankAccountInput = { +export type PurchaseReceiptPaymentsUpdateManyWithWhereWithoutInventoryBankAccountInput = { where: Prisma.PurchaseReceiptPaymentsScalarWhereInput - data: Prisma.XOR + data: Prisma.XOR } export type PurchaseReceiptPaymentsScalarWhereInput = { @@ -586,8 +639,10 @@ export type PurchaseReceiptPaymentsScalarWhereInput = { NOT?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[] id?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number amount?: Prisma.DecimalFilter<"PurchaseReceiptPayments"> | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFilter<"PurchaseReceiptPayments"> | $Enums.payment_method_type - bankAccountId?: Prisma.IntNullableFilter<"PurchaseReceiptPayments"> | number | null + paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFilter<"PurchaseReceiptPayments"> | $Enums.PaymentType + bankAccountId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number + inventoryId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number description?: Prisma.StringNullableFilter<"PurchaseReceiptPayments"> | string | null payedAt?: Prisma.DateTimeFilter<"PurchaseReceiptPayments"> | Date | string receiptId?: Prisma.IntFilter<"PurchaseReceiptPayments"> | number @@ -596,18 +651,21 @@ export type PurchaseReceiptPaymentsScalarWhereInput = { export type PurchaseReceiptPaymentsCreateWithoutPurchaseReceiptInput = { amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.payment_method_type + paymentMethod: $Enums.PaymentMethodType + type: $Enums.PaymentType description?: string | null payedAt: Date | string createdAt?: Date | string - bankAccount?: Prisma.BankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput + inventoryBankAccount: Prisma.InventoryBankAccountCreateNestedOneWithoutPurchaseReceiptPaymentsInput } export type PurchaseReceiptPaymentsUncheckedCreateWithoutPurchaseReceiptInput = { id?: number amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.payment_method_type - bankAccountId?: number | null + paymentMethod: $Enums.PaymentMethodType + type: $Enums.PaymentType + bankAccountId: number + inventoryId: number description?: string | null payedAt: Date | string createdAt?: Date | string @@ -639,39 +697,43 @@ export type PurchaseReceiptPaymentsUpdateManyWithWhereWithoutPurchaseReceiptInpu data: Prisma.XOR } -export type PurchaseReceiptPaymentsCreateManyBankAccountInput = { +export type PurchaseReceiptPaymentsCreateManyInventoryBankAccountInput = { id?: number amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.payment_method_type + paymentMethod: $Enums.PaymentMethodType + type: $Enums.PaymentType description?: string | null payedAt: Date | string receiptId: number createdAt?: Date | string } -export type PurchaseReceiptPaymentsUpdateWithoutBankAccountInput = { +export type PurchaseReceiptPaymentsUpdateWithoutInventoryBankAccountInput = { amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - purchaseReceipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput + purchaseReceipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutPaymentsNestedInput } -export type PurchaseReceiptPaymentsUncheckedUpdateWithoutBankAccountInput = { +export type PurchaseReceiptPaymentsUncheckedUpdateWithoutInventoryBankAccountInput = { id?: Prisma.IntFieldUpdateOperationsInput | number amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string receiptId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } -export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountInput = { +export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutInventoryBankAccountInput = { id?: Prisma.IntFieldUpdateOperationsInput | number amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string receiptId?: Prisma.IntFieldUpdateOperationsInput | number @@ -681,8 +743,10 @@ export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountInput = export type PurchaseReceiptPaymentsCreateManyPurchaseReceiptInput = { id?: number amount: runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod: $Enums.payment_method_type - bankAccountId?: number | null + paymentMethod: $Enums.PaymentMethodType + type: $Enums.PaymentType + bankAccountId: number + inventoryId: number description?: string | null payedAt: Date | string createdAt?: Date | string @@ -690,18 +754,21 @@ export type PurchaseReceiptPaymentsCreateManyPurchaseReceiptInput = { export type PurchaseReceiptPaymentsUpdateWithoutPurchaseReceiptInput = { amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - bankAccount?: Prisma.BankAccountUpdateOneWithoutPurchaseReceiptPaymentsNestedInput + inventoryBankAccount?: Prisma.InventoryBankAccountUpdateOneRequiredWithoutPurchaseReceiptPaymentsNestedInput } export type PurchaseReceiptPaymentsUncheckedUpdateWithoutPurchaseReceiptInput = { id?: Prisma.IntFieldUpdateOperationsInput | number amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType + bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -710,8 +777,10 @@ export type PurchaseReceiptPaymentsUncheckedUpdateWithoutPurchaseReceiptInput = export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutPurchaseReceiptInput = { id?: Prisma.IntFieldUpdateOperationsInput | number amount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - paymentMethod?: Prisma.Enumpayment_method_typeFieldUpdateOperationsInput | $Enums.payment_method_type - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType + type?: Prisma.EnumPaymentTypeFieldUpdateOperationsInput | $Enums.PaymentType + bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null payedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -723,13 +792,15 @@ export type PurchaseReceiptPaymentsSelect - bankAccount?: boolean | Prisma.PurchaseReceiptPayments$bankAccountArgs + inventoryBankAccount?: boolean | Prisma.InventoryBankAccountDefaultArgs }, ExtArgs["result"]["purchaseReceiptPayments"]> @@ -738,30 +809,34 @@ export type PurchaseReceiptPaymentsSelectScalar = { id?: boolean amount?: boolean paymentMethod?: boolean + type?: boolean bankAccountId?: boolean + inventoryId?: boolean description?: boolean payedAt?: boolean receiptId?: boolean createdAt?: boolean } -export type PurchaseReceiptPaymentsOmit = runtime.Types.Extensions.GetOmit<"id" | "amount" | "paymentMethod" | "bankAccountId" | "description" | "payedAt" | "receiptId" | "createdAt", ExtArgs["result"]["purchaseReceiptPayments"]> +export type PurchaseReceiptPaymentsOmit = runtime.Types.Extensions.GetOmit<"id" | "amount" | "paymentMethod" | "type" | "bankAccountId" | "inventoryId" | "description" | "payedAt" | "receiptId" | "createdAt", ExtArgs["result"]["purchaseReceiptPayments"]> export type PurchaseReceiptPaymentsInclude = { purchaseReceipt?: boolean | Prisma.PurchaseReceiptDefaultArgs - bankAccount?: boolean | Prisma.PurchaseReceiptPayments$bankAccountArgs + inventoryBankAccount?: boolean | Prisma.InventoryBankAccountDefaultArgs } export type $PurchaseReceiptPaymentsPayload = { name: "PurchaseReceiptPayments" objects: { purchaseReceipt: Prisma.$PurchaseReceiptPayload - bankAccount: Prisma.$BankAccountPayload | null + inventoryBankAccount: Prisma.$InventoryBankAccountPayload } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: number amount: runtime.Decimal - paymentMethod: $Enums.payment_method_type - bankAccountId: number | null + paymentMethod: $Enums.PaymentMethodType + type: $Enums.PaymentType + bankAccountId: number + inventoryId: number description: string | null payedAt: Date receiptId: number @@ -1107,7 +1182,7 @@ readonly fields: PurchaseReceiptPaymentsFieldRefs; export interface Prisma__PurchaseReceiptPaymentsClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" purchaseReceipt = {}>(args?: Prisma.Subset>): Prisma.Prisma__PurchaseReceiptClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> - bankAccount = {}>(args?: Prisma.Subset>): Prisma.Prisma__BankAccountClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + inventoryBankAccount = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryBankAccountClient, 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. @@ -1139,8 +1214,10 @@ export interface Prisma__PurchaseReceiptPaymentsClient readonly amount: Prisma.FieldRef<"PurchaseReceiptPayments", 'Decimal'> - readonly paymentMethod: Prisma.FieldRef<"PurchaseReceiptPayments", 'payment_method_type'> + readonly paymentMethod: Prisma.FieldRef<"PurchaseReceiptPayments", 'PaymentMethodType'> + readonly type: Prisma.FieldRef<"PurchaseReceiptPayments", 'PaymentType'> readonly bankAccountId: Prisma.FieldRef<"PurchaseReceiptPayments", 'Int'> + readonly inventoryId: Prisma.FieldRef<"PurchaseReceiptPayments", 'Int'> readonly description: Prisma.FieldRef<"PurchaseReceiptPayments", 'String'> readonly payedAt: Prisma.FieldRef<"PurchaseReceiptPayments", 'DateTime'> readonly receiptId: Prisma.FieldRef<"PurchaseReceiptPayments", 'Int'> @@ -1487,25 +1564,6 @@ export type PurchaseReceiptPaymentsDeleteManyArgs = { - /** - * Select specific fields to fetch from the BankAccount - */ - select?: Prisma.BankAccountSelect | null - /** - * Omit specific fields from the BankAccount - */ - omit?: Prisma.BankAccountOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.BankAccountInclude | null - where?: Prisma.BankAccountWhereInput -} - /** * PurchaseReceiptPayments without action */ diff --git a/src/generated/prisma/models/StockMovement.ts b/src/generated/prisma/models/StockMovement.ts index 2e7eb80..44d1751 100644 --- a/src/generated/prisma/models/StockMovement.ts +++ b/src/generated/prisma/models/StockMovement.ts @@ -737,48 +737,6 @@ export type StockMovementUncheckedUpdateManyWithoutInventoryNestedInput = { deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] } -export type StockMovementCreateNestedManyWithoutSupplierInput = { - create?: Prisma.XOR | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[] - connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[] - createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope - connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] -} - -export type StockMovementUncheckedCreateNestedManyWithoutSupplierInput = { - create?: Prisma.XOR | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[] - connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[] - createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope - connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] -} - -export type StockMovementUpdateManyWithoutSupplierNestedInput = { - create?: Prisma.XOR | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[] - connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[] - upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput[] - createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope - set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] - disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] - delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] - connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] - update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput[] - updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput | Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput[] - deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] -} - -export type StockMovementUncheckedUpdateManyWithoutSupplierNestedInput = { - create?: Prisma.XOR | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[] - connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[] - upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput[] - createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope - set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] - disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] - delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] - connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] - update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput[] - updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput | Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput[] - deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] -} - export type StockMovementCreateNestedManyWithoutCustomerInput = { create?: Prisma.XOR | Prisma.StockMovementCreateWithoutCustomerInput[] | Prisma.StockMovementUncheckedCreateWithoutCustomerInput[] connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutCustomerInput | Prisma.StockMovementCreateOrConnectWithoutCustomerInput[] @@ -871,6 +829,48 @@ export type EnumMovementReferenceTypeFieldUpdateOperationsInput = { set?: $Enums.MovementReferenceType } +export type StockMovementCreateNestedManyWithoutSupplierInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[] + createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] +} + +export type StockMovementUncheckedCreateNestedManyWithoutSupplierInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[] + createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] +} + +export type StockMovementUpdateManyWithoutSupplierNestedInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[] + upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput[] + createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope + set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput[] + updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput | Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput[] + deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] +} + +export type StockMovementUncheckedUpdateManyWithoutSupplierNestedInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[] + upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput[] + createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope + set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput[] + updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput | Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput[] + deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] +} + export type StockMovementCreateWithoutCounterInventoryInput = { type: $Enums.MovementType quantity: runtime.Decimal | runtime.DecimalJsLike | number | string @@ -1010,65 +1010,6 @@ export type StockMovementUpdateManyWithWhereWithoutInventoryInput = { data: Prisma.XOR } -export type StockMovementCreateWithoutSupplierInput = { - type: $Enums.MovementType - quantity: runtime.Decimal | runtime.DecimalJsLike | number | string - fee: runtime.Decimal | runtime.DecimalJsLike | number | string - totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string - referenceType: $Enums.MovementReferenceType - referenceId: string - createdAt?: Date | string - avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string - remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string - counterInventory?: Prisma.InventoryCreateNestedOneWithoutCounterStockMovementsInput - customer?: Prisma.CustomerCreateNestedOneWithoutStockMovementsInput - inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput - product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput -} - -export type StockMovementUncheckedCreateWithoutSupplierInput = { - id?: number - type: $Enums.MovementType - quantity: runtime.Decimal | runtime.DecimalJsLike | number | string - fee: runtime.Decimal | runtime.DecimalJsLike | number | string - totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string - referenceType: $Enums.MovementReferenceType - referenceId: string - createdAt?: Date | string - productId: number - inventoryId: number - avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string - remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string - counterInventoryId?: number | null - customerId?: number | null -} - -export type StockMovementCreateOrConnectWithoutSupplierInput = { - where: Prisma.StockMovementWhereUniqueInput - create: Prisma.XOR -} - -export type StockMovementCreateManySupplierInputEnvelope = { - data: Prisma.StockMovementCreateManySupplierInput | Prisma.StockMovementCreateManySupplierInput[] - skipDuplicates?: boolean -} - -export type StockMovementUpsertWithWhereUniqueWithoutSupplierInput = { - where: Prisma.StockMovementWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR -} - -export type StockMovementUpdateWithWhereUniqueWithoutSupplierInput = { - where: Prisma.StockMovementWhereUniqueInput - data: Prisma.XOR -} - -export type StockMovementUpdateManyWithWhereWithoutSupplierInput = { - where: Prisma.StockMovementScalarWhereInput - data: Prisma.XOR -} - export type StockMovementCreateWithoutCustomerInput = { type: $Enums.MovementType quantity: runtime.Decimal | runtime.DecimalJsLike | number | string @@ -1187,6 +1128,65 @@ export type StockMovementUpdateManyWithWhereWithoutProductInput = { data: Prisma.XOR } +export type StockMovementCreateWithoutSupplierInput = { + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string + remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string + counterInventory?: Prisma.InventoryCreateNestedOneWithoutCounterStockMovementsInput + customer?: Prisma.CustomerCreateNestedOneWithoutStockMovementsInput + inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput + product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput +} + +export type StockMovementUncheckedCreateWithoutSupplierInput = { + id?: number + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + productId: number + inventoryId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string + remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string + counterInventoryId?: number | null + customerId?: number | null +} + +export type StockMovementCreateOrConnectWithoutSupplierInput = { + where: Prisma.StockMovementWhereUniqueInput + create: Prisma.XOR +} + +export type StockMovementCreateManySupplierInputEnvelope = { + data: Prisma.StockMovementCreateManySupplierInput | Prisma.StockMovementCreateManySupplierInput[] + skipDuplicates?: boolean +} + +export type StockMovementUpsertWithWhereUniqueWithoutSupplierInput = { + where: Prisma.StockMovementWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type StockMovementUpdateWithWhereUniqueWithoutSupplierInput = { + where: Prisma.StockMovementWhereUniqueInput + data: Prisma.XOR +} + +export type StockMovementUpdateManyWithWhereWithoutSupplierInput = { + where: Prisma.StockMovementScalarWhereInput + data: Prisma.XOR +} + export type StockMovementCreateManyCounterInventoryInput = { id?: number type: $Enums.MovementType @@ -1321,73 +1321,6 @@ export type StockMovementUncheckedUpdateManyWithoutInventoryInput = { customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null } -export type StockMovementCreateManySupplierInput = { - id?: number - type: $Enums.MovementType - quantity: runtime.Decimal | runtime.DecimalJsLike | number | string - fee: runtime.Decimal | runtime.DecimalJsLike | number | string - totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string - referenceType: $Enums.MovementReferenceType - referenceId: string - createdAt?: Date | string - productId: number - inventoryId: number - avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string - remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string - counterInventoryId?: number | null - customerId?: number | null -} - -export type StockMovementUpdateWithoutSupplierInput = { - type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType - quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType - referenceId?: Prisma.StringFieldUpdateOperationsInput | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - counterInventory?: Prisma.InventoryUpdateOneWithoutCounterStockMovementsNestedInput - customer?: Prisma.CustomerUpdateOneWithoutStockMovementsNestedInput - inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput - product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput -} - -export type StockMovementUncheckedUpdateWithoutSupplierInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType - quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType - referenceId?: Prisma.StringFieldUpdateOperationsInput | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - productId?: Prisma.IntFieldUpdateOperationsInput | number - inventoryId?: Prisma.IntFieldUpdateOperationsInput | number - avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null -} - -export type StockMovementUncheckedUpdateManyWithoutSupplierInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType - quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType - referenceId?: Prisma.StringFieldUpdateOperationsInput | string - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - productId?: Prisma.IntFieldUpdateOperationsInput | number - inventoryId?: Prisma.IntFieldUpdateOperationsInput | number - avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null -} - export type StockMovementCreateManyCustomerInput = { id?: number type: $Enums.MovementType @@ -1522,6 +1455,73 @@ export type StockMovementUncheckedUpdateManyWithoutProductInput = { customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null } +export type StockMovementCreateManySupplierInput = { + id?: number + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + productId: number + inventoryId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string + remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string + counterInventoryId?: number | null + customerId?: number | null +} + +export type StockMovementUpdateWithoutSupplierInput = { + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + counterInventory?: Prisma.InventoryUpdateOneWithoutCounterStockMovementsNestedInput + customer?: Prisma.CustomerUpdateOneWithoutStockMovementsNestedInput + inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput + product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput +} + +export type StockMovementUncheckedUpdateWithoutSupplierInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null +} + +export type StockMovementUncheckedUpdateManyWithoutSupplierInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null +} + export type StockMovementSelect = runtime.Types.Extensions.GetSelect<{ diff --git a/src/generated/prisma/models/Supplier.ts b/src/generated/prisma/models/Supplier.ts index de1bc5e..329b757 100644 --- a/src/generated/prisma/models/Supplier.ts +++ b/src/generated/prisma/models/Supplier.ts @@ -280,9 +280,9 @@ export type SupplierWhereInput = { createdAt?: Prisma.DateTimeFilter<"Supplier"> | Date | string updatedAt?: Prisma.DateTimeFilter<"Supplier"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter stockMovements?: Prisma.StockMovementListRelationFilter - supplierLedgers?: Prisma.SupplierLedgerListRelationFilter + receipts?: Prisma.PurchaseReceiptListRelationFilter + ledger?: Prisma.SupplierLedgerListRelationFilter } export type SupplierOrderByWithRelationInput = { @@ -299,9 +299,9 @@ export type SupplierOrderByWithRelationInput = { createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder - purchaseReceipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput - supplierLedgers?: Prisma.SupplierLedgerOrderByRelationAggregateInput + receipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput + ledger?: Prisma.SupplierLedgerOrderByRelationAggregateInput _relevance?: Prisma.SupplierOrderByRelevanceInput } @@ -322,9 +322,9 @@ export type SupplierWhereUniqueInput = Prisma.AtLeast<{ createdAt?: Prisma.DateTimeFilter<"Supplier"> | Date | string updatedAt?: Prisma.DateTimeFilter<"Supplier"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter stockMovements?: Prisma.StockMovementListRelationFilter - supplierLedgers?: Prisma.SupplierLedgerListRelationFilter + receipts?: Prisma.PurchaseReceiptListRelationFilter + ledger?: Prisma.SupplierLedgerListRelationFilter }, "id" | "mobileNumber"> export type SupplierOrderByWithAggregationInput = { @@ -380,9 +380,9 @@ export type SupplierCreateInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutSupplierInput - supplierLedgers?: Prisma.SupplierLedgerCreateNestedManyWithoutSupplierInput + receipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput + ledger?: Prisma.SupplierLedgerCreateNestedManyWithoutSupplierInput } export type SupplierUncheckedCreateInput = { @@ -399,9 +399,9 @@ export type SupplierUncheckedCreateInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutSupplierInput - supplierLedgers?: Prisma.SupplierLedgerUncheckedCreateNestedManyWithoutSupplierInput + receipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput + ledger?: Prisma.SupplierLedgerUncheckedCreateNestedManyWithoutSupplierInput } export type SupplierUpdateInput = { @@ -417,9 +417,9 @@ export type SupplierUpdateInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutSupplierNestedInput - supplierLedgers?: Prisma.SupplierLedgerUpdateManyWithoutSupplierNestedInput + receipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput + ledger?: Prisma.SupplierLedgerUpdateManyWithoutSupplierNestedInput } export type SupplierUncheckedUpdateInput = { @@ -436,9 +436,9 @@ export type SupplierUncheckedUpdateInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutSupplierNestedInput - supplierLedgers?: Prisma.SupplierLedgerUncheckedUpdateManyWithoutSupplierNestedInput + receipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput + ledger?: Prisma.SupplierLedgerUncheckedUpdateManyWithoutSupplierNestedInput } export type SupplierCreateManyInput = { @@ -488,6 +488,16 @@ export type SupplierUncheckedUpdateManyInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } +export type SupplierScalarRelationFilter = { + is?: Prisma.SupplierWhereInput + isNot?: Prisma.SupplierWhereInput +} + +export type SupplierNullableScalarRelationFilter = { + is?: Prisma.SupplierWhereInput | null + isNot?: Prisma.SupplierWhereInput | null +} + export type SupplierOrderByRelevanceInput = { fields: Prisma.SupplierOrderByRelevanceFieldEnum | Prisma.SupplierOrderByRelevanceFieldEnum[] sort: Prisma.SortOrder @@ -550,42 +560,18 @@ export type SupplierSumOrderByAggregateInput = { id?: Prisma.SortOrder } -export type SupplierScalarRelationFilter = { - is?: Prisma.SupplierWhereInput - isNot?: Prisma.SupplierWhereInput -} - -export type SupplierNullableScalarRelationFilter = { - is?: Prisma.SupplierWhereInput | null - isNot?: Prisma.SupplierWhereInput | null -} - -export type SupplierCreateNestedOneWithoutSupplierLedgersInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutSupplierLedgersInput +export type SupplierCreateNestedOneWithoutReceiptsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutReceiptsInput connect?: Prisma.SupplierWhereUniqueInput } -export type SupplierUpdateOneRequiredWithoutSupplierLedgersNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutSupplierLedgersInput - upsert?: Prisma.SupplierUpsertWithoutSupplierLedgersInput +export type SupplierUpdateOneRequiredWithoutReceiptsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutReceiptsInput + upsert?: Prisma.SupplierUpsertWithoutReceiptsInput connect?: Prisma.SupplierWhereUniqueInput - update?: Prisma.XOR, Prisma.SupplierUncheckedUpdateWithoutSupplierLedgersInput> -} - -export type SupplierCreateNestedOneWithoutPurchaseReceiptsInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutPurchaseReceiptsInput - connect?: Prisma.SupplierWhereUniqueInput -} - -export type SupplierUpdateOneRequiredWithoutPurchaseReceiptsNestedInput = { - create?: Prisma.XOR - connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutPurchaseReceiptsInput - upsert?: Prisma.SupplierUpsertWithoutPurchaseReceiptsInput - connect?: Prisma.SupplierWhereUniqueInput - update?: Prisma.XOR, Prisma.SupplierUncheckedUpdateWithoutPurchaseReceiptsInput> + update?: Prisma.XOR, Prisma.SupplierUncheckedUpdateWithoutReceiptsInput> } export type SupplierCreateNestedOneWithoutStockMovementsInput = { @@ -604,93 +590,21 @@ export type SupplierUpdateOneWithoutStockMovementsNestedInput = { update?: Prisma.XOR, Prisma.SupplierUncheckedUpdateWithoutStockMovementsInput> } -export type SupplierCreateWithoutSupplierLedgersInput = { - firstName: string - lastName: string - email?: string | null - mobileNumber: string - address?: string | null - city?: string | null - state?: string | null - country?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput - stockMovements?: Prisma.StockMovementCreateNestedManyWithoutSupplierInput +export type SupplierCreateNestedOneWithoutLedgerInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutLedgerInput + connect?: Prisma.SupplierWhereUniqueInput } -export type SupplierUncheckedCreateWithoutSupplierLedgersInput = { - id?: number - firstName: string - lastName: string - email?: string | null - mobileNumber: string - address?: string | null - city?: string | null - state?: string | null - country?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput - stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutSupplierInput +export type SupplierUpdateOneRequiredWithoutLedgerNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutLedgerInput + upsert?: Prisma.SupplierUpsertWithoutLedgerInput + connect?: Prisma.SupplierWhereUniqueInput + update?: Prisma.XOR, Prisma.SupplierUncheckedUpdateWithoutLedgerInput> } -export type SupplierCreateOrConnectWithoutSupplierLedgersInput = { - where: Prisma.SupplierWhereUniqueInput - create: Prisma.XOR -} - -export type SupplierUpsertWithoutSupplierLedgersInput = { - update: Prisma.XOR - create: Prisma.XOR - where?: Prisma.SupplierWhereInput -} - -export type SupplierUpdateToOneWithWhereWithoutSupplierLedgersInput = { - where?: Prisma.SupplierWhereInput - data: Prisma.XOR -} - -export type SupplierUpdateWithoutSupplierLedgersInput = { - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string - address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput - stockMovements?: Prisma.StockMovementUpdateManyWithoutSupplierNestedInput -} - -export type SupplierUncheckedUpdateWithoutSupplierLedgersInput = { - id?: Prisma.IntFieldUpdateOperationsInput | number - firstName?: Prisma.StringFieldUpdateOperationsInput | string - lastName?: Prisma.StringFieldUpdateOperationsInput | string - email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string - address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput - stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutSupplierNestedInput -} - -export type SupplierCreateWithoutPurchaseReceiptsInput = { +export type SupplierCreateWithoutReceiptsInput = { firstName: string lastName: string email?: string | null @@ -704,10 +618,10 @@ export type SupplierCreateWithoutPurchaseReceiptsInput = { updatedAt?: Date | string deletedAt?: Date | string | null stockMovements?: Prisma.StockMovementCreateNestedManyWithoutSupplierInput - supplierLedgers?: Prisma.SupplierLedgerCreateNestedManyWithoutSupplierInput + ledger?: Prisma.SupplierLedgerCreateNestedManyWithoutSupplierInput } -export type SupplierUncheckedCreateWithoutPurchaseReceiptsInput = { +export type SupplierUncheckedCreateWithoutReceiptsInput = { id?: number firstName: string lastName: string @@ -722,26 +636,26 @@ export type SupplierUncheckedCreateWithoutPurchaseReceiptsInput = { updatedAt?: Date | string deletedAt?: Date | string | null stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutSupplierInput - supplierLedgers?: Prisma.SupplierLedgerUncheckedCreateNestedManyWithoutSupplierInput + ledger?: Prisma.SupplierLedgerUncheckedCreateNestedManyWithoutSupplierInput } -export type SupplierCreateOrConnectWithoutPurchaseReceiptsInput = { +export type SupplierCreateOrConnectWithoutReceiptsInput = { where: Prisma.SupplierWhereUniqueInput - create: Prisma.XOR + create: Prisma.XOR } -export type SupplierUpsertWithoutPurchaseReceiptsInput = { - update: Prisma.XOR - create: Prisma.XOR +export type SupplierUpsertWithoutReceiptsInput = { + update: Prisma.XOR + create: Prisma.XOR where?: Prisma.SupplierWhereInput } -export type SupplierUpdateToOneWithWhereWithoutPurchaseReceiptsInput = { +export type SupplierUpdateToOneWithWhereWithoutReceiptsInput = { where?: Prisma.SupplierWhereInput - data: Prisma.XOR + data: Prisma.XOR } -export type SupplierUpdateWithoutPurchaseReceiptsInput = { +export type SupplierUpdateWithoutReceiptsInput = { firstName?: Prisma.StringFieldUpdateOperationsInput | string lastName?: Prisma.StringFieldUpdateOperationsInput | string email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null @@ -755,10 +669,10 @@ export type SupplierUpdateWithoutPurchaseReceiptsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null stockMovements?: Prisma.StockMovementUpdateManyWithoutSupplierNestedInput - supplierLedgers?: Prisma.SupplierLedgerUpdateManyWithoutSupplierNestedInput + ledger?: Prisma.SupplierLedgerUpdateManyWithoutSupplierNestedInput } -export type SupplierUncheckedUpdateWithoutPurchaseReceiptsInput = { +export type SupplierUncheckedUpdateWithoutReceiptsInput = { id?: Prisma.IntFieldUpdateOperationsInput | number firstName?: Prisma.StringFieldUpdateOperationsInput | string lastName?: Prisma.StringFieldUpdateOperationsInput | string @@ -773,7 +687,7 @@ export type SupplierUncheckedUpdateWithoutPurchaseReceiptsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutSupplierNestedInput - supplierLedgers?: Prisma.SupplierLedgerUncheckedUpdateManyWithoutSupplierNestedInput + ledger?: Prisma.SupplierLedgerUncheckedUpdateManyWithoutSupplierNestedInput } export type SupplierCreateWithoutStockMovementsInput = { @@ -789,8 +703,8 @@ export type SupplierCreateWithoutStockMovementsInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput - supplierLedgers?: Prisma.SupplierLedgerCreateNestedManyWithoutSupplierInput + receipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput + ledger?: Prisma.SupplierLedgerCreateNestedManyWithoutSupplierInput } export type SupplierUncheckedCreateWithoutStockMovementsInput = { @@ -807,8 +721,8 @@ export type SupplierUncheckedCreateWithoutStockMovementsInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput - supplierLedgers?: Prisma.SupplierLedgerUncheckedCreateNestedManyWithoutSupplierInput + receipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput + ledger?: Prisma.SupplierLedgerUncheckedCreateNestedManyWithoutSupplierInput } export type SupplierCreateOrConnectWithoutStockMovementsInput = { @@ -840,8 +754,8 @@ export type SupplierUpdateWithoutStockMovementsInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput - supplierLedgers?: Prisma.SupplierLedgerUpdateManyWithoutSupplierNestedInput + receipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput + ledger?: Prisma.SupplierLedgerUpdateManyWithoutSupplierNestedInput } export type SupplierUncheckedUpdateWithoutStockMovementsInput = { @@ -858,8 +772,94 @@ export type SupplierUncheckedUpdateWithoutStockMovementsInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput - supplierLedgers?: Prisma.SupplierLedgerUncheckedUpdateManyWithoutSupplierNestedInput + receipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput + ledger?: Prisma.SupplierLedgerUncheckedUpdateManyWithoutSupplierNestedInput +} + +export type SupplierCreateWithoutLedgerInput = { + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutSupplierInput + receipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput +} + +export type SupplierUncheckedCreateWithoutLedgerInput = { + id?: number + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutSupplierInput + receipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput +} + +export type SupplierCreateOrConnectWithoutLedgerInput = { + where: Prisma.SupplierWhereUniqueInput + create: Prisma.XOR +} + +export type SupplierUpsertWithoutLedgerInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.SupplierWhereInput +} + +export type SupplierUpdateToOneWithWhereWithoutLedgerInput = { + where?: Prisma.SupplierWhereInput + data: Prisma.XOR +} + +export type SupplierUpdateWithoutLedgerInput = { + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + stockMovements?: Prisma.StockMovementUpdateManyWithoutSupplierNestedInput + receipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput +} + +export type SupplierUncheckedUpdateWithoutLedgerInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutSupplierNestedInput + receipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput } @@ -868,15 +868,15 @@ export type SupplierUncheckedUpdateWithoutStockMovementsInput = { */ export type SupplierCountOutputType = { - purchaseReceipts: number stockMovements: number - supplierLedgers: number + receipts: number + ledger: number } export type SupplierCountOutputTypeSelect = { - purchaseReceipts?: boolean | SupplierCountOutputTypeCountPurchaseReceiptsArgs stockMovements?: boolean | SupplierCountOutputTypeCountStockMovementsArgs - supplierLedgers?: boolean | SupplierCountOutputTypeCountSupplierLedgersArgs + receipts?: boolean | SupplierCountOutputTypeCountReceiptsArgs + ledger?: boolean | SupplierCountOutputTypeCountLedgerArgs } /** @@ -889,13 +889,6 @@ export type SupplierCountOutputTypeDefaultArgs | null } -/** - * SupplierCountOutputType without action - */ -export type SupplierCountOutputTypeCountPurchaseReceiptsArgs = { - where?: Prisma.PurchaseReceiptWhereInput -} - /** * SupplierCountOutputType without action */ @@ -906,7 +899,14 @@ export type SupplierCountOutputTypeCountStockMovementsArgs = { +export type SupplierCountOutputTypeCountReceiptsArgs = { + where?: Prisma.PurchaseReceiptWhereInput +} + +/** + * SupplierCountOutputType without action + */ +export type SupplierCountOutputTypeCountLedgerArgs = { where?: Prisma.SupplierLedgerWhereInput } @@ -925,9 +925,9 @@ export type SupplierSelect stockMovements?: boolean | Prisma.Supplier$stockMovementsArgs - supplierLedgers?: boolean | Prisma.Supplier$supplierLedgersArgs + receipts?: boolean | Prisma.Supplier$receiptsArgs + ledger?: boolean | Prisma.Supplier$ledgerArgs _count?: boolean | Prisma.SupplierCountOutputTypeDefaultArgs }, ExtArgs["result"]["supplier"]> @@ -951,18 +951,18 @@ export type SupplierSelectScalar = { export type SupplierOmit = runtime.Types.Extensions.GetOmit<"id" | "firstName" | "lastName" | "email" | "mobileNumber" | "address" | "city" | "state" | "country" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["supplier"]> export type SupplierInclude = { - purchaseReceipts?: boolean | Prisma.Supplier$purchaseReceiptsArgs stockMovements?: boolean | Prisma.Supplier$stockMovementsArgs - supplierLedgers?: boolean | Prisma.Supplier$supplierLedgersArgs + receipts?: boolean | Prisma.Supplier$receiptsArgs + ledger?: boolean | Prisma.Supplier$ledgerArgs _count?: boolean | Prisma.SupplierCountOutputTypeDefaultArgs } export type $SupplierPayload = { name: "Supplier" objects: { - purchaseReceipts: Prisma.$PurchaseReceiptPayload[] stockMovements: Prisma.$StockMovementPayload[] - supplierLedgers: Prisma.$SupplierLedgerPayload[] + receipts: Prisma.$PurchaseReceiptPayload[] + ledger: Prisma.$SupplierLedgerPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: number @@ -1318,9 +1318,9 @@ readonly fields: SupplierFieldRefs; */ export interface Prisma__SupplierClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" - purchaseReceipts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> stockMovements = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> - supplierLedgers = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + receipts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + ledger = {}>(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. @@ -1705,30 +1705,6 @@ export type SupplierDeleteManyArgs = { - /** - * Select specific fields to fetch from the PurchaseReceipt - */ - select?: Prisma.PurchaseReceiptSelect | null - /** - * Omit specific fields from the PurchaseReceipt - */ - omit?: Prisma.PurchaseReceiptOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.PurchaseReceiptInclude | null - where?: Prisma.PurchaseReceiptWhereInput - orderBy?: Prisma.PurchaseReceiptOrderByWithRelationInput | Prisma.PurchaseReceiptOrderByWithRelationInput[] - cursor?: Prisma.PurchaseReceiptWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.PurchaseReceiptScalarFieldEnum | Prisma.PurchaseReceiptScalarFieldEnum[] -} - /** * Supplier.stockMovements */ @@ -1754,9 +1730,33 @@ export type Supplier$stockMovementsArgs = { +export type Supplier$receiptsArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + where?: Prisma.PurchaseReceiptWhereInput + orderBy?: Prisma.PurchaseReceiptOrderByWithRelationInput | Prisma.PurchaseReceiptOrderByWithRelationInput[] + cursor?: Prisma.PurchaseReceiptWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PurchaseReceiptScalarFieldEnum | Prisma.PurchaseReceiptScalarFieldEnum[] +} + +/** + * Supplier.ledger + */ +export type Supplier$ledgerArgs = { /** * Select specific fields to fetch from the SupplierLedger */ diff --git a/src/generated/prisma/models/SupplierLedger.ts b/src/generated/prisma/models/SupplierLedger.ts index f37f796..04add61 100644 --- a/src/generated/prisma/models/SupplierLedger.ts +++ b/src/generated/prisma/models/SupplierLedger.ts @@ -50,7 +50,7 @@ export type SupplierLedgerMinAggregateOutputType = { debit: runtime.Decimal | null credit: runtime.Decimal | null balance: runtime.Decimal | null - sourceType: $Enums.ledgerSourceType | null + sourceType: $Enums.LedgerSourceType | null sourceId: number | null createdAt: Date | null supplierId: number | null @@ -62,7 +62,7 @@ export type SupplierLedgerMaxAggregateOutputType = { debit: runtime.Decimal | null credit: runtime.Decimal | null balance: runtime.Decimal | null - sourceType: $Enums.ledgerSourceType | null + sourceType: $Enums.LedgerSourceType | null sourceId: number | null createdAt: Date | null supplierId: number | null @@ -229,7 +229,7 @@ export type SupplierLedgerGroupByOutputType = { debit: runtime.Decimal credit: runtime.Decimal balance: runtime.Decimal - sourceType: $Enums.ledgerSourceType + sourceType: $Enums.LedgerSourceType sourceId: number createdAt: Date supplierId: number @@ -264,7 +264,7 @@ export type SupplierLedgerWhereInput = { debit?: Prisma.DecimalFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeFilter<"SupplierLedger"> | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeFilter<"SupplierLedger"> | $Enums.LedgerSourceType sourceId?: Prisma.IntFilter<"SupplierLedger"> | number createdAt?: Prisma.DateTimeFilter<"SupplierLedger"> | Date | string supplierId?: Prisma.IntFilter<"SupplierLedger"> | number @@ -294,7 +294,7 @@ export type SupplierLedgerWhereUniqueInput = Prisma.AtLeast<{ debit?: Prisma.DecimalFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeFilter<"SupplierLedger"> | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeFilter<"SupplierLedger"> | $Enums.LedgerSourceType sourceId?: Prisma.IntFilter<"SupplierLedger"> | number createdAt?: Prisma.DateTimeFilter<"SupplierLedger"> | Date | string supplierId?: Prisma.IntFilter<"SupplierLedger"> | number @@ -327,7 +327,7 @@ export type SupplierLedgerScalarWhereWithAggregatesInput = { debit?: Prisma.DecimalWithAggregatesFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalWithAggregatesFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalWithAggregatesFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeWithAggregatesFilter<"SupplierLedger"> | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeWithAggregatesFilter<"SupplierLedger"> | $Enums.LedgerSourceType sourceId?: Prisma.IntWithAggregatesFilter<"SupplierLedger"> | number createdAt?: Prisma.DateTimeWithAggregatesFilter<"SupplierLedger"> | Date | string supplierId?: Prisma.IntWithAggregatesFilter<"SupplierLedger"> | number @@ -335,22 +335,22 @@ export type SupplierLedgerScalarWhereWithAggregatesInput = { export type SupplierLedgerCreateInput = { description?: string | null - debit: runtime.Decimal | runtime.DecimalJsLike | number | string - credit: runtime.Decimal | runtime.DecimalJsLike | number | string + debit?: runtime.Decimal | runtime.DecimalJsLike | number | string + credit?: runtime.Decimal | runtime.DecimalJsLike | number | string balance: runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType: $Enums.ledgerSourceType + sourceType: $Enums.LedgerSourceType sourceId: number createdAt?: Date | string - supplier: Prisma.SupplierCreateNestedOneWithoutSupplierLedgersInput + supplier: Prisma.SupplierCreateNestedOneWithoutLedgerInput } export type SupplierLedgerUncheckedCreateInput = { id?: number description?: string | null - debit: runtime.Decimal | runtime.DecimalJsLike | number | string - credit: runtime.Decimal | runtime.DecimalJsLike | number | string + debit?: runtime.Decimal | runtime.DecimalJsLike | number | string + credit?: runtime.Decimal | runtime.DecimalJsLike | number | string balance: runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType: $Enums.ledgerSourceType + sourceType: $Enums.LedgerSourceType sourceId: number createdAt?: Date | string supplierId: number @@ -361,10 +361,10 @@ export type SupplierLedgerUpdateInput = { debit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeFieldUpdateOperationsInput | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType sourceId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string - supplier?: Prisma.SupplierUpdateOneRequiredWithoutSupplierLedgersNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutLedgerNestedInput } export type SupplierLedgerUncheckedUpdateInput = { @@ -373,7 +373,7 @@ export type SupplierLedgerUncheckedUpdateInput = { debit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeFieldUpdateOperationsInput | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType sourceId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string supplierId?: Prisma.IntFieldUpdateOperationsInput | number @@ -382,10 +382,10 @@ export type SupplierLedgerUncheckedUpdateInput = { export type SupplierLedgerCreateManyInput = { id?: number description?: string | null - debit: runtime.Decimal | runtime.DecimalJsLike | number | string - credit: runtime.Decimal | runtime.DecimalJsLike | number | string + debit?: runtime.Decimal | runtime.DecimalJsLike | number | string + credit?: runtime.Decimal | runtime.DecimalJsLike | number | string balance: runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType: $Enums.ledgerSourceType + sourceType: $Enums.LedgerSourceType sourceId: number createdAt?: Date | string supplierId: number @@ -396,7 +396,7 @@ export type SupplierLedgerUpdateManyMutationInput = { debit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeFieldUpdateOperationsInput | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType sourceId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } @@ -407,7 +407,7 @@ export type SupplierLedgerUncheckedUpdateManyInput = { debit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeFieldUpdateOperationsInput | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType sourceId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string supplierId?: Prisma.IntFieldUpdateOperationsInput | number @@ -525,16 +525,16 @@ export type SupplierLedgerUncheckedUpdateManyWithoutSupplierNestedInput = { deleteMany?: Prisma.SupplierLedgerScalarWhereInput | Prisma.SupplierLedgerScalarWhereInput[] } -export type EnumledgerSourceTypeFieldUpdateOperationsInput = { - set?: $Enums.ledgerSourceType +export type EnumLedgerSourceTypeFieldUpdateOperationsInput = { + set?: $Enums.LedgerSourceType } export type SupplierLedgerCreateWithoutSupplierInput = { description?: string | null - debit: runtime.Decimal | runtime.DecimalJsLike | number | string - credit: runtime.Decimal | runtime.DecimalJsLike | number | string + debit?: runtime.Decimal | runtime.DecimalJsLike | number | string + credit?: runtime.Decimal | runtime.DecimalJsLike | number | string balance: runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType: $Enums.ledgerSourceType + sourceType: $Enums.LedgerSourceType sourceId: number createdAt?: Date | string } @@ -542,10 +542,10 @@ export type SupplierLedgerCreateWithoutSupplierInput = { export type SupplierLedgerUncheckedCreateWithoutSupplierInput = { id?: number description?: string | null - debit: runtime.Decimal | runtime.DecimalJsLike | number | string - credit: runtime.Decimal | runtime.DecimalJsLike | number | string + debit?: runtime.Decimal | runtime.DecimalJsLike | number | string + credit?: runtime.Decimal | runtime.DecimalJsLike | number | string balance: runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType: $Enums.ledgerSourceType + sourceType: $Enums.LedgerSourceType sourceId: number createdAt?: Date | string } @@ -585,7 +585,7 @@ export type SupplierLedgerScalarWhereInput = { debit?: Prisma.DecimalFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalFilter<"SupplierLedger"> | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeFilter<"SupplierLedger"> | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeFilter<"SupplierLedger"> | $Enums.LedgerSourceType sourceId?: Prisma.IntFilter<"SupplierLedger"> | number createdAt?: Prisma.DateTimeFilter<"SupplierLedger"> | Date | string supplierId?: Prisma.IntFilter<"SupplierLedger"> | number @@ -594,10 +594,10 @@ export type SupplierLedgerScalarWhereInput = { export type SupplierLedgerCreateManySupplierInput = { id?: number description?: string | null - debit: runtime.Decimal | runtime.DecimalJsLike | number | string - credit: runtime.Decimal | runtime.DecimalJsLike | number | string + debit?: runtime.Decimal | runtime.DecimalJsLike | number | string + credit?: runtime.Decimal | runtime.DecimalJsLike | number | string balance: runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType: $Enums.ledgerSourceType + sourceType: $Enums.LedgerSourceType sourceId: number createdAt?: Date | string } @@ -607,7 +607,7 @@ export type SupplierLedgerUpdateWithoutSupplierInput = { debit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeFieldUpdateOperationsInput | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType sourceId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } @@ -618,7 +618,7 @@ export type SupplierLedgerUncheckedUpdateWithoutSupplierInput = { debit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeFieldUpdateOperationsInput | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType sourceId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } @@ -629,7 +629,7 @@ export type SupplierLedgerUncheckedUpdateManyWithoutSupplierInput = { debit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string credit?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string balance?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string - sourceType?: Prisma.EnumledgerSourceTypeFieldUpdateOperationsInput | $Enums.ledgerSourceType + sourceType?: Prisma.EnumLedgerSourceTypeFieldUpdateOperationsInput | $Enums.LedgerSourceType sourceId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } @@ -679,7 +679,7 @@ export type $SupplierLedgerPayload readonly credit: Prisma.FieldRef<"SupplierLedger", 'Decimal'> readonly balance: Prisma.FieldRef<"SupplierLedger", 'Decimal'> - readonly sourceType: Prisma.FieldRef<"SupplierLedger", 'ledgerSourceType'> + readonly sourceType: Prisma.FieldRef<"SupplierLedger", 'LedgerSourceType'> readonly sourceId: Prisma.FieldRef<"SupplierLedger", 'Int'> readonly createdAt: Prisma.FieldRef<"SupplierLedger", 'DateTime'> readonly supplierId: Prisma.FieldRef<"SupplierLedger", 'Int'> diff --git a/src/modules/inventories/pos-accounts/pos-accounts.service.ts b/src/modules/inventories/pos-accounts/pos-accounts.service.ts index 610efa4..16187b8 100644 --- a/src/modules/inventories/pos-accounts/pos-accounts.service.ts +++ b/src/modules/inventories/pos-accounts/pos-accounts.service.ts @@ -44,16 +44,20 @@ export class PosAccountsService { inventoryId, }, include: { - bankAccount: { - select: { - id: true, - name: true, - accountNumber: true, - branch: { + inventoryBankAccount: { + include: { + bankAccount: { select: { id: true, name: true, - bank: { select: { id: true, name: true } }, + accountNumber: true, + branch: { + select: { + id: true, + name: true, + bank: { select: { id: true, name: true } }, + }, + }, }, }, }, @@ -64,7 +68,12 @@ export class PosAccountsService { bankAccountId: true, }, }) - return ResponseMapper.list(items) + return ResponseMapper.list( + items.map(item => ({ + ...item, + bankAccount: item.inventoryBankAccount?.bankAccount, + })), + ) } async findOne(inventoryId: number, id: number) { @@ -74,16 +83,20 @@ export class PosAccountsService { inventoryId, }, include: { - bankAccount: { - select: { - id: true, - name: true, - accountNumber: true, - branch: { + inventoryBankAccount: { + include: { + bankAccount: { select: { id: true, name: true, - bank: { select: { id: true, name: true } }, + accountNumber: true, + branch: { + select: { + id: true, + name: true, + bank: { select: { id: true, name: true } }, + }, + }, }, }, }, @@ -94,7 +107,9 @@ export class PosAccountsService { bankAccountId: true, }, }) - return ResponseMapper.single(item) + return ResponseMapper.single( + item ? { ...item, bankAccount: item.inventoryBankAccount?.bankAccount } : null, + ) } async update(inventoryId: number, id: number, dto: UpdatePosAccountDto) { diff --git a/src/modules/pos/pos.service.ts b/src/modules/pos/pos.service.ts index e8f7fd7..6595093 100644 --- a/src/modules/pos/pos.service.ts +++ b/src/modules/pos/pos.service.ts @@ -28,30 +28,37 @@ export class PosService { const info = await this.prisma.posAccount.findUniqueOrThrow({ where: { id: posId }, include: { - inventory: { - select: { - id: true, - name: true, - }, - }, - bankAccount: { - select: { - id: true, - name: true, - accountNumber: true, - branch: { + inventoryBankAccount: { + include: { + bankAccount: { select: { id: true, name: true, - bank: { select: { id: true, name: true } }, + accountNumber: true, + branch: { + select: { + id: true, + name: true, + bank: { select: { id: true, name: true } }, + }, + }, }, }, + inventory: { + select: { id: true, name: true }, + }, }, }, }, }) - return ResponseMapper.single({ ...info }) + const { inventoryBankAccount, ...rest } = info + + return ResponseMapper.single({ + ...rest, + bankAccount: inventoryBankAccount?.bankAccount, + inventory: inventoryBankAccount?.inventory, + }) } async getStock( diff --git a/src/purchase-receipts/dto/create-purchase-receipt.dto.ts b/src/purchase-receipts/dto/create-purchase-receipt.dto.ts index 76bcb76..35e4d6a 100644 --- a/src/purchase-receipts/dto/create-purchase-receipt.dto.ts +++ b/src/purchase-receipts/dto/create-purchase-receipt.dto.ts @@ -1,12 +1,5 @@ import { Type } from 'class-transformer' -import { - ArrayMinSize, - IsBoolean, - IsInt, - IsNumber, - IsOptional, - IsString, -} from 'class-validator' +import { ArrayMinSize, IsInt, IsNumber, IsOptional, IsString } from 'class-validator' import { CreatePurchaseReceiptItemDto } from '../../purchase-receipt-items/dto/create-purchase-receipt-item.dto' export class CreatePurchaseReceiptDto { @@ -17,10 +10,6 @@ export class CreatePurchaseReceiptDto { @IsNumber() totalAmount: number - @IsBoolean() - @IsOptional() - isSettled?: boolean - @Type(() => Number) @IsNumber() paidAmount: number diff --git a/src/suppliers/suppliers.service.ts b/src/suppliers/suppliers.service.ts index e2c1cad..bc487cf 100644 --- a/src/suppliers/suppliers.service.ts +++ b/src/suppliers/suppliers.service.ts @@ -64,6 +64,12 @@ export class SuppliersService { }, }, }, + payments: { + select: { + id: true, + amount: true, + }, + }, }, omit: { inventoryId: true,