diff --git a/prisma/migrations/20251225164731_add_inventory_bank_account_table/migration.sql b/prisma/migrations/20251225164731_add_inventory_bank_account_table/migration.sql new file mode 100644 index 0000000..1378313 --- /dev/null +++ b/prisma/migrations/20251225164731_add_inventory_bank_account_table/migration.sql @@ -0,0 +1,18 @@ +/* + Warnings: + + - You are about to drop the column `bankAccountId` on the `Inventories` table. All the data in the column will be lost. + - You are about to drop the `_Bank_Accounts_inventoryId_fkey` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropForeignKey +ALTER TABLE `_Bank_Accounts_inventoryId_fkey` DROP FOREIGN KEY `_Bank_Accounts_inventoryId_fkey_A_fkey`; + +-- DropForeignKey +ALTER TABLE `_Bank_Accounts_inventoryId_fkey` DROP FOREIGN KEY `_Bank_Accounts_inventoryId_fkey_B_fkey`; + +-- AlterTable +ALTER TABLE `Inventories` DROP COLUMN `bankAccountId`; + +-- DropTable +DROP TABLE `_Bank_Accounts_inventoryId_fkey`; diff --git a/prisma/schema/bank.prisma b/prisma/schema/bank.prisma index d05f259..d75c5ba 100644 --- a/prisma/schema/bank.prisma +++ b/prisma/schema/bank.prisma @@ -19,14 +19,13 @@ model BankAccount { accountNumber String? @unique @db.VarChar(20) cardNumber String? @unique @db.VarChar(16) name String @db.VarChar(255) - iban String? @db.VarChar(34) + iban String? @unique @db.VarChar(34) branchId Int createdAt DateTime @default(now()) @db.Timestamp(0) updatedAt DateTime @updatedAt @db.Timestamp(0) deletedAt DateTime? @db.Timestamp(0) branch BankBranch @relation("Bank_Accounts_branchId_fkey", fields: [branchId], references: [id]) - inventories Inventory[] @relation("Bank_Accounts_inventoryId_fkey") purchaseReceiptPayments PurchaseReceiptPayments[] posAccounts PosAccount[] inventoryBankAccounts InventoryBankAccount[] @relation("Inventory_Bank_Accounts_bankAccountId_fkey") diff --git a/prisma/schema/inventory.prisma b/prisma/schema/inventory.prisma index f8166ed..636b8fe 100644 --- a/prisma/schema/inventory.prisma +++ b/prisma/schema/inventory.prisma @@ -16,8 +16,6 @@ model Inventory { stockBalances StockBalance[] @relation("StockBalance_inventory") counterStockMovements StockMovement[] @relation("StockMovement_CounterInventory") stockMovements StockMovement[] @relation("StockMovement_Inventory") - bankAccountId Int? - bankAccounts BankAccount[] @relation("Bank_Accounts_inventoryId_fkey") posAccounts PosAccount[] @relation("Inventory_PosAccounts") inventoryBankAccounts InventoryBankAccount[] @relation("Inventory_Bank_Accounts_inventoryId_fkey") @@ -71,7 +69,7 @@ model PosAccount { name String @db.VarChar(255) code String @unique() @db.VarChar(10) description String? @db.VarChar(500) - bankAccountId Int? + bankAccountId Int inventoryId Int createdAt DateTime @default(now()) @db.Timestamp(0) updatedAt DateTime @updatedAt @db.Timestamp(0) diff --git a/src/app.module.ts b/src/app.module.ts index 3568dd7..94eda77 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -3,13 +3,13 @@ import { AppController } from './app.controller' import { AppService } from './app.service' import { AuthModule } from './auth/auth.module' import { CustomersModule } from './customers/customers.module' -import { InventoriesModule } from './inventories/inventories.module' import { InventoryTransferItemsModule } from './inventory-transfer-items/inventory-transfer-items.module' import { InventoryTransfersModule } from './inventory-transfers/inventory-transfers.module' import { BankAccountsModule } from './modules/bank-accounts/bank-accounts.module' import { BankBranchesModule } from './modules/bank-branches/bank-branches.module' import { BanksModule } from './modules/banks/banks.module' import { CardexModule } from './modules/cardex/cardex.module' +import { InventoriesModule } from './modules/inventories/inventories.module' import { PosModule } from './modules/pos/pos.module' import { PrismaModule } from './prisma/prisma.module' import { ProductBrandsModule } from './product-brands/product-brands.module' diff --git a/src/common/response/response-mapper.ts b/src/common/response/response-mapper.ts index 0519fdd..5a32747 100644 --- a/src/common/response/response-mapper.ts +++ b/src/common/response/response-mapper.ts @@ -5,7 +5,7 @@ * the global `ResponseMappingInterceptor` understands and normalizes. */ export type MapperWrapper = - | { __mapped: 'create' | 'update' | 'single'; data: T } + | { __mapped: 'create' | 'update' | 'single' | 'delete'; data: T } | { __mapped: 'list'; items: T[] } | { __mapped: 'paginate'; items: T[]; total: number; page?: number; perPage?: number } | { __mapped: 'sequelize'; rows: T[]; count: number; page?: number; perPage?: number } @@ -23,6 +23,10 @@ export const ResponseMapper = { return { __mapped: 'single', data: item } }, + delete(item: T): MapperWrapper { + return { __mapped: 'delete', data: item } + }, + list(items: T[]): MapperWrapper { return { __mapped: 'list', items } }, diff --git a/src/generated/prisma/commonInputTypes.ts b/src/generated/prisma/commonInputTypes.ts index 5948e19..b19f3b7 100644 --- a/src/generated/prisma/commonInputTypes.ts +++ b/src/generated/prisma/commonInputTypes.ts @@ -226,33 +226,6 @@ export type BoolWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedBoolFilter<$PrismaModel> } -export type IntNullableFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null -} - -export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _avg?: Prisma.NestedFloatNullableFilter<$PrismaModel> - _sum?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedIntNullableFilter<$PrismaModel> - _max?: Prisma.NestedIntNullableFilter<$PrismaModel> -} - export type DecimalFilter<$PrismaModel = never> = { equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] @@ -331,6 +304,33 @@ export type Enumpayment_method_typeWithAggregatesFilter<$PrismaModel = never> = _max?: Prisma.NestedEnumpayment_method_typeFilter<$PrismaModel> } +export type IntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | null + notIn?: number[] | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null +} + +export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | null + notIn?: number[] | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _avg?: Prisma.NestedFloatNullableFilter<$PrismaModel> + _sum?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedIntNullableFilter<$PrismaModel> + _max?: Prisma.NestedIntNullableFilter<$PrismaModel> +} + export type DecimalNullableFilter<$PrismaModel = never> = { equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> | null in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | null @@ -594,33 +594,6 @@ export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedBoolFilter<$PrismaModel> } -export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _avg?: Prisma.NestedFloatNullableFilter<$PrismaModel> - _sum?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedIntNullableFilter<$PrismaModel> - _max?: Prisma.NestedIntNullableFilter<$PrismaModel> -} - -export type NestedFloatNullableFilter<$PrismaModel = never> = { - equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null - in?: number[] | null - notIn?: number[] | null - lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> - lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> - gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> - gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> - not?: Prisma.NestedFloatNullableFilter<$PrismaModel> | number | null -} - export type NestedDecimalFilter<$PrismaModel = never> = { equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] @@ -699,6 +672,33 @@ export type NestedEnumpayment_method_typeWithAggregatesFilter<$PrismaModel = nev _max?: Prisma.NestedEnumpayment_method_typeFilter<$PrismaModel> } +export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | null + notIn?: number[] | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _avg?: Prisma.NestedFloatNullableFilter<$PrismaModel> + _sum?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedIntNullableFilter<$PrismaModel> + _max?: Prisma.NestedIntNullableFilter<$PrismaModel> +} + +export type NestedFloatNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null + in?: number[] | null + notIn?: number[] | null + lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + not?: Prisma.NestedFloatNullableFilter<$PrismaModel> | number | null +} + export type NestedDecimalNullableFilter<$PrismaModel = never> = { equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> | null in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] | null diff --git a/src/generated/prisma/internal/class.ts b/src/generated/prisma/internal/class.ts index ab99231..d45fcb1 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? @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 inventories Inventory[] @relation(\"Bank_Accounts_inventoryId_fkey\")\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 bankAccountId Int?\n bankAccounts BankAccount[] @relation(\"Bank_Accounts_inventoryId_fkey\")\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 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", "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\":\"inventories\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Bank_Accounts_inventoryId_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\":\"bankAccountId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"bankAccounts\",\"kind\":\"object\",\"type\":\"BankAccount\",\"relationName\":\"Bank_Accounts_inventoryId_fkey\"},{\"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\":\"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\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') diff --git a/src/generated/prisma/internal/prismaNamespace.ts b/src/generated/prisma/internal/prismaNamespace.ts index 4a86f8f..2866fff 100644 --- a/src/generated/prisma/internal/prismaNamespace.ts +++ b/src/generated/prisma/internal/prismaNamespace.ts @@ -2474,8 +2474,7 @@ export const InventoryScalarFieldEnum = { createdAt: 'createdAt', updatedAt: 'updatedAt', deletedAt: 'deletedAt', - isPointOfSale: 'isPointOfSale', - bankAccountId: 'bankAccountId' + isPointOfSale: 'isPointOfSale' } as const export type InventoryScalarFieldEnum = (typeof InventoryScalarFieldEnum)[keyof typeof InventoryScalarFieldEnum] diff --git a/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/generated/prisma/internal/prismaNamespaceBrowser.ts index 934923d..a2a6610 100644 --- a/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -187,8 +187,7 @@ export const InventoryScalarFieldEnum = { createdAt: 'createdAt', updatedAt: 'updatedAt', deletedAt: 'deletedAt', - isPointOfSale: 'isPointOfSale', - bankAccountId: 'bankAccountId' + isPointOfSale: 'isPointOfSale' } as const export type InventoryScalarFieldEnum = (typeof InventoryScalarFieldEnum)[keyof typeof InventoryScalarFieldEnum] diff --git a/src/generated/prisma/models/BankAccount.ts b/src/generated/prisma/models/BankAccount.ts index 9a0dc68..1232857 100644 --- a/src/generated/prisma/models/BankAccount.ts +++ b/src/generated/prisma/models/BankAccount.ts @@ -253,7 +253,6 @@ export type BankAccountWhereInput = { updatedAt?: Prisma.DateTimeFilter<"BankAccount"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"BankAccount"> | Date | string | null branch?: Prisma.XOR - inventories?: Prisma.InventoryListRelationFilter purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter posAccounts?: Prisma.PosAccountListRelationFilter inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter @@ -270,7 +269,6 @@ export type BankAccountOrderByWithRelationInput = { updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder branch?: Prisma.BankBranchOrderByWithRelationInput - inventories?: Prisma.InventoryOrderByRelationAggregateInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsOrderByRelationAggregateInput posAccounts?: Prisma.PosAccountOrderByRelationAggregateInput inventoryBankAccounts?: Prisma.InventoryBankAccountOrderByRelationAggregateInput @@ -281,21 +279,20 @@ export type BankAccountWhereUniqueInput = Prisma.AtLeast<{ id?: number accountNumber?: string cardNumber?: string + iban?: string AND?: Prisma.BankAccountWhereInput | Prisma.BankAccountWhereInput[] OR?: Prisma.BankAccountWhereInput[] NOT?: Prisma.BankAccountWhereInput | Prisma.BankAccountWhereInput[] name?: Prisma.StringFilter<"BankAccount"> | string - iban?: Prisma.StringNullableFilter<"BankAccount"> | string | null branchId?: Prisma.IntFilter<"BankAccount"> | number createdAt?: Prisma.DateTimeFilter<"BankAccount"> | Date | string updatedAt?: Prisma.DateTimeFilter<"BankAccount"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"BankAccount"> | Date | string | null branch?: Prisma.XOR - inventories?: Prisma.InventoryListRelationFilter purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter posAccounts?: Prisma.PosAccountListRelationFilter inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter -}, "id" | "accountNumber" | "cardNumber"> +}, "id" | "accountNumber" | "cardNumber" | "iban"> export type BankAccountOrderByWithAggregationInput = { id?: Prisma.SortOrder @@ -338,7 +335,6 @@ export type BankAccountCreateInput = { updatedAt?: Date | string deletedAt?: Date | string | null branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput - inventories?: Prisma.InventoryCreateNestedManyWithoutBankAccountsInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput @@ -354,7 +350,6 @@ export type BankAccountUncheckedCreateInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - inventories?: Prisma.InventoryUncheckedCreateNestedManyWithoutBankAccountsInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput @@ -369,7 +364,6 @@ export type BankAccountUpdateInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput - inventories?: Prisma.InventoryUpdateManyWithoutBankAccountsNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput @@ -385,7 +379,6 @@ export type BankAccountUncheckedUpdateInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventories?: Prisma.InventoryUncheckedUpdateManyWithoutBankAccountsNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput @@ -539,44 +532,6 @@ export type BankAccountUncheckedUpdateManyWithoutBranchNestedInput = { deleteMany?: Prisma.BankAccountScalarWhereInput | Prisma.BankAccountScalarWhereInput[] } -export type BankAccountCreateNestedManyWithoutInventoriesInput = { - create?: Prisma.XOR | Prisma.BankAccountCreateWithoutInventoriesInput[] | Prisma.BankAccountUncheckedCreateWithoutInventoriesInput[] - connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutInventoriesInput | Prisma.BankAccountCreateOrConnectWithoutInventoriesInput[] - connect?: Prisma.BankAccountWhereUniqueInput | Prisma.BankAccountWhereUniqueInput[] -} - -export type BankAccountUncheckedCreateNestedManyWithoutInventoriesInput = { - create?: Prisma.XOR | Prisma.BankAccountCreateWithoutInventoriesInput[] | Prisma.BankAccountUncheckedCreateWithoutInventoriesInput[] - connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutInventoriesInput | Prisma.BankAccountCreateOrConnectWithoutInventoriesInput[] - connect?: Prisma.BankAccountWhereUniqueInput | Prisma.BankAccountWhereUniqueInput[] -} - -export type BankAccountUpdateManyWithoutInventoriesNestedInput = { - create?: Prisma.XOR | Prisma.BankAccountCreateWithoutInventoriesInput[] | Prisma.BankAccountUncheckedCreateWithoutInventoriesInput[] - connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutInventoriesInput | Prisma.BankAccountCreateOrConnectWithoutInventoriesInput[] - upsert?: Prisma.BankAccountUpsertWithWhereUniqueWithoutInventoriesInput | Prisma.BankAccountUpsertWithWhereUniqueWithoutInventoriesInput[] - set?: Prisma.BankAccountWhereUniqueInput | Prisma.BankAccountWhereUniqueInput[] - disconnect?: Prisma.BankAccountWhereUniqueInput | Prisma.BankAccountWhereUniqueInput[] - delete?: Prisma.BankAccountWhereUniqueInput | Prisma.BankAccountWhereUniqueInput[] - connect?: Prisma.BankAccountWhereUniqueInput | Prisma.BankAccountWhereUniqueInput[] - update?: Prisma.BankAccountUpdateWithWhereUniqueWithoutInventoriesInput | Prisma.BankAccountUpdateWithWhereUniqueWithoutInventoriesInput[] - updateMany?: Prisma.BankAccountUpdateManyWithWhereWithoutInventoriesInput | Prisma.BankAccountUpdateManyWithWhereWithoutInventoriesInput[] - deleteMany?: Prisma.BankAccountScalarWhereInput | Prisma.BankAccountScalarWhereInput[] -} - -export type BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput = { - create?: Prisma.XOR | Prisma.BankAccountCreateWithoutInventoriesInput[] | Prisma.BankAccountUncheckedCreateWithoutInventoriesInput[] - connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutInventoriesInput | Prisma.BankAccountCreateOrConnectWithoutInventoriesInput[] - upsert?: Prisma.BankAccountUpsertWithWhereUniqueWithoutInventoriesInput | Prisma.BankAccountUpsertWithWhereUniqueWithoutInventoriesInput[] - set?: Prisma.BankAccountWhereUniqueInput | Prisma.BankAccountWhereUniqueInput[] - disconnect?: Prisma.BankAccountWhereUniqueInput | Prisma.BankAccountWhereUniqueInput[] - delete?: Prisma.BankAccountWhereUniqueInput | Prisma.BankAccountWhereUniqueInput[] - connect?: Prisma.BankAccountWhereUniqueInput | Prisma.BankAccountWhereUniqueInput[] - update?: Prisma.BankAccountUpdateWithWhereUniqueWithoutInventoriesInput | Prisma.BankAccountUpdateWithWhereUniqueWithoutInventoriesInput[] - updateMany?: Prisma.BankAccountUpdateManyWithWhereWithoutInventoriesInput | Prisma.BankAccountUpdateManyWithWhereWithoutInventoriesInput[] - deleteMany?: Prisma.BankAccountScalarWhereInput | Prisma.BankAccountScalarWhereInput[] -} - export type BankAccountCreateNestedOneWithoutInventoryBankAccountsInput = { create?: Prisma.XOR connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutInventoryBankAccountsInput @@ -631,7 +586,6 @@ export type BankAccountCreateWithoutBranchInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - inventories?: Prisma.InventoryCreateNestedManyWithoutBankAccountsInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput @@ -646,7 +600,6 @@ export type BankAccountUncheckedCreateWithoutBranchInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - inventories?: Prisma.InventoryUncheckedCreateNestedManyWithoutBankAccountsInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput @@ -693,56 +646,6 @@ export type BankAccountScalarWhereInput = { deletedAt?: Prisma.DateTimeNullableFilter<"BankAccount"> | Date | string | null } -export type BankAccountCreateWithoutInventoriesInput = { - 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 - posAccounts?: Prisma.PosAccountCreateNestedManyWithoutBankAccountInput - inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput -} - -export type BankAccountUncheckedCreateWithoutInventoriesInput = { - 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 - posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutBankAccountInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput -} - -export type BankAccountCreateOrConnectWithoutInventoriesInput = { - where: Prisma.BankAccountWhereUniqueInput - create: Prisma.XOR -} - -export type BankAccountUpsertWithWhereUniqueWithoutInventoriesInput = { - where: Prisma.BankAccountWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR -} - -export type BankAccountUpdateWithWhereUniqueWithoutInventoriesInput = { - where: Prisma.BankAccountWhereUniqueInput - data: Prisma.XOR -} - -export type BankAccountUpdateManyWithWhereWithoutInventoriesInput = { - where: Prisma.BankAccountScalarWhereInput - data: Prisma.XOR -} - export type BankAccountCreateWithoutInventoryBankAccountsInput = { accountNumber?: string | null cardNumber?: string | null @@ -752,7 +655,6 @@ export type BankAccountCreateWithoutInventoryBankAccountsInput = { updatedAt?: Date | string deletedAt?: Date | string | null branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput - inventories?: Prisma.InventoryCreateNestedManyWithoutBankAccountsInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutBankAccountInput } @@ -767,7 +669,6 @@ export type BankAccountUncheckedCreateWithoutInventoryBankAccountsInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - inventories?: Prisma.InventoryUncheckedCreateNestedManyWithoutBankAccountsInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutBankAccountInput } @@ -797,7 +698,6 @@ export type BankAccountUpdateWithoutInventoryBankAccountsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput - inventories?: Prisma.InventoryUpdateManyWithoutBankAccountsNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutBankAccountNestedInput } @@ -812,7 +712,6 @@ export type BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventories?: Prisma.InventoryUncheckedUpdateManyWithoutBankAccountsNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutBankAccountNestedInput } @@ -826,7 +725,6 @@ export type BankAccountCreateWithoutPosAccountsInput = { updatedAt?: Date | string deletedAt?: Date | string | null branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput - inventories?: Prisma.InventoryCreateNestedManyWithoutBankAccountsInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput } @@ -841,7 +739,6 @@ export type BankAccountUncheckedCreateWithoutPosAccountsInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - inventories?: Prisma.InventoryUncheckedCreateNestedManyWithoutBankAccountsInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput } @@ -871,7 +768,6 @@ export type BankAccountUpdateWithoutPosAccountsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput - inventories?: Prisma.InventoryUpdateManyWithoutBankAccountsNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput } @@ -886,7 +782,6 @@ export type BankAccountUncheckedUpdateWithoutPosAccountsInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventories?: Prisma.InventoryUncheckedUpdateManyWithoutBankAccountsNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput } @@ -900,7 +795,6 @@ export type BankAccountCreateWithoutPurchaseReceiptPaymentsInput = { updatedAt?: Date | string deletedAt?: Date | string | null branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput - inventories?: Prisma.InventoryCreateNestedManyWithoutBankAccountsInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput } @@ -915,7 +809,6 @@ export type BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput = { createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null - inventories?: Prisma.InventoryUncheckedCreateNestedManyWithoutBankAccountsInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutBankAccountInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput } @@ -945,7 +838,6 @@ export type BankAccountUpdateWithoutPurchaseReceiptPaymentsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput - inventories?: Prisma.InventoryUpdateManyWithoutBankAccountsNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput } @@ -960,7 +852,6 @@ export type BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventories?: Prisma.InventoryUncheckedUpdateManyWithoutBankAccountsNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput } @@ -984,7 +875,6 @@ export type BankAccountUpdateWithoutBranchInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventories?: Prisma.InventoryUpdateManyWithoutBankAccountsNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput @@ -999,7 +889,6 @@ export type BankAccountUncheckedUpdateWithoutBranchInput = { createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - inventories?: Prisma.InventoryUncheckedUpdateManyWithoutBankAccountsNestedInput purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutBankAccountNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput @@ -1016,61 +905,18 @@ export type BankAccountUncheckedUpdateManyWithoutBranchInput = { deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } -export type BankAccountUpdateWithoutInventoriesInput = { - 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 - posAccounts?: Prisma.PosAccountUpdateManyWithoutBankAccountNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput -} - -export type BankAccountUncheckedUpdateWithoutInventoriesInput = { - 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 - posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutBankAccountNestedInput - inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput -} - -export type BankAccountUncheckedUpdateManyWithoutInventoriesInput = { - 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 -} - /** * Count Type BankAccountCountOutputType */ export type BankAccountCountOutputType = { - inventories: number purchaseReceiptPayments: number posAccounts: number inventoryBankAccounts: number } export type BankAccountCountOutputTypeSelect = { - inventories?: boolean | BankAccountCountOutputTypeCountInventoriesArgs purchaseReceiptPayments?: boolean | BankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs posAccounts?: boolean | BankAccountCountOutputTypeCountPosAccountsArgs inventoryBankAccounts?: boolean | BankAccountCountOutputTypeCountInventoryBankAccountsArgs @@ -1086,13 +932,6 @@ export type BankAccountCountOutputTypeDefaultArgs | null } -/** - * BankAccountCountOutputType without action - */ -export type BankAccountCountOutputTypeCountInventoriesArgs = { - where?: Prisma.InventoryWhereInput -} - /** * BankAccountCountOutputType without action */ @@ -1126,7 +965,6 @@ export type BankAccountSelect - inventories?: boolean | Prisma.BankAccount$inventoriesArgs purchaseReceiptPayments?: boolean | Prisma.BankAccount$purchaseReceiptPaymentsArgs posAccounts?: boolean | Prisma.BankAccount$posAccountsArgs inventoryBankAccounts?: boolean | Prisma.BankAccount$inventoryBankAccountsArgs @@ -1150,7 +988,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 - inventories?: boolean | Prisma.BankAccount$inventoriesArgs purchaseReceiptPayments?: boolean | Prisma.BankAccount$purchaseReceiptPaymentsArgs posAccounts?: boolean | Prisma.BankAccount$posAccountsArgs inventoryBankAccounts?: boolean | Prisma.BankAccount$inventoryBankAccountsArgs @@ -1161,7 +998,6 @@ export type $BankAccountPayload - inventories: Prisma.$InventoryPayload[] purchaseReceiptPayments: Prisma.$PurchaseReceiptPaymentsPayload[] posAccounts: Prisma.$PosAccountPayload[] inventoryBankAccounts: Prisma.$InventoryBankAccountPayload[] @@ -1517,7 +1353,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> - inventories = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> 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> @@ -1901,30 +1736,6 @@ export type BankAccountDeleteManyArgs = { - /** - * Select specific fields to fetch from the Inventory - */ - select?: Prisma.InventorySelect | null - /** - * Omit specific fields from the Inventory - */ - omit?: Prisma.InventoryOmit | null - /** - * Choose, which related nodes to fetch as well - */ - include?: Prisma.InventoryInclude | null - where?: Prisma.InventoryWhereInput - orderBy?: Prisma.InventoryOrderByWithRelationInput | Prisma.InventoryOrderByWithRelationInput[] - cursor?: Prisma.InventoryWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.InventoryScalarFieldEnum | Prisma.InventoryScalarFieldEnum[] -} - /** * BankAccount.purchaseReceiptPayments */ diff --git a/src/generated/prisma/models/Inventory.ts b/src/generated/prisma/models/Inventory.ts index a539d59..a038c6d 100644 --- a/src/generated/prisma/models/Inventory.ts +++ b/src/generated/prisma/models/Inventory.ts @@ -28,12 +28,10 @@ export type AggregateInventory = { export type InventoryAvgAggregateOutputType = { id: number | null - bankAccountId: number | null } export type InventorySumAggregateOutputType = { id: number | null - bankAccountId: number | null } export type InventoryMinAggregateOutputType = { @@ -45,7 +43,6 @@ export type InventoryMinAggregateOutputType = { updatedAt: Date | null deletedAt: Date | null isPointOfSale: boolean | null - bankAccountId: number | null } export type InventoryMaxAggregateOutputType = { @@ -57,7 +54,6 @@ export type InventoryMaxAggregateOutputType = { updatedAt: Date | null deletedAt: Date | null isPointOfSale: boolean | null - bankAccountId: number | null } export type InventoryCountAggregateOutputType = { @@ -69,19 +65,16 @@ export type InventoryCountAggregateOutputType = { updatedAt: number deletedAt: number isPointOfSale: number - bankAccountId: number _all: number } export type InventoryAvgAggregateInputType = { id?: true - bankAccountId?: true } export type InventorySumAggregateInputType = { id?: true - bankAccountId?: true } export type InventoryMinAggregateInputType = { @@ -93,7 +86,6 @@ export type InventoryMinAggregateInputType = { updatedAt?: true deletedAt?: true isPointOfSale?: true - bankAccountId?: true } export type InventoryMaxAggregateInputType = { @@ -105,7 +97,6 @@ export type InventoryMaxAggregateInputType = { updatedAt?: true deletedAt?: true isPointOfSale?: true - bankAccountId?: true } export type InventoryCountAggregateInputType = { @@ -117,7 +108,6 @@ export type InventoryCountAggregateInputType = { updatedAt?: true deletedAt?: true isPointOfSale?: true - bankAccountId?: true _all?: true } @@ -216,7 +206,6 @@ export type InventoryGroupByOutputType = { updatedAt: Date deletedAt: Date | null isPointOfSale: boolean - bankAccountId: number | null _count: InventoryCountAggregateOutputType | null _avg: InventoryAvgAggregateOutputType | null _sum: InventorySumAggregateOutputType | null @@ -251,7 +240,6 @@ export type InventoryWhereInput = { updatedAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"Inventory"> | Date | string | null isPointOfSale?: Prisma.BoolFilter<"Inventory"> | boolean - bankAccountId?: Prisma.IntNullableFilter<"Inventory"> | number | null inventoryTransfersFrom?: Prisma.InventoryTransferListRelationFilter inventoryTransfersTo?: Prisma.InventoryTransferListRelationFilter purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter @@ -260,7 +248,6 @@ export type InventoryWhereInput = { stockBalances?: Prisma.StockBalanceListRelationFilter counterStockMovements?: Prisma.StockMovementListRelationFilter stockMovements?: Prisma.StockMovementListRelationFilter - bankAccounts?: Prisma.BankAccountListRelationFilter posAccounts?: Prisma.PosAccountListRelationFilter inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter } @@ -274,7 +261,6 @@ export type InventoryOrderByWithRelationInput = { updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder isPointOfSale?: Prisma.SortOrder - bankAccountId?: Prisma.SortOrderInput | Prisma.SortOrder inventoryTransfersFrom?: Prisma.InventoryTransferOrderByRelationAggregateInput inventoryTransfersTo?: Prisma.InventoryTransferOrderByRelationAggregateInput purchaseReceipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput @@ -283,7 +269,6 @@ export type InventoryOrderByWithRelationInput = { stockBalances?: Prisma.StockBalanceOrderByRelationAggregateInput counterStockMovements?: Prisma.StockMovementOrderByRelationAggregateInput stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput - bankAccounts?: Prisma.BankAccountOrderByRelationAggregateInput posAccounts?: Prisma.PosAccountOrderByRelationAggregateInput inventoryBankAccounts?: Prisma.InventoryBankAccountOrderByRelationAggregateInput _relevance?: Prisma.InventoryOrderByRelevanceInput @@ -301,7 +286,6 @@ export type InventoryWhereUniqueInput = Prisma.AtLeast<{ updatedAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"Inventory"> | Date | string | null isPointOfSale?: Prisma.BoolFilter<"Inventory"> | boolean - bankAccountId?: Prisma.IntNullableFilter<"Inventory"> | number | null inventoryTransfersFrom?: Prisma.InventoryTransferListRelationFilter inventoryTransfersTo?: Prisma.InventoryTransferListRelationFilter purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter @@ -310,7 +294,6 @@ export type InventoryWhereUniqueInput = Prisma.AtLeast<{ stockBalances?: Prisma.StockBalanceListRelationFilter counterStockMovements?: Prisma.StockMovementListRelationFilter stockMovements?: Prisma.StockMovementListRelationFilter - bankAccounts?: Prisma.BankAccountListRelationFilter posAccounts?: Prisma.PosAccountListRelationFilter inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter }, "id"> @@ -324,7 +307,6 @@ export type InventoryOrderByWithAggregationInput = { updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder isPointOfSale?: Prisma.SortOrder - bankAccountId?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.InventoryCountOrderByAggregateInput _avg?: Prisma.InventoryAvgOrderByAggregateInput _max?: Prisma.InventoryMaxOrderByAggregateInput @@ -344,7 +326,6 @@ export type InventoryScalarWhereWithAggregatesInput = { updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Inventory"> | Date | string deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Inventory"> | Date | string | null isPointOfSale?: Prisma.BoolWithAggregatesFilter<"Inventory"> | boolean - bankAccountId?: Prisma.IntNullableWithAggregatesFilter<"Inventory"> | number | null } export type InventoryCreateInput = { @@ -355,7 +336,6 @@ export type InventoryCreateInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput @@ -364,7 +344,6 @@ export type InventoryCreateInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -378,7 +357,6 @@ export type InventoryUncheckedCreateInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput @@ -387,7 +365,6 @@ export type InventoryUncheckedCreateInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -400,7 +377,6 @@ export type InventoryUpdateInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput @@ -409,7 +385,6 @@ export type InventoryUpdateInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -423,7 +398,6 @@ export type InventoryUncheckedUpdateInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput @@ -432,7 +406,6 @@ export type InventoryUncheckedUpdateInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -446,7 +419,6 @@ export type InventoryCreateManyInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null } export type InventoryUpdateManyMutationInput = { @@ -457,7 +429,6 @@ export type InventoryUpdateManyMutationInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null } export type InventoryUncheckedUpdateManyInput = { @@ -469,17 +440,6 @@ export type InventoryUncheckedUpdateManyInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null -} - -export type InventoryListRelationFilter = { - every?: Prisma.InventoryWhereInput - some?: Prisma.InventoryWhereInput - none?: Prisma.InventoryWhereInput -} - -export type InventoryOrderByRelationAggregateInput = { - _count?: Prisma.SortOrder } export type InventoryOrderByRelevanceInput = { @@ -497,12 +457,10 @@ export type InventoryCountOrderByAggregateInput = { updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrder isPointOfSale?: Prisma.SortOrder - bankAccountId?: Prisma.SortOrder } export type InventoryAvgOrderByAggregateInput = { id?: Prisma.SortOrder - bankAccountId?: Prisma.SortOrder } export type InventoryMaxOrderByAggregateInput = { @@ -514,7 +472,6 @@ export type InventoryMaxOrderByAggregateInput = { updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrder isPointOfSale?: Prisma.SortOrder - bankAccountId?: Prisma.SortOrder } export type InventoryMinOrderByAggregateInput = { @@ -526,12 +483,10 @@ export type InventoryMinOrderByAggregateInput = { updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrder isPointOfSale?: Prisma.SortOrder - bankAccountId?: Prisma.SortOrder } export type InventorySumOrderByAggregateInput = { id?: Prisma.SortOrder - bankAccountId?: Prisma.SortOrder } export type InventoryScalarRelationFilter = { @@ -544,52 +499,6 @@ export type InventoryNullableScalarRelationFilter = { isNot?: Prisma.InventoryWhereInput | null } -export type InventoryCreateNestedManyWithoutBankAccountsInput = { - create?: Prisma.XOR | Prisma.InventoryCreateWithoutBankAccountsInput[] | Prisma.InventoryUncheckedCreateWithoutBankAccountsInput[] - connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutBankAccountsInput | Prisma.InventoryCreateOrConnectWithoutBankAccountsInput[] - connect?: Prisma.InventoryWhereUniqueInput | Prisma.InventoryWhereUniqueInput[] -} - -export type InventoryUncheckedCreateNestedManyWithoutBankAccountsInput = { - create?: Prisma.XOR | Prisma.InventoryCreateWithoutBankAccountsInput[] | Prisma.InventoryUncheckedCreateWithoutBankAccountsInput[] - connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutBankAccountsInput | Prisma.InventoryCreateOrConnectWithoutBankAccountsInput[] - connect?: Prisma.InventoryWhereUniqueInput | Prisma.InventoryWhereUniqueInput[] -} - -export type InventoryUpdateManyWithoutBankAccountsNestedInput = { - create?: Prisma.XOR | Prisma.InventoryCreateWithoutBankAccountsInput[] | Prisma.InventoryUncheckedCreateWithoutBankAccountsInput[] - connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutBankAccountsInput | Prisma.InventoryCreateOrConnectWithoutBankAccountsInput[] - upsert?: Prisma.InventoryUpsertWithWhereUniqueWithoutBankAccountsInput | Prisma.InventoryUpsertWithWhereUniqueWithoutBankAccountsInput[] - set?: Prisma.InventoryWhereUniqueInput | Prisma.InventoryWhereUniqueInput[] - disconnect?: Prisma.InventoryWhereUniqueInput | Prisma.InventoryWhereUniqueInput[] - delete?: Prisma.InventoryWhereUniqueInput | Prisma.InventoryWhereUniqueInput[] - connect?: Prisma.InventoryWhereUniqueInput | Prisma.InventoryWhereUniqueInput[] - update?: Prisma.InventoryUpdateWithWhereUniqueWithoutBankAccountsInput | Prisma.InventoryUpdateWithWhereUniqueWithoutBankAccountsInput[] - updateMany?: Prisma.InventoryUpdateManyWithWhereWithoutBankAccountsInput | Prisma.InventoryUpdateManyWithWhereWithoutBankAccountsInput[] - deleteMany?: Prisma.InventoryScalarWhereInput | Prisma.InventoryScalarWhereInput[] -} - -export type InventoryUncheckedUpdateManyWithoutBankAccountsNestedInput = { - create?: Prisma.XOR | Prisma.InventoryCreateWithoutBankAccountsInput[] | Prisma.InventoryUncheckedCreateWithoutBankAccountsInput[] - connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutBankAccountsInput | Prisma.InventoryCreateOrConnectWithoutBankAccountsInput[] - upsert?: Prisma.InventoryUpsertWithWhereUniqueWithoutBankAccountsInput | Prisma.InventoryUpsertWithWhereUniqueWithoutBankAccountsInput[] - set?: Prisma.InventoryWhereUniqueInput | Prisma.InventoryWhereUniqueInput[] - disconnect?: Prisma.InventoryWhereUniqueInput | Prisma.InventoryWhereUniqueInput[] - delete?: Prisma.InventoryWhereUniqueInput | Prisma.InventoryWhereUniqueInput[] - connect?: Prisma.InventoryWhereUniqueInput | Prisma.InventoryWhereUniqueInput[] - update?: Prisma.InventoryUpdateWithWhereUniqueWithoutBankAccountsInput | Prisma.InventoryUpdateWithWhereUniqueWithoutBankAccountsInput[] - updateMany?: Prisma.InventoryUpdateManyWithWhereWithoutBankAccountsInput | Prisma.InventoryUpdateManyWithWhereWithoutBankAccountsInput[] - deleteMany?: Prisma.InventoryScalarWhereInput | Prisma.InventoryScalarWhereInput[] -} - -export type NullableIntFieldUpdateOperationsInput = { - set?: number | null - increment?: number - decrement?: number - multiply?: number - divide?: number -} - export type InventoryCreateNestedOneWithoutInventoryTransfersFromInput = { create?: Prisma.XOR connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryTransfersFromInput @@ -732,85 +641,6 @@ export type InventoryUpdateOneRequiredWithoutStockAdjustmentsNestedInput = { update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutStockAdjustmentsInput> } -export type InventoryCreateWithoutBankAccountsInput = { - name: string - location?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - isPointOfSale?: boolean - bankAccountId?: number | null - inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput - 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 InventoryUncheckedCreateWithoutBankAccountsInput = { - id?: number - name: string - location?: string | null - isActive?: boolean - createdAt?: Date | string - updatedAt?: Date | string - deletedAt?: Date | string | null - isPointOfSale?: boolean - bankAccountId?: number | null - inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput - 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 InventoryCreateOrConnectWithoutBankAccountsInput = { - where: Prisma.InventoryWhereUniqueInput - create: Prisma.XOR -} - -export type InventoryUpsertWithWhereUniqueWithoutBankAccountsInput = { - where: Prisma.InventoryWhereUniqueInput - update: Prisma.XOR - create: Prisma.XOR -} - -export type InventoryUpdateWithWhereUniqueWithoutBankAccountsInput = { - where: Prisma.InventoryWhereUniqueInput - data: Prisma.XOR -} - -export type InventoryUpdateManyWithWhereWithoutBankAccountsInput = { - where: Prisma.InventoryScalarWhereInput - data: Prisma.XOR -} - -export type InventoryScalarWhereInput = { - AND?: Prisma.InventoryScalarWhereInput | Prisma.InventoryScalarWhereInput[] - OR?: Prisma.InventoryScalarWhereInput[] - NOT?: Prisma.InventoryScalarWhereInput | Prisma.InventoryScalarWhereInput[] - id?: Prisma.IntFilter<"Inventory"> | number - name?: Prisma.StringFilter<"Inventory"> | string - location?: Prisma.StringNullableFilter<"Inventory"> | string | null - isActive?: Prisma.BoolFilter<"Inventory"> | boolean - createdAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string - updatedAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string - deletedAt?: Prisma.DateTimeNullableFilter<"Inventory"> | Date | string | null - isPointOfSale?: Prisma.BoolFilter<"Inventory"> | boolean - bankAccountId?: Prisma.IntNullableFilter<"Inventory"> | number | null -} - export type InventoryCreateWithoutInventoryTransfersFromInput = { name: string location?: string | null @@ -819,7 +649,6 @@ export type InventoryCreateWithoutInventoryTransfersFromInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput @@ -827,7 +656,6 @@ export type InventoryCreateWithoutInventoryTransfersFromInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -841,7 +669,6 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput @@ -849,7 +676,6 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -867,7 +693,6 @@ export type InventoryCreateWithoutInventoryTransfersToInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput @@ -875,7 +700,6 @@ export type InventoryCreateWithoutInventoryTransfersToInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -889,7 +713,6 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput @@ -897,7 +720,6 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -926,7 +748,6 @@ export type InventoryUpdateWithoutInventoryTransfersFromInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput @@ -934,7 +755,6 @@ export type InventoryUpdateWithoutInventoryTransfersFromInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -948,7 +768,6 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput @@ -956,7 +775,6 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -980,7 +798,6 @@ export type InventoryUpdateWithoutInventoryTransfersToInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput @@ -988,7 +805,6 @@ export type InventoryUpdateWithoutInventoryTransfersToInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1002,7 +818,6 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput @@ -1010,7 +825,6 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1023,7 +837,6 @@ export type InventoryCreateWithoutInventoryBankAccountsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput @@ -1032,7 +845,6 @@ export type InventoryCreateWithoutInventoryBankAccountsInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput } @@ -1045,7 +857,6 @@ export type InventoryUncheckedCreateWithoutInventoryBankAccountsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput @@ -1054,7 +865,6 @@ export type InventoryUncheckedCreateWithoutInventoryBankAccountsInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1082,7 +892,6 @@ export type InventoryUpdateWithoutInventoryBankAccountsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput @@ -1091,7 +900,6 @@ export type InventoryUpdateWithoutInventoryBankAccountsInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput } @@ -1104,7 +912,6 @@ export type InventoryUncheckedUpdateWithoutInventoryBankAccountsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput @@ -1113,7 +920,6 @@ export type InventoryUncheckedUpdateWithoutInventoryBankAccountsInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1125,7 +931,6 @@ export type InventoryCreateWithoutPosAccountsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput @@ -1134,7 +939,6 @@ export type InventoryCreateWithoutPosAccountsInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1147,7 +951,6 @@ export type InventoryUncheckedCreateWithoutPosAccountsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput @@ -1156,7 +959,6 @@ export type InventoryUncheckedCreateWithoutPosAccountsInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1184,7 +986,6 @@ export type InventoryUpdateWithoutPosAccountsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput @@ -1193,7 +994,6 @@ export type InventoryUpdateWithoutPosAccountsInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1206,7 +1006,6 @@ export type InventoryUncheckedUpdateWithoutPosAccountsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput @@ -1215,7 +1014,6 @@ export type InventoryUncheckedUpdateWithoutPosAccountsInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1227,7 +1025,6 @@ export type InventoryCreateWithoutSalesInvoicesInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput @@ -1235,7 +1032,6 @@ export type InventoryCreateWithoutSalesInvoicesInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1249,7 +1045,6 @@ export type InventoryUncheckedCreateWithoutSalesInvoicesInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput @@ -1257,7 +1052,6 @@ export type InventoryUncheckedCreateWithoutSalesInvoicesInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1286,7 +1080,6 @@ export type InventoryUpdateWithoutSalesInvoicesInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput @@ -1294,7 +1087,6 @@ export type InventoryUpdateWithoutSalesInvoicesInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1308,7 +1100,6 @@ export type InventoryUncheckedUpdateWithoutSalesInvoicesInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput @@ -1316,7 +1107,6 @@ export type InventoryUncheckedUpdateWithoutSalesInvoicesInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1329,7 +1119,6 @@ export type InventoryCreateWithoutPurchaseReceiptsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput @@ -1337,7 +1126,6 @@ export type InventoryCreateWithoutPurchaseReceiptsInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1351,7 +1139,6 @@ export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput @@ -1359,7 +1146,6 @@ export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1388,7 +1174,6 @@ export type InventoryUpdateWithoutPurchaseReceiptsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput @@ -1396,7 +1181,6 @@ export type InventoryUpdateWithoutPurchaseReceiptsInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1410,7 +1194,6 @@ export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput @@ -1418,7 +1201,6 @@ export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1431,7 +1213,6 @@ export type InventoryCreateWithoutCounterStockMovementsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput @@ -1439,7 +1220,6 @@ export type InventoryCreateWithoutCounterStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1453,7 +1233,6 @@ export type InventoryUncheckedCreateWithoutCounterStockMovementsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput @@ -1461,7 +1240,6 @@ export type InventoryUncheckedCreateWithoutCounterStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1479,7 +1257,6 @@ export type InventoryCreateWithoutStockMovementsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput @@ -1487,7 +1264,6 @@ export type InventoryCreateWithoutStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1501,7 +1277,6 @@ export type InventoryUncheckedCreateWithoutStockMovementsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput @@ -1509,7 +1284,6 @@ export type InventoryUncheckedCreateWithoutStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1538,7 +1312,6 @@ export type InventoryUpdateWithoutCounterStockMovementsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput @@ -1546,7 +1319,6 @@ export type InventoryUpdateWithoutCounterStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1560,7 +1332,6 @@ export type InventoryUncheckedUpdateWithoutCounterStockMovementsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput @@ -1568,7 +1339,6 @@ export type InventoryUncheckedUpdateWithoutCounterStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1592,7 +1362,6 @@ export type InventoryUpdateWithoutStockMovementsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput @@ -1600,7 +1369,6 @@ export type InventoryUpdateWithoutStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1614,7 +1382,6 @@ export type InventoryUncheckedUpdateWithoutStockMovementsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput @@ -1622,7 +1389,6 @@ export type InventoryUncheckedUpdateWithoutStockMovementsInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1635,7 +1401,6 @@ export type InventoryCreateWithoutStockBalancesInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput @@ -1643,7 +1408,6 @@ export type InventoryCreateWithoutStockBalancesInput = { stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1657,7 +1421,6 @@ export type InventoryUncheckedCreateWithoutStockBalancesInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput @@ -1665,7 +1428,6 @@ export type InventoryUncheckedCreateWithoutStockBalancesInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1694,7 +1456,6 @@ export type InventoryUpdateWithoutStockBalancesInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput @@ -1702,7 +1463,6 @@ export type InventoryUpdateWithoutStockBalancesInput = { stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1716,7 +1476,6 @@ export type InventoryUncheckedUpdateWithoutStockBalancesInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput @@ -1724,7 +1483,6 @@ export type InventoryUncheckedUpdateWithoutStockBalancesInput = { stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } @@ -1737,7 +1495,6 @@ export type InventoryCreateWithoutStockAdjustmentsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput @@ -1745,7 +1502,6 @@ export type InventoryCreateWithoutStockAdjustmentsInput = { stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput } @@ -1759,7 +1515,6 @@ export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = { updatedAt?: Date | string deletedAt?: Date | string | null isPointOfSale?: boolean - bankAccountId?: number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput @@ -1767,7 +1522,6 @@ export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = { stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput - bankAccounts?: Prisma.BankAccountUncheckedCreateNestedManyWithoutInventoriesInput posAccounts?: Prisma.PosAccountUncheckedCreateNestedManyWithoutInventoryInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput } @@ -1796,7 +1550,6 @@ export type InventoryUpdateWithoutStockAdjustmentsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput @@ -1804,7 +1557,6 @@ export type InventoryUpdateWithoutStockAdjustmentsInput = { stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput } @@ -1818,7 +1570,6 @@ export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = { updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput @@ -1826,66 +1577,10 @@ export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = { stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput - bankAccounts?: Prisma.BankAccountUncheckedUpdateManyWithoutInventoriesNestedInput posAccounts?: Prisma.PosAccountUncheckedUpdateManyWithoutInventoryNestedInput inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput } -export type InventoryUpdateWithoutBankAccountsInput = { - 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 - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput - 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 InventoryUncheckedUpdateWithoutBankAccountsInput = { - 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 - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null - inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput - 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 InventoryUncheckedUpdateManyWithoutBankAccountsInput = { - 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 - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null -} - /** * Count Type InventoryCountOutputType @@ -1900,7 +1595,6 @@ export type InventoryCountOutputType = { stockBalances: number counterStockMovements: number stockMovements: number - bankAccounts: number posAccounts: number inventoryBankAccounts: number } @@ -1914,7 +1608,6 @@ export type InventoryCountOutputTypeSelect = { - where?: Prisma.BankAccountWhereInput -} - /** * InventoryCountOutputType without action */ @@ -2016,7 +1702,6 @@ export type InventorySelect inventoryTransfersTo?: boolean | Prisma.Inventory$inventoryTransfersToArgs purchaseReceipts?: boolean | Prisma.Inventory$purchaseReceiptsArgs @@ -2025,7 +1710,6 @@ export type InventorySelect counterStockMovements?: boolean | Prisma.Inventory$counterStockMovementsArgs stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs - bankAccounts?: boolean | Prisma.Inventory$bankAccountsArgs posAccounts?: boolean | Prisma.Inventory$posAccountsArgs inventoryBankAccounts?: boolean | Prisma.Inventory$inventoryBankAccountsArgs _count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs @@ -2042,10 +1726,9 @@ export type InventorySelectScalar = { updatedAt?: boolean deletedAt?: boolean isPointOfSale?: boolean - bankAccountId?: boolean } -export type InventoryOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "location" | "isActive" | "createdAt" | "updatedAt" | "deletedAt" | "isPointOfSale" | "bankAccountId", ExtArgs["result"]["inventory"]> +export type InventoryOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "location" | "isActive" | "createdAt" | "updatedAt" | "deletedAt" | "isPointOfSale", ExtArgs["result"]["inventory"]> export type InventoryInclude = { inventoryTransfersFrom?: boolean | Prisma.Inventory$inventoryTransfersFromArgs inventoryTransfersTo?: boolean | Prisma.Inventory$inventoryTransfersToArgs @@ -2055,7 +1738,6 @@ export type InventoryInclude counterStockMovements?: boolean | Prisma.Inventory$counterStockMovementsArgs stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs - bankAccounts?: boolean | Prisma.Inventory$bankAccountsArgs posAccounts?: boolean | Prisma.Inventory$posAccountsArgs inventoryBankAccounts?: boolean | Prisma.Inventory$inventoryBankAccountsArgs _count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs @@ -2072,7 +1754,6 @@ export type $InventoryPayload[] counterStockMovements: Prisma.$StockMovementPayload[] stockMovements: Prisma.$StockMovementPayload[] - bankAccounts: Prisma.$BankAccountPayload[] posAccounts: Prisma.$PosAccountPayload[] inventoryBankAccounts: Prisma.$InventoryBankAccountPayload[] } @@ -2085,7 +1766,6 @@ export type $InventoryPayload composites: {} } @@ -2434,7 +2114,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> - bankAccounts = {}>(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> /** @@ -2474,7 +2153,6 @@ export interface InventoryFieldRefs { readonly updatedAt: Prisma.FieldRef<"Inventory", 'DateTime'> readonly deletedAt: Prisma.FieldRef<"Inventory", 'DateTime'> readonly isPointOfSale: Prisma.FieldRef<"Inventory", 'Boolean'> - readonly bankAccountId: Prisma.FieldRef<"Inventory", 'Int'> } @@ -3009,30 +2687,6 @@ export type Inventory$stockMovementsArgs = { - /** - * 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 - orderBy?: Prisma.BankAccountOrderByWithRelationInput | Prisma.BankAccountOrderByWithRelationInput[] - cursor?: Prisma.BankAccountWhereUniqueInput - take?: number - skip?: number - distinct?: Prisma.BankAccountScalarFieldEnum | Prisma.BankAccountScalarFieldEnum[] -} - /** * Inventory.posAccounts */ diff --git a/src/generated/prisma/models/PosAccount.ts b/src/generated/prisma/models/PosAccount.ts index f4ed7fa..d51ddb9 100644 --- a/src/generated/prisma/models/PosAccount.ts +++ b/src/generated/prisma/models/PosAccount.ts @@ -216,7 +216,7 @@ export type PosAccountGroupByOutputType = { name: string code: string description: string | null - bankAccountId: number | null + bankAccountId: number inventoryId: number createdAt: Date updatedAt: Date @@ -251,7 +251,7 @@ export type PosAccountWhereInput = { name?: Prisma.StringFilter<"PosAccount"> | string code?: Prisma.StringFilter<"PosAccount"> | string description?: Prisma.StringNullableFilter<"PosAccount"> | string | null - bankAccountId?: Prisma.IntNullableFilter<"PosAccount"> | number | null + bankAccountId?: Prisma.IntFilter<"PosAccount"> | number inventoryId?: Prisma.IntFilter<"PosAccount"> | number createdAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string updatedAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string @@ -266,7 +266,7 @@ export type PosAccountOrderByWithRelationInput = { name?: Prisma.SortOrder code?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder - bankAccountId?: Prisma.SortOrderInput | Prisma.SortOrder + bankAccountId?: Prisma.SortOrder inventoryId?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder @@ -285,7 +285,7 @@ export type PosAccountWhereUniqueInput = Prisma.AtLeast<{ NOT?: Prisma.PosAccountWhereInput | Prisma.PosAccountWhereInput[] name?: Prisma.StringFilter<"PosAccount"> | string description?: Prisma.StringNullableFilter<"PosAccount"> | string | null - bankAccountId?: Prisma.IntNullableFilter<"PosAccount"> | number | null + bankAccountId?: Prisma.IntFilter<"PosAccount"> | number inventoryId?: Prisma.IntFilter<"PosAccount"> | number createdAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string updatedAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string @@ -300,7 +300,7 @@ export type PosAccountOrderByWithAggregationInput = { name?: Prisma.SortOrder code?: Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder - bankAccountId?: Prisma.SortOrderInput | Prisma.SortOrder + bankAccountId?: Prisma.SortOrder inventoryId?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder @@ -320,7 +320,7 @@ export type PosAccountScalarWhereWithAggregatesInput = { name?: Prisma.StringWithAggregatesFilter<"PosAccount"> | string code?: Prisma.StringWithAggregatesFilter<"PosAccount"> | string description?: Prisma.StringNullableWithAggregatesFilter<"PosAccount"> | string | null - bankAccountId?: Prisma.IntNullableWithAggregatesFilter<"PosAccount"> | number | null + bankAccountId?: Prisma.IntWithAggregatesFilter<"PosAccount"> | number inventoryId?: Prisma.IntWithAggregatesFilter<"PosAccount"> | number createdAt?: Prisma.DateTimeWithAggregatesFilter<"PosAccount"> | Date | string updatedAt?: Prisma.DateTimeWithAggregatesFilter<"PosAccount"> | Date | string @@ -344,7 +344,7 @@ export type PosAccountUncheckedCreateInput = { name: string code: string description?: string | null - bankAccountId?: number | null + bankAccountId: number inventoryId: number createdAt?: Date | string updatedAt?: Date | string @@ -368,7 +368,7 @@ export type PosAccountUncheckedUpdateInput = { name?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number inventoryId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -380,7 +380,7 @@ export type PosAccountCreateManyInput = { name: string code: string description?: string | null - bankAccountId?: number | null + bankAccountId: number inventoryId: number createdAt?: Date | string updatedAt?: Date | string @@ -401,7 +401,7 @@ export type PosAccountUncheckedUpdateManyInput = { name?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number inventoryId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string @@ -654,7 +654,7 @@ export type PosAccountScalarWhereInput = { name?: Prisma.StringFilter<"PosAccount"> | string code?: Prisma.StringFilter<"PosAccount"> | string description?: Prisma.StringNullableFilter<"PosAccount"> | string | null - bankAccountId?: Prisma.IntNullableFilter<"PosAccount"> | number | null + bankAccountId?: Prisma.IntFilter<"PosAccount"> | number inventoryId?: Prisma.IntFilter<"PosAccount"> | number createdAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string updatedAt?: Prisma.DateTimeFilter<"PosAccount"> | Date | string @@ -677,7 +677,7 @@ export type PosAccountUncheckedCreateWithoutInventoryInput = { name: string code: string description?: string | null - bankAccountId?: number | null + bankAccountId: number createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null @@ -805,7 +805,7 @@ export type PosAccountCreateManyInventoryInput = { name: string code: string description?: string | null - bankAccountId?: number | null + bankAccountId: number createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null @@ -827,7 +827,7 @@ export type PosAccountUncheckedUpdateWithoutInventoryInput = { name?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null @@ -838,7 +838,7 @@ export type PosAccountUncheckedUpdateManyWithoutInventoryInput = { name?: Prisma.StringFieldUpdateOperationsInput | string code?: Prisma.StringFieldUpdateOperationsInput | string description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - bankAccountId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + bankAccountId?: Prisma.IntFieldUpdateOperationsInput | number createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null @@ -935,7 +935,7 @@ export type $PosAccountPayload connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutItemsInput diff --git a/src/inventories/inventories.module.ts b/src/inventories/inventories.module.ts deleted file mode 100644 index eb4f81a..0000000 --- a/src/inventories/inventories.module.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Module } from '@nestjs/common' -import { PrismaModule } from '../prisma/prisma.module' -import { InventoriesController } from './inventories.controller' -import { InventoriesService } from './inventories.service' - -@Module({ - imports: [PrismaModule], - controllers: [InventoriesController], - providers: [InventoriesService], -}) -export class InventoriesModule {} diff --git a/src/modules/inventories/bank-accounts/dto/update-inventory-bank-account.dto.ts b/src/modules/inventories/bank-accounts/dto/update-inventory-bank-account.dto.ts new file mode 100644 index 0000000..da7da72 --- /dev/null +++ b/src/modules/inventories/bank-accounts/dto/update-inventory-bank-account.dto.ts @@ -0,0 +1,6 @@ +import { IsNumber } from 'class-validator' + +export class UpdateInventoryBankAccountDto { + @IsNumber() + bankAccountId: number +} diff --git a/src/modules/inventories/bank-accounts/inventory-bank-accounts.controller.ts b/src/modules/inventories/bank-accounts/inventory-bank-accounts.controller.ts new file mode 100644 index 0000000..06d1dec --- /dev/null +++ b/src/modules/inventories/bank-accounts/inventory-bank-accounts.controller.ts @@ -0,0 +1,38 @@ +import { Body, Controller, Get, Param, Post } from '@nestjs/common' +import { CreateBankAccountDto } from '../../bank-accounts/dto/create-bank-account.dto' +import { UpdateInventoryBankAccountDto } from './dto/update-inventory-bank-account.dto' +import { InventoryBankAccountsService } from './inventory-bank-accounts.service' + +@Controller('inventories/:inventoryId/bank-accounts') +export class InventoryBankAccountsController { + constructor(private readonly bankAccountsService: InventoryBankAccountsService) {} + + @Post() + create( + @Param('inventoryId') inventoryId: string, + @Body() bankAccount: CreateBankAccountDto, + ) { + return this.bankAccountsService.create(Number(inventoryId), bankAccount) + } + + @Get() + findAll(@Param('inventoryId') inventoryId: string) { + return this.bankAccountsService.findAll(Number(inventoryId)) + } + + @Post('/assign') + assign( + @Param('inventoryId') inventoryId: string, + @Body() dto: UpdateInventoryBankAccountDto, + ) { + return this.bankAccountsService.assign(Number(inventoryId), dto.bankAccountId) + } + + @Post('/unassign') + unassign( + @Param('inventoryId') inventoryId: string, + @Body() dto: UpdateInventoryBankAccountDto, + ) { + return this.bankAccountsService.unassign(Number(inventoryId), dto.bankAccountId) + } +} diff --git a/src/modules/inventories/bank-accounts/inventory-bank-accounts.module.ts b/src/modules/inventories/bank-accounts/inventory-bank-accounts.module.ts new file mode 100644 index 0000000..fbe1075 --- /dev/null +++ b/src/modules/inventories/bank-accounts/inventory-bank-accounts.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../../../prisma/prisma.module' +import { InventoryBankAccountsController } from './inventory-bank-accounts.controller' +import { InventoryBankAccountsService } from './inventory-bank-accounts.service' + +@Module({ + imports: [PrismaModule], + controllers: [InventoryBankAccountsController], + providers: [InventoryBankAccountsService], +}) +export class InventoryBankAccountsModule {} diff --git a/src/modules/inventories/bank-accounts/inventory-bank-accounts.service.ts b/src/modules/inventories/bank-accounts/inventory-bank-accounts.service.ts new file mode 100644 index 0000000..8a0994a --- /dev/null +++ b/src/modules/inventories/bank-accounts/inventory-bank-accounts.service.ts @@ -0,0 +1,76 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../../../common/response/response-mapper' +import { PrismaService } from '../../../prisma/prisma.service' +import { CreateBankAccountDto } from '../../bank-accounts/dto/create-bank-account.dto' + +@Injectable() +export class InventoryBankAccountsService { + constructor(private prisma: PrismaService) {} + + async create(inventoryId: number, bankAccount: CreateBankAccountDto) { + return this.prisma.bankAccount + .create({ + data: bankAccount, + }) + .then(async res => { + await this.prisma.inventoryBankAccount.create({ + data: { + inventoryId, + bankAccountId: res.id, + }, + }) + return ResponseMapper.create(res) + }) + } + + async findAll(inventoryId: number) { + const items = await this.prisma.inventoryBankAccount.findMany({ + where: { + inventoryId, + }, + include: { + bankAccount: { + include: { + branch: { + include: { + bank: { + select: { id: true, name: true, shortName: true }, + }, + }, + }, + }, + }, + posAccounts: { + select: { id: true, name: true, code: true }, + }, + }, + omit: { + bankAccountId: true, + inventoryId: true, + }, + }) + return ResponseMapper.list( + items.map(item => ({ posAccounts: item.posAccounts, ...item.bankAccount })), + ) + } + + async assign(inventoryId: number, bankAccountId: number) { + const item = await this.prisma.inventoryBankAccount.create({ + data: { + inventoryId, + bankAccountId, + }, + }) + return ResponseMapper.create(item) + } + + async unassign(inventoryId: number, bankAccountId: number) { + const item = await this.prisma.inventoryBankAccount.deleteMany({ + where: { + inventoryId, + bankAccountId, + }, + }) + return ResponseMapper.single(item) + } +} diff --git a/src/inventories/dto/create-inventory.dto.ts b/src/modules/inventories/index/dto/create-inventory.dto.ts similarity index 100% rename from src/inventories/dto/create-inventory.dto.ts rename to src/modules/inventories/index/dto/create-inventory.dto.ts diff --git a/src/inventories/dto/update-inventory.dto.ts b/src/modules/inventories/index/dto/update-inventory.dto.ts similarity index 100% rename from src/inventories/dto/update-inventory.dto.ts rename to src/modules/inventories/index/dto/update-inventory.dto.ts diff --git a/src/inventories/inventories.controller.ts b/src/modules/inventories/index/inventories.controller.ts similarity index 96% rename from src/inventories/inventories.controller.ts rename to src/modules/inventories/index/inventories.controller.ts index a35c50f..5b9a761 100644 --- a/src/inventories/inventories.controller.ts +++ b/src/modules/inventories/index/inventories.controller.ts @@ -1,6 +1,6 @@ import { Body, Controller, Delete, Get, Param, Patch, Post, Query } from '@nestjs/common' import { ApiQuery } from '@nestjs/swagger' -import { MovementType } from '../generated/prisma/enums' +import { MovementType } from '../../../generated/prisma/enums' import { CreateInventoryDto } from './dto/create-inventory.dto' import { UpdateInventoryDto } from './dto/update-inventory.dto' import { InventoriesService } from './inventories.service' diff --git a/src/inventories/inventories.service.ts b/src/modules/inventories/index/inventories.service.ts similarity index 92% rename from src/inventories/inventories.service.ts rename to src/modules/inventories/index/inventories.service.ts index d1b65ea..ee7defc 100644 --- a/src/inventories/inventories.service.ts +++ b/src/modules/inventories/index/inventories.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common' -import { ResponseMapper } from '../common/response/response-mapper' -import { MovementType } from '../generated/prisma/enums' -import { PrismaService } from '../prisma/prisma.service' +import { ResponseMapper } from '../../../common/response/response-mapper' +import { MovementType } from '../../../generated/prisma/enums' +import { PrismaService } from '../../../prisma/prisma.service' @Injectable() export class InventoriesService { @@ -75,7 +75,12 @@ export class InventoriesService { groups.map(async group => { const movements = await this.prisma.stockMovement.findMany({ where: { inventoryId, referenceId: group.referenceId, type }, - include: { product: true }, + include: { + product: true, + counterInventory: { + select: { id: true, name: true }, + }, + }, }) let info = null as any const mapped = movements.map(movement => { @@ -89,6 +94,7 @@ export class InventoriesService { totalCost: Number(movement.totalCost), referenceType: movement.referenceType, referenceId: movement.referenceId, + counterInventory: movement.counterInventory, createdAt: movement.createdAt, } } else { diff --git a/src/inventories/models/response-inventory.dto.ts b/src/modules/inventories/index/models/response-inventory.dto.ts similarity index 100% rename from src/inventories/models/response-inventory.dto.ts rename to src/modules/inventories/index/models/response-inventory.dto.ts diff --git a/src/modules/inventories/inventories.module.ts b/src/modules/inventories/inventories.module.ts new file mode 100644 index 0000000..443d1d7 --- /dev/null +++ b/src/modules/inventories/inventories.module.ts @@ -0,0 +1,13 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../../prisma/prisma.module' +import { InventoryBankAccountsModule } from './bank-accounts/inventory-bank-accounts.module' +import { InventoriesController } from './index/inventories.controller' +import { InventoriesService } from './index/inventories.service' +import { PosAccountsModule } from './pos-accounts/pos-accounts.module' + +@Module({ + imports: [PrismaModule, InventoryBankAccountsModule, PosAccountsModule], + controllers: [InventoriesController], + providers: [InventoriesService], +}) +export class InventoriesModule {} diff --git a/src/modules/inventories/pos-accounts/dto/create-pos-accounts.dto.ts b/src/modules/inventories/pos-accounts/dto/create-pos-accounts.dto.ts new file mode 100644 index 0000000..704550a --- /dev/null +++ b/src/modules/inventories/pos-accounts/dto/create-pos-accounts.dto.ts @@ -0,0 +1,16 @@ +import { IsInt, IsOptional, IsString } from 'class-validator' + +export class CreatePosAccountDto { + @IsString() + name: string + + @IsString() + code: string + + @IsOptional() + @IsString() + description?: string + + @IsInt() + bankAccountId: number +} diff --git a/src/modules/inventories/pos-accounts/dto/update-pos-accounts.dto.ts b/src/modules/inventories/pos-accounts/dto/update-pos-accounts.dto.ts new file mode 100644 index 0000000..3445d65 --- /dev/null +++ b/src/modules/inventories/pos-accounts/dto/update-pos-accounts.dto.ts @@ -0,0 +1,8 @@ +import { PartialType } from '@nestjs/swagger' +import { IsInt } from 'class-validator' +import { CreatePosAccountDto } from './create-pos-accounts.dto' + +export class UpdatePosAccountDto extends PartialType(CreatePosAccountDto) { + @IsInt() + bankAccountId: number +} diff --git a/src/modules/inventories/pos-accounts/pos-accounts.controller.ts b/src/modules/inventories/pos-accounts/pos-accounts.controller.ts new file mode 100644 index 0000000..168031f --- /dev/null +++ b/src/modules/inventories/pos-accounts/pos-accounts.controller.ts @@ -0,0 +1,45 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreatePosAccountDto } from './dto/create-pos-accounts.dto' +import { UpdatePosAccountDto } from './dto/update-pos-accounts.dto' +import { PosAccountsService } from './pos-accounts.service' + +@Controller('inventories/:inventoryId/pos-accounts') +export class PosAccountsController { + constructor(private readonly posAccountsService: PosAccountsService) {} + + @Post() + create( + @Param('inventoryId') inventoryId: string, + @Body() createPosAccountDto: CreatePosAccountDto, + ) { + return this.posAccountsService.create(Number(inventoryId), createPosAccountDto) + } + + @Get() + findAll(@Param('inventoryId') inventoryId: string) { + return this.posAccountsService.findAll(Number(inventoryId)) + } + + @Get(':id') + findOne(@Param('inventoryId') inventoryId: string, @Param('id') id: string) { + return this.posAccountsService.findOne(Number(inventoryId), Number(id)) + } + + @Patch(':id') + update( + @Param('inventoryId') inventoryId: string, + @Param('id') id: string, + @Body() updatePosAccountDto: UpdatePosAccountDto, + ) { + return this.posAccountsService.update( + Number(inventoryId), + Number(id), + updatePosAccountDto, + ) + } + + @Delete(':id') + remove(@Param('inventoryId') inventoryId: string, @Param('id') id: string) { + return this.posAccountsService.remove(Number(inventoryId), Number(id)) + } +} diff --git a/src/modules/inventories/pos-accounts/pos-accounts.module.ts b/src/modules/inventories/pos-accounts/pos-accounts.module.ts new file mode 100644 index 0000000..0f9d179 --- /dev/null +++ b/src/modules/inventories/pos-accounts/pos-accounts.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../../../prisma/prisma.module' +import { PosAccountsController } from './pos-accounts.controller' +import { PosAccountsService } from './pos-accounts.service' + +@Module({ + imports: [PrismaModule], + controllers: [PosAccountsController], + providers: [PosAccountsService], +}) +export class PosAccountsModule {} diff --git a/src/modules/inventories/pos-accounts/pos-accounts.service.ts b/src/modules/inventories/pos-accounts/pos-accounts.service.ts new file mode 100644 index 0000000..610efa4 --- /dev/null +++ b/src/modules/inventories/pos-accounts/pos-accounts.service.ts @@ -0,0 +1,120 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../../../common/response/response-mapper' +import { PrismaService } from '../../../prisma/prisma.service' +import { CreatePosAccountDto } from './dto/create-pos-accounts.dto' +import { UpdatePosAccountDto } from './dto/update-pos-accounts.dto' + +@Injectable() +export class PosAccountsService { + constructor(private prisma: PrismaService) {} + + private async validateBankAccountInventoryLink( + inventoryId: number, + bankAccountId: number, + ) { + const link = await this.prisma.inventoryBankAccount.findUnique({ + where: { + inventoryId_bankAccountId: { + inventoryId, + bankAccountId, + }, + }, + }) + if (!link) { + throw new Error('حساب بانکی به این انبار متصل نیست') + } + } + + async create(inventoryId: number, dto: CreatePosAccountDto) { + if (dto.bankAccountId) { + await this.validateBankAccountInventoryLink(inventoryId, dto.bankAccountId) + } + const item = await this.prisma.posAccount.create({ + data: { + ...dto, + inventoryId, + }, + }) + return ResponseMapper.create(item) + } + + async findAll(inventoryId: number) { + const items = await this.prisma.posAccount.findMany({ + where: { + inventoryId, + }, + include: { + bankAccount: { + select: { + id: true, + name: true, + accountNumber: true, + branch: { + select: { + id: true, + name: true, + bank: { select: { id: true, name: true } }, + }, + }, + }, + }, + }, + omit: { + inventoryId: true, + bankAccountId: true, + }, + }) + return ResponseMapper.list(items) + } + + async findOne(inventoryId: number, id: number) { + const item = await this.prisma.posAccount.findFirst({ + where: { + id, + inventoryId, + }, + include: { + bankAccount: { + select: { + id: true, + name: true, + accountNumber: true, + branch: { + select: { + id: true, + name: true, + bank: { select: { id: true, name: true } }, + }, + }, + }, + }, + }, + omit: { + inventoryId: true, + bankAccountId: true, + }, + }) + return ResponseMapper.single(item) + } + + async update(inventoryId: number, id: number, dto: UpdatePosAccountDto) { + await this.validateBankAccountInventoryLink(inventoryId, dto.bankAccountId) + + const item = await this.prisma.posAccount.update({ + where: { + id, + }, + data: dto, + }) + return ResponseMapper.update(item) + } + + async remove(inventoryId: number, id: number) { + const item = await this.prisma.posAccount.delete({ + where: { + id, + }, + }) + return ResponseMapper.delete(item) + } +}