diff --git a/prisma.config.ts b/prisma.config.ts index 2980f15..0867741 100644 --- a/prisma.config.ts +++ b/prisma.config.ts @@ -11,5 +11,6 @@ export default defineConfig({ }, datasource: { url: env('DATABASE_URL'), + shadowDatabaseUrl: env('SHADOW_DATABASE_URL'), }, }) diff --git a/prisma/migrations/20251208150814_init/migration.sql b/prisma/migrations/20251208150814_init/migration.sql new file mode 100644 index 0000000..7a11705 --- /dev/null +++ b/prisma/migrations/20251208150814_init/migration.sql @@ -0,0 +1,284 @@ +/* + Warnings: + + - Made the column `createdAt` on table `Customers` required. This step will fail if there are existing NULL values in that column. + - Made the column `updatedAt` on table `Customers` required. This step will fail if there are existing NULL values in that column. + - Made the column `createdAt` on table `Product_Variants` required. This step will fail if there are existing NULL values in that column. + - Made the column `updatedAt` on table `Product_Variants` required. This step will fail if there are existing NULL values in that column. + - Made the column `createdAt` on table `Suppliers` required. This step will fail if there are existing NULL values in that column. + - Made the column `updatedAt` on table `Suppliers` required. This step will fail if there are existing NULL values in that column. + - Added the required column `updatedAt` to the `Users` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE `Customers` MODIFY `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + MODIFY `updatedAt` TIMESTAMP(0) NOT NULL; + +-- AlterTable +ALTER TABLE `Inventories` ADD COLUMN `deletedAt` TIMESTAMP(0) NULL, + MODIFY `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0); + +-- AlterTable +ALTER TABLE `Product_Variants` MODIFY `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + MODIFY `updatedAt` TIMESTAMP(0) NOT NULL; + +-- AlterTable +ALTER TABLE `Stores` ADD COLUMN `deletedAt` TIMESTAMP(0) NULL, + MODIFY `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0); + +-- AlterTable +ALTER TABLE `Suppliers` MODIFY `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + MODIFY `updatedAt` TIMESTAMP(0) NOT NULL; + +-- AlterTable +ALTER TABLE `Users` ADD COLUMN `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + ADD COLUMN `deletedAt` TIMESTAMP(0) NULL, + ADD COLUMN `updatedAt` TIMESTAMP(0) NOT NULL; + +-- CreateTable +CREATE TABLE `Product_Charges` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `count` DECIMAL(10, 2) NOT NULL, + `fee` DECIMAL(10, 2) NOT NULL, + `totalAmount` DECIMAL(10, 2) NOT NULL, + `isSettled` BOOLEAN NOT NULL DEFAULT false, + `buyAt` TIMESTAMP(0) NULL, + `description` TEXT NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `updatedAt` TIMESTAMP(0) NOT NULL, + `deletedAt` TIMESTAMP(0) NULL, + `productId` INTEGER NOT NULL, + `inventoryId` INTEGER NOT NULL, + `supplierId` INTEGER NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Orders` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `orderNumber` VARCHAR(100) NOT NULL, + `status` ENUM('pending', 'reject', 'done') NOT NULL DEFAULT 'pending', + `paymentMethod` ENUM('cash', 'card') NOT NULL DEFAULT 'card', + `totalAmount` DECIMAL(10, 2) NOT NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `updatedAt` TIMESTAMP(0) NOT NULL, + `deletedAt` TIMESTAMP(0) NULL, + `customerId` INTEGER NOT NULL, + + UNIQUE INDEX `Orders_orderNumber_key`(`orderNumber`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Purchase_Receipts` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `code` VARCHAR(100) NOT NULL, + `totalAmount` DECIMAL(10, 2) NOT NULL, + `description` TEXT NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `updatedAt` TIMESTAMP(0) NOT NULL, + `supplierId` INTEGER NOT NULL, + `inventoryId` INTEGER NOT NULL, + + UNIQUE INDEX `Purchase_Receipts_code_key`(`code`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Purchase_Receipt_Items` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `count` DECIMAL(10, 2) NOT NULL, + `fee` DECIMAL(10, 2) NOT NULL, + `total` DECIMAL(10, 2) NOT NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `receiptId` INTEGER NOT NULL, + `productId` INTEGER NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Sales_Invoices` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `code` VARCHAR(100) NOT NULL, + `totalAmount` DECIMAL(10, 2) NOT NULL, + `description` TEXT NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `updatedAt` TIMESTAMP(0) NOT NULL, + `customerId` INTEGER NULL, + + UNIQUE INDEX `Sales_Invoices_code_key`(`code`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Sales_Invoice_Items` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `count` DECIMAL(10, 2) NOT NULL, + `fee` DECIMAL(10, 2) NOT NULL, + `total` DECIMAL(10, 2) NOT NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `invoiceId` INTEGER NOT NULL, + `productId` INTEGER NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Stock_Movements` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `type` ENUM('IN', 'OUT', 'ADJUST') NOT NULL, + `quantity` DECIMAL(10, 2) NOT NULL, + `fee` DECIMAL(10, 2) NOT NULL, + `totalCost` DECIMAL(10, 2) NOT NULL, + `referenceType` ENUM('PURCHASE', 'SALES', 'ADJUSTMENT') NOT NULL, + `referenceId` VARCHAR(191) NOT NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `productId` INTEGER NOT NULL, + `inventoryId` INTEGER NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `stock_balance` ( + `itemId` INTEGER NOT NULL, + `quantity` DECIMAL(65, 30) NOT NULL, + `totalCost` DECIMAL(65, 30) NOT NULL, + `updatedAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + + PRIMARY KEY (`itemId`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Inventory_Transfers` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `code` VARCHAR(100) NOT NULL, + `description` TEXT NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `fromInventoryId` INTEGER NOT NULL, + `toInventoryId` INTEGER NOT NULL, + + UNIQUE INDEX `Inventory_Transfers_code_key`(`code`), + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Inventory_Transfer_Items` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `count` DECIMAL(10, 2) NOT NULL, + `productId` INTEGER NOT NULL, + `transferId` INTEGER NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `StockMovementsView` ( + `id` INTEGER NULL, + `type` VARCHAR(191) NULL, + `productId` INTEGER NULL, + `quantity` DECIMAL(65, 30) NULL, + `fee` DECIMAL(65, 30) NULL, + `totalCost` DECIMAL(65, 30) NULL, + `referenceId` INTEGER NULL, + `referenceType` VARCHAR(191) NULL, + `createdAt` DATETIME(3) NULL +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Stock_Adjustments` ( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `adjustedQuantity` DECIMAL(10, 2) NOT NULL, + `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), + `productId` INTEGER NOT NULL, + `inventoryId` INTEGER NOT NULL, + + PRIMARY KEY (`id`) +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `stock_movements_view` ( + `id` INTEGER NULL, + `productId` INTEGER NULL, + `type` VARCHAR(191) NULL, + `quantity` DECIMAL(65, 30) NULL, + `fee` DECIMAL(65, 30) NULL, + `totalCost` DECIMAL(65, 30) NULL, + `referenceId` VARCHAR(191) NULL, + `referenceType` VARCHAR(191) NULL, + `createdAt` DATETIME(3) NULL, + `currentStock` DECIMAL(65, 30) NULL, + `currentAvgCost` DECIMAL(65, 30) NULL +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Stock_View` ( + `productId` INTEGER NULL, + `inventoryId` INTEGER NULL, + `stock` DECIMAL(65, 30) NULL +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- CreateTable +CREATE TABLE `Total_Stock_View` ( + `productId` INTEGER NULL, + `stock` DECIMAL(65, 30) NULL +) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; + +-- AddForeignKey +ALTER TABLE `Product_Charges` ADD CONSTRAINT `Product_Charges_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE NO ACTION; + +-- AddForeignKey +ALTER TABLE `Product_Charges` ADD CONSTRAINT `Product_Charges_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE NO ACTION; + +-- AddForeignKey +ALTER TABLE `Product_Charges` ADD CONSTRAINT `Product_Charges_supplierId_fkey` FOREIGN KEY (`supplierId`) REFERENCES `Suppliers`(`id`) ON DELETE RESTRICT ON UPDATE NO ACTION; + +-- AddForeignKey +ALTER TABLE `Orders` ADD CONSTRAINT `Orders_customerId_fkey` FOREIGN KEY (`customerId`) REFERENCES `Customers`(`id`) ON DELETE RESTRICT ON UPDATE NO ACTION; + +-- AddForeignKey +ALTER TABLE `Purchase_Receipts` ADD CONSTRAINT `Purchase_Receipts_supplierId_fkey` FOREIGN KEY (`supplierId`) REFERENCES `Suppliers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Purchase_Receipts` ADD CONSTRAINT `Purchase_Receipts_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Purchase_Receipt_Items` ADD CONSTRAINT `Purchase_Receipt_Items_receiptId_fkey` FOREIGN KEY (`receiptId`) REFERENCES `Purchase_Receipts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Purchase_Receipt_Items` ADD CONSTRAINT `Purchase_Receipt_Items_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Sales_Invoices` ADD CONSTRAINT `Sales_Invoices_customerId_fkey` FOREIGN KEY (`customerId`) REFERENCES `Customers`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Sales_Invoice_Items` ADD CONSTRAINT `Sales_Invoice_Items_invoiceId_fkey` FOREIGN KEY (`invoiceId`) REFERENCES `Sales_Invoices`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Sales_Invoice_Items` ADD CONSTRAINT `Sales_Invoice_Items_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Stock_Movements` ADD CONSTRAINT `Stock_Movements_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Stock_Movements` ADD CONSTRAINT `Stock_Movements_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Inventory_Transfers` ADD CONSTRAINT `Inventory_Transfers_fromInventoryId_fkey` FOREIGN KEY (`fromInventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Inventory_Transfers` ADD CONSTRAINT `Inventory_Transfers_toInventoryId_fkey` FOREIGN KEY (`toInventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Inventory_Transfer_Items` ADD CONSTRAINT `Inventory_Transfer_Items_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Inventory_Transfer_Items` ADD CONSTRAINT `Inventory_Transfer_Items_transferId_fkey` FOREIGN KEY (`transferId`) REFERENCES `Inventory_Transfers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Stock_Adjustments` ADD CONSTRAINT `Stock_Adjustments_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE `Stock_Adjustments` ADD CONSTRAINT `Stock_Adjustments_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/20251208152438_apply_views/migration.sql b/prisma/migrations/20251208152438_apply_views/migration.sql new file mode 100644 index 0000000..420a808 --- /dev/null +++ b/prisma/migrations/20251208152438_apply_views/migration.sql @@ -0,0 +1,20 @@ +/* + Warnings: + + - You are about to drop the `StockMovementsView` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Stock_View` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `Total_Stock_View` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `stock_movements_view` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropTable +DROP TABLE `StockMovementsView`; + +-- DropTable +DROP TABLE `Stock_View`; + +-- DropTable +DROP TABLE `Total_Stock_View`; + +-- DropTable +DROP TABLE `stock_movements_view`; diff --git a/prisma/migrations/20251208153255_apply_views/migration.sql b/prisma/migrations/20251208153255_apply_views/migration.sql new file mode 100644 index 0000000..e997d32 --- /dev/null +++ b/prisma/migrations/20251208153255_apply_views/migration.sql @@ -0,0 +1,13 @@ +/* + Warnings: + + - The primary key for the `stock_balance` table will be changed. If it partially fails, the table could be left without primary key constraint. + - You are about to drop the column `itemId` on the `stock_balance` table. All the data in the column will be lost. + - Added the required column `ProductId` to the `stock_balance` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE `stock_balance` DROP PRIMARY KEY, + DROP COLUMN `itemId`, + ADD COLUMN `ProductId` INTEGER NOT NULL, + ADD PRIMARY KEY (`ProductId`); diff --git a/prisma/migrations/20251208153603_apply_views/migration.sql b/prisma/migrations/20251208153603_apply_views/migration.sql new file mode 100644 index 0000000..9a9c228 --- /dev/null +++ b/prisma/migrations/20251208153603_apply_views/migration.sql @@ -0,0 +1,9 @@ +/* + Warnings: + + - Added the required column `avgCost` to the `Stock_Movements` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE `Stock_Movements` ADD COLUMN `avgCost` DECIMAL(10, 2) NOT NULL; + diff --git a/prisma/migrations/20251208154043_apply_views/migration.sql b/prisma/migrations/20251208154043_apply_views/migration.sql new file mode 100644 index 0000000..dd5b03e --- /dev/null +++ b/prisma/migrations/20251208154043_apply_views/migration.sql @@ -0,0 +1,9 @@ +/* + Warnings: + + - Added the required column `avgCost` to the `stock_balance` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE `stock_balance` ADD COLUMN `avgCost` DECIMAL(65, 30) NOT NULL; + diff --git a/prisma/schema.prisma b/prisma/schema.prisma index de193e4..fb67f3e 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -1,23 +1,27 @@ +generator client { + provider = "prisma-client" + output = "../src/generated/prisma" + previewFeatures = ["views"] + moduleFormat = "cjs" +} + datasource db { provider = "mysql" } -generator client { - provider = "prisma-client" - output = "../src/generated/prisma" - moduleFormat = "cjs" -} - model User { - id Int @id @default(autoincrement()) - mobileNumber String @unique @db.Char(11) + id Int @id @default(autoincrement()) + mobileNumber String @unique @db.Char(11) password String firstName String lastName String + roleId Int + createdAt DateTime @default(now()) @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + role Role @relation("User_Role", fields: [roleId], references: [id], onUpdate: NoAction) - roleId Int - role Role @relation("User_Role", fields: [roleId], references: [id], onUpdate: NoAction) - + @@index([roleId], map: "Users_roleId_fkey") @@map("Users") } @@ -29,8 +33,7 @@ model Role { createdAt DateTime @default(now()) @db.Timestamp(0) updatedAt DateTime @updatedAt @db.Timestamp(0) deletedAt DateTime? @db.Timestamp(0) - - users User[] @relation("User_Role") + users User[] @relation("User_Role") @@map("Roles") } @@ -48,43 +51,39 @@ model ProductVariant { alertQuantity Decimal? @default(5.00) @db.Decimal(10, 2) isActive Boolean @default(true) isFeatured Boolean @default(false) - createdAt DateTime? @db.Timestamp(0) - updatedAt DateTime? @db.Timestamp(0) + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) deletedAt DateTime? @db.Timestamp(0) + productId Int + product Product @relation("Product_Variant", fields: [productId], references: [id], onUpdate: NoAction) - product Product @relation("Product_Variant", fields: [productId], references: [id], onUpdate: NoAction) - productId Int - // is_stock_managed Boolean @default(true) - // created_by Int? - // collection_product collection_product[] - // product_batches product_batches[] - // product_stocks product_stocks[] - // attachments attachments? @relation(fields: [attachment_id], references: [id], onUpdate: NoAction, map: "products_attachment_id_foreign") - // purchase_items purchase_items[] - // sale_items sale_items[] - + @@index([productId], map: "Product_Variants_productId_fkey") @@map("Product_Variants") } model Product { - id Int @id @default(autoincrement()) - name String @db.VarChar(255) - barcode String? @unique(map: "products_barcode_unique") @db.VarChar(100) - sku String? @unique(map: "products_sku_unique") @db.VarChar(100) - description String? @db.Text - // productType String? @default("simple") @db.VarChar(50) - createdAt DateTime @default(now()) @db.Timestamp(0) - updatedAt DateTime @updatedAt @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) - - variants ProductVariant[] @relation("Product_Variant") - - brand ProductBrand? @relation("Product_Brand", fields: [brandId], references: [id], onUpdate: NoAction) - brandId Int? - - category ProductCategory? @relation("Product_Category", fields: [categoryId], references: [id], onUpdate: NoAction) - categoryId Int? + id Int @id @default(autoincrement()) + name String @db.VarChar(255) + description String? @db.Text + sku String? @unique(map: "products_sku_unique") @db.VarChar(100) + barcode String? @unique(map: "products_barcode_unique") @db.VarChar(100) + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) + brandId Int? + categoryId Int? + inventoryTransferItems InventoryTransferItem[] @relation("InventoryTransferItem_Product") + productCharges ProductCharge[] @relation("Product_Charges") + variants ProductVariant[] @relation("Product_Variant") + brand ProductBrand? @relation("Product_Brand", fields: [brandId], references: [id], onUpdate: NoAction) + category ProductCategory? @relation("Product_Category", fields: [categoryId], references: [id], onUpdate: NoAction) + purchaseReceiptItems PurchaseReceiptItem[] @relation("Product_PurchaseReceiptItems") + salesInvoiceItems SalesInvoiceItem[] @relation("Product_SalesInvoiceItems") + stockAdjustments StockAdjustment[] @relation("Product_Stock_Adjustments") + stockMovements StockMovement[] @relation("StockMovement_Product") + @@index([brandId], map: "Products_brandId_fkey") + @@index([categoryId], map: "Products_categoryId_fkey") @@map("Products") } @@ -96,8 +95,7 @@ model ProductBrand { createdAt DateTime @default(now()) @db.Timestamp(0) updatedAt DateTime @updatedAt @db.Timestamp(0) deletedAt DateTime? @db.Timestamp(0) - - products Product[] @relation("Product_Brand") + products Product[] @relation("Product_Brand") @@map("Product_brands") } @@ -110,66 +108,339 @@ model ProductCategory { createdAt DateTime @default(now()) @db.Timestamp(0) updatedAt DateTime @updatedAt @db.Timestamp(0) deletedAt DateTime? @db.Timestamp(0) - - products Product[] @relation("Product_Category") + products Product[] @relation("Product_Category") @@map("Product_categories") } model Supplier { - id Int @id @default(autoincrement()) - firstName String @db.VarChar(255) - lastName String @db.VarChar(255) - email String? @db.VarChar(255) - mobileNumber String @unique @db.Char(11) - address String? @db.Text - city String? @db.VarChar(100) - state String? @db.VarChar(100) - country String? @db.VarChar(100) - isActive Boolean @default(true) - createdAt DateTime? @db.Timestamp(0) - updatedAt DateTime? @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) + id Int @id @default(autoincrement()) + firstName String @db.VarChar(255) + lastName String @db.VarChar(255) + email String? @db.VarChar(255) + mobileNumber String @unique @db.Char(11) + address String? @db.Text + city String? @db.VarChar(100) + state String? @db.VarChar(100) + country String? @db.VarChar(100) + isActive Boolean @default(true) + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) + productCharges ProductCharge[] @relation("Supplier_Product_Charges") + purchaseReceipts PurchaseReceipt[] @@map("Suppliers") } model Customer { - id Int @id @default(autoincrement()) - firstName String @db.VarChar(255) - lastName String @db.VarChar(255) - email String? @db.VarChar(255) - mobileNumber String @unique @db.Char(11) - address String? @db.Text - city String? @db.VarChar(100) - state String? @db.VarChar(100) - country String? @db.VarChar(100) - isActive Boolean @default(true) - createdAt DateTime? @db.Timestamp(0) - updatedAt DateTime? @db.Timestamp(0) - deletedAt DateTime? @db.Timestamp(0) + id Int @id @default(autoincrement()) + firstName String @db.VarChar(255) + lastName String @db.VarChar(255) + email String? @db.VarChar(255) + mobileNumber String @unique @db.Char(11) + address String? @db.Text + city String? @db.VarChar(100) + state String? @db.VarChar(100) + country String? @db.VarChar(100) + isActive Boolean @default(true) + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) + orders Order[] @relation("Customer_Orders") + salesInvoices SalesInvoice[] @relation("Customer_Sales_Invoices") @@map("Customers") } model Inventory { - id Int @id @default(autoincrement()) - name String @db.VarChar(255) - location String? @db.VarChar(255) - isActive Boolean @default(true) - createdAt DateTime @db.Timestamp(0) - updatedAt DateTime @db.Timestamp(0) + id Int @id @default(autoincrement()) + name String @db.VarChar(255) + location String? @db.VarChar(255) + isActive Boolean @default(true) + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) + inventoryTransfersFrom InventoryTransfer[] @relation("Inventory_From") + inventoryTransfersTo InventoryTransfer[] @relation("Inventory_To") + productCharges ProductCharge[] @relation("Inventory_Product_Charges") + purchaseReceipts PurchaseReceipt[] + stockAdjustments StockAdjustment[] @relation("Inventory_Stock_Adjustments") + stockMovements StockMovement[] @relation("StockMovement_Inventory") @@map("Inventories") } model Store { - id Int @id @default(autoincrement()) - name String @db.VarChar(255) - location String? @db.VarChar(255) - isActive Boolean @default(true) - createdAt DateTime @db.Timestamp(0) - updatedAt DateTime @db.Timestamp(0) + id Int @id @default(autoincrement()) + name String @db.VarChar(255) + location String? @db.VarChar(255) + isActive Boolean @default(true) + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) @@map("Stores") } + +model ProductCharge { + id Int @id @default(autoincrement()) + count Decimal @db.Decimal(10, 2) + fee Decimal @db.Decimal(10, 2) + totalAmount Decimal @db.Decimal(10, 2) + isSettled Boolean @default(false) + buyAt DateTime? @db.Timestamp(0) + description String? @db.Text + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) + productId Int + inventoryId Int + supplierId Int + inventory Inventory @relation("Inventory_Product_Charges", fields: [inventoryId], references: [id], onUpdate: NoAction) + product Product @relation("Product_Charges", fields: [productId], references: [id], onUpdate: NoAction) + supplier Supplier @relation("Supplier_Product_Charges", fields: [supplierId], references: [id], onUpdate: NoAction) + + @@index([inventoryId], map: "Product_Charges_inventoryId_fkey") + @@index([productId], map: "Product_Charges_productId_fkey") + @@index([supplierId], map: "Product_Charges_supplierId_fkey") + @@map("Product_Charges") +} + +model Order { + id Int @id @default(autoincrement()) + orderNumber String @unique @db.VarChar(100) + status OrderStatus @default(pending) + paymentMethod paymentMethod @default(card) + totalAmount Decimal @db.Decimal(10, 2) + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + deletedAt DateTime? @db.Timestamp(0) + customerId Int + customer Customer @relation("Customer_Orders", fields: [customerId], references: [id], onUpdate: NoAction) + + @@index([customerId], map: "Orders_customerId_fkey") + @@map("Orders") +} + +model PurchaseReceipt { + id Int @id @default(autoincrement()) + code String @unique @db.VarChar(100) + totalAmount Decimal @db.Decimal(10, 2) + description String? @db.Text + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + supplierId Int + inventoryId Int + items PurchaseReceiptItem[] @relation("PurchaseReceipt_Items") + inventory Inventory @relation(fields: [inventoryId], references: [id]) + supplier Supplier @relation(fields: [supplierId], references: [id]) + + @@index([inventoryId], map: "Purchase_Receipts_inventoryId_fkey") + @@index([supplierId], map: "Purchase_Receipts_supplierId_fkey") + @@map("Purchase_Receipts") +} + +model PurchaseReceiptItem { + id Int @id @default(autoincrement()) + count Decimal @db.Decimal(10, 2) + fee Decimal @db.Decimal(10, 2) + total Decimal @db.Decimal(10, 2) + createdAt DateTime @default(now()) @db.Timestamp(0) + receiptId Int + productId Int + product Product @relation("Product_PurchaseReceiptItems", fields: [productId], references: [id]) + receipt PurchaseReceipt @relation("PurchaseReceipt_Items", fields: [receiptId], references: [id]) + + @@index([productId], map: "Purchase_Receipt_Items_productId_fkey") + @@index([receiptId], map: "Purchase_Receipt_Items_receiptId_fkey") + @@map("Purchase_Receipt_Items") +} + +model SalesInvoice { + id Int @id @default(autoincrement()) + code String @unique @db.VarChar(100) + totalAmount Decimal @db.Decimal(10, 2) + description String? @db.Text + createdAt DateTime @default(now()) @db.Timestamp(0) + updatedAt DateTime @updatedAt @db.Timestamp(0) + customerId Int? + items SalesInvoiceItem[] @relation("SalesInvoice_Items") + customer Customer? @relation("Customer_Sales_Invoices", fields: [customerId], references: [id]) + + @@index([customerId], map: "Sales_Invoices_customerId_fkey") + @@map("Sales_Invoices") +} + +model SalesInvoiceItem { + id Int @id @default(autoincrement()) + count Decimal @db.Decimal(10, 2) + fee Decimal @db.Decimal(10, 2) + total Decimal @db.Decimal(10, 2) + createdAt DateTime @default(now()) @db.Timestamp(0) + invoiceId Int + productId Int + invoice SalesInvoice @relation("SalesInvoice_Items", fields: [invoiceId], references: [id]) + product Product @relation("Product_SalesInvoiceItems", fields: [productId], references: [id]) + + @@index([invoiceId], map: "Sales_Invoice_Items_invoiceId_fkey") + @@index([productId], map: "Sales_Invoice_Items_productId_fkey") + @@map("Sales_Invoice_Items") +} + +model StockMovement { + id Int @id @default(autoincrement()) + type MovementType + quantity Decimal @db.Decimal(10, 2) + fee Decimal @db.Decimal(10, 2) + totalCost Decimal @db.Decimal(10, 2) + referenceType MovementReferenceType + referenceId String + createdAt DateTime @default(now()) @db.Timestamp(0) + productId Int + inventoryId Int + avgCost Decimal @db.Decimal(10, 2) + inventory Inventory @relation("StockMovement_Inventory", fields: [inventoryId], references: [id]) + product Product @relation("StockMovement_Product", fields: [productId], references: [id]) + + @@index([inventoryId], map: "Stock_Movements_inventoryId_fkey") + @@index([productId], map: "Stock_Movements_productId_fkey") + @@map("Stock_Movements") +} + +model StockBalance { + quantity Decimal + totalCost Decimal + updatedAt DateTime @default(now()) @updatedAt @db.Timestamp(0) + ProductId Int @id + avgCost Decimal + + @@map("stock_balance") +} + +model InventoryTransfer { + id Int @id @default(autoincrement()) + code String @unique @db.VarChar(100) + description String? @db.Text + createdAt DateTime @default(now()) @db.Timestamp(0) + fromInventoryId Int + toInventoryId Int + items InventoryTransferItem[] @relation("InventoryTransfer_Items") + fromInventory Inventory @relation("Inventory_From", fields: [fromInventoryId], references: [id]) + toInventory Inventory @relation("Inventory_To", fields: [toInventoryId], references: [id]) + + @@index([fromInventoryId], map: "Inventory_Transfers_fromInventoryId_fkey") + @@index([toInventoryId], map: "Inventory_Transfers_toInventoryId_fkey") + @@map("Inventory_Transfers") +} + +model InventoryTransferItem { + id Int @id @default(autoincrement()) + count Decimal @db.Decimal(10, 2) + productId Int + transferId Int + product Product @relation("InventoryTransferItem_Product", fields: [productId], references: [id]) + transfer InventoryTransfer @relation("InventoryTransfer_Items", fields: [transferId], references: [id]) + + @@index([productId], map: "Inventory_Transfer_Items_productId_fkey") + @@index([transferId], map: "Inventory_Transfer_Items_transferId_fkey") + @@map("Inventory_Transfer_Items") +} + +model StockAdjustment { + id Int @id @default(autoincrement()) + adjustedQuantity Decimal @db.Decimal(10, 2) + createdAt DateTime @default(now()) @db.Timestamp(0) + productId Int + inventoryId Int + inventory Inventory @relation("Inventory_Stock_Adjustments", fields: [inventoryId], references: [id]) + product Product @relation("Product_Stock_Adjustments", fields: [productId], references: [id]) + + @@index([inventoryId], map: "Stock_Adjustments_inventoryId_fkey") + @@index([productId], map: "Stock_Adjustments_productId_fkey") + @@map("Stock_Adjustments") +} + +view StockMovements_View { + id Int @default(0) + productId Int + type stock_movements_view_type + quantity Decimal @db.Decimal(10, 2) + fee Decimal @db.Decimal(10, 2) + totalCost Decimal @db.Decimal(10, 2) + referenceId String + referenceType stock_movements_view_referenceType + createdAt DateTime @default(now()) @db.Timestamp(0) + current_stock Decimal? + current_avg_cost Decimal? + + @@map("stock_movements_view") + @@ignore +} + +view inventory_overview { + ProductId Int + stock_quantity Decimal + avgCost Decimal + totalCost Decimal + updatedAt DateTime @default(now()) @db.Timestamp(0) +} + +view stock_cardex { + productId Int + movement_id Int @default(0) + type stock_cardex_type + quantity Decimal @db.Decimal(10, 2) + fee Decimal @db.Decimal(10, 2) + totalCost Decimal @db.Decimal(10, 2) + balance_quantity Decimal? + balance_avg_cost Decimal? + createdAt DateTime @default(now()) @db.Timestamp(0) +} + +view stock_view { + productId Int + inventoryId Int + stock Decimal? @db.Decimal(32, 2) +} + +enum OrderStatus { + pending + reject + done +} + +enum paymentMethod { + cash + card +} + +enum MovementType { + IN + OUT + ADJUST +} + +enum MovementReferenceType { + PURCHASE + SALES + ADJUSTMENT +} + +enum stock_cardex_type { + IN + OUT + ADJUST +} + +enum stock_movements_view_type { + IN + OUT + ADJUST +} + +enum stock_movements_view_referenceType { + PURCHASE + SALES + ADJUSTMENT +} diff --git a/prisma/views/pos/StockMovements_View.sql b/prisma/views/pos/StockMovements_View.sql new file mode 100644 index 0000000..a24a303 --- /dev/null +++ b/prisma/views/pos/StockMovements_View.sql @@ -0,0 +1,17 @@ +SELECT + `sm`.`id` AS `id`, + `sm`.`productId` AS `productId`, + `sm`.`type` AS `type`, + `sm`.`quantity` AS `quantity`, + `sm`.`fee` AS `fee`, + `sm`.`totalCost` AS `totalCost`, + `sm`.`referenceId` AS `referenceId`, + `sm`.`referenceType` AS `referenceType`, + `sm`.`createdAt` AS `createdAt`, + `sb`.`quantity` AS `current_stock`, + `sb`.`avgCost` AS `current_avg_cost` +FROM + ( + `pos`.`Stock_Movements` `sm` + LEFT JOIN `pos`.`stock_balance` `sb` ON((`sb`.`ProductId` = `sm`.`productId`)) + ) \ No newline at end of file diff --git a/prisma/views/pos/inventory_overview.sql b/prisma/views/pos/inventory_overview.sql new file mode 100644 index 0000000..c6501d8 --- /dev/null +++ b/prisma/views/pos/inventory_overview.sql @@ -0,0 +1,8 @@ +SELECT + `pos`.`stock_balance`.`ProductId` AS `ProductId`, + `pos`.`stock_balance`.`quantity` AS `stock_quantity`, + `pos`.`stock_balance`.`avgCost` AS `avgCost`, + `pos`.`stock_balance`.`totalCost` AS `totalCost`, + `pos`.`stock_balance`.`updatedAt` AS `updatedAt` +FROM + `pos`.`stock_balance` \ No newline at end of file diff --git a/prisma/views/pos/stock_cardex.sql b/prisma/views/pos/stock_cardex.sql new file mode 100644 index 0000000..03f36eb --- /dev/null +++ b/prisma/views/pos/stock_cardex.sql @@ -0,0 +1,18 @@ +SELECT + `sm`.`productId` AS `productId`, + `sm`.`id` AS `movement_id`, + `sm`.`type` AS `type`, + `sm`.`quantity` AS `quantity`, + `sm`.`fee` AS `fee`, + `sm`.`totalCost` AS `totalCost`, + `sb`.`quantity` AS `balance_quantity`, + `sb`.`avgCost` AS `balance_avg_cost`, + `sm`.`createdAt` AS `createdAt` +FROM + ( + `pos`.`Stock_Movements` `sm` + LEFT JOIN `pos`.`stock_balance` `sb` ON((`sb`.`ProductId` = `sm`.`productId`)) + ) +ORDER BY + `sm`.`productId`, + `sm`.`createdAt` \ No newline at end of file diff --git a/prisma/views/pos/stock_view.sql b/prisma/views/pos/stock_view.sql new file mode 100644 index 0000000..4ad031b --- /dev/null +++ b/prisma/views/pos/stock_view.sql @@ -0,0 +1,18 @@ +SELECT + `pos`.`Stock_Movements`.`productId` AS `productId`, + `pos`.`Stock_Movements`.`inventoryId` AS `inventoryId`, + sum( + ( + CASE + WHEN (`pos`.`Stock_Movements`.`type` = 'IN') THEN `pos`.`Stock_Movements`.`quantity` + WHEN (`pos`.`Stock_Movements`.`type` = 'OUT') THEN -(`pos`.`Stock_Movements`.`quantity`) + WHEN (`pos`.`Stock_Movements`.`type` = 'ADJUST') THEN `pos`.`Stock_Movements`.`quantity` + ELSE 0 + END + ) + ) AS `stock` +FROM + `pos`.`Stock_Movements` +GROUP BY + `pos`.`Stock_Movements`.`productId`, + `pos`.`Stock_Movements`.`inventoryId` \ No newline at end of file diff --git a/queries/Query.sql b/queries/Query.sql new file mode 100644 index 0000000..e69de29 diff --git a/src/app.module.ts b/src/app.module.ts index 5b4bd71..0e9a0c6 100644 --- a/src/app.module.ts +++ b/src/app.module.ts @@ -3,12 +3,22 @@ import { AppController } from './app.controller' import { AppService } from './app.service' 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 { PrismaModule } from './prisma/prisma.module' import { ProductBrandsModule } from './product-brands/product-brands.module' import { ProductCategoriesModule } from './product-categories/product-categories.module' +import { ProductChargesModule } from './product-charges/product-charges.module' import { ProductVariantsModule } from './product-variants/product-variants.module' import { ProductsModule } from './products/products.module' +import { PurchaseReceiptItemsModule } from './purchase-receipt-items/purchase-receipt-items.module' +import { PurchaseReceiptsModule } from './purchase-receipts/purchase-receipts.module' import { RolesModule } from './roles/roles.module' +import { SalesInvoiceItemsModule } from './sales-invoice-items/sales-invoice-items.module' +import { SalesInvoicesModule } from './sales-invoices/sales-invoices.module' +import { StockAdjustmentsModule } from './stock-adjustments/stock-adjustments.module' +import { StockBalanceModule } from './stock-balance/stock-balance.module' +import { StockMovementsModule } from './stock-movements/stock-movements.module' import { StoresModule } from './stores/stores.module' import { SuppliersModule } from './suppliers/suppliers.module' import { UsersModule } from './users/users.module' @@ -22,10 +32,20 @@ import { UsersModule } from './users/users.module' ProductVariantsModule, ProductBrandsModule, ProductCategoriesModule, + ProductChargesModule, SuppliersModule, CustomersModule, InventoriesModule, StoresModule, + PurchaseReceiptsModule, + PurchaseReceiptItemsModule, + SalesInvoicesModule, + SalesInvoiceItemsModule, + InventoryTransfersModule, + InventoryTransferItemsModule, + StockMovementsModule, + StockAdjustmentsModule, + StockBalanceModule, ], controllers: [AppController], providers: [AppService], diff --git a/src/common/interfaces/response-models.ts b/src/common/interfaces/response-models.ts new file mode 100644 index 0000000..f9407ef --- /dev/null +++ b/src/common/interfaces/response-models.ts @@ -0,0 +1,34 @@ +export interface ShortEntity { + id: number + name: string +} + +export interface PaginationMeta { + totalRecords: number + totalPages: number + page: number + perPage: number +} + +export interface ResponseModel { + data: T + meta?: PaginationMeta +} + +export interface Envelope { + statusCode: number + timestamp: string + path: string + data: T + meta?: PaginationMeta + errors?: string[] +} + +// Generic GET response shapes used across modules +// - GetListResponse: response for `GET /resources` (returns array + optional meta) +// - GetSingleResponse: response for `GET /resources/:id` (returns single item) +export type GetListResponse = ResponseModel +export type GetSingleResponse = ResponseModel + +// Paginated response where data is the items array and meta contains pagination info +export type PaginatedResponse = ResponseModel diff --git a/src/generated/prisma/browser.ts b/src/generated/prisma/browser.ts index ab7af45..69b27f8 100644 --- a/src/generated/prisma/browser.ts +++ b/src/generated/prisma/browser.ts @@ -67,3 +67,73 @@ export type Inventory = Prisma.InventoryModel * */ export type Store = Prisma.StoreModel +/** + * Model ProductCharge + * + */ +export type ProductCharge = Prisma.ProductChargeModel +/** + * Model Order + * + */ +export type Order = Prisma.OrderModel +/** + * Model PurchaseReceipt + * + */ +export type PurchaseReceipt = Prisma.PurchaseReceiptModel +/** + * Model PurchaseReceiptItem + * + */ +export type PurchaseReceiptItem = Prisma.PurchaseReceiptItemModel +/** + * Model SalesInvoice + * + */ +export type SalesInvoice = Prisma.SalesInvoiceModel +/** + * Model SalesInvoiceItem + * + */ +export type SalesInvoiceItem = Prisma.SalesInvoiceItemModel +/** + * Model StockMovement + * + */ +export type StockMovement = Prisma.StockMovementModel +/** + * Model StockBalance + * + */ +export type StockBalance = Prisma.StockBalanceModel +/** + * Model InventoryTransfer + * + */ +export type InventoryTransfer = Prisma.InventoryTransferModel +/** + * Model InventoryTransferItem + * + */ +export type InventoryTransferItem = Prisma.InventoryTransferItemModel +/** + * Model StockAdjustment + * + */ +export type StockAdjustment = Prisma.StockAdjustmentModel +/** + * Model inventory_overview + * + */ +export type inventory_overview = Prisma.inventory_overviewModel +/** + * Model stock_cardex + * + */ +export type stock_cardex = Prisma.stock_cardexModel +/** + * Model stock_view + * + */ +export type stock_view = Prisma.stock_viewModel diff --git a/src/generated/prisma/client.ts b/src/generated/prisma/client.ts index 3fd96d0..7668600 100644 --- a/src/generated/prisma/client.ts +++ b/src/generated/prisma/client.ts @@ -87,3 +87,73 @@ export type Inventory = Prisma.InventoryModel * */ export type Store = Prisma.StoreModel +/** + * Model ProductCharge + * + */ +export type ProductCharge = Prisma.ProductChargeModel +/** + * Model Order + * + */ +export type Order = Prisma.OrderModel +/** + * Model PurchaseReceipt + * + */ +export type PurchaseReceipt = Prisma.PurchaseReceiptModel +/** + * Model PurchaseReceiptItem + * + */ +export type PurchaseReceiptItem = Prisma.PurchaseReceiptItemModel +/** + * Model SalesInvoice + * + */ +export type SalesInvoice = Prisma.SalesInvoiceModel +/** + * Model SalesInvoiceItem + * + */ +export type SalesInvoiceItem = Prisma.SalesInvoiceItemModel +/** + * Model StockMovement + * + */ +export type StockMovement = Prisma.StockMovementModel +/** + * Model StockBalance + * + */ +export type StockBalance = Prisma.StockBalanceModel +/** + * Model InventoryTransfer + * + */ +export type InventoryTransfer = Prisma.InventoryTransferModel +/** + * Model InventoryTransferItem + * + */ +export type InventoryTransferItem = Prisma.InventoryTransferItemModel +/** + * Model StockAdjustment + * + */ +export type StockAdjustment = Prisma.StockAdjustmentModel +/** + * Model inventory_overview + * + */ +export type inventory_overview = Prisma.inventory_overviewModel +/** + * Model stock_cardex + * + */ +export type stock_cardex = Prisma.stock_cardexModel +/** + * Model stock_view + * + */ +export type stock_view = Prisma.stock_viewModel diff --git a/src/generated/prisma/commonInputTypes.ts b/src/generated/prisma/commonInputTypes.ts index 2fd2cb8..57efbc4 100644 --- a/src/generated/prisma/commonInputTypes.ts +++ b/src/generated/prisma/commonInputTypes.ts @@ -40,6 +40,33 @@ export type StringFilter<$PrismaModel = never> = { not?: Prisma.NestedStringFilter<$PrismaModel> | string } +export type DateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] + notIn?: Date[] | string[] + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string +} + +export type DateTimeNullableFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | null + notIn?: Date[] | string[] | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null +} + +export type SortOrderInput = { + sort: Prisma.SortOrder + nulls?: Prisma.NullsOrder +} + export type IntWithAggregatesFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> in?: number[] @@ -74,6 +101,34 @@ export type StringWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedStringFilter<$PrismaModel> } +export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] + notIn?: Date[] | string[] + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeFilter<$PrismaModel> +} + +export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | null + notIn?: Date[] | string[] | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> +} + export type StringNullableFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null in?: string[] | null @@ -113,33 +168,6 @@ export type JsonNullableFilterBase<$PrismaModel = never> = { not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter } -export type DateTimeFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] - notIn?: Date[] | string[] - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string -} - -export type DateTimeNullableFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null -} - -export type SortOrderInput = { - sort: Prisma.SortOrder - nulls?: Prisma.NullsOrder -} - export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null in?: string[] | null @@ -185,34 +213,6 @@ export type JsonNullableWithAggregatesFilterBase<$PrismaModel = never> = { _max?: Prisma.NestedJsonNullableFilter<$PrismaModel> } -export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] - notIn?: Date[] | string[] - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedDateTimeFilter<$PrismaModel> - _max?: Prisma.NestedDateTimeFilter<$PrismaModel> -} - -export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableWithAggregatesFilter<$PrismaModel> | Date | string | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> - _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> -} - export type DecimalFilter<$PrismaModel = never> = { equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] @@ -307,6 +307,91 @@ export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedIntNullableFilter<$PrismaModel> } +export type EnumOrderStatusFilter<$PrismaModel = never> = { + equals?: $Enums.OrderStatus | Prisma.EnumOrderStatusFieldRefInput<$PrismaModel> + in?: $Enums.OrderStatus[] + notIn?: $Enums.OrderStatus[] + not?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> | $Enums.OrderStatus +} + +export type EnumpaymentMethodFilter<$PrismaModel = never> = { + equals?: $Enums.paymentMethod | Prisma.EnumpaymentMethodFieldRefInput<$PrismaModel> + in?: $Enums.paymentMethod[] + notIn?: $Enums.paymentMethod[] + not?: Prisma.NestedEnumpaymentMethodFilter<$PrismaModel> | $Enums.paymentMethod +} + +export type EnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.OrderStatus | Prisma.EnumOrderStatusFieldRefInput<$PrismaModel> + in?: $Enums.OrderStatus[] + notIn?: $Enums.OrderStatus[] + not?: Prisma.NestedEnumOrderStatusWithAggregatesFilter<$PrismaModel> | $Enums.OrderStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> +} + +export type EnumpaymentMethodWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.paymentMethod | Prisma.EnumpaymentMethodFieldRefInput<$PrismaModel> + in?: $Enums.paymentMethod[] + notIn?: $Enums.paymentMethod[] + not?: Prisma.NestedEnumpaymentMethodWithAggregatesFilter<$PrismaModel> | $Enums.paymentMethod + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumpaymentMethodFilter<$PrismaModel> + _max?: Prisma.NestedEnumpaymentMethodFilter<$PrismaModel> +} + +export type EnumMovementTypeFilter<$PrismaModel = never> = { + equals?: $Enums.MovementType | Prisma.EnumMovementTypeFieldRefInput<$PrismaModel> + in?: $Enums.MovementType[] + notIn?: $Enums.MovementType[] + not?: Prisma.NestedEnumMovementTypeFilter<$PrismaModel> | $Enums.MovementType +} + +export type EnumMovementReferenceTypeFilter<$PrismaModel = never> = { + equals?: $Enums.MovementReferenceType | Prisma.EnumMovementReferenceTypeFieldRefInput<$PrismaModel> + in?: $Enums.MovementReferenceType[] + notIn?: $Enums.MovementReferenceType[] + not?: Prisma.NestedEnumMovementReferenceTypeFilter<$PrismaModel> | $Enums.MovementReferenceType +} + +export type EnumMovementTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.MovementType | Prisma.EnumMovementTypeFieldRefInput<$PrismaModel> + in?: $Enums.MovementType[] + notIn?: $Enums.MovementType[] + not?: Prisma.NestedEnumMovementTypeWithAggregatesFilter<$PrismaModel> | $Enums.MovementType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumMovementTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumMovementTypeFilter<$PrismaModel> +} + +export type EnumMovementReferenceTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.MovementReferenceType | Prisma.EnumMovementReferenceTypeFieldRefInput<$PrismaModel> + in?: $Enums.MovementReferenceType[] + notIn?: $Enums.MovementReferenceType[] + not?: Prisma.NestedEnumMovementReferenceTypeWithAggregatesFilter<$PrismaModel> | $Enums.MovementReferenceType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumMovementReferenceTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumMovementReferenceTypeFilter<$PrismaModel> +} + +export type Enumstock_cardex_typeFilter<$PrismaModel = never> = { + equals?: $Enums.stock_cardex_type | Prisma.Enumstock_cardex_typeFieldRefInput<$PrismaModel> + in?: $Enums.stock_cardex_type[] + notIn?: $Enums.stock_cardex_type[] + not?: Prisma.NestedEnumstock_cardex_typeFilter<$PrismaModel> | $Enums.stock_cardex_type +} + +export type Enumstock_cardex_typeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.stock_cardex_type | Prisma.Enumstock_cardex_typeFieldRefInput<$PrismaModel> + in?: $Enums.stock_cardex_type[] + notIn?: $Enums.stock_cardex_type[] + not?: Prisma.NestedEnumstock_cardex_typeWithAggregatesFilter<$PrismaModel> | $Enums.stock_cardex_type + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumstock_cardex_typeFilter<$PrismaModel> + _max?: Prisma.NestedEnumstock_cardex_typeFilter<$PrismaModel> +} + export type NestedIntFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> in?: number[] @@ -333,6 +418,28 @@ export type NestedStringFilter<$PrismaModel = never> = { not?: Prisma.NestedStringFilter<$PrismaModel> | string } +export type NestedDateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] + notIn?: Date[] | string[] + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string +} + +export type NestedDateTimeNullableFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | null + notIn?: Date[] | string[] | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null +} + export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> in?: number[] @@ -378,96 +485,6 @@ export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedStringFilter<$PrismaModel> } -export type NestedStringNullableFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - search?: string - not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null -} - -export type NestedDateTimeFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] - notIn?: Date[] | string[] - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string -} - -export type NestedDateTimeNullableFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | null - notIn?: Date[] | string[] | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null -} - -export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { - equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null - in?: string[] | null - notIn?: string[] | null - lt?: string | Prisma.StringFieldRefInput<$PrismaModel> - lte?: string | Prisma.StringFieldRefInput<$PrismaModel> - gt?: string | Prisma.StringFieldRefInput<$PrismaModel> - gte?: string | Prisma.StringFieldRefInput<$PrismaModel> - contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> - search?: string - not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null - _count?: Prisma.NestedIntNullableFilter<$PrismaModel> - _min?: Prisma.NestedStringNullableFilter<$PrismaModel> - _max?: Prisma.NestedStringNullableFilter<$PrismaModel> -} - -export type NestedIntNullableFilter<$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 NestedJsonNullableFilter<$PrismaModel = never> = -| Prisma.PatchUndefined< - Prisma.Either>, Exclude>, 'path'>>, - Required> - > -| Prisma.OptionalFlat>, 'path'>> - -export type NestedJsonNullableFilterBase<$PrismaModel = never> = { - equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter - path?: string - mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> - string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> - string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> - array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - lt?: runtime.InputJsonValue - lte?: runtime.InputJsonValue - gt?: runtime.InputJsonValue - gte?: runtime.InputJsonValue - not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter -} - export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> in?: Date[] | string[] @@ -496,6 +513,74 @@ export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> } +export type NestedIntNullableFilter<$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 NestedStringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + search?: string + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | null + notIn?: string[] | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + search?: string + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type NestedJsonNullableFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type NestedJsonNullableFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + lt?: runtime.InputJsonValue + lte?: runtime.InputJsonValue + gt?: runtime.InputJsonValue + gte?: runtime.InputJsonValue + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter +} + export type NestedDecimalFilter<$PrismaModel = never> = { equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel> in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[] @@ -590,4 +675,89 @@ export type NestedFloatNullableFilter<$PrismaModel = never> = { not?: Prisma.NestedFloatNullableFilter<$PrismaModel> | number | null } +export type NestedEnumOrderStatusFilter<$PrismaModel = never> = { + equals?: $Enums.OrderStatus | Prisma.EnumOrderStatusFieldRefInput<$PrismaModel> + in?: $Enums.OrderStatus[] + notIn?: $Enums.OrderStatus[] + not?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> | $Enums.OrderStatus +} + +export type NestedEnumpaymentMethodFilter<$PrismaModel = never> = { + equals?: $Enums.paymentMethod | Prisma.EnumpaymentMethodFieldRefInput<$PrismaModel> + in?: $Enums.paymentMethod[] + notIn?: $Enums.paymentMethod[] + not?: Prisma.NestedEnumpaymentMethodFilter<$PrismaModel> | $Enums.paymentMethod +} + +export type NestedEnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.OrderStatus | Prisma.EnumOrderStatusFieldRefInput<$PrismaModel> + in?: $Enums.OrderStatus[] + notIn?: $Enums.OrderStatus[] + not?: Prisma.NestedEnumOrderStatusWithAggregatesFilter<$PrismaModel> | $Enums.OrderStatus + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> + _max?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> +} + +export type NestedEnumpaymentMethodWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.paymentMethod | Prisma.EnumpaymentMethodFieldRefInput<$PrismaModel> + in?: $Enums.paymentMethod[] + notIn?: $Enums.paymentMethod[] + not?: Prisma.NestedEnumpaymentMethodWithAggregatesFilter<$PrismaModel> | $Enums.paymentMethod + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumpaymentMethodFilter<$PrismaModel> + _max?: Prisma.NestedEnumpaymentMethodFilter<$PrismaModel> +} + +export type NestedEnumMovementTypeFilter<$PrismaModel = never> = { + equals?: $Enums.MovementType | Prisma.EnumMovementTypeFieldRefInput<$PrismaModel> + in?: $Enums.MovementType[] + notIn?: $Enums.MovementType[] + not?: Prisma.NestedEnumMovementTypeFilter<$PrismaModel> | $Enums.MovementType +} + +export type NestedEnumMovementReferenceTypeFilter<$PrismaModel = never> = { + equals?: $Enums.MovementReferenceType | Prisma.EnumMovementReferenceTypeFieldRefInput<$PrismaModel> + in?: $Enums.MovementReferenceType[] + notIn?: $Enums.MovementReferenceType[] + not?: Prisma.NestedEnumMovementReferenceTypeFilter<$PrismaModel> | $Enums.MovementReferenceType +} + +export type NestedEnumMovementTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.MovementType | Prisma.EnumMovementTypeFieldRefInput<$PrismaModel> + in?: $Enums.MovementType[] + notIn?: $Enums.MovementType[] + not?: Prisma.NestedEnumMovementTypeWithAggregatesFilter<$PrismaModel> | $Enums.MovementType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumMovementTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumMovementTypeFilter<$PrismaModel> +} + +export type NestedEnumMovementReferenceTypeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.MovementReferenceType | Prisma.EnumMovementReferenceTypeFieldRefInput<$PrismaModel> + in?: $Enums.MovementReferenceType[] + notIn?: $Enums.MovementReferenceType[] + not?: Prisma.NestedEnumMovementReferenceTypeWithAggregatesFilter<$PrismaModel> | $Enums.MovementReferenceType + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumMovementReferenceTypeFilter<$PrismaModel> + _max?: Prisma.NestedEnumMovementReferenceTypeFilter<$PrismaModel> +} + +export type NestedEnumstock_cardex_typeFilter<$PrismaModel = never> = { + equals?: $Enums.stock_cardex_type | Prisma.Enumstock_cardex_typeFieldRefInput<$PrismaModel> + in?: $Enums.stock_cardex_type[] + notIn?: $Enums.stock_cardex_type[] + not?: Prisma.NestedEnumstock_cardex_typeFilter<$PrismaModel> | $Enums.stock_cardex_type +} + +export type NestedEnumstock_cardex_typeWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.stock_cardex_type | Prisma.Enumstock_cardex_typeFieldRefInput<$PrismaModel> + in?: $Enums.stock_cardex_type[] + notIn?: $Enums.stock_cardex_type[] + not?: Prisma.NestedEnumstock_cardex_typeWithAggregatesFilter<$PrismaModel> | $Enums.stock_cardex_type + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumstock_cardex_typeFilter<$PrismaModel> + _max?: Prisma.NestedEnumstock_cardex_typeFilter<$PrismaModel> +} + diff --git a/src/generated/prisma/enums.ts b/src/generated/prisma/enums.ts index 043572d..c4034bf 100644 --- a/src/generated/prisma/enums.ts +++ b/src/generated/prisma/enums.ts @@ -9,7 +9,63 @@ * 🟢 You can import this file directly. */ +export const OrderStatus = { + pending: 'pending', + reject: 'reject', + done: 'done' +} as const + +export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus] -// This file is empty because there are no enums in the schema. -export {} +export const paymentMethod = { + cash: 'cash', + card: 'card' +} as const + +export type paymentMethod = (typeof paymentMethod)[keyof typeof paymentMethod] + + +export const MovementType = { + IN: 'IN', + OUT: 'OUT', + ADJUST: 'ADJUST' +} as const + +export type MovementType = (typeof MovementType)[keyof typeof MovementType] + + +export const MovementReferenceType = { + PURCHASE: 'PURCHASE', + SALES: 'SALES', + ADJUSTMENT: 'ADJUSTMENT' +} as const + +export type MovementReferenceType = (typeof MovementReferenceType)[keyof typeof MovementReferenceType] + + +export const stock_cardex_type = { + IN: 'IN', + OUT: 'OUT', + ADJUST: 'ADJUST' +} as const + +export type stock_cardex_type = (typeof stock_cardex_type)[keyof typeof stock_cardex_type] + + +export const stock_movements_view_type = { + IN: 'IN', + OUT: 'OUT', + ADJUST: 'ADJUST' +} as const + +export type stock_movements_view_type = (typeof stock_movements_view_type)[keyof typeof stock_movements_view_type] + + +export const stock_movements_view_referenceType = { + PURCHASE: 'PURCHASE', + SALES: 'SALES', + ADJUSTMENT: 'ADJUSTMENT' +} as const + +export type stock_movements_view_referenceType = (typeof stock_movements_view_referenceType)[keyof typeof stock_movements_view_referenceType] diff --git a/src/generated/prisma/internal/class.ts b/src/generated/prisma/internal/class.ts index 67dad5f..fe48b20 100644 --- a/src/generated/prisma/internal/class.ts +++ b/src/generated/prisma/internal/class.ts @@ -16,11 +16,13 @@ import type * as Prisma from "./prismaNamespace.js" const config: runtime.GetPrismaClientConfig = { - "previewFeatures": [], + "previewFeatures": [ + "views" + ], "clientVersion": "7.1.0", "engineVersion": "ab635e6b9d606fa5c8fb8b1a7f909c3c3c1c98ba", "activeProvider": "mysql", - "inlineSchema": "datasource db {\n provider = \"mysql\"\n}\n\ngenerator client {\n provider = \"prisma-client\"\n output = \"../src/generated/prisma\"\n moduleFormat = \"cjs\"\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\n roleId Int\n role Role @relation(\"User_Role\", fields: [roleId], references: [id], onUpdate: NoAction)\n\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\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? @db.Timestamp(0)\n updatedAt DateTime? @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n product Product @relation(\"Product_Variant\", fields: [productId], references: [id], onUpdate: NoAction)\n productId Int\n // is_stock_managed Boolean @default(true)\n // created_by Int?\n // collection_product collection_product[]\n // product_batches product_batches[]\n // product_stocks product_stocks[]\n // attachments attachments? @relation(fields: [attachment_id], references: [id], onUpdate: NoAction, map: \"products_attachment_id_foreign\")\n // purchase_items purchase_items[]\n // sale_items sale_items[]\n\n @@map(\"Product_Variants\")\n}\n\nmodel Product {\n id Int @id @default(autoincrement())\n name String @db.VarChar(255)\n barcode String? @unique(map: \"products_barcode_unique\") @db.VarChar(100)\n sku String? @unique(map: \"products_sku_unique\") @db.VarChar(100)\n description String? @db.Text\n // productType String? @default(\"simple\") @db.VarChar(50)\n createdAt DateTime @default(now()) @db.Timestamp(0)\n updatedAt DateTime @updatedAt @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\n\n variants ProductVariant[] @relation(\"Product_Variant\")\n\n brand ProductBrand? @relation(\"Product_Brand\", fields: [brandId], references: [id], onUpdate: NoAction)\n brandId Int?\n\n category ProductCategory? @relation(\"Product_Category\", fields: [categoryId], references: [id], onUpdate: NoAction)\n categoryId Int?\n\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\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\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? @db.Timestamp(0)\n updatedAt DateTime? @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\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? @db.Timestamp(0)\n updatedAt DateTime? @db.Timestamp(0)\n deletedAt DateTime? @db.Timestamp(0)\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 @db.Timestamp(0)\n updatedAt DateTime @db.Timestamp(0)\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 @db.Timestamp(0)\n updatedAt DateTime @db.Timestamp(0)\n\n @@map(\"Stores\")\n}\n", + "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 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\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\nview stock_view {\n productId Int\n inventoryId Int\n stock Decimal? @db.Decimal(32, 2)\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": {}, @@ -28,7 +30,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\":\"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\":\"product\",\"kind\":\"object\",\"type\":\"Product\",\"relationName\":\"Product_Variant\"},{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":\"Product_Variants\"},\"Product\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"barcode\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sku\",\"kind\":\"scalar\",\"type\":\"String\"},{\"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\":\"variants\",\"kind\":\"object\",\"type\":\"ProductVariant\",\"relationName\":\"Product_Variant\"},{\"name\":\"brand\",\"kind\":\"object\",\"type\":\"ProductBrand\",\"relationName\":\"Product_Brand\"},{\"name\":\"brandId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"category\",\"kind\":\"object\",\"type\":\"ProductCategory\",\"relationName\":\"Product_Category\"},{\"name\":\"categoryId\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"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\"}],\"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\"}],\"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\"}],\"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\"}],\"dbName\":\"Stores\"}},\"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\":\"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\":null},\"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\":null},\"stock_view\":{\"fields\":[{\"name\":\"productId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"inventoryId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"stock\",\"kind\":\"scalar\",\"type\":\"Decimal\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') @@ -273,6 +275,146 @@ export interface PrismaClient< * ``` */ get store(): Prisma.StoreDelegate; + + /** + * `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; + + /** + * `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; + + /** + * `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; + + /** + * `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; + + /** + * `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; + + /** + * `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; + + /** + * `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; + + /** + * `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; + + /** + * `prisma.inventoryTransfer`: Exposes CRUD operations for the **InventoryTransfer** model. + * Example usage: + * ```ts + * // Fetch zero or more InventoryTransfers + * const inventoryTransfers = await prisma.inventoryTransfer.findMany() + * ``` + */ + get inventoryTransfer(): Prisma.InventoryTransferDelegate; + + /** + * `prisma.inventoryTransferItem`: Exposes CRUD operations for the **InventoryTransferItem** model. + * Example usage: + * ```ts + * // Fetch zero or more InventoryTransferItems + * const inventoryTransferItems = await prisma.inventoryTransferItem.findMany() + * ``` + */ + get inventoryTransferItem(): Prisma.InventoryTransferItemDelegate; + + /** + * `prisma.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; + + /** + * `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; + + /** + * `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; + + /** + * `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; } export function getPrismaClientClass(): PrismaClientConstructor { diff --git a/src/generated/prisma/internal/prismaNamespace.ts b/src/generated/prisma/internal/prismaNamespace.ts index 1122910..ef09a51 100644 --- a/src/generated/prisma/internal/prismaNamespace.ts +++ b/src/generated/prisma/internal/prismaNamespace.ts @@ -393,7 +393,21 @@ export const ModelName = { Supplier: 'Supplier', Customer: 'Customer', Inventory: 'Inventory', - Store: 'Store' + Store: 'Store', + ProductCharge: 'ProductCharge', + Order: 'Order', + PurchaseReceipt: 'PurchaseReceipt', + PurchaseReceiptItem: 'PurchaseReceiptItem', + SalesInvoice: 'SalesInvoice', + SalesInvoiceItem: 'SalesInvoiceItem', + StockMovement: 'StockMovement', + StockBalance: 'StockBalance', + InventoryTransfer: 'InventoryTransfer', + InventoryTransferItem: 'InventoryTransferItem', + StockAdjustment: 'StockAdjustment', + inventory_overview: 'inventory_overview', + stock_cardex: 'stock_cardex', + stock_view: 'stock_view' } as const export type ModelName = (typeof ModelName)[keyof typeof ModelName] @@ -409,7 +423,7 @@ export type TypeMap + fields: Prisma.ProductChargeFieldRefs + operations: { + findUnique: { + args: Prisma.ProductChargeFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.ProductChargeFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.ProductChargeFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.ProductChargeFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.ProductChargeFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.ProductChargeCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.ProductChargeCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.ProductChargeDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.ProductChargeUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.ProductChargeDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.ProductChargeUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.ProductChargeUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.ProductChargeAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.ProductChargeGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.ProductChargeCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Order: { + payload: Prisma.$OrderPayload + fields: Prisma.OrderFieldRefs + operations: { + findUnique: { + args: Prisma.OrderFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.OrderFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.OrderFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.OrderFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.OrderFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.OrderCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.OrderCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.OrderDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.OrderUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.OrderDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.OrderUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.OrderUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.OrderAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.OrderGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.OrderCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + PurchaseReceipt: { + payload: Prisma.$PurchaseReceiptPayload + fields: Prisma.PurchaseReceiptFieldRefs + operations: { + findUnique: { + args: Prisma.PurchaseReceiptFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.PurchaseReceiptFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.PurchaseReceiptFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.PurchaseReceiptFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.PurchaseReceiptFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.PurchaseReceiptCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.PurchaseReceiptCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.PurchaseReceiptDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.PurchaseReceiptUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.PurchaseReceiptDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.PurchaseReceiptUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.PurchaseReceiptUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.PurchaseReceiptAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.PurchaseReceiptGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.PurchaseReceiptCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + PurchaseReceiptItem: { + payload: Prisma.$PurchaseReceiptItemPayload + fields: Prisma.PurchaseReceiptItemFieldRefs + operations: { + findUnique: { + args: Prisma.PurchaseReceiptItemFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.PurchaseReceiptItemFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.PurchaseReceiptItemFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.PurchaseReceiptItemFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.PurchaseReceiptItemFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.PurchaseReceiptItemCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.PurchaseReceiptItemCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.PurchaseReceiptItemDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.PurchaseReceiptItemUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.PurchaseReceiptItemDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.PurchaseReceiptItemUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.PurchaseReceiptItemUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.PurchaseReceiptItemAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.PurchaseReceiptItemGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.PurchaseReceiptItemCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + SalesInvoice: { + payload: Prisma.$SalesInvoicePayload + fields: Prisma.SalesInvoiceFieldRefs + operations: { + findUnique: { + args: Prisma.SalesInvoiceFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.SalesInvoiceFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.SalesInvoiceFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.SalesInvoiceFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.SalesInvoiceFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.SalesInvoiceCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.SalesInvoiceCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.SalesInvoiceDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.SalesInvoiceUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.SalesInvoiceDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.SalesInvoiceUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.SalesInvoiceUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.SalesInvoiceAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.SalesInvoiceGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.SalesInvoiceCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + SalesInvoiceItem: { + payload: Prisma.$SalesInvoiceItemPayload + fields: Prisma.SalesInvoiceItemFieldRefs + operations: { + findUnique: { + args: Prisma.SalesInvoiceItemFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.SalesInvoiceItemFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.SalesInvoiceItemFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.SalesInvoiceItemFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.SalesInvoiceItemFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.SalesInvoiceItemCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.SalesInvoiceItemCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.SalesInvoiceItemDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.SalesInvoiceItemUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.SalesInvoiceItemDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.SalesInvoiceItemUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.SalesInvoiceItemUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.SalesInvoiceItemAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.SalesInvoiceItemGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.SalesInvoiceItemCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + StockMovement: { + payload: Prisma.$StockMovementPayload + fields: Prisma.StockMovementFieldRefs + operations: { + findUnique: { + args: Prisma.StockMovementFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.StockMovementFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.StockMovementFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.StockMovementFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.StockMovementFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.StockMovementCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.StockMovementCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.StockMovementDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.StockMovementUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.StockMovementDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.StockMovementUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.StockMovementUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.StockMovementAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.StockMovementGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.StockMovementCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + StockBalance: { + payload: Prisma.$StockBalancePayload + fields: Prisma.StockBalanceFieldRefs + operations: { + findUnique: { + args: Prisma.StockBalanceFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.StockBalanceFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.StockBalanceFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.StockBalanceFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.StockBalanceFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.StockBalanceCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.StockBalanceCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.StockBalanceDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.StockBalanceUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.StockBalanceDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.StockBalanceUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.StockBalanceUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.StockBalanceAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.StockBalanceGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.StockBalanceCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + InventoryTransfer: { + payload: Prisma.$InventoryTransferPayload + fields: Prisma.InventoryTransferFieldRefs + operations: { + findUnique: { + args: Prisma.InventoryTransferFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.InventoryTransferFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.InventoryTransferFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.InventoryTransferFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.InventoryTransferFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.InventoryTransferCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.InventoryTransferCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.InventoryTransferDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.InventoryTransferUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.InventoryTransferDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.InventoryTransferUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.InventoryTransferUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.InventoryTransferAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.InventoryTransferGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.InventoryTransferCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + InventoryTransferItem: { + payload: Prisma.$InventoryTransferItemPayload + fields: Prisma.InventoryTransferItemFieldRefs + operations: { + findUnique: { + args: Prisma.InventoryTransferItemFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.InventoryTransferItemFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.InventoryTransferItemFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.InventoryTransferItemFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.InventoryTransferItemFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.InventoryTransferItemCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.InventoryTransferItemCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.InventoryTransferItemDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.InventoryTransferItemUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.InventoryTransferItemDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.InventoryTransferItemUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.InventoryTransferItemUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.InventoryTransferItemAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.InventoryTransferItemGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.InventoryTransferItemCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + StockAdjustment: { + payload: Prisma.$StockAdjustmentPayload + fields: Prisma.StockAdjustmentFieldRefs + operations: { + findUnique: { + args: Prisma.StockAdjustmentFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.StockAdjustmentFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.StockAdjustmentFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.StockAdjustmentFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.StockAdjustmentFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.StockAdjustmentCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.StockAdjustmentCreateManyArgs + result: BatchPayload + } + delete: { + args: Prisma.StockAdjustmentDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.StockAdjustmentUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.StockAdjustmentDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.StockAdjustmentUpdateManyArgs + result: BatchPayload + } + upsert: { + args: Prisma.StockAdjustmentUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.StockAdjustmentAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.StockAdjustmentGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.StockAdjustmentCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + inventory_overview: { + payload: Prisma.$inventory_overviewPayload + fields: Prisma.inventory_overviewFieldRefs + operations: { + findFirst: { + args: Prisma.inventory_overviewFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.inventory_overviewFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.inventory_overviewFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + aggregate: { + args: Prisma.Inventory_overviewAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.inventory_overviewGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.inventory_overviewCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + stock_cardex: { + payload: Prisma.$stock_cardexPayload + fields: Prisma.stock_cardexFieldRefs + operations: { + findFirst: { + args: Prisma.stock_cardexFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.stock_cardexFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.stock_cardexFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + aggregate: { + args: Prisma.Stock_cardexAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.stock_cardexGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.stock_cardexCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + stock_view: { + payload: Prisma.$stock_viewPayload + fields: Prisma.stock_viewFieldRefs + operations: { + findFirst: { + args: Prisma.stock_viewFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.stock_viewFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.stock_viewFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + aggregate: { + args: Prisma.Stock_viewAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.stock_viewGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.stock_viewCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } } } & { other: { @@ -1118,7 +1948,10 @@ export const UserScalarFieldEnum = { password: 'password', firstName: 'firstName', lastName: 'lastName', - roleId: 'roleId' + roleId: 'roleId', + createdAt: 'createdAt', + deletedAt: 'deletedAt', + updatedAt: 'updatedAt' } as const export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] @@ -1162,9 +1995,9 @@ export type ProductVariantScalarFieldEnum = (typeof ProductVariantScalarFieldEnu export const ProductScalarFieldEnum = { id: 'id', name: 'name', - barcode: 'barcode', - sku: 'sku', description: 'description', + sku: 'sku', + barcode: 'barcode', createdAt: 'createdAt', updatedAt: 'updatedAt', deletedAt: 'deletedAt', @@ -1245,7 +2078,8 @@ export const InventoryScalarFieldEnum = { location: 'location', isActive: 'isActive', createdAt: 'createdAt', - updatedAt: 'updatedAt' + updatedAt: 'updatedAt', + deletedAt: 'deletedAt' } as const export type InventoryScalarFieldEnum = (typeof InventoryScalarFieldEnum)[keyof typeof InventoryScalarFieldEnum] @@ -1257,12 +2091,196 @@ export const StoreScalarFieldEnum = { location: 'location', isActive: 'isActive', createdAt: 'createdAt', - updatedAt: 'updatedAt' + updatedAt: 'updatedAt', + deletedAt: 'deletedAt' } as const export type StoreScalarFieldEnum = (typeof StoreScalarFieldEnum)[keyof typeof StoreScalarFieldEnum] +export const ProductChargeScalarFieldEnum = { + id: 'id', + count: 'count', + fee: 'fee', + totalAmount: 'totalAmount', + isSettled: 'isSettled', + buyAt: 'buyAt', + description: 'description', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + deletedAt: 'deletedAt', + productId: 'productId', + inventoryId: 'inventoryId', + supplierId: 'supplierId' +} as const + +export type ProductChargeScalarFieldEnum = (typeof ProductChargeScalarFieldEnum)[keyof typeof ProductChargeScalarFieldEnum] + + +export const OrderScalarFieldEnum = { + id: 'id', + orderNumber: 'orderNumber', + status: 'status', + paymentMethod: 'paymentMethod', + totalAmount: 'totalAmount', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + deletedAt: 'deletedAt', + customerId: 'customerId' +} as const + +export type OrderScalarFieldEnum = (typeof OrderScalarFieldEnum)[keyof typeof OrderScalarFieldEnum] + + +export const PurchaseReceiptScalarFieldEnum = { + id: 'id', + code: 'code', + totalAmount: 'totalAmount', + description: 'description', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + supplierId: 'supplierId', + inventoryId: 'inventoryId' +} as const + +export type PurchaseReceiptScalarFieldEnum = (typeof PurchaseReceiptScalarFieldEnum)[keyof typeof PurchaseReceiptScalarFieldEnum] + + +export const PurchaseReceiptItemScalarFieldEnum = { + id: 'id', + count: 'count', + fee: 'fee', + total: 'total', + createdAt: 'createdAt', + receiptId: 'receiptId', + productId: 'productId' +} as const + +export type PurchaseReceiptItemScalarFieldEnum = (typeof PurchaseReceiptItemScalarFieldEnum)[keyof typeof PurchaseReceiptItemScalarFieldEnum] + + +export const SalesInvoiceScalarFieldEnum = { + id: 'id', + code: 'code', + totalAmount: 'totalAmount', + description: 'description', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + customerId: 'customerId' +} as const + +export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum] + + +export const SalesInvoiceItemScalarFieldEnum = { + id: 'id', + count: 'count', + fee: 'fee', + total: 'total', + createdAt: 'createdAt', + invoiceId: 'invoiceId', + productId: 'productId' +} as const + +export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum] + + +export const StockMovementScalarFieldEnum = { + id: 'id', + type: 'type', + quantity: 'quantity', + fee: 'fee', + totalCost: 'totalCost', + referenceType: 'referenceType', + referenceId: 'referenceId', + createdAt: 'createdAt', + productId: 'productId', + inventoryId: 'inventoryId', + avgCost: 'avgCost' +} as const + +export type StockMovementScalarFieldEnum = (typeof StockMovementScalarFieldEnum)[keyof typeof StockMovementScalarFieldEnum] + + +export const StockBalanceScalarFieldEnum = { + quantity: 'quantity', + totalCost: 'totalCost', + updatedAt: 'updatedAt', + ProductId: 'ProductId', + avgCost: 'avgCost' +} as const + +export type StockBalanceScalarFieldEnum = (typeof StockBalanceScalarFieldEnum)[keyof typeof StockBalanceScalarFieldEnum] + + +export const InventoryTransferScalarFieldEnum = { + id: 'id', + code: 'code', + description: 'description', + createdAt: 'createdAt', + fromInventoryId: 'fromInventoryId', + toInventoryId: 'toInventoryId' +} as const + +export type InventoryTransferScalarFieldEnum = (typeof InventoryTransferScalarFieldEnum)[keyof typeof InventoryTransferScalarFieldEnum] + + +export const InventoryTransferItemScalarFieldEnum = { + id: 'id', + count: 'count', + productId: 'productId', + transferId: 'transferId' +} as const + +export type InventoryTransferItemScalarFieldEnum = (typeof InventoryTransferItemScalarFieldEnum)[keyof typeof InventoryTransferItemScalarFieldEnum] + + +export const StockAdjustmentScalarFieldEnum = { + id: 'id', + adjustedQuantity: 'adjustedQuantity', + createdAt: 'createdAt', + productId: 'productId', + inventoryId: 'inventoryId' +} as const + +export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldEnum)[keyof typeof StockAdjustmentScalarFieldEnum] + + +export const Inventory_overviewScalarFieldEnum = { + ProductId: 'ProductId', + stock_quantity: 'stock_quantity', + avgCost: 'avgCost', + totalCost: 'totalCost', + updatedAt: 'updatedAt' +} as const + +export type Inventory_overviewScalarFieldEnum = (typeof Inventory_overviewScalarFieldEnum)[keyof typeof Inventory_overviewScalarFieldEnum] + + +export const Stock_cardexScalarFieldEnum = { + productId: 'productId', + movement_id: 'movement_id', + type: 'type', + quantity: 'quantity', + fee: 'fee', + totalCost: 'totalCost', + balance_quantity: 'balance_quantity', + balance_avg_cost: 'balance_avg_cost', + createdAt: 'createdAt' +} as const + +export type Stock_cardexScalarFieldEnum = (typeof Stock_cardexScalarFieldEnum)[keyof typeof Stock_cardexScalarFieldEnum] + + +export const Stock_viewScalarFieldEnum = { + productId: 'productId', + inventoryId: 'inventoryId', + stock: 'stock' +} as const + +export type Stock_viewScalarFieldEnum = (typeof Stock_viewScalarFieldEnum)[keyof typeof Stock_viewScalarFieldEnum] + + export const SortOrder = { asc: 'asc', desc: 'desc' @@ -1279,6 +2297,14 @@ export const NullableJsonNullValueInput = { export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput] +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + export const UserOrderByRelevanceFieldEnum = { mobileNumber: 'mobileNumber', password: 'password', @@ -1306,14 +2332,6 @@ export const QueryMode = { export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] -export const NullsOrder = { - first: 'first', - last: 'last' -} as const - -export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] - - export const RoleOrderByRelevanceFieldEnum = { name: 'name', description: 'description' @@ -1335,9 +2353,9 @@ export type ProductVariantOrderByRelevanceFieldEnum = (typeof ProductVariantOrde export const ProductOrderByRelevanceFieldEnum = { name: 'name', - barcode: 'barcode', + description: 'description', sku: 'sku', - description: 'description' + barcode: 'barcode' } as const export type ProductOrderByRelevanceFieldEnum = (typeof ProductOrderByRelevanceFieldEnum)[keyof typeof ProductOrderByRelevanceFieldEnum] @@ -1405,6 +2423,51 @@ export const StoreOrderByRelevanceFieldEnum = { export type StoreOrderByRelevanceFieldEnum = (typeof StoreOrderByRelevanceFieldEnum)[keyof typeof StoreOrderByRelevanceFieldEnum] +export const ProductChargeOrderByRelevanceFieldEnum = { + description: 'description' +} as const + +export type ProductChargeOrderByRelevanceFieldEnum = (typeof ProductChargeOrderByRelevanceFieldEnum)[keyof typeof ProductChargeOrderByRelevanceFieldEnum] + + +export const OrderOrderByRelevanceFieldEnum = { + orderNumber: 'orderNumber' +} as const + +export type OrderOrderByRelevanceFieldEnum = (typeof OrderOrderByRelevanceFieldEnum)[keyof typeof OrderOrderByRelevanceFieldEnum] + + +export const PurchaseReceiptOrderByRelevanceFieldEnum = { + code: 'code', + description: 'description' +} as const + +export type PurchaseReceiptOrderByRelevanceFieldEnum = (typeof PurchaseReceiptOrderByRelevanceFieldEnum)[keyof typeof PurchaseReceiptOrderByRelevanceFieldEnum] + + +export const SalesInvoiceOrderByRelevanceFieldEnum = { + code: 'code', + description: 'description' +} as const + +export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum] + + +export const StockMovementOrderByRelevanceFieldEnum = { + referenceId: 'referenceId' +} as const + +export type StockMovementOrderByRelevanceFieldEnum = (typeof StockMovementOrderByRelevanceFieldEnum)[keyof typeof StockMovementOrderByRelevanceFieldEnum] + + +export const InventoryTransferOrderByRelevanceFieldEnum = { + code: 'code', + description: 'description' +} as const + +export type InventoryTransferOrderByRelevanceFieldEnum = (typeof InventoryTransferOrderByRelevanceFieldEnum)[keyof typeof InventoryTransferOrderByRelevanceFieldEnum] + + /** * Field references @@ -1425,6 +2488,13 @@ export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, +/** + * Reference to a field of type 'DateTime' + */ +export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> + + + /** * Reference to a field of type 'Json' */ @@ -1439,13 +2509,6 @@ export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$Prisma -/** - * Reference to a field of type 'DateTime' - */ -export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> - - - /** * Reference to a field of type 'Decimal' */ @@ -1460,6 +2523,41 @@ export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, +/** + * Reference to a field of type 'OrderStatus' + */ +export type EnumOrderStatusFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'OrderStatus'> + + + +/** + * Reference to a field of type 'paymentMethod' + */ +export type EnumpaymentMethodFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'paymentMethod'> + + + +/** + * Reference to a field of type 'MovementType' + */ +export type EnumMovementTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'MovementType'> + + + +/** + * Reference to a field of type 'MovementReferenceType' + */ +export type EnumMovementReferenceTypeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'MovementReferenceType'> + + + +/** + * Reference to a field of type 'stock_cardex_type' + */ +export type Enumstock_cardex_typeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'stock_cardex_type'> + + + /** * Reference to a field of type 'Float' */ @@ -1571,6 +2669,20 @@ export type GlobalOmitConfig = { customer?: Prisma.CustomerOmit inventory?: Prisma.InventoryOmit store?: Prisma.StoreOmit + productCharge?: Prisma.ProductChargeOmit + order?: Prisma.OrderOmit + purchaseReceipt?: Prisma.PurchaseReceiptOmit + purchaseReceiptItem?: Prisma.PurchaseReceiptItemOmit + salesInvoice?: Prisma.SalesInvoiceOmit + salesInvoiceItem?: Prisma.SalesInvoiceItemOmit + stockMovement?: Prisma.StockMovementOmit + stockBalance?: Prisma.StockBalanceOmit + inventoryTransfer?: Prisma.InventoryTransferOmit + inventoryTransferItem?: Prisma.InventoryTransferItemOmit + stockAdjustment?: Prisma.StockAdjustmentOmit + inventory_overview?: Prisma.inventory_overviewOmit + stock_cardex?: Prisma.stock_cardexOmit + stock_view?: Prisma.stock_viewOmit } /* Types for Logging */ diff --git a/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/src/generated/prisma/internal/prismaNamespaceBrowser.ts index eb084ca..3b02643 100644 --- a/src/generated/prisma/internal/prismaNamespaceBrowser.ts +++ b/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -60,7 +60,21 @@ export const ModelName = { Supplier: 'Supplier', Customer: 'Customer', Inventory: 'Inventory', - Store: 'Store' + Store: 'Store', + ProductCharge: 'ProductCharge', + Order: 'Order', + PurchaseReceipt: 'PurchaseReceipt', + PurchaseReceiptItem: 'PurchaseReceiptItem', + SalesInvoice: 'SalesInvoice', + SalesInvoiceItem: 'SalesInvoiceItem', + StockMovement: 'StockMovement', + StockBalance: 'StockBalance', + InventoryTransfer: 'InventoryTransfer', + InventoryTransferItem: 'InventoryTransferItem', + StockAdjustment: 'StockAdjustment', + inventory_overview: 'inventory_overview', + stock_cardex: 'stock_cardex', + stock_view: 'stock_view' } as const export type ModelName = (typeof ModelName)[keyof typeof ModelName] @@ -85,7 +99,10 @@ export const UserScalarFieldEnum = { password: 'password', firstName: 'firstName', lastName: 'lastName', - roleId: 'roleId' + roleId: 'roleId', + createdAt: 'createdAt', + deletedAt: 'deletedAt', + updatedAt: 'updatedAt' } as const export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] @@ -129,9 +146,9 @@ export type ProductVariantScalarFieldEnum = (typeof ProductVariantScalarFieldEnu export const ProductScalarFieldEnum = { id: 'id', name: 'name', - barcode: 'barcode', - sku: 'sku', description: 'description', + sku: 'sku', + barcode: 'barcode', createdAt: 'createdAt', updatedAt: 'updatedAt', deletedAt: 'deletedAt', @@ -212,7 +229,8 @@ export const InventoryScalarFieldEnum = { location: 'location', isActive: 'isActive', createdAt: 'createdAt', - updatedAt: 'updatedAt' + updatedAt: 'updatedAt', + deletedAt: 'deletedAt' } as const export type InventoryScalarFieldEnum = (typeof InventoryScalarFieldEnum)[keyof typeof InventoryScalarFieldEnum] @@ -224,12 +242,196 @@ export const StoreScalarFieldEnum = { location: 'location', isActive: 'isActive', createdAt: 'createdAt', - updatedAt: 'updatedAt' + updatedAt: 'updatedAt', + deletedAt: 'deletedAt' } as const export type StoreScalarFieldEnum = (typeof StoreScalarFieldEnum)[keyof typeof StoreScalarFieldEnum] +export const ProductChargeScalarFieldEnum = { + id: 'id', + count: 'count', + fee: 'fee', + totalAmount: 'totalAmount', + isSettled: 'isSettled', + buyAt: 'buyAt', + description: 'description', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + deletedAt: 'deletedAt', + productId: 'productId', + inventoryId: 'inventoryId', + supplierId: 'supplierId' +} as const + +export type ProductChargeScalarFieldEnum = (typeof ProductChargeScalarFieldEnum)[keyof typeof ProductChargeScalarFieldEnum] + + +export const OrderScalarFieldEnum = { + id: 'id', + orderNumber: 'orderNumber', + status: 'status', + paymentMethod: 'paymentMethod', + totalAmount: 'totalAmount', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + deletedAt: 'deletedAt', + customerId: 'customerId' +} as const + +export type OrderScalarFieldEnum = (typeof OrderScalarFieldEnum)[keyof typeof OrderScalarFieldEnum] + + +export const PurchaseReceiptScalarFieldEnum = { + id: 'id', + code: 'code', + totalAmount: 'totalAmount', + description: 'description', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + supplierId: 'supplierId', + inventoryId: 'inventoryId' +} as const + +export type PurchaseReceiptScalarFieldEnum = (typeof PurchaseReceiptScalarFieldEnum)[keyof typeof PurchaseReceiptScalarFieldEnum] + + +export const PurchaseReceiptItemScalarFieldEnum = { + id: 'id', + count: 'count', + fee: 'fee', + total: 'total', + createdAt: 'createdAt', + receiptId: 'receiptId', + productId: 'productId' +} as const + +export type PurchaseReceiptItemScalarFieldEnum = (typeof PurchaseReceiptItemScalarFieldEnum)[keyof typeof PurchaseReceiptItemScalarFieldEnum] + + +export const SalesInvoiceScalarFieldEnum = { + id: 'id', + code: 'code', + totalAmount: 'totalAmount', + description: 'description', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + customerId: 'customerId' +} as const + +export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum] + + +export const SalesInvoiceItemScalarFieldEnum = { + id: 'id', + count: 'count', + fee: 'fee', + total: 'total', + createdAt: 'createdAt', + invoiceId: 'invoiceId', + productId: 'productId' +} as const + +export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum] + + +export const StockMovementScalarFieldEnum = { + id: 'id', + type: 'type', + quantity: 'quantity', + fee: 'fee', + totalCost: 'totalCost', + referenceType: 'referenceType', + referenceId: 'referenceId', + createdAt: 'createdAt', + productId: 'productId', + inventoryId: 'inventoryId', + avgCost: 'avgCost' +} as const + +export type StockMovementScalarFieldEnum = (typeof StockMovementScalarFieldEnum)[keyof typeof StockMovementScalarFieldEnum] + + +export const StockBalanceScalarFieldEnum = { + quantity: 'quantity', + totalCost: 'totalCost', + updatedAt: 'updatedAt', + ProductId: 'ProductId', + avgCost: 'avgCost' +} as const + +export type StockBalanceScalarFieldEnum = (typeof StockBalanceScalarFieldEnum)[keyof typeof StockBalanceScalarFieldEnum] + + +export const InventoryTransferScalarFieldEnum = { + id: 'id', + code: 'code', + description: 'description', + createdAt: 'createdAt', + fromInventoryId: 'fromInventoryId', + toInventoryId: 'toInventoryId' +} as const + +export type InventoryTransferScalarFieldEnum = (typeof InventoryTransferScalarFieldEnum)[keyof typeof InventoryTransferScalarFieldEnum] + + +export const InventoryTransferItemScalarFieldEnum = { + id: 'id', + count: 'count', + productId: 'productId', + transferId: 'transferId' +} as const + +export type InventoryTransferItemScalarFieldEnum = (typeof InventoryTransferItemScalarFieldEnum)[keyof typeof InventoryTransferItemScalarFieldEnum] + + +export const StockAdjustmentScalarFieldEnum = { + id: 'id', + adjustedQuantity: 'adjustedQuantity', + createdAt: 'createdAt', + productId: 'productId', + inventoryId: 'inventoryId' +} as const + +export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldEnum)[keyof typeof StockAdjustmentScalarFieldEnum] + + +export const Inventory_overviewScalarFieldEnum = { + ProductId: 'ProductId', + stock_quantity: 'stock_quantity', + avgCost: 'avgCost', + totalCost: 'totalCost', + updatedAt: 'updatedAt' +} as const + +export type Inventory_overviewScalarFieldEnum = (typeof Inventory_overviewScalarFieldEnum)[keyof typeof Inventory_overviewScalarFieldEnum] + + +export const Stock_cardexScalarFieldEnum = { + productId: 'productId', + movement_id: 'movement_id', + type: 'type', + quantity: 'quantity', + fee: 'fee', + totalCost: 'totalCost', + balance_quantity: 'balance_quantity', + balance_avg_cost: 'balance_avg_cost', + createdAt: 'createdAt' +} as const + +export type Stock_cardexScalarFieldEnum = (typeof Stock_cardexScalarFieldEnum)[keyof typeof Stock_cardexScalarFieldEnum] + + +export const Stock_viewScalarFieldEnum = { + productId: 'productId', + inventoryId: 'inventoryId', + stock: 'stock' +} as const + +export type Stock_viewScalarFieldEnum = (typeof Stock_viewScalarFieldEnum)[keyof typeof Stock_viewScalarFieldEnum] + + export const SortOrder = { asc: 'asc', desc: 'desc' @@ -246,6 +448,14 @@ export const NullableJsonNullValueInput = { export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput] +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + export const UserOrderByRelevanceFieldEnum = { mobileNumber: 'mobileNumber', password: 'password', @@ -273,14 +483,6 @@ export const QueryMode = { export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] -export const NullsOrder = { - first: 'first', - last: 'last' -} as const - -export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] - - export const RoleOrderByRelevanceFieldEnum = { name: 'name', description: 'description' @@ -302,9 +504,9 @@ export type ProductVariantOrderByRelevanceFieldEnum = (typeof ProductVariantOrde export const ProductOrderByRelevanceFieldEnum = { name: 'name', - barcode: 'barcode', + description: 'description', sku: 'sku', - description: 'description' + barcode: 'barcode' } as const export type ProductOrderByRelevanceFieldEnum = (typeof ProductOrderByRelevanceFieldEnum)[keyof typeof ProductOrderByRelevanceFieldEnum] @@ -371,3 +573,48 @@ export const StoreOrderByRelevanceFieldEnum = { export type StoreOrderByRelevanceFieldEnum = (typeof StoreOrderByRelevanceFieldEnum)[keyof typeof StoreOrderByRelevanceFieldEnum] + +export const ProductChargeOrderByRelevanceFieldEnum = { + description: 'description' +} as const + +export type ProductChargeOrderByRelevanceFieldEnum = (typeof ProductChargeOrderByRelevanceFieldEnum)[keyof typeof ProductChargeOrderByRelevanceFieldEnum] + + +export const OrderOrderByRelevanceFieldEnum = { + orderNumber: 'orderNumber' +} as const + +export type OrderOrderByRelevanceFieldEnum = (typeof OrderOrderByRelevanceFieldEnum)[keyof typeof OrderOrderByRelevanceFieldEnum] + + +export const PurchaseReceiptOrderByRelevanceFieldEnum = { + code: 'code', + description: 'description' +} as const + +export type PurchaseReceiptOrderByRelevanceFieldEnum = (typeof PurchaseReceiptOrderByRelevanceFieldEnum)[keyof typeof PurchaseReceiptOrderByRelevanceFieldEnum] + + +export const SalesInvoiceOrderByRelevanceFieldEnum = { + code: 'code', + description: 'description' +} as const + +export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum] + + +export const StockMovementOrderByRelevanceFieldEnum = { + referenceId: 'referenceId' +} as const + +export type StockMovementOrderByRelevanceFieldEnum = (typeof StockMovementOrderByRelevanceFieldEnum)[keyof typeof StockMovementOrderByRelevanceFieldEnum] + + +export const InventoryTransferOrderByRelevanceFieldEnum = { + code: 'code', + description: 'description' +} as const + +export type InventoryTransferOrderByRelevanceFieldEnum = (typeof InventoryTransferOrderByRelevanceFieldEnum)[keyof typeof InventoryTransferOrderByRelevanceFieldEnum] + diff --git a/src/generated/prisma/models.ts b/src/generated/prisma/models.ts index d38d0b0..55b9c24 100644 --- a/src/generated/prisma/models.ts +++ b/src/generated/prisma/models.ts @@ -18,4 +18,18 @@ export type * from './models/Supplier.js' export type * from './models/Customer.js' export type * from './models/Inventory.js' export type * from './models/Store.js' +export type * from './models/ProductCharge.js' +export type * from './models/Order.js' +export type * from './models/PurchaseReceipt.js' +export type * from './models/PurchaseReceiptItem.js' +export type * from './models/SalesInvoice.js' +export type * from './models/SalesInvoiceItem.js' +export type * from './models/StockMovement.js' +export type * from './models/StockBalance.js' +export type * from './models/InventoryTransfer.js' +export type * from './models/InventoryTransferItem.js' +export type * from './models/StockAdjustment.js' +export type * from './models/inventory_overview.js' +export type * from './models/stock_cardex.js' +export type * from './models/stock_view.js' export type * from './commonInputTypes.js' \ No newline at end of file diff --git a/src/generated/prisma/models/Customer.ts b/src/generated/prisma/models/Customer.ts index 683525a..3cedab8 100644 --- a/src/generated/prisma/models/Customer.ts +++ b/src/generated/prisma/models/Customer.ts @@ -238,8 +238,8 @@ export type CustomerGroupByOutputType = { state: string | null country: string | null isActive: boolean - createdAt: Date | null - updatedAt: Date | null + createdAt: Date + updatedAt: Date deletedAt: Date | null _count: CustomerCountAggregateOutputType | null _avg: CustomerAvgAggregateOutputType | null @@ -277,9 +277,11 @@ export type CustomerWhereInput = { state?: Prisma.StringNullableFilter<"Customer"> | string | null country?: Prisma.StringNullableFilter<"Customer"> | string | null isActive?: Prisma.BoolFilter<"Customer"> | boolean - createdAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null + createdAt?: Prisma.DateTimeFilter<"Customer"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Customer"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null + orders?: Prisma.OrderListRelationFilter + salesInvoices?: Prisma.SalesInvoiceListRelationFilter } export type CustomerOrderByWithRelationInput = { @@ -293,9 +295,11 @@ export type CustomerOrderByWithRelationInput = { state?: Prisma.SortOrderInput | Prisma.SortOrder country?: Prisma.SortOrderInput | Prisma.SortOrder isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrderInput | Prisma.SortOrder - updatedAt?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + orders?: Prisma.OrderOrderByRelationAggregateInput + salesInvoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput _relevance?: Prisma.CustomerOrderByRelevanceInput } @@ -313,9 +317,11 @@ export type CustomerWhereUniqueInput = Prisma.AtLeast<{ state?: Prisma.StringNullableFilter<"Customer"> | string | null country?: Prisma.StringNullableFilter<"Customer"> | string | null isActive?: Prisma.BoolFilter<"Customer"> | boolean - createdAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null + createdAt?: Prisma.DateTimeFilter<"Customer"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Customer"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null + orders?: Prisma.OrderListRelationFilter + salesInvoices?: Prisma.SalesInvoiceListRelationFilter }, "id" | "mobileNumber"> export type CustomerOrderByWithAggregationInput = { @@ -329,8 +335,8 @@ export type CustomerOrderByWithAggregationInput = { state?: Prisma.SortOrderInput | Prisma.SortOrder country?: Prisma.SortOrderInput | Prisma.SortOrder isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrderInput | Prisma.SortOrder - updatedAt?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.CustomerCountOrderByAggregateInput _avg?: Prisma.CustomerAvgOrderByAggregateInput @@ -353,8 +359,8 @@ export type CustomerScalarWhereWithAggregatesInput = { state?: Prisma.StringNullableWithAggregatesFilter<"Customer"> | string | null country?: Prisma.StringNullableWithAggregatesFilter<"Customer"> | string | null isActive?: Prisma.BoolWithAggregatesFilter<"Customer"> | boolean - createdAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Customer"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Customer"> | Date | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Customer"> | Date | string deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Customer"> | Date | string | null } @@ -368,9 +374,11 @@ export type CustomerCreateInput = { state?: string | null country?: string | null isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null + orders?: Prisma.OrderCreateNestedManyWithoutCustomerInput + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput } export type CustomerUncheckedCreateInput = { @@ -384,9 +392,11 @@ export type CustomerUncheckedCreateInput = { state?: string | null country?: string | null isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null + orders?: Prisma.OrderUncheckedCreateNestedManyWithoutCustomerInput + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput } export type CustomerUpdateInput = { @@ -399,9 +409,11 @@ export type CustomerUpdateInput = { state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + orders?: Prisma.OrderUpdateManyWithoutCustomerNestedInput + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput } export type CustomerUncheckedUpdateInput = { @@ -415,9 +427,11 @@ export type CustomerUncheckedUpdateInput = { state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + orders?: Prisma.OrderUncheckedUpdateManyWithoutCustomerNestedInput + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput } export type CustomerCreateManyInput = { @@ -431,8 +445,8 @@ export type CustomerCreateManyInput = { state?: string | null country?: string | null isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null } @@ -446,8 +460,8 @@ export type CustomerUpdateManyMutationInput = { state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -462,8 +476,8 @@ export type CustomerUncheckedUpdateManyInput = { state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -529,6 +543,248 @@ export type CustomerSumOrderByAggregateInput = { id?: Prisma.SortOrder } +export type CustomerScalarRelationFilter = { + is?: Prisma.CustomerWhereInput + isNot?: Prisma.CustomerWhereInput +} + +export type CustomerNullableScalarRelationFilter = { + is?: Prisma.CustomerWhereInput | null + isNot?: Prisma.CustomerWhereInput | null +} + +export type CustomerCreateNestedOneWithoutOrdersInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutOrdersInput + connect?: Prisma.CustomerWhereUniqueInput +} + +export type CustomerUpdateOneRequiredWithoutOrdersNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutOrdersInput + upsert?: Prisma.CustomerUpsertWithoutOrdersInput + connect?: Prisma.CustomerWhereUniqueInput + update?: Prisma.XOR, Prisma.CustomerUncheckedUpdateWithoutOrdersInput> +} + +export type CustomerCreateNestedOneWithoutSalesInvoicesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutSalesInvoicesInput + connect?: Prisma.CustomerWhereUniqueInput +} + +export type CustomerUpdateOneWithoutSalesInvoicesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutSalesInvoicesInput + upsert?: Prisma.CustomerUpsertWithoutSalesInvoicesInput + disconnect?: Prisma.CustomerWhereInput | boolean + delete?: Prisma.CustomerWhereInput | boolean + connect?: Prisma.CustomerWhereUniqueInput + update?: Prisma.XOR, Prisma.CustomerUncheckedUpdateWithoutSalesInvoicesInput> +} + +export type CustomerCreateWithoutOrdersInput = { + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput +} + +export type CustomerUncheckedCreateWithoutOrdersInput = { + id?: number + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput +} + +export type CustomerCreateOrConnectWithoutOrdersInput = { + where: Prisma.CustomerWhereUniqueInput + create: Prisma.XOR +} + +export type CustomerUpsertWithoutOrdersInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.CustomerWhereInput +} + +export type CustomerUpdateToOneWithWhereWithoutOrdersInput = { + where?: Prisma.CustomerWhereInput + data: Prisma.XOR +} + +export type CustomerUpdateWithoutOrdersInput = { + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput +} + +export type CustomerUncheckedUpdateWithoutOrdersInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput +} + +export type CustomerCreateWithoutSalesInvoicesInput = { + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + orders?: Prisma.OrderCreateNestedManyWithoutCustomerInput +} + +export type CustomerUncheckedCreateWithoutSalesInvoicesInput = { + id?: number + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + orders?: Prisma.OrderUncheckedCreateNestedManyWithoutCustomerInput +} + +export type CustomerCreateOrConnectWithoutSalesInvoicesInput = { + where: Prisma.CustomerWhereUniqueInput + create: Prisma.XOR +} + +export type CustomerUpsertWithoutSalesInvoicesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.CustomerWhereInput +} + +export type CustomerUpdateToOneWithWhereWithoutSalesInvoicesInput = { + where?: Prisma.CustomerWhereInput + data: Prisma.XOR +} + +export type CustomerUpdateWithoutSalesInvoicesInput = { + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + orders?: Prisma.OrderUpdateManyWithoutCustomerNestedInput +} + +export type CustomerUncheckedUpdateWithoutSalesInvoicesInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + orders?: Prisma.OrderUncheckedUpdateManyWithoutCustomerNestedInput +} + + +/** + * Count Type CustomerCountOutputType + */ + +export type CustomerCountOutputType = { + orders: number + salesInvoices: number +} + +export type CustomerCountOutputTypeSelect = { + orders?: boolean | CustomerCountOutputTypeCountOrdersArgs + salesInvoices?: boolean | CustomerCountOutputTypeCountSalesInvoicesArgs +} + +/** + * CustomerCountOutputType without action + */ +export type CustomerCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the CustomerCountOutputType + */ + select?: Prisma.CustomerCountOutputTypeSelect | null +} + +/** + * CustomerCountOutputType without action + */ +export type CustomerCountOutputTypeCountOrdersArgs = { + where?: Prisma.OrderWhereInput +} + +/** + * CustomerCountOutputType without action + */ +export type CustomerCountOutputTypeCountSalesInvoicesArgs = { + where?: Prisma.SalesInvoiceWhereInput +} export type CustomerSelect = runtime.Types.Extensions.GetSelect<{ @@ -545,6 +801,9 @@ export type CustomerSelect + salesInvoices?: boolean | Prisma.Customer$salesInvoicesArgs + _count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs }, ExtArgs["result"]["customer"]> @@ -566,10 +825,18 @@ export type CustomerSelectScalar = { } export type CustomerOmit = runtime.Types.Extensions.GetOmit<"id" | "firstName" | "lastName" | "email" | "mobileNumber" | "address" | "city" | "state" | "country" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["customer"]> +export type CustomerInclude = { + orders?: boolean | Prisma.Customer$ordersArgs + salesInvoices?: boolean | Prisma.Customer$salesInvoicesArgs + _count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs +} export type $CustomerPayload = { name: "Customer" - objects: {} + objects: { + orders: Prisma.$OrderPayload[] + salesInvoices: Prisma.$SalesInvoicePayload[] + } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: number firstName: string @@ -581,8 +848,8 @@ export type $CustomerPayload composites: {} @@ -924,6 +1191,8 @@ readonly fields: CustomerFieldRefs; */ export interface Prisma__CustomerClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" + orders = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + salesInvoices = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -982,6 +1251,10 @@ export type CustomerFindUniqueArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null /** * Filter, which Customer to fetch. */ @@ -1000,6 +1273,10 @@ export type CustomerFindUniqueOrThrowArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null /** * Filter, which Customer to fetch. */ @@ -1018,6 +1295,10 @@ export type CustomerFindFirstArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null /** * Filter, which Customer to fetch. */ @@ -1066,6 +1347,10 @@ export type CustomerFindFirstOrThrowArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null /** * Filter, which Customer to fetch. */ @@ -1114,6 +1399,10 @@ export type CustomerFindManyArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null /** * Filter, which Customers to fetch. */ @@ -1157,6 +1446,10 @@ export type CustomerCreateArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null /** * The data needed to create a Customer. */ @@ -1186,6 +1479,10 @@ export type CustomerUpdateArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null /** * The data needed to update a Customer. */ @@ -1226,6 +1523,10 @@ export type CustomerUpsertArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null /** * The filter to search for the Customer to update in case it exists. */ @@ -1252,6 +1553,10 @@ export type CustomerDeleteArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null /** * Filter which Customer to delete. */ @@ -1272,6 +1577,54 @@ export type CustomerDeleteManyArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null + where?: Prisma.OrderWhereInput + orderBy?: Prisma.OrderOrderByWithRelationInput | Prisma.OrderOrderByWithRelationInput[] + cursor?: Prisma.OrderWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.OrderScalarFieldEnum | Prisma.OrderScalarFieldEnum[] +} + +/** + * Customer.salesInvoices + */ +export type Customer$salesInvoicesArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + where?: Prisma.SalesInvoiceWhereInput + orderBy?: Prisma.SalesInvoiceOrderByWithRelationInput | Prisma.SalesInvoiceOrderByWithRelationInput[] + cursor?: Prisma.SalesInvoiceWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.SalesInvoiceScalarFieldEnum | Prisma.SalesInvoiceScalarFieldEnum[] +} + /** * Customer without action */ @@ -1284,4 +1637,8 @@ export type CustomerDefaultArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null } diff --git a/src/generated/prisma/models/Inventory.ts b/src/generated/prisma/models/Inventory.ts index 9ffc5fc..faff616 100644 --- a/src/generated/prisma/models/Inventory.ts +++ b/src/generated/prisma/models/Inventory.ts @@ -41,6 +41,7 @@ export type InventoryMinAggregateOutputType = { isActive: boolean | null createdAt: Date | null updatedAt: Date | null + deletedAt: Date | null } export type InventoryMaxAggregateOutputType = { @@ -50,6 +51,7 @@ export type InventoryMaxAggregateOutputType = { isActive: boolean | null createdAt: Date | null updatedAt: Date | null + deletedAt: Date | null } export type InventoryCountAggregateOutputType = { @@ -59,6 +61,7 @@ export type InventoryCountAggregateOutputType = { isActive: number createdAt: number updatedAt: number + deletedAt: number _all: number } @@ -78,6 +81,7 @@ export type InventoryMinAggregateInputType = { isActive?: true createdAt?: true updatedAt?: true + deletedAt?: true } export type InventoryMaxAggregateInputType = { @@ -87,6 +91,7 @@ export type InventoryMaxAggregateInputType = { isActive?: true createdAt?: true updatedAt?: true + deletedAt?: true } export type InventoryCountAggregateInputType = { @@ -96,6 +101,7 @@ export type InventoryCountAggregateInputType = { isActive?: true createdAt?: true updatedAt?: true + deletedAt?: true _all?: true } @@ -192,6 +198,7 @@ export type InventoryGroupByOutputType = { isActive: boolean createdAt: Date updatedAt: Date + deletedAt: Date | null _count: InventoryCountAggregateOutputType | null _avg: InventoryAvgAggregateOutputType | null _sum: InventorySumAggregateOutputType | null @@ -224,6 +231,13 @@ export type InventoryWhereInput = { isActive?: Prisma.BoolFilter<"Inventory"> | boolean createdAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string updatedAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"Inventory"> | Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferListRelationFilter + inventoryTransfersTo?: Prisma.InventoryTransferListRelationFilter + productCharges?: Prisma.ProductChargeListRelationFilter + purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter + stockAdjustments?: Prisma.StockAdjustmentListRelationFilter + stockMovements?: Prisma.StockMovementListRelationFilter } export type InventoryOrderByWithRelationInput = { @@ -233,6 +247,13 @@ export type InventoryOrderByWithRelationInput = { isActive?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + inventoryTransfersFrom?: Prisma.InventoryTransferOrderByRelationAggregateInput + inventoryTransfersTo?: Prisma.InventoryTransferOrderByRelationAggregateInput + productCharges?: Prisma.ProductChargeOrderByRelationAggregateInput + purchaseReceipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput + stockAdjustments?: Prisma.StockAdjustmentOrderByRelationAggregateInput + stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput _relevance?: Prisma.InventoryOrderByRelevanceInput } @@ -246,6 +267,13 @@ export type InventoryWhereUniqueInput = Prisma.AtLeast<{ isActive?: Prisma.BoolFilter<"Inventory"> | boolean createdAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string updatedAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"Inventory"> | Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferListRelationFilter + inventoryTransfersTo?: Prisma.InventoryTransferListRelationFilter + productCharges?: Prisma.ProductChargeListRelationFilter + purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter + stockAdjustments?: Prisma.StockAdjustmentListRelationFilter + stockMovements?: Prisma.StockMovementListRelationFilter }, "id"> export type InventoryOrderByWithAggregationInput = { @@ -255,6 +283,7 @@ export type InventoryOrderByWithAggregationInput = { isActive?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.InventoryCountOrderByAggregateInput _avg?: Prisma.InventoryAvgOrderByAggregateInput _max?: Prisma.InventoryMaxOrderByAggregateInput @@ -272,14 +301,22 @@ export type InventoryScalarWhereWithAggregatesInput = { isActive?: Prisma.BoolWithAggregatesFilter<"Inventory"> | boolean createdAt?: Prisma.DateTimeWithAggregatesFilter<"Inventory"> | Date | string updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Inventory"> | Date | string + deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Inventory"> | Date | string | null } export type InventoryCreateInput = { name: string location?: string | null isActive?: boolean - createdAt: Date | string - updatedAt: Date | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput + inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput } export type InventoryUncheckedCreateInput = { @@ -287,8 +324,15 @@ export type InventoryUncheckedCreateInput = { name: string location?: string | null isActive?: boolean - createdAt: Date | string - updatedAt: Date | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput } export type InventoryUpdateInput = { @@ -297,6 +341,13 @@ export type InventoryUpdateInput = { isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput + inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput } export type InventoryUncheckedUpdateInput = { @@ -306,6 +357,13 @@ export type InventoryUncheckedUpdateInput = { isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput } export type InventoryCreateManyInput = { @@ -313,8 +371,9 @@ export type InventoryCreateManyInput = { name: string location?: string | null isActive?: boolean - createdAt: Date | string - updatedAt: Date | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null } export type InventoryUpdateManyMutationInput = { @@ -323,6 +382,7 @@ export type InventoryUpdateManyMutationInput = { isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type InventoryUncheckedUpdateManyInput = { @@ -332,6 +392,7 @@ export type InventoryUncheckedUpdateManyInput = { isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type InventoryOrderByRelevanceInput = { @@ -347,6 +408,7 @@ export type InventoryCountOrderByAggregateInput = { isActive?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder } export type InventoryAvgOrderByAggregateInput = { @@ -360,6 +422,7 @@ export type InventoryMaxOrderByAggregateInput = { isActive?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder } export type InventoryMinOrderByAggregateInput = { @@ -369,12 +432,620 @@ export type InventoryMinOrderByAggregateInput = { isActive?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder } export type InventorySumOrderByAggregateInput = { id?: Prisma.SortOrder } +export type InventoryScalarRelationFilter = { + is?: Prisma.InventoryWhereInput + isNot?: Prisma.InventoryWhereInput +} + +export type InventoryCreateNestedOneWithoutProductChargesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutProductChargesInput + connect?: Prisma.InventoryWhereUniqueInput +} + +export type InventoryUpdateOneRequiredWithoutProductChargesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutProductChargesInput + upsert?: Prisma.InventoryUpsertWithoutProductChargesInput + connect?: Prisma.InventoryWhereUniqueInput + update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutProductChargesInput> +} + +export type InventoryCreateNestedOneWithoutPurchaseReceiptsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutPurchaseReceiptsInput + connect?: Prisma.InventoryWhereUniqueInput +} + +export type InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutPurchaseReceiptsInput + upsert?: Prisma.InventoryUpsertWithoutPurchaseReceiptsInput + connect?: Prisma.InventoryWhereUniqueInput + update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutPurchaseReceiptsInput> +} + +export type InventoryCreateNestedOneWithoutStockMovementsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockMovementsInput + connect?: Prisma.InventoryWhereUniqueInput +} + +export type InventoryUpdateOneRequiredWithoutStockMovementsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockMovementsInput + upsert?: Prisma.InventoryUpsertWithoutStockMovementsInput + connect?: Prisma.InventoryWhereUniqueInput + update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutStockMovementsInput> +} + +export type InventoryCreateNestedOneWithoutInventoryTransfersFromInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryTransfersFromInput + connect?: Prisma.InventoryWhereUniqueInput +} + +export type InventoryCreateNestedOneWithoutInventoryTransfersToInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryTransfersToInput + connect?: Prisma.InventoryWhereUniqueInput +} + +export type InventoryUpdateOneRequiredWithoutInventoryTransfersFromNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryTransfersFromInput + upsert?: Prisma.InventoryUpsertWithoutInventoryTransfersFromInput + connect?: Prisma.InventoryWhereUniqueInput + update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutInventoryTransfersFromInput> +} + +export type InventoryUpdateOneRequiredWithoutInventoryTransfersToNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryTransfersToInput + upsert?: Prisma.InventoryUpsertWithoutInventoryTransfersToInput + connect?: Prisma.InventoryWhereUniqueInput + update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutInventoryTransfersToInput> +} + +export type InventoryCreateNestedOneWithoutStockAdjustmentsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockAdjustmentsInput + connect?: Prisma.InventoryWhereUniqueInput +} + +export type InventoryUpdateOneRequiredWithoutStockAdjustmentsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockAdjustmentsInput + upsert?: Prisma.InventoryUpsertWithoutStockAdjustmentsInput + connect?: Prisma.InventoryWhereUniqueInput + update?: Prisma.XOR, Prisma.InventoryUncheckedUpdateWithoutStockAdjustmentsInput> +} + +export type InventoryCreateWithoutProductChargesInput = { + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput + inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput +} + +export type InventoryUncheckedCreateWithoutProductChargesInput = { + id?: number + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput +} + +export type InventoryCreateOrConnectWithoutProductChargesInput = { + where: Prisma.InventoryWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryUpsertWithoutProductChargesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.InventoryWhereInput +} + +export type InventoryUpdateToOneWithWhereWithoutProductChargesInput = { + where?: Prisma.InventoryWhereInput + data: Prisma.XOR +} + +export type InventoryUpdateWithoutProductChargesInput = { + 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 + inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput + inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput +} + +export type InventoryUncheckedUpdateWithoutProductChargesInput = { + 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 + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput +} + +export type InventoryCreateWithoutPurchaseReceiptsInput = { + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput + inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput +} + +export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = { + id?: number + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput +} + +export type InventoryCreateOrConnectWithoutPurchaseReceiptsInput = { + where: Prisma.InventoryWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryUpsertWithoutPurchaseReceiptsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.InventoryWhereInput +} + +export type InventoryUpdateToOneWithWhereWithoutPurchaseReceiptsInput = { + where?: Prisma.InventoryWhereInput + data: Prisma.XOR +} + +export type InventoryUpdateWithoutPurchaseReceiptsInput = { + 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 + inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput + inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput +} + +export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = { + 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 + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput +} + +export type InventoryCreateWithoutStockMovementsInput = { + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput + inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput +} + +export type InventoryUncheckedCreateWithoutStockMovementsInput = { + id?: number + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput +} + +export type InventoryCreateOrConnectWithoutStockMovementsInput = { + where: Prisma.InventoryWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryUpsertWithoutStockMovementsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.InventoryWhereInput +} + +export type InventoryUpdateToOneWithWhereWithoutStockMovementsInput = { + where?: Prisma.InventoryWhereInput + data: Prisma.XOR +} + +export type InventoryUpdateWithoutStockMovementsInput = { + 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 + inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput + inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput +} + +export type InventoryUncheckedUpdateWithoutStockMovementsInput = { + 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 + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput +} + +export type InventoryCreateWithoutInventoryTransfersFromInput = { + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput +} + +export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = { + id?: number + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput +} + +export type InventoryCreateOrConnectWithoutInventoryTransfersFromInput = { + where: Prisma.InventoryWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryCreateWithoutInventoryTransfersToInput = { + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput +} + +export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = { + id?: number + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput +} + +export type InventoryCreateOrConnectWithoutInventoryTransfersToInput = { + where: Prisma.InventoryWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryUpsertWithoutInventoryTransfersFromInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.InventoryWhereInput +} + +export type InventoryUpdateToOneWithWhereWithoutInventoryTransfersFromInput = { + where?: Prisma.InventoryWhereInput + data: Prisma.XOR +} + +export type InventoryUpdateWithoutInventoryTransfersFromInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput +} + +export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput +} + +export type InventoryUpsertWithoutInventoryTransfersToInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.InventoryWhereInput +} + +export type InventoryUpdateToOneWithWhereWithoutInventoryTransfersToInput = { + where?: Prisma.InventoryWhereInput + data: Prisma.XOR +} + +export type InventoryUpdateWithoutInventoryTransfersToInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput +} + +export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput +} + +export type InventoryCreateWithoutStockAdjustmentsInput = { + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput + inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput +} + +export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = { + id?: number + name: string + location?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput +} + +export type InventoryCreateOrConnectWithoutStockAdjustmentsInput = { + where: Prisma.InventoryWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryUpsertWithoutStockAdjustmentsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.InventoryWhereInput +} + +export type InventoryUpdateToOneWithWhereWithoutStockAdjustmentsInput = { + where?: Prisma.InventoryWhereInput + data: Prisma.XOR +} + +export type InventoryUpdateWithoutStockAdjustmentsInput = { + 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 + inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput + inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput +} + +export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = { + 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 + inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput + inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput +} + + +/** + * Count Type InventoryCountOutputType + */ + +export type InventoryCountOutputType = { + inventoryTransfersFrom: number + inventoryTransfersTo: number + productCharges: number + purchaseReceipts: number + stockAdjustments: number + stockMovements: number +} + +export type InventoryCountOutputTypeSelect = { + inventoryTransfersFrom?: boolean | InventoryCountOutputTypeCountInventoryTransfersFromArgs + inventoryTransfersTo?: boolean | InventoryCountOutputTypeCountInventoryTransfersToArgs + productCharges?: boolean | InventoryCountOutputTypeCountProductChargesArgs + purchaseReceipts?: boolean | InventoryCountOutputTypeCountPurchaseReceiptsArgs + stockAdjustments?: boolean | InventoryCountOutputTypeCountStockAdjustmentsArgs + stockMovements?: boolean | InventoryCountOutputTypeCountStockMovementsArgs +} + +/** + * InventoryCountOutputType without action + */ +export type InventoryCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the InventoryCountOutputType + */ + select?: Prisma.InventoryCountOutputTypeSelect | null +} + +/** + * InventoryCountOutputType without action + */ +export type InventoryCountOutputTypeCountInventoryTransfersFromArgs = { + where?: Prisma.InventoryTransferWhereInput +} + +/** + * InventoryCountOutputType without action + */ +export type InventoryCountOutputTypeCountInventoryTransfersToArgs = { + where?: Prisma.InventoryTransferWhereInput +} + +/** + * InventoryCountOutputType without action + */ +export type InventoryCountOutputTypeCountProductChargesArgs = { + where?: Prisma.ProductChargeWhereInput +} + +/** + * InventoryCountOutputType without action + */ +export type InventoryCountOutputTypeCountPurchaseReceiptsArgs = { + where?: Prisma.PurchaseReceiptWhereInput +} + +/** + * InventoryCountOutputType without action + */ +export type InventoryCountOutputTypeCountStockAdjustmentsArgs = { + where?: Prisma.StockAdjustmentWhereInput +} + +/** + * InventoryCountOutputType without action + */ +export type InventoryCountOutputTypeCountStockMovementsArgs = { + where?: Prisma.StockMovementWhereInput +} export type InventorySelect = runtime.Types.Extensions.GetSelect<{ @@ -384,6 +1055,14 @@ export type InventorySelect + inventoryTransfersTo?: boolean | Prisma.Inventory$inventoryTransfersToArgs + productCharges?: boolean | Prisma.Inventory$productChargesArgs + purchaseReceipts?: boolean | Prisma.Inventory$purchaseReceiptsArgs + stockAdjustments?: boolean | Prisma.Inventory$stockAdjustmentsArgs + stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs + _count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs }, ExtArgs["result"]["inventory"]> @@ -395,13 +1074,30 @@ export type InventorySelectScalar = { isActive?: boolean createdAt?: boolean updatedAt?: boolean + deletedAt?: boolean } -export type InventoryOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "location" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["inventory"]> +export type InventoryOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "location" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["inventory"]> +export type InventoryInclude = { + inventoryTransfersFrom?: boolean | Prisma.Inventory$inventoryTransfersFromArgs + inventoryTransfersTo?: boolean | Prisma.Inventory$inventoryTransfersToArgs + productCharges?: boolean | Prisma.Inventory$productChargesArgs + purchaseReceipts?: boolean | Prisma.Inventory$purchaseReceiptsArgs + stockAdjustments?: boolean | Prisma.Inventory$stockAdjustmentsArgs + stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs + _count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs +} export type $InventoryPayload = { name: "Inventory" - objects: {} + objects: { + inventoryTransfersFrom: Prisma.$InventoryTransferPayload[] + inventoryTransfersTo: Prisma.$InventoryTransferPayload[] + productCharges: Prisma.$ProductChargePayload[] + purchaseReceipts: Prisma.$PurchaseReceiptPayload[] + stockAdjustments: Prisma.$StockAdjustmentPayload[] + stockMovements: Prisma.$StockMovementPayload[] + } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: number name: string @@ -409,6 +1105,7 @@ export type $InventoryPayload composites: {} } @@ -749,6 +1446,12 @@ readonly fields: InventoryFieldRefs; */ export interface Prisma__InventoryClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" + inventoryTransfersFrom = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + inventoryTransfersTo = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + productCharges = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + purchaseReceipts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + stockAdjustments = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + stockMovements = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -784,6 +1487,7 @@ export interface InventoryFieldRefs { readonly isActive: Prisma.FieldRef<"Inventory", 'Boolean'> readonly createdAt: Prisma.FieldRef<"Inventory", 'DateTime'> readonly updatedAt: Prisma.FieldRef<"Inventory", 'DateTime'> + readonly deletedAt: Prisma.FieldRef<"Inventory", 'DateTime'> } @@ -800,6 +1504,10 @@ export type InventoryFindUniqueArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryInclude | null /** * Filter, which Inventory to fetch. */ @@ -818,6 +1526,10 @@ export type InventoryFindUniqueOrThrowArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryInclude | null /** * Filter, which Inventory to fetch. */ @@ -836,6 +1548,10 @@ export type InventoryFindFirstArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryInclude | null /** * Filter, which Inventory to fetch. */ @@ -884,6 +1600,10 @@ export type InventoryFindFirstOrThrowArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryInclude | null /** * Filter, which Inventory to fetch. */ @@ -932,6 +1652,10 @@ export type InventoryFindManyArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryInclude | null /** * Filter, which Inventories to fetch. */ @@ -975,6 +1699,10 @@ export type InventoryCreateArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryInclude | null /** * The data needed to create a Inventory. */ @@ -1004,6 +1732,10 @@ export type InventoryUpdateArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryInclude | null /** * The data needed to update a Inventory. */ @@ -1044,6 +1776,10 @@ export type InventoryUpsertArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryInclude | null /** * The filter to search for the Inventory to update in case it exists. */ @@ -1070,6 +1806,10 @@ export type InventoryDeleteArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryInclude | null /** * Filter which Inventory to delete. */ @@ -1090,6 +1830,150 @@ export type InventoryDeleteManyArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + where?: Prisma.InventoryTransferWhereInput + orderBy?: Prisma.InventoryTransferOrderByWithRelationInput | Prisma.InventoryTransferOrderByWithRelationInput[] + cursor?: Prisma.InventoryTransferWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.InventoryTransferScalarFieldEnum | Prisma.InventoryTransferScalarFieldEnum[] +} + +/** + * Inventory.inventoryTransfersTo + */ +export type Inventory$inventoryTransfersToArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + where?: Prisma.InventoryTransferWhereInput + orderBy?: Prisma.InventoryTransferOrderByWithRelationInput | Prisma.InventoryTransferOrderByWithRelationInput[] + cursor?: Prisma.InventoryTransferWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.InventoryTransferScalarFieldEnum | Prisma.InventoryTransferScalarFieldEnum[] +} + +/** + * Inventory.productCharges + */ +export type Inventory$productChargesArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + where?: Prisma.ProductChargeWhereInput + orderBy?: Prisma.ProductChargeOrderByWithRelationInput | Prisma.ProductChargeOrderByWithRelationInput[] + cursor?: Prisma.ProductChargeWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.ProductChargeScalarFieldEnum | Prisma.ProductChargeScalarFieldEnum[] +} + +/** + * Inventory.purchaseReceipts + */ +export type Inventory$purchaseReceiptsArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + where?: Prisma.PurchaseReceiptWhereInput + orderBy?: Prisma.PurchaseReceiptOrderByWithRelationInput | Prisma.PurchaseReceiptOrderByWithRelationInput[] + cursor?: Prisma.PurchaseReceiptWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PurchaseReceiptScalarFieldEnum | Prisma.PurchaseReceiptScalarFieldEnum[] +} + +/** + * Inventory.stockAdjustments + */ +export type Inventory$stockAdjustmentsArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + where?: Prisma.StockAdjustmentWhereInput + orderBy?: Prisma.StockAdjustmentOrderByWithRelationInput | Prisma.StockAdjustmentOrderByWithRelationInput[] + cursor?: Prisma.StockAdjustmentWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.StockAdjustmentScalarFieldEnum | Prisma.StockAdjustmentScalarFieldEnum[] +} + +/** + * Inventory.stockMovements + */ +export type Inventory$stockMovementsArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + where?: Prisma.StockMovementWhereInput + orderBy?: Prisma.StockMovementOrderByWithRelationInput | Prisma.StockMovementOrderByWithRelationInput[] + cursor?: Prisma.StockMovementWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[] +} + /** * Inventory without action */ @@ -1102,4 +1986,8 @@ export type InventoryDefaultArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryInclude | null } diff --git a/src/generated/prisma/models/InventoryTransfer.ts b/src/generated/prisma/models/InventoryTransfer.ts new file mode 100644 index 0000000..4b4730a --- /dev/null +++ b/src/generated/prisma/models/InventoryTransfer.ts @@ -0,0 +1,1565 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `InventoryTransfer` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model InventoryTransfer + * + */ +export type InventoryTransferModel = runtime.Types.Result.DefaultSelection + +export type AggregateInventoryTransfer = { + _count: InventoryTransferCountAggregateOutputType | null + _avg: InventoryTransferAvgAggregateOutputType | null + _sum: InventoryTransferSumAggregateOutputType | null + _min: InventoryTransferMinAggregateOutputType | null + _max: InventoryTransferMaxAggregateOutputType | null +} + +export type InventoryTransferAvgAggregateOutputType = { + id: number | null + fromInventoryId: number | null + toInventoryId: number | null +} + +export type InventoryTransferSumAggregateOutputType = { + id: number | null + fromInventoryId: number | null + toInventoryId: number | null +} + +export type InventoryTransferMinAggregateOutputType = { + id: number | null + code: string | null + description: string | null + createdAt: Date | null + fromInventoryId: number | null + toInventoryId: number | null +} + +export type InventoryTransferMaxAggregateOutputType = { + id: number | null + code: string | null + description: string | null + createdAt: Date | null + fromInventoryId: number | null + toInventoryId: number | null +} + +export type InventoryTransferCountAggregateOutputType = { + id: number + code: number + description: number + createdAt: number + fromInventoryId: number + toInventoryId: number + _all: number +} + + +export type InventoryTransferAvgAggregateInputType = { + id?: true + fromInventoryId?: true + toInventoryId?: true +} + +export type InventoryTransferSumAggregateInputType = { + id?: true + fromInventoryId?: true + toInventoryId?: true +} + +export type InventoryTransferMinAggregateInputType = { + id?: true + code?: true + description?: true + createdAt?: true + fromInventoryId?: true + toInventoryId?: true +} + +export type InventoryTransferMaxAggregateInputType = { + id?: true + code?: true + description?: true + createdAt?: true + fromInventoryId?: true + toInventoryId?: true +} + +export type InventoryTransferCountAggregateInputType = { + id?: true + code?: true + description?: true + createdAt?: true + fromInventoryId?: true + toInventoryId?: true + _all?: true +} + +export type InventoryTransferAggregateArgs = { + /** + * Filter which InventoryTransfer to aggregate. + */ + where?: Prisma.InventoryTransferWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of InventoryTransfers to fetch. + */ + orderBy?: Prisma.InventoryTransferOrderByWithRelationInput | Prisma.InventoryTransferOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.InventoryTransferWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` InventoryTransfers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` InventoryTransfers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned InventoryTransfers + **/ + _count?: true | InventoryTransferCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: InventoryTransferAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: InventoryTransferSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: InventoryTransferMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: InventoryTransferMaxAggregateInputType +} + +export type GetInventoryTransferAggregateType = { + [P in keyof T & keyof AggregateInventoryTransfer]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type InventoryTransferGroupByArgs = { + where?: Prisma.InventoryTransferWhereInput + orderBy?: Prisma.InventoryTransferOrderByWithAggregationInput | Prisma.InventoryTransferOrderByWithAggregationInput[] + by: Prisma.InventoryTransferScalarFieldEnum[] | Prisma.InventoryTransferScalarFieldEnum + having?: Prisma.InventoryTransferScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: InventoryTransferCountAggregateInputType | true + _avg?: InventoryTransferAvgAggregateInputType + _sum?: InventoryTransferSumAggregateInputType + _min?: InventoryTransferMinAggregateInputType + _max?: InventoryTransferMaxAggregateInputType +} + +export type InventoryTransferGroupByOutputType = { + id: number + code: string + description: string | null + createdAt: Date + fromInventoryId: number + toInventoryId: number + _count: InventoryTransferCountAggregateOutputType | null + _avg: InventoryTransferAvgAggregateOutputType | null + _sum: InventoryTransferSumAggregateOutputType | null + _min: InventoryTransferMinAggregateOutputType | null + _max: InventoryTransferMaxAggregateOutputType | null +} + +type GetInventoryTransferGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof InventoryTransferGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type InventoryTransferWhereInput = { + AND?: Prisma.InventoryTransferWhereInput | Prisma.InventoryTransferWhereInput[] + OR?: Prisma.InventoryTransferWhereInput[] + NOT?: Prisma.InventoryTransferWhereInput | Prisma.InventoryTransferWhereInput[] + id?: Prisma.IntFilter<"InventoryTransfer"> | number + code?: Prisma.StringFilter<"InventoryTransfer"> | string + description?: Prisma.StringNullableFilter<"InventoryTransfer"> | string | null + createdAt?: Prisma.DateTimeFilter<"InventoryTransfer"> | Date | string + fromInventoryId?: Prisma.IntFilter<"InventoryTransfer"> | number + toInventoryId?: Prisma.IntFilter<"InventoryTransfer"> | number + items?: Prisma.InventoryTransferItemListRelationFilter + fromInventory?: Prisma.XOR + toInventory?: Prisma.XOR +} + +export type InventoryTransferOrderByWithRelationInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + fromInventoryId?: Prisma.SortOrder + toInventoryId?: Prisma.SortOrder + items?: Prisma.InventoryTransferItemOrderByRelationAggregateInput + fromInventory?: Prisma.InventoryOrderByWithRelationInput + toInventory?: Prisma.InventoryOrderByWithRelationInput + _relevance?: Prisma.InventoryTransferOrderByRelevanceInput +} + +export type InventoryTransferWhereUniqueInput = Prisma.AtLeast<{ + id?: number + code?: string + AND?: Prisma.InventoryTransferWhereInput | Prisma.InventoryTransferWhereInput[] + OR?: Prisma.InventoryTransferWhereInput[] + NOT?: Prisma.InventoryTransferWhereInput | Prisma.InventoryTransferWhereInput[] + description?: Prisma.StringNullableFilter<"InventoryTransfer"> | string | null + createdAt?: Prisma.DateTimeFilter<"InventoryTransfer"> | Date | string + fromInventoryId?: Prisma.IntFilter<"InventoryTransfer"> | number + toInventoryId?: Prisma.IntFilter<"InventoryTransfer"> | number + items?: Prisma.InventoryTransferItemListRelationFilter + fromInventory?: Prisma.XOR + toInventory?: Prisma.XOR +}, "id" | "code"> + +export type InventoryTransferOrderByWithAggregationInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + fromInventoryId?: Prisma.SortOrder + toInventoryId?: Prisma.SortOrder + _count?: Prisma.InventoryTransferCountOrderByAggregateInput + _avg?: Prisma.InventoryTransferAvgOrderByAggregateInput + _max?: Prisma.InventoryTransferMaxOrderByAggregateInput + _min?: Prisma.InventoryTransferMinOrderByAggregateInput + _sum?: Prisma.InventoryTransferSumOrderByAggregateInput +} + +export type InventoryTransferScalarWhereWithAggregatesInput = { + AND?: Prisma.InventoryTransferScalarWhereWithAggregatesInput | Prisma.InventoryTransferScalarWhereWithAggregatesInput[] + OR?: Prisma.InventoryTransferScalarWhereWithAggregatesInput[] + NOT?: Prisma.InventoryTransferScalarWhereWithAggregatesInput | Prisma.InventoryTransferScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"InventoryTransfer"> | number + code?: Prisma.StringWithAggregatesFilter<"InventoryTransfer"> | string + description?: Prisma.StringNullableWithAggregatesFilter<"InventoryTransfer"> | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"InventoryTransfer"> | Date | string + fromInventoryId?: Prisma.IntWithAggregatesFilter<"InventoryTransfer"> | number + toInventoryId?: Prisma.IntWithAggregatesFilter<"InventoryTransfer"> | number +} + +export type InventoryTransferCreateInput = { + code: string + description?: string | null + createdAt?: Date | string + items?: Prisma.InventoryTransferItemCreateNestedManyWithoutTransferInput + fromInventory: Prisma.InventoryCreateNestedOneWithoutInventoryTransfersFromInput + toInventory: Prisma.InventoryCreateNestedOneWithoutInventoryTransfersToInput +} + +export type InventoryTransferUncheckedCreateInput = { + id?: number + code: string + description?: string | null + createdAt?: Date | string + fromInventoryId: number + toInventoryId: number + items?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutTransferInput +} + +export type InventoryTransferUpdateInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + items?: Prisma.InventoryTransferItemUpdateManyWithoutTransferNestedInput + fromInventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryTransfersFromNestedInput + toInventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryTransfersToNestedInput +} + +export type InventoryTransferUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + fromInventoryId?: Prisma.IntFieldUpdateOperationsInput | number + toInventoryId?: Prisma.IntFieldUpdateOperationsInput | number + items?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutTransferNestedInput +} + +export type InventoryTransferCreateManyInput = { + id?: number + code: string + description?: string | null + createdAt?: Date | string + fromInventoryId: number + toInventoryId: number +} + +export type InventoryTransferUpdateManyMutationInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type InventoryTransferUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + fromInventoryId?: Prisma.IntFieldUpdateOperationsInput | number + toInventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type InventoryTransferListRelationFilter = { + every?: Prisma.InventoryTransferWhereInput + some?: Prisma.InventoryTransferWhereInput + none?: Prisma.InventoryTransferWhereInput +} + +export type InventoryTransferOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type InventoryTransferOrderByRelevanceInput = { + fields: Prisma.InventoryTransferOrderByRelevanceFieldEnum | Prisma.InventoryTransferOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type InventoryTransferCountOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + fromInventoryId?: Prisma.SortOrder + toInventoryId?: Prisma.SortOrder +} + +export type InventoryTransferAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + fromInventoryId?: Prisma.SortOrder + toInventoryId?: Prisma.SortOrder +} + +export type InventoryTransferMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + fromInventoryId?: Prisma.SortOrder + toInventoryId?: Prisma.SortOrder +} + +export type InventoryTransferMinOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + fromInventoryId?: Prisma.SortOrder + toInventoryId?: Prisma.SortOrder +} + +export type InventoryTransferSumOrderByAggregateInput = { + id?: Prisma.SortOrder + fromInventoryId?: Prisma.SortOrder + toInventoryId?: Prisma.SortOrder +} + +export type InventoryTransferScalarRelationFilter = { + is?: Prisma.InventoryTransferWhereInput + isNot?: Prisma.InventoryTransferWhereInput +} + +export type InventoryTransferCreateNestedManyWithoutFromInventoryInput = { + create?: Prisma.XOR | Prisma.InventoryTransferCreateWithoutFromInventoryInput[] | Prisma.InventoryTransferUncheckedCreateWithoutFromInventoryInput[] + connectOrCreate?: Prisma.InventoryTransferCreateOrConnectWithoutFromInventoryInput | Prisma.InventoryTransferCreateOrConnectWithoutFromInventoryInput[] + createMany?: Prisma.InventoryTransferCreateManyFromInventoryInputEnvelope + connect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] +} + +export type InventoryTransferCreateNestedManyWithoutToInventoryInput = { + create?: Prisma.XOR | Prisma.InventoryTransferCreateWithoutToInventoryInput[] | Prisma.InventoryTransferUncheckedCreateWithoutToInventoryInput[] + connectOrCreate?: Prisma.InventoryTransferCreateOrConnectWithoutToInventoryInput | Prisma.InventoryTransferCreateOrConnectWithoutToInventoryInput[] + createMany?: Prisma.InventoryTransferCreateManyToInventoryInputEnvelope + connect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] +} + +export type InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput = { + create?: Prisma.XOR | Prisma.InventoryTransferCreateWithoutFromInventoryInput[] | Prisma.InventoryTransferUncheckedCreateWithoutFromInventoryInput[] + connectOrCreate?: Prisma.InventoryTransferCreateOrConnectWithoutFromInventoryInput | Prisma.InventoryTransferCreateOrConnectWithoutFromInventoryInput[] + createMany?: Prisma.InventoryTransferCreateManyFromInventoryInputEnvelope + connect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] +} + +export type InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput = { + create?: Prisma.XOR | Prisma.InventoryTransferCreateWithoutToInventoryInput[] | Prisma.InventoryTransferUncheckedCreateWithoutToInventoryInput[] + connectOrCreate?: Prisma.InventoryTransferCreateOrConnectWithoutToInventoryInput | Prisma.InventoryTransferCreateOrConnectWithoutToInventoryInput[] + createMany?: Prisma.InventoryTransferCreateManyToInventoryInputEnvelope + connect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] +} + +export type InventoryTransferUpdateManyWithoutFromInventoryNestedInput = { + create?: Prisma.XOR | Prisma.InventoryTransferCreateWithoutFromInventoryInput[] | Prisma.InventoryTransferUncheckedCreateWithoutFromInventoryInput[] + connectOrCreate?: Prisma.InventoryTransferCreateOrConnectWithoutFromInventoryInput | Prisma.InventoryTransferCreateOrConnectWithoutFromInventoryInput[] + upsert?: Prisma.InventoryTransferUpsertWithWhereUniqueWithoutFromInventoryInput | Prisma.InventoryTransferUpsertWithWhereUniqueWithoutFromInventoryInput[] + createMany?: Prisma.InventoryTransferCreateManyFromInventoryInputEnvelope + set?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + disconnect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + delete?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + connect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + update?: Prisma.InventoryTransferUpdateWithWhereUniqueWithoutFromInventoryInput | Prisma.InventoryTransferUpdateWithWhereUniqueWithoutFromInventoryInput[] + updateMany?: Prisma.InventoryTransferUpdateManyWithWhereWithoutFromInventoryInput | Prisma.InventoryTransferUpdateManyWithWhereWithoutFromInventoryInput[] + deleteMany?: Prisma.InventoryTransferScalarWhereInput | Prisma.InventoryTransferScalarWhereInput[] +} + +export type InventoryTransferUpdateManyWithoutToInventoryNestedInput = { + create?: Prisma.XOR | Prisma.InventoryTransferCreateWithoutToInventoryInput[] | Prisma.InventoryTransferUncheckedCreateWithoutToInventoryInput[] + connectOrCreate?: Prisma.InventoryTransferCreateOrConnectWithoutToInventoryInput | Prisma.InventoryTransferCreateOrConnectWithoutToInventoryInput[] + upsert?: Prisma.InventoryTransferUpsertWithWhereUniqueWithoutToInventoryInput | Prisma.InventoryTransferUpsertWithWhereUniqueWithoutToInventoryInput[] + createMany?: Prisma.InventoryTransferCreateManyToInventoryInputEnvelope + set?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + disconnect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + delete?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + connect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + update?: Prisma.InventoryTransferUpdateWithWhereUniqueWithoutToInventoryInput | Prisma.InventoryTransferUpdateWithWhereUniqueWithoutToInventoryInput[] + updateMany?: Prisma.InventoryTransferUpdateManyWithWhereWithoutToInventoryInput | Prisma.InventoryTransferUpdateManyWithWhereWithoutToInventoryInput[] + deleteMany?: Prisma.InventoryTransferScalarWhereInput | Prisma.InventoryTransferScalarWhereInput[] +} + +export type InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput = { + create?: Prisma.XOR | Prisma.InventoryTransferCreateWithoutFromInventoryInput[] | Prisma.InventoryTransferUncheckedCreateWithoutFromInventoryInput[] + connectOrCreate?: Prisma.InventoryTransferCreateOrConnectWithoutFromInventoryInput | Prisma.InventoryTransferCreateOrConnectWithoutFromInventoryInput[] + upsert?: Prisma.InventoryTransferUpsertWithWhereUniqueWithoutFromInventoryInput | Prisma.InventoryTransferUpsertWithWhereUniqueWithoutFromInventoryInput[] + createMany?: Prisma.InventoryTransferCreateManyFromInventoryInputEnvelope + set?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + disconnect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + delete?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + connect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + update?: Prisma.InventoryTransferUpdateWithWhereUniqueWithoutFromInventoryInput | Prisma.InventoryTransferUpdateWithWhereUniqueWithoutFromInventoryInput[] + updateMany?: Prisma.InventoryTransferUpdateManyWithWhereWithoutFromInventoryInput | Prisma.InventoryTransferUpdateManyWithWhereWithoutFromInventoryInput[] + deleteMany?: Prisma.InventoryTransferScalarWhereInput | Prisma.InventoryTransferScalarWhereInput[] +} + +export type InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput = { + create?: Prisma.XOR | Prisma.InventoryTransferCreateWithoutToInventoryInput[] | Prisma.InventoryTransferUncheckedCreateWithoutToInventoryInput[] + connectOrCreate?: Prisma.InventoryTransferCreateOrConnectWithoutToInventoryInput | Prisma.InventoryTransferCreateOrConnectWithoutToInventoryInput[] + upsert?: Prisma.InventoryTransferUpsertWithWhereUniqueWithoutToInventoryInput | Prisma.InventoryTransferUpsertWithWhereUniqueWithoutToInventoryInput[] + createMany?: Prisma.InventoryTransferCreateManyToInventoryInputEnvelope + set?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + disconnect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + delete?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + connect?: Prisma.InventoryTransferWhereUniqueInput | Prisma.InventoryTransferWhereUniqueInput[] + update?: Prisma.InventoryTransferUpdateWithWhereUniqueWithoutToInventoryInput | Prisma.InventoryTransferUpdateWithWhereUniqueWithoutToInventoryInput[] + updateMany?: Prisma.InventoryTransferUpdateManyWithWhereWithoutToInventoryInput | Prisma.InventoryTransferUpdateManyWithWhereWithoutToInventoryInput[] + deleteMany?: Prisma.InventoryTransferScalarWhereInput | Prisma.InventoryTransferScalarWhereInput[] +} + +export type InventoryTransferCreateNestedOneWithoutItemsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryTransferCreateOrConnectWithoutItemsInput + connect?: Prisma.InventoryTransferWhereUniqueInput +} + +export type InventoryTransferUpdateOneRequiredWithoutItemsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.InventoryTransferCreateOrConnectWithoutItemsInput + upsert?: Prisma.InventoryTransferUpsertWithoutItemsInput + connect?: Prisma.InventoryTransferWhereUniqueInput + update?: Prisma.XOR, Prisma.InventoryTransferUncheckedUpdateWithoutItemsInput> +} + +export type InventoryTransferCreateWithoutFromInventoryInput = { + code: string + description?: string | null + createdAt?: Date | string + items?: Prisma.InventoryTransferItemCreateNestedManyWithoutTransferInput + toInventory: Prisma.InventoryCreateNestedOneWithoutInventoryTransfersToInput +} + +export type InventoryTransferUncheckedCreateWithoutFromInventoryInput = { + id?: number + code: string + description?: string | null + createdAt?: Date | string + toInventoryId: number + items?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutTransferInput +} + +export type InventoryTransferCreateOrConnectWithoutFromInventoryInput = { + where: Prisma.InventoryTransferWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryTransferCreateManyFromInventoryInputEnvelope = { + data: Prisma.InventoryTransferCreateManyFromInventoryInput | Prisma.InventoryTransferCreateManyFromInventoryInput[] + skipDuplicates?: boolean +} + +export type InventoryTransferCreateWithoutToInventoryInput = { + code: string + description?: string | null + createdAt?: Date | string + items?: Prisma.InventoryTransferItemCreateNestedManyWithoutTransferInput + fromInventory: Prisma.InventoryCreateNestedOneWithoutInventoryTransfersFromInput +} + +export type InventoryTransferUncheckedCreateWithoutToInventoryInput = { + id?: number + code: string + description?: string | null + createdAt?: Date | string + fromInventoryId: number + items?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutTransferInput +} + +export type InventoryTransferCreateOrConnectWithoutToInventoryInput = { + where: Prisma.InventoryTransferWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryTransferCreateManyToInventoryInputEnvelope = { + data: Prisma.InventoryTransferCreateManyToInventoryInput | Prisma.InventoryTransferCreateManyToInventoryInput[] + skipDuplicates?: boolean +} + +export type InventoryTransferUpsertWithWhereUniqueWithoutFromInventoryInput = { + where: Prisma.InventoryTransferWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type InventoryTransferUpdateWithWhereUniqueWithoutFromInventoryInput = { + where: Prisma.InventoryTransferWhereUniqueInput + data: Prisma.XOR +} + +export type InventoryTransferUpdateManyWithWhereWithoutFromInventoryInput = { + where: Prisma.InventoryTransferScalarWhereInput + data: Prisma.XOR +} + +export type InventoryTransferScalarWhereInput = { + AND?: Prisma.InventoryTransferScalarWhereInput | Prisma.InventoryTransferScalarWhereInput[] + OR?: Prisma.InventoryTransferScalarWhereInput[] + NOT?: Prisma.InventoryTransferScalarWhereInput | Prisma.InventoryTransferScalarWhereInput[] + id?: Prisma.IntFilter<"InventoryTransfer"> | number + code?: Prisma.StringFilter<"InventoryTransfer"> | string + description?: Prisma.StringNullableFilter<"InventoryTransfer"> | string | null + createdAt?: Prisma.DateTimeFilter<"InventoryTransfer"> | Date | string + fromInventoryId?: Prisma.IntFilter<"InventoryTransfer"> | number + toInventoryId?: Prisma.IntFilter<"InventoryTransfer"> | number +} + +export type InventoryTransferUpsertWithWhereUniqueWithoutToInventoryInput = { + where: Prisma.InventoryTransferWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type InventoryTransferUpdateWithWhereUniqueWithoutToInventoryInput = { + where: Prisma.InventoryTransferWhereUniqueInput + data: Prisma.XOR +} + +export type InventoryTransferUpdateManyWithWhereWithoutToInventoryInput = { + where: Prisma.InventoryTransferScalarWhereInput + data: Prisma.XOR +} + +export type InventoryTransferCreateWithoutItemsInput = { + code: string + description?: string | null + createdAt?: Date | string + fromInventory: Prisma.InventoryCreateNestedOneWithoutInventoryTransfersFromInput + toInventory: Prisma.InventoryCreateNestedOneWithoutInventoryTransfersToInput +} + +export type InventoryTransferUncheckedCreateWithoutItemsInput = { + id?: number + code: string + description?: string | null + createdAt?: Date | string + fromInventoryId: number + toInventoryId: number +} + +export type InventoryTransferCreateOrConnectWithoutItemsInput = { + where: Prisma.InventoryTransferWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryTransferUpsertWithoutItemsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.InventoryTransferWhereInput +} + +export type InventoryTransferUpdateToOneWithWhereWithoutItemsInput = { + where?: Prisma.InventoryTransferWhereInput + data: Prisma.XOR +} + +export type InventoryTransferUpdateWithoutItemsInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + fromInventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryTransfersFromNestedInput + toInventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryTransfersToNestedInput +} + +export type InventoryTransferUncheckedUpdateWithoutItemsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + fromInventoryId?: Prisma.IntFieldUpdateOperationsInput | number + toInventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type InventoryTransferCreateManyFromInventoryInput = { + id?: number + code: string + description?: string | null + createdAt?: Date | string + toInventoryId: number +} + +export type InventoryTransferCreateManyToInventoryInput = { + id?: number + code: string + description?: string | null + createdAt?: Date | string + fromInventoryId: number +} + +export type InventoryTransferUpdateWithoutFromInventoryInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + items?: Prisma.InventoryTransferItemUpdateManyWithoutTransferNestedInput + toInventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryTransfersToNestedInput +} + +export type InventoryTransferUncheckedUpdateWithoutFromInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + toInventoryId?: Prisma.IntFieldUpdateOperationsInput | number + items?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutTransferNestedInput +} + +export type InventoryTransferUncheckedUpdateManyWithoutFromInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + toInventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type InventoryTransferUpdateWithoutToInventoryInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + items?: Prisma.InventoryTransferItemUpdateManyWithoutTransferNestedInput + fromInventory?: Prisma.InventoryUpdateOneRequiredWithoutInventoryTransfersFromNestedInput +} + +export type InventoryTransferUncheckedUpdateWithoutToInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + fromInventoryId?: Prisma.IntFieldUpdateOperationsInput | number + items?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutTransferNestedInput +} + +export type InventoryTransferUncheckedUpdateManyWithoutToInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + fromInventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + + +/** + * Count Type InventoryTransferCountOutputType + */ + +export type InventoryTransferCountOutputType = { + items: number +} + +export type InventoryTransferCountOutputTypeSelect = { + items?: boolean | InventoryTransferCountOutputTypeCountItemsArgs +} + +/** + * InventoryTransferCountOutputType without action + */ +export type InventoryTransferCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the InventoryTransferCountOutputType + */ + select?: Prisma.InventoryTransferCountOutputTypeSelect | null +} + +/** + * InventoryTransferCountOutputType without action + */ +export type InventoryTransferCountOutputTypeCountItemsArgs = { + where?: Prisma.InventoryTransferItemWhereInput +} + + +export type InventoryTransferSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + code?: boolean + description?: boolean + createdAt?: boolean + fromInventoryId?: boolean + toInventoryId?: boolean + items?: boolean | Prisma.InventoryTransfer$itemsArgs + fromInventory?: boolean | Prisma.InventoryDefaultArgs + toInventory?: boolean | Prisma.InventoryDefaultArgs + _count?: boolean | Prisma.InventoryTransferCountOutputTypeDefaultArgs +}, ExtArgs["result"]["inventoryTransfer"]> + + + +export type InventoryTransferSelectScalar = { + id?: boolean + code?: boolean + description?: boolean + createdAt?: boolean + fromInventoryId?: boolean + toInventoryId?: boolean +} + +export type InventoryTransferOmit = runtime.Types.Extensions.GetOmit<"id" | "code" | "description" | "createdAt" | "fromInventoryId" | "toInventoryId", ExtArgs["result"]["inventoryTransfer"]> +export type InventoryTransferInclude = { + items?: boolean | Prisma.InventoryTransfer$itemsArgs + fromInventory?: boolean | Prisma.InventoryDefaultArgs + toInventory?: boolean | Prisma.InventoryDefaultArgs + _count?: boolean | Prisma.InventoryTransferCountOutputTypeDefaultArgs +} + +export type $InventoryTransferPayload = { + name: "InventoryTransfer" + objects: { + items: Prisma.$InventoryTransferItemPayload[] + fromInventory: Prisma.$InventoryPayload + toInventory: Prisma.$InventoryPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + code: string + description: string | null + createdAt: Date + fromInventoryId: number + toInventoryId: number + }, ExtArgs["result"]["inventoryTransfer"]> + composites: {} +} + +export type InventoryTransferGetPayload = runtime.Types.Result.GetResult + +export type InventoryTransferCountArgs = + Omit & { + select?: InventoryTransferCountAggregateInputType | true + } + +export interface InventoryTransferDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['InventoryTransfer'], meta: { name: 'InventoryTransfer' } } + /** + * Find zero or one InventoryTransfer that matches the filter. + * @param {InventoryTransferFindUniqueArgs} args - Arguments to find a InventoryTransfer + * @example + * // Get one InventoryTransfer + * const inventoryTransfer = await prisma.inventoryTransfer.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one InventoryTransfer that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {InventoryTransferFindUniqueOrThrowArgs} args - Arguments to find a InventoryTransfer + * @example + * // Get one InventoryTransfer + * const inventoryTransfer = await prisma.inventoryTransfer.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first InventoryTransfer that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferFindFirstArgs} args - Arguments to find a InventoryTransfer + * @example + * // Get one InventoryTransfer + * const inventoryTransfer = await prisma.inventoryTransfer.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first InventoryTransfer that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferFindFirstOrThrowArgs} args - Arguments to find a InventoryTransfer + * @example + * // Get one InventoryTransfer + * const inventoryTransfer = await prisma.inventoryTransfer.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more InventoryTransfers that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all InventoryTransfers + * const inventoryTransfers = await prisma.inventoryTransfer.findMany() + * + * // Get first 10 InventoryTransfers + * const inventoryTransfers = await prisma.inventoryTransfer.findMany({ take: 10 }) + * + * // Only select the `id` + * const inventoryTransferWithIdOnly = await prisma.inventoryTransfer.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a InventoryTransfer. + * @param {InventoryTransferCreateArgs} args - Arguments to create a InventoryTransfer. + * @example + * // Create one InventoryTransfer + * const InventoryTransfer = await prisma.inventoryTransfer.create({ + * data: { + * // ... data to create a InventoryTransfer + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many InventoryTransfers. + * @param {InventoryTransferCreateManyArgs} args - Arguments to create many InventoryTransfers. + * @example + * // Create many InventoryTransfers + * const inventoryTransfer = await prisma.inventoryTransfer.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a InventoryTransfer. + * @param {InventoryTransferDeleteArgs} args - Arguments to delete one InventoryTransfer. + * @example + * // Delete one InventoryTransfer + * const InventoryTransfer = await prisma.inventoryTransfer.delete({ + * where: { + * // ... filter to delete one InventoryTransfer + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one InventoryTransfer. + * @param {InventoryTransferUpdateArgs} args - Arguments to update one InventoryTransfer. + * @example + * // Update one InventoryTransfer + * const inventoryTransfer = await prisma.inventoryTransfer.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more InventoryTransfers. + * @param {InventoryTransferDeleteManyArgs} args - Arguments to filter InventoryTransfers to delete. + * @example + * // Delete a few InventoryTransfers + * const { count } = await prisma.inventoryTransfer.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more InventoryTransfers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many InventoryTransfers + * const inventoryTransfer = await prisma.inventoryTransfer.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one InventoryTransfer. + * @param {InventoryTransferUpsertArgs} args - Arguments to update or create a InventoryTransfer. + * @example + * // Update or create a InventoryTransfer + * const inventoryTransfer = await prisma.inventoryTransfer.upsert({ + * create: { + * // ... data to create a InventoryTransfer + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the InventoryTransfer we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of InventoryTransfers. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferCountArgs} args - Arguments to filter InventoryTransfers to count. + * @example + * // Count the number of InventoryTransfers + * const count = await prisma.inventoryTransfer.count({ + * where: { + * // ... the filter for the InventoryTransfers we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a InventoryTransfer. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by InventoryTransfer. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends InventoryTransferGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: InventoryTransferGroupByArgs['orderBy'] } + : { orderBy?: InventoryTransferGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetInventoryTransferGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the InventoryTransfer model + */ +readonly fields: InventoryTransferFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for InventoryTransfer. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__InventoryTransferClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + items = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + fromInventory = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + toInventory = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the InventoryTransfer model + */ +export interface InventoryTransferFieldRefs { + readonly id: Prisma.FieldRef<"InventoryTransfer", 'Int'> + readonly code: Prisma.FieldRef<"InventoryTransfer", 'String'> + readonly description: Prisma.FieldRef<"InventoryTransfer", 'String'> + readonly createdAt: Prisma.FieldRef<"InventoryTransfer", 'DateTime'> + readonly fromInventoryId: Prisma.FieldRef<"InventoryTransfer", 'Int'> + readonly toInventoryId: Prisma.FieldRef<"InventoryTransfer", 'Int'> +} + + +// Custom InputTypes +/** + * InventoryTransfer findUnique + */ +export type InventoryTransferFindUniqueArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + /** + * Filter, which InventoryTransfer to fetch. + */ + where: Prisma.InventoryTransferWhereUniqueInput +} + +/** + * InventoryTransfer findUniqueOrThrow + */ +export type InventoryTransferFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + /** + * Filter, which InventoryTransfer to fetch. + */ + where: Prisma.InventoryTransferWhereUniqueInput +} + +/** + * InventoryTransfer findFirst + */ +export type InventoryTransferFindFirstArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + /** + * Filter, which InventoryTransfer to fetch. + */ + where?: Prisma.InventoryTransferWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of InventoryTransfers to fetch. + */ + orderBy?: Prisma.InventoryTransferOrderByWithRelationInput | Prisma.InventoryTransferOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for InventoryTransfers. + */ + cursor?: Prisma.InventoryTransferWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` InventoryTransfers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` InventoryTransfers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of InventoryTransfers. + */ + distinct?: Prisma.InventoryTransferScalarFieldEnum | Prisma.InventoryTransferScalarFieldEnum[] +} + +/** + * InventoryTransfer findFirstOrThrow + */ +export type InventoryTransferFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + /** + * Filter, which InventoryTransfer to fetch. + */ + where?: Prisma.InventoryTransferWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of InventoryTransfers to fetch. + */ + orderBy?: Prisma.InventoryTransferOrderByWithRelationInput | Prisma.InventoryTransferOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for InventoryTransfers. + */ + cursor?: Prisma.InventoryTransferWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` InventoryTransfers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` InventoryTransfers. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of InventoryTransfers. + */ + distinct?: Prisma.InventoryTransferScalarFieldEnum | Prisma.InventoryTransferScalarFieldEnum[] +} + +/** + * InventoryTransfer findMany + */ +export type InventoryTransferFindManyArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + /** + * Filter, which InventoryTransfers to fetch. + */ + where?: Prisma.InventoryTransferWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of InventoryTransfers to fetch. + */ + orderBy?: Prisma.InventoryTransferOrderByWithRelationInput | Prisma.InventoryTransferOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing InventoryTransfers. + */ + cursor?: Prisma.InventoryTransferWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` InventoryTransfers from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` InventoryTransfers. + */ + skip?: number + distinct?: Prisma.InventoryTransferScalarFieldEnum | Prisma.InventoryTransferScalarFieldEnum[] +} + +/** + * InventoryTransfer create + */ +export type InventoryTransferCreateArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + /** + * The data needed to create a InventoryTransfer. + */ + data: Prisma.XOR +} + +/** + * InventoryTransfer createMany + */ +export type InventoryTransferCreateManyArgs = { + /** + * The data used to create many InventoryTransfers. + */ + data: Prisma.InventoryTransferCreateManyInput | Prisma.InventoryTransferCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * InventoryTransfer update + */ +export type InventoryTransferUpdateArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + /** + * The data needed to update a InventoryTransfer. + */ + data: Prisma.XOR + /** + * Choose, which InventoryTransfer to update. + */ + where: Prisma.InventoryTransferWhereUniqueInput +} + +/** + * InventoryTransfer updateMany + */ +export type InventoryTransferUpdateManyArgs = { + /** + * The data used to update InventoryTransfers. + */ + data: Prisma.XOR + /** + * Filter which InventoryTransfers to update + */ + where?: Prisma.InventoryTransferWhereInput + /** + * Limit how many InventoryTransfers to update. + */ + limit?: number +} + +/** + * InventoryTransfer upsert + */ +export type InventoryTransferUpsertArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + /** + * The filter to search for the InventoryTransfer to update in case it exists. + */ + where: Prisma.InventoryTransferWhereUniqueInput + /** + * In case the InventoryTransfer found by the `where` argument doesn't exist, create a new InventoryTransfer with this data. + */ + create: Prisma.XOR + /** + * In case the InventoryTransfer was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * InventoryTransfer delete + */ +export type InventoryTransferDeleteArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null + /** + * Filter which InventoryTransfer to delete. + */ + where: Prisma.InventoryTransferWhereUniqueInput +} + +/** + * InventoryTransfer deleteMany + */ +export type InventoryTransferDeleteManyArgs = { + /** + * Filter which InventoryTransfers to delete + */ + where?: Prisma.InventoryTransferWhereInput + /** + * Limit how many InventoryTransfers to delete. + */ + limit?: number +} + +/** + * InventoryTransfer.items + */ +export type InventoryTransfer$itemsArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + where?: Prisma.InventoryTransferItemWhereInput + orderBy?: Prisma.InventoryTransferItemOrderByWithRelationInput | Prisma.InventoryTransferItemOrderByWithRelationInput[] + cursor?: Prisma.InventoryTransferItemWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.InventoryTransferItemScalarFieldEnum | Prisma.InventoryTransferItemScalarFieldEnum[] +} + +/** + * InventoryTransfer without action + */ +export type InventoryTransferDefaultArgs = { + /** + * Select specific fields to fetch from the InventoryTransfer + */ + select?: Prisma.InventoryTransferSelect | null + /** + * Omit specific fields from the InventoryTransfer + */ + omit?: Prisma.InventoryTransferOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferInclude | null +} diff --git a/src/generated/prisma/models/InventoryTransferItem.ts b/src/generated/prisma/models/InventoryTransferItem.ts new file mode 100644 index 0000000..4f58360 --- /dev/null +++ b/src/generated/prisma/models/InventoryTransferItem.ts @@ -0,0 +1,1343 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `InventoryTransferItem` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model InventoryTransferItem + * + */ +export type InventoryTransferItemModel = runtime.Types.Result.DefaultSelection + +export type AggregateInventoryTransferItem = { + _count: InventoryTransferItemCountAggregateOutputType | null + _avg: InventoryTransferItemAvgAggregateOutputType | null + _sum: InventoryTransferItemSumAggregateOutputType | null + _min: InventoryTransferItemMinAggregateOutputType | null + _max: InventoryTransferItemMaxAggregateOutputType | null +} + +export type InventoryTransferItemAvgAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + productId: number | null + transferId: number | null +} + +export type InventoryTransferItemSumAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + productId: number | null + transferId: number | null +} + +export type InventoryTransferItemMinAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + productId: number | null + transferId: number | null +} + +export type InventoryTransferItemMaxAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + productId: number | null + transferId: number | null +} + +export type InventoryTransferItemCountAggregateOutputType = { + id: number + count: number + productId: number + transferId: number + _all: number +} + + +export type InventoryTransferItemAvgAggregateInputType = { + id?: true + count?: true + productId?: true + transferId?: true +} + +export type InventoryTransferItemSumAggregateInputType = { + id?: true + count?: true + productId?: true + transferId?: true +} + +export type InventoryTransferItemMinAggregateInputType = { + id?: true + count?: true + productId?: true + transferId?: true +} + +export type InventoryTransferItemMaxAggregateInputType = { + id?: true + count?: true + productId?: true + transferId?: true +} + +export type InventoryTransferItemCountAggregateInputType = { + id?: true + count?: true + productId?: true + transferId?: true + _all?: true +} + +export type InventoryTransferItemAggregateArgs = { + /** + * Filter which InventoryTransferItem to aggregate. + */ + where?: Prisma.InventoryTransferItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of InventoryTransferItems to fetch. + */ + orderBy?: Prisma.InventoryTransferItemOrderByWithRelationInput | Prisma.InventoryTransferItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.InventoryTransferItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` InventoryTransferItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` InventoryTransferItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned InventoryTransferItems + **/ + _count?: true | InventoryTransferItemCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: InventoryTransferItemAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: InventoryTransferItemSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: InventoryTransferItemMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: InventoryTransferItemMaxAggregateInputType +} + +export type GetInventoryTransferItemAggregateType = { + [P in keyof T & keyof AggregateInventoryTransferItem]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type InventoryTransferItemGroupByArgs = { + where?: Prisma.InventoryTransferItemWhereInput + orderBy?: Prisma.InventoryTransferItemOrderByWithAggregationInput | Prisma.InventoryTransferItemOrderByWithAggregationInput[] + by: Prisma.InventoryTransferItemScalarFieldEnum[] | Prisma.InventoryTransferItemScalarFieldEnum + having?: Prisma.InventoryTransferItemScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: InventoryTransferItemCountAggregateInputType | true + _avg?: InventoryTransferItemAvgAggregateInputType + _sum?: InventoryTransferItemSumAggregateInputType + _min?: InventoryTransferItemMinAggregateInputType + _max?: InventoryTransferItemMaxAggregateInputType +} + +export type InventoryTransferItemGroupByOutputType = { + id: number + count: runtime.Decimal + productId: number + transferId: number + _count: InventoryTransferItemCountAggregateOutputType | null + _avg: InventoryTransferItemAvgAggregateOutputType | null + _sum: InventoryTransferItemSumAggregateOutputType | null + _min: InventoryTransferItemMinAggregateOutputType | null + _max: InventoryTransferItemMaxAggregateOutputType | null +} + +type GetInventoryTransferItemGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof InventoryTransferItemGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type InventoryTransferItemWhereInput = { + AND?: Prisma.InventoryTransferItemWhereInput | Prisma.InventoryTransferItemWhereInput[] + OR?: Prisma.InventoryTransferItemWhereInput[] + NOT?: Prisma.InventoryTransferItemWhereInput | Prisma.InventoryTransferItemWhereInput[] + id?: Prisma.IntFilter<"InventoryTransferItem"> | number + count?: Prisma.DecimalFilter<"InventoryTransferItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + productId?: Prisma.IntFilter<"InventoryTransferItem"> | number + transferId?: Prisma.IntFilter<"InventoryTransferItem"> | number + product?: Prisma.XOR + transfer?: Prisma.XOR +} + +export type InventoryTransferItemOrderByWithRelationInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + productId?: Prisma.SortOrder + transferId?: Prisma.SortOrder + product?: Prisma.ProductOrderByWithRelationInput + transfer?: Prisma.InventoryTransferOrderByWithRelationInput +} + +export type InventoryTransferItemWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.InventoryTransferItemWhereInput | Prisma.InventoryTransferItemWhereInput[] + OR?: Prisma.InventoryTransferItemWhereInput[] + NOT?: Prisma.InventoryTransferItemWhereInput | Prisma.InventoryTransferItemWhereInput[] + count?: Prisma.DecimalFilter<"InventoryTransferItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + productId?: Prisma.IntFilter<"InventoryTransferItem"> | number + transferId?: Prisma.IntFilter<"InventoryTransferItem"> | number + product?: Prisma.XOR + transfer?: Prisma.XOR +}, "id"> + +export type InventoryTransferItemOrderByWithAggregationInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + productId?: Prisma.SortOrder + transferId?: Prisma.SortOrder + _count?: Prisma.InventoryTransferItemCountOrderByAggregateInput + _avg?: Prisma.InventoryTransferItemAvgOrderByAggregateInput + _max?: Prisma.InventoryTransferItemMaxOrderByAggregateInput + _min?: Prisma.InventoryTransferItemMinOrderByAggregateInput + _sum?: Prisma.InventoryTransferItemSumOrderByAggregateInput +} + +export type InventoryTransferItemScalarWhereWithAggregatesInput = { + AND?: Prisma.InventoryTransferItemScalarWhereWithAggregatesInput | Prisma.InventoryTransferItemScalarWhereWithAggregatesInput[] + OR?: Prisma.InventoryTransferItemScalarWhereWithAggregatesInput[] + NOT?: Prisma.InventoryTransferItemScalarWhereWithAggregatesInput | Prisma.InventoryTransferItemScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"InventoryTransferItem"> | number + count?: Prisma.DecimalWithAggregatesFilter<"InventoryTransferItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + productId?: Prisma.IntWithAggregatesFilter<"InventoryTransferItem"> | number + transferId?: Prisma.IntWithAggregatesFilter<"InventoryTransferItem"> | number +} + +export type InventoryTransferItemCreateInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + product: Prisma.ProductCreateNestedOneWithoutInventoryTransferItemsInput + transfer: Prisma.InventoryTransferCreateNestedOneWithoutItemsInput +} + +export type InventoryTransferItemUncheckedCreateInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + productId: number + transferId: number +} + +export type InventoryTransferItemUpdateInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + product?: Prisma.ProductUpdateOneRequiredWithoutInventoryTransferItemsNestedInput + transfer?: Prisma.InventoryTransferUpdateOneRequiredWithoutItemsNestedInput +} + +export type InventoryTransferItemUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + productId?: Prisma.IntFieldUpdateOperationsInput | number + transferId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type InventoryTransferItemCreateManyInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + productId: number + transferId: number +} + +export type InventoryTransferItemUpdateManyMutationInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type InventoryTransferItemUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + productId?: Prisma.IntFieldUpdateOperationsInput | number + transferId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type InventoryTransferItemListRelationFilter = { + every?: Prisma.InventoryTransferItemWhereInput + some?: Prisma.InventoryTransferItemWhereInput + none?: Prisma.InventoryTransferItemWhereInput +} + +export type InventoryTransferItemOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type InventoryTransferItemCountOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + productId?: Prisma.SortOrder + transferId?: Prisma.SortOrder +} + +export type InventoryTransferItemAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + productId?: Prisma.SortOrder + transferId?: Prisma.SortOrder +} + +export type InventoryTransferItemMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + productId?: Prisma.SortOrder + transferId?: Prisma.SortOrder +} + +export type InventoryTransferItemMinOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + productId?: Prisma.SortOrder + transferId?: Prisma.SortOrder +} + +export type InventoryTransferItemSumOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + productId?: Prisma.SortOrder + transferId?: Prisma.SortOrder +} + +export type InventoryTransferItemCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.InventoryTransferItemCreateWithoutProductInput[] | Prisma.InventoryTransferItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.InventoryTransferItemCreateOrConnectWithoutProductInput | Prisma.InventoryTransferItemCreateOrConnectWithoutProductInput[] + createMany?: Prisma.InventoryTransferItemCreateManyProductInputEnvelope + connect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] +} + +export type InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.InventoryTransferItemCreateWithoutProductInput[] | Prisma.InventoryTransferItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.InventoryTransferItemCreateOrConnectWithoutProductInput | Prisma.InventoryTransferItemCreateOrConnectWithoutProductInput[] + createMany?: Prisma.InventoryTransferItemCreateManyProductInputEnvelope + connect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] +} + +export type InventoryTransferItemUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.InventoryTransferItemCreateWithoutProductInput[] | Prisma.InventoryTransferItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.InventoryTransferItemCreateOrConnectWithoutProductInput | Prisma.InventoryTransferItemCreateOrConnectWithoutProductInput[] + upsert?: Prisma.InventoryTransferItemUpsertWithWhereUniqueWithoutProductInput | Prisma.InventoryTransferItemUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.InventoryTransferItemCreateManyProductInputEnvelope + set?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + disconnect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + delete?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + connect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + update?: Prisma.InventoryTransferItemUpdateWithWhereUniqueWithoutProductInput | Prisma.InventoryTransferItemUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.InventoryTransferItemUpdateManyWithWhereWithoutProductInput | Prisma.InventoryTransferItemUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.InventoryTransferItemScalarWhereInput | Prisma.InventoryTransferItemScalarWhereInput[] +} + +export type InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.InventoryTransferItemCreateWithoutProductInput[] | Prisma.InventoryTransferItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.InventoryTransferItemCreateOrConnectWithoutProductInput | Prisma.InventoryTransferItemCreateOrConnectWithoutProductInput[] + upsert?: Prisma.InventoryTransferItemUpsertWithWhereUniqueWithoutProductInput | Prisma.InventoryTransferItemUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.InventoryTransferItemCreateManyProductInputEnvelope + set?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + disconnect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + delete?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + connect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + update?: Prisma.InventoryTransferItemUpdateWithWhereUniqueWithoutProductInput | Prisma.InventoryTransferItemUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.InventoryTransferItemUpdateManyWithWhereWithoutProductInput | Prisma.InventoryTransferItemUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.InventoryTransferItemScalarWhereInput | Prisma.InventoryTransferItemScalarWhereInput[] +} + +export type InventoryTransferItemCreateNestedManyWithoutTransferInput = { + create?: Prisma.XOR | Prisma.InventoryTransferItemCreateWithoutTransferInput[] | Prisma.InventoryTransferItemUncheckedCreateWithoutTransferInput[] + connectOrCreate?: Prisma.InventoryTransferItemCreateOrConnectWithoutTransferInput | Prisma.InventoryTransferItemCreateOrConnectWithoutTransferInput[] + createMany?: Prisma.InventoryTransferItemCreateManyTransferInputEnvelope + connect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] +} + +export type InventoryTransferItemUncheckedCreateNestedManyWithoutTransferInput = { + create?: Prisma.XOR | Prisma.InventoryTransferItemCreateWithoutTransferInput[] | Prisma.InventoryTransferItemUncheckedCreateWithoutTransferInput[] + connectOrCreate?: Prisma.InventoryTransferItemCreateOrConnectWithoutTransferInput | Prisma.InventoryTransferItemCreateOrConnectWithoutTransferInput[] + createMany?: Prisma.InventoryTransferItemCreateManyTransferInputEnvelope + connect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] +} + +export type InventoryTransferItemUpdateManyWithoutTransferNestedInput = { + create?: Prisma.XOR | Prisma.InventoryTransferItemCreateWithoutTransferInput[] | Prisma.InventoryTransferItemUncheckedCreateWithoutTransferInput[] + connectOrCreate?: Prisma.InventoryTransferItemCreateOrConnectWithoutTransferInput | Prisma.InventoryTransferItemCreateOrConnectWithoutTransferInput[] + upsert?: Prisma.InventoryTransferItemUpsertWithWhereUniqueWithoutTransferInput | Prisma.InventoryTransferItemUpsertWithWhereUniqueWithoutTransferInput[] + createMany?: Prisma.InventoryTransferItemCreateManyTransferInputEnvelope + set?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + disconnect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + delete?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + connect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + update?: Prisma.InventoryTransferItemUpdateWithWhereUniqueWithoutTransferInput | Prisma.InventoryTransferItemUpdateWithWhereUniqueWithoutTransferInput[] + updateMany?: Prisma.InventoryTransferItemUpdateManyWithWhereWithoutTransferInput | Prisma.InventoryTransferItemUpdateManyWithWhereWithoutTransferInput[] + deleteMany?: Prisma.InventoryTransferItemScalarWhereInput | Prisma.InventoryTransferItemScalarWhereInput[] +} + +export type InventoryTransferItemUncheckedUpdateManyWithoutTransferNestedInput = { + create?: Prisma.XOR | Prisma.InventoryTransferItemCreateWithoutTransferInput[] | Prisma.InventoryTransferItemUncheckedCreateWithoutTransferInput[] + connectOrCreate?: Prisma.InventoryTransferItemCreateOrConnectWithoutTransferInput | Prisma.InventoryTransferItemCreateOrConnectWithoutTransferInput[] + upsert?: Prisma.InventoryTransferItemUpsertWithWhereUniqueWithoutTransferInput | Prisma.InventoryTransferItemUpsertWithWhereUniqueWithoutTransferInput[] + createMany?: Prisma.InventoryTransferItemCreateManyTransferInputEnvelope + set?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + disconnect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + delete?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + connect?: Prisma.InventoryTransferItemWhereUniqueInput | Prisma.InventoryTransferItemWhereUniqueInput[] + update?: Prisma.InventoryTransferItemUpdateWithWhereUniqueWithoutTransferInput | Prisma.InventoryTransferItemUpdateWithWhereUniqueWithoutTransferInput[] + updateMany?: Prisma.InventoryTransferItemUpdateManyWithWhereWithoutTransferInput | Prisma.InventoryTransferItemUpdateManyWithWhereWithoutTransferInput[] + deleteMany?: Prisma.InventoryTransferItemScalarWhereInput | Prisma.InventoryTransferItemScalarWhereInput[] +} + +export type InventoryTransferItemCreateWithoutProductInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + transfer: Prisma.InventoryTransferCreateNestedOneWithoutItemsInput +} + +export type InventoryTransferItemUncheckedCreateWithoutProductInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + transferId: number +} + +export type InventoryTransferItemCreateOrConnectWithoutProductInput = { + where: Prisma.InventoryTransferItemWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryTransferItemCreateManyProductInputEnvelope = { + data: Prisma.InventoryTransferItemCreateManyProductInput | Prisma.InventoryTransferItemCreateManyProductInput[] + skipDuplicates?: boolean +} + +export type InventoryTransferItemUpsertWithWhereUniqueWithoutProductInput = { + where: Prisma.InventoryTransferItemWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type InventoryTransferItemUpdateWithWhereUniqueWithoutProductInput = { + where: Prisma.InventoryTransferItemWhereUniqueInput + data: Prisma.XOR +} + +export type InventoryTransferItemUpdateManyWithWhereWithoutProductInput = { + where: Prisma.InventoryTransferItemScalarWhereInput + data: Prisma.XOR +} + +export type InventoryTransferItemScalarWhereInput = { + AND?: Prisma.InventoryTransferItemScalarWhereInput | Prisma.InventoryTransferItemScalarWhereInput[] + OR?: Prisma.InventoryTransferItemScalarWhereInput[] + NOT?: Prisma.InventoryTransferItemScalarWhereInput | Prisma.InventoryTransferItemScalarWhereInput[] + id?: Prisma.IntFilter<"InventoryTransferItem"> | number + count?: Prisma.DecimalFilter<"InventoryTransferItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + productId?: Prisma.IntFilter<"InventoryTransferItem"> | number + transferId?: Prisma.IntFilter<"InventoryTransferItem"> | number +} + +export type InventoryTransferItemCreateWithoutTransferInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + product: Prisma.ProductCreateNestedOneWithoutInventoryTransferItemsInput +} + +export type InventoryTransferItemUncheckedCreateWithoutTransferInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + productId: number +} + +export type InventoryTransferItemCreateOrConnectWithoutTransferInput = { + where: Prisma.InventoryTransferItemWhereUniqueInput + create: Prisma.XOR +} + +export type InventoryTransferItemCreateManyTransferInputEnvelope = { + data: Prisma.InventoryTransferItemCreateManyTransferInput | Prisma.InventoryTransferItemCreateManyTransferInput[] + skipDuplicates?: boolean +} + +export type InventoryTransferItemUpsertWithWhereUniqueWithoutTransferInput = { + where: Prisma.InventoryTransferItemWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type InventoryTransferItemUpdateWithWhereUniqueWithoutTransferInput = { + where: Prisma.InventoryTransferItemWhereUniqueInput + data: Prisma.XOR +} + +export type InventoryTransferItemUpdateManyWithWhereWithoutTransferInput = { + where: Prisma.InventoryTransferItemScalarWhereInput + data: Prisma.XOR +} + +export type InventoryTransferItemCreateManyProductInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + transferId: number +} + +export type InventoryTransferItemUpdateWithoutProductInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + transfer?: Prisma.InventoryTransferUpdateOneRequiredWithoutItemsNestedInput +} + +export type InventoryTransferItemUncheckedUpdateWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + transferId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type InventoryTransferItemUncheckedUpdateManyWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + transferId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type InventoryTransferItemCreateManyTransferInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + productId: number +} + +export type InventoryTransferItemUpdateWithoutTransferInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + product?: Prisma.ProductUpdateOneRequiredWithoutInventoryTransferItemsNestedInput +} + +export type InventoryTransferItemUncheckedUpdateWithoutTransferInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type InventoryTransferItemUncheckedUpdateManyWithoutTransferInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + + + +export type InventoryTransferItemSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + count?: boolean + productId?: boolean + transferId?: boolean + product?: boolean | Prisma.ProductDefaultArgs + transfer?: boolean | Prisma.InventoryTransferDefaultArgs +}, ExtArgs["result"]["inventoryTransferItem"]> + + + +export type InventoryTransferItemSelectScalar = { + id?: boolean + count?: boolean + productId?: boolean + transferId?: boolean +} + +export type InventoryTransferItemOmit = runtime.Types.Extensions.GetOmit<"id" | "count" | "productId" | "transferId", ExtArgs["result"]["inventoryTransferItem"]> +export type InventoryTransferItemInclude = { + product?: boolean | Prisma.ProductDefaultArgs + transfer?: boolean | Prisma.InventoryTransferDefaultArgs +} + +export type $InventoryTransferItemPayload = { + name: "InventoryTransferItem" + objects: { + product: Prisma.$ProductPayload + transfer: Prisma.$InventoryTransferPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + count: runtime.Decimal + productId: number + transferId: number + }, ExtArgs["result"]["inventoryTransferItem"]> + composites: {} +} + +export type InventoryTransferItemGetPayload = runtime.Types.Result.GetResult + +export type InventoryTransferItemCountArgs = + Omit & { + select?: InventoryTransferItemCountAggregateInputType | true + } + +export interface InventoryTransferItemDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['InventoryTransferItem'], meta: { name: 'InventoryTransferItem' } } + /** + * Find zero or one InventoryTransferItem that matches the filter. + * @param {InventoryTransferItemFindUniqueArgs} args - Arguments to find a InventoryTransferItem + * @example + * // Get one InventoryTransferItem + * const inventoryTransferItem = await prisma.inventoryTransferItem.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferItemClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one InventoryTransferItem that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {InventoryTransferItemFindUniqueOrThrowArgs} args - Arguments to find a InventoryTransferItem + * @example + * // Get one InventoryTransferItem + * const inventoryTransferItem = await prisma.inventoryTransferItem.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferItemClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first InventoryTransferItem that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferItemFindFirstArgs} args - Arguments to find a InventoryTransferItem + * @example + * // Get one InventoryTransferItem + * const inventoryTransferItem = await prisma.inventoryTransferItem.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferItemClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first InventoryTransferItem that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferItemFindFirstOrThrowArgs} args - Arguments to find a InventoryTransferItem + * @example + * // Get one InventoryTransferItem + * const inventoryTransferItem = await prisma.inventoryTransferItem.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferItemClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more InventoryTransferItems that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferItemFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all InventoryTransferItems + * const inventoryTransferItems = await prisma.inventoryTransferItem.findMany() + * + * // Get first 10 InventoryTransferItems + * const inventoryTransferItems = await prisma.inventoryTransferItem.findMany({ take: 10 }) + * + * // Only select the `id` + * const inventoryTransferItemWithIdOnly = await prisma.inventoryTransferItem.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a InventoryTransferItem. + * @param {InventoryTransferItemCreateArgs} args - Arguments to create a InventoryTransferItem. + * @example + * // Create one InventoryTransferItem + * const InventoryTransferItem = await prisma.inventoryTransferItem.create({ + * data: { + * // ... data to create a InventoryTransferItem + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferItemClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many InventoryTransferItems. + * @param {InventoryTransferItemCreateManyArgs} args - Arguments to create many InventoryTransferItems. + * @example + * // Create many InventoryTransferItems + * const inventoryTransferItem = await prisma.inventoryTransferItem.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a InventoryTransferItem. + * @param {InventoryTransferItemDeleteArgs} args - Arguments to delete one InventoryTransferItem. + * @example + * // Delete one InventoryTransferItem + * const InventoryTransferItem = await prisma.inventoryTransferItem.delete({ + * where: { + * // ... filter to delete one InventoryTransferItem + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferItemClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one InventoryTransferItem. + * @param {InventoryTransferItemUpdateArgs} args - Arguments to update one InventoryTransferItem. + * @example + * // Update one InventoryTransferItem + * const inventoryTransferItem = await prisma.inventoryTransferItem.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferItemClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more InventoryTransferItems. + * @param {InventoryTransferItemDeleteManyArgs} args - Arguments to filter InventoryTransferItems to delete. + * @example + * // Delete a few InventoryTransferItems + * const { count } = await prisma.inventoryTransferItem.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more InventoryTransferItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferItemUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many InventoryTransferItems + * const inventoryTransferItem = await prisma.inventoryTransferItem.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one InventoryTransferItem. + * @param {InventoryTransferItemUpsertArgs} args - Arguments to update or create a InventoryTransferItem. + * @example + * // Update or create a InventoryTransferItem + * const inventoryTransferItem = await prisma.inventoryTransferItem.upsert({ + * create: { + * // ... data to create a InventoryTransferItem + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the InventoryTransferItem we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__InventoryTransferItemClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of InventoryTransferItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferItemCountArgs} args - Arguments to filter InventoryTransferItems to count. + * @example + * // Count the number of InventoryTransferItems + * const count = await prisma.inventoryTransferItem.count({ + * where: { + * // ... the filter for the InventoryTransferItems we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a InventoryTransferItem. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferItemAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by InventoryTransferItem. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {InventoryTransferItemGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends InventoryTransferItemGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: InventoryTransferItemGroupByArgs['orderBy'] } + : { orderBy?: InventoryTransferItemGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetInventoryTransferItemGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the InventoryTransferItem model + */ +readonly fields: InventoryTransferItemFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for InventoryTransferItem. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__InventoryTransferItemClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + product = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProductClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + transfer = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryTransferClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the InventoryTransferItem model + */ +export interface InventoryTransferItemFieldRefs { + readonly id: Prisma.FieldRef<"InventoryTransferItem", 'Int'> + readonly count: Prisma.FieldRef<"InventoryTransferItem", 'Decimal'> + readonly productId: Prisma.FieldRef<"InventoryTransferItem", 'Int'> + readonly transferId: Prisma.FieldRef<"InventoryTransferItem", 'Int'> +} + + +// Custom InputTypes +/** + * InventoryTransferItem findUnique + */ +export type InventoryTransferItemFindUniqueArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + /** + * Filter, which InventoryTransferItem to fetch. + */ + where: Prisma.InventoryTransferItemWhereUniqueInput +} + +/** + * InventoryTransferItem findUniqueOrThrow + */ +export type InventoryTransferItemFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + /** + * Filter, which InventoryTransferItem to fetch. + */ + where: Prisma.InventoryTransferItemWhereUniqueInput +} + +/** + * InventoryTransferItem findFirst + */ +export type InventoryTransferItemFindFirstArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + /** + * Filter, which InventoryTransferItem to fetch. + */ + where?: Prisma.InventoryTransferItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of InventoryTransferItems to fetch. + */ + orderBy?: Prisma.InventoryTransferItemOrderByWithRelationInput | Prisma.InventoryTransferItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for InventoryTransferItems. + */ + cursor?: Prisma.InventoryTransferItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` InventoryTransferItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` InventoryTransferItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of InventoryTransferItems. + */ + distinct?: Prisma.InventoryTransferItemScalarFieldEnum | Prisma.InventoryTransferItemScalarFieldEnum[] +} + +/** + * InventoryTransferItem findFirstOrThrow + */ +export type InventoryTransferItemFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + /** + * Filter, which InventoryTransferItem to fetch. + */ + where?: Prisma.InventoryTransferItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of InventoryTransferItems to fetch. + */ + orderBy?: Prisma.InventoryTransferItemOrderByWithRelationInput | Prisma.InventoryTransferItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for InventoryTransferItems. + */ + cursor?: Prisma.InventoryTransferItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` InventoryTransferItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` InventoryTransferItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of InventoryTransferItems. + */ + distinct?: Prisma.InventoryTransferItemScalarFieldEnum | Prisma.InventoryTransferItemScalarFieldEnum[] +} + +/** + * InventoryTransferItem findMany + */ +export type InventoryTransferItemFindManyArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + /** + * Filter, which InventoryTransferItems to fetch. + */ + where?: Prisma.InventoryTransferItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of InventoryTransferItems to fetch. + */ + orderBy?: Prisma.InventoryTransferItemOrderByWithRelationInput | Prisma.InventoryTransferItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing InventoryTransferItems. + */ + cursor?: Prisma.InventoryTransferItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` InventoryTransferItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` InventoryTransferItems. + */ + skip?: number + distinct?: Prisma.InventoryTransferItemScalarFieldEnum | Prisma.InventoryTransferItemScalarFieldEnum[] +} + +/** + * InventoryTransferItem create + */ +export type InventoryTransferItemCreateArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + /** + * The data needed to create a InventoryTransferItem. + */ + data: Prisma.XOR +} + +/** + * InventoryTransferItem createMany + */ +export type InventoryTransferItemCreateManyArgs = { + /** + * The data used to create many InventoryTransferItems. + */ + data: Prisma.InventoryTransferItemCreateManyInput | Prisma.InventoryTransferItemCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * InventoryTransferItem update + */ +export type InventoryTransferItemUpdateArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + /** + * The data needed to update a InventoryTransferItem. + */ + data: Prisma.XOR + /** + * Choose, which InventoryTransferItem to update. + */ + where: Prisma.InventoryTransferItemWhereUniqueInput +} + +/** + * InventoryTransferItem updateMany + */ +export type InventoryTransferItemUpdateManyArgs = { + /** + * The data used to update InventoryTransferItems. + */ + data: Prisma.XOR + /** + * Filter which InventoryTransferItems to update + */ + where?: Prisma.InventoryTransferItemWhereInput + /** + * Limit how many InventoryTransferItems to update. + */ + limit?: number +} + +/** + * InventoryTransferItem upsert + */ +export type InventoryTransferItemUpsertArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + /** + * The filter to search for the InventoryTransferItem to update in case it exists. + */ + where: Prisma.InventoryTransferItemWhereUniqueInput + /** + * In case the InventoryTransferItem found by the `where` argument doesn't exist, create a new InventoryTransferItem with this data. + */ + create: Prisma.XOR + /** + * In case the InventoryTransferItem was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * InventoryTransferItem delete + */ +export type InventoryTransferItemDeleteArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + /** + * Filter which InventoryTransferItem to delete. + */ + where: Prisma.InventoryTransferItemWhereUniqueInput +} + +/** + * InventoryTransferItem deleteMany + */ +export type InventoryTransferItemDeleteManyArgs = { + /** + * Filter which InventoryTransferItems to delete + */ + where?: Prisma.InventoryTransferItemWhereInput + /** + * Limit how many InventoryTransferItems to delete. + */ + limit?: number +} + +/** + * InventoryTransferItem without action + */ +export type InventoryTransferItemDefaultArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null +} diff --git a/src/generated/prisma/models/Order.ts b/src/generated/prisma/models/Order.ts new file mode 100644 index 0000000..45996b2 --- /dev/null +++ b/src/generated/prisma/models/Order.ts @@ -0,0 +1,1409 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `Order` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Order + * + */ +export type OrderModel = runtime.Types.Result.DefaultSelection + +export type AggregateOrder = { + _count: OrderCountAggregateOutputType | null + _avg: OrderAvgAggregateOutputType | null + _sum: OrderSumAggregateOutputType | null + _min: OrderMinAggregateOutputType | null + _max: OrderMaxAggregateOutputType | null +} + +export type OrderAvgAggregateOutputType = { + id: number | null + totalAmount: runtime.Decimal | null + customerId: number | null +} + +export type OrderSumAggregateOutputType = { + id: number | null + totalAmount: runtime.Decimal | null + customerId: number | null +} + +export type OrderMinAggregateOutputType = { + id: number | null + orderNumber: string | null + status: $Enums.OrderStatus | null + paymentMethod: $Enums.paymentMethod | null + totalAmount: runtime.Decimal | null + createdAt: Date | null + updatedAt: Date | null + deletedAt: Date | null + customerId: number | null +} + +export type OrderMaxAggregateOutputType = { + id: number | null + orderNumber: string | null + status: $Enums.OrderStatus | null + paymentMethod: $Enums.paymentMethod | null + totalAmount: runtime.Decimal | null + createdAt: Date | null + updatedAt: Date | null + deletedAt: Date | null + customerId: number | null +} + +export type OrderCountAggregateOutputType = { + id: number + orderNumber: number + status: number + paymentMethod: number + totalAmount: number + createdAt: number + updatedAt: number + deletedAt: number + customerId: number + _all: number +} + + +export type OrderAvgAggregateInputType = { + id?: true + totalAmount?: true + customerId?: true +} + +export type OrderSumAggregateInputType = { + id?: true + totalAmount?: true + customerId?: true +} + +export type OrderMinAggregateInputType = { + id?: true + orderNumber?: true + status?: true + paymentMethod?: true + totalAmount?: true + createdAt?: true + updatedAt?: true + deletedAt?: true + customerId?: true +} + +export type OrderMaxAggregateInputType = { + id?: true + orderNumber?: true + status?: true + paymentMethod?: true + totalAmount?: true + createdAt?: true + updatedAt?: true + deletedAt?: true + customerId?: true +} + +export type OrderCountAggregateInputType = { + id?: true + orderNumber?: true + status?: true + paymentMethod?: true + totalAmount?: true + createdAt?: true + updatedAt?: true + deletedAt?: true + customerId?: true + _all?: true +} + +export type OrderAggregateArgs = { + /** + * Filter which Order to aggregate. + */ + where?: Prisma.OrderWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Orders to fetch. + */ + orderBy?: Prisma.OrderOrderByWithRelationInput | Prisma.OrderOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.OrderWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Orders from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Orders. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Orders + **/ + _count?: true | OrderCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: OrderAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: OrderSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: OrderMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: OrderMaxAggregateInputType +} + +export type GetOrderAggregateType = { + [P in keyof T & keyof AggregateOrder]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type OrderGroupByArgs = { + where?: Prisma.OrderWhereInput + orderBy?: Prisma.OrderOrderByWithAggregationInput | Prisma.OrderOrderByWithAggregationInput[] + by: Prisma.OrderScalarFieldEnum[] | Prisma.OrderScalarFieldEnum + having?: Prisma.OrderScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: OrderCountAggregateInputType | true + _avg?: OrderAvgAggregateInputType + _sum?: OrderSumAggregateInputType + _min?: OrderMinAggregateInputType + _max?: OrderMaxAggregateInputType +} + +export type OrderGroupByOutputType = { + id: number + orderNumber: string + status: $Enums.OrderStatus + paymentMethod: $Enums.paymentMethod + totalAmount: runtime.Decimal + createdAt: Date + updatedAt: Date + deletedAt: Date | null + customerId: number + _count: OrderCountAggregateOutputType | null + _avg: OrderAvgAggregateOutputType | null + _sum: OrderSumAggregateOutputType | null + _min: OrderMinAggregateOutputType | null + _max: OrderMaxAggregateOutputType | null +} + +type GetOrderGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof OrderGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type OrderWhereInput = { + AND?: Prisma.OrderWhereInput | Prisma.OrderWhereInput[] + OR?: Prisma.OrderWhereInput[] + NOT?: Prisma.OrderWhereInput | Prisma.OrderWhereInput[] + id?: Prisma.IntFilter<"Order"> | number + orderNumber?: Prisma.StringFilter<"Order"> | string + status?: Prisma.EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodFilter<"Order"> | $Enums.paymentMethod + totalAmount?: Prisma.DecimalFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"Order"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Order"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"Order"> | Date | string | null + customerId?: Prisma.IntFilter<"Order"> | number + customer?: Prisma.XOR +} + +export type OrderOrderByWithRelationInput = { + id?: Prisma.SortOrder + orderNumber?: Prisma.SortOrder + status?: Prisma.SortOrder + paymentMethod?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + customerId?: Prisma.SortOrder + customer?: Prisma.CustomerOrderByWithRelationInput + _relevance?: Prisma.OrderOrderByRelevanceInput +} + +export type OrderWhereUniqueInput = Prisma.AtLeast<{ + id?: number + orderNumber?: string + AND?: Prisma.OrderWhereInput | Prisma.OrderWhereInput[] + OR?: Prisma.OrderWhereInput[] + NOT?: Prisma.OrderWhereInput | Prisma.OrderWhereInput[] + status?: Prisma.EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodFilter<"Order"> | $Enums.paymentMethod + totalAmount?: Prisma.DecimalFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"Order"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Order"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"Order"> | Date | string | null + customerId?: Prisma.IntFilter<"Order"> | number + customer?: Prisma.XOR +}, "id" | "orderNumber"> + +export type OrderOrderByWithAggregationInput = { + id?: Prisma.SortOrder + orderNumber?: Prisma.SortOrder + status?: Prisma.SortOrder + paymentMethod?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + customerId?: Prisma.SortOrder + _count?: Prisma.OrderCountOrderByAggregateInput + _avg?: Prisma.OrderAvgOrderByAggregateInput + _max?: Prisma.OrderMaxOrderByAggregateInput + _min?: Prisma.OrderMinOrderByAggregateInput + _sum?: Prisma.OrderSumOrderByAggregateInput +} + +export type OrderScalarWhereWithAggregatesInput = { + AND?: Prisma.OrderScalarWhereWithAggregatesInput | Prisma.OrderScalarWhereWithAggregatesInput[] + OR?: Prisma.OrderScalarWhereWithAggregatesInput[] + NOT?: Prisma.OrderScalarWhereWithAggregatesInput | Prisma.OrderScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"Order"> | number + orderNumber?: Prisma.StringWithAggregatesFilter<"Order"> | string + status?: Prisma.EnumOrderStatusWithAggregatesFilter<"Order"> | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodWithAggregatesFilter<"Order"> | $Enums.paymentMethod + totalAmount?: Prisma.DecimalWithAggregatesFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Order"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Order"> | Date | string + deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Order"> | Date | string | null + customerId?: Prisma.IntWithAggregatesFilter<"Order"> | number +} + +export type OrderCreateInput = { + orderNumber: string + status?: $Enums.OrderStatus + paymentMethod?: $Enums.paymentMethod + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + customer: Prisma.CustomerCreateNestedOneWithoutOrdersInput +} + +export type OrderUncheckedCreateInput = { + id?: number + orderNumber: string + status?: $Enums.OrderStatus + paymentMethod?: $Enums.paymentMethod + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + customerId: number +} + +export type OrderUpdateInput = { + orderNumber?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodFieldUpdateOperationsInput | $Enums.paymentMethod + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + customer?: Prisma.CustomerUpdateOneRequiredWithoutOrdersNestedInput +} + +export type OrderUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + orderNumber?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodFieldUpdateOperationsInput | $Enums.paymentMethod + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + customerId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type OrderCreateManyInput = { + id?: number + orderNumber: string + status?: $Enums.OrderStatus + paymentMethod?: $Enums.paymentMethod + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + customerId: number +} + +export type OrderUpdateManyMutationInput = { + orderNumber?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodFieldUpdateOperationsInput | $Enums.paymentMethod + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + +export type OrderUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + orderNumber?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodFieldUpdateOperationsInput | $Enums.paymentMethod + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + customerId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type OrderListRelationFilter = { + every?: Prisma.OrderWhereInput + some?: Prisma.OrderWhereInput + none?: Prisma.OrderWhereInput +} + +export type OrderOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type OrderOrderByRelevanceInput = { + fields: Prisma.OrderOrderByRelevanceFieldEnum | Prisma.OrderOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type OrderCountOrderByAggregateInput = { + id?: Prisma.SortOrder + orderNumber?: Prisma.SortOrder + status?: Prisma.SortOrder + paymentMethod?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder + customerId?: Prisma.SortOrder +} + +export type OrderAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + customerId?: Prisma.SortOrder +} + +export type OrderMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + orderNumber?: Prisma.SortOrder + status?: Prisma.SortOrder + paymentMethod?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder + customerId?: Prisma.SortOrder +} + +export type OrderMinOrderByAggregateInput = { + id?: Prisma.SortOrder + orderNumber?: Prisma.SortOrder + status?: Prisma.SortOrder + paymentMethod?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder + customerId?: Prisma.SortOrder +} + +export type OrderSumOrderByAggregateInput = { + id?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + customerId?: Prisma.SortOrder +} + +export type OrderCreateNestedManyWithoutCustomerInput = { + create?: Prisma.XOR | Prisma.OrderCreateWithoutCustomerInput[] | Prisma.OrderUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: Prisma.OrderCreateOrConnectWithoutCustomerInput | Prisma.OrderCreateOrConnectWithoutCustomerInput[] + createMany?: Prisma.OrderCreateManyCustomerInputEnvelope + connect?: Prisma.OrderWhereUniqueInput | Prisma.OrderWhereUniqueInput[] +} + +export type OrderUncheckedCreateNestedManyWithoutCustomerInput = { + create?: Prisma.XOR | Prisma.OrderCreateWithoutCustomerInput[] | Prisma.OrderUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: Prisma.OrderCreateOrConnectWithoutCustomerInput | Prisma.OrderCreateOrConnectWithoutCustomerInput[] + createMany?: Prisma.OrderCreateManyCustomerInputEnvelope + connect?: Prisma.OrderWhereUniqueInput | Prisma.OrderWhereUniqueInput[] +} + +export type OrderUpdateManyWithoutCustomerNestedInput = { + create?: Prisma.XOR | Prisma.OrderCreateWithoutCustomerInput[] | Prisma.OrderUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: Prisma.OrderCreateOrConnectWithoutCustomerInput | Prisma.OrderCreateOrConnectWithoutCustomerInput[] + upsert?: Prisma.OrderUpsertWithWhereUniqueWithoutCustomerInput | Prisma.OrderUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: Prisma.OrderCreateManyCustomerInputEnvelope + set?: Prisma.OrderWhereUniqueInput | Prisma.OrderWhereUniqueInput[] + disconnect?: Prisma.OrderWhereUniqueInput | Prisma.OrderWhereUniqueInput[] + delete?: Prisma.OrderWhereUniqueInput | Prisma.OrderWhereUniqueInput[] + connect?: Prisma.OrderWhereUniqueInput | Prisma.OrderWhereUniqueInput[] + update?: Prisma.OrderUpdateWithWhereUniqueWithoutCustomerInput | Prisma.OrderUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: Prisma.OrderUpdateManyWithWhereWithoutCustomerInput | Prisma.OrderUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: Prisma.OrderScalarWhereInput | Prisma.OrderScalarWhereInput[] +} + +export type OrderUncheckedUpdateManyWithoutCustomerNestedInput = { + create?: Prisma.XOR | Prisma.OrderCreateWithoutCustomerInput[] | Prisma.OrderUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: Prisma.OrderCreateOrConnectWithoutCustomerInput | Prisma.OrderCreateOrConnectWithoutCustomerInput[] + upsert?: Prisma.OrderUpsertWithWhereUniqueWithoutCustomerInput | Prisma.OrderUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: Prisma.OrderCreateManyCustomerInputEnvelope + set?: Prisma.OrderWhereUniqueInput | Prisma.OrderWhereUniqueInput[] + disconnect?: Prisma.OrderWhereUniqueInput | Prisma.OrderWhereUniqueInput[] + delete?: Prisma.OrderWhereUniqueInput | Prisma.OrderWhereUniqueInput[] + connect?: Prisma.OrderWhereUniqueInput | Prisma.OrderWhereUniqueInput[] + update?: Prisma.OrderUpdateWithWhereUniqueWithoutCustomerInput | Prisma.OrderUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: Prisma.OrderUpdateManyWithWhereWithoutCustomerInput | Prisma.OrderUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: Prisma.OrderScalarWhereInput | Prisma.OrderScalarWhereInput[] +} + +export type EnumOrderStatusFieldUpdateOperationsInput = { + set?: $Enums.OrderStatus +} + +export type EnumpaymentMethodFieldUpdateOperationsInput = { + set?: $Enums.paymentMethod +} + +export type OrderCreateWithoutCustomerInput = { + orderNumber: string + status?: $Enums.OrderStatus + paymentMethod?: $Enums.paymentMethod + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null +} + +export type OrderUncheckedCreateWithoutCustomerInput = { + id?: number + orderNumber: string + status?: $Enums.OrderStatus + paymentMethod?: $Enums.paymentMethod + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null +} + +export type OrderCreateOrConnectWithoutCustomerInput = { + where: Prisma.OrderWhereUniqueInput + create: Prisma.XOR +} + +export type OrderCreateManyCustomerInputEnvelope = { + data: Prisma.OrderCreateManyCustomerInput | Prisma.OrderCreateManyCustomerInput[] + skipDuplicates?: boolean +} + +export type OrderUpsertWithWhereUniqueWithoutCustomerInput = { + where: Prisma.OrderWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type OrderUpdateWithWhereUniqueWithoutCustomerInput = { + where: Prisma.OrderWhereUniqueInput + data: Prisma.XOR +} + +export type OrderUpdateManyWithWhereWithoutCustomerInput = { + where: Prisma.OrderScalarWhereInput + data: Prisma.XOR +} + +export type OrderScalarWhereInput = { + AND?: Prisma.OrderScalarWhereInput | Prisma.OrderScalarWhereInput[] + OR?: Prisma.OrderScalarWhereInput[] + NOT?: Prisma.OrderScalarWhereInput | Prisma.OrderScalarWhereInput[] + id?: Prisma.IntFilter<"Order"> | number + orderNumber?: Prisma.StringFilter<"Order"> | string + status?: Prisma.EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodFilter<"Order"> | $Enums.paymentMethod + totalAmount?: Prisma.DecimalFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"Order"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Order"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"Order"> | Date | string | null + customerId?: Prisma.IntFilter<"Order"> | number +} + +export type OrderCreateManyCustomerInput = { + id?: number + orderNumber: string + status?: $Enums.OrderStatus + paymentMethod?: $Enums.paymentMethod + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null +} + +export type OrderUpdateWithoutCustomerInput = { + orderNumber?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodFieldUpdateOperationsInput | $Enums.paymentMethod + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + +export type OrderUncheckedUpdateWithoutCustomerInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + orderNumber?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodFieldUpdateOperationsInput | $Enums.paymentMethod + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + +export type OrderUncheckedUpdateManyWithoutCustomerInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + orderNumber?: Prisma.StringFieldUpdateOperationsInput | string + status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus + paymentMethod?: Prisma.EnumpaymentMethodFieldUpdateOperationsInput | $Enums.paymentMethod + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + + + +export type OrderSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + orderNumber?: boolean + status?: boolean + paymentMethod?: boolean + totalAmount?: boolean + createdAt?: boolean + updatedAt?: boolean + deletedAt?: boolean + customerId?: boolean + customer?: boolean | Prisma.CustomerDefaultArgs +}, ExtArgs["result"]["order"]> + + + +export type OrderSelectScalar = { + id?: boolean + orderNumber?: boolean + status?: boolean + paymentMethod?: boolean + totalAmount?: boolean + createdAt?: boolean + updatedAt?: boolean + deletedAt?: boolean + customerId?: boolean +} + +export type OrderOmit = runtime.Types.Extensions.GetOmit<"id" | "orderNumber" | "status" | "paymentMethod" | "totalAmount" | "createdAt" | "updatedAt" | "deletedAt" | "customerId", ExtArgs["result"]["order"]> +export type OrderInclude = { + customer?: boolean | Prisma.CustomerDefaultArgs +} + +export type $OrderPayload = { + name: "Order" + objects: { + customer: Prisma.$CustomerPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + orderNumber: string + status: $Enums.OrderStatus + paymentMethod: $Enums.paymentMethod + totalAmount: runtime.Decimal + createdAt: Date + updatedAt: Date + deletedAt: Date | null + customerId: number + }, ExtArgs["result"]["order"]> + composites: {} +} + +export type OrderGetPayload = runtime.Types.Result.GetResult + +export type OrderCountArgs = + Omit & { + select?: OrderCountAggregateInputType | true + } + +export interface OrderDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Order'], meta: { name: 'Order' } } + /** + * Find zero or one Order that matches the filter. + * @param {OrderFindUniqueArgs} args - Arguments to find a Order + * @example + * // Get one Order + * const order = await prisma.order.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__OrderClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Order that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {OrderFindUniqueOrThrowArgs} args - Arguments to find a Order + * @example + * // Get one Order + * const order = await prisma.order.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__OrderClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Order that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OrderFindFirstArgs} args - Arguments to find a Order + * @example + * // Get one Order + * const order = await prisma.order.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__OrderClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Order that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OrderFindFirstOrThrowArgs} args - Arguments to find a Order + * @example + * // Get one Order + * const order = await prisma.order.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__OrderClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Orders that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OrderFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Orders + * const orders = await prisma.order.findMany() + * + * // Get first 10 Orders + * const orders = await prisma.order.findMany({ take: 10 }) + * + * // Only select the `id` + * const orderWithIdOnly = await prisma.order.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Order. + * @param {OrderCreateArgs} args - Arguments to create a Order. + * @example + * // Create one Order + * const Order = await prisma.order.create({ + * data: { + * // ... data to create a Order + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__OrderClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Orders. + * @param {OrderCreateManyArgs} args - Arguments to create many Orders. + * @example + * // Create many Orders + * const order = await prisma.order.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a Order. + * @param {OrderDeleteArgs} args - Arguments to delete one Order. + * @example + * // Delete one Order + * const Order = await prisma.order.delete({ + * where: { + * // ... filter to delete one Order + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__OrderClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Order. + * @param {OrderUpdateArgs} args - Arguments to update one Order. + * @example + * // Update one Order + * const order = await prisma.order.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__OrderClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Orders. + * @param {OrderDeleteManyArgs} args - Arguments to filter Orders to delete. + * @example + * // Delete a few Orders + * const { count } = await prisma.order.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Orders. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OrderUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Orders + * const order = await prisma.order.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one Order. + * @param {OrderUpsertArgs} args - Arguments to update or create a Order. + * @example + * // Update or create a Order + * const order = await prisma.order.upsert({ + * create: { + * // ... data to create a Order + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Order we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__OrderClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Orders. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OrderCountArgs} args - Arguments to filter Orders to count. + * @example + * // Count the number of Orders + * const count = await prisma.order.count({ + * where: { + * // ... the filter for the Orders we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Order. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OrderAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Order. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OrderGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends OrderGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: OrderGroupByArgs['orderBy'] } + : { orderBy?: OrderGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetOrderGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Order model + */ +readonly fields: OrderFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Order. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__OrderClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + customer = {}>(args?: Prisma.Subset>): Prisma.Prisma__CustomerClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Order model + */ +export interface OrderFieldRefs { + readonly id: Prisma.FieldRef<"Order", 'Int'> + readonly orderNumber: Prisma.FieldRef<"Order", 'String'> + readonly status: Prisma.FieldRef<"Order", 'OrderStatus'> + readonly paymentMethod: Prisma.FieldRef<"Order", 'paymentMethod'> + readonly totalAmount: Prisma.FieldRef<"Order", 'Decimal'> + readonly createdAt: Prisma.FieldRef<"Order", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"Order", 'DateTime'> + readonly deletedAt: Prisma.FieldRef<"Order", 'DateTime'> + readonly customerId: Prisma.FieldRef<"Order", 'Int'> +} + + +// Custom InputTypes +/** + * Order findUnique + */ +export type OrderFindUniqueArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null + /** + * Filter, which Order to fetch. + */ + where: Prisma.OrderWhereUniqueInput +} + +/** + * Order findUniqueOrThrow + */ +export type OrderFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null + /** + * Filter, which Order to fetch. + */ + where: Prisma.OrderWhereUniqueInput +} + +/** + * Order findFirst + */ +export type OrderFindFirstArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null + /** + * Filter, which Order to fetch. + */ + where?: Prisma.OrderWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Orders to fetch. + */ + orderBy?: Prisma.OrderOrderByWithRelationInput | Prisma.OrderOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Orders. + */ + cursor?: Prisma.OrderWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Orders from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Orders. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Orders. + */ + distinct?: Prisma.OrderScalarFieldEnum | Prisma.OrderScalarFieldEnum[] +} + +/** + * Order findFirstOrThrow + */ +export type OrderFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null + /** + * Filter, which Order to fetch. + */ + where?: Prisma.OrderWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Orders to fetch. + */ + orderBy?: Prisma.OrderOrderByWithRelationInput | Prisma.OrderOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Orders. + */ + cursor?: Prisma.OrderWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Orders from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Orders. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Orders. + */ + distinct?: Prisma.OrderScalarFieldEnum | Prisma.OrderScalarFieldEnum[] +} + +/** + * Order findMany + */ +export type OrderFindManyArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null + /** + * Filter, which Orders to fetch. + */ + where?: Prisma.OrderWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Orders to fetch. + */ + orderBy?: Prisma.OrderOrderByWithRelationInput | Prisma.OrderOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Orders. + */ + cursor?: Prisma.OrderWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Orders from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Orders. + */ + skip?: number + distinct?: Prisma.OrderScalarFieldEnum | Prisma.OrderScalarFieldEnum[] +} + +/** + * Order create + */ +export type OrderCreateArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null + /** + * The data needed to create a Order. + */ + data: Prisma.XOR +} + +/** + * Order createMany + */ +export type OrderCreateManyArgs = { + /** + * The data used to create many Orders. + */ + data: Prisma.OrderCreateManyInput | Prisma.OrderCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Order update + */ +export type OrderUpdateArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null + /** + * The data needed to update a Order. + */ + data: Prisma.XOR + /** + * Choose, which Order to update. + */ + where: Prisma.OrderWhereUniqueInput +} + +/** + * Order updateMany + */ +export type OrderUpdateManyArgs = { + /** + * The data used to update Orders. + */ + data: Prisma.XOR + /** + * Filter which Orders to update + */ + where?: Prisma.OrderWhereInput + /** + * Limit how many Orders to update. + */ + limit?: number +} + +/** + * Order upsert + */ +export type OrderUpsertArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null + /** + * The filter to search for the Order to update in case it exists. + */ + where: Prisma.OrderWhereUniqueInput + /** + * In case the Order found by the `where` argument doesn't exist, create a new Order with this data. + */ + create: Prisma.XOR + /** + * In case the Order was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Order delete + */ +export type OrderDeleteArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null + /** + * Filter which Order to delete. + */ + where: Prisma.OrderWhereUniqueInput +} + +/** + * Order deleteMany + */ +export type OrderDeleteManyArgs = { + /** + * Filter which Orders to delete + */ + where?: Prisma.OrderWhereInput + /** + * Limit how many Orders to delete. + */ + limit?: number +} + +/** + * Order without action + */ +export type OrderDefaultArgs = { + /** + * Select specific fields to fetch from the Order + */ + select?: Prisma.OrderSelect | null + /** + * Omit specific fields from the Order + */ + omit?: Prisma.OrderOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.OrderInclude | null +} diff --git a/src/generated/prisma/models/Product.ts b/src/generated/prisma/models/Product.ts index e35c4a3..e7d29ec 100644 --- a/src/generated/prisma/models/Product.ts +++ b/src/generated/prisma/models/Product.ts @@ -41,9 +41,9 @@ export type ProductSumAggregateOutputType = { export type ProductMinAggregateOutputType = { id: number | null name: string | null - barcode: string | null - sku: string | null description: string | null + sku: string | null + barcode: string | null createdAt: Date | null updatedAt: Date | null deletedAt: Date | null @@ -54,9 +54,9 @@ export type ProductMinAggregateOutputType = { export type ProductMaxAggregateOutputType = { id: number | null name: string | null - barcode: string | null - sku: string | null description: string | null + sku: string | null + barcode: string | null createdAt: Date | null updatedAt: Date | null deletedAt: Date | null @@ -67,9 +67,9 @@ export type ProductMaxAggregateOutputType = { export type ProductCountAggregateOutputType = { id: number name: number - barcode: number - sku: number description: number + sku: number + barcode: number createdAt: number updatedAt: number deletedAt: number @@ -94,9 +94,9 @@ export type ProductSumAggregateInputType = { export type ProductMinAggregateInputType = { id?: true name?: true - barcode?: true - sku?: true description?: true + sku?: true + barcode?: true createdAt?: true updatedAt?: true deletedAt?: true @@ -107,9 +107,9 @@ export type ProductMinAggregateInputType = { export type ProductMaxAggregateInputType = { id?: true name?: true - barcode?: true - sku?: true description?: true + sku?: true + barcode?: true createdAt?: true updatedAt?: true deletedAt?: true @@ -120,9 +120,9 @@ export type ProductMaxAggregateInputType = { export type ProductCountAggregateInputType = { id?: true name?: true - barcode?: true - sku?: true description?: true + sku?: true + barcode?: true createdAt?: true updatedAt?: true deletedAt?: true @@ -220,9 +220,9 @@ export type ProductGroupByArgs | number name?: Prisma.StringFilter<"Product"> | string - barcode?: Prisma.StringNullableFilter<"Product"> | string | null - sku?: Prisma.StringNullableFilter<"Product"> | string | null description?: Prisma.StringNullableFilter<"Product"> | string | null + sku?: Prisma.StringNullableFilter<"Product"> | string | null + barcode?: Prisma.StringNullableFilter<"Product"> | string | null createdAt?: Prisma.DateTimeFilter<"Product"> | Date | string updatedAt?: Prisma.DateTimeFilter<"Product"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"Product"> | Date | string | null brandId?: Prisma.IntNullableFilter<"Product"> | number | null categoryId?: Prisma.IntNullableFilter<"Product"> | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemListRelationFilter + productCharges?: Prisma.ProductChargeListRelationFilter variants?: Prisma.ProductVariantListRelationFilter brand?: Prisma.XOR | null category?: Prisma.XOR | null + purchaseReceiptItems?: Prisma.PurchaseReceiptItemListRelationFilter + salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter + stockAdjustments?: Prisma.StockAdjustmentListRelationFilter + stockMovements?: Prisma.StockMovementListRelationFilter } export type ProductOrderByWithRelationInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder - barcode?: Prisma.SortOrderInput | Prisma.SortOrder - sku?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder + sku?: Prisma.SortOrderInput | Prisma.SortOrder + barcode?: Prisma.SortOrderInput | Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder brandId?: Prisma.SortOrderInput | Prisma.SortOrder categoryId?: Prisma.SortOrderInput | Prisma.SortOrder + inventoryTransferItems?: Prisma.InventoryTransferItemOrderByRelationAggregateInput + productCharges?: Prisma.ProductChargeOrderByRelationAggregateInput variants?: Prisma.ProductVariantOrderByRelationAggregateInput brand?: Prisma.ProductBrandOrderByWithRelationInput category?: Prisma.ProductCategoryOrderByWithRelationInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemOrderByRelationAggregateInput + salesInvoiceItems?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput + stockAdjustments?: Prisma.StockAdjustmentOrderByRelationAggregateInput + stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput _relevance?: Prisma.ProductOrderByRelevanceInput } export type ProductWhereUniqueInput = Prisma.AtLeast<{ id?: number - barcode?: string sku?: string + barcode?: string AND?: Prisma.ProductWhereInput | Prisma.ProductWhereInput[] OR?: Prisma.ProductWhereInput[] NOT?: Prisma.ProductWhereInput | Prisma.ProductWhereInput[] @@ -300,17 +312,23 @@ export type ProductWhereUniqueInput = Prisma.AtLeast<{ deletedAt?: Prisma.DateTimeNullableFilter<"Product"> | Date | string | null brandId?: Prisma.IntNullableFilter<"Product"> | number | null categoryId?: Prisma.IntNullableFilter<"Product"> | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemListRelationFilter + productCharges?: Prisma.ProductChargeListRelationFilter variants?: Prisma.ProductVariantListRelationFilter brand?: Prisma.XOR | null category?: Prisma.XOR | null -}, "id" | "barcode" | "sku"> + purchaseReceiptItems?: Prisma.PurchaseReceiptItemListRelationFilter + salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter + stockAdjustments?: Prisma.StockAdjustmentListRelationFilter + stockMovements?: Prisma.StockMovementListRelationFilter +}, "id" | "sku" | "barcode"> export type ProductOrderByWithAggregationInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder - barcode?: Prisma.SortOrderInput | Prisma.SortOrder - sku?: Prisma.SortOrderInput | Prisma.SortOrder description?: Prisma.SortOrderInput | Prisma.SortOrder + sku?: Prisma.SortOrderInput | Prisma.SortOrder + barcode?: Prisma.SortOrderInput | Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder @@ -329,9 +347,9 @@ export type ProductScalarWhereWithAggregatesInput = { NOT?: Prisma.ProductScalarWhereWithAggregatesInput | Prisma.ProductScalarWhereWithAggregatesInput[] id?: Prisma.IntWithAggregatesFilter<"Product"> | number name?: Prisma.StringWithAggregatesFilter<"Product"> | string - barcode?: Prisma.StringNullableWithAggregatesFilter<"Product"> | string | null - sku?: Prisma.StringNullableWithAggregatesFilter<"Product"> | string | null description?: Prisma.StringNullableWithAggregatesFilter<"Product"> | string | null + sku?: Prisma.StringNullableWithAggregatesFilter<"Product"> | string | null + barcode?: Prisma.StringNullableWithAggregatesFilter<"Product"> | string | null createdAt?: Prisma.DateTimeWithAggregatesFilter<"Product"> | Date | string updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Product"> | Date | string deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Product"> | Date | string | null @@ -341,64 +359,88 @@ export type ProductScalarWhereWithAggregatesInput = { export type ProductCreateInput = { name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutProductInput variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput } export type ProductUncheckedCreateInput = { id?: number name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null brandId?: number | null categoryId?: number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutProductInput variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput } export type ProductUpdateInput = { name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutProductNestedInput variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateInput = { id?: Prisma.IntFieldUpdateOperationsInput | number name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutProductNestedInput variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput } export type ProductCreateManyInput = { id?: number name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null @@ -408,9 +450,9 @@ export type ProductCreateManyInput = { export type ProductUpdateManyMutationInput = { name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null @@ -419,9 +461,9 @@ export type ProductUpdateManyMutationInput = { export type ProductUncheckedUpdateManyInput = { id?: Prisma.IntFieldUpdateOperationsInput | number name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null @@ -443,9 +485,9 @@ export type ProductOrderByRelevanceInput = { export type ProductCountOrderByAggregateInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder - barcode?: Prisma.SortOrder - sku?: Prisma.SortOrder description?: Prisma.SortOrder + sku?: Prisma.SortOrder + barcode?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrder @@ -462,9 +504,9 @@ export type ProductAvgOrderByAggregateInput = { export type ProductMaxOrderByAggregateInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder - barcode?: Prisma.SortOrder - sku?: Prisma.SortOrder description?: Prisma.SortOrder + sku?: Prisma.SortOrder + barcode?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrder @@ -475,9 +517,9 @@ export type ProductMaxOrderByAggregateInput = { export type ProductMinOrderByAggregateInput = { id?: Prisma.SortOrder name?: Prisma.SortOrder - barcode?: Prisma.SortOrder - sku?: Prisma.SortOrder description?: Prisma.SortOrder + sku?: Prisma.SortOrder + barcode?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrder @@ -607,29 +649,125 @@ export type ProductUncheckedUpdateManyWithoutCategoryNestedInput = { deleteMany?: Prisma.ProductScalarWhereInput | Prisma.ProductScalarWhereInput[] } +export type ProductCreateNestedOneWithoutProductChargesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutProductChargesInput + connect?: Prisma.ProductWhereUniqueInput +} + +export type ProductUpdateOneRequiredWithoutProductChargesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutProductChargesInput + upsert?: Prisma.ProductUpsertWithoutProductChargesInput + connect?: Prisma.ProductWhereUniqueInput + update?: Prisma.XOR, Prisma.ProductUncheckedUpdateWithoutProductChargesInput> +} + +export type ProductCreateNestedOneWithoutPurchaseReceiptItemsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutPurchaseReceiptItemsInput + connect?: Prisma.ProductWhereUniqueInput +} + +export type ProductUpdateOneRequiredWithoutPurchaseReceiptItemsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutPurchaseReceiptItemsInput + upsert?: Prisma.ProductUpsertWithoutPurchaseReceiptItemsInput + connect?: Prisma.ProductWhereUniqueInput + update?: Prisma.XOR, Prisma.ProductUncheckedUpdateWithoutPurchaseReceiptItemsInput> +} + +export type ProductCreateNestedOneWithoutSalesInvoiceItemsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutSalesInvoiceItemsInput + connect?: Prisma.ProductWhereUniqueInput +} + +export type ProductUpdateOneRequiredWithoutSalesInvoiceItemsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutSalesInvoiceItemsInput + upsert?: Prisma.ProductUpsertWithoutSalesInvoiceItemsInput + connect?: Prisma.ProductWhereUniqueInput + update?: Prisma.XOR, Prisma.ProductUncheckedUpdateWithoutSalesInvoiceItemsInput> +} + +export type ProductCreateNestedOneWithoutStockMovementsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutStockMovementsInput + connect?: Prisma.ProductWhereUniqueInput +} + +export type ProductUpdateOneRequiredWithoutStockMovementsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutStockMovementsInput + upsert?: Prisma.ProductUpsertWithoutStockMovementsInput + connect?: Prisma.ProductWhereUniqueInput + update?: Prisma.XOR, Prisma.ProductUncheckedUpdateWithoutStockMovementsInput> +} + +export type ProductCreateNestedOneWithoutInventoryTransferItemsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutInventoryTransferItemsInput + connect?: Prisma.ProductWhereUniqueInput +} + +export type ProductUpdateOneRequiredWithoutInventoryTransferItemsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutInventoryTransferItemsInput + upsert?: Prisma.ProductUpsertWithoutInventoryTransferItemsInput + connect?: Prisma.ProductWhereUniqueInput + update?: Prisma.XOR, Prisma.ProductUncheckedUpdateWithoutInventoryTransferItemsInput> +} + +export type ProductCreateNestedOneWithoutStockAdjustmentsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutStockAdjustmentsInput + connect?: Prisma.ProductWhereUniqueInput +} + +export type ProductUpdateOneRequiredWithoutStockAdjustmentsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.ProductCreateOrConnectWithoutStockAdjustmentsInput + upsert?: Prisma.ProductUpsertWithoutStockAdjustmentsInput + connect?: Prisma.ProductWhereUniqueInput + update?: Prisma.XOR, Prisma.ProductUncheckedUpdateWithoutStockAdjustmentsInput> +} + export type ProductCreateWithoutVariantsInput = { name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutProductInput brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput } export type ProductUncheckedCreateWithoutVariantsInput = { id?: number name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null brandId?: number | null categoryId?: number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutProductInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput } export type ProductCreateOrConnectWithoutVariantsInput = { @@ -650,52 +788,76 @@ export type ProductUpdateToOneWithWhereWithoutVariantsInput = { export type ProductUpdateWithoutVariantsInput = { name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutProductNestedInput brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateWithoutVariantsInput = { id?: Prisma.IntFieldUpdateOperationsInput | number name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutProductNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput } export type ProductCreateWithoutBrandInput = { name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutProductInput variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput } export type ProductUncheckedCreateWithoutBrandInput = { id?: number name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null categoryId?: number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutProductInput variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput } export type ProductCreateOrConnectWithoutBrandInput = { @@ -730,9 +892,9 @@ export type ProductScalarWhereInput = { NOT?: Prisma.ProductScalarWhereInput | Prisma.ProductScalarWhereInput[] id?: Prisma.IntFilter<"Product"> | number name?: Prisma.StringFilter<"Product"> | string - barcode?: Prisma.StringNullableFilter<"Product"> | string | null - sku?: Prisma.StringNullableFilter<"Product"> | string | null description?: Prisma.StringNullableFilter<"Product"> | string | null + sku?: Prisma.StringNullableFilter<"Product"> | string | null + barcode?: Prisma.StringNullableFilter<"Product"> | string | null createdAt?: Prisma.DateTimeFilter<"Product"> | Date | string updatedAt?: Prisma.DateTimeFilter<"Product"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"Product"> | Date | string | null @@ -742,27 +904,39 @@ export type ProductScalarWhereInput = { export type ProductCreateWithoutCategoryInput = { name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutProductInput variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput } export type ProductUncheckedCreateWithoutCategoryInput = { id?: number name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null brandId?: number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutProductInput variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput } export type ProductCreateOrConnectWithoutCategoryInput = { @@ -791,12 +965,552 @@ export type ProductUpdateManyWithWhereWithoutCategoryInput = { data: Prisma.XOR } +export type ProductCreateWithoutProductChargesInput = { + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput + brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput + category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput +} + +export type ProductUncheckedCreateWithoutProductChargesInput = { + id?: number + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + brandId?: number | null + categoryId?: number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput +} + +export type ProductCreateOrConnectWithoutProductChargesInput = { + where: Prisma.ProductWhereUniqueInput + create: Prisma.XOR +} + +export type ProductUpsertWithoutProductChargesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ProductWhereInput +} + +export type ProductUpdateToOneWithWhereWithoutProductChargesInput = { + where?: Prisma.ProductWhereInput + data: Prisma.XOR +} + +export type ProductUpdateWithoutProductChargesInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput + brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput + category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput +} + +export type ProductUncheckedUpdateWithoutProductChargesInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput +} + +export type ProductCreateWithoutPurchaseReceiptItemsInput = { + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput + brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput + category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput + salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput +} + +export type ProductUncheckedCreateWithoutPurchaseReceiptItemsInput = { + id?: number + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + brandId?: number | null + categoryId?: number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput +} + +export type ProductCreateOrConnectWithoutPurchaseReceiptItemsInput = { + where: Prisma.ProductWhereUniqueInput + create: Prisma.XOR +} + +export type ProductUpsertWithoutPurchaseReceiptItemsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ProductWhereInput +} + +export type ProductUpdateToOneWithWhereWithoutPurchaseReceiptItemsInput = { + where?: Prisma.ProductWhereInput + data: Prisma.XOR +} + +export type ProductUpdateWithoutPurchaseReceiptItemsInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput + brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput + category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput +} + +export type ProductUncheckedUpdateWithoutPurchaseReceiptItemsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput +} + +export type ProductCreateWithoutSalesInvoiceItemsInput = { + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput + brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput + category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput +} + +export type ProductUncheckedCreateWithoutSalesInvoiceItemsInput = { + id?: number + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + brandId?: number | null + categoryId?: number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput +} + +export type ProductCreateOrConnectWithoutSalesInvoiceItemsInput = { + where: Prisma.ProductWhereUniqueInput + create: Prisma.XOR +} + +export type ProductUpsertWithoutSalesInvoiceItemsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ProductWhereInput +} + +export type ProductUpdateToOneWithWhereWithoutSalesInvoiceItemsInput = { + where?: Prisma.ProductWhereInput + data: Prisma.XOR +} + +export type ProductUpdateWithoutSalesInvoiceItemsInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput + brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput + category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput +} + +export type ProductUncheckedUpdateWithoutSalesInvoiceItemsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput +} + +export type ProductCreateWithoutStockMovementsInput = { + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput + brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput + category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput +} + +export type ProductUncheckedCreateWithoutStockMovementsInput = { + id?: number + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + brandId?: number | null + categoryId?: number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput +} + +export type ProductCreateOrConnectWithoutStockMovementsInput = { + where: Prisma.ProductWhereUniqueInput + create: Prisma.XOR +} + +export type ProductUpsertWithoutStockMovementsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ProductWhereInput +} + +export type ProductUpdateToOneWithWhereWithoutStockMovementsInput = { + where?: Prisma.ProductWhereInput + data: Prisma.XOR +} + +export type ProductUpdateWithoutStockMovementsInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput + brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput + category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput +} + +export type ProductUncheckedUpdateWithoutStockMovementsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput +} + +export type ProductCreateWithoutInventoryTransferItemsInput = { + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput + brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput + category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput +} + +export type ProductUncheckedCreateWithoutInventoryTransferItemsInput = { + id?: number + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + brandId?: number | null + categoryId?: number | null + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput +} + +export type ProductCreateOrConnectWithoutInventoryTransferItemsInput = { + where: Prisma.ProductWhereUniqueInput + create: Prisma.XOR +} + +export type ProductUpsertWithoutInventoryTransferItemsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ProductWhereInput +} + +export type ProductUpdateToOneWithWhereWithoutInventoryTransferItemsInput = { + where?: Prisma.ProductWhereInput + data: Prisma.XOR +} + +export type ProductUpdateWithoutInventoryTransferItemsInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productCharges?: Prisma.ProductChargeUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput + brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput + category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput +} + +export type ProductUncheckedUpdateWithoutInventoryTransferItemsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput +} + +export type ProductCreateWithoutStockAdjustmentsInput = { + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput + brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput + category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput +} + +export type ProductUncheckedCreateWithoutStockAdjustmentsInput = { + id?: number + name: string + description?: string | null + sku?: string | null + barcode?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + brandId?: number | null + categoryId?: number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutProductInput + variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput + stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput +} + +export type ProductCreateOrConnectWithoutStockAdjustmentsInput = { + where: Prisma.ProductWhereUniqueInput + create: Prisma.XOR +} + +export type ProductUpsertWithoutStockAdjustmentsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.ProductWhereInput +} + +export type ProductUpdateToOneWithWhereWithoutStockAdjustmentsInput = { + where?: Prisma.ProductWhereInput + data: Prisma.XOR +} + +export type ProductUpdateWithoutStockAdjustmentsInput = { + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput + brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput + category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput +} + +export type ProductUncheckedUpdateWithoutStockAdjustmentsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + name?: Prisma.StringFieldUpdateOperationsInput | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutProductNestedInput + variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput +} + export type ProductCreateManyBrandInput = { id?: number name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null @@ -805,35 +1519,47 @@ export type ProductCreateManyBrandInput = { export type ProductUpdateWithoutBrandInput = { name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutProductNestedInput variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateWithoutBrandInput = { id?: Prisma.IntFieldUpdateOperationsInput | number name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutProductNestedInput variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateManyWithoutBrandInput = { id?: Prisma.IntFieldUpdateOperationsInput | number name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null @@ -843,9 +1569,9 @@ export type ProductUncheckedUpdateManyWithoutBrandInput = { export type ProductCreateManyCategoryInput = { id?: number name: string - barcode?: string | null - sku?: string | null description?: string | null + sku?: string | null + barcode?: string | null createdAt?: Date | string updatedAt?: Date | string deletedAt?: Date | string | null @@ -854,35 +1580,47 @@ export type ProductCreateManyCategoryInput = { export type ProductUpdateWithoutCategoryInput = { name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUpdateManyWithoutProductNestedInput variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateWithoutCategoryInput = { id?: Prisma.IntFieldUpdateOperationsInput | number name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutProductNestedInput variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput + purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput + salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput + stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput + stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput } export type ProductUncheckedUpdateManyWithoutCategoryInput = { id?: Prisma.IntFieldUpdateOperationsInput | number name?: Prisma.StringFieldUpdateOperationsInput | string - barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null - sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null @@ -895,11 +1633,23 @@ export type ProductUncheckedUpdateManyWithoutCategoryInput = { */ export type ProductCountOutputType = { + inventoryTransferItems: number + productCharges: number variants: number + purchaseReceiptItems: number + salesInvoiceItems: number + stockAdjustments: number + stockMovements: number } export type ProductCountOutputTypeSelect = { + inventoryTransferItems?: boolean | ProductCountOutputTypeCountInventoryTransferItemsArgs + productCharges?: boolean | ProductCountOutputTypeCountProductChargesArgs variants?: boolean | ProductCountOutputTypeCountVariantsArgs + purchaseReceiptItems?: boolean | ProductCountOutputTypeCountPurchaseReceiptItemsArgs + salesInvoiceItems?: boolean | ProductCountOutputTypeCountSalesInvoiceItemsArgs + stockAdjustments?: boolean | ProductCountOutputTypeCountStockAdjustmentsArgs + stockMovements?: boolean | ProductCountOutputTypeCountStockMovementsArgs } /** @@ -912,6 +1662,20 @@ export type ProductCountOutputTypeDefaultArgs | null } +/** + * ProductCountOutputType without action + */ +export type ProductCountOutputTypeCountInventoryTransferItemsArgs = { + where?: Prisma.InventoryTransferItemWhereInput +} + +/** + * ProductCountOutputType without action + */ +export type ProductCountOutputTypeCountProductChargesArgs = { + where?: Prisma.ProductChargeWhereInput +} + /** * ProductCountOutputType without action */ @@ -919,21 +1683,55 @@ export type ProductCountOutputTypeCountVariantsArgs = { + where?: Prisma.PurchaseReceiptItemWhereInput +} + +/** + * ProductCountOutputType without action + */ +export type ProductCountOutputTypeCountSalesInvoiceItemsArgs = { + where?: Prisma.SalesInvoiceItemWhereInput +} + +/** + * ProductCountOutputType without action + */ +export type ProductCountOutputTypeCountStockAdjustmentsArgs = { + where?: Prisma.StockAdjustmentWhereInput +} + +/** + * ProductCountOutputType without action + */ +export type ProductCountOutputTypeCountStockMovementsArgs = { + where?: Prisma.StockMovementWhereInput +} + export type ProductSelect = runtime.Types.Extensions.GetSelect<{ id?: boolean name?: boolean - barcode?: boolean - sku?: boolean description?: boolean + sku?: boolean + barcode?: boolean createdAt?: boolean updatedAt?: boolean deletedAt?: boolean brandId?: boolean categoryId?: boolean + inventoryTransferItems?: boolean | Prisma.Product$inventoryTransferItemsArgs + productCharges?: boolean | Prisma.Product$productChargesArgs variants?: boolean | Prisma.Product$variantsArgs brand?: boolean | Prisma.Product$brandArgs category?: boolean | Prisma.Product$categoryArgs + purchaseReceiptItems?: boolean | Prisma.Product$purchaseReceiptItemsArgs + salesInvoiceItems?: boolean | Prisma.Product$salesInvoiceItemsArgs + stockAdjustments?: boolean | Prisma.Product$stockAdjustmentsArgs + stockMovements?: boolean | Prisma.Product$stockMovementsArgs _count?: boolean | Prisma.ProductCountOutputTypeDefaultArgs }, ExtArgs["result"]["product"]> @@ -942,9 +1740,9 @@ export type ProductSelect = runtime.Types.Extensions.GetOmit<"id" | "name" | "barcode" | "sku" | "description" | "createdAt" | "updatedAt" | "deletedAt" | "brandId" | "categoryId", ExtArgs["result"]["product"]> +export type ProductOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "description" | "sku" | "barcode" | "createdAt" | "updatedAt" | "deletedAt" | "brandId" | "categoryId", ExtArgs["result"]["product"]> export type ProductInclude = { + inventoryTransferItems?: boolean | Prisma.Product$inventoryTransferItemsArgs + productCharges?: boolean | Prisma.Product$productChargesArgs variants?: boolean | Prisma.Product$variantsArgs brand?: boolean | Prisma.Product$brandArgs category?: boolean | Prisma.Product$categoryArgs + purchaseReceiptItems?: boolean | Prisma.Product$purchaseReceiptItemsArgs + salesInvoiceItems?: boolean | Prisma.Product$salesInvoiceItemsArgs + stockAdjustments?: boolean | Prisma.Product$stockAdjustmentsArgs + stockMovements?: boolean | Prisma.Product$stockMovementsArgs _count?: boolean | Prisma.ProductCountOutputTypeDefaultArgs } export type $ProductPayload = { name: "Product" objects: { + inventoryTransferItems: Prisma.$InventoryTransferItemPayload[] + productCharges: Prisma.$ProductChargePayload[] variants: Prisma.$ProductVariantPayload[] brand: Prisma.$ProductBrandPayload | null category: Prisma.$ProductCategoryPayload | null + purchaseReceiptItems: Prisma.$PurchaseReceiptItemPayload[] + salesInvoiceItems: Prisma.$SalesInvoiceItemPayload[] + stockAdjustments: Prisma.$StockAdjustmentPayload[] + stockMovements: Prisma.$StockMovementPayload[] } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: number name: string - barcode: string | null - sku: string | null description: string | null + sku: string | null + barcode: string | null createdAt: Date updatedAt: Date deletedAt: Date | null @@ -1318,9 +2128,15 @@ readonly fields: ProductFieldRefs; */ export interface Prisma__ProductClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" + inventoryTransferItems = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + productCharges = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> variants = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> brand = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProductBrandClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> category = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProductCategoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + purchaseReceiptItems = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + salesInvoiceItems = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + stockAdjustments = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + stockMovements = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -1352,9 +2168,9 @@ export interface Prisma__ProductClient readonly name: Prisma.FieldRef<"Product", 'String'> - readonly barcode: Prisma.FieldRef<"Product", 'String'> - readonly sku: Prisma.FieldRef<"Product", 'String'> readonly description: Prisma.FieldRef<"Product", 'String'> + readonly sku: Prisma.FieldRef<"Product", 'String'> + readonly barcode: Prisma.FieldRef<"Product", 'String'> readonly createdAt: Prisma.FieldRef<"Product", 'DateTime'> readonly updatedAt: Prisma.FieldRef<"Product", 'DateTime'> readonly deletedAt: Prisma.FieldRef<"Product", 'DateTime'> @@ -1702,6 +2518,54 @@ export type ProductDeleteManyArgs = { + /** + * Select specific fields to fetch from the InventoryTransferItem + */ + select?: Prisma.InventoryTransferItemSelect | null + /** + * Omit specific fields from the InventoryTransferItem + */ + omit?: Prisma.InventoryTransferItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.InventoryTransferItemInclude | null + where?: Prisma.InventoryTransferItemWhereInput + orderBy?: Prisma.InventoryTransferItemOrderByWithRelationInput | Prisma.InventoryTransferItemOrderByWithRelationInput[] + cursor?: Prisma.InventoryTransferItemWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.InventoryTransferItemScalarFieldEnum | Prisma.InventoryTransferItemScalarFieldEnum[] +} + +/** + * Product.productCharges + */ +export type Product$productChargesArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + where?: Prisma.ProductChargeWhereInput + orderBy?: Prisma.ProductChargeOrderByWithRelationInput | Prisma.ProductChargeOrderByWithRelationInput[] + cursor?: Prisma.ProductChargeWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.ProductChargeScalarFieldEnum | Prisma.ProductChargeScalarFieldEnum[] +} + /** * Product.variants */ @@ -1764,6 +2628,102 @@ export type Product$categoryArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + where?: Prisma.PurchaseReceiptItemWhereInput + orderBy?: Prisma.PurchaseReceiptItemOrderByWithRelationInput | Prisma.PurchaseReceiptItemOrderByWithRelationInput[] + cursor?: Prisma.PurchaseReceiptItemWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PurchaseReceiptItemScalarFieldEnum | Prisma.PurchaseReceiptItemScalarFieldEnum[] +} + +/** + * Product.salesInvoiceItems + */ +export type Product$salesInvoiceItemsArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + where?: Prisma.SalesInvoiceItemWhereInput + orderBy?: Prisma.SalesInvoiceItemOrderByWithRelationInput | Prisma.SalesInvoiceItemOrderByWithRelationInput[] + cursor?: Prisma.SalesInvoiceItemWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.SalesInvoiceItemScalarFieldEnum | Prisma.SalesInvoiceItemScalarFieldEnum[] +} + +/** + * Product.stockAdjustments + */ +export type Product$stockAdjustmentsArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + where?: Prisma.StockAdjustmentWhereInput + orderBy?: Prisma.StockAdjustmentOrderByWithRelationInput | Prisma.StockAdjustmentOrderByWithRelationInput[] + cursor?: Prisma.StockAdjustmentWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.StockAdjustmentScalarFieldEnum | Prisma.StockAdjustmentScalarFieldEnum[] +} + +/** + * Product.stockMovements + */ +export type Product$stockMovementsArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + where?: Prisma.StockMovementWhereInput + orderBy?: Prisma.StockMovementOrderByWithRelationInput | Prisma.StockMovementOrderByWithRelationInput[] + cursor?: Prisma.StockMovementWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[] +} + /** * Product without action */ diff --git a/src/generated/prisma/models/ProductCharge.ts b/src/generated/prisma/models/ProductCharge.ts new file mode 100644 index 0000000..b8b2d53 --- /dev/null +++ b/src/generated/prisma/models/ProductCharge.ts @@ -0,0 +1,1881 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `ProductCharge` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model ProductCharge + * + */ +export type ProductChargeModel = runtime.Types.Result.DefaultSelection + +export type AggregateProductCharge = { + _count: ProductChargeCountAggregateOutputType | null + _avg: ProductChargeAvgAggregateOutputType | null + _sum: ProductChargeSumAggregateOutputType | null + _min: ProductChargeMinAggregateOutputType | null + _max: ProductChargeMaxAggregateOutputType | null +} + +export type ProductChargeAvgAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + totalAmount: runtime.Decimal | null + productId: number | null + inventoryId: number | null + supplierId: number | null +} + +export type ProductChargeSumAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + totalAmount: runtime.Decimal | null + productId: number | null + inventoryId: number | null + supplierId: number | null +} + +export type ProductChargeMinAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + totalAmount: runtime.Decimal | null + isSettled: boolean | null + buyAt: Date | null + description: string | null + createdAt: Date | null + updatedAt: Date | null + deletedAt: Date | null + productId: number | null + inventoryId: number | null + supplierId: number | null +} + +export type ProductChargeMaxAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + totalAmount: runtime.Decimal | null + isSettled: boolean | null + buyAt: Date | null + description: string | null + createdAt: Date | null + updatedAt: Date | null + deletedAt: Date | null + productId: number | null + inventoryId: number | null + supplierId: number | null +} + +export type ProductChargeCountAggregateOutputType = { + id: number + count: number + fee: number + totalAmount: number + isSettled: number + buyAt: number + description: number + createdAt: number + updatedAt: number + deletedAt: number + productId: number + inventoryId: number + supplierId: number + _all: number +} + + +export type ProductChargeAvgAggregateInputType = { + id?: true + count?: true + fee?: true + totalAmount?: true + productId?: true + inventoryId?: true + supplierId?: true +} + +export type ProductChargeSumAggregateInputType = { + id?: true + count?: true + fee?: true + totalAmount?: true + productId?: true + inventoryId?: true + supplierId?: true +} + +export type ProductChargeMinAggregateInputType = { + id?: true + count?: true + fee?: true + totalAmount?: true + isSettled?: true + buyAt?: true + description?: true + createdAt?: true + updatedAt?: true + deletedAt?: true + productId?: true + inventoryId?: true + supplierId?: true +} + +export type ProductChargeMaxAggregateInputType = { + id?: true + count?: true + fee?: true + totalAmount?: true + isSettled?: true + buyAt?: true + description?: true + createdAt?: true + updatedAt?: true + deletedAt?: true + productId?: true + inventoryId?: true + supplierId?: true +} + +export type ProductChargeCountAggregateInputType = { + id?: true + count?: true + fee?: true + totalAmount?: true + isSettled?: true + buyAt?: true + description?: true + createdAt?: true + updatedAt?: true + deletedAt?: true + productId?: true + inventoryId?: true + supplierId?: true + _all?: true +} + +export type ProductChargeAggregateArgs = { + /** + * Filter which ProductCharge to aggregate. + */ + where?: Prisma.ProductChargeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ProductCharges to fetch. + */ + orderBy?: Prisma.ProductChargeOrderByWithRelationInput | Prisma.ProductChargeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.ProductChargeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ProductCharges from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` ProductCharges. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned ProductCharges + **/ + _count?: true | ProductChargeCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: ProductChargeAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: ProductChargeSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ProductChargeMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ProductChargeMaxAggregateInputType +} + +export type GetProductChargeAggregateType = { + [P in keyof T & keyof AggregateProductCharge]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type ProductChargeGroupByArgs = { + where?: Prisma.ProductChargeWhereInput + orderBy?: Prisma.ProductChargeOrderByWithAggregationInput | Prisma.ProductChargeOrderByWithAggregationInput[] + by: Prisma.ProductChargeScalarFieldEnum[] | Prisma.ProductChargeScalarFieldEnum + having?: Prisma.ProductChargeScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ProductChargeCountAggregateInputType | true + _avg?: ProductChargeAvgAggregateInputType + _sum?: ProductChargeSumAggregateInputType + _min?: ProductChargeMinAggregateInputType + _max?: ProductChargeMaxAggregateInputType +} + +export type ProductChargeGroupByOutputType = { + id: number + count: runtime.Decimal + fee: runtime.Decimal + totalAmount: runtime.Decimal + isSettled: boolean + buyAt: Date | null + description: string | null + createdAt: Date + updatedAt: Date + deletedAt: Date | null + productId: number + inventoryId: number + supplierId: number + _count: ProductChargeCountAggregateOutputType | null + _avg: ProductChargeAvgAggregateOutputType | null + _sum: ProductChargeSumAggregateOutputType | null + _min: ProductChargeMinAggregateOutputType | null + _max: ProductChargeMaxAggregateOutputType | null +} + +type GetProductChargeGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof ProductChargeGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type ProductChargeWhereInput = { + AND?: Prisma.ProductChargeWhereInput | Prisma.ProductChargeWhereInput[] + OR?: Prisma.ProductChargeWhereInput[] + NOT?: Prisma.ProductChargeWhereInput | Prisma.ProductChargeWhereInput[] + id?: Prisma.IntFilter<"ProductCharge"> | number + count?: Prisma.DecimalFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFilter<"ProductCharge"> | boolean + buyAt?: Prisma.DateTimeNullableFilter<"ProductCharge"> | Date | string | null + description?: Prisma.StringNullableFilter<"ProductCharge"> | string | null + createdAt?: Prisma.DateTimeFilter<"ProductCharge"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"ProductCharge"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"ProductCharge"> | Date | string | null + productId?: Prisma.IntFilter<"ProductCharge"> | number + inventoryId?: Prisma.IntFilter<"ProductCharge"> | number + supplierId?: Prisma.IntFilter<"ProductCharge"> | number + inventory?: Prisma.XOR + product?: Prisma.XOR + supplier?: Prisma.XOR +} + +export type ProductChargeOrderByWithRelationInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + isSettled?: Prisma.SortOrder + buyAt?: Prisma.SortOrderInput | Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder + inventory?: Prisma.InventoryOrderByWithRelationInput + product?: Prisma.ProductOrderByWithRelationInput + supplier?: Prisma.SupplierOrderByWithRelationInput + _relevance?: Prisma.ProductChargeOrderByRelevanceInput +} + +export type ProductChargeWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.ProductChargeWhereInput | Prisma.ProductChargeWhereInput[] + OR?: Prisma.ProductChargeWhereInput[] + NOT?: Prisma.ProductChargeWhereInput | Prisma.ProductChargeWhereInput[] + count?: Prisma.DecimalFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFilter<"ProductCharge"> | boolean + buyAt?: Prisma.DateTimeNullableFilter<"ProductCharge"> | Date | string | null + description?: Prisma.StringNullableFilter<"ProductCharge"> | string | null + createdAt?: Prisma.DateTimeFilter<"ProductCharge"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"ProductCharge"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"ProductCharge"> | Date | string | null + productId?: Prisma.IntFilter<"ProductCharge"> | number + inventoryId?: Prisma.IntFilter<"ProductCharge"> | number + supplierId?: Prisma.IntFilter<"ProductCharge"> | number + inventory?: Prisma.XOR + product?: Prisma.XOR + supplier?: Prisma.XOR +}, "id"> + +export type ProductChargeOrderByWithAggregationInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + isSettled?: Prisma.SortOrder + buyAt?: Prisma.SortOrderInput | Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder + _count?: Prisma.ProductChargeCountOrderByAggregateInput + _avg?: Prisma.ProductChargeAvgOrderByAggregateInput + _max?: Prisma.ProductChargeMaxOrderByAggregateInput + _min?: Prisma.ProductChargeMinOrderByAggregateInput + _sum?: Prisma.ProductChargeSumOrderByAggregateInput +} + +export type ProductChargeScalarWhereWithAggregatesInput = { + AND?: Prisma.ProductChargeScalarWhereWithAggregatesInput | Prisma.ProductChargeScalarWhereWithAggregatesInput[] + OR?: Prisma.ProductChargeScalarWhereWithAggregatesInput[] + NOT?: Prisma.ProductChargeScalarWhereWithAggregatesInput | Prisma.ProductChargeScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"ProductCharge"> | number + count?: Prisma.DecimalWithAggregatesFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalWithAggregatesFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalWithAggregatesFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolWithAggregatesFilter<"ProductCharge"> | boolean + buyAt?: Prisma.DateTimeNullableWithAggregatesFilter<"ProductCharge"> | Date | string | null + description?: Prisma.StringNullableWithAggregatesFilter<"ProductCharge"> | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"ProductCharge"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"ProductCharge"> | Date | string + deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"ProductCharge"> | Date | string | null + productId?: Prisma.IntWithAggregatesFilter<"ProductCharge"> | number + inventoryId?: Prisma.IntWithAggregatesFilter<"ProductCharge"> | number + supplierId?: Prisma.IntWithAggregatesFilter<"ProductCharge"> | number +} + +export type ProductChargeCreateInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventory: Prisma.InventoryCreateNestedOneWithoutProductChargesInput + product: Prisma.ProductCreateNestedOneWithoutProductChargesInput + supplier: Prisma.SupplierCreateNestedOneWithoutProductChargesInput +} + +export type ProductChargeUncheckedCreateInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + productId: number + inventoryId: number + supplierId: number +} + +export type ProductChargeUpdateInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventory?: Prisma.InventoryUpdateOneRequiredWithoutProductChargesNestedInput + product?: Prisma.ProductUpdateOneRequiredWithoutProductChargesNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutProductChargesNestedInput +} + +export type ProductChargeUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type ProductChargeCreateManyInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + productId: number + inventoryId: number + supplierId: number +} + +export type ProductChargeUpdateManyMutationInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null +} + +export type ProductChargeUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type ProductChargeListRelationFilter = { + every?: Prisma.ProductChargeWhereInput + some?: Prisma.ProductChargeWhereInput + none?: Prisma.ProductChargeWhereInput +} + +export type ProductChargeOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type ProductChargeOrderByRelevanceInput = { + fields: Prisma.ProductChargeOrderByRelevanceFieldEnum | Prisma.ProductChargeOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type ProductChargeCountOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + isSettled?: Prisma.SortOrder + buyAt?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder +} + +export type ProductChargeAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder +} + +export type ProductChargeMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + isSettled?: Prisma.SortOrder + buyAt?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder +} + +export type ProductChargeMinOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + isSettled?: Prisma.SortOrder + buyAt?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder +} + +export type ProductChargeSumOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + supplierId?: Prisma.SortOrder +} + +export type ProductChargeCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutProductInput[] | Prisma.ProductChargeUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutProductInput | Prisma.ProductChargeCreateOrConnectWithoutProductInput[] + createMany?: Prisma.ProductChargeCreateManyProductInputEnvelope + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] +} + +export type ProductChargeUncheckedCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutProductInput[] | Prisma.ProductChargeUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutProductInput | Prisma.ProductChargeCreateOrConnectWithoutProductInput[] + createMany?: Prisma.ProductChargeCreateManyProductInputEnvelope + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] +} + +export type ProductChargeUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutProductInput[] | Prisma.ProductChargeUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutProductInput | Prisma.ProductChargeCreateOrConnectWithoutProductInput[] + upsert?: Prisma.ProductChargeUpsertWithWhereUniqueWithoutProductInput | Prisma.ProductChargeUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.ProductChargeCreateManyProductInputEnvelope + set?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + disconnect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + delete?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + update?: Prisma.ProductChargeUpdateWithWhereUniqueWithoutProductInput | Prisma.ProductChargeUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.ProductChargeUpdateManyWithWhereWithoutProductInput | Prisma.ProductChargeUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.ProductChargeScalarWhereInput | Prisma.ProductChargeScalarWhereInput[] +} + +export type ProductChargeUncheckedUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutProductInput[] | Prisma.ProductChargeUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutProductInput | Prisma.ProductChargeCreateOrConnectWithoutProductInput[] + upsert?: Prisma.ProductChargeUpsertWithWhereUniqueWithoutProductInput | Prisma.ProductChargeUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.ProductChargeCreateManyProductInputEnvelope + set?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + disconnect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + delete?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + update?: Prisma.ProductChargeUpdateWithWhereUniqueWithoutProductInput | Prisma.ProductChargeUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.ProductChargeUpdateManyWithWhereWithoutProductInput | Prisma.ProductChargeUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.ProductChargeScalarWhereInput | Prisma.ProductChargeScalarWhereInput[] +} + +export type ProductChargeCreateNestedManyWithoutSupplierInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutSupplierInput[] | Prisma.ProductChargeUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutSupplierInput | Prisma.ProductChargeCreateOrConnectWithoutSupplierInput[] + createMany?: Prisma.ProductChargeCreateManySupplierInputEnvelope + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] +} + +export type ProductChargeUncheckedCreateNestedManyWithoutSupplierInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutSupplierInput[] | Prisma.ProductChargeUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutSupplierInput | Prisma.ProductChargeCreateOrConnectWithoutSupplierInput[] + createMany?: Prisma.ProductChargeCreateManySupplierInputEnvelope + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] +} + +export type ProductChargeUpdateManyWithoutSupplierNestedInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutSupplierInput[] | Prisma.ProductChargeUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutSupplierInput | Prisma.ProductChargeCreateOrConnectWithoutSupplierInput[] + upsert?: Prisma.ProductChargeUpsertWithWhereUniqueWithoutSupplierInput | Prisma.ProductChargeUpsertWithWhereUniqueWithoutSupplierInput[] + createMany?: Prisma.ProductChargeCreateManySupplierInputEnvelope + set?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + disconnect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + delete?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + update?: Prisma.ProductChargeUpdateWithWhereUniqueWithoutSupplierInput | Prisma.ProductChargeUpdateWithWhereUniqueWithoutSupplierInput[] + updateMany?: Prisma.ProductChargeUpdateManyWithWhereWithoutSupplierInput | Prisma.ProductChargeUpdateManyWithWhereWithoutSupplierInput[] + deleteMany?: Prisma.ProductChargeScalarWhereInput | Prisma.ProductChargeScalarWhereInput[] +} + +export type ProductChargeUncheckedUpdateManyWithoutSupplierNestedInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutSupplierInput[] | Prisma.ProductChargeUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutSupplierInput | Prisma.ProductChargeCreateOrConnectWithoutSupplierInput[] + upsert?: Prisma.ProductChargeUpsertWithWhereUniqueWithoutSupplierInput | Prisma.ProductChargeUpsertWithWhereUniqueWithoutSupplierInput[] + createMany?: Prisma.ProductChargeCreateManySupplierInputEnvelope + set?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + disconnect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + delete?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + update?: Prisma.ProductChargeUpdateWithWhereUniqueWithoutSupplierInput | Prisma.ProductChargeUpdateWithWhereUniqueWithoutSupplierInput[] + updateMany?: Prisma.ProductChargeUpdateManyWithWhereWithoutSupplierInput | Prisma.ProductChargeUpdateManyWithWhereWithoutSupplierInput[] + deleteMany?: Prisma.ProductChargeScalarWhereInput | Prisma.ProductChargeScalarWhereInput[] +} + +export type ProductChargeCreateNestedManyWithoutInventoryInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutInventoryInput[] | Prisma.ProductChargeUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutInventoryInput | Prisma.ProductChargeCreateOrConnectWithoutInventoryInput[] + createMany?: Prisma.ProductChargeCreateManyInventoryInputEnvelope + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] +} + +export type ProductChargeUncheckedCreateNestedManyWithoutInventoryInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutInventoryInput[] | Prisma.ProductChargeUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutInventoryInput | Prisma.ProductChargeCreateOrConnectWithoutInventoryInput[] + createMany?: Prisma.ProductChargeCreateManyInventoryInputEnvelope + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] +} + +export type ProductChargeUpdateManyWithoutInventoryNestedInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutInventoryInput[] | Prisma.ProductChargeUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutInventoryInput | Prisma.ProductChargeCreateOrConnectWithoutInventoryInput[] + upsert?: Prisma.ProductChargeUpsertWithWhereUniqueWithoutInventoryInput | Prisma.ProductChargeUpsertWithWhereUniqueWithoutInventoryInput[] + createMany?: Prisma.ProductChargeCreateManyInventoryInputEnvelope + set?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + disconnect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + delete?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + update?: Prisma.ProductChargeUpdateWithWhereUniqueWithoutInventoryInput | Prisma.ProductChargeUpdateWithWhereUniqueWithoutInventoryInput[] + updateMany?: Prisma.ProductChargeUpdateManyWithWhereWithoutInventoryInput | Prisma.ProductChargeUpdateManyWithWhereWithoutInventoryInput[] + deleteMany?: Prisma.ProductChargeScalarWhereInput | Prisma.ProductChargeScalarWhereInput[] +} + +export type ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput = { + create?: Prisma.XOR | Prisma.ProductChargeCreateWithoutInventoryInput[] | Prisma.ProductChargeUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.ProductChargeCreateOrConnectWithoutInventoryInput | Prisma.ProductChargeCreateOrConnectWithoutInventoryInput[] + upsert?: Prisma.ProductChargeUpsertWithWhereUniqueWithoutInventoryInput | Prisma.ProductChargeUpsertWithWhereUniqueWithoutInventoryInput[] + createMany?: Prisma.ProductChargeCreateManyInventoryInputEnvelope + set?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + disconnect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + delete?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + connect?: Prisma.ProductChargeWhereUniqueInput | Prisma.ProductChargeWhereUniqueInput[] + update?: Prisma.ProductChargeUpdateWithWhereUniqueWithoutInventoryInput | Prisma.ProductChargeUpdateWithWhereUniqueWithoutInventoryInput[] + updateMany?: Prisma.ProductChargeUpdateManyWithWhereWithoutInventoryInput | Prisma.ProductChargeUpdateManyWithWhereWithoutInventoryInput[] + deleteMany?: Prisma.ProductChargeScalarWhereInput | Prisma.ProductChargeScalarWhereInput[] +} + +export type ProductChargeCreateWithoutProductInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventory: Prisma.InventoryCreateNestedOneWithoutProductChargesInput + supplier: Prisma.SupplierCreateNestedOneWithoutProductChargesInput +} + +export type ProductChargeUncheckedCreateWithoutProductInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryId: number + supplierId: number +} + +export type ProductChargeCreateOrConnectWithoutProductInput = { + where: Prisma.ProductChargeWhereUniqueInput + create: Prisma.XOR +} + +export type ProductChargeCreateManyProductInputEnvelope = { + data: Prisma.ProductChargeCreateManyProductInput | Prisma.ProductChargeCreateManyProductInput[] + skipDuplicates?: boolean +} + +export type ProductChargeUpsertWithWhereUniqueWithoutProductInput = { + where: Prisma.ProductChargeWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type ProductChargeUpdateWithWhereUniqueWithoutProductInput = { + where: Prisma.ProductChargeWhereUniqueInput + data: Prisma.XOR +} + +export type ProductChargeUpdateManyWithWhereWithoutProductInput = { + where: Prisma.ProductChargeScalarWhereInput + data: Prisma.XOR +} + +export type ProductChargeScalarWhereInput = { + AND?: Prisma.ProductChargeScalarWhereInput | Prisma.ProductChargeScalarWhereInput[] + OR?: Prisma.ProductChargeScalarWhereInput[] + NOT?: Prisma.ProductChargeScalarWhereInput | Prisma.ProductChargeScalarWhereInput[] + id?: Prisma.IntFilter<"ProductCharge"> | number + count?: Prisma.DecimalFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFilter<"ProductCharge"> | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFilter<"ProductCharge"> | boolean + buyAt?: Prisma.DateTimeNullableFilter<"ProductCharge"> | Date | string | null + description?: Prisma.StringNullableFilter<"ProductCharge"> | string | null + createdAt?: Prisma.DateTimeFilter<"ProductCharge"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"ProductCharge"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"ProductCharge"> | Date | string | null + productId?: Prisma.IntFilter<"ProductCharge"> | number + inventoryId?: Prisma.IntFilter<"ProductCharge"> | number + supplierId?: Prisma.IntFilter<"ProductCharge"> | number +} + +export type ProductChargeCreateWithoutSupplierInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventory: Prisma.InventoryCreateNestedOneWithoutProductChargesInput + product: Prisma.ProductCreateNestedOneWithoutProductChargesInput +} + +export type ProductChargeUncheckedCreateWithoutSupplierInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + productId: number + inventoryId: number +} + +export type ProductChargeCreateOrConnectWithoutSupplierInput = { + where: Prisma.ProductChargeWhereUniqueInput + create: Prisma.XOR +} + +export type ProductChargeCreateManySupplierInputEnvelope = { + data: Prisma.ProductChargeCreateManySupplierInput | Prisma.ProductChargeCreateManySupplierInput[] + skipDuplicates?: boolean +} + +export type ProductChargeUpsertWithWhereUniqueWithoutSupplierInput = { + where: Prisma.ProductChargeWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type ProductChargeUpdateWithWhereUniqueWithoutSupplierInput = { + where: Prisma.ProductChargeWhereUniqueInput + data: Prisma.XOR +} + +export type ProductChargeUpdateManyWithWhereWithoutSupplierInput = { + where: Prisma.ProductChargeScalarWhereInput + data: Prisma.XOR +} + +export type ProductChargeCreateWithoutInventoryInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + product: Prisma.ProductCreateNestedOneWithoutProductChargesInput + supplier: Prisma.SupplierCreateNestedOneWithoutProductChargesInput +} + +export type ProductChargeUncheckedCreateWithoutInventoryInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + productId: number + supplierId: number +} + +export type ProductChargeCreateOrConnectWithoutInventoryInput = { + where: Prisma.ProductChargeWhereUniqueInput + create: Prisma.XOR +} + +export type ProductChargeCreateManyInventoryInputEnvelope = { + data: Prisma.ProductChargeCreateManyInventoryInput | Prisma.ProductChargeCreateManyInventoryInput[] + skipDuplicates?: boolean +} + +export type ProductChargeUpsertWithWhereUniqueWithoutInventoryInput = { + where: Prisma.ProductChargeWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type ProductChargeUpdateWithWhereUniqueWithoutInventoryInput = { + where: Prisma.ProductChargeWhereUniqueInput + data: Prisma.XOR +} + +export type ProductChargeUpdateManyWithWhereWithoutInventoryInput = { + where: Prisma.ProductChargeScalarWhereInput + data: Prisma.XOR +} + +export type ProductChargeCreateManyProductInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + inventoryId: number + supplierId: number +} + +export type ProductChargeUpdateWithoutProductInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventory?: Prisma.InventoryUpdateOneRequiredWithoutProductChargesNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutProductChargesNestedInput +} + +export type ProductChargeUncheckedUpdateWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type ProductChargeUncheckedUpdateManyWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type ProductChargeCreateManySupplierInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + productId: number + inventoryId: number +} + +export type ProductChargeUpdateWithoutSupplierInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + inventory?: Prisma.InventoryUpdateOneRequiredWithoutProductChargesNestedInput + product?: Prisma.ProductUpdateOneRequiredWithoutProductChargesNestedInput +} + +export type ProductChargeUncheckedUpdateWithoutSupplierInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type ProductChargeUncheckedUpdateManyWithoutSupplierInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type ProductChargeCreateManyInventoryInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: boolean + buyAt?: Date | string | null + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + productId: number + supplierId: number +} + +export type ProductChargeUpdateWithoutInventoryInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + product?: Prisma.ProductUpdateOneRequiredWithoutProductChargesNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutProductChargesNestedInput +} + +export type ProductChargeUncheckedUpdateWithoutInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type ProductChargeUncheckedUpdateManyWithoutInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + isSettled?: Prisma.BoolFieldUpdateOperationsInput | boolean + buyAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productId?: Prisma.IntFieldUpdateOperationsInput | number + supplierId?: Prisma.IntFieldUpdateOperationsInput | number +} + + + +export type ProductChargeSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + count?: boolean + fee?: boolean + totalAmount?: boolean + isSettled?: boolean + buyAt?: boolean + description?: boolean + createdAt?: boolean + updatedAt?: boolean + deletedAt?: boolean + productId?: boolean + inventoryId?: boolean + supplierId?: boolean + inventory?: boolean | Prisma.InventoryDefaultArgs + product?: boolean | Prisma.ProductDefaultArgs + supplier?: boolean | Prisma.SupplierDefaultArgs +}, ExtArgs["result"]["productCharge"]> + + + +export type ProductChargeSelectScalar = { + id?: boolean + count?: boolean + fee?: boolean + totalAmount?: boolean + isSettled?: boolean + buyAt?: boolean + description?: boolean + createdAt?: boolean + updatedAt?: boolean + deletedAt?: boolean + productId?: boolean + inventoryId?: boolean + supplierId?: boolean +} + +export type ProductChargeOmit = runtime.Types.Extensions.GetOmit<"id" | "count" | "fee" | "totalAmount" | "isSettled" | "buyAt" | "description" | "createdAt" | "updatedAt" | "deletedAt" | "productId" | "inventoryId" | "supplierId", ExtArgs["result"]["productCharge"]> +export type ProductChargeInclude = { + inventory?: boolean | Prisma.InventoryDefaultArgs + product?: boolean | Prisma.ProductDefaultArgs + supplier?: boolean | Prisma.SupplierDefaultArgs +} + +export type $ProductChargePayload = { + name: "ProductCharge" + objects: { + inventory: Prisma.$InventoryPayload + product: Prisma.$ProductPayload + supplier: Prisma.$SupplierPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + count: runtime.Decimal + fee: runtime.Decimal + totalAmount: runtime.Decimal + isSettled: boolean + buyAt: Date | null + description: string | null + createdAt: Date + updatedAt: Date + deletedAt: Date | null + productId: number + inventoryId: number + supplierId: number + }, ExtArgs["result"]["productCharge"]> + composites: {} +} + +export type ProductChargeGetPayload = runtime.Types.Result.GetResult + +export type ProductChargeCountArgs = + Omit & { + select?: ProductChargeCountAggregateInputType | true + } + +export interface ProductChargeDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['ProductCharge'], meta: { name: 'ProductCharge' } } + /** + * Find zero or one ProductCharge that matches the filter. + * @param {ProductChargeFindUniqueArgs} args - Arguments to find a ProductCharge + * @example + * // Get one ProductCharge + * const productCharge = await prisma.productCharge.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__ProductChargeClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one ProductCharge that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ProductChargeFindUniqueOrThrowArgs} args - Arguments to find a ProductCharge + * @example + * // Get one ProductCharge + * const productCharge = await prisma.productCharge.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__ProductChargeClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first ProductCharge that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProductChargeFindFirstArgs} args - Arguments to find a ProductCharge + * @example + * // Get one ProductCharge + * const productCharge = await prisma.productCharge.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__ProductChargeClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first ProductCharge that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProductChargeFindFirstOrThrowArgs} args - Arguments to find a ProductCharge + * @example + * // Get one ProductCharge + * const productCharge = await prisma.productCharge.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__ProductChargeClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more ProductCharges that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProductChargeFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all ProductCharges + * const productCharges = await prisma.productCharge.findMany() + * + * // Get first 10 ProductCharges + * const productCharges = await prisma.productCharge.findMany({ take: 10 }) + * + * // Only select the `id` + * const productChargeWithIdOnly = await prisma.productCharge.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a ProductCharge. + * @param {ProductChargeCreateArgs} args - Arguments to create a ProductCharge. + * @example + * // Create one ProductCharge + * const ProductCharge = await prisma.productCharge.create({ + * data: { + * // ... data to create a ProductCharge + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__ProductChargeClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many ProductCharges. + * @param {ProductChargeCreateManyArgs} args - Arguments to create many ProductCharges. + * @example + * // Create many ProductCharges + * const productCharge = await prisma.productCharge.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a ProductCharge. + * @param {ProductChargeDeleteArgs} args - Arguments to delete one ProductCharge. + * @example + * // Delete one ProductCharge + * const ProductCharge = await prisma.productCharge.delete({ + * where: { + * // ... filter to delete one ProductCharge + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__ProductChargeClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one ProductCharge. + * @param {ProductChargeUpdateArgs} args - Arguments to update one ProductCharge. + * @example + * // Update one ProductCharge + * const productCharge = await prisma.productCharge.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__ProductChargeClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more ProductCharges. + * @param {ProductChargeDeleteManyArgs} args - Arguments to filter ProductCharges to delete. + * @example + * // Delete a few ProductCharges + * const { count } = await prisma.productCharge.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more ProductCharges. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProductChargeUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many ProductCharges + * const productCharge = await prisma.productCharge.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one ProductCharge. + * @param {ProductChargeUpsertArgs} args - Arguments to update or create a ProductCharge. + * @example + * // Update or create a ProductCharge + * const productCharge = await prisma.productCharge.upsert({ + * create: { + * // ... data to create a ProductCharge + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the ProductCharge we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__ProductChargeClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of ProductCharges. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProductChargeCountArgs} args - Arguments to filter ProductCharges to count. + * @example + * // Count the number of ProductCharges + * const count = await prisma.productCharge.count({ + * where: { + * // ... the filter for the ProductCharges we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a ProductCharge. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProductChargeAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by ProductCharge. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ProductChargeGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends ProductChargeGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: ProductChargeGroupByArgs['orderBy'] } + : { orderBy?: ProductChargeGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetProductChargeGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the ProductCharge model + */ +readonly fields: ProductChargeFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for ProductCharge. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__ProductChargeClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + inventory = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + product = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProductClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + supplier = {}>(args?: Prisma.Subset>): Prisma.Prisma__SupplierClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the ProductCharge model + */ +export interface ProductChargeFieldRefs { + readonly id: Prisma.FieldRef<"ProductCharge", 'Int'> + readonly count: Prisma.FieldRef<"ProductCharge", 'Decimal'> + readonly fee: Prisma.FieldRef<"ProductCharge", 'Decimal'> + readonly totalAmount: Prisma.FieldRef<"ProductCharge", 'Decimal'> + readonly isSettled: Prisma.FieldRef<"ProductCharge", 'Boolean'> + readonly buyAt: Prisma.FieldRef<"ProductCharge", 'DateTime'> + readonly description: Prisma.FieldRef<"ProductCharge", 'String'> + readonly createdAt: Prisma.FieldRef<"ProductCharge", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"ProductCharge", 'DateTime'> + readonly deletedAt: Prisma.FieldRef<"ProductCharge", 'DateTime'> + readonly productId: Prisma.FieldRef<"ProductCharge", 'Int'> + readonly inventoryId: Prisma.FieldRef<"ProductCharge", 'Int'> + readonly supplierId: Prisma.FieldRef<"ProductCharge", 'Int'> +} + + +// Custom InputTypes +/** + * ProductCharge findUnique + */ +export type ProductChargeFindUniqueArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + /** + * Filter, which ProductCharge to fetch. + */ + where: Prisma.ProductChargeWhereUniqueInput +} + +/** + * ProductCharge findUniqueOrThrow + */ +export type ProductChargeFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + /** + * Filter, which ProductCharge to fetch. + */ + where: Prisma.ProductChargeWhereUniqueInput +} + +/** + * ProductCharge findFirst + */ +export type ProductChargeFindFirstArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + /** + * Filter, which ProductCharge to fetch. + */ + where?: Prisma.ProductChargeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ProductCharges to fetch. + */ + orderBy?: Prisma.ProductChargeOrderByWithRelationInput | Prisma.ProductChargeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for ProductCharges. + */ + cursor?: Prisma.ProductChargeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ProductCharges from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` ProductCharges. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of ProductCharges. + */ + distinct?: Prisma.ProductChargeScalarFieldEnum | Prisma.ProductChargeScalarFieldEnum[] +} + +/** + * ProductCharge findFirstOrThrow + */ +export type ProductChargeFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + /** + * Filter, which ProductCharge to fetch. + */ + where?: Prisma.ProductChargeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ProductCharges to fetch. + */ + orderBy?: Prisma.ProductChargeOrderByWithRelationInput | Prisma.ProductChargeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for ProductCharges. + */ + cursor?: Prisma.ProductChargeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ProductCharges from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` ProductCharges. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of ProductCharges. + */ + distinct?: Prisma.ProductChargeScalarFieldEnum | Prisma.ProductChargeScalarFieldEnum[] +} + +/** + * ProductCharge findMany + */ +export type ProductChargeFindManyArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + /** + * Filter, which ProductCharges to fetch. + */ + where?: Prisma.ProductChargeWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of ProductCharges to fetch. + */ + orderBy?: Prisma.ProductChargeOrderByWithRelationInput | Prisma.ProductChargeOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing ProductCharges. + */ + cursor?: Prisma.ProductChargeWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` ProductCharges from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` ProductCharges. + */ + skip?: number + distinct?: Prisma.ProductChargeScalarFieldEnum | Prisma.ProductChargeScalarFieldEnum[] +} + +/** + * ProductCharge create + */ +export type ProductChargeCreateArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + /** + * The data needed to create a ProductCharge. + */ + data: Prisma.XOR +} + +/** + * ProductCharge createMany + */ +export type ProductChargeCreateManyArgs = { + /** + * The data used to create many ProductCharges. + */ + data: Prisma.ProductChargeCreateManyInput | Prisma.ProductChargeCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * ProductCharge update + */ +export type ProductChargeUpdateArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + /** + * The data needed to update a ProductCharge. + */ + data: Prisma.XOR + /** + * Choose, which ProductCharge to update. + */ + where: Prisma.ProductChargeWhereUniqueInput +} + +/** + * ProductCharge updateMany + */ +export type ProductChargeUpdateManyArgs = { + /** + * The data used to update ProductCharges. + */ + data: Prisma.XOR + /** + * Filter which ProductCharges to update + */ + where?: Prisma.ProductChargeWhereInput + /** + * Limit how many ProductCharges to update. + */ + limit?: number +} + +/** + * ProductCharge upsert + */ +export type ProductChargeUpsertArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + /** + * The filter to search for the ProductCharge to update in case it exists. + */ + where: Prisma.ProductChargeWhereUniqueInput + /** + * In case the ProductCharge found by the `where` argument doesn't exist, create a new ProductCharge with this data. + */ + create: Prisma.XOR + /** + * In case the ProductCharge was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * ProductCharge delete + */ +export type ProductChargeDeleteArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + /** + * Filter which ProductCharge to delete. + */ + where: Prisma.ProductChargeWhereUniqueInput +} + +/** + * ProductCharge deleteMany + */ +export type ProductChargeDeleteManyArgs = { + /** + * Filter which ProductCharges to delete + */ + where?: Prisma.ProductChargeWhereInput + /** + * Limit how many ProductCharges to delete. + */ + limit?: number +} + +/** + * ProductCharge without action + */ +export type ProductChargeDefaultArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null +} diff --git a/src/generated/prisma/models/ProductVariant.ts b/src/generated/prisma/models/ProductVariant.ts index 5d2f0cf..c01a7f7 100644 --- a/src/generated/prisma/models/ProductVariant.ts +++ b/src/generated/prisma/models/ProductVariant.ts @@ -278,8 +278,8 @@ export type ProductVariantGroupByOutputType = { alertQuantity: runtime.Decimal | null isActive: boolean isFeatured: boolean - createdAt: Date | null - updatedAt: Date | null + createdAt: Date + updatedAt: Date deletedAt: Date | null productId: number _count: ProductVariantCountAggregateOutputType | null @@ -320,8 +320,8 @@ export type ProductVariantWhereInput = { alertQuantity?: Prisma.DecimalNullableFilter<"ProductVariant"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolFilter<"ProductVariant"> | boolean isFeatured?: Prisma.BoolFilter<"ProductVariant"> | boolean - createdAt?: Prisma.DateTimeNullableFilter<"ProductVariant"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableFilter<"ProductVariant"> | Date | string | null + createdAt?: Prisma.DateTimeFilter<"ProductVariant"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"ProductVariant"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"ProductVariant"> | Date | string | null productId?: Prisma.IntFilter<"ProductVariant"> | number product?: Prisma.XOR @@ -340,8 +340,8 @@ export type ProductVariantOrderByWithRelationInput = { alertQuantity?: Prisma.SortOrderInput | Prisma.SortOrder isActive?: Prisma.SortOrder isFeatured?: Prisma.SortOrder - createdAt?: Prisma.SortOrderInput | Prisma.SortOrder - updatedAt?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder productId?: Prisma.SortOrder product?: Prisma.ProductOrderByWithRelationInput @@ -364,8 +364,8 @@ export type ProductVariantWhereUniqueInput = Prisma.AtLeast<{ alertQuantity?: Prisma.DecimalNullableFilter<"ProductVariant"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolFilter<"ProductVariant"> | boolean isFeatured?: Prisma.BoolFilter<"ProductVariant"> | boolean - createdAt?: Prisma.DateTimeNullableFilter<"ProductVariant"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableFilter<"ProductVariant"> | Date | string | null + createdAt?: Prisma.DateTimeFilter<"ProductVariant"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"ProductVariant"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"ProductVariant"> | Date | string | null productId?: Prisma.IntFilter<"ProductVariant"> | number product?: Prisma.XOR @@ -384,8 +384,8 @@ export type ProductVariantOrderByWithAggregationInput = { alertQuantity?: Prisma.SortOrderInput | Prisma.SortOrder isActive?: Prisma.SortOrder isFeatured?: Prisma.SortOrder - createdAt?: Prisma.SortOrderInput | Prisma.SortOrder - updatedAt?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder productId?: Prisma.SortOrder _count?: Prisma.ProductVariantCountOrderByAggregateInput @@ -411,8 +411,8 @@ export type ProductVariantScalarWhereWithAggregatesInput = { alertQuantity?: Prisma.DecimalNullableWithAggregatesFilter<"ProductVariant"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolWithAggregatesFilter<"ProductVariant"> | boolean isFeatured?: Prisma.BoolWithAggregatesFilter<"ProductVariant"> | boolean - createdAt?: Prisma.DateTimeNullableWithAggregatesFilter<"ProductVariant"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"ProductVariant"> | Date | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"ProductVariant"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"ProductVariant"> | Date | string deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"ProductVariant"> | Date | string | null productId?: Prisma.IntWithAggregatesFilter<"ProductVariant"> | number } @@ -429,8 +429,8 @@ export type ProductVariantCreateInput = { alertQuantity?: runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: boolean isFeatured?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null product: Prisma.ProductCreateNestedOneWithoutVariantsInput } @@ -448,8 +448,8 @@ export type ProductVariantUncheckedCreateInput = { alertQuantity?: runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: boolean isFeatured?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null productId: number } @@ -466,8 +466,8 @@ export type ProductVariantUpdateInput = { alertQuantity?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean isFeatured?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null product?: Prisma.ProductUpdateOneRequiredWithoutVariantsNestedInput } @@ -485,8 +485,8 @@ export type ProductVariantUncheckedUpdateInput = { alertQuantity?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean isFeatured?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null productId?: Prisma.IntFieldUpdateOperationsInput | number } @@ -504,8 +504,8 @@ export type ProductVariantCreateManyInput = { alertQuantity?: runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: boolean isFeatured?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null productId: number } @@ -522,8 +522,8 @@ export type ProductVariantUpdateManyMutationInput = { alertQuantity?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean isFeatured?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -540,8 +540,8 @@ export type ProductVariantUncheckedUpdateManyInput = { alertQuantity?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean isFeatured?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null productId?: Prisma.IntFieldUpdateOperationsInput | number } @@ -711,8 +711,8 @@ export type ProductVariantCreateWithoutProductInput = { alertQuantity?: runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: boolean isFeatured?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null } @@ -729,8 +729,8 @@ export type ProductVariantUncheckedCreateWithoutProductInput = { alertQuantity?: runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: boolean isFeatured?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null } @@ -776,8 +776,8 @@ export type ProductVariantScalarWhereInput = { alertQuantity?: Prisma.DecimalNullableFilter<"ProductVariant"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolFilter<"ProductVariant"> | boolean isFeatured?: Prisma.BoolFilter<"ProductVariant"> | boolean - createdAt?: Prisma.DateTimeNullableFilter<"ProductVariant"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableFilter<"ProductVariant"> | Date | string | null + createdAt?: Prisma.DateTimeFilter<"ProductVariant"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"ProductVariant"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"ProductVariant"> | Date | string | null productId?: Prisma.IntFilter<"ProductVariant"> | number } @@ -795,8 +795,8 @@ export type ProductVariantCreateManyProductInput = { alertQuantity?: runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: boolean isFeatured?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null } @@ -812,8 +812,8 @@ export type ProductVariantUpdateWithoutProductInput = { alertQuantity?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean isFeatured?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -830,8 +830,8 @@ export type ProductVariantUncheckedUpdateWithoutProductInput = { alertQuantity?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean isFeatured?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -848,8 +848,8 @@ export type ProductVariantUncheckedUpdateManyWithoutProductInput = { alertQuantity?: Prisma.NullableDecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean isFeatured?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -919,8 +919,8 @@ export type $ProductVariantPayload diff --git a/src/generated/prisma/models/PurchaseReceipt.ts b/src/generated/prisma/models/PurchaseReceipt.ts new file mode 100644 index 0000000..530b842 --- /dev/null +++ b/src/generated/prisma/models/PurchaseReceipt.ts @@ -0,0 +1,1657 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `PurchaseReceipt` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model PurchaseReceipt + * + */ +export type PurchaseReceiptModel = runtime.Types.Result.DefaultSelection + +export type AggregatePurchaseReceipt = { + _count: PurchaseReceiptCountAggregateOutputType | null + _avg: PurchaseReceiptAvgAggregateOutputType | null + _sum: PurchaseReceiptSumAggregateOutputType | null + _min: PurchaseReceiptMinAggregateOutputType | null + _max: PurchaseReceiptMaxAggregateOutputType | null +} + +export type PurchaseReceiptAvgAggregateOutputType = { + id: number | null + totalAmount: runtime.Decimal | null + supplierId: number | null + inventoryId: number | null +} + +export type PurchaseReceiptSumAggregateOutputType = { + id: number | null + totalAmount: runtime.Decimal | null + supplierId: number | null + inventoryId: number | null +} + +export type PurchaseReceiptMinAggregateOutputType = { + id: number | null + code: string | null + totalAmount: runtime.Decimal | null + description: string | null + createdAt: Date | null + updatedAt: Date | null + supplierId: number | null + inventoryId: number | null +} + +export type PurchaseReceiptMaxAggregateOutputType = { + id: number | null + code: string | null + totalAmount: runtime.Decimal | null + description: string | null + createdAt: Date | null + updatedAt: Date | null + supplierId: number | null + inventoryId: number | null +} + +export type PurchaseReceiptCountAggregateOutputType = { + id: number + code: number + totalAmount: number + description: number + createdAt: number + updatedAt: number + supplierId: number + inventoryId: number + _all: number +} + + +export type PurchaseReceiptAvgAggregateInputType = { + id?: true + totalAmount?: true + supplierId?: true + inventoryId?: true +} + +export type PurchaseReceiptSumAggregateInputType = { + id?: true + totalAmount?: true + supplierId?: true + inventoryId?: true +} + +export type PurchaseReceiptMinAggregateInputType = { + id?: true + code?: true + totalAmount?: true + description?: true + createdAt?: true + updatedAt?: true + supplierId?: true + inventoryId?: true +} + +export type PurchaseReceiptMaxAggregateInputType = { + id?: true + code?: true + totalAmount?: true + description?: true + createdAt?: true + updatedAt?: true + supplierId?: true + inventoryId?: true +} + +export type PurchaseReceiptCountAggregateInputType = { + id?: true + code?: true + totalAmount?: true + description?: true + createdAt?: true + updatedAt?: true + supplierId?: true + inventoryId?: true + _all?: true +} + +export type PurchaseReceiptAggregateArgs = { + /** + * Filter which PurchaseReceipt to aggregate. + */ + where?: Prisma.PurchaseReceiptWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PurchaseReceipts to fetch. + */ + orderBy?: Prisma.PurchaseReceiptOrderByWithRelationInput | Prisma.PurchaseReceiptOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.PurchaseReceiptWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PurchaseReceipts from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` PurchaseReceipts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned PurchaseReceipts + **/ + _count?: true | PurchaseReceiptCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PurchaseReceiptAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PurchaseReceiptSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PurchaseReceiptMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PurchaseReceiptMaxAggregateInputType +} + +export type GetPurchaseReceiptAggregateType = { + [P in keyof T & keyof AggregatePurchaseReceipt]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type PurchaseReceiptGroupByArgs = { + where?: Prisma.PurchaseReceiptWhereInput + orderBy?: Prisma.PurchaseReceiptOrderByWithAggregationInput | Prisma.PurchaseReceiptOrderByWithAggregationInput[] + by: Prisma.PurchaseReceiptScalarFieldEnum[] | Prisma.PurchaseReceiptScalarFieldEnum + having?: Prisma.PurchaseReceiptScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PurchaseReceiptCountAggregateInputType | true + _avg?: PurchaseReceiptAvgAggregateInputType + _sum?: PurchaseReceiptSumAggregateInputType + _min?: PurchaseReceiptMinAggregateInputType + _max?: PurchaseReceiptMaxAggregateInputType +} + +export type PurchaseReceiptGroupByOutputType = { + id: number + code: string + totalAmount: runtime.Decimal + description: string | null + createdAt: Date + updatedAt: Date + supplierId: number + inventoryId: number + _count: PurchaseReceiptCountAggregateOutputType | null + _avg: PurchaseReceiptAvgAggregateOutputType | null + _sum: PurchaseReceiptSumAggregateOutputType | null + _min: PurchaseReceiptMinAggregateOutputType | null + _max: PurchaseReceiptMaxAggregateOutputType | null +} + +type GetPurchaseReceiptGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof PurchaseReceiptGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type PurchaseReceiptWhereInput = { + AND?: Prisma.PurchaseReceiptWhereInput | Prisma.PurchaseReceiptWhereInput[] + OR?: Prisma.PurchaseReceiptWhereInput[] + NOT?: Prisma.PurchaseReceiptWhereInput | Prisma.PurchaseReceiptWhereInput[] + id?: Prisma.IntFilter<"PurchaseReceipt"> | number + code?: Prisma.StringFilter<"PurchaseReceipt"> | string + totalAmount?: Prisma.DecimalFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.StringNullableFilter<"PurchaseReceipt"> | string | null + createdAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string + supplierId?: Prisma.IntFilter<"PurchaseReceipt"> | number + inventoryId?: Prisma.IntFilter<"PurchaseReceipt"> | number + items?: Prisma.PurchaseReceiptItemListRelationFilter + inventory?: Prisma.XOR + supplier?: Prisma.XOR +} + +export type PurchaseReceiptOrderByWithRelationInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + supplierId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + items?: Prisma.PurchaseReceiptItemOrderByRelationAggregateInput + inventory?: Prisma.InventoryOrderByWithRelationInput + supplier?: Prisma.SupplierOrderByWithRelationInput + _relevance?: Prisma.PurchaseReceiptOrderByRelevanceInput +} + +export type PurchaseReceiptWhereUniqueInput = Prisma.AtLeast<{ + id?: number + code?: string + AND?: Prisma.PurchaseReceiptWhereInput | Prisma.PurchaseReceiptWhereInput[] + OR?: Prisma.PurchaseReceiptWhereInput[] + NOT?: Prisma.PurchaseReceiptWhereInput | Prisma.PurchaseReceiptWhereInput[] + totalAmount?: Prisma.DecimalFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.StringNullableFilter<"PurchaseReceipt"> | string | null + createdAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string + supplierId?: Prisma.IntFilter<"PurchaseReceipt"> | number + inventoryId?: Prisma.IntFilter<"PurchaseReceipt"> | number + items?: Prisma.PurchaseReceiptItemListRelationFilter + inventory?: Prisma.XOR + supplier?: Prisma.XOR +}, "id" | "code"> + +export type PurchaseReceiptOrderByWithAggregationInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + supplierId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + _count?: Prisma.PurchaseReceiptCountOrderByAggregateInput + _avg?: Prisma.PurchaseReceiptAvgOrderByAggregateInput + _max?: Prisma.PurchaseReceiptMaxOrderByAggregateInput + _min?: Prisma.PurchaseReceiptMinOrderByAggregateInput + _sum?: Prisma.PurchaseReceiptSumOrderByAggregateInput +} + +export type PurchaseReceiptScalarWhereWithAggregatesInput = { + AND?: Prisma.PurchaseReceiptScalarWhereWithAggregatesInput | Prisma.PurchaseReceiptScalarWhereWithAggregatesInput[] + OR?: Prisma.PurchaseReceiptScalarWhereWithAggregatesInput[] + NOT?: Prisma.PurchaseReceiptScalarWhereWithAggregatesInput | Prisma.PurchaseReceiptScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"PurchaseReceipt"> | number + code?: Prisma.StringWithAggregatesFilter<"PurchaseReceipt"> | string + totalAmount?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.StringNullableWithAggregatesFilter<"PurchaseReceipt"> | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceipt"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceipt"> | Date | string + supplierId?: Prisma.IntWithAggregatesFilter<"PurchaseReceipt"> | number + inventoryId?: Prisma.IntWithAggregatesFilter<"PurchaseReceipt"> | number +} + +export type PurchaseReceiptCreateInput = { + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput + inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput + supplier: Prisma.SupplierCreateNestedOneWithoutPurchaseReceiptsInput +} + +export type PurchaseReceiptUncheckedCreateInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + supplierId: number + inventoryId: number + items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput +} + +export type PurchaseReceiptUpdateInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput + inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutPurchaseReceiptsNestedInput +} + +export type PurchaseReceiptUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + supplierId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput +} + +export type PurchaseReceiptCreateManyInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + supplierId: number + inventoryId: number +} + +export type PurchaseReceiptUpdateManyMutationInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type PurchaseReceiptUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + supplierId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PurchaseReceiptListRelationFilter = { + every?: Prisma.PurchaseReceiptWhereInput + some?: Prisma.PurchaseReceiptWhereInput + none?: Prisma.PurchaseReceiptWhereInput +} + +export type PurchaseReceiptOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type PurchaseReceiptOrderByRelevanceInput = { + fields: Prisma.PurchaseReceiptOrderByRelevanceFieldEnum | Prisma.PurchaseReceiptOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type PurchaseReceiptCountOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + supplierId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder +} + +export type PurchaseReceiptAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + supplierId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder +} + +export type PurchaseReceiptMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + supplierId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder +} + +export type PurchaseReceiptMinOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + supplierId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder +} + +export type PurchaseReceiptSumOrderByAggregateInput = { + id?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + supplierId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder +} + +export type PurchaseReceiptScalarRelationFilter = { + is?: Prisma.PurchaseReceiptWhereInput + isNot?: Prisma.PurchaseReceiptWhereInput +} + +export type PurchaseReceiptCreateNestedManyWithoutSupplierInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptCreateWithoutSupplierInput[] | Prisma.PurchaseReceiptUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutSupplierInput | Prisma.PurchaseReceiptCreateOrConnectWithoutSupplierInput[] + createMany?: Prisma.PurchaseReceiptCreateManySupplierInputEnvelope + connect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] +} + +export type PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptCreateWithoutSupplierInput[] | Prisma.PurchaseReceiptUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutSupplierInput | Prisma.PurchaseReceiptCreateOrConnectWithoutSupplierInput[] + createMany?: Prisma.PurchaseReceiptCreateManySupplierInputEnvelope + connect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] +} + +export type PurchaseReceiptUpdateManyWithoutSupplierNestedInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptCreateWithoutSupplierInput[] | Prisma.PurchaseReceiptUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutSupplierInput | Prisma.PurchaseReceiptCreateOrConnectWithoutSupplierInput[] + upsert?: Prisma.PurchaseReceiptUpsertWithWhereUniqueWithoutSupplierInput | Prisma.PurchaseReceiptUpsertWithWhereUniqueWithoutSupplierInput[] + createMany?: Prisma.PurchaseReceiptCreateManySupplierInputEnvelope + set?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + disconnect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + delete?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + connect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + update?: Prisma.PurchaseReceiptUpdateWithWhereUniqueWithoutSupplierInput | Prisma.PurchaseReceiptUpdateWithWhereUniqueWithoutSupplierInput[] + updateMany?: Prisma.PurchaseReceiptUpdateManyWithWhereWithoutSupplierInput | Prisma.PurchaseReceiptUpdateManyWithWhereWithoutSupplierInput[] + deleteMany?: Prisma.PurchaseReceiptScalarWhereInput | Prisma.PurchaseReceiptScalarWhereInput[] +} + +export type PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptCreateWithoutSupplierInput[] | Prisma.PurchaseReceiptUncheckedCreateWithoutSupplierInput[] + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutSupplierInput | Prisma.PurchaseReceiptCreateOrConnectWithoutSupplierInput[] + upsert?: Prisma.PurchaseReceiptUpsertWithWhereUniqueWithoutSupplierInput | Prisma.PurchaseReceiptUpsertWithWhereUniqueWithoutSupplierInput[] + createMany?: Prisma.PurchaseReceiptCreateManySupplierInputEnvelope + set?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + disconnect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + delete?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + connect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + update?: Prisma.PurchaseReceiptUpdateWithWhereUniqueWithoutSupplierInput | Prisma.PurchaseReceiptUpdateWithWhereUniqueWithoutSupplierInput[] + updateMany?: Prisma.PurchaseReceiptUpdateManyWithWhereWithoutSupplierInput | Prisma.PurchaseReceiptUpdateManyWithWhereWithoutSupplierInput[] + deleteMany?: Prisma.PurchaseReceiptScalarWhereInput | Prisma.PurchaseReceiptScalarWhereInput[] +} + +export type PurchaseReceiptCreateNestedManyWithoutInventoryInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptCreateWithoutInventoryInput[] | Prisma.PurchaseReceiptUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutInventoryInput | Prisma.PurchaseReceiptCreateOrConnectWithoutInventoryInput[] + createMany?: Prisma.PurchaseReceiptCreateManyInventoryInputEnvelope + connect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] +} + +export type PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptCreateWithoutInventoryInput[] | Prisma.PurchaseReceiptUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutInventoryInput | Prisma.PurchaseReceiptCreateOrConnectWithoutInventoryInput[] + createMany?: Prisma.PurchaseReceiptCreateManyInventoryInputEnvelope + connect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] +} + +export type PurchaseReceiptUpdateManyWithoutInventoryNestedInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptCreateWithoutInventoryInput[] | Prisma.PurchaseReceiptUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutInventoryInput | Prisma.PurchaseReceiptCreateOrConnectWithoutInventoryInput[] + upsert?: Prisma.PurchaseReceiptUpsertWithWhereUniqueWithoutInventoryInput | Prisma.PurchaseReceiptUpsertWithWhereUniqueWithoutInventoryInput[] + createMany?: Prisma.PurchaseReceiptCreateManyInventoryInputEnvelope + set?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + disconnect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + delete?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + connect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + update?: Prisma.PurchaseReceiptUpdateWithWhereUniqueWithoutInventoryInput | Prisma.PurchaseReceiptUpdateWithWhereUniqueWithoutInventoryInput[] + updateMany?: Prisma.PurchaseReceiptUpdateManyWithWhereWithoutInventoryInput | Prisma.PurchaseReceiptUpdateManyWithWhereWithoutInventoryInput[] + deleteMany?: Prisma.PurchaseReceiptScalarWhereInput | Prisma.PurchaseReceiptScalarWhereInput[] +} + +export type PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptCreateWithoutInventoryInput[] | Prisma.PurchaseReceiptUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutInventoryInput | Prisma.PurchaseReceiptCreateOrConnectWithoutInventoryInput[] + upsert?: Prisma.PurchaseReceiptUpsertWithWhereUniqueWithoutInventoryInput | Prisma.PurchaseReceiptUpsertWithWhereUniqueWithoutInventoryInput[] + createMany?: Prisma.PurchaseReceiptCreateManyInventoryInputEnvelope + set?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + disconnect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + delete?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + connect?: Prisma.PurchaseReceiptWhereUniqueInput | Prisma.PurchaseReceiptWhereUniqueInput[] + update?: Prisma.PurchaseReceiptUpdateWithWhereUniqueWithoutInventoryInput | Prisma.PurchaseReceiptUpdateWithWhereUniqueWithoutInventoryInput[] + updateMany?: Prisma.PurchaseReceiptUpdateManyWithWhereWithoutInventoryInput | Prisma.PurchaseReceiptUpdateManyWithWhereWithoutInventoryInput[] + deleteMany?: Prisma.PurchaseReceiptScalarWhereInput | Prisma.PurchaseReceiptScalarWhereInput[] +} + +export type PurchaseReceiptCreateNestedOneWithoutItemsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutItemsInput + connect?: Prisma.PurchaseReceiptWhereUniqueInput +} + +export type PurchaseReceiptUpdateOneRequiredWithoutItemsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.PurchaseReceiptCreateOrConnectWithoutItemsInput + upsert?: Prisma.PurchaseReceiptUpsertWithoutItemsInput + connect?: Prisma.PurchaseReceiptWhereUniqueInput + update?: Prisma.XOR, Prisma.PurchaseReceiptUncheckedUpdateWithoutItemsInput> +} + +export type PurchaseReceiptCreateWithoutSupplierInput = { + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput + inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput +} + +export type PurchaseReceiptUncheckedCreateWithoutSupplierInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + inventoryId: number + items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput +} + +export type PurchaseReceiptCreateOrConnectWithoutSupplierInput = { + where: Prisma.PurchaseReceiptWhereUniqueInput + create: Prisma.XOR +} + +export type PurchaseReceiptCreateManySupplierInputEnvelope = { + data: Prisma.PurchaseReceiptCreateManySupplierInput | Prisma.PurchaseReceiptCreateManySupplierInput[] + skipDuplicates?: boolean +} + +export type PurchaseReceiptUpsertWithWhereUniqueWithoutSupplierInput = { + where: Prisma.PurchaseReceiptWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PurchaseReceiptUpdateWithWhereUniqueWithoutSupplierInput = { + where: Prisma.PurchaseReceiptWhereUniqueInput + data: Prisma.XOR +} + +export type PurchaseReceiptUpdateManyWithWhereWithoutSupplierInput = { + where: Prisma.PurchaseReceiptScalarWhereInput + data: Prisma.XOR +} + +export type PurchaseReceiptScalarWhereInput = { + AND?: Prisma.PurchaseReceiptScalarWhereInput | Prisma.PurchaseReceiptScalarWhereInput[] + OR?: Prisma.PurchaseReceiptScalarWhereInput[] + NOT?: Prisma.PurchaseReceiptScalarWhereInput | Prisma.PurchaseReceiptScalarWhereInput[] + id?: Prisma.IntFilter<"PurchaseReceipt"> | number + code?: Prisma.StringFilter<"PurchaseReceipt"> | string + totalAmount?: Prisma.DecimalFilter<"PurchaseReceipt"> | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.StringNullableFilter<"PurchaseReceipt"> | string | null + createdAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"PurchaseReceipt"> | Date | string + supplierId?: Prisma.IntFilter<"PurchaseReceipt"> | number + inventoryId?: Prisma.IntFilter<"PurchaseReceipt"> | number +} + +export type PurchaseReceiptCreateWithoutInventoryInput = { + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + items?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutReceiptInput + supplier: Prisma.SupplierCreateNestedOneWithoutPurchaseReceiptsInput +} + +export type PurchaseReceiptUncheckedCreateWithoutInventoryInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + supplierId: number + items?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput +} + +export type PurchaseReceiptCreateOrConnectWithoutInventoryInput = { + where: Prisma.PurchaseReceiptWhereUniqueInput + create: Prisma.XOR +} + +export type PurchaseReceiptCreateManyInventoryInputEnvelope = { + data: Prisma.PurchaseReceiptCreateManyInventoryInput | Prisma.PurchaseReceiptCreateManyInventoryInput[] + skipDuplicates?: boolean +} + +export type PurchaseReceiptUpsertWithWhereUniqueWithoutInventoryInput = { + where: Prisma.PurchaseReceiptWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PurchaseReceiptUpdateWithWhereUniqueWithoutInventoryInput = { + where: Prisma.PurchaseReceiptWhereUniqueInput + data: Prisma.XOR +} + +export type PurchaseReceiptUpdateManyWithWhereWithoutInventoryInput = { + where: Prisma.PurchaseReceiptScalarWhereInput + data: Prisma.XOR +} + +export type PurchaseReceiptCreateWithoutItemsInput = { + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + inventory: Prisma.InventoryCreateNestedOneWithoutPurchaseReceiptsInput + supplier: Prisma.SupplierCreateNestedOneWithoutPurchaseReceiptsInput +} + +export type PurchaseReceiptUncheckedCreateWithoutItemsInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + supplierId: number + inventoryId: number +} + +export type PurchaseReceiptCreateOrConnectWithoutItemsInput = { + where: Prisma.PurchaseReceiptWhereUniqueInput + create: Prisma.XOR +} + +export type PurchaseReceiptUpsertWithoutItemsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.PurchaseReceiptWhereInput +} + +export type PurchaseReceiptUpdateToOneWithWhereWithoutItemsInput = { + where?: Prisma.PurchaseReceiptWhereInput + data: Prisma.XOR +} + +export type PurchaseReceiptUpdateWithoutItemsInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutPurchaseReceiptsNestedInput +} + +export type PurchaseReceiptUncheckedUpdateWithoutItemsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + supplierId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PurchaseReceiptCreateManySupplierInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + inventoryId: number +} + +export type PurchaseReceiptUpdateWithoutSupplierInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput + inventory?: Prisma.InventoryUpdateOneRequiredWithoutPurchaseReceiptsNestedInput +} + +export type PurchaseReceiptUncheckedUpdateWithoutSupplierInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput +} + +export type PurchaseReceiptUncheckedUpdateManyWithoutSupplierInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PurchaseReceiptCreateManyInventoryInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + supplierId: number +} + +export type PurchaseReceiptUpdateWithoutInventoryInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + items?: Prisma.PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput + supplier?: Prisma.SupplierUpdateOneRequiredWithoutPurchaseReceiptsNestedInput +} + +export type PurchaseReceiptUncheckedUpdateWithoutInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + supplierId?: Prisma.IntFieldUpdateOperationsInput | number + items?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput +} + +export type PurchaseReceiptUncheckedUpdateManyWithoutInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + supplierId?: Prisma.IntFieldUpdateOperationsInput | number +} + + +/** + * Count Type PurchaseReceiptCountOutputType + */ + +export type PurchaseReceiptCountOutputType = { + items: number +} + +export type PurchaseReceiptCountOutputTypeSelect = { + items?: boolean | PurchaseReceiptCountOutputTypeCountItemsArgs +} + +/** + * PurchaseReceiptCountOutputType without action + */ +export type PurchaseReceiptCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptCountOutputType + */ + select?: Prisma.PurchaseReceiptCountOutputTypeSelect | null +} + +/** + * PurchaseReceiptCountOutputType without action + */ +export type PurchaseReceiptCountOutputTypeCountItemsArgs = { + where?: Prisma.PurchaseReceiptItemWhereInput +} + + +export type PurchaseReceiptSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + code?: boolean + totalAmount?: boolean + description?: boolean + createdAt?: boolean + updatedAt?: boolean + supplierId?: boolean + inventoryId?: boolean + items?: boolean | Prisma.PurchaseReceipt$itemsArgs + inventory?: boolean | Prisma.InventoryDefaultArgs + supplier?: boolean | Prisma.SupplierDefaultArgs + _count?: boolean | Prisma.PurchaseReceiptCountOutputTypeDefaultArgs +}, ExtArgs["result"]["purchaseReceipt"]> + + + +export type PurchaseReceiptSelectScalar = { + id?: boolean + code?: boolean + totalAmount?: boolean + description?: boolean + createdAt?: boolean + updatedAt?: boolean + supplierId?: boolean + inventoryId?: boolean +} + +export type PurchaseReceiptOmit = runtime.Types.Extensions.GetOmit<"id" | "code" | "totalAmount" | "description" | "createdAt" | "updatedAt" | "supplierId" | "inventoryId", ExtArgs["result"]["purchaseReceipt"]> +export type PurchaseReceiptInclude = { + items?: boolean | Prisma.PurchaseReceipt$itemsArgs + inventory?: boolean | Prisma.InventoryDefaultArgs + supplier?: boolean | Prisma.SupplierDefaultArgs + _count?: boolean | Prisma.PurchaseReceiptCountOutputTypeDefaultArgs +} + +export type $PurchaseReceiptPayload = { + name: "PurchaseReceipt" + objects: { + items: Prisma.$PurchaseReceiptItemPayload[] + inventory: Prisma.$InventoryPayload + supplier: Prisma.$SupplierPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + code: string + totalAmount: runtime.Decimal + description: string | null + createdAt: Date + updatedAt: Date + supplierId: number + inventoryId: number + }, ExtArgs["result"]["purchaseReceipt"]> + composites: {} +} + +export type PurchaseReceiptGetPayload = runtime.Types.Result.GetResult + +export type PurchaseReceiptCountArgs = + Omit & { + select?: PurchaseReceiptCountAggregateInputType | true + } + +export interface PurchaseReceiptDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['PurchaseReceipt'], meta: { name: 'PurchaseReceipt' } } + /** + * Find zero or one PurchaseReceipt that matches the filter. + * @param {PurchaseReceiptFindUniqueArgs} args - Arguments to find a PurchaseReceipt + * @example + * // Get one PurchaseReceipt + * const purchaseReceipt = await prisma.purchaseReceipt.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one PurchaseReceipt that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PurchaseReceiptFindUniqueOrThrowArgs} args - Arguments to find a PurchaseReceipt + * @example + * // Get one PurchaseReceipt + * const purchaseReceipt = await prisma.purchaseReceipt.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first PurchaseReceipt that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptFindFirstArgs} args - Arguments to find a PurchaseReceipt + * @example + * // Get one PurchaseReceipt + * const purchaseReceipt = await prisma.purchaseReceipt.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first PurchaseReceipt that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptFindFirstOrThrowArgs} args - Arguments to find a PurchaseReceipt + * @example + * // Get one PurchaseReceipt + * const purchaseReceipt = await prisma.purchaseReceipt.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more PurchaseReceipts that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all PurchaseReceipts + * const purchaseReceipts = await prisma.purchaseReceipt.findMany() + * + * // Get first 10 PurchaseReceipts + * const purchaseReceipts = await prisma.purchaseReceipt.findMany({ take: 10 }) + * + * // Only select the `id` + * const purchaseReceiptWithIdOnly = await prisma.purchaseReceipt.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a PurchaseReceipt. + * @param {PurchaseReceiptCreateArgs} args - Arguments to create a PurchaseReceipt. + * @example + * // Create one PurchaseReceipt + * const PurchaseReceipt = await prisma.purchaseReceipt.create({ + * data: { + * // ... data to create a PurchaseReceipt + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many PurchaseReceipts. + * @param {PurchaseReceiptCreateManyArgs} args - Arguments to create many PurchaseReceipts. + * @example + * // Create many PurchaseReceipts + * const purchaseReceipt = await prisma.purchaseReceipt.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a PurchaseReceipt. + * @param {PurchaseReceiptDeleteArgs} args - Arguments to delete one PurchaseReceipt. + * @example + * // Delete one PurchaseReceipt + * const PurchaseReceipt = await prisma.purchaseReceipt.delete({ + * where: { + * // ... filter to delete one PurchaseReceipt + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one PurchaseReceipt. + * @param {PurchaseReceiptUpdateArgs} args - Arguments to update one PurchaseReceipt. + * @example + * // Update one PurchaseReceipt + * const purchaseReceipt = await prisma.purchaseReceipt.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more PurchaseReceipts. + * @param {PurchaseReceiptDeleteManyArgs} args - Arguments to filter PurchaseReceipts to delete. + * @example + * // Delete a few PurchaseReceipts + * const { count } = await prisma.purchaseReceipt.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more PurchaseReceipts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many PurchaseReceipts + * const purchaseReceipt = await prisma.purchaseReceipt.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one PurchaseReceipt. + * @param {PurchaseReceiptUpsertArgs} args - Arguments to update or create a PurchaseReceipt. + * @example + * // Update or create a PurchaseReceipt + * const purchaseReceipt = await prisma.purchaseReceipt.upsert({ + * create: { + * // ... data to create a PurchaseReceipt + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the PurchaseReceipt we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of PurchaseReceipts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptCountArgs} args - Arguments to filter PurchaseReceipts to count. + * @example + * // Count the number of PurchaseReceipts + * const count = await prisma.purchaseReceipt.count({ + * where: { + * // ... the filter for the PurchaseReceipts we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a PurchaseReceipt. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by PurchaseReceipt. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends PurchaseReceiptGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: PurchaseReceiptGroupByArgs['orderBy'] } + : { orderBy?: PurchaseReceiptGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetPurchaseReceiptGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the PurchaseReceipt model + */ +readonly fields: PurchaseReceiptFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for PurchaseReceipt. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__PurchaseReceiptClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + items = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + inventory = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + supplier = {}>(args?: Prisma.Subset>): Prisma.Prisma__SupplierClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the PurchaseReceipt model + */ +export interface PurchaseReceiptFieldRefs { + readonly id: Prisma.FieldRef<"PurchaseReceipt", 'Int'> + readonly code: Prisma.FieldRef<"PurchaseReceipt", 'String'> + readonly totalAmount: Prisma.FieldRef<"PurchaseReceipt", 'Decimal'> + readonly description: Prisma.FieldRef<"PurchaseReceipt", 'String'> + readonly createdAt: Prisma.FieldRef<"PurchaseReceipt", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"PurchaseReceipt", 'DateTime'> + readonly supplierId: Prisma.FieldRef<"PurchaseReceipt", 'Int'> + readonly inventoryId: Prisma.FieldRef<"PurchaseReceipt", 'Int'> +} + + +// Custom InputTypes +/** + * PurchaseReceipt findUnique + */ +export type PurchaseReceiptFindUniqueArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + /** + * Filter, which PurchaseReceipt to fetch. + */ + where: Prisma.PurchaseReceiptWhereUniqueInput +} + +/** + * PurchaseReceipt findUniqueOrThrow + */ +export type PurchaseReceiptFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + /** + * Filter, which PurchaseReceipt to fetch. + */ + where: Prisma.PurchaseReceiptWhereUniqueInput +} + +/** + * PurchaseReceipt findFirst + */ +export type PurchaseReceiptFindFirstArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + /** + * Filter, which PurchaseReceipt to fetch. + */ + where?: Prisma.PurchaseReceiptWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PurchaseReceipts to fetch. + */ + orderBy?: Prisma.PurchaseReceiptOrderByWithRelationInput | Prisma.PurchaseReceiptOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for PurchaseReceipts. + */ + cursor?: Prisma.PurchaseReceiptWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PurchaseReceipts from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` PurchaseReceipts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of PurchaseReceipts. + */ + distinct?: Prisma.PurchaseReceiptScalarFieldEnum | Prisma.PurchaseReceiptScalarFieldEnum[] +} + +/** + * PurchaseReceipt findFirstOrThrow + */ +export type PurchaseReceiptFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + /** + * Filter, which PurchaseReceipt to fetch. + */ + where?: Prisma.PurchaseReceiptWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PurchaseReceipts to fetch. + */ + orderBy?: Prisma.PurchaseReceiptOrderByWithRelationInput | Prisma.PurchaseReceiptOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for PurchaseReceipts. + */ + cursor?: Prisma.PurchaseReceiptWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PurchaseReceipts from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` PurchaseReceipts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of PurchaseReceipts. + */ + distinct?: Prisma.PurchaseReceiptScalarFieldEnum | Prisma.PurchaseReceiptScalarFieldEnum[] +} + +/** + * PurchaseReceipt findMany + */ +export type PurchaseReceiptFindManyArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + /** + * Filter, which PurchaseReceipts to fetch. + */ + where?: Prisma.PurchaseReceiptWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PurchaseReceipts to fetch. + */ + orderBy?: Prisma.PurchaseReceiptOrderByWithRelationInput | Prisma.PurchaseReceiptOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing PurchaseReceipts. + */ + cursor?: Prisma.PurchaseReceiptWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PurchaseReceipts from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` PurchaseReceipts. + */ + skip?: number + distinct?: Prisma.PurchaseReceiptScalarFieldEnum | Prisma.PurchaseReceiptScalarFieldEnum[] +} + +/** + * PurchaseReceipt create + */ +export type PurchaseReceiptCreateArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + /** + * The data needed to create a PurchaseReceipt. + */ + data: Prisma.XOR +} + +/** + * PurchaseReceipt createMany + */ +export type PurchaseReceiptCreateManyArgs = { + /** + * The data used to create many PurchaseReceipts. + */ + data: Prisma.PurchaseReceiptCreateManyInput | Prisma.PurchaseReceiptCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * PurchaseReceipt update + */ +export type PurchaseReceiptUpdateArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + /** + * The data needed to update a PurchaseReceipt. + */ + data: Prisma.XOR + /** + * Choose, which PurchaseReceipt to update. + */ + where: Prisma.PurchaseReceiptWhereUniqueInput +} + +/** + * PurchaseReceipt updateMany + */ +export type PurchaseReceiptUpdateManyArgs = { + /** + * The data used to update PurchaseReceipts. + */ + data: Prisma.XOR + /** + * Filter which PurchaseReceipts to update + */ + where?: Prisma.PurchaseReceiptWhereInput + /** + * Limit how many PurchaseReceipts to update. + */ + limit?: number +} + +/** + * PurchaseReceipt upsert + */ +export type PurchaseReceiptUpsertArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + /** + * The filter to search for the PurchaseReceipt to update in case it exists. + */ + where: Prisma.PurchaseReceiptWhereUniqueInput + /** + * In case the PurchaseReceipt found by the `where` argument doesn't exist, create a new PurchaseReceipt with this data. + */ + create: Prisma.XOR + /** + * In case the PurchaseReceipt was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * PurchaseReceipt delete + */ +export type PurchaseReceiptDeleteArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + /** + * Filter which PurchaseReceipt to delete. + */ + where: Prisma.PurchaseReceiptWhereUniqueInput +} + +/** + * PurchaseReceipt deleteMany + */ +export type PurchaseReceiptDeleteManyArgs = { + /** + * Filter which PurchaseReceipts to delete + */ + where?: Prisma.PurchaseReceiptWhereInput + /** + * Limit how many PurchaseReceipts to delete. + */ + limit?: number +} + +/** + * PurchaseReceipt.items + */ +export type PurchaseReceipt$itemsArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + where?: Prisma.PurchaseReceiptItemWhereInput + orderBy?: Prisma.PurchaseReceiptItemOrderByWithRelationInput | Prisma.PurchaseReceiptItemOrderByWithRelationInput[] + cursor?: Prisma.PurchaseReceiptItemWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PurchaseReceiptItemScalarFieldEnum | Prisma.PurchaseReceiptItemScalarFieldEnum[] +} + +/** + * PurchaseReceipt without action + */ +export type PurchaseReceiptDefaultArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null +} diff --git a/src/generated/prisma/models/PurchaseReceiptItem.ts b/src/generated/prisma/models/PurchaseReceiptItem.ts new file mode 100644 index 0000000..0d26f65 --- /dev/null +++ b/src/generated/prisma/models/PurchaseReceiptItem.ts @@ -0,0 +1,1472 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `PurchaseReceiptItem` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model PurchaseReceiptItem + * + */ +export type PurchaseReceiptItemModel = runtime.Types.Result.DefaultSelection + +export type AggregatePurchaseReceiptItem = { + _count: PurchaseReceiptItemCountAggregateOutputType | null + _avg: PurchaseReceiptItemAvgAggregateOutputType | null + _sum: PurchaseReceiptItemSumAggregateOutputType | null + _min: PurchaseReceiptItemMinAggregateOutputType | null + _max: PurchaseReceiptItemMaxAggregateOutputType | null +} + +export type PurchaseReceiptItemAvgAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + total: runtime.Decimal | null + receiptId: number | null + productId: number | null +} + +export type PurchaseReceiptItemSumAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + total: runtime.Decimal | null + receiptId: number | null + productId: number | null +} + +export type PurchaseReceiptItemMinAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + total: runtime.Decimal | null + createdAt: Date | null + receiptId: number | null + productId: number | null +} + +export type PurchaseReceiptItemMaxAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + total: runtime.Decimal | null + createdAt: Date | null + receiptId: number | null + productId: number | null +} + +export type PurchaseReceiptItemCountAggregateOutputType = { + id: number + count: number + fee: number + total: number + createdAt: number + receiptId: number + productId: number + _all: number +} + + +export type PurchaseReceiptItemAvgAggregateInputType = { + id?: true + count?: true + fee?: true + total?: true + receiptId?: true + productId?: true +} + +export type PurchaseReceiptItemSumAggregateInputType = { + id?: true + count?: true + fee?: true + total?: true + receiptId?: true + productId?: true +} + +export type PurchaseReceiptItemMinAggregateInputType = { + id?: true + count?: true + fee?: true + total?: true + createdAt?: true + receiptId?: true + productId?: true +} + +export type PurchaseReceiptItemMaxAggregateInputType = { + id?: true + count?: true + fee?: true + total?: true + createdAt?: true + receiptId?: true + productId?: true +} + +export type PurchaseReceiptItemCountAggregateInputType = { + id?: true + count?: true + fee?: true + total?: true + createdAt?: true + receiptId?: true + productId?: true + _all?: true +} + +export type PurchaseReceiptItemAggregateArgs = { + /** + * Filter which PurchaseReceiptItem to aggregate. + */ + where?: Prisma.PurchaseReceiptItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PurchaseReceiptItems to fetch. + */ + orderBy?: Prisma.PurchaseReceiptItemOrderByWithRelationInput | Prisma.PurchaseReceiptItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.PurchaseReceiptItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PurchaseReceiptItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` PurchaseReceiptItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned PurchaseReceiptItems + **/ + _count?: true | PurchaseReceiptItemCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PurchaseReceiptItemAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PurchaseReceiptItemSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PurchaseReceiptItemMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PurchaseReceiptItemMaxAggregateInputType +} + +export type GetPurchaseReceiptItemAggregateType = { + [P in keyof T & keyof AggregatePurchaseReceiptItem]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type PurchaseReceiptItemGroupByArgs = { + where?: Prisma.PurchaseReceiptItemWhereInput + orderBy?: Prisma.PurchaseReceiptItemOrderByWithAggregationInput | Prisma.PurchaseReceiptItemOrderByWithAggregationInput[] + by: Prisma.PurchaseReceiptItemScalarFieldEnum[] | Prisma.PurchaseReceiptItemScalarFieldEnum + having?: Prisma.PurchaseReceiptItemScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PurchaseReceiptItemCountAggregateInputType | true + _avg?: PurchaseReceiptItemAvgAggregateInputType + _sum?: PurchaseReceiptItemSumAggregateInputType + _min?: PurchaseReceiptItemMinAggregateInputType + _max?: PurchaseReceiptItemMaxAggregateInputType +} + +export type PurchaseReceiptItemGroupByOutputType = { + id: number + count: runtime.Decimal + fee: runtime.Decimal + total: runtime.Decimal + createdAt: Date + receiptId: number + productId: number + _count: PurchaseReceiptItemCountAggregateOutputType | null + _avg: PurchaseReceiptItemAvgAggregateOutputType | null + _sum: PurchaseReceiptItemSumAggregateOutputType | null + _min: PurchaseReceiptItemMinAggregateOutputType | null + _max: PurchaseReceiptItemMaxAggregateOutputType | null +} + +type GetPurchaseReceiptItemGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof PurchaseReceiptItemGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type PurchaseReceiptItemWhereInput = { + AND?: Prisma.PurchaseReceiptItemWhereInput | Prisma.PurchaseReceiptItemWhereInput[] + OR?: Prisma.PurchaseReceiptItemWhereInput[] + NOT?: Prisma.PurchaseReceiptItemWhereInput | Prisma.PurchaseReceiptItemWhereInput[] + id?: Prisma.IntFilter<"PurchaseReceiptItem"> | number + count?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptItem"> | Date | string + receiptId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number + productId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number + product?: Prisma.XOR + receipt?: Prisma.XOR +} + +export type PurchaseReceiptItemOrderByWithRelationInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + receiptId?: Prisma.SortOrder + productId?: Prisma.SortOrder + product?: Prisma.ProductOrderByWithRelationInput + receipt?: Prisma.PurchaseReceiptOrderByWithRelationInput +} + +export type PurchaseReceiptItemWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.PurchaseReceiptItemWhereInput | Prisma.PurchaseReceiptItemWhereInput[] + OR?: Prisma.PurchaseReceiptItemWhereInput[] + NOT?: Prisma.PurchaseReceiptItemWhereInput | Prisma.PurchaseReceiptItemWhereInput[] + count?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptItem"> | Date | string + receiptId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number + productId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number + product?: Prisma.XOR + receipt?: Prisma.XOR +}, "id"> + +export type PurchaseReceiptItemOrderByWithAggregationInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + receiptId?: Prisma.SortOrder + productId?: Prisma.SortOrder + _count?: Prisma.PurchaseReceiptItemCountOrderByAggregateInput + _avg?: Prisma.PurchaseReceiptItemAvgOrderByAggregateInput + _max?: Prisma.PurchaseReceiptItemMaxOrderByAggregateInput + _min?: Prisma.PurchaseReceiptItemMinOrderByAggregateInput + _sum?: Prisma.PurchaseReceiptItemSumOrderByAggregateInput +} + +export type PurchaseReceiptItemScalarWhereWithAggregatesInput = { + AND?: Prisma.PurchaseReceiptItemScalarWhereWithAggregatesInput | Prisma.PurchaseReceiptItemScalarWhereWithAggregatesInput[] + OR?: Prisma.PurchaseReceiptItemScalarWhereWithAggregatesInput[] + NOT?: Prisma.PurchaseReceiptItemScalarWhereWithAggregatesInput | Prisma.PurchaseReceiptItemScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptItem"> | number + count?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"PurchaseReceiptItem"> | Date | string + receiptId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptItem"> | number + productId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptItem"> | number +} + +export type PurchaseReceiptItemCreateInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + product: Prisma.ProductCreateNestedOneWithoutPurchaseReceiptItemsInput + receipt: Prisma.PurchaseReceiptCreateNestedOneWithoutItemsInput +} + +export type PurchaseReceiptItemUncheckedCreateInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + receiptId: number + productId: number +} + +export type PurchaseReceiptItemUpdateInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + product?: Prisma.ProductUpdateOneRequiredWithoutPurchaseReceiptItemsNestedInput + receipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutItemsNestedInput +} + +export type PurchaseReceiptItemUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + receiptId?: Prisma.IntFieldUpdateOperationsInput | number + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PurchaseReceiptItemCreateManyInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + receiptId: number + productId: number +} + +export type PurchaseReceiptItemUpdateManyMutationInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type PurchaseReceiptItemUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + receiptId?: Prisma.IntFieldUpdateOperationsInput | number + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PurchaseReceiptItemListRelationFilter = { + every?: Prisma.PurchaseReceiptItemWhereInput + some?: Prisma.PurchaseReceiptItemWhereInput + none?: Prisma.PurchaseReceiptItemWhereInput +} + +export type PurchaseReceiptItemOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type PurchaseReceiptItemCountOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + receiptId?: Prisma.SortOrder + productId?: Prisma.SortOrder +} + +export type PurchaseReceiptItemAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + receiptId?: Prisma.SortOrder + productId?: Prisma.SortOrder +} + +export type PurchaseReceiptItemMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + receiptId?: Prisma.SortOrder + productId?: Prisma.SortOrder +} + +export type PurchaseReceiptItemMinOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + receiptId?: Prisma.SortOrder + productId?: Prisma.SortOrder +} + +export type PurchaseReceiptItemSumOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + receiptId?: Prisma.SortOrder + productId?: Prisma.SortOrder +} + +export type PurchaseReceiptItemCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptItemCreateWithoutProductInput[] | Prisma.PurchaseReceiptItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.PurchaseReceiptItemCreateOrConnectWithoutProductInput | Prisma.PurchaseReceiptItemCreateOrConnectWithoutProductInput[] + createMany?: Prisma.PurchaseReceiptItemCreateManyProductInputEnvelope + connect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] +} + +export type PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptItemCreateWithoutProductInput[] | Prisma.PurchaseReceiptItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.PurchaseReceiptItemCreateOrConnectWithoutProductInput | Prisma.PurchaseReceiptItemCreateOrConnectWithoutProductInput[] + createMany?: Prisma.PurchaseReceiptItemCreateManyProductInputEnvelope + connect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] +} + +export type PurchaseReceiptItemUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptItemCreateWithoutProductInput[] | Prisma.PurchaseReceiptItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.PurchaseReceiptItemCreateOrConnectWithoutProductInput | Prisma.PurchaseReceiptItemCreateOrConnectWithoutProductInput[] + upsert?: Prisma.PurchaseReceiptItemUpsertWithWhereUniqueWithoutProductInput | Prisma.PurchaseReceiptItemUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.PurchaseReceiptItemCreateManyProductInputEnvelope + set?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + disconnect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + delete?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + connect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + update?: Prisma.PurchaseReceiptItemUpdateWithWhereUniqueWithoutProductInput | Prisma.PurchaseReceiptItemUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.PurchaseReceiptItemUpdateManyWithWhereWithoutProductInput | Prisma.PurchaseReceiptItemUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.PurchaseReceiptItemScalarWhereInput | Prisma.PurchaseReceiptItemScalarWhereInput[] +} + +export type PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptItemCreateWithoutProductInput[] | Prisma.PurchaseReceiptItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.PurchaseReceiptItemCreateOrConnectWithoutProductInput | Prisma.PurchaseReceiptItemCreateOrConnectWithoutProductInput[] + upsert?: Prisma.PurchaseReceiptItemUpsertWithWhereUniqueWithoutProductInput | Prisma.PurchaseReceiptItemUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.PurchaseReceiptItemCreateManyProductInputEnvelope + set?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + disconnect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + delete?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + connect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + update?: Prisma.PurchaseReceiptItemUpdateWithWhereUniqueWithoutProductInput | Prisma.PurchaseReceiptItemUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.PurchaseReceiptItemUpdateManyWithWhereWithoutProductInput | Prisma.PurchaseReceiptItemUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.PurchaseReceiptItemScalarWhereInput | Prisma.PurchaseReceiptItemScalarWhereInput[] +} + +export type PurchaseReceiptItemCreateNestedManyWithoutReceiptInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptItemCreateWithoutReceiptInput[] | Prisma.PurchaseReceiptItemUncheckedCreateWithoutReceiptInput[] + connectOrCreate?: Prisma.PurchaseReceiptItemCreateOrConnectWithoutReceiptInput | Prisma.PurchaseReceiptItemCreateOrConnectWithoutReceiptInput[] + createMany?: Prisma.PurchaseReceiptItemCreateManyReceiptInputEnvelope + connect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] +} + +export type PurchaseReceiptItemUncheckedCreateNestedManyWithoutReceiptInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptItemCreateWithoutReceiptInput[] | Prisma.PurchaseReceiptItemUncheckedCreateWithoutReceiptInput[] + connectOrCreate?: Prisma.PurchaseReceiptItemCreateOrConnectWithoutReceiptInput | Prisma.PurchaseReceiptItemCreateOrConnectWithoutReceiptInput[] + createMany?: Prisma.PurchaseReceiptItemCreateManyReceiptInputEnvelope + connect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] +} + +export type PurchaseReceiptItemUpdateManyWithoutReceiptNestedInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptItemCreateWithoutReceiptInput[] | Prisma.PurchaseReceiptItemUncheckedCreateWithoutReceiptInput[] + connectOrCreate?: Prisma.PurchaseReceiptItemCreateOrConnectWithoutReceiptInput | Prisma.PurchaseReceiptItemCreateOrConnectWithoutReceiptInput[] + upsert?: Prisma.PurchaseReceiptItemUpsertWithWhereUniqueWithoutReceiptInput | Prisma.PurchaseReceiptItemUpsertWithWhereUniqueWithoutReceiptInput[] + createMany?: Prisma.PurchaseReceiptItemCreateManyReceiptInputEnvelope + set?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + disconnect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + delete?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + connect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + update?: Prisma.PurchaseReceiptItemUpdateWithWhereUniqueWithoutReceiptInput | Prisma.PurchaseReceiptItemUpdateWithWhereUniqueWithoutReceiptInput[] + updateMany?: Prisma.PurchaseReceiptItemUpdateManyWithWhereWithoutReceiptInput | Prisma.PurchaseReceiptItemUpdateManyWithWhereWithoutReceiptInput[] + deleteMany?: Prisma.PurchaseReceiptItemScalarWhereInput | Prisma.PurchaseReceiptItemScalarWhereInput[] +} + +export type PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput = { + create?: Prisma.XOR | Prisma.PurchaseReceiptItemCreateWithoutReceiptInput[] | Prisma.PurchaseReceiptItemUncheckedCreateWithoutReceiptInput[] + connectOrCreate?: Prisma.PurchaseReceiptItemCreateOrConnectWithoutReceiptInput | Prisma.PurchaseReceiptItemCreateOrConnectWithoutReceiptInput[] + upsert?: Prisma.PurchaseReceiptItemUpsertWithWhereUniqueWithoutReceiptInput | Prisma.PurchaseReceiptItemUpsertWithWhereUniqueWithoutReceiptInput[] + createMany?: Prisma.PurchaseReceiptItemCreateManyReceiptInputEnvelope + set?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + disconnect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + delete?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + connect?: Prisma.PurchaseReceiptItemWhereUniqueInput | Prisma.PurchaseReceiptItemWhereUniqueInput[] + update?: Prisma.PurchaseReceiptItemUpdateWithWhereUniqueWithoutReceiptInput | Prisma.PurchaseReceiptItemUpdateWithWhereUniqueWithoutReceiptInput[] + updateMany?: Prisma.PurchaseReceiptItemUpdateManyWithWhereWithoutReceiptInput | Prisma.PurchaseReceiptItemUpdateManyWithWhereWithoutReceiptInput[] + deleteMany?: Prisma.PurchaseReceiptItemScalarWhereInput | Prisma.PurchaseReceiptItemScalarWhereInput[] +} + +export type PurchaseReceiptItemCreateWithoutProductInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + receipt: Prisma.PurchaseReceiptCreateNestedOneWithoutItemsInput +} + +export type PurchaseReceiptItemUncheckedCreateWithoutProductInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + receiptId: number +} + +export type PurchaseReceiptItemCreateOrConnectWithoutProductInput = { + where: Prisma.PurchaseReceiptItemWhereUniqueInput + create: Prisma.XOR +} + +export type PurchaseReceiptItemCreateManyProductInputEnvelope = { + data: Prisma.PurchaseReceiptItemCreateManyProductInput | Prisma.PurchaseReceiptItemCreateManyProductInput[] + skipDuplicates?: boolean +} + +export type PurchaseReceiptItemUpsertWithWhereUniqueWithoutProductInput = { + where: Prisma.PurchaseReceiptItemWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PurchaseReceiptItemUpdateWithWhereUniqueWithoutProductInput = { + where: Prisma.PurchaseReceiptItemWhereUniqueInput + data: Prisma.XOR +} + +export type PurchaseReceiptItemUpdateManyWithWhereWithoutProductInput = { + where: Prisma.PurchaseReceiptItemScalarWhereInput + data: Prisma.XOR +} + +export type PurchaseReceiptItemScalarWhereInput = { + AND?: Prisma.PurchaseReceiptItemScalarWhereInput | Prisma.PurchaseReceiptItemScalarWhereInput[] + OR?: Prisma.PurchaseReceiptItemScalarWhereInput[] + NOT?: Prisma.PurchaseReceiptItemScalarWhereInput | Prisma.PurchaseReceiptItemScalarWhereInput[] + id?: Prisma.IntFilter<"PurchaseReceiptItem"> | number + count?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"PurchaseReceiptItem"> | Date | string + receiptId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number + productId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number +} + +export type PurchaseReceiptItemCreateWithoutReceiptInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + product: Prisma.ProductCreateNestedOneWithoutPurchaseReceiptItemsInput +} + +export type PurchaseReceiptItemUncheckedCreateWithoutReceiptInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + productId: number +} + +export type PurchaseReceiptItemCreateOrConnectWithoutReceiptInput = { + where: Prisma.PurchaseReceiptItemWhereUniqueInput + create: Prisma.XOR +} + +export type PurchaseReceiptItemCreateManyReceiptInputEnvelope = { + data: Prisma.PurchaseReceiptItemCreateManyReceiptInput | Prisma.PurchaseReceiptItemCreateManyReceiptInput[] + skipDuplicates?: boolean +} + +export type PurchaseReceiptItemUpsertWithWhereUniqueWithoutReceiptInput = { + where: Prisma.PurchaseReceiptItemWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PurchaseReceiptItemUpdateWithWhereUniqueWithoutReceiptInput = { + where: Prisma.PurchaseReceiptItemWhereUniqueInput + data: Prisma.XOR +} + +export type PurchaseReceiptItemUpdateManyWithWhereWithoutReceiptInput = { + where: Prisma.PurchaseReceiptItemScalarWhereInput + data: Prisma.XOR +} + +export type PurchaseReceiptItemCreateManyProductInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + receiptId: number +} + +export type PurchaseReceiptItemUpdateWithoutProductInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + receipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutItemsNestedInput +} + +export type PurchaseReceiptItemUncheckedUpdateWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + receiptId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PurchaseReceiptItemUncheckedUpdateManyWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + receiptId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PurchaseReceiptItemCreateManyReceiptInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + productId: number +} + +export type PurchaseReceiptItemUpdateWithoutReceiptInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + product?: Prisma.ProductUpdateOneRequiredWithoutPurchaseReceiptItemsNestedInput +} + +export type PurchaseReceiptItemUncheckedUpdateWithoutReceiptInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + + + +export type PurchaseReceiptItemSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + count?: boolean + fee?: boolean + total?: boolean + createdAt?: boolean + receiptId?: boolean + productId?: boolean + product?: boolean | Prisma.ProductDefaultArgs + receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs +}, ExtArgs["result"]["purchaseReceiptItem"]> + + + +export type PurchaseReceiptItemSelectScalar = { + id?: boolean + count?: boolean + fee?: boolean + total?: boolean + createdAt?: boolean + receiptId?: boolean + productId?: boolean +} + +export type PurchaseReceiptItemOmit = runtime.Types.Extensions.GetOmit<"id" | "count" | "fee" | "total" | "createdAt" | "receiptId" | "productId", ExtArgs["result"]["purchaseReceiptItem"]> +export type PurchaseReceiptItemInclude = { + product?: boolean | Prisma.ProductDefaultArgs + receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs +} + +export type $PurchaseReceiptItemPayload = { + name: "PurchaseReceiptItem" + objects: { + product: Prisma.$ProductPayload + receipt: Prisma.$PurchaseReceiptPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + count: runtime.Decimal + fee: runtime.Decimal + total: runtime.Decimal + createdAt: Date + receiptId: number + productId: number + }, ExtArgs["result"]["purchaseReceiptItem"]> + composites: {} +} + +export type PurchaseReceiptItemGetPayload = runtime.Types.Result.GetResult + +export type PurchaseReceiptItemCountArgs = + Omit & { + select?: PurchaseReceiptItemCountAggregateInputType | true + } + +export interface PurchaseReceiptItemDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['PurchaseReceiptItem'], meta: { name: 'PurchaseReceiptItem' } } + /** + * Find zero or one PurchaseReceiptItem that matches the filter. + * @param {PurchaseReceiptItemFindUniqueArgs} args - Arguments to find a PurchaseReceiptItem + * @example + * // Get one PurchaseReceiptItem + * const purchaseReceiptItem = await prisma.purchaseReceiptItem.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptItemClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one PurchaseReceiptItem that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PurchaseReceiptItemFindUniqueOrThrowArgs} args - Arguments to find a PurchaseReceiptItem + * @example + * // Get one PurchaseReceiptItem + * const purchaseReceiptItem = await prisma.purchaseReceiptItem.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptItemClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first PurchaseReceiptItem that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptItemFindFirstArgs} args - Arguments to find a PurchaseReceiptItem + * @example + * // Get one PurchaseReceiptItem + * const purchaseReceiptItem = await prisma.purchaseReceiptItem.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptItemClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first PurchaseReceiptItem that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptItemFindFirstOrThrowArgs} args - Arguments to find a PurchaseReceiptItem + * @example + * // Get one PurchaseReceiptItem + * const purchaseReceiptItem = await prisma.purchaseReceiptItem.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptItemClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more PurchaseReceiptItems that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptItemFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all PurchaseReceiptItems + * const purchaseReceiptItems = await prisma.purchaseReceiptItem.findMany() + * + * // Get first 10 PurchaseReceiptItems + * const purchaseReceiptItems = await prisma.purchaseReceiptItem.findMany({ take: 10 }) + * + * // Only select the `id` + * const purchaseReceiptItemWithIdOnly = await prisma.purchaseReceiptItem.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a PurchaseReceiptItem. + * @param {PurchaseReceiptItemCreateArgs} args - Arguments to create a PurchaseReceiptItem. + * @example + * // Create one PurchaseReceiptItem + * const PurchaseReceiptItem = await prisma.purchaseReceiptItem.create({ + * data: { + * // ... data to create a PurchaseReceiptItem + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptItemClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many PurchaseReceiptItems. + * @param {PurchaseReceiptItemCreateManyArgs} args - Arguments to create many PurchaseReceiptItems. + * @example + * // Create many PurchaseReceiptItems + * const purchaseReceiptItem = await prisma.purchaseReceiptItem.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a PurchaseReceiptItem. + * @param {PurchaseReceiptItemDeleteArgs} args - Arguments to delete one PurchaseReceiptItem. + * @example + * // Delete one PurchaseReceiptItem + * const PurchaseReceiptItem = await prisma.purchaseReceiptItem.delete({ + * where: { + * // ... filter to delete one PurchaseReceiptItem + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptItemClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one PurchaseReceiptItem. + * @param {PurchaseReceiptItemUpdateArgs} args - Arguments to update one PurchaseReceiptItem. + * @example + * // Update one PurchaseReceiptItem + * const purchaseReceiptItem = await prisma.purchaseReceiptItem.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptItemClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more PurchaseReceiptItems. + * @param {PurchaseReceiptItemDeleteManyArgs} args - Arguments to filter PurchaseReceiptItems to delete. + * @example + * // Delete a few PurchaseReceiptItems + * const { count } = await prisma.purchaseReceiptItem.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more PurchaseReceiptItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptItemUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many PurchaseReceiptItems + * const purchaseReceiptItem = await prisma.purchaseReceiptItem.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one PurchaseReceiptItem. + * @param {PurchaseReceiptItemUpsertArgs} args - Arguments to update or create a PurchaseReceiptItem. + * @example + * // Update or create a PurchaseReceiptItem + * const purchaseReceiptItem = await prisma.purchaseReceiptItem.upsert({ + * create: { + * // ... data to create a PurchaseReceiptItem + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the PurchaseReceiptItem we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__PurchaseReceiptItemClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of PurchaseReceiptItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptItemCountArgs} args - Arguments to filter PurchaseReceiptItems to count. + * @example + * // Count the number of PurchaseReceiptItems + * const count = await prisma.purchaseReceiptItem.count({ + * where: { + * // ... the filter for the PurchaseReceiptItems we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a PurchaseReceiptItem. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptItemAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by PurchaseReceiptItem. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PurchaseReceiptItemGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends PurchaseReceiptItemGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: PurchaseReceiptItemGroupByArgs['orderBy'] } + : { orderBy?: PurchaseReceiptItemGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetPurchaseReceiptItemGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the PurchaseReceiptItem model + */ +readonly fields: PurchaseReceiptItemFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for PurchaseReceiptItem. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__PurchaseReceiptItemClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + product = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProductClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + receipt = {}>(args?: Prisma.Subset>): Prisma.Prisma__PurchaseReceiptClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the PurchaseReceiptItem model + */ +export interface PurchaseReceiptItemFieldRefs { + readonly id: Prisma.FieldRef<"PurchaseReceiptItem", 'Int'> + readonly count: Prisma.FieldRef<"PurchaseReceiptItem", 'Decimal'> + readonly fee: Prisma.FieldRef<"PurchaseReceiptItem", 'Decimal'> + readonly total: Prisma.FieldRef<"PurchaseReceiptItem", 'Decimal'> + readonly createdAt: Prisma.FieldRef<"PurchaseReceiptItem", 'DateTime'> + readonly receiptId: Prisma.FieldRef<"PurchaseReceiptItem", 'Int'> + readonly productId: Prisma.FieldRef<"PurchaseReceiptItem", 'Int'> +} + + +// Custom InputTypes +/** + * PurchaseReceiptItem findUnique + */ +export type PurchaseReceiptItemFindUniqueArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + /** + * Filter, which PurchaseReceiptItem to fetch. + */ + where: Prisma.PurchaseReceiptItemWhereUniqueInput +} + +/** + * PurchaseReceiptItem findUniqueOrThrow + */ +export type PurchaseReceiptItemFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + /** + * Filter, which PurchaseReceiptItem to fetch. + */ + where: Prisma.PurchaseReceiptItemWhereUniqueInput +} + +/** + * PurchaseReceiptItem findFirst + */ +export type PurchaseReceiptItemFindFirstArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + /** + * Filter, which PurchaseReceiptItem to fetch. + */ + where?: Prisma.PurchaseReceiptItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PurchaseReceiptItems to fetch. + */ + orderBy?: Prisma.PurchaseReceiptItemOrderByWithRelationInput | Prisma.PurchaseReceiptItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for PurchaseReceiptItems. + */ + cursor?: Prisma.PurchaseReceiptItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PurchaseReceiptItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` PurchaseReceiptItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of PurchaseReceiptItems. + */ + distinct?: Prisma.PurchaseReceiptItemScalarFieldEnum | Prisma.PurchaseReceiptItemScalarFieldEnum[] +} + +/** + * PurchaseReceiptItem findFirstOrThrow + */ +export type PurchaseReceiptItemFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + /** + * Filter, which PurchaseReceiptItem to fetch. + */ + where?: Prisma.PurchaseReceiptItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PurchaseReceiptItems to fetch. + */ + orderBy?: Prisma.PurchaseReceiptItemOrderByWithRelationInput | Prisma.PurchaseReceiptItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for PurchaseReceiptItems. + */ + cursor?: Prisma.PurchaseReceiptItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PurchaseReceiptItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` PurchaseReceiptItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of PurchaseReceiptItems. + */ + distinct?: Prisma.PurchaseReceiptItemScalarFieldEnum | Prisma.PurchaseReceiptItemScalarFieldEnum[] +} + +/** + * PurchaseReceiptItem findMany + */ +export type PurchaseReceiptItemFindManyArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + /** + * Filter, which PurchaseReceiptItems to fetch. + */ + where?: Prisma.PurchaseReceiptItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of PurchaseReceiptItems to fetch. + */ + orderBy?: Prisma.PurchaseReceiptItemOrderByWithRelationInput | Prisma.PurchaseReceiptItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing PurchaseReceiptItems. + */ + cursor?: Prisma.PurchaseReceiptItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` PurchaseReceiptItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` PurchaseReceiptItems. + */ + skip?: number + distinct?: Prisma.PurchaseReceiptItemScalarFieldEnum | Prisma.PurchaseReceiptItemScalarFieldEnum[] +} + +/** + * PurchaseReceiptItem create + */ +export type PurchaseReceiptItemCreateArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + /** + * The data needed to create a PurchaseReceiptItem. + */ + data: Prisma.XOR +} + +/** + * PurchaseReceiptItem createMany + */ +export type PurchaseReceiptItemCreateManyArgs = { + /** + * The data used to create many PurchaseReceiptItems. + */ + data: Prisma.PurchaseReceiptItemCreateManyInput | Prisma.PurchaseReceiptItemCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * PurchaseReceiptItem update + */ +export type PurchaseReceiptItemUpdateArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + /** + * The data needed to update a PurchaseReceiptItem. + */ + data: Prisma.XOR + /** + * Choose, which PurchaseReceiptItem to update. + */ + where: Prisma.PurchaseReceiptItemWhereUniqueInput +} + +/** + * PurchaseReceiptItem updateMany + */ +export type PurchaseReceiptItemUpdateManyArgs = { + /** + * The data used to update PurchaseReceiptItems. + */ + data: Prisma.XOR + /** + * Filter which PurchaseReceiptItems to update + */ + where?: Prisma.PurchaseReceiptItemWhereInput + /** + * Limit how many PurchaseReceiptItems to update. + */ + limit?: number +} + +/** + * PurchaseReceiptItem upsert + */ +export type PurchaseReceiptItemUpsertArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + /** + * The filter to search for the PurchaseReceiptItem to update in case it exists. + */ + where: Prisma.PurchaseReceiptItemWhereUniqueInput + /** + * In case the PurchaseReceiptItem found by the `where` argument doesn't exist, create a new PurchaseReceiptItem with this data. + */ + create: Prisma.XOR + /** + * In case the PurchaseReceiptItem was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * PurchaseReceiptItem delete + */ +export type PurchaseReceiptItemDeleteArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null + /** + * Filter which PurchaseReceiptItem to delete. + */ + where: Prisma.PurchaseReceiptItemWhereUniqueInput +} + +/** + * PurchaseReceiptItem deleteMany + */ +export type PurchaseReceiptItemDeleteManyArgs = { + /** + * Filter which PurchaseReceiptItems to delete + */ + where?: Prisma.PurchaseReceiptItemWhereInput + /** + * Limit how many PurchaseReceiptItems to delete. + */ + limit?: number +} + +/** + * PurchaseReceiptItem without action + */ +export type PurchaseReceiptItemDefaultArgs = { + /** + * Select specific fields to fetch from the PurchaseReceiptItem + */ + select?: Prisma.PurchaseReceiptItemSelect | null + /** + * Omit specific fields from the PurchaseReceiptItem + */ + omit?: Prisma.PurchaseReceiptItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptItemInclude | null +} diff --git a/src/generated/prisma/models/Role.ts b/src/generated/prisma/models/Role.ts index be3c7ec..584c340 100644 --- a/src/generated/prisma/models/Role.ts +++ b/src/generated/prisma/models/Role.ts @@ -421,14 +421,6 @@ export type NullableStringFieldUpdateOperationsInput = { set?: string | null } -export type DateTimeFieldUpdateOperationsInput = { - set?: Date | string -} - -export type NullableDateTimeFieldUpdateOperationsInput = { - set?: Date | string | null -} - export type RoleCreateWithoutUsersInput = { name: string description?: string | null diff --git a/src/generated/prisma/models/SalesInvoice.ts b/src/generated/prisma/models/SalesInvoice.ts new file mode 100644 index 0000000..03d841e --- /dev/null +++ b/src/generated/prisma/models/SalesInvoice.ts @@ -0,0 +1,1497 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `SalesInvoice` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model SalesInvoice + * + */ +export type SalesInvoiceModel = runtime.Types.Result.DefaultSelection + +export type AggregateSalesInvoice = { + _count: SalesInvoiceCountAggregateOutputType | null + _avg: SalesInvoiceAvgAggregateOutputType | null + _sum: SalesInvoiceSumAggregateOutputType | null + _min: SalesInvoiceMinAggregateOutputType | null + _max: SalesInvoiceMaxAggregateOutputType | null +} + +export type SalesInvoiceAvgAggregateOutputType = { + id: number | null + totalAmount: runtime.Decimal | null + customerId: number | null +} + +export type SalesInvoiceSumAggregateOutputType = { + id: number | null + totalAmount: runtime.Decimal | null + customerId: number | null +} + +export type SalesInvoiceMinAggregateOutputType = { + id: number | null + code: string | null + totalAmount: runtime.Decimal | null + description: string | null + createdAt: Date | null + updatedAt: Date | null + customerId: number | null +} + +export type SalesInvoiceMaxAggregateOutputType = { + id: number | null + code: string | null + totalAmount: runtime.Decimal | null + description: string | null + createdAt: Date | null + updatedAt: Date | null + customerId: number | null +} + +export type SalesInvoiceCountAggregateOutputType = { + id: number + code: number + totalAmount: number + description: number + createdAt: number + updatedAt: number + customerId: number + _all: number +} + + +export type SalesInvoiceAvgAggregateInputType = { + id?: true + totalAmount?: true + customerId?: true +} + +export type SalesInvoiceSumAggregateInputType = { + id?: true + totalAmount?: true + customerId?: true +} + +export type SalesInvoiceMinAggregateInputType = { + id?: true + code?: true + totalAmount?: true + description?: true + createdAt?: true + updatedAt?: true + customerId?: true +} + +export type SalesInvoiceMaxAggregateInputType = { + id?: true + code?: true + totalAmount?: true + description?: true + createdAt?: true + updatedAt?: true + customerId?: true +} + +export type SalesInvoiceCountAggregateInputType = { + id?: true + code?: true + totalAmount?: true + description?: true + createdAt?: true + updatedAt?: true + customerId?: true + _all?: true +} + +export type SalesInvoiceAggregateArgs = { + /** + * Filter which SalesInvoice to aggregate. + */ + where?: Prisma.SalesInvoiceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SalesInvoices to fetch. + */ + orderBy?: Prisma.SalesInvoiceOrderByWithRelationInput | Prisma.SalesInvoiceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.SalesInvoiceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SalesInvoices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SalesInvoices. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned SalesInvoices + **/ + _count?: true | SalesInvoiceCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: SalesInvoiceAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: SalesInvoiceSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: SalesInvoiceMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: SalesInvoiceMaxAggregateInputType +} + +export type GetSalesInvoiceAggregateType = { + [P in keyof T & keyof AggregateSalesInvoice]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type SalesInvoiceGroupByArgs = { + where?: Prisma.SalesInvoiceWhereInput + orderBy?: Prisma.SalesInvoiceOrderByWithAggregationInput | Prisma.SalesInvoiceOrderByWithAggregationInput[] + by: Prisma.SalesInvoiceScalarFieldEnum[] | Prisma.SalesInvoiceScalarFieldEnum + having?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: SalesInvoiceCountAggregateInputType | true + _avg?: SalesInvoiceAvgAggregateInputType + _sum?: SalesInvoiceSumAggregateInputType + _min?: SalesInvoiceMinAggregateInputType + _max?: SalesInvoiceMaxAggregateInputType +} + +export type SalesInvoiceGroupByOutputType = { + id: number + code: string + totalAmount: runtime.Decimal + description: string | null + createdAt: Date + updatedAt: Date + customerId: number | null + _count: SalesInvoiceCountAggregateOutputType | null + _avg: SalesInvoiceAvgAggregateOutputType | null + _sum: SalesInvoiceSumAggregateOutputType | null + _min: SalesInvoiceMinAggregateOutputType | null + _max: SalesInvoiceMaxAggregateOutputType | null +} + +type GetSalesInvoiceGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof SalesInvoiceGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type SalesInvoiceWhereInput = { + AND?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[] + OR?: Prisma.SalesInvoiceWhereInput[] + NOT?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[] + id?: Prisma.IntFilter<"SalesInvoice"> | number + code?: Prisma.StringFilter<"SalesInvoice"> | string + totalAmount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null + createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null + items?: Prisma.SalesInvoiceItemListRelationFilter + customer?: Prisma.XOR | null +} + +export type SalesInvoiceOrderByWithRelationInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + customerId?: Prisma.SortOrderInput | Prisma.SortOrder + items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput + customer?: Prisma.CustomerOrderByWithRelationInput + _relevance?: Prisma.SalesInvoiceOrderByRelevanceInput +} + +export type SalesInvoiceWhereUniqueInput = Prisma.AtLeast<{ + id?: number + code?: string + AND?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[] + OR?: Prisma.SalesInvoiceWhereInput[] + NOT?: Prisma.SalesInvoiceWhereInput | Prisma.SalesInvoiceWhereInput[] + totalAmount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null + createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null + items?: Prisma.SalesInvoiceItemListRelationFilter + customer?: Prisma.XOR | null +}, "id" | "code"> + +export type SalesInvoiceOrderByWithAggregationInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + description?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + customerId?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.SalesInvoiceCountOrderByAggregateInput + _avg?: Prisma.SalesInvoiceAvgOrderByAggregateInput + _max?: Prisma.SalesInvoiceMaxOrderByAggregateInput + _min?: Prisma.SalesInvoiceMinOrderByAggregateInput + _sum?: Prisma.SalesInvoiceSumOrderByAggregateInput +} + +export type SalesInvoiceScalarWhereWithAggregatesInput = { + AND?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput | Prisma.SalesInvoiceScalarWhereWithAggregatesInput[] + OR?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput[] + NOT?: Prisma.SalesInvoiceScalarWhereWithAggregatesInput | Prisma.SalesInvoiceScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"SalesInvoice"> | number + code?: Prisma.StringWithAggregatesFilter<"SalesInvoice"> | string + totalAmount?: Prisma.DecimalWithAggregatesFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.StringNullableWithAggregatesFilter<"SalesInvoice"> | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoice"> | Date | string + customerId?: Prisma.IntNullableWithAggregatesFilter<"SalesInvoice"> | number | null +} + +export type SalesInvoiceCreateInput = { + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput + customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput +} + +export type SalesInvoiceUncheckedCreateInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + customerId?: number | null + items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput +} + +export type SalesInvoiceUpdateInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput + customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput +} + +export type SalesInvoiceUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null + items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput +} + +export type SalesInvoiceCreateManyInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + customerId?: number | null +} + +export type SalesInvoiceUpdateManyMutationInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type SalesInvoiceUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null +} + +export type SalesInvoiceListRelationFilter = { + every?: Prisma.SalesInvoiceWhereInput + some?: Prisma.SalesInvoiceWhereInput + none?: Prisma.SalesInvoiceWhereInput +} + +export type SalesInvoiceOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type SalesInvoiceOrderByRelevanceInput = { + fields: Prisma.SalesInvoiceOrderByRelevanceFieldEnum | Prisma.SalesInvoiceOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type SalesInvoiceCountOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + customerId?: Prisma.SortOrder +} + +export type SalesInvoiceAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + customerId?: Prisma.SortOrder +} + +export type SalesInvoiceMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + customerId?: Prisma.SortOrder +} + +export type SalesInvoiceMinOrderByAggregateInput = { + id?: Prisma.SortOrder + code?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + description?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + customerId?: Prisma.SortOrder +} + +export type SalesInvoiceSumOrderByAggregateInput = { + id?: Prisma.SortOrder + totalAmount?: Prisma.SortOrder + customerId?: Prisma.SortOrder +} + +export type SalesInvoiceScalarRelationFilter = { + is?: Prisma.SalesInvoiceWhereInput + isNot?: Prisma.SalesInvoiceWhereInput +} + +export type SalesInvoiceCreateNestedManyWithoutCustomerInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutCustomerInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutCustomerInput | Prisma.SalesInvoiceCreateOrConnectWithoutCustomerInput[] + createMany?: Prisma.SalesInvoiceCreateManyCustomerInputEnvelope + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] +} + +export type SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutCustomerInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutCustomerInput | Prisma.SalesInvoiceCreateOrConnectWithoutCustomerInput[] + createMany?: Prisma.SalesInvoiceCreateManyCustomerInputEnvelope + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] +} + +export type SalesInvoiceUpdateManyWithoutCustomerNestedInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutCustomerInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutCustomerInput | Prisma.SalesInvoiceCreateOrConnectWithoutCustomerInput[] + upsert?: Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutCustomerInput | Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: Prisma.SalesInvoiceCreateManyCustomerInputEnvelope + set?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + disconnect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + delete?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + update?: Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutCustomerInput | Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: Prisma.SalesInvoiceUpdateManyWithWhereWithoutCustomerInput | Prisma.SalesInvoiceUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] +} + +export type SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceCreateWithoutCustomerInput[] | Prisma.SalesInvoiceUncheckedCreateWithoutCustomerInput[] + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutCustomerInput | Prisma.SalesInvoiceCreateOrConnectWithoutCustomerInput[] + upsert?: Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutCustomerInput | Prisma.SalesInvoiceUpsertWithWhereUniqueWithoutCustomerInput[] + createMany?: Prisma.SalesInvoiceCreateManyCustomerInputEnvelope + set?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + disconnect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + delete?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + connect?: Prisma.SalesInvoiceWhereUniqueInput | Prisma.SalesInvoiceWhereUniqueInput[] + update?: Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutCustomerInput | Prisma.SalesInvoiceUpdateWithWhereUniqueWithoutCustomerInput[] + updateMany?: Prisma.SalesInvoiceUpdateManyWithWhereWithoutCustomerInput | Prisma.SalesInvoiceUpdateManyWithWhereWithoutCustomerInput[] + deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] +} + +export type SalesInvoiceCreateNestedOneWithoutItemsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutItemsInput + connect?: Prisma.SalesInvoiceWhereUniqueInput +} + +export type SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutItemsInput + upsert?: Prisma.SalesInvoiceUpsertWithoutItemsInput + connect?: Prisma.SalesInvoiceWhereUniqueInput + update?: Prisma.XOR, Prisma.SalesInvoiceUncheckedUpdateWithoutItemsInput> +} + +export type SalesInvoiceCreateWithoutCustomerInput = { + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput +} + +export type SalesInvoiceUncheckedCreateWithoutCustomerInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput +} + +export type SalesInvoiceCreateOrConnectWithoutCustomerInput = { + where: Prisma.SalesInvoiceWhereUniqueInput + create: Prisma.XOR +} + +export type SalesInvoiceCreateManyCustomerInputEnvelope = { + data: Prisma.SalesInvoiceCreateManyCustomerInput | Prisma.SalesInvoiceCreateManyCustomerInput[] + skipDuplicates?: boolean +} + +export type SalesInvoiceUpsertWithWhereUniqueWithoutCustomerInput = { + where: Prisma.SalesInvoiceWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type SalesInvoiceUpdateWithWhereUniqueWithoutCustomerInput = { + where: Prisma.SalesInvoiceWhereUniqueInput + data: Prisma.XOR +} + +export type SalesInvoiceUpdateManyWithWhereWithoutCustomerInput = { + where: Prisma.SalesInvoiceScalarWhereInput + data: Prisma.XOR +} + +export type SalesInvoiceScalarWhereInput = { + AND?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] + OR?: Prisma.SalesInvoiceScalarWhereInput[] + NOT?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[] + id?: Prisma.IntFilter<"SalesInvoice"> | number + code?: Prisma.StringFilter<"SalesInvoice"> | string + totalAmount?: Prisma.DecimalFilter<"SalesInvoice"> | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.StringNullableFilter<"SalesInvoice"> | string | null + createdAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string + customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null +} + +export type SalesInvoiceCreateWithoutItemsInput = { + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput +} + +export type SalesInvoiceUncheckedCreateWithoutItemsInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string + customerId?: number | null +} + +export type SalesInvoiceCreateOrConnectWithoutItemsInput = { + where: Prisma.SalesInvoiceWhereUniqueInput + create: Prisma.XOR +} + +export type SalesInvoiceUpsertWithoutItemsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.SalesInvoiceWhereInput +} + +export type SalesInvoiceUpdateToOneWithWhereWithoutItemsInput = { + where?: Prisma.SalesInvoiceWhereInput + data: Prisma.XOR +} + +export type SalesInvoiceUpdateWithoutItemsInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput +} + +export type SalesInvoiceUncheckedUpdateWithoutItemsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null +} + +export type SalesInvoiceCreateManyCustomerInput = { + id?: number + code: string + totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string + description?: string | null + createdAt?: Date | string + updatedAt?: Date | string +} + +export type SalesInvoiceUpdateWithoutCustomerInput = { + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput +} + +export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput +} + +export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + code?: Prisma.StringFieldUpdateOperationsInput | string + totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + + +/** + * Count Type SalesInvoiceCountOutputType + */ + +export type SalesInvoiceCountOutputType = { + items: number +} + +export type SalesInvoiceCountOutputTypeSelect = { + items?: boolean | SalesInvoiceCountOutputTypeCountItemsArgs +} + +/** + * SalesInvoiceCountOutputType without action + */ +export type SalesInvoiceCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceCountOutputType + */ + select?: Prisma.SalesInvoiceCountOutputTypeSelect | null +} + +/** + * SalesInvoiceCountOutputType without action + */ +export type SalesInvoiceCountOutputTypeCountItemsArgs = { + where?: Prisma.SalesInvoiceItemWhereInput +} + + +export type SalesInvoiceSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + code?: boolean + totalAmount?: boolean + description?: boolean + createdAt?: boolean + updatedAt?: boolean + customerId?: boolean + items?: boolean | Prisma.SalesInvoice$itemsArgs + customer?: boolean | Prisma.SalesInvoice$customerArgs + _count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs +}, ExtArgs["result"]["salesInvoice"]> + + + +export type SalesInvoiceSelectScalar = { + id?: boolean + code?: boolean + totalAmount?: boolean + description?: boolean + createdAt?: boolean + updatedAt?: boolean + customerId?: boolean +} + +export type SalesInvoiceOmit = runtime.Types.Extensions.GetOmit<"id" | "code" | "totalAmount" | "description" | "createdAt" | "updatedAt" | "customerId", ExtArgs["result"]["salesInvoice"]> +export type SalesInvoiceInclude = { + items?: boolean | Prisma.SalesInvoice$itemsArgs + customer?: boolean | Prisma.SalesInvoice$customerArgs + _count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs +} + +export type $SalesInvoicePayload = { + name: "SalesInvoice" + objects: { + items: Prisma.$SalesInvoiceItemPayload[] + customer: Prisma.$CustomerPayload | null + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + code: string + totalAmount: runtime.Decimal + description: string | null + createdAt: Date + updatedAt: Date + customerId: number | null + }, ExtArgs["result"]["salesInvoice"]> + composites: {} +} + +export type SalesInvoiceGetPayload = runtime.Types.Result.GetResult + +export type SalesInvoiceCountArgs = + Omit & { + select?: SalesInvoiceCountAggregateInputType | true + } + +export interface SalesInvoiceDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['SalesInvoice'], meta: { name: 'SalesInvoice' } } + /** + * Find zero or one SalesInvoice that matches the filter. + * @param {SalesInvoiceFindUniqueArgs} args - Arguments to find a SalesInvoice + * @example + * // Get one SalesInvoice + * const salesInvoice = await prisma.salesInvoice.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one SalesInvoice that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {SalesInvoiceFindUniqueOrThrowArgs} args - Arguments to find a SalesInvoice + * @example + * // Get one SalesInvoice + * const salesInvoice = await prisma.salesInvoice.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first SalesInvoice that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceFindFirstArgs} args - Arguments to find a SalesInvoice + * @example + * // Get one SalesInvoice + * const salesInvoice = await prisma.salesInvoice.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first SalesInvoice that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceFindFirstOrThrowArgs} args - Arguments to find a SalesInvoice + * @example + * // Get one SalesInvoice + * const salesInvoice = await prisma.salesInvoice.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more SalesInvoices that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all SalesInvoices + * const salesInvoices = await prisma.salesInvoice.findMany() + * + * // Get first 10 SalesInvoices + * const salesInvoices = await prisma.salesInvoice.findMany({ take: 10 }) + * + * // Only select the `id` + * const salesInvoiceWithIdOnly = await prisma.salesInvoice.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a SalesInvoice. + * @param {SalesInvoiceCreateArgs} args - Arguments to create a SalesInvoice. + * @example + * // Create one SalesInvoice + * const SalesInvoice = await prisma.salesInvoice.create({ + * data: { + * // ... data to create a SalesInvoice + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many SalesInvoices. + * @param {SalesInvoiceCreateManyArgs} args - Arguments to create many SalesInvoices. + * @example + * // Create many SalesInvoices + * const salesInvoice = await prisma.salesInvoice.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a SalesInvoice. + * @param {SalesInvoiceDeleteArgs} args - Arguments to delete one SalesInvoice. + * @example + * // Delete one SalesInvoice + * const SalesInvoice = await prisma.salesInvoice.delete({ + * where: { + * // ... filter to delete one SalesInvoice + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one SalesInvoice. + * @param {SalesInvoiceUpdateArgs} args - Arguments to update one SalesInvoice. + * @example + * // Update one SalesInvoice + * const salesInvoice = await prisma.salesInvoice.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more SalesInvoices. + * @param {SalesInvoiceDeleteManyArgs} args - Arguments to filter SalesInvoices to delete. + * @example + * // Delete a few SalesInvoices + * const { count } = await prisma.salesInvoice.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more SalesInvoices. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many SalesInvoices + * const salesInvoice = await prisma.salesInvoice.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one SalesInvoice. + * @param {SalesInvoiceUpsertArgs} args - Arguments to update or create a SalesInvoice. + * @example + * // Update or create a SalesInvoice + * const salesInvoice = await prisma.salesInvoice.upsert({ + * create: { + * // ... data to create a SalesInvoice + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the SalesInvoice we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of SalesInvoices. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceCountArgs} args - Arguments to filter SalesInvoices to count. + * @example + * // Count the number of SalesInvoices + * const count = await prisma.salesInvoice.count({ + * where: { + * // ... the filter for the SalesInvoices we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a SalesInvoice. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by SalesInvoice. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends SalesInvoiceGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: SalesInvoiceGroupByArgs['orderBy'] } + : { orderBy?: SalesInvoiceGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetSalesInvoiceGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the SalesInvoice model + */ +readonly fields: SalesInvoiceFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for SalesInvoice. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__SalesInvoiceClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + items = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + customer = {}>(args?: Prisma.Subset>): Prisma.Prisma__CustomerClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the SalesInvoice model + */ +export interface SalesInvoiceFieldRefs { + readonly id: Prisma.FieldRef<"SalesInvoice", 'Int'> + readonly code: Prisma.FieldRef<"SalesInvoice", 'String'> + readonly totalAmount: Prisma.FieldRef<"SalesInvoice", 'Decimal'> + readonly description: Prisma.FieldRef<"SalesInvoice", 'String'> + readonly createdAt: Prisma.FieldRef<"SalesInvoice", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"SalesInvoice", 'DateTime'> + readonly customerId: Prisma.FieldRef<"SalesInvoice", 'Int'> +} + + +// Custom InputTypes +/** + * SalesInvoice findUnique + */ +export type SalesInvoiceFindUniqueArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + /** + * Filter, which SalesInvoice to fetch. + */ + where: Prisma.SalesInvoiceWhereUniqueInput +} + +/** + * SalesInvoice findUniqueOrThrow + */ +export type SalesInvoiceFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + /** + * Filter, which SalesInvoice to fetch. + */ + where: Prisma.SalesInvoiceWhereUniqueInput +} + +/** + * SalesInvoice findFirst + */ +export type SalesInvoiceFindFirstArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + /** + * Filter, which SalesInvoice to fetch. + */ + where?: Prisma.SalesInvoiceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SalesInvoices to fetch. + */ + orderBy?: Prisma.SalesInvoiceOrderByWithRelationInput | Prisma.SalesInvoiceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for SalesInvoices. + */ + cursor?: Prisma.SalesInvoiceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SalesInvoices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SalesInvoices. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of SalesInvoices. + */ + distinct?: Prisma.SalesInvoiceScalarFieldEnum | Prisma.SalesInvoiceScalarFieldEnum[] +} + +/** + * SalesInvoice findFirstOrThrow + */ +export type SalesInvoiceFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + /** + * Filter, which SalesInvoice to fetch. + */ + where?: Prisma.SalesInvoiceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SalesInvoices to fetch. + */ + orderBy?: Prisma.SalesInvoiceOrderByWithRelationInput | Prisma.SalesInvoiceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for SalesInvoices. + */ + cursor?: Prisma.SalesInvoiceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SalesInvoices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SalesInvoices. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of SalesInvoices. + */ + distinct?: Prisma.SalesInvoiceScalarFieldEnum | Prisma.SalesInvoiceScalarFieldEnum[] +} + +/** + * SalesInvoice findMany + */ +export type SalesInvoiceFindManyArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + /** + * Filter, which SalesInvoices to fetch. + */ + where?: Prisma.SalesInvoiceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SalesInvoices to fetch. + */ + orderBy?: Prisma.SalesInvoiceOrderByWithRelationInput | Prisma.SalesInvoiceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing SalesInvoices. + */ + cursor?: Prisma.SalesInvoiceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SalesInvoices from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SalesInvoices. + */ + skip?: number + distinct?: Prisma.SalesInvoiceScalarFieldEnum | Prisma.SalesInvoiceScalarFieldEnum[] +} + +/** + * SalesInvoice create + */ +export type SalesInvoiceCreateArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + /** + * The data needed to create a SalesInvoice. + */ + data: Prisma.XOR +} + +/** + * SalesInvoice createMany + */ +export type SalesInvoiceCreateManyArgs = { + /** + * The data used to create many SalesInvoices. + */ + data: Prisma.SalesInvoiceCreateManyInput | Prisma.SalesInvoiceCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * SalesInvoice update + */ +export type SalesInvoiceUpdateArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + /** + * The data needed to update a SalesInvoice. + */ + data: Prisma.XOR + /** + * Choose, which SalesInvoice to update. + */ + where: Prisma.SalesInvoiceWhereUniqueInput +} + +/** + * SalesInvoice updateMany + */ +export type SalesInvoiceUpdateManyArgs = { + /** + * The data used to update SalesInvoices. + */ + data: Prisma.XOR + /** + * Filter which SalesInvoices to update + */ + where?: Prisma.SalesInvoiceWhereInput + /** + * Limit how many SalesInvoices to update. + */ + limit?: number +} + +/** + * SalesInvoice upsert + */ +export type SalesInvoiceUpsertArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + /** + * The filter to search for the SalesInvoice to update in case it exists. + */ + where: Prisma.SalesInvoiceWhereUniqueInput + /** + * In case the SalesInvoice found by the `where` argument doesn't exist, create a new SalesInvoice with this data. + */ + create: Prisma.XOR + /** + * In case the SalesInvoice was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * SalesInvoice delete + */ +export type SalesInvoiceDeleteArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null + /** + * Filter which SalesInvoice to delete. + */ + where: Prisma.SalesInvoiceWhereUniqueInput +} + +/** + * SalesInvoice deleteMany + */ +export type SalesInvoiceDeleteManyArgs = { + /** + * Filter which SalesInvoices to delete + */ + where?: Prisma.SalesInvoiceWhereInput + /** + * Limit how many SalesInvoices to delete. + */ + limit?: number +} + +/** + * SalesInvoice.items + */ +export type SalesInvoice$itemsArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + where?: Prisma.SalesInvoiceItemWhereInput + orderBy?: Prisma.SalesInvoiceItemOrderByWithRelationInput | Prisma.SalesInvoiceItemOrderByWithRelationInput[] + cursor?: Prisma.SalesInvoiceItemWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.SalesInvoiceItemScalarFieldEnum | Prisma.SalesInvoiceItemScalarFieldEnum[] +} + +/** + * SalesInvoice.customer + */ +export type SalesInvoice$customerArgs = { + /** + * Select specific fields to fetch from the Customer + */ + select?: Prisma.CustomerSelect | null + /** + * Omit specific fields from the Customer + */ + omit?: Prisma.CustomerOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.CustomerInclude | null + where?: Prisma.CustomerWhereInput +} + +/** + * SalesInvoice without action + */ +export type SalesInvoiceDefaultArgs = { + /** + * Select specific fields to fetch from the SalesInvoice + */ + select?: Prisma.SalesInvoiceSelect | null + /** + * Omit specific fields from the SalesInvoice + */ + omit?: Prisma.SalesInvoiceOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceInclude | null +} diff --git a/src/generated/prisma/models/SalesInvoiceItem.ts b/src/generated/prisma/models/SalesInvoiceItem.ts new file mode 100644 index 0000000..0e7a6ca --- /dev/null +++ b/src/generated/prisma/models/SalesInvoiceItem.ts @@ -0,0 +1,1472 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `SalesInvoiceItem` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model SalesInvoiceItem + * + */ +export type SalesInvoiceItemModel = runtime.Types.Result.DefaultSelection + +export type AggregateSalesInvoiceItem = { + _count: SalesInvoiceItemCountAggregateOutputType | null + _avg: SalesInvoiceItemAvgAggregateOutputType | null + _sum: SalesInvoiceItemSumAggregateOutputType | null + _min: SalesInvoiceItemMinAggregateOutputType | null + _max: SalesInvoiceItemMaxAggregateOutputType | null +} + +export type SalesInvoiceItemAvgAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + total: runtime.Decimal | null + invoiceId: number | null + productId: number | null +} + +export type SalesInvoiceItemSumAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + total: runtime.Decimal | null + invoiceId: number | null + productId: number | null +} + +export type SalesInvoiceItemMinAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + total: runtime.Decimal | null + createdAt: Date | null + invoiceId: number | null + productId: number | null +} + +export type SalesInvoiceItemMaxAggregateOutputType = { + id: number | null + count: runtime.Decimal | null + fee: runtime.Decimal | null + total: runtime.Decimal | null + createdAt: Date | null + invoiceId: number | null + productId: number | null +} + +export type SalesInvoiceItemCountAggregateOutputType = { + id: number + count: number + fee: number + total: number + createdAt: number + invoiceId: number + productId: number + _all: number +} + + +export type SalesInvoiceItemAvgAggregateInputType = { + id?: true + count?: true + fee?: true + total?: true + invoiceId?: true + productId?: true +} + +export type SalesInvoiceItemSumAggregateInputType = { + id?: true + count?: true + fee?: true + total?: true + invoiceId?: true + productId?: true +} + +export type SalesInvoiceItemMinAggregateInputType = { + id?: true + count?: true + fee?: true + total?: true + createdAt?: true + invoiceId?: true + productId?: true +} + +export type SalesInvoiceItemMaxAggregateInputType = { + id?: true + count?: true + fee?: true + total?: true + createdAt?: true + invoiceId?: true + productId?: true +} + +export type SalesInvoiceItemCountAggregateInputType = { + id?: true + count?: true + fee?: true + total?: true + createdAt?: true + invoiceId?: true + productId?: true + _all?: true +} + +export type SalesInvoiceItemAggregateArgs = { + /** + * Filter which SalesInvoiceItem to aggregate. + */ + where?: Prisma.SalesInvoiceItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SalesInvoiceItems to fetch. + */ + orderBy?: Prisma.SalesInvoiceItemOrderByWithRelationInput | Prisma.SalesInvoiceItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.SalesInvoiceItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SalesInvoiceItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SalesInvoiceItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned SalesInvoiceItems + **/ + _count?: true | SalesInvoiceItemCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: SalesInvoiceItemAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: SalesInvoiceItemSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: SalesInvoiceItemMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: SalesInvoiceItemMaxAggregateInputType +} + +export type GetSalesInvoiceItemAggregateType = { + [P in keyof T & keyof AggregateSalesInvoiceItem]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type SalesInvoiceItemGroupByArgs = { + where?: Prisma.SalesInvoiceItemWhereInput + orderBy?: Prisma.SalesInvoiceItemOrderByWithAggregationInput | Prisma.SalesInvoiceItemOrderByWithAggregationInput[] + by: Prisma.SalesInvoiceItemScalarFieldEnum[] | Prisma.SalesInvoiceItemScalarFieldEnum + having?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: SalesInvoiceItemCountAggregateInputType | true + _avg?: SalesInvoiceItemAvgAggregateInputType + _sum?: SalesInvoiceItemSumAggregateInputType + _min?: SalesInvoiceItemMinAggregateInputType + _max?: SalesInvoiceItemMaxAggregateInputType +} + +export type SalesInvoiceItemGroupByOutputType = { + id: number + count: runtime.Decimal + fee: runtime.Decimal + total: runtime.Decimal + createdAt: Date + invoiceId: number + productId: number + _count: SalesInvoiceItemCountAggregateOutputType | null + _avg: SalesInvoiceItemAvgAggregateOutputType | null + _sum: SalesInvoiceItemSumAggregateOutputType | null + _min: SalesInvoiceItemMinAggregateOutputType | null + _max: SalesInvoiceItemMaxAggregateOutputType | null +} + +type GetSalesInvoiceItemGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof SalesInvoiceItemGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type SalesInvoiceItemWhereInput = { + AND?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[] + OR?: Prisma.SalesInvoiceItemWhereInput[] + NOT?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[] + id?: Prisma.IntFilter<"SalesInvoiceItem"> | number + count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string + invoiceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number + productId?: Prisma.IntFilter<"SalesInvoiceItem"> | number + invoice?: Prisma.XOR + product?: Prisma.XOR +} + +export type SalesInvoiceItemOrderByWithRelationInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + invoiceId?: Prisma.SortOrder + productId?: Prisma.SortOrder + invoice?: Prisma.SalesInvoiceOrderByWithRelationInput + product?: Prisma.ProductOrderByWithRelationInput +} + +export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[] + OR?: Prisma.SalesInvoiceItemWhereInput[] + NOT?: Prisma.SalesInvoiceItemWhereInput | Prisma.SalesInvoiceItemWhereInput[] + count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string + invoiceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number + productId?: Prisma.IntFilter<"SalesInvoiceItem"> | number + invoice?: Prisma.XOR + product?: Prisma.XOR +}, "id"> + +export type SalesInvoiceItemOrderByWithAggregationInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + invoiceId?: Prisma.SortOrder + productId?: Prisma.SortOrder + _count?: Prisma.SalesInvoiceItemCountOrderByAggregateInput + _avg?: Prisma.SalesInvoiceItemAvgOrderByAggregateInput + _max?: Prisma.SalesInvoiceItemMaxOrderByAggregateInput + _min?: Prisma.SalesInvoiceItemMinOrderByAggregateInput + _sum?: Prisma.SalesInvoiceItemSumOrderByAggregateInput +} + +export type SalesInvoiceItemScalarWhereWithAggregatesInput = { + AND?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput | Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[] + OR?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[] + NOT?: Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput | Prisma.SalesInvoiceItemScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"SalesInvoiceItem"> | number + count?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"SalesInvoiceItem"> | Date | string + invoiceId?: Prisma.IntWithAggregatesFilter<"SalesInvoiceItem"> | number + productId?: Prisma.IntWithAggregatesFilter<"SalesInvoiceItem"> | number +} + +export type SalesInvoiceItemCreateInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput + product: Prisma.ProductCreateNestedOneWithoutSalesInvoiceItemsInput +} + +export type SalesInvoiceItemUncheckedCreateInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + invoiceId: number + productId: number +} + +export type SalesInvoiceItemUpdateInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput + product?: Prisma.ProductUpdateOneRequiredWithoutSalesInvoiceItemsNestedInput +} + +export type SalesInvoiceItemUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoiceId?: Prisma.IntFieldUpdateOperationsInput | number + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type SalesInvoiceItemCreateManyInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + invoiceId: number + productId: number +} + +export type SalesInvoiceItemUpdateManyMutationInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type SalesInvoiceItemUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoiceId?: Prisma.IntFieldUpdateOperationsInput | number + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type SalesInvoiceItemListRelationFilter = { + every?: Prisma.SalesInvoiceItemWhereInput + some?: Prisma.SalesInvoiceItemWhereInput + none?: Prisma.SalesInvoiceItemWhereInput +} + +export type SalesInvoiceItemOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type SalesInvoiceItemCountOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + invoiceId?: Prisma.SortOrder + productId?: Prisma.SortOrder +} + +export type SalesInvoiceItemAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + invoiceId?: Prisma.SortOrder + productId?: Prisma.SortOrder +} + +export type SalesInvoiceItemMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + invoiceId?: Prisma.SortOrder + productId?: Prisma.SortOrder +} + +export type SalesInvoiceItemMinOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + invoiceId?: Prisma.SortOrder + productId?: Prisma.SortOrder +} + +export type SalesInvoiceItemSumOrderByAggregateInput = { + id?: Prisma.SortOrder + count?: Prisma.SortOrder + fee?: Prisma.SortOrder + total?: Prisma.SortOrder + invoiceId?: Prisma.SortOrder + productId?: Prisma.SortOrder +} + +export type SalesInvoiceItemCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceItemCreateWithoutProductInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutProductInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutProductInput[] + createMany?: Prisma.SalesInvoiceItemCreateManyProductInputEnvelope + connect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] +} + +export type SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceItemCreateWithoutProductInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutProductInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutProductInput[] + createMany?: Prisma.SalesInvoiceItemCreateManyProductInputEnvelope + connect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] +} + +export type SalesInvoiceItemUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceItemCreateWithoutProductInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutProductInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutProductInput[] + upsert?: Prisma.SalesInvoiceItemUpsertWithWhereUniqueWithoutProductInput | Prisma.SalesInvoiceItemUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.SalesInvoiceItemCreateManyProductInputEnvelope + set?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + disconnect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + delete?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + connect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + update?: Prisma.SalesInvoiceItemUpdateWithWhereUniqueWithoutProductInput | Prisma.SalesInvoiceItemUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.SalesInvoiceItemUpdateManyWithWhereWithoutProductInput | Prisma.SalesInvoiceItemUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[] +} + +export type SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceItemCreateWithoutProductInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutProductInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutProductInput[] + upsert?: Prisma.SalesInvoiceItemUpsertWithWhereUniqueWithoutProductInput | Prisma.SalesInvoiceItemUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.SalesInvoiceItemCreateManyProductInputEnvelope + set?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + disconnect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + delete?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + connect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + update?: Prisma.SalesInvoiceItemUpdateWithWhereUniqueWithoutProductInput | Prisma.SalesInvoiceItemUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.SalesInvoiceItemUpdateManyWithWhereWithoutProductInput | Prisma.SalesInvoiceItemUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[] +} + +export type SalesInvoiceItemCreateNestedManyWithoutInvoiceInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceItemCreateWithoutInvoiceInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput[] + connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput[] + createMany?: Prisma.SalesInvoiceItemCreateManyInvoiceInputEnvelope + connect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] +} + +export type SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceItemCreateWithoutInvoiceInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput[] + connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput[] + createMany?: Prisma.SalesInvoiceItemCreateManyInvoiceInputEnvelope + connect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] +} + +export type SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceItemCreateWithoutInvoiceInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput[] + connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput[] + upsert?: Prisma.SalesInvoiceItemUpsertWithWhereUniqueWithoutInvoiceInput | Prisma.SalesInvoiceItemUpsertWithWhereUniqueWithoutInvoiceInput[] + createMany?: Prisma.SalesInvoiceItemCreateManyInvoiceInputEnvelope + set?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + disconnect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + delete?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + connect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + update?: Prisma.SalesInvoiceItemUpdateWithWhereUniqueWithoutInvoiceInput | Prisma.SalesInvoiceItemUpdateWithWhereUniqueWithoutInvoiceInput[] + updateMany?: Prisma.SalesInvoiceItemUpdateManyWithWhereWithoutInvoiceInput | Prisma.SalesInvoiceItemUpdateManyWithWhereWithoutInvoiceInput[] + deleteMany?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[] +} + +export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput = { + create?: Prisma.XOR | Prisma.SalesInvoiceItemCreateWithoutInvoiceInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput[] + connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput[] + upsert?: Prisma.SalesInvoiceItemUpsertWithWhereUniqueWithoutInvoiceInput | Prisma.SalesInvoiceItemUpsertWithWhereUniqueWithoutInvoiceInput[] + createMany?: Prisma.SalesInvoiceItemCreateManyInvoiceInputEnvelope + set?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + disconnect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + delete?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + connect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[] + update?: Prisma.SalesInvoiceItemUpdateWithWhereUniqueWithoutInvoiceInput | Prisma.SalesInvoiceItemUpdateWithWhereUniqueWithoutInvoiceInput[] + updateMany?: Prisma.SalesInvoiceItemUpdateManyWithWhereWithoutInvoiceInput | Prisma.SalesInvoiceItemUpdateManyWithWhereWithoutInvoiceInput[] + deleteMany?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[] +} + +export type SalesInvoiceItemCreateWithoutProductInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput +} + +export type SalesInvoiceItemUncheckedCreateWithoutProductInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + invoiceId: number +} + +export type SalesInvoiceItemCreateOrConnectWithoutProductInput = { + where: Prisma.SalesInvoiceItemWhereUniqueInput + create: Prisma.XOR +} + +export type SalesInvoiceItemCreateManyProductInputEnvelope = { + data: Prisma.SalesInvoiceItemCreateManyProductInput | Prisma.SalesInvoiceItemCreateManyProductInput[] + skipDuplicates?: boolean +} + +export type SalesInvoiceItemUpsertWithWhereUniqueWithoutProductInput = { + where: Prisma.SalesInvoiceItemWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type SalesInvoiceItemUpdateWithWhereUniqueWithoutProductInput = { + where: Prisma.SalesInvoiceItemWhereUniqueInput + data: Prisma.XOR +} + +export type SalesInvoiceItemUpdateManyWithWhereWithoutProductInput = { + where: Prisma.SalesInvoiceItemScalarWhereInput + data: Prisma.XOR +} + +export type SalesInvoiceItemScalarWhereInput = { + AND?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[] + OR?: Prisma.SalesInvoiceItemScalarWhereInput[] + NOT?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[] + id?: Prisma.IntFilter<"SalesInvoiceItem"> | number + count?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"SalesInvoiceItem"> | Date | string + invoiceId?: Prisma.IntFilter<"SalesInvoiceItem"> | number + productId?: Prisma.IntFilter<"SalesInvoiceItem"> | number +} + +export type SalesInvoiceItemCreateWithoutInvoiceInput = { + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + product: Prisma.ProductCreateNestedOneWithoutSalesInvoiceItemsInput +} + +export type SalesInvoiceItemUncheckedCreateWithoutInvoiceInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + productId: number +} + +export type SalesInvoiceItemCreateOrConnectWithoutInvoiceInput = { + where: Prisma.SalesInvoiceItemWhereUniqueInput + create: Prisma.XOR +} + +export type SalesInvoiceItemCreateManyInvoiceInputEnvelope = { + data: Prisma.SalesInvoiceItemCreateManyInvoiceInput | Prisma.SalesInvoiceItemCreateManyInvoiceInput[] + skipDuplicates?: boolean +} + +export type SalesInvoiceItemUpsertWithWhereUniqueWithoutInvoiceInput = { + where: Prisma.SalesInvoiceItemWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type SalesInvoiceItemUpdateWithWhereUniqueWithoutInvoiceInput = { + where: Prisma.SalesInvoiceItemWhereUniqueInput + data: Prisma.XOR +} + +export type SalesInvoiceItemUpdateManyWithWhereWithoutInvoiceInput = { + where: Prisma.SalesInvoiceItemScalarWhereInput + data: Prisma.XOR +} + +export type SalesInvoiceItemCreateManyProductInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + invoiceId: number +} + +export type SalesInvoiceItemUpdateWithoutProductInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput +} + +export type SalesInvoiceItemUncheckedUpdateWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoiceId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type SalesInvoiceItemUncheckedUpdateManyWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + invoiceId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type SalesInvoiceItemCreateManyInvoiceInput = { + id?: number + count: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + total: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + productId: number +} + +export type SalesInvoiceItemUpdateWithoutInvoiceInput = { + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + product?: Prisma.ProductUpdateOneRequiredWithoutSalesInvoiceItemsNestedInput +} + +export type SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + total?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + + + +export type SalesInvoiceItemSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + count?: boolean + fee?: boolean + total?: boolean + createdAt?: boolean + invoiceId?: boolean + productId?: boolean + invoice?: boolean | Prisma.SalesInvoiceDefaultArgs + product?: boolean | Prisma.ProductDefaultArgs +}, ExtArgs["result"]["salesInvoiceItem"]> + + + +export type SalesInvoiceItemSelectScalar = { + id?: boolean + count?: boolean + fee?: boolean + total?: boolean + createdAt?: boolean + invoiceId?: boolean + productId?: boolean +} + +export type SalesInvoiceItemOmit = runtime.Types.Extensions.GetOmit<"id" | "count" | "fee" | "total" | "createdAt" | "invoiceId" | "productId", ExtArgs["result"]["salesInvoiceItem"]> +export type SalesInvoiceItemInclude = { + invoice?: boolean | Prisma.SalesInvoiceDefaultArgs + product?: boolean | Prisma.ProductDefaultArgs +} + +export type $SalesInvoiceItemPayload = { + name: "SalesInvoiceItem" + objects: { + invoice: Prisma.$SalesInvoicePayload + product: Prisma.$ProductPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + count: runtime.Decimal + fee: runtime.Decimal + total: runtime.Decimal + createdAt: Date + invoiceId: number + productId: number + }, ExtArgs["result"]["salesInvoiceItem"]> + composites: {} +} + +export type SalesInvoiceItemGetPayload = runtime.Types.Result.GetResult + +export type SalesInvoiceItemCountArgs = + Omit & { + select?: SalesInvoiceItemCountAggregateInputType | true + } + +export interface SalesInvoiceItemDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['SalesInvoiceItem'], meta: { name: 'SalesInvoiceItem' } } + /** + * Find zero or one SalesInvoiceItem that matches the filter. + * @param {SalesInvoiceItemFindUniqueArgs} args - Arguments to find a SalesInvoiceItem + * @example + * // Get one SalesInvoiceItem + * const salesInvoiceItem = await prisma.salesInvoiceItem.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceItemClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one SalesInvoiceItem that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {SalesInvoiceItemFindUniqueOrThrowArgs} args - Arguments to find a SalesInvoiceItem + * @example + * // Get one SalesInvoiceItem + * const salesInvoiceItem = await prisma.salesInvoiceItem.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceItemClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first SalesInvoiceItem that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceItemFindFirstArgs} args - Arguments to find a SalesInvoiceItem + * @example + * // Get one SalesInvoiceItem + * const salesInvoiceItem = await prisma.salesInvoiceItem.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceItemClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first SalesInvoiceItem that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceItemFindFirstOrThrowArgs} args - Arguments to find a SalesInvoiceItem + * @example + * // Get one SalesInvoiceItem + * const salesInvoiceItem = await prisma.salesInvoiceItem.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceItemClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more SalesInvoiceItems that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceItemFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all SalesInvoiceItems + * const salesInvoiceItems = await prisma.salesInvoiceItem.findMany() + * + * // Get first 10 SalesInvoiceItems + * const salesInvoiceItems = await prisma.salesInvoiceItem.findMany({ take: 10 }) + * + * // Only select the `id` + * const salesInvoiceItemWithIdOnly = await prisma.salesInvoiceItem.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a SalesInvoiceItem. + * @param {SalesInvoiceItemCreateArgs} args - Arguments to create a SalesInvoiceItem. + * @example + * // Create one SalesInvoiceItem + * const SalesInvoiceItem = await prisma.salesInvoiceItem.create({ + * data: { + * // ... data to create a SalesInvoiceItem + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceItemClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many SalesInvoiceItems. + * @param {SalesInvoiceItemCreateManyArgs} args - Arguments to create many SalesInvoiceItems. + * @example + * // Create many SalesInvoiceItems + * const salesInvoiceItem = await prisma.salesInvoiceItem.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a SalesInvoiceItem. + * @param {SalesInvoiceItemDeleteArgs} args - Arguments to delete one SalesInvoiceItem. + * @example + * // Delete one SalesInvoiceItem + * const SalesInvoiceItem = await prisma.salesInvoiceItem.delete({ + * where: { + * // ... filter to delete one SalesInvoiceItem + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceItemClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one SalesInvoiceItem. + * @param {SalesInvoiceItemUpdateArgs} args - Arguments to update one SalesInvoiceItem. + * @example + * // Update one SalesInvoiceItem + * const salesInvoiceItem = await prisma.salesInvoiceItem.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceItemClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more SalesInvoiceItems. + * @param {SalesInvoiceItemDeleteManyArgs} args - Arguments to filter SalesInvoiceItems to delete. + * @example + * // Delete a few SalesInvoiceItems + * const { count } = await prisma.salesInvoiceItem.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more SalesInvoiceItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceItemUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many SalesInvoiceItems + * const salesInvoiceItem = await prisma.salesInvoiceItem.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one SalesInvoiceItem. + * @param {SalesInvoiceItemUpsertArgs} args - Arguments to update or create a SalesInvoiceItem. + * @example + * // Update or create a SalesInvoiceItem + * const salesInvoiceItem = await prisma.salesInvoiceItem.upsert({ + * create: { + * // ... data to create a SalesInvoiceItem + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the SalesInvoiceItem we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__SalesInvoiceItemClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of SalesInvoiceItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceItemCountArgs} args - Arguments to filter SalesInvoiceItems to count. + * @example + * // Count the number of SalesInvoiceItems + * const count = await prisma.salesInvoiceItem.count({ + * where: { + * // ... the filter for the SalesInvoiceItems we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a SalesInvoiceItem. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceItemAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by SalesInvoiceItem. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {SalesInvoiceItemGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends SalesInvoiceItemGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: SalesInvoiceItemGroupByArgs['orderBy'] } + : { orderBy?: SalesInvoiceItemGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetSalesInvoiceItemGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the SalesInvoiceItem model + */ +readonly fields: SalesInvoiceItemFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for SalesInvoiceItem. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__SalesInvoiceItemClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + invoice = {}>(args?: Prisma.Subset>): Prisma.Prisma__SalesInvoiceClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + product = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProductClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the SalesInvoiceItem model + */ +export interface SalesInvoiceItemFieldRefs { + readonly id: Prisma.FieldRef<"SalesInvoiceItem", 'Int'> + readonly count: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> + readonly fee: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> + readonly total: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'> + readonly createdAt: Prisma.FieldRef<"SalesInvoiceItem", 'DateTime'> + readonly invoiceId: Prisma.FieldRef<"SalesInvoiceItem", 'Int'> + readonly productId: Prisma.FieldRef<"SalesInvoiceItem", 'Int'> +} + + +// Custom InputTypes +/** + * SalesInvoiceItem findUnique + */ +export type SalesInvoiceItemFindUniqueArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + /** + * Filter, which SalesInvoiceItem to fetch. + */ + where: Prisma.SalesInvoiceItemWhereUniqueInput +} + +/** + * SalesInvoiceItem findUniqueOrThrow + */ +export type SalesInvoiceItemFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + /** + * Filter, which SalesInvoiceItem to fetch. + */ + where: Prisma.SalesInvoiceItemWhereUniqueInput +} + +/** + * SalesInvoiceItem findFirst + */ +export type SalesInvoiceItemFindFirstArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + /** + * Filter, which SalesInvoiceItem to fetch. + */ + where?: Prisma.SalesInvoiceItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SalesInvoiceItems to fetch. + */ + orderBy?: Prisma.SalesInvoiceItemOrderByWithRelationInput | Prisma.SalesInvoiceItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for SalesInvoiceItems. + */ + cursor?: Prisma.SalesInvoiceItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SalesInvoiceItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SalesInvoiceItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of SalesInvoiceItems. + */ + distinct?: Prisma.SalesInvoiceItemScalarFieldEnum | Prisma.SalesInvoiceItemScalarFieldEnum[] +} + +/** + * SalesInvoiceItem findFirstOrThrow + */ +export type SalesInvoiceItemFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + /** + * Filter, which SalesInvoiceItem to fetch. + */ + where?: Prisma.SalesInvoiceItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SalesInvoiceItems to fetch. + */ + orderBy?: Prisma.SalesInvoiceItemOrderByWithRelationInput | Prisma.SalesInvoiceItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for SalesInvoiceItems. + */ + cursor?: Prisma.SalesInvoiceItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SalesInvoiceItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SalesInvoiceItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of SalesInvoiceItems. + */ + distinct?: Prisma.SalesInvoiceItemScalarFieldEnum | Prisma.SalesInvoiceItemScalarFieldEnum[] +} + +/** + * SalesInvoiceItem findMany + */ +export type SalesInvoiceItemFindManyArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + /** + * Filter, which SalesInvoiceItems to fetch. + */ + where?: Prisma.SalesInvoiceItemWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of SalesInvoiceItems to fetch. + */ + orderBy?: Prisma.SalesInvoiceItemOrderByWithRelationInput | Prisma.SalesInvoiceItemOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing SalesInvoiceItems. + */ + cursor?: Prisma.SalesInvoiceItemWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` SalesInvoiceItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` SalesInvoiceItems. + */ + skip?: number + distinct?: Prisma.SalesInvoiceItemScalarFieldEnum | Prisma.SalesInvoiceItemScalarFieldEnum[] +} + +/** + * SalesInvoiceItem create + */ +export type SalesInvoiceItemCreateArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + /** + * The data needed to create a SalesInvoiceItem. + */ + data: Prisma.XOR +} + +/** + * SalesInvoiceItem createMany + */ +export type SalesInvoiceItemCreateManyArgs = { + /** + * The data used to create many SalesInvoiceItems. + */ + data: Prisma.SalesInvoiceItemCreateManyInput | Prisma.SalesInvoiceItemCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * SalesInvoiceItem update + */ +export type SalesInvoiceItemUpdateArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + /** + * The data needed to update a SalesInvoiceItem. + */ + data: Prisma.XOR + /** + * Choose, which SalesInvoiceItem to update. + */ + where: Prisma.SalesInvoiceItemWhereUniqueInput +} + +/** + * SalesInvoiceItem updateMany + */ +export type SalesInvoiceItemUpdateManyArgs = { + /** + * The data used to update SalesInvoiceItems. + */ + data: Prisma.XOR + /** + * Filter which SalesInvoiceItems to update + */ + where?: Prisma.SalesInvoiceItemWhereInput + /** + * Limit how many SalesInvoiceItems to update. + */ + limit?: number +} + +/** + * SalesInvoiceItem upsert + */ +export type SalesInvoiceItemUpsertArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + /** + * The filter to search for the SalesInvoiceItem to update in case it exists. + */ + where: Prisma.SalesInvoiceItemWhereUniqueInput + /** + * In case the SalesInvoiceItem found by the `where` argument doesn't exist, create a new SalesInvoiceItem with this data. + */ + create: Prisma.XOR + /** + * In case the SalesInvoiceItem was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * SalesInvoiceItem delete + */ +export type SalesInvoiceItemDeleteArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null + /** + * Filter which SalesInvoiceItem to delete. + */ + where: Prisma.SalesInvoiceItemWhereUniqueInput +} + +/** + * SalesInvoiceItem deleteMany + */ +export type SalesInvoiceItemDeleteManyArgs = { + /** + * Filter which SalesInvoiceItems to delete + */ + where?: Prisma.SalesInvoiceItemWhereInput + /** + * Limit how many SalesInvoiceItems to delete. + */ + limit?: number +} + +/** + * SalesInvoiceItem without action + */ +export type SalesInvoiceItemDefaultArgs = { + /** + * Select specific fields to fetch from the SalesInvoiceItem + */ + select?: Prisma.SalesInvoiceItemSelect | null + /** + * Omit specific fields from the SalesInvoiceItem + */ + omit?: Prisma.SalesInvoiceItemOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SalesInvoiceItemInclude | null +} diff --git a/src/generated/prisma/models/StockAdjustment.ts b/src/generated/prisma/models/StockAdjustment.ts new file mode 100644 index 0000000..1c88c58 --- /dev/null +++ b/src/generated/prisma/models/StockAdjustment.ts @@ -0,0 +1,1382 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `StockAdjustment` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model StockAdjustment + * + */ +export type StockAdjustmentModel = runtime.Types.Result.DefaultSelection + +export type AggregateStockAdjustment = { + _count: StockAdjustmentCountAggregateOutputType | null + _avg: StockAdjustmentAvgAggregateOutputType | null + _sum: StockAdjustmentSumAggregateOutputType | null + _min: StockAdjustmentMinAggregateOutputType | null + _max: StockAdjustmentMaxAggregateOutputType | null +} + +export type StockAdjustmentAvgAggregateOutputType = { + id: number | null + adjustedQuantity: runtime.Decimal | null + productId: number | null + inventoryId: number | null +} + +export type StockAdjustmentSumAggregateOutputType = { + id: number | null + adjustedQuantity: runtime.Decimal | null + productId: number | null + inventoryId: number | null +} + +export type StockAdjustmentMinAggregateOutputType = { + id: number | null + adjustedQuantity: runtime.Decimal | null + createdAt: Date | null + productId: number | null + inventoryId: number | null +} + +export type StockAdjustmentMaxAggregateOutputType = { + id: number | null + adjustedQuantity: runtime.Decimal | null + createdAt: Date | null + productId: number | null + inventoryId: number | null +} + +export type StockAdjustmentCountAggregateOutputType = { + id: number + adjustedQuantity: number + createdAt: number + productId: number + inventoryId: number + _all: number +} + + +export type StockAdjustmentAvgAggregateInputType = { + id?: true + adjustedQuantity?: true + productId?: true + inventoryId?: true +} + +export type StockAdjustmentSumAggregateInputType = { + id?: true + adjustedQuantity?: true + productId?: true + inventoryId?: true +} + +export type StockAdjustmentMinAggregateInputType = { + id?: true + adjustedQuantity?: true + createdAt?: true + productId?: true + inventoryId?: true +} + +export type StockAdjustmentMaxAggregateInputType = { + id?: true + adjustedQuantity?: true + createdAt?: true + productId?: true + inventoryId?: true +} + +export type StockAdjustmentCountAggregateInputType = { + id?: true + adjustedQuantity?: true + createdAt?: true + productId?: true + inventoryId?: true + _all?: true +} + +export type StockAdjustmentAggregateArgs = { + /** + * Filter which StockAdjustment to aggregate. + */ + where?: Prisma.StockAdjustmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockAdjustments to fetch. + */ + orderBy?: Prisma.StockAdjustmentOrderByWithRelationInput | Prisma.StockAdjustmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.StockAdjustmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockAdjustments from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockAdjustments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned StockAdjustments + **/ + _count?: true | StockAdjustmentCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: StockAdjustmentAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: StockAdjustmentSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: StockAdjustmentMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: StockAdjustmentMaxAggregateInputType +} + +export type GetStockAdjustmentAggregateType = { + [P in keyof T & keyof AggregateStockAdjustment]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type StockAdjustmentGroupByArgs = { + where?: Prisma.StockAdjustmentWhereInput + orderBy?: Prisma.StockAdjustmentOrderByWithAggregationInput | Prisma.StockAdjustmentOrderByWithAggregationInput[] + by: Prisma.StockAdjustmentScalarFieldEnum[] | Prisma.StockAdjustmentScalarFieldEnum + having?: Prisma.StockAdjustmentScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: StockAdjustmentCountAggregateInputType | true + _avg?: StockAdjustmentAvgAggregateInputType + _sum?: StockAdjustmentSumAggregateInputType + _min?: StockAdjustmentMinAggregateInputType + _max?: StockAdjustmentMaxAggregateInputType +} + +export type StockAdjustmentGroupByOutputType = { + id: number + adjustedQuantity: runtime.Decimal + createdAt: Date + productId: number + inventoryId: number + _count: StockAdjustmentCountAggregateOutputType | null + _avg: StockAdjustmentAvgAggregateOutputType | null + _sum: StockAdjustmentSumAggregateOutputType | null + _min: StockAdjustmentMinAggregateOutputType | null + _max: StockAdjustmentMaxAggregateOutputType | null +} + +type GetStockAdjustmentGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof StockAdjustmentGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type StockAdjustmentWhereInput = { + AND?: Prisma.StockAdjustmentWhereInput | Prisma.StockAdjustmentWhereInput[] + OR?: Prisma.StockAdjustmentWhereInput[] + NOT?: Prisma.StockAdjustmentWhereInput | Prisma.StockAdjustmentWhereInput[] + id?: Prisma.IntFilter<"StockAdjustment"> | number + adjustedQuantity?: Prisma.DecimalFilter<"StockAdjustment"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"StockAdjustment"> | Date | string + productId?: Prisma.IntFilter<"StockAdjustment"> | number + inventoryId?: Prisma.IntFilter<"StockAdjustment"> | number + inventory?: Prisma.XOR + product?: Prisma.XOR +} + +export type StockAdjustmentOrderByWithRelationInput = { + id?: Prisma.SortOrder + adjustedQuantity?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + inventory?: Prisma.InventoryOrderByWithRelationInput + product?: Prisma.ProductOrderByWithRelationInput +} + +export type StockAdjustmentWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.StockAdjustmentWhereInput | Prisma.StockAdjustmentWhereInput[] + OR?: Prisma.StockAdjustmentWhereInput[] + NOT?: Prisma.StockAdjustmentWhereInput | Prisma.StockAdjustmentWhereInput[] + adjustedQuantity?: Prisma.DecimalFilter<"StockAdjustment"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"StockAdjustment"> | Date | string + productId?: Prisma.IntFilter<"StockAdjustment"> | number + inventoryId?: Prisma.IntFilter<"StockAdjustment"> | number + inventory?: Prisma.XOR + product?: Prisma.XOR +}, "id"> + +export type StockAdjustmentOrderByWithAggregationInput = { + id?: Prisma.SortOrder + adjustedQuantity?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + _count?: Prisma.StockAdjustmentCountOrderByAggregateInput + _avg?: Prisma.StockAdjustmentAvgOrderByAggregateInput + _max?: Prisma.StockAdjustmentMaxOrderByAggregateInput + _min?: Prisma.StockAdjustmentMinOrderByAggregateInput + _sum?: Prisma.StockAdjustmentSumOrderByAggregateInput +} + +export type StockAdjustmentScalarWhereWithAggregatesInput = { + AND?: Prisma.StockAdjustmentScalarWhereWithAggregatesInput | Prisma.StockAdjustmentScalarWhereWithAggregatesInput[] + OR?: Prisma.StockAdjustmentScalarWhereWithAggregatesInput[] + NOT?: Prisma.StockAdjustmentScalarWhereWithAggregatesInput | Prisma.StockAdjustmentScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"StockAdjustment"> | number + adjustedQuantity?: Prisma.DecimalWithAggregatesFilter<"StockAdjustment"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"StockAdjustment"> | Date | string + productId?: Prisma.IntWithAggregatesFilter<"StockAdjustment"> | number + inventoryId?: Prisma.IntWithAggregatesFilter<"StockAdjustment"> | number +} + +export type StockAdjustmentCreateInput = { + adjustedQuantity: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + inventory: Prisma.InventoryCreateNestedOneWithoutStockAdjustmentsInput + product: Prisma.ProductCreateNestedOneWithoutStockAdjustmentsInput +} + +export type StockAdjustmentUncheckedCreateInput = { + id?: number + adjustedQuantity: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + productId: number + inventoryId: number +} + +export type StockAdjustmentUpdateInput = { + adjustedQuantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockAdjustmentsNestedInput + product?: Prisma.ProductUpdateOneRequiredWithoutStockAdjustmentsNestedInput +} + +export type StockAdjustmentUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + adjustedQuantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type StockAdjustmentCreateManyInput = { + id?: number + adjustedQuantity: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + productId: number + inventoryId: number +} + +export type StockAdjustmentUpdateManyMutationInput = { + adjustedQuantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type StockAdjustmentUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + adjustedQuantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type StockAdjustmentListRelationFilter = { + every?: Prisma.StockAdjustmentWhereInput + some?: Prisma.StockAdjustmentWhereInput + none?: Prisma.StockAdjustmentWhereInput +} + +export type StockAdjustmentOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type StockAdjustmentCountOrderByAggregateInput = { + id?: Prisma.SortOrder + adjustedQuantity?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder +} + +export type StockAdjustmentAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + adjustedQuantity?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder +} + +export type StockAdjustmentMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + adjustedQuantity?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder +} + +export type StockAdjustmentMinOrderByAggregateInput = { + id?: Prisma.SortOrder + adjustedQuantity?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder +} + +export type StockAdjustmentSumOrderByAggregateInput = { + id?: Prisma.SortOrder + adjustedQuantity?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder +} + +export type StockAdjustmentCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.StockAdjustmentCreateWithoutProductInput[] | Prisma.StockAdjustmentUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.StockAdjustmentCreateOrConnectWithoutProductInput | Prisma.StockAdjustmentCreateOrConnectWithoutProductInput[] + createMany?: Prisma.StockAdjustmentCreateManyProductInputEnvelope + connect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] +} + +export type StockAdjustmentUncheckedCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.StockAdjustmentCreateWithoutProductInput[] | Prisma.StockAdjustmentUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.StockAdjustmentCreateOrConnectWithoutProductInput | Prisma.StockAdjustmentCreateOrConnectWithoutProductInput[] + createMany?: Prisma.StockAdjustmentCreateManyProductInputEnvelope + connect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] +} + +export type StockAdjustmentUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.StockAdjustmentCreateWithoutProductInput[] | Prisma.StockAdjustmentUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.StockAdjustmentCreateOrConnectWithoutProductInput | Prisma.StockAdjustmentCreateOrConnectWithoutProductInput[] + upsert?: Prisma.StockAdjustmentUpsertWithWhereUniqueWithoutProductInput | Prisma.StockAdjustmentUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.StockAdjustmentCreateManyProductInputEnvelope + set?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + disconnect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + delete?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + connect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + update?: Prisma.StockAdjustmentUpdateWithWhereUniqueWithoutProductInput | Prisma.StockAdjustmentUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.StockAdjustmentUpdateManyWithWhereWithoutProductInput | Prisma.StockAdjustmentUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.StockAdjustmentScalarWhereInput | Prisma.StockAdjustmentScalarWhereInput[] +} + +export type StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.StockAdjustmentCreateWithoutProductInput[] | Prisma.StockAdjustmentUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.StockAdjustmentCreateOrConnectWithoutProductInput | Prisma.StockAdjustmentCreateOrConnectWithoutProductInput[] + upsert?: Prisma.StockAdjustmentUpsertWithWhereUniqueWithoutProductInput | Prisma.StockAdjustmentUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.StockAdjustmentCreateManyProductInputEnvelope + set?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + disconnect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + delete?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + connect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + update?: Prisma.StockAdjustmentUpdateWithWhereUniqueWithoutProductInput | Prisma.StockAdjustmentUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.StockAdjustmentUpdateManyWithWhereWithoutProductInput | Prisma.StockAdjustmentUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.StockAdjustmentScalarWhereInput | Prisma.StockAdjustmentScalarWhereInput[] +} + +export type StockAdjustmentCreateNestedManyWithoutInventoryInput = { + create?: Prisma.XOR | Prisma.StockAdjustmentCreateWithoutInventoryInput[] | Prisma.StockAdjustmentUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.StockAdjustmentCreateOrConnectWithoutInventoryInput | Prisma.StockAdjustmentCreateOrConnectWithoutInventoryInput[] + createMany?: Prisma.StockAdjustmentCreateManyInventoryInputEnvelope + connect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] +} + +export type StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput = { + create?: Prisma.XOR | Prisma.StockAdjustmentCreateWithoutInventoryInput[] | Prisma.StockAdjustmentUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.StockAdjustmentCreateOrConnectWithoutInventoryInput | Prisma.StockAdjustmentCreateOrConnectWithoutInventoryInput[] + createMany?: Prisma.StockAdjustmentCreateManyInventoryInputEnvelope + connect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] +} + +export type StockAdjustmentUpdateManyWithoutInventoryNestedInput = { + create?: Prisma.XOR | Prisma.StockAdjustmentCreateWithoutInventoryInput[] | Prisma.StockAdjustmentUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.StockAdjustmentCreateOrConnectWithoutInventoryInput | Prisma.StockAdjustmentCreateOrConnectWithoutInventoryInput[] + upsert?: Prisma.StockAdjustmentUpsertWithWhereUniqueWithoutInventoryInput | Prisma.StockAdjustmentUpsertWithWhereUniqueWithoutInventoryInput[] + createMany?: Prisma.StockAdjustmentCreateManyInventoryInputEnvelope + set?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + disconnect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + delete?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + connect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + update?: Prisma.StockAdjustmentUpdateWithWhereUniqueWithoutInventoryInput | Prisma.StockAdjustmentUpdateWithWhereUniqueWithoutInventoryInput[] + updateMany?: Prisma.StockAdjustmentUpdateManyWithWhereWithoutInventoryInput | Prisma.StockAdjustmentUpdateManyWithWhereWithoutInventoryInput[] + deleteMany?: Prisma.StockAdjustmentScalarWhereInput | Prisma.StockAdjustmentScalarWhereInput[] +} + +export type StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput = { + create?: Prisma.XOR | Prisma.StockAdjustmentCreateWithoutInventoryInput[] | Prisma.StockAdjustmentUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.StockAdjustmentCreateOrConnectWithoutInventoryInput | Prisma.StockAdjustmentCreateOrConnectWithoutInventoryInput[] + upsert?: Prisma.StockAdjustmentUpsertWithWhereUniqueWithoutInventoryInput | Prisma.StockAdjustmentUpsertWithWhereUniqueWithoutInventoryInput[] + createMany?: Prisma.StockAdjustmentCreateManyInventoryInputEnvelope + set?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + disconnect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + delete?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + connect?: Prisma.StockAdjustmentWhereUniqueInput | Prisma.StockAdjustmentWhereUniqueInput[] + update?: Prisma.StockAdjustmentUpdateWithWhereUniqueWithoutInventoryInput | Prisma.StockAdjustmentUpdateWithWhereUniqueWithoutInventoryInput[] + updateMany?: Prisma.StockAdjustmentUpdateManyWithWhereWithoutInventoryInput | Prisma.StockAdjustmentUpdateManyWithWhereWithoutInventoryInput[] + deleteMany?: Prisma.StockAdjustmentScalarWhereInput | Prisma.StockAdjustmentScalarWhereInput[] +} + +export type StockAdjustmentCreateWithoutProductInput = { + adjustedQuantity: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + inventory: Prisma.InventoryCreateNestedOneWithoutStockAdjustmentsInput +} + +export type StockAdjustmentUncheckedCreateWithoutProductInput = { + id?: number + adjustedQuantity: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + inventoryId: number +} + +export type StockAdjustmentCreateOrConnectWithoutProductInput = { + where: Prisma.StockAdjustmentWhereUniqueInput + create: Prisma.XOR +} + +export type StockAdjustmentCreateManyProductInputEnvelope = { + data: Prisma.StockAdjustmentCreateManyProductInput | Prisma.StockAdjustmentCreateManyProductInput[] + skipDuplicates?: boolean +} + +export type StockAdjustmentUpsertWithWhereUniqueWithoutProductInput = { + where: Prisma.StockAdjustmentWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type StockAdjustmentUpdateWithWhereUniqueWithoutProductInput = { + where: Prisma.StockAdjustmentWhereUniqueInput + data: Prisma.XOR +} + +export type StockAdjustmentUpdateManyWithWhereWithoutProductInput = { + where: Prisma.StockAdjustmentScalarWhereInput + data: Prisma.XOR +} + +export type StockAdjustmentScalarWhereInput = { + AND?: Prisma.StockAdjustmentScalarWhereInput | Prisma.StockAdjustmentScalarWhereInput[] + OR?: Prisma.StockAdjustmentScalarWhereInput[] + NOT?: Prisma.StockAdjustmentScalarWhereInput | Prisma.StockAdjustmentScalarWhereInput[] + id?: Prisma.IntFilter<"StockAdjustment"> | number + adjustedQuantity?: Prisma.DecimalFilter<"StockAdjustment"> | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFilter<"StockAdjustment"> | Date | string + productId?: Prisma.IntFilter<"StockAdjustment"> | number + inventoryId?: Prisma.IntFilter<"StockAdjustment"> | number +} + +export type StockAdjustmentCreateWithoutInventoryInput = { + adjustedQuantity: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + product: Prisma.ProductCreateNestedOneWithoutStockAdjustmentsInput +} + +export type StockAdjustmentUncheckedCreateWithoutInventoryInput = { + id?: number + adjustedQuantity: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + productId: number +} + +export type StockAdjustmentCreateOrConnectWithoutInventoryInput = { + where: Prisma.StockAdjustmentWhereUniqueInput + create: Prisma.XOR +} + +export type StockAdjustmentCreateManyInventoryInputEnvelope = { + data: Prisma.StockAdjustmentCreateManyInventoryInput | Prisma.StockAdjustmentCreateManyInventoryInput[] + skipDuplicates?: boolean +} + +export type StockAdjustmentUpsertWithWhereUniqueWithoutInventoryInput = { + where: Prisma.StockAdjustmentWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type StockAdjustmentUpdateWithWhereUniqueWithoutInventoryInput = { + where: Prisma.StockAdjustmentWhereUniqueInput + data: Prisma.XOR +} + +export type StockAdjustmentUpdateManyWithWhereWithoutInventoryInput = { + where: Prisma.StockAdjustmentScalarWhereInput + data: Prisma.XOR +} + +export type StockAdjustmentCreateManyProductInput = { + id?: number + adjustedQuantity: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + inventoryId: number +} + +export type StockAdjustmentUpdateWithoutProductInput = { + adjustedQuantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockAdjustmentsNestedInput +} + +export type StockAdjustmentUncheckedUpdateWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + adjustedQuantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type StockAdjustmentUncheckedUpdateManyWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + adjustedQuantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type StockAdjustmentCreateManyInventoryInput = { + id?: number + adjustedQuantity: runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Date | string + productId: number +} + +export type StockAdjustmentUpdateWithoutInventoryInput = { + adjustedQuantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + product?: Prisma.ProductUpdateOneRequiredWithoutStockAdjustmentsNestedInput +} + +export type StockAdjustmentUncheckedUpdateWithoutInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + adjustedQuantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type StockAdjustmentUncheckedUpdateManyWithoutInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + adjustedQuantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number +} + + + +export type StockAdjustmentSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + adjustedQuantity?: boolean + createdAt?: boolean + productId?: boolean + inventoryId?: boolean + inventory?: boolean | Prisma.InventoryDefaultArgs + product?: boolean | Prisma.ProductDefaultArgs +}, ExtArgs["result"]["stockAdjustment"]> + + + +export type StockAdjustmentSelectScalar = { + id?: boolean + adjustedQuantity?: boolean + createdAt?: boolean + productId?: boolean + inventoryId?: boolean +} + +export type StockAdjustmentOmit = runtime.Types.Extensions.GetOmit<"id" | "adjustedQuantity" | "createdAt" | "productId" | "inventoryId", ExtArgs["result"]["stockAdjustment"]> +export type StockAdjustmentInclude = { + inventory?: boolean | Prisma.InventoryDefaultArgs + product?: boolean | Prisma.ProductDefaultArgs +} + +export type $StockAdjustmentPayload = { + name: "StockAdjustment" + objects: { + inventory: Prisma.$InventoryPayload + product: Prisma.$ProductPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + adjustedQuantity: runtime.Decimal + createdAt: Date + productId: number + inventoryId: number + }, ExtArgs["result"]["stockAdjustment"]> + composites: {} +} + +export type StockAdjustmentGetPayload = runtime.Types.Result.GetResult + +export type StockAdjustmentCountArgs = + Omit & { + select?: StockAdjustmentCountAggregateInputType | true + } + +export interface StockAdjustmentDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['StockAdjustment'], meta: { name: 'StockAdjustment' } } + /** + * Find zero or one StockAdjustment that matches the filter. + * @param {StockAdjustmentFindUniqueArgs} args - Arguments to find a StockAdjustment + * @example + * // Get one StockAdjustment + * const stockAdjustment = await prisma.stockAdjustment.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__StockAdjustmentClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one StockAdjustment that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {StockAdjustmentFindUniqueOrThrowArgs} args - Arguments to find a StockAdjustment + * @example + * // Get one StockAdjustment + * const stockAdjustment = await prisma.stockAdjustment.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__StockAdjustmentClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first StockAdjustment that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockAdjustmentFindFirstArgs} args - Arguments to find a StockAdjustment + * @example + * // Get one StockAdjustment + * const stockAdjustment = await prisma.stockAdjustment.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__StockAdjustmentClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first StockAdjustment that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockAdjustmentFindFirstOrThrowArgs} args - Arguments to find a StockAdjustment + * @example + * // Get one StockAdjustment + * const stockAdjustment = await prisma.stockAdjustment.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__StockAdjustmentClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more StockAdjustments that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockAdjustmentFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all StockAdjustments + * const stockAdjustments = await prisma.stockAdjustment.findMany() + * + * // Get first 10 StockAdjustments + * const stockAdjustments = await prisma.stockAdjustment.findMany({ take: 10 }) + * + * // Only select the `id` + * const stockAdjustmentWithIdOnly = await prisma.stockAdjustment.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a StockAdjustment. + * @param {StockAdjustmentCreateArgs} args - Arguments to create a StockAdjustment. + * @example + * // Create one StockAdjustment + * const StockAdjustment = await prisma.stockAdjustment.create({ + * data: { + * // ... data to create a StockAdjustment + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__StockAdjustmentClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many StockAdjustments. + * @param {StockAdjustmentCreateManyArgs} args - Arguments to create many StockAdjustments. + * @example + * // Create many StockAdjustments + * const stockAdjustment = await prisma.stockAdjustment.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a StockAdjustment. + * @param {StockAdjustmentDeleteArgs} args - Arguments to delete one StockAdjustment. + * @example + * // Delete one StockAdjustment + * const StockAdjustment = await prisma.stockAdjustment.delete({ + * where: { + * // ... filter to delete one StockAdjustment + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__StockAdjustmentClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one StockAdjustment. + * @param {StockAdjustmentUpdateArgs} args - Arguments to update one StockAdjustment. + * @example + * // Update one StockAdjustment + * const stockAdjustment = await prisma.stockAdjustment.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__StockAdjustmentClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more StockAdjustments. + * @param {StockAdjustmentDeleteManyArgs} args - Arguments to filter StockAdjustments to delete. + * @example + * // Delete a few StockAdjustments + * const { count } = await prisma.stockAdjustment.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more StockAdjustments. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockAdjustmentUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many StockAdjustments + * const stockAdjustment = await prisma.stockAdjustment.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one StockAdjustment. + * @param {StockAdjustmentUpsertArgs} args - Arguments to update or create a StockAdjustment. + * @example + * // Update or create a StockAdjustment + * const stockAdjustment = await prisma.stockAdjustment.upsert({ + * create: { + * // ... data to create a StockAdjustment + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the StockAdjustment we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__StockAdjustmentClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of StockAdjustments. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockAdjustmentCountArgs} args - Arguments to filter StockAdjustments to count. + * @example + * // Count the number of StockAdjustments + * const count = await prisma.stockAdjustment.count({ + * where: { + * // ... the filter for the StockAdjustments we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a StockAdjustment. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockAdjustmentAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by StockAdjustment. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockAdjustmentGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends StockAdjustmentGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: StockAdjustmentGroupByArgs['orderBy'] } + : { orderBy?: StockAdjustmentGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetStockAdjustmentGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the StockAdjustment model + */ +readonly fields: StockAdjustmentFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for StockAdjustment. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__StockAdjustmentClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + inventory = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + product = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProductClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the StockAdjustment model + */ +export interface StockAdjustmentFieldRefs { + readonly id: Prisma.FieldRef<"StockAdjustment", 'Int'> + readonly adjustedQuantity: Prisma.FieldRef<"StockAdjustment", 'Decimal'> + readonly createdAt: Prisma.FieldRef<"StockAdjustment", 'DateTime'> + readonly productId: Prisma.FieldRef<"StockAdjustment", 'Int'> + readonly inventoryId: Prisma.FieldRef<"StockAdjustment", 'Int'> +} + + +// Custom InputTypes +/** + * StockAdjustment findUnique + */ +export type StockAdjustmentFindUniqueArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + /** + * Filter, which StockAdjustment to fetch. + */ + where: Prisma.StockAdjustmentWhereUniqueInput +} + +/** + * StockAdjustment findUniqueOrThrow + */ +export type StockAdjustmentFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + /** + * Filter, which StockAdjustment to fetch. + */ + where: Prisma.StockAdjustmentWhereUniqueInput +} + +/** + * StockAdjustment findFirst + */ +export type StockAdjustmentFindFirstArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + /** + * Filter, which StockAdjustment to fetch. + */ + where?: Prisma.StockAdjustmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockAdjustments to fetch. + */ + orderBy?: Prisma.StockAdjustmentOrderByWithRelationInput | Prisma.StockAdjustmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for StockAdjustments. + */ + cursor?: Prisma.StockAdjustmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockAdjustments from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockAdjustments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of StockAdjustments. + */ + distinct?: Prisma.StockAdjustmentScalarFieldEnum | Prisma.StockAdjustmentScalarFieldEnum[] +} + +/** + * StockAdjustment findFirstOrThrow + */ +export type StockAdjustmentFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + /** + * Filter, which StockAdjustment to fetch. + */ + where?: Prisma.StockAdjustmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockAdjustments to fetch. + */ + orderBy?: Prisma.StockAdjustmentOrderByWithRelationInput | Prisma.StockAdjustmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for StockAdjustments. + */ + cursor?: Prisma.StockAdjustmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockAdjustments from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockAdjustments. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of StockAdjustments. + */ + distinct?: Prisma.StockAdjustmentScalarFieldEnum | Prisma.StockAdjustmentScalarFieldEnum[] +} + +/** + * StockAdjustment findMany + */ +export type StockAdjustmentFindManyArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + /** + * Filter, which StockAdjustments to fetch. + */ + where?: Prisma.StockAdjustmentWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockAdjustments to fetch. + */ + orderBy?: Prisma.StockAdjustmentOrderByWithRelationInput | Prisma.StockAdjustmentOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing StockAdjustments. + */ + cursor?: Prisma.StockAdjustmentWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockAdjustments from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockAdjustments. + */ + skip?: number + distinct?: Prisma.StockAdjustmentScalarFieldEnum | Prisma.StockAdjustmentScalarFieldEnum[] +} + +/** + * StockAdjustment create + */ +export type StockAdjustmentCreateArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + /** + * The data needed to create a StockAdjustment. + */ + data: Prisma.XOR +} + +/** + * StockAdjustment createMany + */ +export type StockAdjustmentCreateManyArgs = { + /** + * The data used to create many StockAdjustments. + */ + data: Prisma.StockAdjustmentCreateManyInput | Prisma.StockAdjustmentCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * StockAdjustment update + */ +export type StockAdjustmentUpdateArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + /** + * The data needed to update a StockAdjustment. + */ + data: Prisma.XOR + /** + * Choose, which StockAdjustment to update. + */ + where: Prisma.StockAdjustmentWhereUniqueInput +} + +/** + * StockAdjustment updateMany + */ +export type StockAdjustmentUpdateManyArgs = { + /** + * The data used to update StockAdjustments. + */ + data: Prisma.XOR + /** + * Filter which StockAdjustments to update + */ + where?: Prisma.StockAdjustmentWhereInput + /** + * Limit how many StockAdjustments to update. + */ + limit?: number +} + +/** + * StockAdjustment upsert + */ +export type StockAdjustmentUpsertArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + /** + * The filter to search for the StockAdjustment to update in case it exists. + */ + where: Prisma.StockAdjustmentWhereUniqueInput + /** + * In case the StockAdjustment found by the `where` argument doesn't exist, create a new StockAdjustment with this data. + */ + create: Prisma.XOR + /** + * In case the StockAdjustment was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * StockAdjustment delete + */ +export type StockAdjustmentDeleteArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null + /** + * Filter which StockAdjustment to delete. + */ + where: Prisma.StockAdjustmentWhereUniqueInput +} + +/** + * StockAdjustment deleteMany + */ +export type StockAdjustmentDeleteManyArgs = { + /** + * Filter which StockAdjustments to delete + */ + where?: Prisma.StockAdjustmentWhereInput + /** + * Limit how many StockAdjustments to delete. + */ + limit?: number +} + +/** + * StockAdjustment without action + */ +export type StockAdjustmentDefaultArgs = { + /** + * Select specific fields to fetch from the StockAdjustment + */ + select?: Prisma.StockAdjustmentSelect | null + /** + * Omit specific fields from the StockAdjustment + */ + omit?: Prisma.StockAdjustmentOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockAdjustmentInclude | null +} diff --git a/src/generated/prisma/models/StockBalance.ts b/src/generated/prisma/models/StockBalance.ts new file mode 100644 index 0000000..1d8ef4c --- /dev/null +++ b/src/generated/prisma/models/StockBalance.ts @@ -0,0 +1,1093 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `StockBalance` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model StockBalance + * + */ +export type StockBalanceModel = runtime.Types.Result.DefaultSelection + +export type AggregateStockBalance = { + _count: StockBalanceCountAggregateOutputType | null + _avg: StockBalanceAvgAggregateOutputType | null + _sum: StockBalanceSumAggregateOutputType | null + _min: StockBalanceMinAggregateOutputType | null + _max: StockBalanceMaxAggregateOutputType | null +} + +export type StockBalanceAvgAggregateOutputType = { + quantity: runtime.Decimal | null + totalCost: runtime.Decimal | null + ProductId: number | null + avgCost: runtime.Decimal | null +} + +export type StockBalanceSumAggregateOutputType = { + quantity: runtime.Decimal | null + totalCost: runtime.Decimal | null + ProductId: number | null + avgCost: runtime.Decimal | null +} + +export type StockBalanceMinAggregateOutputType = { + quantity: runtime.Decimal | null + totalCost: runtime.Decimal | null + updatedAt: Date | null + ProductId: number | null + avgCost: runtime.Decimal | null +} + +export type StockBalanceMaxAggregateOutputType = { + quantity: runtime.Decimal | null + totalCost: runtime.Decimal | null + updatedAt: Date | null + ProductId: number | null + avgCost: runtime.Decimal | null +} + +export type StockBalanceCountAggregateOutputType = { + quantity: number + totalCost: number + updatedAt: number + ProductId: number + avgCost: number + _all: number +} + + +export type StockBalanceAvgAggregateInputType = { + quantity?: true + totalCost?: true + ProductId?: true + avgCost?: true +} + +export type StockBalanceSumAggregateInputType = { + quantity?: true + totalCost?: true + ProductId?: true + avgCost?: true +} + +export type StockBalanceMinAggregateInputType = { + quantity?: true + totalCost?: true + updatedAt?: true + ProductId?: true + avgCost?: true +} + +export type StockBalanceMaxAggregateInputType = { + quantity?: true + totalCost?: true + updatedAt?: true + ProductId?: true + avgCost?: true +} + +export type StockBalanceCountAggregateInputType = { + quantity?: true + totalCost?: true + updatedAt?: true + ProductId?: true + avgCost?: true + _all?: true +} + +export type StockBalanceAggregateArgs = { + /** + * Filter which StockBalance to aggregate. + */ + where?: Prisma.StockBalanceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockBalances to fetch. + */ + orderBy?: Prisma.StockBalanceOrderByWithRelationInput | Prisma.StockBalanceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.StockBalanceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockBalances from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockBalances. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned StockBalances + **/ + _count?: true | StockBalanceCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: StockBalanceAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: StockBalanceSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: StockBalanceMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: StockBalanceMaxAggregateInputType +} + +export type GetStockBalanceAggregateType = { + [P in keyof T & keyof AggregateStockBalance]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type StockBalanceGroupByArgs = { + where?: Prisma.StockBalanceWhereInput + orderBy?: Prisma.StockBalanceOrderByWithAggregationInput | Prisma.StockBalanceOrderByWithAggregationInput[] + by: Prisma.StockBalanceScalarFieldEnum[] | Prisma.StockBalanceScalarFieldEnum + having?: Prisma.StockBalanceScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: StockBalanceCountAggregateInputType | true + _avg?: StockBalanceAvgAggregateInputType + _sum?: StockBalanceSumAggregateInputType + _min?: StockBalanceMinAggregateInputType + _max?: StockBalanceMaxAggregateInputType +} + +export type StockBalanceGroupByOutputType = { + quantity: runtime.Decimal + totalCost: runtime.Decimal + updatedAt: Date + ProductId: number + avgCost: runtime.Decimal + _count: StockBalanceCountAggregateOutputType | null + _avg: StockBalanceAvgAggregateOutputType | null + _sum: StockBalanceSumAggregateOutputType | null + _min: StockBalanceMinAggregateOutputType | null + _max: StockBalanceMaxAggregateOutputType | null +} + +type GetStockBalanceGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof StockBalanceGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type StockBalanceWhereInput = { + AND?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[] + OR?: Prisma.StockBalanceWhereInput[] + NOT?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[] + quantity?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Prisma.DateTimeFilter<"StockBalance"> | Date | string + ProductId?: Prisma.IntFilter<"StockBalance"> | number + avgCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockBalanceOrderByWithRelationInput = { + quantity?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + ProductId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + +export type StockBalanceWhereUniqueInput = Prisma.AtLeast<{ + ProductId?: number + AND?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[] + OR?: Prisma.StockBalanceWhereInput[] + NOT?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[] + quantity?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Prisma.DateTimeFilter<"StockBalance"> | Date | string + avgCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string +}, "ProductId"> + +export type StockBalanceOrderByWithAggregationInput = { + quantity?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + ProductId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder + _count?: Prisma.StockBalanceCountOrderByAggregateInput + _avg?: Prisma.StockBalanceAvgOrderByAggregateInput + _max?: Prisma.StockBalanceMaxOrderByAggregateInput + _min?: Prisma.StockBalanceMinOrderByAggregateInput + _sum?: Prisma.StockBalanceSumOrderByAggregateInput +} + +export type StockBalanceScalarWhereWithAggregatesInput = { + AND?: Prisma.StockBalanceScalarWhereWithAggregatesInput | Prisma.StockBalanceScalarWhereWithAggregatesInput[] + OR?: Prisma.StockBalanceScalarWhereWithAggregatesInput[] + NOT?: Prisma.StockBalanceScalarWhereWithAggregatesInput | Prisma.StockBalanceScalarWhereWithAggregatesInput[] + quantity?: Prisma.DecimalWithAggregatesFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalWithAggregatesFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"StockBalance"> | Date | string + ProductId?: Prisma.IntWithAggregatesFilter<"StockBalance"> | number + avgCost?: Prisma.DecimalWithAggregatesFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockBalanceCreateInput = { + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Date | string + ProductId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockBalanceUncheckedCreateInput = { + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Date | string + ProductId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockBalanceUpdateInput = { + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + ProductId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockBalanceUncheckedUpdateInput = { + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + ProductId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockBalanceCreateManyInput = { + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Date | string + ProductId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockBalanceUpdateManyMutationInput = { + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + ProductId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockBalanceUncheckedUpdateManyInput = { + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + ProductId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockBalanceCountOrderByAggregateInput = { + quantity?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + ProductId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + +export type StockBalanceAvgOrderByAggregateInput = { + quantity?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + ProductId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + +export type StockBalanceMaxOrderByAggregateInput = { + quantity?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + ProductId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + +export type StockBalanceMinOrderByAggregateInput = { + quantity?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + ProductId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + +export type StockBalanceSumOrderByAggregateInput = { + quantity?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + ProductId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + + + +export type StockBalanceSelect = runtime.Types.Extensions.GetSelect<{ + quantity?: boolean + totalCost?: boolean + updatedAt?: boolean + ProductId?: boolean + avgCost?: boolean +}, ExtArgs["result"]["stockBalance"]> + + + +export type StockBalanceSelectScalar = { + quantity?: boolean + totalCost?: boolean + updatedAt?: boolean + ProductId?: boolean + avgCost?: boolean +} + +export type StockBalanceOmit = runtime.Types.Extensions.GetOmit<"quantity" | "totalCost" | "updatedAt" | "ProductId" | "avgCost", ExtArgs["result"]["stockBalance"]> + +export type $StockBalancePayload = { + name: "StockBalance" + objects: {} + scalars: runtime.Types.Extensions.GetPayloadResult<{ + quantity: runtime.Decimal + totalCost: runtime.Decimal + updatedAt: Date + ProductId: number + avgCost: runtime.Decimal + }, ExtArgs["result"]["stockBalance"]> + composites: {} +} + +export type StockBalanceGetPayload = runtime.Types.Result.GetResult + +export type StockBalanceCountArgs = + Omit & { + select?: StockBalanceCountAggregateInputType | true + } + +export interface StockBalanceDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['StockBalance'], meta: { name: 'StockBalance' } } + /** + * Find zero or one StockBalance that matches the filter. + * @param {StockBalanceFindUniqueArgs} args - Arguments to find a StockBalance + * @example + * // Get one StockBalance + * const stockBalance = await prisma.stockBalance.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__StockBalanceClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one StockBalance that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {StockBalanceFindUniqueOrThrowArgs} args - Arguments to find a StockBalance + * @example + * // Get one StockBalance + * const stockBalance = await prisma.stockBalance.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__StockBalanceClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first StockBalance that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockBalanceFindFirstArgs} args - Arguments to find a StockBalance + * @example + * // Get one StockBalance + * const stockBalance = await prisma.stockBalance.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__StockBalanceClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first StockBalance that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockBalanceFindFirstOrThrowArgs} args - Arguments to find a StockBalance + * @example + * // Get one StockBalance + * const stockBalance = await prisma.stockBalance.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__StockBalanceClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more StockBalances that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockBalanceFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all StockBalances + * const stockBalances = await prisma.stockBalance.findMany() + * + * // Get first 10 StockBalances + * const stockBalances = await prisma.stockBalance.findMany({ take: 10 }) + * + * // Only select the `quantity` + * const stockBalanceWithQuantityOnly = await prisma.stockBalance.findMany({ select: { quantity: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a StockBalance. + * @param {StockBalanceCreateArgs} args - Arguments to create a StockBalance. + * @example + * // Create one StockBalance + * const StockBalance = await prisma.stockBalance.create({ + * data: { + * // ... data to create a StockBalance + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__StockBalanceClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many StockBalances. + * @param {StockBalanceCreateManyArgs} args - Arguments to create many StockBalances. + * @example + * // Create many StockBalances + * const stockBalance = await prisma.stockBalance.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a StockBalance. + * @param {StockBalanceDeleteArgs} args - Arguments to delete one StockBalance. + * @example + * // Delete one StockBalance + * const StockBalance = await prisma.stockBalance.delete({ + * where: { + * // ... filter to delete one StockBalance + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__StockBalanceClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one StockBalance. + * @param {StockBalanceUpdateArgs} args - Arguments to update one StockBalance. + * @example + * // Update one StockBalance + * const stockBalance = await prisma.stockBalance.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__StockBalanceClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more StockBalances. + * @param {StockBalanceDeleteManyArgs} args - Arguments to filter StockBalances to delete. + * @example + * // Delete a few StockBalances + * const { count } = await prisma.stockBalance.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more StockBalances. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockBalanceUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many StockBalances + * const stockBalance = await prisma.stockBalance.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one StockBalance. + * @param {StockBalanceUpsertArgs} args - Arguments to update or create a StockBalance. + * @example + * // Update or create a StockBalance + * const stockBalance = await prisma.stockBalance.upsert({ + * create: { + * // ... data to create a StockBalance + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the StockBalance we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__StockBalanceClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of StockBalances. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockBalanceCountArgs} args - Arguments to filter StockBalances to count. + * @example + * // Count the number of StockBalances + * const count = await prisma.stockBalance.count({ + * where: { + * // ... the filter for the StockBalances we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a StockBalance. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockBalanceAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by StockBalance. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockBalanceGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends StockBalanceGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: StockBalanceGroupByArgs['orderBy'] } + : { orderBy?: StockBalanceGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetStockBalanceGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the StockBalance model + */ +readonly fields: StockBalanceFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for StockBalance. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__StockBalanceClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the StockBalance model + */ +export interface StockBalanceFieldRefs { + readonly quantity: Prisma.FieldRef<"StockBalance", 'Decimal'> + readonly totalCost: Prisma.FieldRef<"StockBalance", 'Decimal'> + readonly updatedAt: Prisma.FieldRef<"StockBalance", 'DateTime'> + readonly ProductId: Prisma.FieldRef<"StockBalance", 'Int'> + readonly avgCost: Prisma.FieldRef<"StockBalance", 'Decimal'> +} + + +// Custom InputTypes +/** + * StockBalance findUnique + */ +export type StockBalanceFindUniqueArgs = { + /** + * Select specific fields to fetch from the StockBalance + */ + select?: Prisma.StockBalanceSelect | null + /** + * Omit specific fields from the StockBalance + */ + omit?: Prisma.StockBalanceOmit | null + /** + * Filter, which StockBalance to fetch. + */ + where: Prisma.StockBalanceWhereUniqueInput +} + +/** + * StockBalance findUniqueOrThrow + */ +export type StockBalanceFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the StockBalance + */ + select?: Prisma.StockBalanceSelect | null + /** + * Omit specific fields from the StockBalance + */ + omit?: Prisma.StockBalanceOmit | null + /** + * Filter, which StockBalance to fetch. + */ + where: Prisma.StockBalanceWhereUniqueInput +} + +/** + * StockBalance findFirst + */ +export type StockBalanceFindFirstArgs = { + /** + * Select specific fields to fetch from the StockBalance + */ + select?: Prisma.StockBalanceSelect | null + /** + * Omit specific fields from the StockBalance + */ + omit?: Prisma.StockBalanceOmit | null + /** + * Filter, which StockBalance to fetch. + */ + where?: Prisma.StockBalanceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockBalances to fetch. + */ + orderBy?: Prisma.StockBalanceOrderByWithRelationInput | Prisma.StockBalanceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for StockBalances. + */ + cursor?: Prisma.StockBalanceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockBalances from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockBalances. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of StockBalances. + */ + distinct?: Prisma.StockBalanceScalarFieldEnum | Prisma.StockBalanceScalarFieldEnum[] +} + +/** + * StockBalance findFirstOrThrow + */ +export type StockBalanceFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the StockBalance + */ + select?: Prisma.StockBalanceSelect | null + /** + * Omit specific fields from the StockBalance + */ + omit?: Prisma.StockBalanceOmit | null + /** + * Filter, which StockBalance to fetch. + */ + where?: Prisma.StockBalanceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockBalances to fetch. + */ + orderBy?: Prisma.StockBalanceOrderByWithRelationInput | Prisma.StockBalanceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for StockBalances. + */ + cursor?: Prisma.StockBalanceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockBalances from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockBalances. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of StockBalances. + */ + distinct?: Prisma.StockBalanceScalarFieldEnum | Prisma.StockBalanceScalarFieldEnum[] +} + +/** + * StockBalance findMany + */ +export type StockBalanceFindManyArgs = { + /** + * Select specific fields to fetch from the StockBalance + */ + select?: Prisma.StockBalanceSelect | null + /** + * Omit specific fields from the StockBalance + */ + omit?: Prisma.StockBalanceOmit | null + /** + * Filter, which StockBalances to fetch. + */ + where?: Prisma.StockBalanceWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockBalances to fetch. + */ + orderBy?: Prisma.StockBalanceOrderByWithRelationInput | Prisma.StockBalanceOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing StockBalances. + */ + cursor?: Prisma.StockBalanceWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockBalances from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockBalances. + */ + skip?: number + distinct?: Prisma.StockBalanceScalarFieldEnum | Prisma.StockBalanceScalarFieldEnum[] +} + +/** + * StockBalance create + */ +export type StockBalanceCreateArgs = { + /** + * Select specific fields to fetch from the StockBalance + */ + select?: Prisma.StockBalanceSelect | null + /** + * Omit specific fields from the StockBalance + */ + omit?: Prisma.StockBalanceOmit | null + /** + * The data needed to create a StockBalance. + */ + data: Prisma.XOR +} + +/** + * StockBalance createMany + */ +export type StockBalanceCreateManyArgs = { + /** + * The data used to create many StockBalances. + */ + data: Prisma.StockBalanceCreateManyInput | Prisma.StockBalanceCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * StockBalance update + */ +export type StockBalanceUpdateArgs = { + /** + * Select specific fields to fetch from the StockBalance + */ + select?: Prisma.StockBalanceSelect | null + /** + * Omit specific fields from the StockBalance + */ + omit?: Prisma.StockBalanceOmit | null + /** + * The data needed to update a StockBalance. + */ + data: Prisma.XOR + /** + * Choose, which StockBalance to update. + */ + where: Prisma.StockBalanceWhereUniqueInput +} + +/** + * StockBalance updateMany + */ +export type StockBalanceUpdateManyArgs = { + /** + * The data used to update StockBalances. + */ + data: Prisma.XOR + /** + * Filter which StockBalances to update + */ + where?: Prisma.StockBalanceWhereInput + /** + * Limit how many StockBalances to update. + */ + limit?: number +} + +/** + * StockBalance upsert + */ +export type StockBalanceUpsertArgs = { + /** + * Select specific fields to fetch from the StockBalance + */ + select?: Prisma.StockBalanceSelect | null + /** + * Omit specific fields from the StockBalance + */ + omit?: Prisma.StockBalanceOmit | null + /** + * The filter to search for the StockBalance to update in case it exists. + */ + where: Prisma.StockBalanceWhereUniqueInput + /** + * In case the StockBalance found by the `where` argument doesn't exist, create a new StockBalance with this data. + */ + create: Prisma.XOR + /** + * In case the StockBalance was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * StockBalance delete + */ +export type StockBalanceDeleteArgs = { + /** + * Select specific fields to fetch from the StockBalance + */ + select?: Prisma.StockBalanceSelect | null + /** + * Omit specific fields from the StockBalance + */ + omit?: Prisma.StockBalanceOmit | null + /** + * Filter which StockBalance to delete. + */ + where: Prisma.StockBalanceWhereUniqueInput +} + +/** + * StockBalance deleteMany + */ +export type StockBalanceDeleteManyArgs = { + /** + * Filter which StockBalances to delete + */ + where?: Prisma.StockBalanceWhereInput + /** + * Limit how many StockBalances to delete. + */ + limit?: number +} + +/** + * StockBalance without action + */ +export type StockBalanceDefaultArgs = { + /** + * Select specific fields to fetch from the StockBalance + */ + select?: Prisma.StockBalanceSelect | null + /** + * Omit specific fields from the StockBalance + */ + omit?: Prisma.StockBalanceOmit | null +} diff --git a/src/generated/prisma/models/StockMovement.ts b/src/generated/prisma/models/StockMovement.ts new file mode 100644 index 0000000..26508d4 --- /dev/null +++ b/src/generated/prisma/models/StockMovement.ts @@ -0,0 +1,1649 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `StockMovement` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model StockMovement + * + */ +export type StockMovementModel = runtime.Types.Result.DefaultSelection + +export type AggregateStockMovement = { + _count: StockMovementCountAggregateOutputType | null + _avg: StockMovementAvgAggregateOutputType | null + _sum: StockMovementSumAggregateOutputType | null + _min: StockMovementMinAggregateOutputType | null + _max: StockMovementMaxAggregateOutputType | null +} + +export type StockMovementAvgAggregateOutputType = { + id: number | null + quantity: runtime.Decimal | null + fee: runtime.Decimal | null + totalCost: runtime.Decimal | null + productId: number | null + inventoryId: number | null + avgCost: runtime.Decimal | null +} + +export type StockMovementSumAggregateOutputType = { + id: number | null + quantity: runtime.Decimal | null + fee: runtime.Decimal | null + totalCost: runtime.Decimal | null + productId: number | null + inventoryId: number | null + avgCost: runtime.Decimal | null +} + +export type StockMovementMinAggregateOutputType = { + id: number | null + type: $Enums.MovementType | null + quantity: runtime.Decimal | null + fee: runtime.Decimal | null + totalCost: runtime.Decimal | null + referenceType: $Enums.MovementReferenceType | null + referenceId: string | null + createdAt: Date | null + productId: number | null + inventoryId: number | null + avgCost: runtime.Decimal | null +} + +export type StockMovementMaxAggregateOutputType = { + id: number | null + type: $Enums.MovementType | null + quantity: runtime.Decimal | null + fee: runtime.Decimal | null + totalCost: runtime.Decimal | null + referenceType: $Enums.MovementReferenceType | null + referenceId: string | null + createdAt: Date | null + productId: number | null + inventoryId: number | null + avgCost: runtime.Decimal | null +} + +export type StockMovementCountAggregateOutputType = { + id: number + type: number + quantity: number + fee: number + totalCost: number + referenceType: number + referenceId: number + createdAt: number + productId: number + inventoryId: number + avgCost: number + _all: number +} + + +export type StockMovementAvgAggregateInputType = { + id?: true + quantity?: true + fee?: true + totalCost?: true + productId?: true + inventoryId?: true + avgCost?: true +} + +export type StockMovementSumAggregateInputType = { + id?: true + quantity?: true + fee?: true + totalCost?: true + productId?: true + inventoryId?: true + avgCost?: true +} + +export type StockMovementMinAggregateInputType = { + id?: true + type?: true + quantity?: true + fee?: true + totalCost?: true + referenceType?: true + referenceId?: true + createdAt?: true + productId?: true + inventoryId?: true + avgCost?: true +} + +export type StockMovementMaxAggregateInputType = { + id?: true + type?: true + quantity?: true + fee?: true + totalCost?: true + referenceType?: true + referenceId?: true + createdAt?: true + productId?: true + inventoryId?: true + avgCost?: true +} + +export type StockMovementCountAggregateInputType = { + id?: true + type?: true + quantity?: true + fee?: true + totalCost?: true + referenceType?: true + referenceId?: true + createdAt?: true + productId?: true + inventoryId?: true + avgCost?: true + _all?: true +} + +export type StockMovementAggregateArgs = { + /** + * Filter which StockMovement to aggregate. + */ + where?: Prisma.StockMovementWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockMovements to fetch. + */ + orderBy?: Prisma.StockMovementOrderByWithRelationInput | Prisma.StockMovementOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.StockMovementWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockMovements from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockMovements. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned StockMovements + **/ + _count?: true | StockMovementCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: StockMovementAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: StockMovementSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: StockMovementMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: StockMovementMaxAggregateInputType +} + +export type GetStockMovementAggregateType = { + [P in keyof T & keyof AggregateStockMovement]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type StockMovementGroupByArgs = { + where?: Prisma.StockMovementWhereInput + orderBy?: Prisma.StockMovementOrderByWithAggregationInput | Prisma.StockMovementOrderByWithAggregationInput[] + by: Prisma.StockMovementScalarFieldEnum[] | Prisma.StockMovementScalarFieldEnum + having?: Prisma.StockMovementScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: StockMovementCountAggregateInputType | true + _avg?: StockMovementAvgAggregateInputType + _sum?: StockMovementSumAggregateInputType + _min?: StockMovementMinAggregateInputType + _max?: StockMovementMaxAggregateInputType +} + +export type StockMovementGroupByOutputType = { + id: number + type: $Enums.MovementType + quantity: runtime.Decimal + fee: runtime.Decimal + totalCost: runtime.Decimal + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt: Date + productId: number + inventoryId: number + avgCost: runtime.Decimal + _count: StockMovementCountAggregateOutputType | null + _avg: StockMovementAvgAggregateOutputType | null + _sum: StockMovementSumAggregateOutputType | null + _min: StockMovementMinAggregateOutputType | null + _max: StockMovementMaxAggregateOutputType | null +} + +type GetStockMovementGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof StockMovementGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type StockMovementWhereInput = { + AND?: Prisma.StockMovementWhereInput | Prisma.StockMovementWhereInput[] + OR?: Prisma.StockMovementWhereInput[] + NOT?: Prisma.StockMovementWhereInput | Prisma.StockMovementWhereInput[] + id?: Prisma.IntFilter<"StockMovement"> | number + type?: Prisma.EnumMovementTypeFilter<"StockMovement"> | $Enums.MovementType + quantity?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFilter<"StockMovement"> | $Enums.MovementReferenceType + referenceId?: Prisma.StringFilter<"StockMovement"> | string + createdAt?: Prisma.DateTimeFilter<"StockMovement"> | Date | string + productId?: Prisma.IntFilter<"StockMovement"> | number + inventoryId?: Prisma.IntFilter<"StockMovement"> | number + avgCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + inventory?: Prisma.XOR + product?: Prisma.XOR +} + +export type StockMovementOrderByWithRelationInput = { + id?: Prisma.SortOrder + type?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + referenceType?: Prisma.SortOrder + referenceId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder + inventory?: Prisma.InventoryOrderByWithRelationInput + product?: Prisma.ProductOrderByWithRelationInput + _relevance?: Prisma.StockMovementOrderByRelevanceInput +} + +export type StockMovementWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.StockMovementWhereInput | Prisma.StockMovementWhereInput[] + OR?: Prisma.StockMovementWhereInput[] + NOT?: Prisma.StockMovementWhereInput | Prisma.StockMovementWhereInput[] + type?: Prisma.EnumMovementTypeFilter<"StockMovement"> | $Enums.MovementType + quantity?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFilter<"StockMovement"> | $Enums.MovementReferenceType + referenceId?: Prisma.StringFilter<"StockMovement"> | string + createdAt?: Prisma.DateTimeFilter<"StockMovement"> | Date | string + productId?: Prisma.IntFilter<"StockMovement"> | number + inventoryId?: Prisma.IntFilter<"StockMovement"> | number + avgCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + inventory?: Prisma.XOR + product?: Prisma.XOR +}, "id"> + +export type StockMovementOrderByWithAggregationInput = { + id?: Prisma.SortOrder + type?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + referenceType?: Prisma.SortOrder + referenceId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder + _count?: Prisma.StockMovementCountOrderByAggregateInput + _avg?: Prisma.StockMovementAvgOrderByAggregateInput + _max?: Prisma.StockMovementMaxOrderByAggregateInput + _min?: Prisma.StockMovementMinOrderByAggregateInput + _sum?: Prisma.StockMovementSumOrderByAggregateInput +} + +export type StockMovementScalarWhereWithAggregatesInput = { + AND?: Prisma.StockMovementScalarWhereWithAggregatesInput | Prisma.StockMovementScalarWhereWithAggregatesInput[] + OR?: Prisma.StockMovementScalarWhereWithAggregatesInput[] + NOT?: Prisma.StockMovementScalarWhereWithAggregatesInput | Prisma.StockMovementScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"StockMovement"> | number + type?: Prisma.EnumMovementTypeWithAggregatesFilter<"StockMovement"> | $Enums.MovementType + quantity?: Prisma.DecimalWithAggregatesFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalWithAggregatesFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalWithAggregatesFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeWithAggregatesFilter<"StockMovement"> | $Enums.MovementReferenceType + referenceId?: Prisma.StringWithAggregatesFilter<"StockMovement"> | string + createdAt?: Prisma.DateTimeWithAggregatesFilter<"StockMovement"> | Date | string + productId?: Prisma.IntWithAggregatesFilter<"StockMovement"> | number + inventoryId?: Prisma.IntWithAggregatesFilter<"StockMovement"> | number + avgCost?: Prisma.DecimalWithAggregatesFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementCreateInput = { + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string + inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput + product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput +} + +export type StockMovementUncheckedCreateInput = { + id?: number + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + productId: number + inventoryId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementUpdateInput = { + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput + product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput +} + +export type StockMovementUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementCreateManyInput = { + id?: number + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + productId: number + inventoryId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementUpdateManyMutationInput = { + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementListRelationFilter = { + every?: Prisma.StockMovementWhereInput + some?: Prisma.StockMovementWhereInput + none?: Prisma.StockMovementWhereInput +} + +export type StockMovementOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type StockMovementOrderByRelevanceInput = { + fields: Prisma.StockMovementOrderByRelevanceFieldEnum | Prisma.StockMovementOrderByRelevanceFieldEnum[] + sort: Prisma.SortOrder + search: string +} + +export type StockMovementCountOrderByAggregateInput = { + id?: Prisma.SortOrder + type?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + referenceType?: Prisma.SortOrder + referenceId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + +export type StockMovementAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + +export type StockMovementMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + type?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + referenceType?: Prisma.SortOrder + referenceId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + +export type StockMovementMinOrderByAggregateInput = { + id?: Prisma.SortOrder + type?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + referenceType?: Prisma.SortOrder + referenceId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + +export type StockMovementSumOrderByAggregateInput = { + id?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + avgCost?: Prisma.SortOrder +} + +export type StockMovementCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutProductInput[] | Prisma.StockMovementUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutProductInput | Prisma.StockMovementCreateOrConnectWithoutProductInput[] + createMany?: Prisma.StockMovementCreateManyProductInputEnvelope + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] +} + +export type StockMovementUncheckedCreateNestedManyWithoutProductInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutProductInput[] | Prisma.StockMovementUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutProductInput | Prisma.StockMovementCreateOrConnectWithoutProductInput[] + createMany?: Prisma.StockMovementCreateManyProductInputEnvelope + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] +} + +export type StockMovementUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutProductInput[] | Prisma.StockMovementUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutProductInput | Prisma.StockMovementCreateOrConnectWithoutProductInput[] + upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutProductInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.StockMovementCreateManyProductInputEnvelope + set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutProductInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutProductInput | Prisma.StockMovementUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] +} + +export type StockMovementUncheckedUpdateManyWithoutProductNestedInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutProductInput[] | Prisma.StockMovementUncheckedCreateWithoutProductInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutProductInput | Prisma.StockMovementCreateOrConnectWithoutProductInput[] + upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutProductInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutProductInput[] + createMany?: Prisma.StockMovementCreateManyProductInputEnvelope + set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutProductInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutProductInput[] + updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutProductInput | Prisma.StockMovementUpdateManyWithWhereWithoutProductInput[] + deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] +} + +export type StockMovementCreateNestedManyWithoutInventoryInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[] + createMany?: Prisma.StockMovementCreateManyInventoryInputEnvelope + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] +} + +export type StockMovementUncheckedCreateNestedManyWithoutInventoryInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[] + createMany?: Prisma.StockMovementCreateManyInventoryInputEnvelope + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] +} + +export type StockMovementUpdateManyWithoutInventoryNestedInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[] + upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutInventoryInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutInventoryInput[] + createMany?: Prisma.StockMovementCreateManyInventoryInputEnvelope + set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutInventoryInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutInventoryInput[] + updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutInventoryInput | Prisma.StockMovementUpdateManyWithWhereWithoutInventoryInput[] + deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] +} + +export type StockMovementUncheckedUpdateManyWithoutInventoryNestedInput = { + create?: Prisma.XOR | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[] + connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[] + upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutInventoryInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutInventoryInput[] + createMany?: Prisma.StockMovementCreateManyInventoryInputEnvelope + set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] + update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutInventoryInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutInventoryInput[] + updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutInventoryInput | Prisma.StockMovementUpdateManyWithWhereWithoutInventoryInput[] + deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] +} + +export type EnumMovementTypeFieldUpdateOperationsInput = { + set?: $Enums.MovementType +} + +export type EnumMovementReferenceTypeFieldUpdateOperationsInput = { + set?: $Enums.MovementReferenceType +} + +export type StockMovementCreateWithoutProductInput = { + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string + inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput +} + +export type StockMovementUncheckedCreateWithoutProductInput = { + id?: number + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + inventoryId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementCreateOrConnectWithoutProductInput = { + where: Prisma.StockMovementWhereUniqueInput + create: Prisma.XOR +} + +export type StockMovementCreateManyProductInputEnvelope = { + data: Prisma.StockMovementCreateManyProductInput | Prisma.StockMovementCreateManyProductInput[] + skipDuplicates?: boolean +} + +export type StockMovementUpsertWithWhereUniqueWithoutProductInput = { + where: Prisma.StockMovementWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type StockMovementUpdateWithWhereUniqueWithoutProductInput = { + where: Prisma.StockMovementWhereUniqueInput + data: Prisma.XOR +} + +export type StockMovementUpdateManyWithWhereWithoutProductInput = { + where: Prisma.StockMovementScalarWhereInput + data: Prisma.XOR +} + +export type StockMovementScalarWhereInput = { + AND?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] + OR?: Prisma.StockMovementScalarWhereInput[] + NOT?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] + id?: Prisma.IntFilter<"StockMovement"> | number + type?: Prisma.EnumMovementTypeFilter<"StockMovement"> | $Enums.MovementType + quantity?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFilter<"StockMovement"> | $Enums.MovementReferenceType + referenceId?: Prisma.StringFilter<"StockMovement"> | string + createdAt?: Prisma.DateTimeFilter<"StockMovement"> | Date | string + productId?: Prisma.IntFilter<"StockMovement"> | number + inventoryId?: Prisma.IntFilter<"StockMovement"> | number + avgCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementCreateWithoutInventoryInput = { + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string + product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput +} + +export type StockMovementUncheckedCreateWithoutInventoryInput = { + id?: number + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + productId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementCreateOrConnectWithoutInventoryInput = { + where: Prisma.StockMovementWhereUniqueInput + create: Prisma.XOR +} + +export type StockMovementCreateManyInventoryInputEnvelope = { + data: Prisma.StockMovementCreateManyInventoryInput | Prisma.StockMovementCreateManyInventoryInput[] + skipDuplicates?: boolean +} + +export type StockMovementUpsertWithWhereUniqueWithoutInventoryInput = { + where: Prisma.StockMovementWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type StockMovementUpdateWithWhereUniqueWithoutInventoryInput = { + where: Prisma.StockMovementWhereUniqueInput + data: Prisma.XOR +} + +export type StockMovementUpdateManyWithWhereWithoutInventoryInput = { + where: Prisma.StockMovementScalarWhereInput + data: Prisma.XOR +} + +export type StockMovementCreateManyProductInput = { + id?: number + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + inventoryId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementUpdateWithoutProductInput = { + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput +} + +export type StockMovementUncheckedUpdateWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementUncheckedUpdateManyWithoutProductInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + inventoryId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementCreateManyInventoryInput = { + id?: number + type: $Enums.MovementType + quantity: runtime.Decimal | runtime.DecimalJsLike | number | string + fee: runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt?: Date | string + productId: number + avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementUpdateWithoutInventoryInput = { + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput +} + +export type StockMovementUncheckedUpdateWithoutInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + +export type StockMovementUncheckedUpdateManyWithoutInventoryInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType + quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string + referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType + referenceId?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + productId?: Prisma.IntFieldUpdateOperationsInput | number + avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string +} + + + +export type StockMovementSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + type?: boolean + quantity?: boolean + fee?: boolean + totalCost?: boolean + referenceType?: boolean + referenceId?: boolean + createdAt?: boolean + productId?: boolean + inventoryId?: boolean + avgCost?: boolean + inventory?: boolean | Prisma.InventoryDefaultArgs + product?: boolean | Prisma.ProductDefaultArgs +}, ExtArgs["result"]["stockMovement"]> + + + +export type StockMovementSelectScalar = { + id?: boolean + type?: boolean + quantity?: boolean + fee?: boolean + totalCost?: boolean + referenceType?: boolean + referenceId?: boolean + createdAt?: boolean + productId?: boolean + inventoryId?: boolean + avgCost?: boolean +} + +export type StockMovementOmit = runtime.Types.Extensions.GetOmit<"id" | "type" | "quantity" | "fee" | "totalCost" | "referenceType" | "referenceId" | "createdAt" | "productId" | "inventoryId" | "avgCost", ExtArgs["result"]["stockMovement"]> +export type StockMovementInclude = { + inventory?: boolean | Prisma.InventoryDefaultArgs + product?: boolean | Prisma.ProductDefaultArgs +} + +export type $StockMovementPayload = { + name: "StockMovement" + objects: { + inventory: Prisma.$InventoryPayload + product: Prisma.$ProductPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + type: $Enums.MovementType + quantity: runtime.Decimal + fee: runtime.Decimal + totalCost: runtime.Decimal + referenceType: $Enums.MovementReferenceType + referenceId: string + createdAt: Date + productId: number + inventoryId: number + avgCost: runtime.Decimal + }, ExtArgs["result"]["stockMovement"]> + composites: {} +} + +export type StockMovementGetPayload = runtime.Types.Result.GetResult + +export type StockMovementCountArgs = + Omit & { + select?: StockMovementCountAggregateInputType | true + } + +export interface StockMovementDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['StockMovement'], meta: { name: 'StockMovement' } } + /** + * Find zero or one StockMovement that matches the filter. + * @param {StockMovementFindUniqueArgs} args - Arguments to find a StockMovement + * @example + * // Get one StockMovement + * const stockMovement = await prisma.stockMovement.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__StockMovementClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one StockMovement that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {StockMovementFindUniqueOrThrowArgs} args - Arguments to find a StockMovement + * @example + * // Get one StockMovement + * const stockMovement = await prisma.stockMovement.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__StockMovementClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first StockMovement that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockMovementFindFirstArgs} args - Arguments to find a StockMovement + * @example + * // Get one StockMovement + * const stockMovement = await prisma.stockMovement.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__StockMovementClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first StockMovement that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockMovementFindFirstOrThrowArgs} args - Arguments to find a StockMovement + * @example + * // Get one StockMovement + * const stockMovement = await prisma.stockMovement.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__StockMovementClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more StockMovements that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockMovementFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all StockMovements + * const stockMovements = await prisma.stockMovement.findMany() + * + * // Get first 10 StockMovements + * const stockMovements = await prisma.stockMovement.findMany({ take: 10 }) + * + * // Only select the `id` + * const stockMovementWithIdOnly = await prisma.stockMovement.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a StockMovement. + * @param {StockMovementCreateArgs} args - Arguments to create a StockMovement. + * @example + * // Create one StockMovement + * const StockMovement = await prisma.stockMovement.create({ + * data: { + * // ... data to create a StockMovement + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__StockMovementClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many StockMovements. + * @param {StockMovementCreateManyArgs} args - Arguments to create many StockMovements. + * @example + * // Create many StockMovements + * const stockMovement = await prisma.stockMovement.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Delete a StockMovement. + * @param {StockMovementDeleteArgs} args - Arguments to delete one StockMovement. + * @example + * // Delete one StockMovement + * const StockMovement = await prisma.stockMovement.delete({ + * where: { + * // ... filter to delete one StockMovement + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__StockMovementClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one StockMovement. + * @param {StockMovementUpdateArgs} args - Arguments to update one StockMovement. + * @example + * // Update one StockMovement + * const stockMovement = await prisma.stockMovement.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__StockMovementClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more StockMovements. + * @param {StockMovementDeleteManyArgs} args - Arguments to filter StockMovements to delete. + * @example + * // Delete a few StockMovements + * const { count } = await prisma.stockMovement.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more StockMovements. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockMovementUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many StockMovements + * const stockMovement = await prisma.stockMovement.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create or update one StockMovement. + * @param {StockMovementUpsertArgs} args - Arguments to update or create a StockMovement. + * @example + * // Update or create a StockMovement + * const stockMovement = await prisma.stockMovement.upsert({ + * create: { + * // ... data to create a StockMovement + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the StockMovement we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__StockMovementClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of StockMovements. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockMovementCountArgs} args - Arguments to filter StockMovements to count. + * @example + * // Count the number of StockMovements + * const count = await prisma.stockMovement.count({ + * where: { + * // ... the filter for the StockMovements we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a StockMovement. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockMovementAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by StockMovement. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {StockMovementGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends StockMovementGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: StockMovementGroupByArgs['orderBy'] } + : { orderBy?: StockMovementGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetStockMovementGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the StockMovement model + */ +readonly fields: StockMovementFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for StockMovement. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__StockMovementClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + inventory = {}>(args?: Prisma.Subset>): Prisma.Prisma__InventoryClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + product = {}>(args?: Prisma.Subset>): Prisma.Prisma__ProductClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the StockMovement model + */ +export interface StockMovementFieldRefs { + readonly id: Prisma.FieldRef<"StockMovement", 'Int'> + readonly type: Prisma.FieldRef<"StockMovement", 'MovementType'> + readonly quantity: Prisma.FieldRef<"StockMovement", 'Decimal'> + readonly fee: Prisma.FieldRef<"StockMovement", 'Decimal'> + readonly totalCost: Prisma.FieldRef<"StockMovement", 'Decimal'> + readonly referenceType: Prisma.FieldRef<"StockMovement", 'MovementReferenceType'> + readonly referenceId: Prisma.FieldRef<"StockMovement", 'String'> + readonly createdAt: Prisma.FieldRef<"StockMovement", 'DateTime'> + readonly productId: Prisma.FieldRef<"StockMovement", 'Int'> + readonly inventoryId: Prisma.FieldRef<"StockMovement", 'Int'> + readonly avgCost: Prisma.FieldRef<"StockMovement", 'Decimal'> +} + + +// Custom InputTypes +/** + * StockMovement findUnique + */ +export type StockMovementFindUniqueArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + /** + * Filter, which StockMovement to fetch. + */ + where: Prisma.StockMovementWhereUniqueInput +} + +/** + * StockMovement findUniqueOrThrow + */ +export type StockMovementFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + /** + * Filter, which StockMovement to fetch. + */ + where: Prisma.StockMovementWhereUniqueInput +} + +/** + * StockMovement findFirst + */ +export type StockMovementFindFirstArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + /** + * Filter, which StockMovement to fetch. + */ + where?: Prisma.StockMovementWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockMovements to fetch. + */ + orderBy?: Prisma.StockMovementOrderByWithRelationInput | Prisma.StockMovementOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for StockMovements. + */ + cursor?: Prisma.StockMovementWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockMovements from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockMovements. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of StockMovements. + */ + distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[] +} + +/** + * StockMovement findFirstOrThrow + */ +export type StockMovementFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + /** + * Filter, which StockMovement to fetch. + */ + where?: Prisma.StockMovementWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockMovements to fetch. + */ + orderBy?: Prisma.StockMovementOrderByWithRelationInput | Prisma.StockMovementOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for StockMovements. + */ + cursor?: Prisma.StockMovementWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockMovements from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockMovements. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of StockMovements. + */ + distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[] +} + +/** + * StockMovement findMany + */ +export type StockMovementFindManyArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + /** + * Filter, which StockMovements to fetch. + */ + where?: Prisma.StockMovementWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of StockMovements to fetch. + */ + orderBy?: Prisma.StockMovementOrderByWithRelationInput | Prisma.StockMovementOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing StockMovements. + */ + cursor?: Prisma.StockMovementWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` StockMovements from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` StockMovements. + */ + skip?: number + distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[] +} + +/** + * StockMovement create + */ +export type StockMovementCreateArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + /** + * The data needed to create a StockMovement. + */ + data: Prisma.XOR +} + +/** + * StockMovement createMany + */ +export type StockMovementCreateManyArgs = { + /** + * The data used to create many StockMovements. + */ + data: Prisma.StockMovementCreateManyInput | Prisma.StockMovementCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * StockMovement update + */ +export type StockMovementUpdateArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + /** + * The data needed to update a StockMovement. + */ + data: Prisma.XOR + /** + * Choose, which StockMovement to update. + */ + where: Prisma.StockMovementWhereUniqueInput +} + +/** + * StockMovement updateMany + */ +export type StockMovementUpdateManyArgs = { + /** + * The data used to update StockMovements. + */ + data: Prisma.XOR + /** + * Filter which StockMovements to update + */ + where?: Prisma.StockMovementWhereInput + /** + * Limit how many StockMovements to update. + */ + limit?: number +} + +/** + * StockMovement upsert + */ +export type StockMovementUpsertArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + /** + * The filter to search for the StockMovement to update in case it exists. + */ + where: Prisma.StockMovementWhereUniqueInput + /** + * In case the StockMovement found by the `where` argument doesn't exist, create a new StockMovement with this data. + */ + create: Prisma.XOR + /** + * In case the StockMovement was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * StockMovement delete + */ +export type StockMovementDeleteArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null + /** + * Filter which StockMovement to delete. + */ + where: Prisma.StockMovementWhereUniqueInput +} + +/** + * StockMovement deleteMany + */ +export type StockMovementDeleteManyArgs = { + /** + * Filter which StockMovements to delete + */ + where?: Prisma.StockMovementWhereInput + /** + * Limit how many StockMovements to delete. + */ + limit?: number +} + +/** + * StockMovement without action + */ +export type StockMovementDefaultArgs = { + /** + * Select specific fields to fetch from the StockMovement + */ + select?: Prisma.StockMovementSelect | null + /** + * Omit specific fields from the StockMovement + */ + omit?: Prisma.StockMovementOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.StockMovementInclude | null +} diff --git a/src/generated/prisma/models/Store.ts b/src/generated/prisma/models/Store.ts index 7d2224a..2df4e0d 100644 --- a/src/generated/prisma/models/Store.ts +++ b/src/generated/prisma/models/Store.ts @@ -41,6 +41,7 @@ export type StoreMinAggregateOutputType = { isActive: boolean | null createdAt: Date | null updatedAt: Date | null + deletedAt: Date | null } export type StoreMaxAggregateOutputType = { @@ -50,6 +51,7 @@ export type StoreMaxAggregateOutputType = { isActive: boolean | null createdAt: Date | null updatedAt: Date | null + deletedAt: Date | null } export type StoreCountAggregateOutputType = { @@ -59,6 +61,7 @@ export type StoreCountAggregateOutputType = { isActive: number createdAt: number updatedAt: number + deletedAt: number _all: number } @@ -78,6 +81,7 @@ export type StoreMinAggregateInputType = { isActive?: true createdAt?: true updatedAt?: true + deletedAt?: true } export type StoreMaxAggregateInputType = { @@ -87,6 +91,7 @@ export type StoreMaxAggregateInputType = { isActive?: true createdAt?: true updatedAt?: true + deletedAt?: true } export type StoreCountAggregateInputType = { @@ -96,6 +101,7 @@ export type StoreCountAggregateInputType = { isActive?: true createdAt?: true updatedAt?: true + deletedAt?: true _all?: true } @@ -192,6 +198,7 @@ export type StoreGroupByOutputType = { isActive: boolean createdAt: Date updatedAt: Date + deletedAt: Date | null _count: StoreCountAggregateOutputType | null _avg: StoreAvgAggregateOutputType | null _sum: StoreSumAggregateOutputType | null @@ -224,6 +231,7 @@ export type StoreWhereInput = { isActive?: Prisma.BoolFilter<"Store"> | boolean createdAt?: Prisma.DateTimeFilter<"Store"> | Date | string updatedAt?: Prisma.DateTimeFilter<"Store"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"Store"> | Date | string | null } export type StoreOrderByWithRelationInput = { @@ -233,6 +241,7 @@ export type StoreOrderByWithRelationInput = { isActive?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder _relevance?: Prisma.StoreOrderByRelevanceInput } @@ -246,6 +255,7 @@ export type StoreWhereUniqueInput = Prisma.AtLeast<{ isActive?: Prisma.BoolFilter<"Store"> | boolean createdAt?: Prisma.DateTimeFilter<"Store"> | Date | string updatedAt?: Prisma.DateTimeFilter<"Store"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"Store"> | Date | string | null }, "id"> export type StoreOrderByWithAggregationInput = { @@ -255,6 +265,7 @@ export type StoreOrderByWithAggregationInput = { isActive?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.StoreCountOrderByAggregateInput _avg?: Prisma.StoreAvgOrderByAggregateInput _max?: Prisma.StoreMaxOrderByAggregateInput @@ -272,14 +283,16 @@ export type StoreScalarWhereWithAggregatesInput = { isActive?: Prisma.BoolWithAggregatesFilter<"Store"> | boolean createdAt?: Prisma.DateTimeWithAggregatesFilter<"Store"> | Date | string updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Store"> | Date | string + deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Store"> | Date | string | null } export type StoreCreateInput = { name: string location?: string | null isActive?: boolean - createdAt: Date | string - updatedAt: Date | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null } export type StoreUncheckedCreateInput = { @@ -287,8 +300,9 @@ export type StoreUncheckedCreateInput = { name: string location?: string | null isActive?: boolean - createdAt: Date | string - updatedAt: Date | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null } export type StoreUpdateInput = { @@ -297,6 +311,7 @@ export type StoreUpdateInput = { isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type StoreUncheckedUpdateInput = { @@ -306,6 +321,7 @@ export type StoreUncheckedUpdateInput = { isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type StoreCreateManyInput = { @@ -313,8 +329,9 @@ export type StoreCreateManyInput = { name: string location?: string | null isActive?: boolean - createdAt: Date | string - updatedAt: Date | string + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null } export type StoreUpdateManyMutationInput = { @@ -323,6 +340,7 @@ export type StoreUpdateManyMutationInput = { isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type StoreUncheckedUpdateManyInput = { @@ -332,6 +350,7 @@ export type StoreUncheckedUpdateManyInput = { isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } export type StoreOrderByRelevanceInput = { @@ -347,6 +366,7 @@ export type StoreCountOrderByAggregateInput = { isActive?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder } export type StoreAvgOrderByAggregateInput = { @@ -360,6 +380,7 @@ export type StoreMaxOrderByAggregateInput = { isActive?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder } export type StoreMinOrderByAggregateInput = { @@ -369,6 +390,7 @@ export type StoreMinOrderByAggregateInput = { isActive?: Prisma.SortOrder createdAt?: Prisma.SortOrder updatedAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder } export type StoreSumOrderByAggregateInput = { @@ -384,6 +406,7 @@ export type StoreSelect @@ -395,9 +418,10 @@ export type StoreSelectScalar = { isActive?: boolean createdAt?: boolean updatedAt?: boolean + deletedAt?: boolean } -export type StoreOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "location" | "isActive" | "createdAt" | "updatedAt", ExtArgs["result"]["store"]> +export type StoreOmit = runtime.Types.Extensions.GetOmit<"id" | "name" | "location" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["store"]> export type $StorePayload = { name: "Store" @@ -409,6 +433,7 @@ export type $StorePayload composites: {} } @@ -784,6 +809,7 @@ export interface StoreFieldRefs { readonly isActive: Prisma.FieldRef<"Store", 'Boolean'> readonly createdAt: Prisma.FieldRef<"Store", 'DateTime'> readonly updatedAt: Prisma.FieldRef<"Store", 'DateTime'> + readonly deletedAt: Prisma.FieldRef<"Store", 'DateTime'> } diff --git a/src/generated/prisma/models/Supplier.ts b/src/generated/prisma/models/Supplier.ts index ff4ddd2..994b18f 100644 --- a/src/generated/prisma/models/Supplier.ts +++ b/src/generated/prisma/models/Supplier.ts @@ -238,8 +238,8 @@ export type SupplierGroupByOutputType = { state: string | null country: string | null isActive: boolean - createdAt: Date | null - updatedAt: Date | null + createdAt: Date + updatedAt: Date deletedAt: Date | null _count: SupplierCountAggregateOutputType | null _avg: SupplierAvgAggregateOutputType | null @@ -277,9 +277,11 @@ export type SupplierWhereInput = { state?: Prisma.StringNullableFilter<"Supplier"> | string | null country?: Prisma.StringNullableFilter<"Supplier"> | string | null isActive?: Prisma.BoolFilter<"Supplier"> | boolean - createdAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null + createdAt?: Prisma.DateTimeFilter<"Supplier"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Supplier"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null + productCharges?: Prisma.ProductChargeListRelationFilter + purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter } export type SupplierOrderByWithRelationInput = { @@ -293,9 +295,11 @@ export type SupplierOrderByWithRelationInput = { state?: Prisma.SortOrderInput | Prisma.SortOrder country?: Prisma.SortOrderInput | Prisma.SortOrder isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrderInput | Prisma.SortOrder - updatedAt?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + productCharges?: Prisma.ProductChargeOrderByRelationAggregateInput + purchaseReceipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput _relevance?: Prisma.SupplierOrderByRelevanceInput } @@ -313,9 +317,11 @@ export type SupplierWhereUniqueInput = Prisma.AtLeast<{ state?: Prisma.StringNullableFilter<"Supplier"> | string | null country?: Prisma.StringNullableFilter<"Supplier"> | string | null isActive?: Prisma.BoolFilter<"Supplier"> | boolean - createdAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null + createdAt?: Prisma.DateTimeFilter<"Supplier"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Supplier"> | Date | string deletedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null + productCharges?: Prisma.ProductChargeListRelationFilter + purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter }, "id" | "mobileNumber"> export type SupplierOrderByWithAggregationInput = { @@ -329,8 +335,8 @@ export type SupplierOrderByWithAggregationInput = { state?: Prisma.SortOrderInput | Prisma.SortOrder country?: Prisma.SortOrderInput | Prisma.SortOrder isActive?: Prisma.SortOrder - createdAt?: Prisma.SortOrderInput | Prisma.SortOrder - updatedAt?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder _count?: Prisma.SupplierCountOrderByAggregateInput _avg?: Prisma.SupplierAvgOrderByAggregateInput @@ -353,8 +359,8 @@ export type SupplierScalarWhereWithAggregatesInput = { state?: Prisma.StringNullableWithAggregatesFilter<"Supplier"> | string | null country?: Prisma.StringNullableWithAggregatesFilter<"Supplier"> | string | null isActive?: Prisma.BoolWithAggregatesFilter<"Supplier"> | boolean - createdAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Supplier"> | Date | string | null - updatedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Supplier"> | Date | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Supplier"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Supplier"> | Date | string deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Supplier"> | Date | string | null } @@ -368,9 +374,11 @@ export type SupplierCreateInput = { state?: string | null country?: string | null isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutSupplierInput + purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput } export type SupplierUncheckedCreateInput = { @@ -384,9 +392,11 @@ export type SupplierUncheckedCreateInput = { state?: string | null country?: string | null isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutSupplierInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput } export type SupplierUpdateInput = { @@ -399,9 +409,11 @@ export type SupplierUpdateInput = { state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productCharges?: Prisma.ProductChargeUpdateManyWithoutSupplierNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput } export type SupplierUncheckedUpdateInput = { @@ -415,9 +427,11 @@ export type SupplierUncheckedUpdateInput = { state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutSupplierNestedInput + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput } export type SupplierCreateManyInput = { @@ -431,8 +445,8 @@ export type SupplierCreateManyInput = { state?: string | null country?: string | null isActive?: boolean - createdAt?: Date | string | null - updatedAt?: Date | string | null + createdAt?: Date | string + updatedAt?: Date | string deletedAt?: Date | string | null } @@ -446,8 +460,8 @@ export type SupplierUpdateManyMutationInput = { state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -462,8 +476,8 @@ export type SupplierUncheckedUpdateManyInput = { state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean - createdAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null - updatedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null } @@ -529,6 +543,241 @@ export type SupplierSumOrderByAggregateInput = { id?: Prisma.SortOrder } +export type SupplierScalarRelationFilter = { + is?: Prisma.SupplierWhereInput + isNot?: Prisma.SupplierWhereInput +} + +export type SupplierCreateNestedOneWithoutProductChargesInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutProductChargesInput + connect?: Prisma.SupplierWhereUniqueInput +} + +export type SupplierUpdateOneRequiredWithoutProductChargesNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutProductChargesInput + upsert?: Prisma.SupplierUpsertWithoutProductChargesInput + connect?: Prisma.SupplierWhereUniqueInput + update?: Prisma.XOR, Prisma.SupplierUncheckedUpdateWithoutProductChargesInput> +} + +export type SupplierCreateNestedOneWithoutPurchaseReceiptsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutPurchaseReceiptsInput + connect?: Prisma.SupplierWhereUniqueInput +} + +export type SupplierUpdateOneRequiredWithoutPurchaseReceiptsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutPurchaseReceiptsInput + upsert?: Prisma.SupplierUpsertWithoutPurchaseReceiptsInput + connect?: Prisma.SupplierWhereUniqueInput + update?: Prisma.XOR, Prisma.SupplierUncheckedUpdateWithoutPurchaseReceiptsInput> +} + +export type SupplierCreateWithoutProductChargesInput = { + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput +} + +export type SupplierUncheckedCreateWithoutProductChargesInput = { + id?: number + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput +} + +export type SupplierCreateOrConnectWithoutProductChargesInput = { + where: Prisma.SupplierWhereUniqueInput + create: Prisma.XOR +} + +export type SupplierUpsertWithoutProductChargesInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.SupplierWhereInput +} + +export type SupplierUpdateToOneWithWhereWithoutProductChargesInput = { + where?: Prisma.SupplierWhereInput + data: Prisma.XOR +} + +export type SupplierUpdateWithoutProductChargesInput = { + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput +} + +export type SupplierUncheckedUpdateWithoutProductChargesInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput +} + +export type SupplierCreateWithoutPurchaseReceiptsInput = { + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + productCharges?: Prisma.ProductChargeCreateNestedManyWithoutSupplierInput +} + +export type SupplierUncheckedCreateWithoutPurchaseReceiptsInput = { + id?: number + firstName: string + lastName: string + email?: string | null + mobileNumber: string + address?: string | null + city?: string | null + state?: string | null + country?: string | null + isActive?: boolean + createdAt?: Date | string + updatedAt?: Date | string + deletedAt?: Date | string | null + productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutSupplierInput +} + +export type SupplierCreateOrConnectWithoutPurchaseReceiptsInput = { + where: Prisma.SupplierWhereUniqueInput + create: Prisma.XOR +} + +export type SupplierUpsertWithoutPurchaseReceiptsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.SupplierWhereInput +} + +export type SupplierUpdateToOneWithWhereWithoutPurchaseReceiptsInput = { + where?: Prisma.SupplierWhereInput + data: Prisma.XOR +} + +export type SupplierUpdateWithoutPurchaseReceiptsInput = { + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productCharges?: Prisma.ProductChargeUpdateManyWithoutSupplierNestedInput +} + +export type SupplierUncheckedUpdateWithoutPurchaseReceiptsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + firstName?: Prisma.StringFieldUpdateOperationsInput | string + lastName?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string + address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutSupplierNestedInput +} + + +/** + * Count Type SupplierCountOutputType + */ + +export type SupplierCountOutputType = { + productCharges: number + purchaseReceipts: number +} + +export type SupplierCountOutputTypeSelect = { + productCharges?: boolean | SupplierCountOutputTypeCountProductChargesArgs + purchaseReceipts?: boolean | SupplierCountOutputTypeCountPurchaseReceiptsArgs +} + +/** + * SupplierCountOutputType without action + */ +export type SupplierCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the SupplierCountOutputType + */ + select?: Prisma.SupplierCountOutputTypeSelect | null +} + +/** + * SupplierCountOutputType without action + */ +export type SupplierCountOutputTypeCountProductChargesArgs = { + where?: Prisma.ProductChargeWhereInput +} + +/** + * SupplierCountOutputType without action + */ +export type SupplierCountOutputTypeCountPurchaseReceiptsArgs = { + where?: Prisma.PurchaseReceiptWhereInput +} export type SupplierSelect = runtime.Types.Extensions.GetSelect<{ @@ -545,6 +794,9 @@ export type SupplierSelect + purchaseReceipts?: boolean | Prisma.Supplier$purchaseReceiptsArgs + _count?: boolean | Prisma.SupplierCountOutputTypeDefaultArgs }, ExtArgs["result"]["supplier"]> @@ -566,10 +818,18 @@ export type SupplierSelectScalar = { } export type SupplierOmit = runtime.Types.Extensions.GetOmit<"id" | "firstName" | "lastName" | "email" | "mobileNumber" | "address" | "city" | "state" | "country" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["supplier"]> +export type SupplierInclude = { + productCharges?: boolean | Prisma.Supplier$productChargesArgs + purchaseReceipts?: boolean | Prisma.Supplier$purchaseReceiptsArgs + _count?: boolean | Prisma.SupplierCountOutputTypeDefaultArgs +} export type $SupplierPayload = { name: "Supplier" - objects: {} + objects: { + productCharges: Prisma.$ProductChargePayload[] + purchaseReceipts: Prisma.$PurchaseReceiptPayload[] + } scalars: runtime.Types.Extensions.GetPayloadResult<{ id: number firstName: string @@ -581,8 +841,8 @@ export type $SupplierPayload composites: {} @@ -924,6 +1184,8 @@ readonly fields: SupplierFieldRefs; */ export interface Prisma__SupplierClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" + productCharges = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + purchaseReceipts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> /** * Attaches callbacks for the resolution and/or rejection of the Promise. * @param onfulfilled The callback to execute when the Promise is resolved. @@ -982,6 +1244,10 @@ export type SupplierFindUniqueArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null /** * Filter, which Supplier to fetch. */ @@ -1000,6 +1266,10 @@ export type SupplierFindUniqueOrThrowArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null /** * Filter, which Supplier to fetch. */ @@ -1018,6 +1288,10 @@ export type SupplierFindFirstArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null /** * Filter, which Supplier to fetch. */ @@ -1066,6 +1340,10 @@ export type SupplierFindFirstOrThrowArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null /** * Filter, which Supplier to fetch. */ @@ -1114,6 +1392,10 @@ export type SupplierFindManyArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null /** * Filter, which Suppliers to fetch. */ @@ -1157,6 +1439,10 @@ export type SupplierCreateArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null /** * The data needed to create a Supplier. */ @@ -1186,6 +1472,10 @@ export type SupplierUpdateArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null /** * The data needed to update a Supplier. */ @@ -1226,6 +1516,10 @@ export type SupplierUpsertArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null /** * The filter to search for the Supplier to update in case it exists. */ @@ -1252,6 +1546,10 @@ export type SupplierDeleteArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null /** * Filter which Supplier to delete. */ @@ -1272,6 +1570,54 @@ export type SupplierDeleteManyArgs = { + /** + * Select specific fields to fetch from the ProductCharge + */ + select?: Prisma.ProductChargeSelect | null + /** + * Omit specific fields from the ProductCharge + */ + omit?: Prisma.ProductChargeOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.ProductChargeInclude | null + where?: Prisma.ProductChargeWhereInput + orderBy?: Prisma.ProductChargeOrderByWithRelationInput | Prisma.ProductChargeOrderByWithRelationInput[] + cursor?: Prisma.ProductChargeWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.ProductChargeScalarFieldEnum | Prisma.ProductChargeScalarFieldEnum[] +} + +/** + * Supplier.purchaseReceipts + */ +export type Supplier$purchaseReceiptsArgs = { + /** + * Select specific fields to fetch from the PurchaseReceipt + */ + select?: Prisma.PurchaseReceiptSelect | null + /** + * Omit specific fields from the PurchaseReceipt + */ + omit?: Prisma.PurchaseReceiptOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PurchaseReceiptInclude | null + where?: Prisma.PurchaseReceiptWhereInput + orderBy?: Prisma.PurchaseReceiptOrderByWithRelationInput | Prisma.PurchaseReceiptOrderByWithRelationInput[] + cursor?: Prisma.PurchaseReceiptWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PurchaseReceiptScalarFieldEnum | Prisma.PurchaseReceiptScalarFieldEnum[] +} + /** * Supplier without action */ @@ -1284,4 +1630,8 @@ export type SupplierDefaultArgs | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.SupplierInclude | null } diff --git a/src/generated/prisma/models/User.ts b/src/generated/prisma/models/User.ts index 7885044..483825c 100644 --- a/src/generated/prisma/models/User.ts +++ b/src/generated/prisma/models/User.ts @@ -43,6 +43,9 @@ export type UserMinAggregateOutputType = { firstName: string | null lastName: string | null roleId: number | null + createdAt: Date | null + deletedAt: Date | null + updatedAt: Date | null } export type UserMaxAggregateOutputType = { @@ -52,6 +55,9 @@ export type UserMaxAggregateOutputType = { firstName: string | null lastName: string | null roleId: number | null + createdAt: Date | null + deletedAt: Date | null + updatedAt: Date | null } export type UserCountAggregateOutputType = { @@ -61,6 +67,9 @@ export type UserCountAggregateOutputType = { firstName: number lastName: number roleId: number + createdAt: number + deletedAt: number + updatedAt: number _all: number } @@ -82,6 +91,9 @@ export type UserMinAggregateInputType = { firstName?: true lastName?: true roleId?: true + createdAt?: true + deletedAt?: true + updatedAt?: true } export type UserMaxAggregateInputType = { @@ -91,6 +103,9 @@ export type UserMaxAggregateInputType = { firstName?: true lastName?: true roleId?: true + createdAt?: true + deletedAt?: true + updatedAt?: true } export type UserCountAggregateInputType = { @@ -100,6 +115,9 @@ export type UserCountAggregateInputType = { firstName?: true lastName?: true roleId?: true + createdAt?: true + deletedAt?: true + updatedAt?: true _all?: true } @@ -196,6 +214,9 @@ export type UserGroupByOutputType = { firstName: string lastName: string roleId: number + createdAt: Date + deletedAt: Date | null + updatedAt: Date _count: UserCountAggregateOutputType | null _avg: UserAvgAggregateOutputType | null _sum: UserSumAggregateOutputType | null @@ -228,6 +249,9 @@ export type UserWhereInput = { firstName?: Prisma.StringFilter<"User"> | string lastName?: Prisma.StringFilter<"User"> | string roleId?: Prisma.IntFilter<"User"> | number + createdAt?: Prisma.DateTimeFilter<"User"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"User"> | Date | string | null + updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string role?: Prisma.XOR } @@ -238,6 +262,9 @@ export type UserOrderByWithRelationInput = { firstName?: Prisma.SortOrder lastName?: Prisma.SortOrder roleId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + updatedAt?: Prisma.SortOrder role?: Prisma.RoleOrderByWithRelationInput _relevance?: Prisma.UserOrderByRelevanceInput } @@ -252,6 +279,9 @@ export type UserWhereUniqueInput = Prisma.AtLeast<{ firstName?: Prisma.StringFilter<"User"> | string lastName?: Prisma.StringFilter<"User"> | string roleId?: Prisma.IntFilter<"User"> | number + createdAt?: Prisma.DateTimeFilter<"User"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"User"> | Date | string | null + updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string role?: Prisma.XOR }, "id" | "mobileNumber"> @@ -262,6 +292,9 @@ export type UserOrderByWithAggregationInput = { firstName?: Prisma.SortOrder lastName?: Prisma.SortOrder roleId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder + updatedAt?: Prisma.SortOrder _count?: Prisma.UserCountOrderByAggregateInput _avg?: Prisma.UserAvgOrderByAggregateInput _max?: Prisma.UserMaxOrderByAggregateInput @@ -279,6 +312,9 @@ export type UserScalarWhereWithAggregatesInput = { firstName?: Prisma.StringWithAggregatesFilter<"User"> | string lastName?: Prisma.StringWithAggregatesFilter<"User"> | string roleId?: Prisma.IntWithAggregatesFilter<"User"> | number + createdAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string + deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"User"> | Date | string | null + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"User"> | Date | string } export type UserCreateInput = { @@ -286,6 +322,9 @@ export type UserCreateInput = { password: string firstName: string lastName: string + createdAt?: Date | string + deletedAt?: Date | string | null + updatedAt?: Date | string role: Prisma.RoleCreateNestedOneWithoutUsersInput } @@ -296,6 +335,9 @@ export type UserUncheckedCreateInput = { firstName: string lastName: string roleId: number + createdAt?: Date | string + deletedAt?: Date | string | null + updatedAt?: Date | string } export type UserUpdateInput = { @@ -303,6 +345,9 @@ export type UserUpdateInput = { password?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.StringFieldUpdateOperationsInput | string lastName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string role?: Prisma.RoleUpdateOneRequiredWithoutUsersNestedInput } @@ -313,6 +358,9 @@ export type UserUncheckedUpdateInput = { firstName?: Prisma.StringFieldUpdateOperationsInput | string lastName?: Prisma.StringFieldUpdateOperationsInput | string roleId?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type UserCreateManyInput = { @@ -322,6 +370,9 @@ export type UserCreateManyInput = { firstName: string lastName: string roleId: number + createdAt?: Date | string + deletedAt?: Date | string | null + updatedAt?: Date | string } export type UserUpdateManyMutationInput = { @@ -329,6 +380,9 @@ export type UserUpdateManyMutationInput = { password?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.StringFieldUpdateOperationsInput | string lastName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type UserUncheckedUpdateManyInput = { @@ -338,6 +392,9 @@ export type UserUncheckedUpdateManyInput = { firstName?: Prisma.StringFieldUpdateOperationsInput | string lastName?: Prisma.StringFieldUpdateOperationsInput | string roleId?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type UserOrderByRelevanceInput = { @@ -353,6 +410,9 @@ export type UserCountOrderByAggregateInput = { firstName?: Prisma.SortOrder lastName?: Prisma.SortOrder roleId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder } export type UserAvgOrderByAggregateInput = { @@ -367,6 +427,9 @@ export type UserMaxOrderByAggregateInput = { firstName?: Prisma.SortOrder lastName?: Prisma.SortOrder roleId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder } export type UserMinOrderByAggregateInput = { @@ -376,6 +439,9 @@ export type UserMinOrderByAggregateInput = { firstName?: Prisma.SortOrder lastName?: Prisma.SortOrder roleId?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + deletedAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder } export type UserSumOrderByAggregateInput = { @@ -397,6 +463,14 @@ export type StringFieldUpdateOperationsInput = { set?: string } +export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string +} + +export type NullableDateTimeFieldUpdateOperationsInput = { + set?: Date | string | null +} + export type IntFieldUpdateOperationsInput = { set?: number increment?: number @@ -452,6 +526,9 @@ export type UserCreateWithoutRoleInput = { password: string firstName: string lastName: string + createdAt?: Date | string + deletedAt?: Date | string | null + updatedAt?: Date | string } export type UserUncheckedCreateWithoutRoleInput = { @@ -460,6 +537,9 @@ export type UserUncheckedCreateWithoutRoleInput = { password: string firstName: string lastName: string + createdAt?: Date | string + deletedAt?: Date | string | null + updatedAt?: Date | string } export type UserCreateOrConnectWithoutRoleInput = { @@ -498,6 +578,9 @@ export type UserScalarWhereInput = { firstName?: Prisma.StringFilter<"User"> | string lastName?: Prisma.StringFilter<"User"> | string roleId?: Prisma.IntFilter<"User"> | number + createdAt?: Prisma.DateTimeFilter<"User"> | Date | string + deletedAt?: Prisma.DateTimeNullableFilter<"User"> | Date | string | null + updatedAt?: Prisma.DateTimeFilter<"User"> | Date | string } export type UserCreateManyRoleInput = { @@ -506,6 +589,9 @@ export type UserCreateManyRoleInput = { password: string firstName: string lastName: string + createdAt?: Date | string + deletedAt?: Date | string | null + updatedAt?: Date | string } export type UserUpdateWithoutRoleInput = { @@ -513,6 +599,9 @@ export type UserUpdateWithoutRoleInput = { password?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.StringFieldUpdateOperationsInput | string lastName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type UserUncheckedUpdateWithoutRoleInput = { @@ -521,6 +610,9 @@ export type UserUncheckedUpdateWithoutRoleInput = { password?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.StringFieldUpdateOperationsInput | string lastName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } export type UserUncheckedUpdateManyWithoutRoleInput = { @@ -529,6 +621,9 @@ export type UserUncheckedUpdateManyWithoutRoleInput = { password?: Prisma.StringFieldUpdateOperationsInput | string firstName?: Prisma.StringFieldUpdateOperationsInput | string lastName?: Prisma.StringFieldUpdateOperationsInput | string + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string } @@ -540,6 +635,9 @@ export type UserSelect }, ExtArgs["result"]["user"]> @@ -552,9 +650,12 @@ export type UserSelectScalar = { firstName?: boolean lastName?: boolean roleId?: boolean + createdAt?: boolean + deletedAt?: boolean + updatedAt?: boolean } -export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "mobileNumber" | "password" | "firstName" | "lastName" | "roleId", ExtArgs["result"]["user"]> +export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "mobileNumber" | "password" | "firstName" | "lastName" | "roleId" | "createdAt" | "deletedAt" | "updatedAt", ExtArgs["result"]["user"]> export type UserInclude = { role?: boolean | Prisma.RoleDefaultArgs } @@ -571,6 +672,9 @@ export type $UserPayload composites: {} } @@ -947,6 +1051,9 @@ export interface UserFieldRefs { readonly firstName: Prisma.FieldRef<"User", 'String'> readonly lastName: Prisma.FieldRef<"User", 'String'> readonly roleId: Prisma.FieldRef<"User", 'Int'> + readonly createdAt: Prisma.FieldRef<"User", 'DateTime'> + readonly deletedAt: Prisma.FieldRef<"User", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"User", 'DateTime'> } diff --git a/src/generated/prisma/models/inventory_overview.ts b/src/generated/prisma/models/inventory_overview.ts new file mode 100644 index 0000000..d0e2b89 --- /dev/null +++ b/src/generated/prisma/models/inventory_overview.ts @@ -0,0 +1,713 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `inventory_overview` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model inventory_overview + * + */ +export type inventory_overviewModel = runtime.Types.Result.DefaultSelection + +export type AggregateInventory_overview = { + _count: Inventory_overviewCountAggregateOutputType | null + _avg: Inventory_overviewAvgAggregateOutputType | null + _sum: Inventory_overviewSumAggregateOutputType | null + _min: Inventory_overviewMinAggregateOutputType | null + _max: Inventory_overviewMaxAggregateOutputType | null +} + +export type Inventory_overviewAvgAggregateOutputType = { + ProductId: number | null + stock_quantity: runtime.Decimal | null + avgCost: runtime.Decimal | null + totalCost: runtime.Decimal | null +} + +export type Inventory_overviewSumAggregateOutputType = { + ProductId: number | null + stock_quantity: runtime.Decimal | null + avgCost: runtime.Decimal | null + totalCost: runtime.Decimal | null +} + +export type Inventory_overviewMinAggregateOutputType = { + ProductId: number | null + stock_quantity: runtime.Decimal | null + avgCost: runtime.Decimal | null + totalCost: runtime.Decimal | null + updatedAt: Date | null +} + +export type Inventory_overviewMaxAggregateOutputType = { + ProductId: number | null + stock_quantity: runtime.Decimal | null + avgCost: runtime.Decimal | null + totalCost: runtime.Decimal | null + updatedAt: Date | null +} + +export type Inventory_overviewCountAggregateOutputType = { + ProductId: number + stock_quantity: number + avgCost: number + totalCost: number + updatedAt: number + _all: number +} + + +export type Inventory_overviewAvgAggregateInputType = { + ProductId?: true + stock_quantity?: true + avgCost?: true + totalCost?: true +} + +export type Inventory_overviewSumAggregateInputType = { + ProductId?: true + stock_quantity?: true + avgCost?: true + totalCost?: true +} + +export type Inventory_overviewMinAggregateInputType = { + ProductId?: true + stock_quantity?: true + avgCost?: true + totalCost?: true + updatedAt?: true +} + +export type Inventory_overviewMaxAggregateInputType = { + ProductId?: true + stock_quantity?: true + avgCost?: true + totalCost?: true + updatedAt?: true +} + +export type Inventory_overviewCountAggregateInputType = { + ProductId?: true + stock_quantity?: true + avgCost?: true + totalCost?: true + updatedAt?: true + _all?: true +} + +export type Inventory_overviewAggregateArgs = { + /** + * Filter which inventory_overview to aggregate. + */ + where?: Prisma.inventory_overviewWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of inventory_overviews to fetch. + */ + orderBy?: Prisma.inventory_overviewOrderByWithRelationInput | Prisma.inventory_overviewOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` inventory_overviews from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` inventory_overviews. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned inventory_overviews + **/ + _count?: true | Inventory_overviewCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: Inventory_overviewAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: Inventory_overviewSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: Inventory_overviewMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: Inventory_overviewMaxAggregateInputType +} + +export type GetInventory_overviewAggregateType = { + [P in keyof T & keyof AggregateInventory_overview]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type inventory_overviewGroupByArgs = { + where?: Prisma.inventory_overviewWhereInput + orderBy?: Prisma.inventory_overviewOrderByWithAggregationInput | Prisma.inventory_overviewOrderByWithAggregationInput[] + by: Prisma.Inventory_overviewScalarFieldEnum[] | Prisma.Inventory_overviewScalarFieldEnum + having?: Prisma.inventory_overviewScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: Inventory_overviewCountAggregateInputType | true + _avg?: Inventory_overviewAvgAggregateInputType + _sum?: Inventory_overviewSumAggregateInputType + _min?: Inventory_overviewMinAggregateInputType + _max?: Inventory_overviewMaxAggregateInputType +} + +export type Inventory_overviewGroupByOutputType = { + ProductId: number + stock_quantity: runtime.Decimal + avgCost: runtime.Decimal + totalCost: runtime.Decimal + updatedAt: Date + _count: Inventory_overviewCountAggregateOutputType | null + _avg: Inventory_overviewAvgAggregateOutputType | null + _sum: Inventory_overviewSumAggregateOutputType | null + _min: Inventory_overviewMinAggregateOutputType | null + _max: Inventory_overviewMaxAggregateOutputType | null +} + +type GetInventory_overviewGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof Inventory_overviewGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type inventory_overviewWhereInput = { + AND?: Prisma.inventory_overviewWhereInput | Prisma.inventory_overviewWhereInput[] + OR?: Prisma.inventory_overviewWhereInput[] + NOT?: Prisma.inventory_overviewWhereInput | Prisma.inventory_overviewWhereInput[] + ProductId?: Prisma.IntFilter<"inventory_overview"> | number + stock_quantity?: Prisma.DecimalFilter<"inventory_overview"> | runtime.Decimal | runtime.DecimalJsLike | number | string + avgCost?: Prisma.DecimalFilter<"inventory_overview"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFilter<"inventory_overview"> | runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Prisma.DateTimeFilter<"inventory_overview"> | Date | string +} + +export type inventory_overviewOrderByWithRelationInput = { + ProductId?: Prisma.SortOrder + stock_quantity?: Prisma.SortOrder + avgCost?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type inventory_overviewOrderByWithAggregationInput = { + ProductId?: Prisma.SortOrder + stock_quantity?: Prisma.SortOrder + avgCost?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + _count?: Prisma.inventory_overviewCountOrderByAggregateInput + _avg?: Prisma.inventory_overviewAvgOrderByAggregateInput + _max?: Prisma.inventory_overviewMaxOrderByAggregateInput + _min?: Prisma.inventory_overviewMinOrderByAggregateInput + _sum?: Prisma.inventory_overviewSumOrderByAggregateInput +} + +export type inventory_overviewScalarWhereWithAggregatesInput = { + AND?: Prisma.inventory_overviewScalarWhereWithAggregatesInput | Prisma.inventory_overviewScalarWhereWithAggregatesInput[] + OR?: Prisma.inventory_overviewScalarWhereWithAggregatesInput[] + NOT?: Prisma.inventory_overviewScalarWhereWithAggregatesInput | Prisma.inventory_overviewScalarWhereWithAggregatesInput[] + ProductId?: Prisma.IntWithAggregatesFilter<"inventory_overview"> | number + stock_quantity?: Prisma.DecimalWithAggregatesFilter<"inventory_overview"> | runtime.Decimal | runtime.DecimalJsLike | number | string + avgCost?: Prisma.DecimalWithAggregatesFilter<"inventory_overview"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalWithAggregatesFilter<"inventory_overview"> | runtime.Decimal | runtime.DecimalJsLike | number | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"inventory_overview"> | Date | string +} + +export type inventory_overviewCountOrderByAggregateInput = { + ProductId?: Prisma.SortOrder + stock_quantity?: Prisma.SortOrder + avgCost?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type inventory_overviewAvgOrderByAggregateInput = { + ProductId?: Prisma.SortOrder + stock_quantity?: Prisma.SortOrder + avgCost?: Prisma.SortOrder + totalCost?: Prisma.SortOrder +} + +export type inventory_overviewMaxOrderByAggregateInput = { + ProductId?: Prisma.SortOrder + stock_quantity?: Prisma.SortOrder + avgCost?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type inventory_overviewMinOrderByAggregateInput = { + ProductId?: Prisma.SortOrder + stock_quantity?: Prisma.SortOrder + avgCost?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder +} + +export type inventory_overviewSumOrderByAggregateInput = { + ProductId?: Prisma.SortOrder + stock_quantity?: Prisma.SortOrder + avgCost?: Prisma.SortOrder + totalCost?: Prisma.SortOrder +} + + + +export type inventory_overviewSelect = runtime.Types.Extensions.GetSelect<{ + ProductId?: boolean + stock_quantity?: boolean + avgCost?: boolean + totalCost?: boolean + updatedAt?: boolean +}, ExtArgs["result"]["inventory_overview"]> + + + +export type inventory_overviewSelectScalar = { + ProductId?: boolean + stock_quantity?: boolean + avgCost?: boolean + totalCost?: boolean + updatedAt?: boolean +} + +export type inventory_overviewOmit = runtime.Types.Extensions.GetOmit<"ProductId" | "stock_quantity" | "avgCost" | "totalCost" | "updatedAt", ExtArgs["result"]["inventory_overview"]> + +export type $inventory_overviewPayload = { + name: "inventory_overview" + objects: {} + scalars: runtime.Types.Extensions.GetPayloadResult<{ + ProductId: number + stock_quantity: runtime.Decimal + avgCost: runtime.Decimal + totalCost: runtime.Decimal + updatedAt: Date + }, ExtArgs["result"]["inventory_overview"]> + composites: {} +} + +export type inventory_overviewGetPayload = runtime.Types.Result.GetResult + +export type inventory_overviewCountArgs = + Omit & { + select?: Inventory_overviewCountAggregateInputType | true + } + +export interface inventory_overviewDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['inventory_overview'], meta: { name: 'inventory_overview' } } + /** + * Find the first Inventory_overview that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {inventory_overviewFindFirstArgs} args - Arguments to find a Inventory_overview + * @example + * // Get one Inventory_overview + * const inventory_overview = await prisma.inventory_overview.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst ? { + orderBy: {} + } : {}, SkipDependenciesValidator extends "skip" extends Prisma.Keys ? { + orderBy: {} + } : {}>(args?: Prisma.SelectSubset> & TakeDependenciesValidator & SkipDependenciesValidator): Prisma.Prisma__inventory_overviewClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Inventory_overview that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {inventory_overviewFindFirstOrThrowArgs} args - Arguments to find a Inventory_overview + * @example + * // Get one Inventory_overview + * const inventory_overview = await prisma.inventory_overview.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow ? { + orderBy: {} + } : {}, SkipDependenciesValidator extends "skip" extends Prisma.Keys ? { + orderBy: {} + } : {}>(args?: Prisma.SelectSubset> & TakeDependenciesValidator & SkipDependenciesValidator): Prisma.Prisma__inventory_overviewClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Inventory_overviews that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {inventory_overviewFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Inventory_overviews + * const inventory_overviews = await prisma.inventory_overview.findMany() + * + * // Get first 10 Inventory_overviews + * const inventory_overviews = await prisma.inventory_overview.findMany({ take: 10 }) + * + * // Only select the `ProductId` + * const inventory_overviewWithProductIdOnly = await prisma.inventory_overview.findMany({ select: { ProductId: true } }) + * + */ + findMany ? { + orderBy: {} + } : {}, SkipDependenciesValidator extends "skip" extends Prisma.Keys ? { + orderBy: {} + } : {}>(args?: Prisma.SelectSubset> & TakeDependenciesValidator & SkipDependenciesValidator): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + + /** + * Count the number of Inventory_overviews. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {inventory_overviewCountArgs} args - Arguments to filter Inventory_overviews to count. + * @example + * // Count the number of Inventory_overviews + * const count = await prisma.inventory_overview.count({ + * where: { + * // ... the filter for the Inventory_overviews we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Inventory_overview. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {Inventory_overviewAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Inventory_overview. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {inventory_overviewGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends inventory_overviewGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: inventory_overviewGroupByArgs['orderBy'] } + : { orderBy?: inventory_overviewGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetInventory_overviewGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the inventory_overview model + */ +readonly fields: inventory_overviewFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for inventory_overview. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__inventory_overviewClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the inventory_overview model + */ +export interface inventory_overviewFieldRefs { + readonly ProductId: Prisma.FieldRef<"inventory_overview", 'Int'> + readonly stock_quantity: Prisma.FieldRef<"inventory_overview", 'Decimal'> + readonly avgCost: Prisma.FieldRef<"inventory_overview", 'Decimal'> + readonly totalCost: Prisma.FieldRef<"inventory_overview", 'Decimal'> + readonly updatedAt: Prisma.FieldRef<"inventory_overview", 'DateTime'> +} + + +// Custom InputTypes +/** + * inventory_overview findFirst + */ +export type inventory_overviewFindFirstArgs = { + /** + * Select specific fields to fetch from the inventory_overview + */ + select?: Prisma.inventory_overviewSelect | null + /** + * Omit specific fields from the inventory_overview + */ + omit?: Prisma.inventory_overviewOmit | null + /** + * Filter, which inventory_overview to fetch. + */ + where?: Prisma.inventory_overviewWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of inventory_overviews to fetch. + */ + orderBy?: Prisma.inventory_overviewOrderByWithRelationInput | Prisma.inventory_overviewOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` inventory_overviews from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` inventory_overviews. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of inventory_overviews. + */ + distinct?: Prisma.Inventory_overviewScalarFieldEnum | Prisma.Inventory_overviewScalarFieldEnum[] +} + +/** + * inventory_overview findFirstOrThrow + */ +export type inventory_overviewFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the inventory_overview + */ + select?: Prisma.inventory_overviewSelect | null + /** + * Omit specific fields from the inventory_overview + */ + omit?: Prisma.inventory_overviewOmit | null + /** + * Filter, which inventory_overview to fetch. + */ + where?: Prisma.inventory_overviewWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of inventory_overviews to fetch. + */ + orderBy?: Prisma.inventory_overviewOrderByWithRelationInput | Prisma.inventory_overviewOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` inventory_overviews from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` inventory_overviews. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of inventory_overviews. + */ + distinct?: Prisma.Inventory_overviewScalarFieldEnum | Prisma.Inventory_overviewScalarFieldEnum[] +} + +/** + * inventory_overview findMany + */ +export type inventory_overviewFindManyArgs = { + /** + * Select specific fields to fetch from the inventory_overview + */ + select?: Prisma.inventory_overviewSelect | null + /** + * Omit specific fields from the inventory_overview + */ + omit?: Prisma.inventory_overviewOmit | null + /** + * Filter, which inventory_overviews to fetch. + */ + where?: Prisma.inventory_overviewWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of inventory_overviews to fetch. + */ + orderBy?: Prisma.inventory_overviewOrderByWithRelationInput | Prisma.inventory_overviewOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` inventory_overviews from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` inventory_overviews. + */ + skip?: number + distinct?: Prisma.Inventory_overviewScalarFieldEnum | Prisma.Inventory_overviewScalarFieldEnum[] +} + +/** + * inventory_overview without action + */ +export type inventory_overviewDefaultArgs = { + /** + * Select specific fields to fetch from the inventory_overview + */ + select?: Prisma.inventory_overviewSelect | null + /** + * Omit specific fields from the inventory_overview + */ + omit?: Prisma.inventory_overviewOmit | null +} diff --git a/src/generated/prisma/models/stock_cardex.ts b/src/generated/prisma/models/stock_cardex.ts new file mode 100644 index 0000000..4a3d911 --- /dev/null +++ b/src/generated/prisma/models/stock_cardex.ts @@ -0,0 +1,803 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `stock_cardex` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model stock_cardex + * + */ +export type stock_cardexModel = runtime.Types.Result.DefaultSelection + +export type AggregateStock_cardex = { + _count: Stock_cardexCountAggregateOutputType | null + _avg: Stock_cardexAvgAggregateOutputType | null + _sum: Stock_cardexSumAggregateOutputType | null + _min: Stock_cardexMinAggregateOutputType | null + _max: Stock_cardexMaxAggregateOutputType | null +} + +export type Stock_cardexAvgAggregateOutputType = { + productId: number | null + movement_id: number | null + quantity: runtime.Decimal | null + fee: runtime.Decimal | null + totalCost: runtime.Decimal | null + balance_quantity: runtime.Decimal | null + balance_avg_cost: runtime.Decimal | null +} + +export type Stock_cardexSumAggregateOutputType = { + productId: number | null + movement_id: number | null + quantity: runtime.Decimal | null + fee: runtime.Decimal | null + totalCost: runtime.Decimal | null + balance_quantity: runtime.Decimal | null + balance_avg_cost: runtime.Decimal | null +} + +export type Stock_cardexMinAggregateOutputType = { + productId: number | null + movement_id: number | null + type: $Enums.stock_cardex_type | null + quantity: runtime.Decimal | null + fee: runtime.Decimal | null + totalCost: runtime.Decimal | null + balance_quantity: runtime.Decimal | null + balance_avg_cost: runtime.Decimal | null + createdAt: Date | null +} + +export type Stock_cardexMaxAggregateOutputType = { + productId: number | null + movement_id: number | null + type: $Enums.stock_cardex_type | null + quantity: runtime.Decimal | null + fee: runtime.Decimal | null + totalCost: runtime.Decimal | null + balance_quantity: runtime.Decimal | null + balance_avg_cost: runtime.Decimal | null + createdAt: Date | null +} + +export type Stock_cardexCountAggregateOutputType = { + productId: number + movement_id: number + type: number + quantity: number + fee: number + totalCost: number + balance_quantity: number + balance_avg_cost: number + createdAt: number + _all: number +} + + +export type Stock_cardexAvgAggregateInputType = { + productId?: true + movement_id?: true + quantity?: true + fee?: true + totalCost?: true + balance_quantity?: true + balance_avg_cost?: true +} + +export type Stock_cardexSumAggregateInputType = { + productId?: true + movement_id?: true + quantity?: true + fee?: true + totalCost?: true + balance_quantity?: true + balance_avg_cost?: true +} + +export type Stock_cardexMinAggregateInputType = { + productId?: true + movement_id?: true + type?: true + quantity?: true + fee?: true + totalCost?: true + balance_quantity?: true + balance_avg_cost?: true + createdAt?: true +} + +export type Stock_cardexMaxAggregateInputType = { + productId?: true + movement_id?: true + type?: true + quantity?: true + fee?: true + totalCost?: true + balance_quantity?: true + balance_avg_cost?: true + createdAt?: true +} + +export type Stock_cardexCountAggregateInputType = { + productId?: true + movement_id?: true + type?: true + quantity?: true + fee?: true + totalCost?: true + balance_quantity?: true + balance_avg_cost?: true + createdAt?: true + _all?: true +} + +export type Stock_cardexAggregateArgs = { + /** + * Filter which stock_cardex to aggregate. + */ + where?: Prisma.stock_cardexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of stock_cardexes to fetch. + */ + orderBy?: Prisma.stock_cardexOrderByWithRelationInput | Prisma.stock_cardexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` stock_cardexes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` stock_cardexes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned stock_cardexes + **/ + _count?: true | Stock_cardexCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: Stock_cardexAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: Stock_cardexSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: Stock_cardexMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: Stock_cardexMaxAggregateInputType +} + +export type GetStock_cardexAggregateType = { + [P in keyof T & keyof AggregateStock_cardex]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type stock_cardexGroupByArgs = { + where?: Prisma.stock_cardexWhereInput + orderBy?: Prisma.stock_cardexOrderByWithAggregationInput | Prisma.stock_cardexOrderByWithAggregationInput[] + by: Prisma.Stock_cardexScalarFieldEnum[] | Prisma.Stock_cardexScalarFieldEnum + having?: Prisma.stock_cardexScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: Stock_cardexCountAggregateInputType | true + _avg?: Stock_cardexAvgAggregateInputType + _sum?: Stock_cardexSumAggregateInputType + _min?: Stock_cardexMinAggregateInputType + _max?: Stock_cardexMaxAggregateInputType +} + +export type Stock_cardexGroupByOutputType = { + productId: number + movement_id: number + type: $Enums.stock_cardex_type + quantity: runtime.Decimal + fee: runtime.Decimal + totalCost: runtime.Decimal + balance_quantity: runtime.Decimal | null + balance_avg_cost: runtime.Decimal | null + createdAt: Date + _count: Stock_cardexCountAggregateOutputType | null + _avg: Stock_cardexAvgAggregateOutputType | null + _sum: Stock_cardexSumAggregateOutputType | null + _min: Stock_cardexMinAggregateOutputType | null + _max: Stock_cardexMaxAggregateOutputType | null +} + +type GetStock_cardexGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof Stock_cardexGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type stock_cardexWhereInput = { + AND?: Prisma.stock_cardexWhereInput | Prisma.stock_cardexWhereInput[] + OR?: Prisma.stock_cardexWhereInput[] + NOT?: Prisma.stock_cardexWhereInput | Prisma.stock_cardexWhereInput[] + productId?: Prisma.IntFilter<"stock_cardex"> | number + movement_id?: Prisma.IntFilter<"stock_cardex"> | number + type?: Prisma.Enumstock_cardex_typeFilter<"stock_cardex"> | $Enums.stock_cardex_type + quantity?: Prisma.DecimalFilter<"stock_cardex"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalFilter<"stock_cardex"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalFilter<"stock_cardex"> | runtime.Decimal | runtime.DecimalJsLike | number | string + balance_quantity?: Prisma.DecimalNullableFilter<"stock_cardex"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null + balance_avg_cost?: Prisma.DecimalNullableFilter<"stock_cardex"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null + createdAt?: Prisma.DateTimeFilter<"stock_cardex"> | Date | string +} + +export type stock_cardexOrderByWithRelationInput = { + productId?: Prisma.SortOrder + movement_id?: Prisma.SortOrder + type?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + balance_quantity?: Prisma.SortOrderInput | Prisma.SortOrder + balance_avg_cost?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type stock_cardexOrderByWithAggregationInput = { + productId?: Prisma.SortOrder + movement_id?: Prisma.SortOrder + type?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + balance_quantity?: Prisma.SortOrderInput | Prisma.SortOrder + balance_avg_cost?: Prisma.SortOrderInput | Prisma.SortOrder + createdAt?: Prisma.SortOrder + _count?: Prisma.stock_cardexCountOrderByAggregateInput + _avg?: Prisma.stock_cardexAvgOrderByAggregateInput + _max?: Prisma.stock_cardexMaxOrderByAggregateInput + _min?: Prisma.stock_cardexMinOrderByAggregateInput + _sum?: Prisma.stock_cardexSumOrderByAggregateInput +} + +export type stock_cardexScalarWhereWithAggregatesInput = { + AND?: Prisma.stock_cardexScalarWhereWithAggregatesInput | Prisma.stock_cardexScalarWhereWithAggregatesInput[] + OR?: Prisma.stock_cardexScalarWhereWithAggregatesInput[] + NOT?: Prisma.stock_cardexScalarWhereWithAggregatesInput | Prisma.stock_cardexScalarWhereWithAggregatesInput[] + productId?: Prisma.IntWithAggregatesFilter<"stock_cardex"> | number + movement_id?: Prisma.IntWithAggregatesFilter<"stock_cardex"> | number + type?: Prisma.Enumstock_cardex_typeWithAggregatesFilter<"stock_cardex"> | $Enums.stock_cardex_type + quantity?: Prisma.DecimalWithAggregatesFilter<"stock_cardex"> | runtime.Decimal | runtime.DecimalJsLike | number | string + fee?: Prisma.DecimalWithAggregatesFilter<"stock_cardex"> | runtime.Decimal | runtime.DecimalJsLike | number | string + totalCost?: Prisma.DecimalWithAggregatesFilter<"stock_cardex"> | runtime.Decimal | runtime.DecimalJsLike | number | string + balance_quantity?: Prisma.DecimalNullableWithAggregatesFilter<"stock_cardex"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null + balance_avg_cost?: Prisma.DecimalNullableWithAggregatesFilter<"stock_cardex"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null + createdAt?: Prisma.DateTimeWithAggregatesFilter<"stock_cardex"> | Date | string +} + +export type stock_cardexCountOrderByAggregateInput = { + productId?: Prisma.SortOrder + movement_id?: Prisma.SortOrder + type?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + balance_quantity?: Prisma.SortOrder + balance_avg_cost?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type stock_cardexAvgOrderByAggregateInput = { + productId?: Prisma.SortOrder + movement_id?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + balance_quantity?: Prisma.SortOrder + balance_avg_cost?: Prisma.SortOrder +} + +export type stock_cardexMaxOrderByAggregateInput = { + productId?: Prisma.SortOrder + movement_id?: Prisma.SortOrder + type?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + balance_quantity?: Prisma.SortOrder + balance_avg_cost?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type stock_cardexMinOrderByAggregateInput = { + productId?: Prisma.SortOrder + movement_id?: Prisma.SortOrder + type?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + balance_quantity?: Prisma.SortOrder + balance_avg_cost?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type stock_cardexSumOrderByAggregateInput = { + productId?: Prisma.SortOrder + movement_id?: Prisma.SortOrder + quantity?: Prisma.SortOrder + fee?: Prisma.SortOrder + totalCost?: Prisma.SortOrder + balance_quantity?: Prisma.SortOrder + balance_avg_cost?: Prisma.SortOrder +} + + + +export type stock_cardexSelect = runtime.Types.Extensions.GetSelect<{ + productId?: boolean + movement_id?: boolean + type?: boolean + quantity?: boolean + fee?: boolean + totalCost?: boolean + balance_quantity?: boolean + balance_avg_cost?: boolean + createdAt?: boolean +}, ExtArgs["result"]["stock_cardex"]> + + + +export type stock_cardexSelectScalar = { + productId?: boolean + movement_id?: boolean + type?: boolean + quantity?: boolean + fee?: boolean + totalCost?: boolean + balance_quantity?: boolean + balance_avg_cost?: boolean + createdAt?: boolean +} + +export type stock_cardexOmit = runtime.Types.Extensions.GetOmit<"productId" | "movement_id" | "type" | "quantity" | "fee" | "totalCost" | "balance_quantity" | "balance_avg_cost" | "createdAt", ExtArgs["result"]["stock_cardex"]> + +export type $stock_cardexPayload = { + name: "stock_cardex" + objects: {} + scalars: runtime.Types.Extensions.GetPayloadResult<{ + productId: number + movement_id: number + type: $Enums.stock_cardex_type + quantity: runtime.Decimal + fee: runtime.Decimal + totalCost: runtime.Decimal + balance_quantity: runtime.Decimal | null + balance_avg_cost: runtime.Decimal | null + createdAt: Date + }, ExtArgs["result"]["stock_cardex"]> + composites: {} +} + +export type stock_cardexGetPayload = runtime.Types.Result.GetResult + +export type stock_cardexCountArgs = + Omit & { + select?: Stock_cardexCountAggregateInputType | true + } + +export interface stock_cardexDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['stock_cardex'], meta: { name: 'stock_cardex' } } + /** + * Find the first Stock_cardex that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {stock_cardexFindFirstArgs} args - Arguments to find a Stock_cardex + * @example + * // Get one Stock_cardex + * const stock_cardex = await prisma.stock_cardex.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst ? { + orderBy: {} + } : {}, SkipDependenciesValidator extends "skip" extends Prisma.Keys ? { + orderBy: {} + } : {}>(args?: Prisma.SelectSubset> & TakeDependenciesValidator & SkipDependenciesValidator): Prisma.Prisma__stock_cardexClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Stock_cardex that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {stock_cardexFindFirstOrThrowArgs} args - Arguments to find a Stock_cardex + * @example + * // Get one Stock_cardex + * const stock_cardex = await prisma.stock_cardex.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow ? { + orderBy: {} + } : {}, SkipDependenciesValidator extends "skip" extends Prisma.Keys ? { + orderBy: {} + } : {}>(args?: Prisma.SelectSubset> & TakeDependenciesValidator & SkipDependenciesValidator): Prisma.Prisma__stock_cardexClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Stock_cardexes that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {stock_cardexFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Stock_cardexes + * const stock_cardexes = await prisma.stock_cardex.findMany() + * + * // Get first 10 Stock_cardexes + * const stock_cardexes = await prisma.stock_cardex.findMany({ take: 10 }) + * + * // Only select the `productId` + * const stock_cardexWithProductIdOnly = await prisma.stock_cardex.findMany({ select: { productId: true } }) + * + */ + findMany ? { + orderBy: {} + } : {}, SkipDependenciesValidator extends "skip" extends Prisma.Keys ? { + orderBy: {} + } : {}>(args?: Prisma.SelectSubset> & TakeDependenciesValidator & SkipDependenciesValidator): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + + /** + * Count the number of Stock_cardexes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {stock_cardexCountArgs} args - Arguments to filter Stock_cardexes to count. + * @example + * // Count the number of Stock_cardexes + * const count = await prisma.stock_cardex.count({ + * where: { + * // ... the filter for the Stock_cardexes we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Stock_cardex. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {Stock_cardexAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Stock_cardex. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {stock_cardexGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends stock_cardexGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: stock_cardexGroupByArgs['orderBy'] } + : { orderBy?: stock_cardexGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetStock_cardexGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the stock_cardex model + */ +readonly fields: stock_cardexFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for stock_cardex. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__stock_cardexClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the stock_cardex model + */ +export interface stock_cardexFieldRefs { + readonly productId: Prisma.FieldRef<"stock_cardex", 'Int'> + readonly movement_id: Prisma.FieldRef<"stock_cardex", 'Int'> + readonly type: Prisma.FieldRef<"stock_cardex", 'stock_cardex_type'> + readonly quantity: Prisma.FieldRef<"stock_cardex", 'Decimal'> + readonly fee: Prisma.FieldRef<"stock_cardex", 'Decimal'> + readonly totalCost: Prisma.FieldRef<"stock_cardex", 'Decimal'> + readonly balance_quantity: Prisma.FieldRef<"stock_cardex", 'Decimal'> + readonly balance_avg_cost: Prisma.FieldRef<"stock_cardex", 'Decimal'> + readonly createdAt: Prisma.FieldRef<"stock_cardex", 'DateTime'> +} + + +// Custom InputTypes +/** + * stock_cardex findFirst + */ +export type stock_cardexFindFirstArgs = { + /** + * Select specific fields to fetch from the stock_cardex + */ + select?: Prisma.stock_cardexSelect | null + /** + * Omit specific fields from the stock_cardex + */ + omit?: Prisma.stock_cardexOmit | null + /** + * Filter, which stock_cardex to fetch. + */ + where?: Prisma.stock_cardexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of stock_cardexes to fetch. + */ + orderBy?: Prisma.stock_cardexOrderByWithRelationInput | Prisma.stock_cardexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` stock_cardexes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` stock_cardexes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of stock_cardexes. + */ + distinct?: Prisma.Stock_cardexScalarFieldEnum | Prisma.Stock_cardexScalarFieldEnum[] +} + +/** + * stock_cardex findFirstOrThrow + */ +export type stock_cardexFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the stock_cardex + */ + select?: Prisma.stock_cardexSelect | null + /** + * Omit specific fields from the stock_cardex + */ + omit?: Prisma.stock_cardexOmit | null + /** + * Filter, which stock_cardex to fetch. + */ + where?: Prisma.stock_cardexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of stock_cardexes to fetch. + */ + orderBy?: Prisma.stock_cardexOrderByWithRelationInput | Prisma.stock_cardexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` stock_cardexes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` stock_cardexes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of stock_cardexes. + */ + distinct?: Prisma.Stock_cardexScalarFieldEnum | Prisma.Stock_cardexScalarFieldEnum[] +} + +/** + * stock_cardex findMany + */ +export type stock_cardexFindManyArgs = { + /** + * Select specific fields to fetch from the stock_cardex + */ + select?: Prisma.stock_cardexSelect | null + /** + * Omit specific fields from the stock_cardex + */ + omit?: Prisma.stock_cardexOmit | null + /** + * Filter, which stock_cardexes to fetch. + */ + where?: Prisma.stock_cardexWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of stock_cardexes to fetch. + */ + orderBy?: Prisma.stock_cardexOrderByWithRelationInput | Prisma.stock_cardexOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` stock_cardexes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` stock_cardexes. + */ + skip?: number + distinct?: Prisma.Stock_cardexScalarFieldEnum | Prisma.Stock_cardexScalarFieldEnum[] +} + +/** + * stock_cardex without action + */ +export type stock_cardexDefaultArgs = { + /** + * Select specific fields to fetch from the stock_cardex + */ + select?: Prisma.stock_cardexSelect | null + /** + * Omit specific fields from the stock_cardex + */ + omit?: Prisma.stock_cardexOmit | null +} diff --git a/src/generated/prisma/models/stock_view.ts b/src/generated/prisma/models/stock_view.ts new file mode 100644 index 0000000..66146d2 --- /dev/null +++ b/src/generated/prisma/models/stock_view.ts @@ -0,0 +1,671 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// biome-ignore-all lint: generated file +// @ts-nocheck +/* + * This file exports the `stock_view` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model stock_view + * + */ +export type stock_viewModel = runtime.Types.Result.DefaultSelection + +export type AggregateStock_view = { + _count: Stock_viewCountAggregateOutputType | null + _avg: Stock_viewAvgAggregateOutputType | null + _sum: Stock_viewSumAggregateOutputType | null + _min: Stock_viewMinAggregateOutputType | null + _max: Stock_viewMaxAggregateOutputType | null +} + +export type Stock_viewAvgAggregateOutputType = { + productId: number | null + inventoryId: number | null + stock: runtime.Decimal | null +} + +export type Stock_viewSumAggregateOutputType = { + productId: number | null + inventoryId: number | null + stock: runtime.Decimal | null +} + +export type Stock_viewMinAggregateOutputType = { + productId: number | null + inventoryId: number | null + stock: runtime.Decimal | null +} + +export type Stock_viewMaxAggregateOutputType = { + productId: number | null + inventoryId: number | null + stock: runtime.Decimal | null +} + +export type Stock_viewCountAggregateOutputType = { + productId: number + inventoryId: number + stock: number + _all: number +} + + +export type Stock_viewAvgAggregateInputType = { + productId?: true + inventoryId?: true + stock?: true +} + +export type Stock_viewSumAggregateInputType = { + productId?: true + inventoryId?: true + stock?: true +} + +export type Stock_viewMinAggregateInputType = { + productId?: true + inventoryId?: true + stock?: true +} + +export type Stock_viewMaxAggregateInputType = { + productId?: true + inventoryId?: true + stock?: true +} + +export type Stock_viewCountAggregateInputType = { + productId?: true + inventoryId?: true + stock?: true + _all?: true +} + +export type Stock_viewAggregateArgs = { + /** + * Filter which stock_view to aggregate. + */ + where?: Prisma.stock_viewWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of stock_views to fetch. + */ + orderBy?: Prisma.stock_viewOrderByWithRelationInput | Prisma.stock_viewOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` stock_views from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` stock_views. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned stock_views + **/ + _count?: true | Stock_viewCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: Stock_viewAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: Stock_viewSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: Stock_viewMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: Stock_viewMaxAggregateInputType +} + +export type GetStock_viewAggregateType = { + [P in keyof T & keyof AggregateStock_view]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type stock_viewGroupByArgs = { + where?: Prisma.stock_viewWhereInput + orderBy?: Prisma.stock_viewOrderByWithAggregationInput | Prisma.stock_viewOrderByWithAggregationInput[] + by: Prisma.Stock_viewScalarFieldEnum[] | Prisma.Stock_viewScalarFieldEnum + having?: Prisma.stock_viewScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: Stock_viewCountAggregateInputType | true + _avg?: Stock_viewAvgAggregateInputType + _sum?: Stock_viewSumAggregateInputType + _min?: Stock_viewMinAggregateInputType + _max?: Stock_viewMaxAggregateInputType +} + +export type Stock_viewGroupByOutputType = { + productId: number + inventoryId: number + stock: runtime.Decimal | null + _count: Stock_viewCountAggregateOutputType | null + _avg: Stock_viewAvgAggregateOutputType | null + _sum: Stock_viewSumAggregateOutputType | null + _min: Stock_viewMinAggregateOutputType | null + _max: Stock_viewMaxAggregateOutputType | null +} + +type GetStock_viewGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof Stock_viewGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type stock_viewWhereInput = { + AND?: Prisma.stock_viewWhereInput | Prisma.stock_viewWhereInput[] + OR?: Prisma.stock_viewWhereInput[] + NOT?: Prisma.stock_viewWhereInput | Prisma.stock_viewWhereInput[] + productId?: Prisma.IntFilter<"stock_view"> | number + inventoryId?: Prisma.IntFilter<"stock_view"> | number + stock?: Prisma.DecimalNullableFilter<"stock_view"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null +} + +export type stock_viewOrderByWithRelationInput = { + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + stock?: Prisma.SortOrderInput | Prisma.SortOrder +} + +export type stock_viewOrderByWithAggregationInput = { + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + stock?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.stock_viewCountOrderByAggregateInput + _avg?: Prisma.stock_viewAvgOrderByAggregateInput + _max?: Prisma.stock_viewMaxOrderByAggregateInput + _min?: Prisma.stock_viewMinOrderByAggregateInput + _sum?: Prisma.stock_viewSumOrderByAggregateInput +} + +export type stock_viewScalarWhereWithAggregatesInput = { + AND?: Prisma.stock_viewScalarWhereWithAggregatesInput | Prisma.stock_viewScalarWhereWithAggregatesInput[] + OR?: Prisma.stock_viewScalarWhereWithAggregatesInput[] + NOT?: Prisma.stock_viewScalarWhereWithAggregatesInput | Prisma.stock_viewScalarWhereWithAggregatesInput[] + productId?: Prisma.IntWithAggregatesFilter<"stock_view"> | number + inventoryId?: Prisma.IntWithAggregatesFilter<"stock_view"> | number + stock?: Prisma.DecimalNullableWithAggregatesFilter<"stock_view"> | runtime.Decimal | runtime.DecimalJsLike | number | string | null +} + +export type stock_viewCountOrderByAggregateInput = { + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + stock?: Prisma.SortOrder +} + +export type stock_viewAvgOrderByAggregateInput = { + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + stock?: Prisma.SortOrder +} + +export type stock_viewMaxOrderByAggregateInput = { + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + stock?: Prisma.SortOrder +} + +export type stock_viewMinOrderByAggregateInput = { + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + stock?: Prisma.SortOrder +} + +export type stock_viewSumOrderByAggregateInput = { + productId?: Prisma.SortOrder + inventoryId?: Prisma.SortOrder + stock?: Prisma.SortOrder +} + + + +export type stock_viewSelect = runtime.Types.Extensions.GetSelect<{ + productId?: boolean + inventoryId?: boolean + stock?: boolean +}, ExtArgs["result"]["stock_view"]> + + + +export type stock_viewSelectScalar = { + productId?: boolean + inventoryId?: boolean + stock?: boolean +} + +export type stock_viewOmit = runtime.Types.Extensions.GetOmit<"productId" | "inventoryId" | "stock", ExtArgs["result"]["stock_view"]> + +export type $stock_viewPayload = { + name: "stock_view" + objects: {} + scalars: runtime.Types.Extensions.GetPayloadResult<{ + productId: number + inventoryId: number + stock: runtime.Decimal | null + }, ExtArgs["result"]["stock_view"]> + composites: {} +} + +export type stock_viewGetPayload = runtime.Types.Result.GetResult + +export type stock_viewCountArgs = + Omit & { + select?: Stock_viewCountAggregateInputType | true + } + +export interface stock_viewDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['stock_view'], meta: { name: 'stock_view' } } + /** + * Find the first Stock_view that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {stock_viewFindFirstArgs} args - Arguments to find a Stock_view + * @example + * // Get one Stock_view + * const stock_view = await prisma.stock_view.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst ? { + orderBy: {} + } : {}, SkipDependenciesValidator extends "skip" extends Prisma.Keys ? { + orderBy: {} + } : {}>(args?: Prisma.SelectSubset> & TakeDependenciesValidator & SkipDependenciesValidator): Prisma.Prisma__stock_viewClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Stock_view that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {stock_viewFindFirstOrThrowArgs} args - Arguments to find a Stock_view + * @example + * // Get one Stock_view + * const stock_view = await prisma.stock_view.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow ? { + orderBy: {} + } : {}, SkipDependenciesValidator extends "skip" extends Prisma.Keys ? { + orderBy: {} + } : {}>(args?: Prisma.SelectSubset> & TakeDependenciesValidator & SkipDependenciesValidator): Prisma.Prisma__stock_viewClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Stock_views that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {stock_viewFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Stock_views + * const stock_views = await prisma.stock_view.findMany() + * + * // Get first 10 Stock_views + * const stock_views = await prisma.stock_view.findMany({ take: 10 }) + * + * // Only select the `productId` + * const stock_viewWithProductIdOnly = await prisma.stock_view.findMany({ select: { productId: true } }) + * + */ + findMany ? { + orderBy: {} + } : {}, SkipDependenciesValidator extends "skip" extends Prisma.Keys ? { + orderBy: {} + } : {}>(args?: Prisma.SelectSubset> & TakeDependenciesValidator & SkipDependenciesValidator): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + + /** + * Count the number of Stock_views. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {stock_viewCountArgs} args - Arguments to filter Stock_views to count. + * @example + * // Count the number of Stock_views + * const count = await prisma.stock_view.count({ + * where: { + * // ... the filter for the Stock_views we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Stock_view. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {Stock_viewAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Stock_view. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {stock_viewGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends stock_viewGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: stock_viewGroupByArgs['orderBy'] } + : { orderBy?: stock_viewGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetStock_viewGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the stock_view model + */ +readonly fields: stock_viewFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for stock_view. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ +export interface Prisma__stock_viewClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): runtime.Types.Utils.JsPromise + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the stock_view model + */ +export interface stock_viewFieldRefs { + readonly productId: Prisma.FieldRef<"stock_view", 'Int'> + readonly inventoryId: Prisma.FieldRef<"stock_view", 'Int'> + readonly stock: Prisma.FieldRef<"stock_view", 'Decimal'> +} + + +// Custom InputTypes +/** + * stock_view findFirst + */ +export type stock_viewFindFirstArgs = { + /** + * Select specific fields to fetch from the stock_view + */ + select?: Prisma.stock_viewSelect | null + /** + * Omit specific fields from the stock_view + */ + omit?: Prisma.stock_viewOmit | null + /** + * Filter, which stock_view to fetch. + */ + where?: Prisma.stock_viewWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of stock_views to fetch. + */ + orderBy?: Prisma.stock_viewOrderByWithRelationInput | Prisma.stock_viewOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` stock_views from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` stock_views. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of stock_views. + */ + distinct?: Prisma.Stock_viewScalarFieldEnum | Prisma.Stock_viewScalarFieldEnum[] +} + +/** + * stock_view findFirstOrThrow + */ +export type stock_viewFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the stock_view + */ + select?: Prisma.stock_viewSelect | null + /** + * Omit specific fields from the stock_view + */ + omit?: Prisma.stock_viewOmit | null + /** + * Filter, which stock_view to fetch. + */ + where?: Prisma.stock_viewWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of stock_views to fetch. + */ + orderBy?: Prisma.stock_viewOrderByWithRelationInput | Prisma.stock_viewOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` stock_views from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` stock_views. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of stock_views. + */ + distinct?: Prisma.Stock_viewScalarFieldEnum | Prisma.Stock_viewScalarFieldEnum[] +} + +/** + * stock_view findMany + */ +export type stock_viewFindManyArgs = { + /** + * Select specific fields to fetch from the stock_view + */ + select?: Prisma.stock_viewSelect | null + /** + * Omit specific fields from the stock_view + */ + omit?: Prisma.stock_viewOmit | null + /** + * Filter, which stock_views to fetch. + */ + where?: Prisma.stock_viewWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of stock_views to fetch. + */ + orderBy?: Prisma.stock_viewOrderByWithRelationInput | Prisma.stock_viewOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` stock_views from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` stock_views. + */ + skip?: number + distinct?: Prisma.Stock_viewScalarFieldEnum | Prisma.Stock_viewScalarFieldEnum[] +} + +/** + * stock_view without action + */ +export type stock_viewDefaultArgs = { + /** + * Select specific fields to fetch from the stock_view + */ + select?: Prisma.stock_viewSelect | null + /** + * Omit specific fields from the stock_view + */ + omit?: Prisma.stock_viewOmit | null +} diff --git a/src/inventories/inventories.service.ts b/src/inventories/inventories.service.ts index da22d25..724f9b0 100644 --- a/src/inventories/inventories.service.ts +++ b/src/inventories/inventories.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common' +import { ShortEntity } from '../common/interfaces/response-models' import { ResponseMapper } from '../common/response/response-mapper' import { PrismaService } from '../prisma/prisma.service' @@ -11,14 +12,52 @@ export class InventoriesService { } async findAll() { - const items = await this.prisma.inventory.findMany() - return ResponseMapper.list(items) + const items = await this.prisma.inventory.findMany({ + include: { productCharges: { include: { product: true } } }, + }) + + const mapped = items.map(i => { + const productsMap: Record = {} + for (const pc of i.productCharges ?? []) { + if (pc.product) { + productsMap[pc.product.id] = { id: pc.product.id, name: pc.product.name } + } + } + const groupedProducts = Object.values(productsMap) + const { productCharges, ...rest } = i as any + return { ...rest, groupedProducts } + }) + + return ResponseMapper.list(mapped) } async findOne(id: number) { - const item = await this.prisma.inventory.findUnique({ where: { id } }) + const item = await this.prisma.inventory.findUnique({ + where: { id }, + include: { productCharges: { include: { product: true } } }, + }) if (!item) return null - return ResponseMapper.single(item) + const productsMap: Record = {} + for (const pc of item.productCharges ?? []) { + const pid = pc.productId + const pname = pc.product?.name ?? `#${pid}` + if (!productsMap[pid]) productsMap[pid] = { id: pid, name: pname, count: 0 } + productsMap[pid].count += Number(pc.count) + } + + const productsWithCount = Object.values(productsMap) + const groupedProducts: ShortEntity[] = productsWithCount.map(p => ({ + id: p.id, + name: p.name, + })) + + const { productCharges, ...rest } = item as any + const itemWithCounts = { + ...rest, + products: productsWithCount, + groupedProducts, + } + return ResponseMapper.single(itemWithCounts) } async update(id: number, data: any) { diff --git a/src/inventories/models/response-inventory.dto.ts b/src/inventories/models/response-inventory.dto.ts new file mode 100644 index 0000000..b65a3e6 --- /dev/null +++ b/src/inventories/models/response-inventory.dto.ts @@ -0,0 +1,5 @@ +export interface IInventoryResponse { + name: string + location?: string + isActive: boolean +} diff --git a/src/inventory-transfer-items/dto/create-inventory-transfer-item.dto.ts b/src/inventory-transfer-items/dto/create-inventory-transfer-item.dto.ts new file mode 100644 index 0000000..b042197 --- /dev/null +++ b/src/inventory-transfer-items/dto/create-inventory-transfer-item.dto.ts @@ -0,0 +1,16 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber } from 'class-validator' + +export class CreateInventoryTransferItemDto { + @Type(() => Number) + @IsNumber() + count: number + + @Type(() => Number) + @IsInt() + productId: number + + @Type(() => Number) + @IsInt() + transferId: number +} diff --git a/src/inventory-transfer-items/dto/update-inventory-transfer-item.dto.ts b/src/inventory-transfer-items/dto/update-inventory-transfer-item.dto.ts new file mode 100644 index 0000000..91ab9af --- /dev/null +++ b/src/inventory-transfer-items/dto/update-inventory-transfer-item.dto.ts @@ -0,0 +1,19 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber, IsOptional } from 'class-validator' + +export class UpdateInventoryTransferItemDto { + @IsOptional() + @Type(() => Number) + @IsNumber() + count?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + productId?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + transferId?: number +} diff --git a/src/inventory-transfer-items/inventory-transfer-items.controller.ts b/src/inventory-transfer-items/inventory-transfer-items.controller.ts new file mode 100644 index 0000000..ba2de37 --- /dev/null +++ b/src/inventory-transfer-items/inventory-transfer-items.controller.ts @@ -0,0 +1,42 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreateInventoryTransferItemDto } from './dto/create-inventory-transfer-item.dto' +import { UpdateInventoryTransferItemDto } from './dto/update-inventory-transfer-item.dto' +import { InventoryTransferItemsService } from './inventory-transfer-items.service' + +@Controller('inventory-transfers/:transferId/items') +export class InventoryTransferItemsController { + constructor(private readonly service: InventoryTransferItemsService) {} + + @Post() + create( + @Param('transferId') transferId: string, + @Body() dto: CreateInventoryTransferItemDto, + ) { + // ensure transferId from route is used + return this.service.createForTransfer(Number(transferId), dto) + } + + @Get() + findAll(@Param('transferId') transferId: string) { + return this.service.findAllForTransfer(Number(transferId)) + } + + @Get(':id') + findOne(@Param('transferId') transferId: string, @Param('id') id: string) { + return this.service.findOneForTransfer(Number(transferId), Number(id)) + } + + @Patch(':id') + update( + @Param('transferId') transferId: string, + @Param('id') id: string, + @Body() dto: UpdateInventoryTransferItemDto, + ) { + return this.service.updateForTransfer(Number(transferId), Number(id), dto) + } + + @Delete(':id') + remove(@Param('transferId') transferId: string, @Param('id') id: string) { + return this.service.removeForTransfer(Number(transferId), Number(id)) + } +} diff --git a/src/inventory-transfer-items/inventory-transfer-items.module.ts b/src/inventory-transfer-items/inventory-transfer-items.module.ts new file mode 100644 index 0000000..f1e8c1c --- /dev/null +++ b/src/inventory-transfer-items/inventory-transfer-items.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { InventoryTransferItemsController } from './inventory-transfer-items.controller' +import { InventoryTransferItemsService } from './inventory-transfer-items.service' + +@Module({ + imports: [PrismaModule], + controllers: [InventoryTransferItemsController], + providers: [InventoryTransferItemsService], +}) +export class InventoryTransferItemsModule {} diff --git a/src/inventory-transfer-items/inventory-transfer-items.service.ts b/src/inventory-transfer-items/inventory-transfer-items.service.ts new file mode 100644 index 0000000..2638641 --- /dev/null +++ b/src/inventory-transfer-items/inventory-transfer-items.service.ts @@ -0,0 +1,101 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../common/response/response-mapper' +import { PrismaService } from '../prisma/prisma.service' +import { CreateInventoryTransferItemDto } from './dto/create-inventory-transfer-item.dto' + +@Injectable() +export class InventoryTransferItemsService { + constructor(private prisma: PrismaService) {} + + async create(dto: CreateInventoryTransferItemDto) { + const payload: any = { ...dto } + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + payload.product = { connect: { id: Number(payload.productId) } } + delete payload.productId + } + if (Object.prototype.hasOwnProperty.call(payload, 'transferId')) { + payload.transfer = { connect: { id: Number(payload.transferId) } } + delete payload.transferId + } + + const item = await this.prisma.inventoryTransferItem.create({ data: payload }) + return ResponseMapper.create(item) + } + + async findAll(transferId?: number) { + const where = transferId ? { transferId: Number(transferId) } : undefined + const items = await this.prisma.inventoryTransferItem.findMany({ + where, + include: { product: true }, + }) + return ResponseMapper.list(items) + } + + async findOne(id: number) { + const item = await this.prisma.inventoryTransferItem.findUnique({ + where: { id }, + include: { product: true, transfer: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + // scoped helpers for nested routes + async createForTransfer(transferId: number, dto: CreateInventoryTransferItemDto) { + const payload: any = { ...dto, transferId } + return this.create(payload) + } + + async findAllForTransfer(transferId: number) { + return this.findAll(transferId) + } + + async findOneForTransfer(transferId: number, id: number) { + const item = await this.prisma.inventoryTransferItem.findFirst({ + where: { id, transferId }, + include: { product: true, transfer: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + async update(id: number, data: any) { + const payload: any = { ...data } + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + payload.product = { connect: { id: Number(payload.productId) } } + delete payload.productId + } + if (Object.prototype.hasOwnProperty.call(payload, 'transferId')) { + payload.transfer = { connect: { id: Number(payload.transferId) } } + delete payload.transferId + } + + const item = await this.prisma.inventoryTransferItem.update({ + where: { id }, + data: payload, + }) + return ResponseMapper.update(item) + } + + async updateForTransfer(transferId: number, id: number, data: any) { + // ensure the item belongs to the transfer + const existing = await this.prisma.inventoryTransferItem.findFirst({ + where: { id, transferId }, + }) + if (!existing) return null + return this.update(id, data) + } + + async remove(id: number) { + const item = await this.prisma.inventoryTransferItem.delete({ where: { id } }) + return ResponseMapper.single(item) + } + + async removeForTransfer(transferId: number, id: number) { + const existing = await this.prisma.inventoryTransferItem.findFirst({ + where: { id, transferId }, + }) + if (!existing) return null + return this.remove(id) + } +} diff --git a/src/inventory-transfers/dto/create-inventory-transfer.dto.ts b/src/inventory-transfers/dto/create-inventory-transfer.dto.ts new file mode 100644 index 0000000..dff57ac --- /dev/null +++ b/src/inventory-transfers/dto/create-inventory-transfer.dto.ts @@ -0,0 +1,19 @@ +import { Type } from 'class-transformer' +import { IsInt, IsOptional, IsString } from 'class-validator' + +export class CreateInventoryTransferDto { + @IsString() + code: string + + @IsOptional() + @IsString() + description?: string + + @Type(() => Number) + @IsInt() + fromInventoryId: number + + @Type(() => Number) + @IsInt() + toInventoryId: number +} diff --git a/src/inventory-transfers/dto/update-inventory-transfer.dto.ts b/src/inventory-transfers/dto/update-inventory-transfer.dto.ts new file mode 100644 index 0000000..5d5765c --- /dev/null +++ b/src/inventory-transfers/dto/update-inventory-transfer.dto.ts @@ -0,0 +1,22 @@ +import { Type } from 'class-transformer' +import { IsInt, IsOptional, IsString } from 'class-validator' + +export class UpdateInventoryTransferDto { + @IsOptional() + @IsString() + code?: string + + @IsOptional() + @IsString() + description?: string + + @IsOptional() + @Type(() => Number) + @IsInt() + fromInventoryId?: number | null + + @IsOptional() + @Type(() => Number) + @IsInt() + toInventoryId?: number | null +} diff --git a/src/inventory-transfers/inventory-transfers.controller.ts b/src/inventory-transfers/inventory-transfers.controller.ts new file mode 100644 index 0000000..947112e --- /dev/null +++ b/src/inventory-transfers/inventory-transfers.controller.ts @@ -0,0 +1,34 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreateInventoryTransferDto } from './dto/create-inventory-transfer.dto' +import { UpdateInventoryTransferDto } from './dto/update-inventory-transfer.dto' +import { InventoryTransfersService } from './inventory-transfers.service' + +@Controller('inventory-transfers') +export class InventoryTransfersController { + constructor(private readonly service: InventoryTransfersService) {} + + @Post() + create(@Body() dto: CreateInventoryTransferDto) { + return this.service.create(dto) + } + + @Get() + findAll() { + return this.service.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.service.findOne(Number(id)) + } + + @Patch(':id') + update(@Param('id') id: string, @Body() dto: UpdateInventoryTransferDto) { + return this.service.update(Number(id), dto) + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.service.remove(Number(id)) + } +} diff --git a/src/inventory-transfers/inventory-transfers.module.ts b/src/inventory-transfers/inventory-transfers.module.ts new file mode 100644 index 0000000..be4fbfc --- /dev/null +++ b/src/inventory-transfers/inventory-transfers.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { InventoryTransfersController } from './inventory-transfers.controller' +import { InventoryTransfersService } from './inventory-transfers.service' + +@Module({ + imports: [PrismaModule], + controllers: [InventoryTransfersController], + providers: [InventoryTransfersService], +}) +export class InventoryTransfersModule {} diff --git a/src/inventory-transfers/inventory-transfers.service.ts b/src/inventory-transfers/inventory-transfers.service.ts new file mode 100644 index 0000000..2279211 --- /dev/null +++ b/src/inventory-transfers/inventory-transfers.service.ts @@ -0,0 +1,65 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../common/response/response-mapper' +import { PrismaService } from '../prisma/prisma.service' +import { CreateInventoryTransferDto } from './dto/create-inventory-transfer.dto' + +@Injectable() +export class InventoryTransfersService { + constructor(private prisma: PrismaService) {} + + async create(dto: CreateInventoryTransferDto) { + const payload: any = { ...dto } + if (Object.prototype.hasOwnProperty.call(payload, 'fromInventoryId')) { + payload.fromInventory = { connect: { id: Number(payload.fromInventoryId) } } + delete payload.fromInventoryId + } + if (Object.prototype.hasOwnProperty.call(payload, 'toInventoryId')) { + payload.toInventory = { connect: { id: Number(payload.toInventoryId) } } + delete payload.toInventoryId + } + + const item = await this.prisma.inventoryTransfer.create({ data: payload }) + return ResponseMapper.create(item) + } + + async findAll() { + const items = await this.prisma.inventoryTransfer.findMany({ + include: { fromInventory: true, toInventory: true }, + }) + return ResponseMapper.list(items) + } + + async findOne(id: number) { + const item = await this.prisma.inventoryTransfer.findUnique({ + where: { id }, + include: { items: true, fromInventory: true, toInventory: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + async update(id: number, data: any) { + const payload: any = { ...data } + if (Object.prototype.hasOwnProperty.call(payload, 'fromInventoryId')) { + if (payload.fromInventoryId === null) payload.fromInventory = { disconnect: true } + else payload.fromInventory = { connect: { id: Number(payload.fromInventoryId) } } + delete payload.fromInventoryId + } + if (Object.prototype.hasOwnProperty.call(payload, 'toInventoryId')) { + if (payload.toInventoryId === null) payload.toInventory = { disconnect: true } + else payload.toInventory = { connect: { id: Number(payload.toInventoryId) } } + delete payload.toInventoryId + } + + const item = await this.prisma.inventoryTransfer.update({ + where: { id }, + data: payload, + }) + return ResponseMapper.update(item) + } + + async remove(id: number) { + const item = await this.prisma.inventoryTransfer.delete({ where: { id } }) + return ResponseMapper.single(item) + } +} diff --git a/src/lib/prisma.ts b/src/lib/prisma.ts index 2106aea..4da9ef0 100644 --- a/src/lib/prisma.ts +++ b/src/lib/prisma.ts @@ -9,7 +9,9 @@ const adapter = new PrismaMariaDb({ user: env('DATABASE_USER'), password: env('DATABASE_PASSWORD'), database: env('DATABASE_NAME'), + ssl: false, connectionLimit: 5, + port: Number(env('DATABASE_PORT')) || 3306, }) const prisma = new PrismaClient({ adapter }) diff --git a/src/prisma/prisma.service.ts b/src/prisma/prisma.service.ts index 960599e..1e27a28 100644 --- a/src/prisma/prisma.service.ts +++ b/src/prisma/prisma.service.ts @@ -12,6 +12,7 @@ export class PrismaService extends PrismaClient implements OnModuleInit, OnModul user: env('DATABASE_USER'), password: env('DATABASE_PASSWORD'), database: env('DATABASE_NAME'), + port: env('DATABASE_PORT') ? Number(env('DATABASE_PORT')) : 3306, connectionLimit: 5, }) super({ adapter }) diff --git a/src/product-charges/dto/create-product-charge.dto.ts b/src/product-charges/dto/create-product-charge.dto.ts new file mode 100644 index 0000000..0ea439a --- /dev/null +++ b/src/product-charges/dto/create-product-charge.dto.ts @@ -0,0 +1,47 @@ +import { Type } from 'class-transformer' +import { + IsBoolean, + IsDateString, + IsInt, + IsNumber, + IsOptional, + IsString, +} from 'class-validator' + +export class CreateProductChargeDto { + @Type(() => Number) + @IsNumber() + count: number + + @Type(() => Number) + @IsNumber() + fee: number + + @Type(() => Number) + @IsNumber() + totalAmount: number + + @IsOptional() + @IsBoolean() + @Type(() => Boolean) + isSettled?: boolean + + @IsDateString() + buyAt: string + + @IsOptional() + @IsString() + description?: string + + @Type(() => Number) + @IsInt() + productId: number + + @Type(() => Number) + @IsInt() + inventoryId: number + + @Type(() => Number) + @IsInt() + supplierId: number +} diff --git a/src/product-charges/dto/update-product-charge.dto.ts b/src/product-charges/dto/update-product-charge.dto.ts new file mode 100644 index 0000000..fdd7867 --- /dev/null +++ b/src/product-charges/dto/update-product-charge.dto.ts @@ -0,0 +1,54 @@ +import { Type } from 'class-transformer' +import { + IsBoolean, + IsDateString, + IsInt, + IsNumber, + IsOptional, + IsString, +} from 'class-validator' + +export class UpdateProductChargeDto { + @IsOptional() + @Type(() => Number) + @IsNumber() + count?: number + + @IsOptional() + @Type(() => Number) + @IsNumber() + fee?: number + + @IsOptional() + @Type(() => Number) + @IsNumber() + totalAmount?: number + + @IsOptional() + @Type(() => Boolean) + @IsBoolean() + isSettled?: boolean + + @IsOptional() + @IsDateString() + buyAt?: string + + @IsOptional() + @IsString() + description?: string + + @IsOptional() + @Type(() => Number) + @IsInt() + productId?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + inventoryId?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + supplierId?: number +} diff --git a/src/product-charges/product-charges.controller.ts b/src/product-charges/product-charges.controller.ts new file mode 100644 index 0000000..e64b587 --- /dev/null +++ b/src/product-charges/product-charges.controller.ts @@ -0,0 +1,34 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreateProductChargeDto } from './dto/create-product-charge.dto' +import { UpdateProductChargeDto } from './dto/update-product-charge.dto' +import { ProductChargesService } from './product-charges.service' + +@Controller('product-charges') +export class ProductChargesController { + constructor(private readonly service: ProductChargesService) {} + + @Post() + create(@Body() dto: CreateProductChargeDto) { + return this.service.create(dto) + } + + @Get() + findAll() { + return this.service.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.service.findOne(Number(id)) + } + + @Patch(':id') + update(@Param('id') id: string, @Body() dto: UpdateProductChargeDto) { + return this.service.update(Number(id), dto) + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.service.remove(Number(id)) + } +} diff --git a/src/product-charges/product-charges.module.ts b/src/product-charges/product-charges.module.ts new file mode 100644 index 0000000..d2550d2 --- /dev/null +++ b/src/product-charges/product-charges.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { ProductChargesController } from './product-charges.controller' +import { ProductChargesService } from './product-charges.service' + +@Module({ + imports: [PrismaModule], + controllers: [ProductChargesController], + providers: [ProductChargesService], +}) +export class ProductChargesModule {} diff --git a/src/product-charges/product-charges.service.ts b/src/product-charges/product-charges.service.ts new file mode 100644 index 0000000..ed3faf9 --- /dev/null +++ b/src/product-charges/product-charges.service.ts @@ -0,0 +1,104 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../common/response/response-mapper' +import { PrismaService } from '../prisma/prisma.service' +import { CreateProductChargeDto } from './dto/create-product-charge.dto' + +@Injectable() +export class ProductChargesService { + constructor(private prisma: PrismaService) {} + + async create(data: CreateProductChargeDto) { + const payload: any = { ...data } + + // transform relation id scalars into nested connect objects + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + if (payload.productId !== undefined && payload.productId !== null) { + payload.product = { connect: { id: Number(payload.productId) } } + } + delete payload.productId + } + + if (Object.prototype.hasOwnProperty.call(payload, 'inventoryId')) { + if (payload.inventoryId !== undefined && payload.inventoryId !== null) { + payload.inventory = { connect: { id: Number(payload.inventoryId) } } + } + delete payload.inventoryId + } + + if (Object.prototype.hasOwnProperty.call(payload, 'supplierId')) { + if (payload.supplierId !== undefined && payload.supplierId !== null) { + payload.supplier = { connect: { id: Number(payload.supplierId) } } + } + delete payload.supplierId + } + + // Convert buyAt to Date if it's a string + if (typeof payload.buyAt === 'string') { + payload.buyAt = new Date(payload.buyAt) + } + + // Remove explicit nulls for optional fields to avoid Prisma complaining + Object.keys(payload).forEach(k => { + if (payload[k] === null) delete payload[k] + }) + + const item = await this.prisma.productCharge.create({ data: payload }) + return ResponseMapper.create(item) + } + + async findAll() { + const items = await this.prisma.productCharge.findMany() + return ResponseMapper.list(items) + } + + async findOne(id: number) { + const item = await this.prisma.productCharge.findUnique({ where: { id } }) + if (!item) return null + return ResponseMapper.single(item) + } + + async update(id: number, data: any) { + const payload: any = { ...data } + + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + if (payload.productId === null) { + payload.product = { disconnect: true } + } else { + payload.product = { connect: { id: Number(payload.productId) } } + } + delete payload.productId + } + + if (Object.prototype.hasOwnProperty.call(payload, 'inventoryId')) { + if (payload.inventoryId === null) { + payload.inventory = { disconnect: true } + } else { + payload.inventory = { connect: { id: Number(payload.inventoryId) } } + } + delete payload.inventoryId + } + + if (Object.prototype.hasOwnProperty.call(payload, 'supplierId')) { + if (payload.supplierId === null) { + payload.supplier = { disconnect: true } + } else { + payload.supplier = { connect: { id: Number(payload.supplierId) } } + } + delete payload.supplierId + } + + if (typeof payload.buyAt === 'string') payload.buyAt = new Date(payload.buyAt) + + Object.keys(payload).forEach(k => { + if (payload[k] === null) delete payload[k] + }) + + const item = await this.prisma.productCharge.update({ where: { id }, data: payload }) + return ResponseMapper.update(item) + } + + async remove(id: number) { + const item = await this.prisma.productCharge.delete({ where: { id } }) + return ResponseMapper.single(item) + } +} diff --git a/src/products/products.controller.ts b/src/products/products.controller.ts index 68c237e..c2354e6 100644 --- a/src/products/products.controller.ts +++ b/src/products/products.controller.ts @@ -9,7 +9,6 @@ export class ProductsController { @Post() create(@Body() dto: CreateProductDto) { - console.log('[ProductController] create called', dto) return this.productsService.create(dto) } diff --git a/src/products/products.service.ts b/src/products/products.service.ts index 181a81e..2c2b879 100644 --- a/src/products/products.service.ts +++ b/src/products/products.service.ts @@ -1,4 +1,5 @@ import { Injectable } from '@nestjs/common' +import { ShortEntity } from '../common/interfaces/response-models' import { ResponseMapper } from '../common/response/response-mapper' import { PrismaService } from '../prisma/prisma.service' import { CreateProductDto } from './dto/create-product.dto' @@ -8,12 +9,7 @@ export class ProductsService { constructor(private prisma: PrismaService) {} async create(data: CreateProductDto) { - console.log(data) - - // Transform incoming DTO so relation ids are passed as `connect` objects const payload: any = { ...data } - // If the client supplied brandId/categoryId (even null), remove the scalar - // Prisma expects nested relation objects, so only add `connect` when an id is present. if (Object.prototype.hasOwnProperty.call(payload, 'brandId')) { if (payload.brandId !== undefined && payload.brandId !== null) { payload.brand = { connect: { id: Number(payload.brandId) } } @@ -38,7 +34,13 @@ export class ProductsService { }) const mapped = items.map(p => { const { brandId, categoryId, ...rest } = p as any - return { ...rest, brand: p.brand, category: p.category } + const brand: ShortEntity | null = p.brand + ? { id: p.brand.id, name: p.brand.name } + : null + const category: ShortEntity | null = p.category + ? { id: p.category.id, name: p.category.name } + : null + return { ...rest, brand, category } }) return ResponseMapper.list(mapped) } @@ -46,14 +48,23 @@ export class ProductsService { async findOne(id: number) { const p = await this.prisma.product.findUnique({ where: { id }, - include: { brand: true, category: true }, + include: { brand: true, category: true, productCharges: true }, }) if (!p) return null - console.log('first') - const { brandId, categoryId, ...rest } = p as any - return ResponseMapper.single({ ...rest, brand: p.brand, category: p.category }) + const brand: ShortEntity | null = p.brand + ? { id: p.brand.id, name: p.brand.name } + : null + const category: ShortEntity | null = p.category + ? { id: p.category.id, name: p.category.name } + : null + return ResponseMapper.single({ + ...rest, + brand, + category, + count: p.productCharges.reduce((acc, charge) => acc + Number(charge.count), 0.0), + }) } async update(id: number, data: any) { diff --git a/src/purchase-receipt-items/dto/create-purchase-receipt-item.dto.ts b/src/purchase-receipt-items/dto/create-purchase-receipt-item.dto.ts new file mode 100644 index 0000000..880d3a3 --- /dev/null +++ b/src/purchase-receipt-items/dto/create-purchase-receipt-item.dto.ts @@ -0,0 +1,24 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber } from 'class-validator' + +export class CreatePurchaseReceiptItemDto { + @Type(() => Number) + @IsNumber() + count: number + + @Type(() => Number) + @IsNumber() + fee: number + + @Type(() => Number) + @IsNumber() + total: number + + @Type(() => Number) + @IsInt() + receiptId: number + + @Type(() => Number) + @IsInt() + productId: number +} diff --git a/src/purchase-receipt-items/dto/update-purchase-receipt-item.dto.ts b/src/purchase-receipt-items/dto/update-purchase-receipt-item.dto.ts new file mode 100644 index 0000000..fd99e2b --- /dev/null +++ b/src/purchase-receipt-items/dto/update-purchase-receipt-item.dto.ts @@ -0,0 +1,29 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber, IsOptional } from 'class-validator' + +export class UpdatePurchaseReceiptItemDto { + @IsOptional() + @Type(() => Number) + @IsNumber() + count?: number + + @IsOptional() + @Type(() => Number) + @IsNumber() + fee?: number + + @IsOptional() + @Type(() => Number) + @IsNumber() + total?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + receiptId?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + productId?: number +} diff --git a/src/purchase-receipt-items/purchase-receipt-items.controller.ts b/src/purchase-receipt-items/purchase-receipt-items.controller.ts new file mode 100644 index 0000000..6d95a91 --- /dev/null +++ b/src/purchase-receipt-items/purchase-receipt-items.controller.ts @@ -0,0 +1,41 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreatePurchaseReceiptItemDto } from './dto/create-purchase-receipt-item.dto' +import { UpdatePurchaseReceiptItemDto } from './dto/update-purchase-receipt-item.dto' +import { PurchaseReceiptItemsService } from './purchase-receipt-items.service' + +@Controller('purchase-receipts/:receiptId/items') +export class PurchaseReceiptItemsController { + constructor(private readonly service: PurchaseReceiptItemsService) {} + + @Post() + create( + @Param('receiptId') receiptId: string, + @Body() dto: CreatePurchaseReceiptItemDto, + ) { + return this.service.createForReceipt(Number(receiptId), dto) + } + + @Get() + findAll(@Param('receiptId') receiptId: string) { + return this.service.findAllForReceipt(Number(receiptId)) + } + + @Get(':id') + findOne(@Param('receiptId') receiptId: string, @Param('id') id: string) { + return this.service.findOneForReceipt(Number(receiptId), Number(id)) + } + + @Patch(':id') + update( + @Param('receiptId') receiptId: string, + @Param('id') id: string, + @Body() dto: UpdatePurchaseReceiptItemDto, + ) { + return this.service.updateForReceipt(Number(receiptId), Number(id), dto) + } + + @Delete(':id') + remove(@Param('receiptId') receiptId: string, @Param('id') id: string) { + return this.service.removeForReceipt(Number(receiptId), Number(id)) + } +} diff --git a/src/purchase-receipt-items/purchase-receipt-items.module.ts b/src/purchase-receipt-items/purchase-receipt-items.module.ts new file mode 100644 index 0000000..82e05e8 --- /dev/null +++ b/src/purchase-receipt-items/purchase-receipt-items.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { PurchaseReceiptItemsController } from './purchase-receipt-items.controller' +import { PurchaseReceiptItemsService } from './purchase-receipt-items.service' + +@Module({ + imports: [PrismaModule], + controllers: [PurchaseReceiptItemsController], + providers: [PurchaseReceiptItemsService], +}) +export class PurchaseReceiptItemsModule {} diff --git a/src/purchase-receipt-items/purchase-receipt-items.service.ts b/src/purchase-receipt-items/purchase-receipt-items.service.ts new file mode 100644 index 0000000..00c7bda --- /dev/null +++ b/src/purchase-receipt-items/purchase-receipt-items.service.ts @@ -0,0 +1,98 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../common/response/response-mapper' +import { PrismaService } from '../prisma/prisma.service' +import { CreatePurchaseReceiptItemDto } from './dto/create-purchase-receipt-item.dto' + +@Injectable() +export class PurchaseReceiptItemsService { + constructor(private prisma: PrismaService) {} + + async create(dto: CreatePurchaseReceiptItemDto) { + const payload: any = { ...dto } + if (Object.prototype.hasOwnProperty.call(payload, 'receiptId')) { + payload.receipt = { connect: { id: Number(payload.receiptId) } } + delete payload.receiptId + } + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + payload.product = { connect: { id: Number(payload.productId) } } + delete payload.productId + } + + const item = await this.prisma.purchaseReceiptItem.create({ data: payload }) + return ResponseMapper.create(item) + } + async findAll(receiptId?: number) { + const where = receiptId ? { receiptId: Number(receiptId) } : undefined + const items = await this.prisma.purchaseReceiptItem.findMany({ + where, + include: { product: true }, + }) + return ResponseMapper.list(items) + } + + async findOne(id: number) { + const item = await this.prisma.purchaseReceiptItem.findUnique({ + where: { id }, + include: { product: true, receipt: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + async createForReceipt(receiptId: number, dto: CreatePurchaseReceiptItemDto) { + const payload: any = { ...dto, receiptId } + return this.create(payload) + } + + async findAllForReceipt(receiptId: number) { + return this.findAll(receiptId) + } + + async findOneForReceipt(receiptId: number, id: number) { + const item = await this.prisma.purchaseReceiptItem.findFirst({ + where: { id, receiptId }, + include: { product: true, receipt: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + async update(id: number, data: any) { + const payload: any = { ...data } + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + payload.product = { connect: { id: Number(payload.productId) } } + delete payload.productId + } + if (Object.prototype.hasOwnProperty.call(payload, 'receiptId')) { + payload.receipt = { connect: { id: Number(payload.receiptId) } } + delete payload.receiptId + } + + const item = await this.prisma.purchaseReceiptItem.update({ + where: { id }, + data: payload, + }) + return ResponseMapper.update(item) + } + + async updateForReceipt(receiptId: number, id: number, data: any) { + const existing = await this.prisma.purchaseReceiptItem.findFirst({ + where: { id, receiptId }, + }) + if (!existing) return null + return this.update(id, data) + } + + async remove(id: number) { + const item = await this.prisma.purchaseReceiptItem.delete({ where: { id } }) + return ResponseMapper.single(item) + } + + async removeForReceipt(receiptId: number, id: number) { + const existing = await this.prisma.purchaseReceiptItem.findFirst({ + where: { id, receiptId }, + }) + if (!existing) return null + return this.remove(id) + } +} diff --git a/src/purchase-receipts/dto/create-purchase-receipt.dto.ts b/src/purchase-receipts/dto/create-purchase-receipt.dto.ts new file mode 100644 index 0000000..51d44f8 --- /dev/null +++ b/src/purchase-receipts/dto/create-purchase-receipt.dto.ts @@ -0,0 +1,23 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber, IsOptional, IsString } from 'class-validator' + +export class CreatePurchaseReceiptDto { + @IsString() + code: string + + @Type(() => Number) + @IsNumber() + totalAmount: number + + @IsOptional() + @IsString() + description?: string + + @Type(() => Number) + @IsInt() + supplierId: number + + @Type(() => Number) + @IsInt() + inventoryId: number +} diff --git a/src/purchase-receipts/dto/update-purchase-receipt.dto.ts b/src/purchase-receipts/dto/update-purchase-receipt.dto.ts new file mode 100644 index 0000000..07a2cda --- /dev/null +++ b/src/purchase-receipts/dto/update-purchase-receipt.dto.ts @@ -0,0 +1,27 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber, IsOptional, IsString } from 'class-validator' + +export class UpdatePurchaseReceiptDto { + @IsOptional() + @IsString() + code?: string + + @IsOptional() + @Type(() => Number) + @IsNumber() + totalAmount?: number + + @IsOptional() + @IsString() + description?: string + + @IsOptional() + @Type(() => Number) + @IsInt() + supplierId?: number | null + + @IsOptional() + @Type(() => Number) + @IsInt() + inventoryId?: number | null +} diff --git a/src/purchase-receipts/purchase-receipts.controller.ts b/src/purchase-receipts/purchase-receipts.controller.ts new file mode 100644 index 0000000..ed95505 --- /dev/null +++ b/src/purchase-receipts/purchase-receipts.controller.ts @@ -0,0 +1,34 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreatePurchaseReceiptDto } from './dto/create-purchase-receipt.dto' +import { UpdatePurchaseReceiptDto } from './dto/update-purchase-receipt.dto' +import { PurchaseReceiptsService } from './purchase-receipts.service' + +@Controller('purchase-receipts') +export class PurchaseReceiptsController { + constructor(private readonly service: PurchaseReceiptsService) {} + + @Post() + create(@Body() dto: CreatePurchaseReceiptDto) { + return this.service.create(dto) + } + + @Get() + findAll() { + return this.service.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.service.findOne(Number(id)) + } + + @Patch(':id') + update(@Param('id') id: string, @Body() dto: UpdatePurchaseReceiptDto) { + return this.service.update(Number(id), dto) + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.service.remove(Number(id)) + } +} diff --git a/src/purchase-receipts/purchase-receipts.module.ts b/src/purchase-receipts/purchase-receipts.module.ts new file mode 100644 index 0000000..bc94cbf --- /dev/null +++ b/src/purchase-receipts/purchase-receipts.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { PurchaseReceiptsController } from './purchase-receipts.controller' +import { PurchaseReceiptsService } from './purchase-receipts.service' + +@Module({ + imports: [PrismaModule], + controllers: [PurchaseReceiptsController], + providers: [PurchaseReceiptsService], +}) +export class PurchaseReceiptsModule {} diff --git a/src/purchase-receipts/purchase-receipts.service.ts b/src/purchase-receipts/purchase-receipts.service.ts new file mode 100644 index 0000000..469b830 --- /dev/null +++ b/src/purchase-receipts/purchase-receipts.service.ts @@ -0,0 +1,65 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../common/response/response-mapper' +import { PrismaService } from '../prisma/prisma.service' +import { CreatePurchaseReceiptDto } from './dto/create-purchase-receipt.dto' + +@Injectable() +export class PurchaseReceiptsService { + constructor(private prisma: PrismaService) {} + + async create(dto: CreatePurchaseReceiptDto) { + const payload: any = { ...dto } + if (Object.prototype.hasOwnProperty.call(payload, 'supplierId')) { + payload.supplier = { connect: { id: Number(payload.supplierId) } } + delete payload.supplierId + } + if (Object.prototype.hasOwnProperty.call(payload, 'inventoryId')) { + payload.inventory = { connect: { id: Number(payload.inventoryId) } } + delete payload.inventoryId + } + + const item = await this.prisma.purchaseReceipt.create({ data: payload }) + return ResponseMapper.create(item) + } + + async findAll() { + const items = await this.prisma.purchaseReceipt.findMany({ + include: { supplier: true, inventory: true }, + }) + return ResponseMapper.list(items) + } + + async findOne(id: number) { + const item = await this.prisma.purchaseReceipt.findUnique({ + where: { id }, + include: { supplier: true, inventory: true, items: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + async update(id: number, data: any) { + const payload: any = { ...data } + if (Object.prototype.hasOwnProperty.call(payload, 'supplierId')) { + if (payload.supplierId === null) payload.supplier = { disconnect: true } + else payload.supplier = { connect: { id: Number(payload.supplierId) } } + delete payload.supplierId + } + if (Object.prototype.hasOwnProperty.call(payload, 'inventoryId')) { + if (payload.inventoryId === null) payload.inventory = { disconnect: true } + else payload.inventory = { connect: { id: Number(payload.inventoryId) } } + delete payload.inventoryId + } + + const item = await this.prisma.purchaseReceipt.update({ + where: { id }, + data: payload, + }) + return ResponseMapper.update(item) + } + + async remove(id: number) { + const item = await this.prisma.purchaseReceipt.delete({ where: { id } }) + return ResponseMapper.single(item) + } +} diff --git a/src/sales-invoice-items/dto/create-sales-invoice-item.dto.ts b/src/sales-invoice-items/dto/create-sales-invoice-item.dto.ts new file mode 100644 index 0000000..f13fe76 --- /dev/null +++ b/src/sales-invoice-items/dto/create-sales-invoice-item.dto.ts @@ -0,0 +1,24 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber } from 'class-validator' + +export class CreateSalesInvoiceItemDto { + @Type(() => Number) + @IsNumber() + count: number + + @Type(() => Number) + @IsNumber() + fee: number + + @Type(() => Number) + @IsNumber() + total: number + + @Type(() => Number) + @IsInt() + invoiceId: number + + @Type(() => Number) + @IsInt() + productId: number +} diff --git a/src/sales-invoice-items/dto/update-sales-invoice-item.dto.ts b/src/sales-invoice-items/dto/update-sales-invoice-item.dto.ts new file mode 100644 index 0000000..1475047 --- /dev/null +++ b/src/sales-invoice-items/dto/update-sales-invoice-item.dto.ts @@ -0,0 +1,29 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber, IsOptional } from 'class-validator' + +export class UpdateSalesInvoiceItemDto { + @IsOptional() + @Type(() => Number) + @IsNumber() + count?: number + + @IsOptional() + @Type(() => Number) + @IsNumber() + fee?: number + + @IsOptional() + @Type(() => Number) + @IsNumber() + total?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + invoiceId?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + productId?: number +} diff --git a/src/sales-invoice-items/sales-invoice-items.controller.ts b/src/sales-invoice-items/sales-invoice-items.controller.ts new file mode 100644 index 0000000..e3679b0 --- /dev/null +++ b/src/sales-invoice-items/sales-invoice-items.controller.ts @@ -0,0 +1,38 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreateSalesInvoiceItemDto } from './dto/create-sales-invoice-item.dto' +import { UpdateSalesInvoiceItemDto } from './dto/update-sales-invoice-item.dto' +import { SalesInvoiceItemsService } from './sales-invoice-items.service' + +@Controller('sales-invoices/:invoiceId/items') +export class SalesInvoiceItemsController { + constructor(private readonly service: SalesInvoiceItemsService) {} + + @Post() + create(@Param('invoiceId') invoiceId: string, @Body() dto: CreateSalesInvoiceItemDto) { + return this.service.createForInvoice(Number(invoiceId), dto) + } + + @Get() + findAll(@Param('invoiceId') invoiceId: string) { + return this.service.findAllForInvoice(Number(invoiceId)) + } + + @Get(':id') + findOne(@Param('invoiceId') invoiceId: string, @Param('id') id: string) { + return this.service.findOneForInvoice(Number(invoiceId), Number(id)) + } + + @Patch(':id') + update( + @Param('invoiceId') invoiceId: string, + @Param('id') id: string, + @Body() dto: UpdateSalesInvoiceItemDto, + ) { + return this.service.updateForInvoice(Number(invoiceId), Number(id), dto) + } + + @Delete(':id') + remove(@Param('invoiceId') invoiceId: string, @Param('id') id: string) { + return this.service.removeForInvoice(Number(invoiceId), Number(id)) + } +} diff --git a/src/sales-invoice-items/sales-invoice-items.module.ts b/src/sales-invoice-items/sales-invoice-items.module.ts new file mode 100644 index 0000000..8eacaa3 --- /dev/null +++ b/src/sales-invoice-items/sales-invoice-items.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { SalesInvoiceItemsController } from './sales-invoice-items.controller' +import { SalesInvoiceItemsService } from './sales-invoice-items.service' + +@Module({ + imports: [PrismaModule], + controllers: [SalesInvoiceItemsController], + providers: [SalesInvoiceItemsService], +}) +export class SalesInvoiceItemsModule {} diff --git a/src/sales-invoice-items/sales-invoice-items.service.ts b/src/sales-invoice-items/sales-invoice-items.service.ts new file mode 100644 index 0000000..72d1931 --- /dev/null +++ b/src/sales-invoice-items/sales-invoice-items.service.ts @@ -0,0 +1,98 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../common/response/response-mapper' +import { PrismaService } from '../prisma/prisma.service' +import { CreateSalesInvoiceItemDto } from './dto/create-sales-invoice-item.dto' + +@Injectable() +export class SalesInvoiceItemsService { + constructor(private prisma: PrismaService) {} + + async create(dto: CreateSalesInvoiceItemDto) { + const payload: any = { ...dto } + if (Object.prototype.hasOwnProperty.call(payload, 'invoiceId')) { + payload.invoice = { connect: { id: Number(payload.invoiceId) } } + delete payload.invoiceId + } + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + payload.product = { connect: { id: Number(payload.productId) } } + delete payload.productId + } + + const item = await this.prisma.salesInvoiceItem.create({ data: payload }) + return ResponseMapper.create(item) + } + async findAll(invoiceId?: number) { + const where = invoiceId ? { invoiceId: Number(invoiceId) } : undefined + const items = await this.prisma.salesInvoiceItem.findMany({ + where, + include: { product: true }, + }) + return ResponseMapper.list(items) + } + + async findOne(id: number) { + const item = await this.prisma.salesInvoiceItem.findUnique({ + where: { id }, + include: { product: true, invoice: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + async createForInvoice(invoiceId: number, dto: CreateSalesInvoiceItemDto) { + const payload: any = { ...dto, invoiceId } + return this.create(payload) + } + + async findAllForInvoice(invoiceId: number) { + return this.findAll(invoiceId) + } + + async findOneForInvoice(invoiceId: number, id: number) { + const item = await this.prisma.salesInvoiceItem.findFirst({ + where: { id, invoiceId }, + include: { product: true, invoice: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + async update(id: number, data: any) { + const payload: any = { ...data } + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + payload.product = { connect: { id: Number(payload.productId) } } + delete payload.productId + } + if (Object.prototype.hasOwnProperty.call(payload, 'invoiceId')) { + payload.invoice = { connect: { id: Number(payload.invoiceId) } } + delete payload.invoiceId + } + + const item = await this.prisma.salesInvoiceItem.update({ + where: { id }, + data: payload, + }) + return ResponseMapper.update(item) + } + + async updateForInvoice(invoiceId: number, id: number, data: any) { + const existing = await this.prisma.salesInvoiceItem.findFirst({ + where: { id, invoiceId }, + }) + if (!existing) return null + return this.update(id, data) + } + + async remove(id: number) { + const item = await this.prisma.salesInvoiceItem.delete({ where: { id } }) + return ResponseMapper.single(item) + } + + async removeForInvoice(invoiceId: number, id: number) { + const existing = await this.prisma.salesInvoiceItem.findFirst({ + where: { id, invoiceId }, + }) + if (!existing) return null + return this.remove(id) + } +} diff --git a/src/sales-invoices/dto/create-sales-invoice.dto.ts b/src/sales-invoices/dto/create-sales-invoice.dto.ts new file mode 100644 index 0000000..1b09ae5 --- /dev/null +++ b/src/sales-invoices/dto/create-sales-invoice.dto.ts @@ -0,0 +1,20 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber, IsOptional, IsString } from 'class-validator' + +export class CreateSalesInvoiceDto { + @IsString() + code: string + + @Type(() => Number) + @IsNumber() + totalAmount: number + + @IsOptional() + @IsString() + description?: string + + @IsOptional() + @Type(() => Number) + @IsInt() + customerId?: number +} diff --git a/src/sales-invoices/dto/update-sales-invoice.dto.ts b/src/sales-invoices/dto/update-sales-invoice.dto.ts new file mode 100644 index 0000000..0e99d68 --- /dev/null +++ b/src/sales-invoices/dto/update-sales-invoice.dto.ts @@ -0,0 +1,22 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber, IsOptional, IsString } from 'class-validator' + +export class UpdateSalesInvoiceDto { + @IsOptional() + @IsString() + code?: string + + @IsOptional() + @Type(() => Number) + @IsNumber() + totalAmount?: number + + @IsOptional() + @IsString() + description?: string + + @IsOptional() + @Type(() => Number) + @IsInt() + customerId?: number | null +} diff --git a/src/sales-invoices/sales-invoices.controller.ts b/src/sales-invoices/sales-invoices.controller.ts new file mode 100644 index 0000000..48e65a0 --- /dev/null +++ b/src/sales-invoices/sales-invoices.controller.ts @@ -0,0 +1,34 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreateSalesInvoiceDto } from './dto/create-sales-invoice.dto' +import { UpdateSalesInvoiceDto } from './dto/update-sales-invoice.dto' +import { SalesInvoicesService } from './sales-invoices.service' + +@Controller('sales-invoices') +export class SalesInvoicesController { + constructor(private readonly service: SalesInvoicesService) {} + + @Post() + create(@Body() dto: CreateSalesInvoiceDto) { + return this.service.create(dto) + } + + @Get() + findAll() { + return this.service.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.service.findOne(Number(id)) + } + + @Patch(':id') + update(@Param('id') id: string, @Body() dto: UpdateSalesInvoiceDto) { + return this.service.update(Number(id), dto) + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.service.remove(Number(id)) + } +} diff --git a/src/sales-invoices/sales-invoices.module.ts b/src/sales-invoices/sales-invoices.module.ts new file mode 100644 index 0000000..e1ec1ae --- /dev/null +++ b/src/sales-invoices/sales-invoices.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { SalesInvoicesController } from './sales-invoices.controller' +import { SalesInvoicesService } from './sales-invoices.service' + +@Module({ + imports: [PrismaModule], + controllers: [SalesInvoicesController], + providers: [SalesInvoicesService], +}) +export class SalesInvoicesModule {} diff --git a/src/sales-invoices/sales-invoices.service.ts b/src/sales-invoices/sales-invoices.service.ts new file mode 100644 index 0000000..db50238 --- /dev/null +++ b/src/sales-invoices/sales-invoices.service.ts @@ -0,0 +1,50 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../common/response/response-mapper' +import { PrismaService } from '../prisma/prisma.service' +import { CreateSalesInvoiceDto } from './dto/create-sales-invoice.dto' + +@Injectable() +export class SalesInvoicesService { + constructor(private prisma: PrismaService) {} + + async create(dto: CreateSalesInvoiceDto) { + const payload: any = { ...dto } + if (Object.prototype.hasOwnProperty.call(payload, 'customerId')) { + payload.customer = { connect: { id: Number(payload.customerId) } } + delete payload.customerId + } + + const item = await this.prisma.salesInvoice.create({ data: payload }) + return ResponseMapper.create(item) + } + + async findAll() { + const items = await this.prisma.salesInvoice.findMany({ include: { customer: true } }) + return ResponseMapper.list(items) + } + + async findOne(id: number) { + const item = await this.prisma.salesInvoice.findUnique({ + where: { id }, + include: { items: true, customer: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + async update(id: number, data: any) { + const payload: any = { ...data } + if (Object.prototype.hasOwnProperty.call(payload, 'customerId')) { + if (payload.customerId === null) payload.customer = { disconnect: true } + else payload.customer = { connect: { id: Number(payload.customerId) } } + delete payload.customerId + } + const item = await this.prisma.salesInvoice.update({ where: { id }, data: payload }) + return ResponseMapper.update(item) + } + + async remove(id: number) { + const item = await this.prisma.salesInvoice.delete({ where: { id } }) + return ResponseMapper.single(item) + } +} diff --git a/src/stock-adjustments/dto/create-stock-adjustment.dto.ts b/src/stock-adjustments/dto/create-stock-adjustment.dto.ts new file mode 100644 index 0000000..d79c788 --- /dev/null +++ b/src/stock-adjustments/dto/create-stock-adjustment.dto.ts @@ -0,0 +1,16 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber } from 'class-validator' + +export class CreateStockAdjustmentDto { + @Type(() => Number) + @IsNumber() + adjustedQuantity: number + + @Type(() => Number) + @IsInt() + productId: number + + @Type(() => Number) + @IsInt() + inventoryId: number +} diff --git a/src/stock-adjustments/dto/update-stock-adjustment.dto.ts b/src/stock-adjustments/dto/update-stock-adjustment.dto.ts new file mode 100644 index 0000000..8bd1e45 --- /dev/null +++ b/src/stock-adjustments/dto/update-stock-adjustment.dto.ts @@ -0,0 +1,19 @@ +import { Type } from 'class-transformer' +import { IsInt, IsNumber, IsOptional } from 'class-validator' + +export class UpdateStockAdjustmentDto { + @IsOptional() + @Type(() => Number) + @IsNumber() + adjustedQuantity?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + productId?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + inventoryId?: number +} diff --git a/src/stock-adjustments/stock-adjustments.controller.ts b/src/stock-adjustments/stock-adjustments.controller.ts new file mode 100644 index 0000000..de4d122 --- /dev/null +++ b/src/stock-adjustments/stock-adjustments.controller.ts @@ -0,0 +1,34 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreateStockAdjustmentDto } from './dto/create-stock-adjustment.dto' +import { UpdateStockAdjustmentDto } from './dto/update-stock-adjustment.dto' +import { StockAdjustmentsService } from './stock-adjustments.service' + +@Controller('stock-adjustments') +export class StockAdjustmentsController { + constructor(private readonly service: StockAdjustmentsService) {} + + @Post() + create(@Body() dto: CreateStockAdjustmentDto) { + return this.service.create(dto) + } + + @Get() + findAll() { + return this.service.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.service.findOne(Number(id)) + } + + @Patch(':id') + update(@Param('id') id: string, @Body() dto: UpdateStockAdjustmentDto) { + return this.service.update(Number(id), dto) + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.service.remove(Number(id)) + } +} diff --git a/src/stock-adjustments/stock-adjustments.module.ts b/src/stock-adjustments/stock-adjustments.module.ts new file mode 100644 index 0000000..0934cdb --- /dev/null +++ b/src/stock-adjustments/stock-adjustments.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { StockAdjustmentsController } from './stock-adjustments.controller' +import { StockAdjustmentsService } from './stock-adjustments.service' + +@Module({ + imports: [PrismaModule], + controllers: [StockAdjustmentsController], + providers: [StockAdjustmentsService], +}) +export class StockAdjustmentsModule {} diff --git a/src/stock-adjustments/stock-adjustments.service.ts b/src/stock-adjustments/stock-adjustments.service.ts new file mode 100644 index 0000000..aba7349 --- /dev/null +++ b/src/stock-adjustments/stock-adjustments.service.ts @@ -0,0 +1,63 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../common/response/response-mapper' +import { PrismaService } from '../prisma/prisma.service' +import { CreateStockAdjustmentDto } from './dto/create-stock-adjustment.dto' + +@Injectable() +export class StockAdjustmentsService { + constructor(private prisma: PrismaService) {} + + async create(dto: CreateStockAdjustmentDto) { + const payload: any = { ...dto } + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + payload.product = { connect: { id: Number(payload.productId) } } + delete payload.productId + } + if (Object.prototype.hasOwnProperty.call(payload, 'inventoryId')) { + payload.inventory = { connect: { id: Number(payload.inventoryId) } } + delete payload.inventoryId + } + + const item = await this.prisma.stockAdjustment.create({ data: payload }) + return ResponseMapper.create(item) + } + + async findAll() { + const items = await this.prisma.stockAdjustment.findMany({ + include: { product: true, inventory: true }, + }) + return ResponseMapper.list(items) + } + + async findOne(id: number) { + const item = await this.prisma.stockAdjustment.findUnique({ + where: { id }, + include: { product: true, inventory: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + async update(id: number, data: any) { + const payload: any = { ...data } + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + payload.product = { connect: { id: Number(payload.productId) } } + delete payload.productId + } + if (Object.prototype.hasOwnProperty.call(payload, 'inventoryId')) { + payload.inventory = { connect: { id: Number(payload.inventoryId) } } + delete payload.inventoryId + } + + const item = await this.prisma.stockAdjustment.update({ + where: { id }, + data: payload, + }) + return ResponseMapper.update(item) + } + + async remove(id: number) { + const item = await this.prisma.stockAdjustment.delete({ where: { id } }) + return ResponseMapper.single(item) + } +} diff --git a/src/stock-balance/stock-balance.controller.ts b/src/stock-balance/stock-balance.controller.ts new file mode 100644 index 0000000..1e63d16 --- /dev/null +++ b/src/stock-balance/stock-balance.controller.ts @@ -0,0 +1,17 @@ +import { Controller, Get, Param } from '@nestjs/common' +import { StockBalanceService } from './stock-balance.service' + +@Controller('stock-balance') +export class StockBalanceController { + constructor(private readonly service: StockBalanceService) {} + + @Get() + findAll() { + return this.service.findAll() + } + + @Get(':itemId') + findOne(@Param('itemId') itemId: string) { + return this.service.findOne(Number(itemId)) + } +} diff --git a/src/stock-balance/stock-balance.module.ts b/src/stock-balance/stock-balance.module.ts new file mode 100644 index 0000000..ceefccd --- /dev/null +++ b/src/stock-balance/stock-balance.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { StockBalanceController } from './stock-balance.controller' +import { StockBalanceService } from './stock-balance.service' + +@Module({ + imports: [PrismaModule], + controllers: [StockBalanceController], + providers: [StockBalanceService], +}) +export class StockBalanceModule {} diff --git a/src/stock-balance/stock-balance.service.ts b/src/stock-balance/stock-balance.service.ts new file mode 100644 index 0000000..73ae291 --- /dev/null +++ b/src/stock-balance/stock-balance.service.ts @@ -0,0 +1,19 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../common/response/response-mapper' +import { PrismaService } from '../prisma/prisma.service' + +@Injectable() +export class StockBalanceService { + constructor(private prisma: PrismaService) {} + + async findAll() { + const items = await this.prisma.stockBalance.findMany() + return ResponseMapper.list(items) + } + + async findOne(ProductId: number) { + const item = await this.prisma.stockBalance.findUnique({ where: { ProductId } }) + if (!item) return null + return ResponseMapper.single(item) + } +} diff --git a/src/stock-movements/dto/create-stock-movement.dto.ts b/src/stock-movements/dto/create-stock-movement.dto.ts new file mode 100644 index 0000000..9ffa6e5 --- /dev/null +++ b/src/stock-movements/dto/create-stock-movement.dto.ts @@ -0,0 +1,34 @@ +import { Type } from 'class-transformer' +import { IsEnum, IsInt, IsNumber, IsString } from 'class-validator' +import { MovementReferenceType, MovementType } from '../../generated/prisma/enums' + +export class CreateStockMovementDto { + @IsEnum(MovementType) + type: MovementType + + @Type(() => Number) + @IsNumber() + quantity: number + + @Type(() => Number) + @IsNumber() + fee: number + + @Type(() => Number) + @IsNumber() + totalCost: number + + @IsEnum(MovementReferenceType) + referenceType: MovementReferenceType + + @IsString() + referenceId: string + + @Type(() => Number) + @IsInt() + productId: number + + @Type(() => Number) + @IsInt() + inventoryId: number +} diff --git a/src/stock-movements/dto/update-stock-movement.dto.ts b/src/stock-movements/dto/update-stock-movement.dto.ts new file mode 100644 index 0000000..33edb05 --- /dev/null +++ b/src/stock-movements/dto/update-stock-movement.dto.ts @@ -0,0 +1,42 @@ +import { Type } from 'class-transformer' +import { IsEnum, IsInt, IsNumber, IsOptional, IsString } from 'class-validator' +import { MovementReferenceType, MovementType } from '../../generated/prisma/enums' + +export class UpdateStockMovementDto { + @IsOptional() + @IsEnum(MovementType) + type?: MovementType + + @IsOptional() + @Type(() => Number) + @IsNumber() + quantity?: number + + @IsOptional() + @Type(() => Number) + @IsNumber() + unitCost?: number + + @IsOptional() + @Type(() => Number) + @IsNumber() + totalCost?: number + + @IsOptional() + @IsEnum(MovementReferenceType) + referenceType?: MovementReferenceType + + @IsOptional() + @IsString() + referenceId?: string + + @IsOptional() + @Type(() => Number) + @IsInt() + productId?: number + + @IsOptional() + @Type(() => Number) + @IsInt() + inventoryId?: number +} diff --git a/src/stock-movements/stock-movements.controller.ts b/src/stock-movements/stock-movements.controller.ts new file mode 100644 index 0000000..54aa8fb --- /dev/null +++ b/src/stock-movements/stock-movements.controller.ts @@ -0,0 +1,34 @@ +import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common' +import { CreateStockMovementDto } from './dto/create-stock-movement.dto' +import { UpdateStockMovementDto } from './dto/update-stock-movement.dto' +import { StockMovementsService } from './stock-movements.service' + +@Controller('stock-movements') +export class StockMovementsController { + constructor(private readonly service: StockMovementsService) {} + + @Post() + create(@Body() dto: CreateStockMovementDto) { + return this.service.create(dto) + } + + @Get() + findAll() { + return this.service.findAll() + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.service.findOne(Number(id)) + } + + @Patch(':id') + update(@Param('id') id: string, @Body() dto: UpdateStockMovementDto) { + return this.service.update(Number(id), dto) + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.service.remove(Number(id)) + } +} diff --git a/src/stock-movements/stock-movements.module.ts b/src/stock-movements/stock-movements.module.ts new file mode 100644 index 0000000..6b86471 --- /dev/null +++ b/src/stock-movements/stock-movements.module.ts @@ -0,0 +1,11 @@ +import { Module } from '@nestjs/common' +import { PrismaModule } from '../prisma/prisma.module' +import { StockMovementsController } from './stock-movements.controller' +import { StockMovementsService } from './stock-movements.service' + +@Module({ + imports: [PrismaModule], + controllers: [StockMovementsController], + providers: [StockMovementsService], +}) +export class StockMovementsModule {} diff --git a/src/stock-movements/stock-movements.service.ts b/src/stock-movements/stock-movements.service.ts new file mode 100644 index 0000000..9aa696b --- /dev/null +++ b/src/stock-movements/stock-movements.service.ts @@ -0,0 +1,60 @@ +import { Injectable } from '@nestjs/common' +import { ResponseMapper } from '../common/response/response-mapper' +import { PrismaService } from '../prisma/prisma.service' +import { CreateStockMovementDto } from './dto/create-stock-movement.dto' + +@Injectable() +export class StockMovementsService { + constructor(private prisma: PrismaService) {} + + async create(dto: CreateStockMovementDto) { + const payload: any = { ...dto } + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + payload.product = { connect: { id: Number(payload.productId) } } + delete payload.productId + } + if (Object.prototype.hasOwnProperty.call(payload, 'inventoryId')) { + payload.inventory = { connect: { id: Number(payload.inventoryId) } } + delete payload.inventoryId + } + + const item = await this.prisma.stockMovement.create({ data: payload }) + return ResponseMapper.create(item) + } + + async findAll() { + const items = await this.prisma.stockMovement.findMany({ + include: { product: true, inventory: true }, + }) + return ResponseMapper.list(items) + } + + async findOne(id: number) { + const item = await this.prisma.stockMovement.findUnique({ + where: { id }, + include: { product: true, inventory: true }, + }) + if (!item) return null + return ResponseMapper.single(item) + } + + async update(id: number, data: any) { + const payload: any = { ...data } + if (Object.prototype.hasOwnProperty.call(payload, 'productId')) { + payload.product = { connect: { id: Number(payload.productId) } } + delete payload.productId + } + if (Object.prototype.hasOwnProperty.call(payload, 'inventoryId')) { + payload.inventory = { connect: { id: Number(payload.inventoryId) } } + delete payload.inventoryId + } + + const item = await this.prisma.stockMovement.update({ where: { id }, data: payload }) + return ResponseMapper.update(item) + } + + async remove(id: number) { + const item = await this.prisma.stockMovement.delete({ where: { id } }) + return ResponseMapper.single(item) + } +}