41d7dd8802
- Created initial database schema with tables for Users, Roles, Products, and related entities. - Added foreign key constraints to maintain data integrity across tables. - Implemented triggers for managing stock movements on insert, update, and delete operations. - Developed scripts to dump existing triggers and pull trigger definitions from the database.
423 lines
50 KiB
TypeScript
423 lines
50 KiB
TypeScript
|
|
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
/* eslint-disable */
|
|
// biome-ignore-all lint: generated file
|
|
// @ts-nocheck
|
|
/*
|
|
* WARNING: This is an internal file that is subject to change!
|
|
*
|
|
* 🛑 Under no circumstances should you import this file directly! 🛑
|
|
*
|
|
* Please import the `PrismaClient` class from the `client.ts` file instead.
|
|
*/
|
|
|
|
import * as runtime from "@prisma/client/runtime/client"
|
|
import type * as Prisma from "./prismaNamespace.js"
|
|
|
|
|
|
const config: runtime.GetPrismaClientConfig = {
|
|
"previewFeatures": [
|
|
"views"
|
|
],
|
|
"clientVersion": "7.1.0",
|
|
"engineVersion": "ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba",
|
|
"activeProvider": "mysql",
|
|
"inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n previewFeatures = [\"views\"]\n moduleFormat = \"cjs\"\n}\n\ndatasource db {\n provider = \"mysql\"\n}\n\nmodel 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 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 @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 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 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 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 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 productCharges ProductCharge[] @relation(\"Supplier_Product_Charges\")\n purchaseReceipts PurchaseReceipt[]\n\n @@map(\"Suppliers\")\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\n @@map(\"Customers\")\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 inventoryTransfersFrom InventoryTransfer[] @relation(\"Inventory_From\")\n inventoryTransfersTo InventoryTransfer[] @relation(\"Inventory_To\")\n productCharges ProductCharge[] @relation(\"Inventory_Product_Charges\")\n purchaseReceipts PurchaseReceipt[]\n stockAdjustments StockAdjustment[] @relation(\"Inventory_Stock_Adjustments\")\n stockMovements StockMovement[] @relation(\"StockMovement_Inventory\")\n\n @@map(\"Inventories\")\n}\n\nmodel Store {\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\n @@map(\"Stores\")\n}\n\nmodel ProductCharge {\n id Int @id @default(autoincrement())\n count Decimal @db.Decimal(10, 2)\n fee Decimal @db.Decimal(10, 2)\n totalAmount Decimal @db.Decimal(10, 2)\n isSettled Boolean @default(false)\n buyAt DateTime? @db.Timestamp(0)\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 productId Int\n inventoryId Int\n supplierId Int\n inventory Inventory @relation(\"Inventory_Product_Charges\", fields: [inventoryId], references: [id], onUpdate: NoAction)\n product Product @relation(\"Product_Charges\", fields: [productId], references: [id], onUpdate: NoAction)\n supplier Supplier @relation(\"Supplier_Product_Charges\", fields: [supplierId], references: [id], onUpdate: NoAction)\n\n @@index([inventoryId], map: \"Product_Charges_inventoryId_fkey\")\n @@index([productId], map: \"Product_Charges_productId_fkey\")\n @@index([supplierId], map: \"Product_Charges_supplierId_fkey\")\n @@map(\"Product_Charges\")\n}\n\nmodel Order {\n id Int @id @default(autoincrement())\n orderNumber String @unique @db.VarChar(100)\n status OrderStatus @default(pending)\n paymentMethod paymentMethod @default(card)\n totalAmount Decimal @db.Decimal(10, 2)\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 PurchaseReceipt {\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 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\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 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 items SalesInvoiceItem[] @relation(\"SalesInvoice_Items\")\n customer Customer? @relation(\"Customer_Sales_Invoices\", fields: [customerId], references: [id])\n\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 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 inventory Inventory @relation(\"StockMovement_Inventory\", fields: [inventoryId], references: [id])\n product Product @relation(\"StockMovement_Product\", fields: [productId], references: [id])\n\n @@index([inventoryId], map: \"Stock_Movements_inventoryId_fkey\")\n @@index([productId], map: \"Stock_Movements_productId_fkey\")\n @@map(\"Stock_Movements\")\n}\n\nmodel StockBalance {\n quantity Decimal\n totalCost Decimal\n updatedAt DateTime @default(now()) @updatedAt @db.Timestamp(0)\n ProductId Int @id\n avgCost Decimal\n\n @@map(\"Stock_Balance\")\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 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\nview StockMovements_View {\n id Int @default(0)\n productId Int\n type stock_movements_view_type\n quantity Decimal @db.Decimal(10, 2)\n fee Decimal @db.Decimal(10, 2)\n totalCost Decimal @db.Decimal(10, 2)\n referenceId String\n referenceType stock_movements_view_referenceType\n createdAt DateTime @default(now()) @db.Timestamp(0)\n current_stock Decimal?\n current_avg_cost Decimal?\n\n @@map(\"Stock_Movements_View\")\n @@ignore\n}\n\nview inventory_overview {\n ProductId Int\n stock_quantity Decimal\n avgCost Decimal\n totalCost Decimal\n updatedAt DateTime @default(now()) @db.Timestamp(0)\n\n @@map(\"Inventory_Overview\")\n}\n\nview stock_cardex {\n productId Int\n movement_id Int @default(0)\n type stock_cardex_type\n quantity Decimal @db.Decimal(10, 2)\n fee Decimal @db.Decimal(10, 2)\n totalCost Decimal @db.Decimal(10, 2)\n balance_quantity Decimal?\n balance_avg_cost Decimal?\n createdAt DateTime @default(now()) @db.Timestamp(0)\n\n @@map(\"Stock_Cardex\")\n}\n\nview stock_view {\n productId Int\n inventoryId Int\n stock Decimal? @db.Decimal(32, 2)\n\n @@map(\"Stock_View\")\n}\n\nenum OrderStatus {\n pending\n reject\n done\n}\n\nenum paymentMethod {\n cash\n card\n}\n\nenum MovementType {\n IN\n OUT\n ADJUST\n}\n\nenum MovementReferenceType {\n PURCHASE\n SALES\n ADJUSTMENT\n}\n\nenum stock_cardex_type {\n IN\n OUT\n ADJUST\n}\n\nenum stock_movements_view_type {\n IN\n OUT\n ADJUST\n}\n\nenum stock_movements_view_referenceType {\n PURCHASE\n SALES\n ADJUSTMENT\n}\n",
|
|
"runtimeDataModel": {
|
|
"models": {},
|
|
"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\":\"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\"},\"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\":\"inventoryTransferItems\",\"kind\":\"object\",\"type\":\"InventoryTransferItem\",\"relationName\":\"InventoryTransferItem_Product\"},{\"name\":\"productCharges\",\"kind\":\"object\",\"type\":\"ProductCharge\",\"relationName\":\"Product_Charges\"},{\"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\":\"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\"},\"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\":\"productCharges\",\"kind\":\"object\",\"type\":\"ProductCharge\",\"relationName\":\"Supplier_Product_Charges\"},{\"name\":\"purchaseReceipts\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"PurchaseReceiptToSupplier\"}],\"dbName\":\"Suppliers\"},\"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\"}],\"dbName\":\"Customers\"},\"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\":\"inventoryTransfersFrom\",\"kind\":\"object\",\"type\":\"InventoryTransfer\",\"relationName\":\"Inventory_From\"},{\"name\":\"inventoryTransfersTo\",\"kind\":\"object\",\"type\":\"InventoryTransfer\",\"relationName\":\"Inventory_To\"},{\"name\":\"productCharges\",\"kind\":\"object\",\"type\":\"ProductCharge\",\"relationName\":\"Inventory_Product_Charges\"},{\"name\":\"purchaseReceipts\",\"kind\":\"object\",\"type\":\"PurchaseReceipt\",\"relationName\":\"InventoryToPurchaseReceipt\"},{\"name\":\"stockAdjustments\",\"kind\":\"object\",\"type\":\"StockAdjustment\",\"relationName\":\"Inventory_Stock_Adjustments\"},{\"name\":\"stockMovements\",\"kind\":\"object\",\"type\":\"StockMovement\",\"relationName\":\"StockMovement_Inventory\"}],\"dbName\":\"Inventories\"},\"Store\":{\"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\"}],\"dbName\":\"Stores\"},\"ProductCharge\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"count\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"fee\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"isSettled\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"buyAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"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\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"supplierId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"Inventory_Product_Charges\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_Charges\"},{\"name\":\"supplier\",\"kind\":\"object\",\"type\":\"Supplier\",\"relationName\":\"Supplier_Product_Charges\"}],\"dbName\":\"Product_Charges\"},\"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\":\"paymentMethod\"},{\"name\":\"totalAmount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"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\"},\"PurchaseReceipt\":{\"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\":\"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\"}],\"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\"},\"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\":\"items\",\"kind\":\"object\",\"type\":\"SalesInvoiceItem\",\"relationName\":\"SalesInvoice_Items\"},{\"name\":\"customer\",\"kind\":\"object\",\"type\":\"Customer\",\"relationName\":\"Customer_Sales_Invoices\"}],\"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\"},\"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\":\"inventory\",\"kind\":\"object\",\"type\":\"Inventory\",\"relationName\":\"StockMovement_Inventory\"},{\"name\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"StockMovement_Product\"}],\"dbName\":\"Stock_Movements\"},\"StockBalance\":{\"fields\":[{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"ProductId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"avgCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"}],\"dbName\":\"Stock_Balance\"},\"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\"},\"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\"},\"inventory_overview\":{\"fields\":[{\"name\":\"ProductId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"stock_quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"avgCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"Inventory_Overview\"},\"stock_cardex\":{\"fields\":[{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"movement_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"type\",\"kind\":\"enum\",\"type\":\"stock_cardex_type\"},{\"name\":\"quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"fee\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"totalCost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"balance_quantity\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"balance_avg_cost\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"Stock_Cardex\"},\"stock_view\":{\"fields\":[{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"stock\",\"kind\":\"scalar\",\"type\":\"Decimal\"}],\"dbName\":\"Stock_View\"}},\"enums\":{},\"types\":{}}")
|
|
|
|
async function decodeBase64AsWasm(wasmBase64: string): Promise<WebAssembly.Module> {
|
|
const { Buffer } = await import('node:buffer')
|
|
const wasmArray = Buffer.from(wasmBase64, 'base64')
|
|
return new WebAssembly.Module(wasmArray)
|
|
}
|
|
|
|
config.compilerWasm = {
|
|
getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.mysql.js"),
|
|
|
|
getQueryCompilerWasmModule: async () => {
|
|
const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.mysql.wasm-base64.js")
|
|
return await decodeBase64AsWasm(wasm)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export type LogOptions<ClientOptions extends Prisma.PrismaClientOptions> =
|
|
'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array<Prisma.LogLevel | Prisma.LogDefinition> ? Prisma.GetEvents<ClientOptions['log']> : never : never
|
|
|
|
export interface PrismaClientConstructor {
|
|
/**
|
|
* ## Prisma Client
|
|
*
|
|
* Type-safe database client for TypeScript
|
|
* @example
|
|
* ```
|
|
* const prisma = new PrismaClient()
|
|
* // Fetch zero or more Users
|
|
* const users = await prisma.user.findMany()
|
|
* ```
|
|
*
|
|
* Read more in our [docs](https://pris.ly/d/client).
|
|
*/
|
|
|
|
new <
|
|
Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions,
|
|
LogOpts extends LogOptions<Options> = LogOptions<Options>,
|
|
OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'],
|
|
ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
>(options: Prisma.Subset<Options, Prisma.PrismaClientOptions> ): PrismaClient<LogOpts, OmitOpts, ExtArgs>
|
|
}
|
|
|
|
/**
|
|
* ## Prisma Client
|
|
*
|
|
* Type-safe database client for TypeScript
|
|
* @example
|
|
* ```
|
|
* const prisma = new PrismaClient()
|
|
* // Fetch zero or more Users
|
|
* const users = await prisma.user.findMany()
|
|
* ```
|
|
*
|
|
* Read more in our [docs](https://pris.ly/d/client).
|
|
*/
|
|
|
|
export interface PrismaClient<
|
|
in LogOpts extends Prisma.LogLevel = never,
|
|
in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = undefined,
|
|
in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs
|
|
> {
|
|
[K: symbol]: { types: Prisma.TypeMap<ExtArgs>['other'] }
|
|
|
|
$on<V extends LogOpts>(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient;
|
|
|
|
/**
|
|
* Connect with the database
|
|
*/
|
|
$connect(): runtime.Types.Utils.JsPromise<void>;
|
|
|
|
/**
|
|
* Disconnect from the database
|
|
*/
|
|
$disconnect(): runtime.Types.Utils.JsPromise<void>;
|
|
|
|
/**
|
|
* Executes a prepared raw query and returns the number of affected rows.
|
|
* @example
|
|
* ```
|
|
* const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};`
|
|
* ```
|
|
*
|
|
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
*/
|
|
$executeRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<number>;
|
|
|
|
/**
|
|
* Executes a raw query and returns the number of affected rows.
|
|
* Susceptible to SQL injections, see documentation.
|
|
* @example
|
|
* ```
|
|
* const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com')
|
|
* ```
|
|
*
|
|
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
*/
|
|
$executeRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<number>;
|
|
|
|
/**
|
|
* Performs a prepared raw query and returns the `SELECT` data.
|
|
* @example
|
|
* ```
|
|
* const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};`
|
|
* ```
|
|
*
|
|
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
*/
|
|
$queryRaw<T = unknown>(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise<T>;
|
|
|
|
/**
|
|
* Performs a raw query and returns the `SELECT` data.
|
|
* Susceptible to SQL injections, see documentation.
|
|
* @example
|
|
* ```
|
|
* const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com')
|
|
* ```
|
|
*
|
|
* Read more in our [docs](https://pris.ly/d/raw-queries).
|
|
*/
|
|
$queryRawUnsafe<T = unknown>(query: string, ...values: any[]): Prisma.PrismaPromise<T>;
|
|
|
|
|
|
/**
|
|
* Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole.
|
|
* @example
|
|
* ```
|
|
* const [george, bob, alice] = await prisma.$transaction([
|
|
* prisma.user.create({ data: { name: 'George' } }),
|
|
* prisma.user.create({ data: { name: 'Bob' } }),
|
|
* prisma.user.create({ data: { name: 'Alice' } }),
|
|
* ])
|
|
* ```
|
|
*
|
|
* Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions).
|
|
*/
|
|
$transaction<P extends Prisma.PrismaPromise<any>[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise<runtime.Types.Utils.UnwrapTuple<P>>
|
|
|
|
$transaction<R>(fn: (prisma: Omit<PrismaClient, runtime.ITXClientDenyList>) => runtime.Types.Utils.JsPromise<R>, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise<R>
|
|
|
|
$extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb<OmitOpts>, ExtArgs, runtime.Types.Utils.Call<Prisma.TypeMapCb<OmitOpts>, {
|
|
extArgs: ExtArgs
|
|
}>>
|
|
|
|
/**
|
|
* `prisma.user`: Exposes CRUD operations for the **User** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Users
|
|
* const users = await prisma.user.findMany()
|
|
* ```
|
|
*/
|
|
get user(): Prisma.UserDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.role`: Exposes CRUD operations for the **Role** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Roles
|
|
* const roles = await prisma.role.findMany()
|
|
* ```
|
|
*/
|
|
get role(): Prisma.RoleDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.productVariant`: Exposes CRUD operations for the **ProductVariant** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more ProductVariants
|
|
* const productVariants = await prisma.productVariant.findMany()
|
|
* ```
|
|
*/
|
|
get productVariant(): Prisma.ProductVariantDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.product`: Exposes CRUD operations for the **Product** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Products
|
|
* const products = await prisma.product.findMany()
|
|
* ```
|
|
*/
|
|
get product(): Prisma.ProductDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.productBrand`: Exposes CRUD operations for the **ProductBrand** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more ProductBrands
|
|
* const productBrands = await prisma.productBrand.findMany()
|
|
* ```
|
|
*/
|
|
get productBrand(): Prisma.ProductBrandDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.productCategory`: Exposes CRUD operations for the **ProductCategory** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more ProductCategories
|
|
* const productCategories = await prisma.productCategory.findMany()
|
|
* ```
|
|
*/
|
|
get productCategory(): Prisma.ProductCategoryDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.supplier`: Exposes CRUD operations for the **Supplier** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Suppliers
|
|
* const suppliers = await prisma.supplier.findMany()
|
|
* ```
|
|
*/
|
|
get supplier(): Prisma.SupplierDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.customer`: Exposes CRUD operations for the **Customer** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Customers
|
|
* const customers = await prisma.customer.findMany()
|
|
* ```
|
|
*/
|
|
get customer(): Prisma.CustomerDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.inventory`: Exposes CRUD operations for the **Inventory** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Inventories
|
|
* const inventories = await prisma.inventory.findMany()
|
|
* ```
|
|
*/
|
|
get inventory(): Prisma.InventoryDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.store`: Exposes CRUD operations for the **Store** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Stores
|
|
* const stores = await prisma.store.findMany()
|
|
* ```
|
|
*/
|
|
get store(): Prisma.StoreDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.productCharge`: Exposes CRUD operations for the **ProductCharge** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more ProductCharges
|
|
* const productCharges = await prisma.productCharge.findMany()
|
|
* ```
|
|
*/
|
|
get productCharge(): Prisma.ProductChargeDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.order`: Exposes CRUD operations for the **Order** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Orders
|
|
* const orders = await prisma.order.findMany()
|
|
* ```
|
|
*/
|
|
get order(): Prisma.OrderDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.purchaseReceipt`: Exposes CRUD operations for the **PurchaseReceipt** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more PurchaseReceipts
|
|
* const purchaseReceipts = await prisma.purchaseReceipt.findMany()
|
|
* ```
|
|
*/
|
|
get purchaseReceipt(): Prisma.PurchaseReceiptDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.purchaseReceiptItem`: Exposes CRUD operations for the **PurchaseReceiptItem** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more PurchaseReceiptItems
|
|
* const purchaseReceiptItems = await prisma.purchaseReceiptItem.findMany()
|
|
* ```
|
|
*/
|
|
get purchaseReceiptItem(): Prisma.PurchaseReceiptItemDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.salesInvoice`: Exposes CRUD operations for the **SalesInvoice** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more SalesInvoices
|
|
* const salesInvoices = await prisma.salesInvoice.findMany()
|
|
* ```
|
|
*/
|
|
get salesInvoice(): Prisma.SalesInvoiceDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.salesInvoiceItem`: Exposes CRUD operations for the **SalesInvoiceItem** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more SalesInvoiceItems
|
|
* const salesInvoiceItems = await prisma.salesInvoiceItem.findMany()
|
|
* ```
|
|
*/
|
|
get salesInvoiceItem(): Prisma.SalesInvoiceItemDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.stockMovement`: Exposes CRUD operations for the **StockMovement** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more StockMovements
|
|
* const stockMovements = await prisma.stockMovement.findMany()
|
|
* ```
|
|
*/
|
|
get stockMovement(): Prisma.StockMovementDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.stockBalance`: Exposes CRUD operations for the **StockBalance** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more StockBalances
|
|
* const stockBalances = await prisma.stockBalance.findMany()
|
|
* ```
|
|
*/
|
|
get stockBalance(): Prisma.StockBalanceDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.inventoryTransfer`: Exposes CRUD operations for the **InventoryTransfer** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more InventoryTransfers
|
|
* const inventoryTransfers = await prisma.inventoryTransfer.findMany()
|
|
* ```
|
|
*/
|
|
get inventoryTransfer(): Prisma.InventoryTransferDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.inventoryTransferItem`: Exposes CRUD operations for the **InventoryTransferItem** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more InventoryTransferItems
|
|
* const inventoryTransferItems = await prisma.inventoryTransferItem.findMany()
|
|
* ```
|
|
*/
|
|
get inventoryTransferItem(): Prisma.InventoryTransferItemDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.stockAdjustment`: Exposes CRUD operations for the **StockAdjustment** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more StockAdjustments
|
|
* const stockAdjustments = await prisma.stockAdjustment.findMany()
|
|
* ```
|
|
*/
|
|
get stockAdjustment(): Prisma.StockAdjustmentDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.inventory_overview`: Exposes CRUD operations for the **inventory_overview** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Inventory_overviews
|
|
* const inventory_overviews = await prisma.inventory_overview.findMany()
|
|
* ```
|
|
*/
|
|
get inventory_overview(): Prisma.inventory_overviewDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.stock_cardex`: Exposes CRUD operations for the **stock_cardex** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Stock_cardexes
|
|
* const stock_cardexes = await prisma.stock_cardex.findMany()
|
|
* ```
|
|
*/
|
|
get stock_cardex(): Prisma.stock_cardexDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
|
|
/**
|
|
* `prisma.stock_view`: Exposes CRUD operations for the **stock_view** model.
|
|
* Example usage:
|
|
* ```ts
|
|
* // Fetch zero or more Stock_views
|
|
* const stock_views = await prisma.stock_view.findMany()
|
|
* ```
|
|
*/
|
|
get stock_view(): Prisma.stock_viewDelegate<ExtArgs, { omit: OmitOpts }>;
|
|
}
|
|
|
|
export function getPrismaClientClass(): PrismaClientConstructor {
|
|
return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor
|
|
}
|