feat(statistics): implement top alert stocks, top last sales, top supplier debts, and top selling products endpoints with SQL queries

This commit is contained in:
2026-01-04 13:45:26 +03:30
parent eb6e0e7a0d
commit a2db2daa70
72 changed files with 11934 additions and 2559 deletions
-91
View File
@@ -1,91 +0,0 @@
-- Corrected triggers for sales invoice items
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_before_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_before_insert` BEFORE INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin
DECLARE current_stock DECIMAL(10,2);
DECLARE inventory_id INT;
SELECT pa.inventoryId INTO inventory_id
FROM Pos_Accounts pa
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
WHERE si.id = NEW.invoiceId;
SELECT COALESCE(quantity, 0) INTO current_stock
FROM Stock_Balance sb
WHERE productId = NEW.productId AND sb.inventoryId = inventory_id
LIMIT 1;
IF NEW.count > current_stock THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Not enough stock to complete sale.';
END IF;
end;
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_after_insert` AFTER INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin DECLARE current_stock DECIMAL(10, 2);
DECLARE inventory_id INT;
DECLARE customer_id INT;
DECLARE pos_id INT;
INSERT INTO Trigger_Logs (name , message) VALUES ('pos_id', 'init');
SELECT posAccountId, customerId INTO pos_id, customer_id
FROM Sales_Invoices si
WHERE si.id = NEW.invoiceId
LIMIT 1;
INSERT INTO Trigger_Logs (name , message) VALUES ('pos_id', pos_id);
INSERT INTO Trigger_Logs (name , message) VALUES ('customer_id', customer_id);
SELECT pa.inventoryId INTO inventory_id
FROM Pos_Accounts pa
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
WHERE si.id = NEW.invoiceId;
SELECT COALESCE(quantity, 0) INTO current_stock
FROM Stock_Balance sb
WHERE productId = NEW.productId AND sb.inventoryId = inventory_id
LIMIT 1;
INSERT INTO Trigger_Logs (name , message) VALUES ('invId', inventory_id);
INSERT INTO Stock_Movements (
type,
quantity,
fee,
totalCost,
referenceType,
referenceId,
productId,
inventoryId,
avgCost,
remainedInStock,
customerId,
createdAt
)
VALUES (
'OUT',
NEW.count,
NEW.fee,
NEW.total,
'SALES',
NEW.invoiceId,
NEW.productId,
inventory_id,
CASE
WHEN NEW.count = 0 THEN 0
ELSE NEW.total / NEW.count
END,
current_stock - NEW.count,
customer_id,
NOW()
);
END
+3 -1
View File
@@ -3,6 +3,8 @@
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"deleteOutDir": true
"deleteOutDir": true,
"assets": ["**/*.sql"],
"watchAssets": true
}
}
@@ -1 +0,0 @@
-- This is an empty migration.
@@ -1,347 +0,0 @@
-- AUTO-GENERATED MYSQL TRIGGER DUMP
-- Generated at: 2025-12-22T15:32:20.184Z
-- ------------------------------------------
-- Trigger: trg_transfer_item_after_insert
-- Event: INSERT
-- Table: Inventory_Transfer_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_transfer_item_after_insert`;
CREATE TRIGGER `trg_transfer_item_after_insert` AFTER INSERT ON `Inventory_Transfer_Items` FOR EACH ROW begin
DECLARE fromInv INT;
DECLARE toInv INT;
DECLARE _avgCost DECIMAL(10,2);
DECLARE latestQuantityInOrigin DECIMAL(10,2);
DECLARE latestQuantityInDestination DECIMAL(10,2);
SELECT fromInventoryId, toInventoryId INTO fromInv, toInv
FROM Inventory_Transfers WHERE id = NEW.transferId;
SELECT COALESCE(avgCost, 0), COALESCE(quantity, 0) INTO _avgCost, latestQuantityInOrigin FROM Stock_Balance
WHERE ProductId = NEW.productId AND inventoryId = fromInv LIMIT 1;
SELECT COALESCE(quantity, 0) INTO latestQuantityInDestination FROM Stock_Balance
WHERE ProductId = NEW.productId AND inventoryId = toInv LIMIT 1;
-- OUT from source
INSERT INTO Stock_Movements
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
VALUES
('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, toInv, NOW(), latestQuantityInOrigin-NEW.count);
-- IN to destination
INSERT INTO Stock_Movements
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
VALUES
('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, fromInv, NOW(), latestQuantityInOrigin-NEW.count);
end;
-- ------------------------------------------
-- Trigger: trg_purchase_receipt_item_after_insert
-- Event: INSERT
-- Table: Purchase_Receipt_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_insert`;
CREATE TRIGGER `trg_purchase_receipt_item_after_insert` AFTER INSERT ON `Purchase_Receipt_Items` FOR EACH ROW BEGIN DECLARE latestQuantity DECIMAL(10, 2) DEFAULT 0;
DECLARE invId INT;
DECLARE suppId INT;
-- Get inventory & supplier from receipt
SELECT inventoryId, supplierId
INTO invId, suppId
FROM Purchase_Receipts
WHERE id = NEW.receiptId;
-- Get current stock quantity (if exists)
SELECT COALESCE(quantity, 0)
INTO latestQuantity
FROM Stock_Balance sb
WHERE sb.inventoryId = invId
AND sb.productId = NEW.productId
LIMIT 1;
-- Insert stock movement
INSERT INTO Stock_Movements (
type,
quantity,
fee,
totalCost,
referenceType,
referenceId,
productId,
inventoryId,
avgCost,
supplierId,
remainedInStock,
createdAt
)
VALUES (
'IN',
NEW.count,
NEW.fee,
NEW.total,
'PURCHASE',
NEW.receiptId,
NEW.productId,
invId,
CASE
WHEN NEW.count = 0 THEN 0
ELSE NEW.total / NEW.count
END
,
suppId,
latestQuantity + NEW.count,
NOW()
);
END;
-- ------------------------------------------
-- Trigger: trg_sales_invoice_items_before_insert
-- Event: INSERT
-- Table: Sales_Invoice_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_before_insert`;
CREATE TRIGGER `trg_sales_invoice_items_before_insert` BEFORE INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin DECLARE current_stock DECIMAL(10, 2);
DECLARE inventory_id INT;
SELECT inventoryId INTO inventory_id
FROM Sales_Invoices si
WHERE si.id = NEW.invoiceId
LIMIT 1;
SELECT COALESCE(quantity, 0) INTO current_stock
FROM Stock_Balance sb
WHERE productId = NEW.productId AND sb.inventoryId = inventory_id
LIMIT 1;
IF NEW.count > current_stock THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'موجودی کالا در انبار کافی نیست.';
END IF;
end;
-- ------------------------------------------
-- Trigger: trg_sales_invoice_items_after_insert
-- Event: INSERT
-- Table: Sales_Invoice_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_after_insert`;
CREATE TRIGGER `trg_sales_invoice_items_after_insert` AFTER INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin DECLARE current_stock DECIMAL(10, 2);
DECLARE inventory_id INT;
DECLARE customer_id INT;
SELECT inventoryId , customerId INTO inventory_id, customer_id
FROM Sales_Invoices si
WHERE si.id = NEW.invoiceId
LIMIT 1;
SELECT COALESCE(quantity, 0) INTO current_stock
FROM Stock_Balance sb
WHERE productId = NEW.productId AND sb.inventoryId = inventory_id
LIMIT 1;
INSERT INTO Stock_Movements (
type,
quantity,
fee,
totalCost,
referenceType,
referenceId,
productId,
inventoryId,
avgCost,
remainedInStock,
customerId,
createdAt
)
VALUES (
'OUT',
NEW.count,
NEW.fee,
NEW.total,
'SALES',
NEW.invoiceId,
NEW.productId,
inventory_id,
CASE
WHEN NEW.count = 0 THEN 0
ELSE NEW.total / NEW.count
END,
current_stock + NEW.count,
customer_id,
NOW()
);
END;
-- ------------------------------------------
-- Trigger: trg_stock_transfer
-- Event: INSERT
-- Table: Stock_Movements
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_transfer`;
CREATE TRIGGER `trg_stock_transfer` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'INVENTORY_TRANSFER' THEN IF NEW.type = 'IN' THEN
INSERT INTO
Stock_Balance (
productId,
inventoryId,
quantity,
totalCost,
avgCost,
updatedAt
)
VALUES (
NEW.productId,
NEW.inventoryId,
NEW.quantity,
NEW.totalCost,
CASE
WHEN NEW.quantity = 0 THEN 0
ELSE NEW.totalCost / NEW.quantity
END,
NOW()
)
ON DUPLICATE KEY UPDATE
quantity = quantity + NEW.quantity,
totalCost = totalCost + NEW.totalCost,
avgCost = CASE
WHEN (quantity + NEW.quantity) = 0 THEN 0
ELSE (totalCost + NEW.totalCost) / (quantity + NEW.quantity)
END,
updatedAt = NOW();
END IF;
IF NEW.type = 'OUT' THEN IF EXISTS (
SELECT 1
FROM Stock_Balance sb
WHERE
sb.productId = NEW.productId
AND sb.inventoryId = NEW.inventoryId
) THEN
UPDATE Stock_Balance sb
SET
sb.quantity = sb.quantity - NEW.quantity,
sb.totalCost = sb.totalCost - (sb.avgCost * NEW.quantity),
sb.updatedAt = NOW()
WHERE
sb.productId = NEW.productId
AND sb.inventoryId = NEW.inventoryId;
ELSE
INSERT INTO
Stock_Balance (
productId,
inventoryId,
quantity,
totalCost,
avgCost,
updatedAt
)
VALUES (
NEW.productId,
NEW.inventoryId,
- NEW.quantity,
- COALESCE(NEW.fee, 0) * NEW.quantity,
COALESCE(NEW.fee, 0),
NOW()
);
END IF;
END IF;
END IF;
END;
-- ------------------------------------------
-- Trigger: trg_stock_purchase_insert
-- Event: INSERT
-- Table: Stock_Movements
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_purchase_insert`;
CREATE TRIGGER `trg_stock_purchase_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'PURCHASE' THEN
INSERT INTO
Stock_Balance (
productId,
quantity,
avgCost,
totalCost,
inventoryId,
updatedAt
)
VALUES (
NEW.productId,
NEW.quantity,
NEW.fee,
NEW.totalCost,
NEW.inventoryId,
NOW()
)
ON DUPLICATE KEY UPDATE
quantity = quantity + NEW.quantity,
totalCost = totalCost + NEW.totalCost,
avgCost = totalCost / quantity;
END IF;
END;
-- ------------------------------------------
-- Trigger: trg_stock_sale_insert
-- Event: INSERT
-- Table: Stock_Movements
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_sale_insert`;
CREATE TRIGGER `trg_stock_sale_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'SALES' THEN
INSERT INTO
Stock_Balance (
productId,
quantity,
avgCost,
totalCost,
inventoryId,
updatedAt
)
VALUES (
NEW.productId,
NEW.quantity,
NEW.fee,
NEW.totalCost,
NEW.inventoryId,
NOW()
)
ON DUPLICATE KEY UPDATE
quantity = quantity - NEW.quantity,
totalCost = totalCost - NEW.totalCost,
avgCost = totalCost / quantity;
END IF;
END;
@@ -1,18 +0,0 @@
/*
Warnings:
- You are about to drop the column `bankAccountId` on the `Inventories` table. All the data in the column will be lost.
- You are about to drop the `_Bank_Accounts_inventoryId_fkey` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE `_Bank_Accounts_inventoryId_fkey` DROP FOREIGN KEY `_Bank_Accounts_inventoryId_fkey_A_fkey`;
-- DropForeignKey
ALTER TABLE `_Bank_Accounts_inventoryId_fkey` DROP FOREIGN KEY `_Bank_Accounts_inventoryId_fkey_B_fkey`;
-- AlterTable
ALTER TABLE `Inventories` DROP COLUMN `bankAccountId`;
-- DropTable
DROP TABLE `_Bank_Accounts_inventoryId_fkey`;
@@ -1,158 +0,0 @@
/*
Warnings:
- You are about to alter the column `count` on the `Inventory_Transfer_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`.
- You are about to alter the column `totalAmount` on the `Orders` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `basePrice` on the `Product_Variants` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `salePrice` on the `Product_Variants` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `quantity` on the `Product_Variants` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`.
- You are about to alter the column `alertQuantity` on the `Product_Variants` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`.
- You are about to alter the column `salePrice` on the `Products` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,0)`.
- You are about to alter the column `count` on the `Purchase_Receipt_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`.
- You are about to alter the column `fee` on the `Purchase_Receipt_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `total` on the `Purchase_Receipt_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `amount` on the `Purchase_Receipt_Payments` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to drop the column `isSettled` on the `Purchase_Receipts` table. All the data in the column will be lost.
- You are about to alter the column `totalAmount` on the `Purchase_Receipts` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `paidAmount` on the `Purchase_Receipts` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `count` on the `Sales_Invoice_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`.
- You are about to alter the column `fee` on the `Sales_Invoice_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `total` on the `Sales_Invoice_Items` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `totalAmount` on the `Sales_Invoices` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `adjustedQuantity` on the `Stock_Adjustments` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`.
- You are about to alter the column `quantity` on the `Stock_Movements` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`.
- You are about to alter the column `fee` on the `Stock_Movements` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `totalCost` on the `Stock_Movements` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `avgCost` on the `Stock_Movements` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `remainedInStock` on the `Stock_Movements` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(10,0)`.
- You are about to alter the column `debit` on the `Supplier_Ledger` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `credit` on the `Supplier_Ledger` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- You are about to alter the column `balance` on the `Supplier_Ledger` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(15,2)`.
- A unique constraint covering the columns `[iban]` on the table `Bank_Accounts` will be added. If there are existing duplicate values, this will fail.
- Made the column `bankAccountId` on table `Pos_Accounts` required. This step will fail if there are existing NULL values in that column.
- Added the required column `inventoryId` to the `Purchase_Receipt_Payments` table without a default value. This is not possible if the table is not empty.
- Added the required column `type` to the `Purchase_Receipt_Payments` table without a default value. This is not possible if the table is not empty.
- Made the column `bankAccountId` on table `Purchase_Receipt_Payments` required. This step will fail if there are existing NULL values in that column.
*/
-- DropForeignKey
ALTER TABLE `Pos_Accounts`
DROP FOREIGN KEY `Pos_Accounts_bankAccountId_fkey`;
-- DropForeignKey
ALTER TABLE `Pos_Accounts`
DROP FOREIGN KEY `Pos_Accounts_bankAccountId_inventoryId_fkey`;
-- DropForeignKey
ALTER TABLE `Pos_Accounts`
DROP FOREIGN KEY `Pos_Accounts_inventoryId_fkey`;
-- DropForeignKey
ALTER TABLE `Purchase_Receipt_Payments`
DROP FOREIGN KEY `Purchase_Receipt_Payments_bankAccountId_fkey`;
-- DropIndex
DROP INDEX `Pos_Accounts_bankAccountId_inventoryId_fkey` ON `Pos_Accounts`;
-- DropIndex
DROP INDEX `Purchase_Receipt_Payments_bankAccountId_fkey` ON `Purchase_Receipt_Payments`;
-- AlterTable
ALTER TABLE `Inventory_Transfer_Items`
MODIFY `count` DECIMAL(10, 0) NOT NULL;
-- AlterTable
ALTER TABLE `Orders` MODIFY `totalAmount` DECIMAL(15, 2) NOT NULL;
-- AlterTable
ALTER TABLE `Pos_Accounts` MODIFY `bankAccountId` INTEGER NOT NULL;
-- AlterTable
ALTER TABLE `Product_Variants`
MODIFY `basePrice` DECIMAL(15, 2) NOT NULL,
MODIFY `salePrice` DECIMAL(15, 2) NOT NULL,
MODIFY `quantity` DECIMAL(10, 0) NULL DEFAULT 0.00,
MODIFY `alertQuantity` DECIMAL(10, 0) NULL DEFAULT 5.00;
-- AlterTable
ALTER TABLE `Products`
MODIFY `salePrice` DECIMAL(15, 0) NOT NULL DEFAULT 0.00;
-- AlterTable
ALTER TABLE `Purchase_Receipt_Items`
MODIFY `count` DECIMAL(10, 0) NOT NULL,
MODIFY `fee` DECIMAL(15, 2) NOT NULL,
MODIFY `total` DECIMAL(15, 2) NOT NULL;
-- AlterTable
ALTER TABLE `Purchase_Receipt_Payments`
ADD COLUMN `inventoryId` INTEGER NOT NULL,
ADD COLUMN `type` ENUM('PAYMENT', 'REFUND') NOT NULL,
MODIFY `amount` DECIMAL(15, 2) NOT NULL,
MODIFY `bankAccountId` INTEGER NOT NULL;
-- AlterTable
ALTER TABLE `Purchase_Receipts`
DROP COLUMN `isSettled`,
ADD COLUMN `status` ENUM(
'UNPAID',
'PARTIALLY_PAID',
'PAID'
) NOT NULL DEFAULT 'UNPAID',
MODIFY `totalAmount` DECIMAL(15, 2) NOT NULL,
MODIFY `paidAmount` DECIMAL(15, 2) NOT NULL DEFAULT 0.00;
-- AlterTable
ALTER TABLE `Sales_Invoice_Items`
MODIFY `count` DECIMAL(10, 0) NOT NULL,
MODIFY `fee` DECIMAL(15, 2) NOT NULL,
MODIFY `total` DECIMAL(15, 2) NOT NULL;
-- AlterTable
ALTER TABLE `Sales_Invoices`
MODIFY `totalAmount` DECIMAL(15, 2) NOT NULL;
-- AlterTable
ALTER TABLE `Stock_Adjustments`
MODIFY `adjustedQuantity` DECIMAL(10, 0) NOT NULL;
-- AlterTable
ALTER TABLE `Stock_Movements`
MODIFY `quantity` DECIMAL(10, 0) NOT NULL,
MODIFY `fee` DECIMAL(15, 2) NOT NULL,
MODIFY `totalCost` DECIMAL(15, 2) NOT NULL,
MODIFY `avgCost` DECIMAL(15, 2) NOT NULL,
MODIFY `remainedInStock` DECIMAL(10, 0) NOT NULL DEFAULT 0.00;
-- AlterTable
ALTER TABLE `Supplier_Ledger`
MODIFY `debit` DECIMAL(15, 2) NOT NULL DEFAULT 0,
MODIFY `credit` DECIMAL(15, 2) NOT NULL DEFAULT 0,
MODIFY `balance` DECIMAL(15, 2) NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX `Bank_Accounts_iban_key` ON `Bank_Accounts` (`iban`);
-- AddForeignKey
ALTER TABLE `Pos_Accounts`
ADD CONSTRAINT `Pos_Accounts_inventoryId_bankAccountId_fkey` FOREIGN KEY (
`inventoryId`,
`bankAccountId`
) REFERENCES `Inventory_Bank_Accounts` (
`inventoryId`,
`bankAccountId`
) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Purchase_Receipt_Payments`
ADD CONSTRAINT `Purchase_Receipt_Payments_inventoryId_bankAccountId_fkey` FOREIGN KEY (
`inventoryId`,
`bankAccountId`
) REFERENCES `Inventory_Bank_Accounts` (
`inventoryId`,
`bankAccountId`
) ON DELETE RESTRICT ON UPDATE CASCADE;
-- RenameIndex
ALTER TABLE `Supplier_Ledger`
RENAME INDEX `Supplier_Ledger_supplierId_fkey` TO `Supplier_Ledger_supplierId_idx`;
@@ -1,2 +0,0 @@
-- CreateIndex
CREATE INDEX `Pos_Accounts_inventoryId_idx` ON `Pos_Accounts`(`inventoryId`);
@@ -1,14 +0,0 @@
/*
Warnings:
- You are about to drop the column `inventoryId` on the `Purchase_Receipt_Payments` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE `Purchase_Receipt_Payments` DROP FOREIGN KEY `Purchase_Receipt_Payments_inventoryId_bankAccountId_fkey`;
-- DropIndex
DROP INDEX `Purchase_Receipt_Payments_inventoryId_bankAccountId_fkey` ON `Purchase_Receipt_Payments`;
-- AlterTable
ALTER TABLE `Purchase_Receipt_Payments` DROP COLUMN `inventoryId`;
@@ -1,2 +0,0 @@
-- AddForeignKey
ALTER TABLE `Purchase_Receipt_Payments` ADD CONSTRAINT `Purchase_Receipt_Payments_bankAccountId_fkey` FOREIGN KEY (`bankAccountId`) REFERENCES `Bank_Accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -1,50 +0,0 @@
/*
Warnings:
- You are about to drop the column `inventoryId` on the `Sales_Invoices` table. All the data in the column will be lost.
- Added the required column `posAccountId` to the `Sales_Invoices` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE `Sales_Invoices` DROP FOREIGN KEY `Sales_Invoices_inventoryId_fkey`;
-- DropIndex
DROP INDEX `Sales_Invoices_inventoryId_fkey` ON `Sales_Invoices`;
-- AlterTable
ALTER TABLE `Purchase_Receipt_Payments` ADD COLUMN `inventoryBankAccountBankAccountId` INTEGER NULL,
ADD COLUMN `inventoryBankAccountInventoryId` INTEGER NULL;
-- AlterTable
ALTER TABLE `Sales_Invoices` DROP COLUMN `inventoryId`,
ADD COLUMN `posAccountId` INTEGER NOT NULL;
-- CreateIndex
CREATE INDEX `Sales_Invoices_posAccountId_idx` ON `Sales_Invoices`(`posAccountId`);
-- AddForeignKey
ALTER TABLE `Sales_Invoices` ADD CONSTRAINT `Sales_Invoices_posAccountId_fkey` FOREIGN KEY (`posAccountId`) REFERENCES `Pos_Accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Purchase_Receipt_Payments` ADD CONSTRAINT `Purchase_Receipt_Payments_inventoryBankAccountInventoryId_i_fkey` FOREIGN KEY (`inventoryBankAccountInventoryId`, `inventoryBankAccountBankAccountId`) REFERENCES `Inventory_Bank_Accounts`(`inventoryId`, `bankAccountId`) ON DELETE SET NULL ON UPDATE CASCADE;
-- RenameIndex
ALTER TABLE `Orders` RENAME INDEX `Orders_customerId_fkey` TO `Orders_customerId_idx`;
-- RenameIndex
ALTER TABLE `Product_Variants` RENAME INDEX `products_barcode_unique` TO `Product_Variants_barcode_key`;
-- RenameIndex
ALTER TABLE `Products` RENAME INDEX `products_barcode_unique` TO `Products_barcode_key`;
-- RenameIndex
ALTER TABLE `Products` RENAME INDEX `products_sku_unique` TO `Products_sku_key`;
-- RenameIndex
ALTER TABLE `Sales_Invoice_Items` RENAME INDEX `Sales_Invoice_Items_invoiceId_fkey` TO `Sales_Invoice_Items_invoiceId_idx`;
-- RenameIndex
ALTER TABLE `Sales_Invoice_Items` RENAME INDEX `Sales_Invoice_Items_productId_fkey` TO `Sales_Invoice_Items_productId_idx`;
-- RenameIndex
ALTER TABLE `Sales_Invoices` RENAME INDEX `Sales_Invoices_customerId_fkey` TO `Sales_Invoices_customerId_idx`;
@@ -1,2 +0,0 @@
-- AlterTable
ALTER TABLE `Products` ADD COLUMN `minimumStockAlertLevel` DECIMAL(10, 0) NOT NULL DEFAULT 1.00;
@@ -84,9 +84,35 @@ CREATE TABLE `Bank_Accounts` (
UNIQUE INDEX `Bank_Accounts_accountNumber_key`(`accountNumber`),
UNIQUE INDEX `Bank_Accounts_cardNumber_key`(`cardNumber`),
UNIQUE INDEX `Bank_Accounts_iban_key`(`iban`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Bank_Account_Transactions` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`bankAccountId` INTEGER NOT NULL,
`type` ENUM('DEPOSIT', 'WITHDRAWAL') NOT NULL,
`amount` DECIMAL(15, 2) NOT NULL,
`balanceAfter` DECIMAL(15, 2) NOT NULL,
`referenceId` INTEGER NOT NULL,
`referenceType` ENUM('PURCHASE_PAYMENT', 'PURCHASE_REFUND', 'POS_SALE', 'POS_REFUND', 'BANK_TRANSFER', 'MANUAL_ADJUSTMENT') NOT NULL,
`description` TEXT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
INDEX `Bank_Account_Transactions_bankAccountId_idx`(`bankAccountId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Bank_Account_Balance` (
`bankAccountId` INTEGER NOT NULL,
`balance` DECIMAL(15, 2) NOT NULL,
`updatedAt` TIMESTAMP(0) NOT NULL,
UNIQUE INDEX `Bank_Account_Balance_bankAccountId_key`(`bankAccountId`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Inventories` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
@@ -97,11 +123,36 @@ CREATE TABLE `Inventories` (
`updatedAt` TIMESTAMP(0) NOT NULL,
`deletedAt` TIMESTAMP(0) NULL,
`isPointOfSale` BOOLEAN NOT NULL DEFAULT false,
`bankAccountId` INTEGER NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Inventory_Bank_Accounts` (
`inventoryId` INTEGER NOT NULL,
`bankAccountId` INTEGER NOT NULL,
INDEX `Inventory_Bank_Accounts_bankAccountId_idx`(`bankAccountId`),
PRIMARY KEY (`inventoryId`, `bankAccountId`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Pos_Accounts` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`code` VARCHAR(10) NOT NULL,
`description` VARCHAR(500) NULL,
`bankAccountId` INTEGER NOT NULL,
`inventoryId` INTEGER NOT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`updatedAt` TIMESTAMP(0) NOT NULL,
`deletedAt` TIMESTAMP(0) NULL,
UNIQUE INDEX `Pos_Accounts_code_key`(`code`),
INDEX `Pos_Accounts_inventoryId_idx`(`inventoryId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Inventory_Transfers` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
@@ -120,7 +171,7 @@ CREATE TABLE `Inventory_Transfers` (
-- CreateTable
CREATE TABLE `Inventory_Transfer_Items` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`count` DECIMAL(10, 2) NOT NULL,
`count` DECIMAL(10, 0) NOT NULL,
`productId` INTEGER NOT NULL,
`transferId` INTEGER NOT NULL,
@@ -129,31 +180,6 @@ CREATE TABLE `Inventory_Transfer_Items` (
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Inventory_Bank_Accounts` (
`inventoryId` INTEGER NOT NULL,
`bankAccountId` INTEGER NOT NULL,
INDEX `Inventory_Bank_Accounts_bankAccountId_idx`(`bankAccountId`),
PRIMARY KEY (`inventoryId`, `bankAccountId`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Pos_Accounts` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`code` VARCHAR(10) NOT NULL,
`description` VARCHAR(500) NULL,
`bankAccountId` INTEGER NULL,
`inventoryId` INTEGER NOT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`updatedAt` TIMESTAMP(0) NOT NULL,
`deletedAt` TIMESTAMP(0) NULL,
UNIQUE INDEX `Pos_Accounts_code_key`(`code`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Banks` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
@@ -168,38 +194,34 @@ CREATE TABLE `Banks` (
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Suppliers` (
CREATE TABLE `Orders` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`firstName` VARCHAR(255) NOT NULL,
`lastName` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NULL,
`mobileNumber` CHAR(11) NOT NULL,
`address` TEXT NULL,
`city` VARCHAR(100) NULL,
`state` VARCHAR(100) NULL,
`country` VARCHAR(100) NULL,
`isActive` BOOLEAN NOT NULL DEFAULT true,
`orderNumber` VARCHAR(100) NOT NULL,
`status` ENUM('PENDING', 'REJECT', 'DONE') NOT NULL DEFAULT 'PENDING',
`totalAmount` DECIMAL(15, 2) NOT NULL,
`description` TEXT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`updatedAt` TIMESTAMP(0) NOT NULL,
`deletedAt` TIMESTAMP(0) NULL,
`customerId` INTEGER NULL,
UNIQUE INDEX `Suppliers_mobileNumber_key`(`mobileNumber`),
UNIQUE INDEX `Orders_orderNumber_key`(`orderNumber`),
INDEX `Orders_customerId_idx`(`customerId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Supplier_Ledger` (
CREATE TABLE `Order_Items` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`description` TEXT NULL,
`debit` DECIMAL(10, 2) NOT NULL,
`credit` DECIMAL(10, 2) NOT NULL,
`balance` DECIMAL(10, 2) NOT NULL,
`sourceType` ENUM('PURCHASE', 'PAYMENT', 'ADJUSTMENT', 'REFUND') NOT NULL,
`sourceId` INTEGER NOT NULL,
`quantity` DECIMAL(10, 0) NOT NULL,
`unitPrice` DECIMAL(15, 2) NOT NULL,
`totalPrice` DECIMAL(15, 2) NOT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`supplierId` INTEGER NOT NULL,
`orderId` INTEGER NOT NULL,
`productId` INTEGER NOT NULL,
INDEX `Supplier_Ledger_supplierId_fkey`(`supplierId`),
INDEX `Order_Items_orderId_idx`(`orderId`),
INDEX `Order_Items_productId_idx`(`productId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@@ -223,56 +245,6 @@ CREATE TABLE `Customers` (
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', 'BANK', 'CHECK', 'OTHER') NOT NULL DEFAULT 'CARD',
`totalAmount` DECIMAL(10, 2) NOT NULL,
`description` TEXT 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`),
INDEX `Orders_customerId_fkey`(`customerId`),
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,
`inventoryId` INTEGER NOT NULL,
UNIQUE INDEX `Sales_Invoices_code_key`(`code`),
INDEX `Sales_Invoices_inventoryId_fkey`(`inventoryId`),
INDEX `Sales_Invoices_customerId_fkey`(`customerId`),
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,
INDEX `Sales_Invoice_Items_invoiceId_fkey`(`invoiceId`),
INDEX `Sales_Invoice_Items_productId_fkey`(`productId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Trigger_Logs` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
@@ -287,14 +259,14 @@ CREATE TABLE `Trigger_Logs` (
CREATE TABLE `Product_Variants` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`basePrice` DECIMAL(10, 2) NOT NULL,
`salePrice` DECIMAL(10, 2) NOT NULL,
`basePrice` DECIMAL(15, 2) NOT NULL,
`salePrice` DECIMAL(15, 2) NOT NULL,
`description` TEXT NULL,
`barcode` VARCHAR(100) NULL,
`imageUrl` VARCHAR(255) NULL,
`unit` VARCHAR(10) NULL,
`quantity` DECIMAL(10, 2) NULL DEFAULT 0.00,
`alertQuantity` DECIMAL(10, 2) NULL DEFAULT 5.00,
`quantity` DECIMAL(10, 0) NULL DEFAULT 0.00,
`alertQuantity` DECIMAL(10, 0) NULL DEFAULT 5.00,
`isActive` BOOLEAN NOT NULL DEFAULT true,
`isFeatured` BOOLEAN NOT NULL DEFAULT false,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
@@ -302,7 +274,7 @@ CREATE TABLE `Product_Variants` (
`deletedAt` TIMESTAMP(0) NULL,
`productId` INTEGER NOT NULL,
UNIQUE INDEX `products_barcode_unique`(`barcode`),
UNIQUE INDEX `Product_Variants_barcode_key`(`barcode`),
INDEX `Product_Variants_productId_fkey`(`productId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@@ -319,10 +291,11 @@ CREATE TABLE `Products` (
`deletedAt` TIMESTAMP(0) NULL,
`brandId` INTEGER NULL,
`categoryId` INTEGER NULL,
`salePrice` DECIMAL(10, 2) NOT NULL DEFAULT 0.00,
`salePrice` DECIMAL(15, 0) NOT NULL DEFAULT 0.00,
`minimumStockAlertLevel` DECIMAL(10, 0) NOT NULL DEFAULT 1.00,
UNIQUE INDEX `products_sku_unique`(`sku`),
UNIQUE INDEX `products_barcode_unique`(`barcode`),
UNIQUE INDEX `Products_sku_key`(`sku`),
UNIQUE INDEX `Products_barcode_key`(`barcode`),
INDEX `Products_brandId_fkey`(`brandId`),
INDEX `Products_categoryId_fkey`(`categoryId`),
PRIMARY KEY (`id`)
@@ -358,12 +331,12 @@ CREATE TABLE `Product_categories` (
CREATE TABLE `Purchase_Receipts` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`code` VARCHAR(100) NOT NULL,
`totalAmount` DECIMAL(10, 2) NOT NULL,
`paidAmount` DECIMAL(10, 2) NOT NULL DEFAULT 0.00,
`isSettled` BOOLEAN NOT NULL DEFAULT false,
`totalAmount` DECIMAL(15, 2) NOT NULL,
`paidAmount` DECIMAL(15, 2) NOT NULL DEFAULT 0.00,
`description` TEXT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`updatedAt` TIMESTAMP(0) NOT NULL,
`status` ENUM('UNPAID', 'PARTIALLY_PAID', 'PAID') NOT NULL DEFAULT 'UNPAID',
`supplierId` INTEGER NOT NULL,
`inventoryId` INTEGER NOT NULL,
@@ -376,13 +349,13 @@ CREATE TABLE `Purchase_Receipts` (
-- 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,
`description` TEXT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`count` DECIMAL(10, 0) NOT NULL,
`unitPrice` DECIMAL(15, 2) NOT NULL,
`totalPrice` DECIMAL(15, 2) NOT NULL,
`receiptId` INTEGER NOT NULL,
`productId` INTEGER NOT NULL,
`description` TEXT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
INDEX `Purchase_Receipt_Items_productId_fkey`(`productId`),
INDEX `Purchase_Receipt_Items_receiptId_fkey`(`receiptId`),
@@ -392,16 +365,63 @@ CREATE TABLE `Purchase_Receipt_Items` (
-- CreateTable
CREATE TABLE `Purchase_Receipt_Payments` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`amount` DECIMAL(10, 2) NOT NULL,
`amount` DECIMAL(15, 2) NOT NULL,
`paymentMethod` ENUM('CASH', 'CARD', 'BANK', 'CHECK', 'OTHER') NOT NULL,
`bankAccountId` INTEGER NULL,
`description` TEXT NULL,
`payedAt` TIMESTAMP(0) NOT NULL,
`type` ENUM('PAYMENT', 'REFUND') NOT NULL,
`bankAccountId` INTEGER NOT NULL,
`receiptId` INTEGER NOT NULL,
`payedAt` TIMESTAMP(0) NOT NULL,
`description` TEXT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`inventoryBankAccountInventoryId` INTEGER NULL,
`inventoryBankAccountBankAccountId` INTEGER NULL,
INDEX `Purchase_Receipt_Payments_receiptId_fkey`(`receiptId`),
INDEX `Purchase_Receipt_Payments_bankAccountId_fkey`(`bankAccountId`),
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(15, 2) NOT NULL,
`description` TEXT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`updatedAt` TIMESTAMP(0) NOT NULL,
`customerId` INTEGER NULL,
`posAccountId` INTEGER NOT NULL,
UNIQUE INDEX `Sales_Invoices_code_key`(`code`),
INDEX `Sales_Invoices_customerId_idx`(`customerId`),
INDEX `Sales_Invoices_posAccountId_idx`(`posAccountId`),
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, 0) NOT NULL,
`unitPrice` DECIMAL(15, 2) NOT NULL DEFAULT 0.00,
`totalPrice` DECIMAL(15, 2) NOT NULL DEFAULT 0.00,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`invoiceId` INTEGER NOT NULL,
`productId` INTEGER NOT NULL,
INDEX `Sales_Invoice_Items_invoiceId_idx`(`invoiceId`),
INDEX `Sales_Invoice_Items_productId_idx`(`productId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `SalesInvoicePayment` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`invoiceId` INTEGER NOT NULL,
`amount` DECIMAL(15, 2) NOT NULL,
`paymentMethod` ENUM('CASH', 'CARD', 'BANK', 'CHECK', 'OTHER') NOT NULL,
`paidAt` DATETIME(3) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
INDEX `SalesInvoicePayment_invoiceId_idx`(`invoiceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@@ -409,17 +429,17 @@ CREATE TABLE `Purchase_Receipt_Payments` (
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,
`quantity` DECIMAL(10, 0) NOT NULL,
`unitPrice` DECIMAL(15, 2) NOT NULL,
`totalCost` DECIMAL(15, 2) NOT NULL,
`referenceType` ENUM('PURCHASE', 'SALES', 'ADJUSTMENT', 'INVENTORY_TRANSFER') NOT NULL,
`referenceId` VARCHAR(191) NOT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`productId` INTEGER NOT NULL,
`inventoryId` INTEGER NOT NULL,
`avgCost` DECIMAL(10, 2) NOT NULL,
`avgCost` DECIMAL(15, 2) NOT NULL,
`supplierId` INTEGER NULL,
`remainedInStock` DECIMAL(10, 2) NOT NULL DEFAULT 0.00,
`remainedInStock` DECIMAL(10, 0) NOT NULL DEFAULT 0.00,
`counterInventoryId` INTEGER NULL,
`customerId` INTEGER NULL,
@@ -451,7 +471,7 @@ CREATE TABLE `Stock_Balance` (
-- CreateTable
CREATE TABLE `Stock_Adjustments` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`adjustedQuantity` DECIMAL(10, 2) NOT NULL,
`adjustedQuantity` DECIMAL(10, 0) NOT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`productId` INTEGER NOT NULL,
`inventoryId` INTEGER NOT NULL,
@@ -462,12 +482,54 @@ CREATE TABLE `Stock_Adjustments` (
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `_Bank_Accounts_inventoryId_fkey` (
`A` INTEGER NOT NULL,
`B` INTEGER NOT NULL,
CREATE TABLE `Stock_Reservations` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`quantity` DECIMAL(10, 0) NOT NULL,
`expiresAt` TIMESTAMP(0) NOT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`productId` INTEGER NOT NULL,
`inventoryId` INTEGER NOT NULL,
`orderId` INTEGER NOT NULL,
UNIQUE INDEX `_Bank_Accounts_inventoryId_fkey_AB_unique`(`A`, `B`),
INDEX `_Bank_Accounts_inventoryId_fkey_B_index`(`B`)
INDEX `Stock_Reservations_inventoryId_idx`(`inventoryId`),
INDEX `Stock_Reservations_productId_idx`(`productId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Suppliers` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`firstName` VARCHAR(255) NOT NULL,
`lastName` VARCHAR(255) NOT NULL,
`email` VARCHAR(255) NULL,
`mobileNumber` CHAR(11) NOT NULL,
`address` TEXT NULL,
`city` VARCHAR(100) NULL,
`state` VARCHAR(100) NULL,
`country` VARCHAR(100) NULL,
`isActive` BOOLEAN NOT NULL DEFAULT true,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`updatedAt` TIMESTAMP(0) NOT NULL,
`deletedAt` TIMESTAMP(0) NULL,
UNIQUE INDEX `Suppliers_mobileNumber_key`(`mobileNumber`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Supplier_Ledger` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`description` TEXT NULL,
`debit` DECIMAL(15, 2) NOT NULL DEFAULT 0,
`credit` DECIMAL(15, 2) NOT NULL DEFAULT 0,
`balance` DECIMAL(15, 2) NOT NULL,
`sourceType` ENUM('PURCHASE', 'PAYMENT', 'ADJUSTMENT', 'REFUND') NOT NULL,
`sourceId` INTEGER NOT NULL,
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
`supplierId` INTEGER NOT NULL,
INDEX `Supplier_Ledger_supplierId_idx`(`supplierId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
@@ -482,6 +544,21 @@ ALTER TABLE `Bank_Branches` ADD CONSTRAINT `Bank_Branches_bankId_fkey` FOREIGN K
-- AddForeignKey
ALTER TABLE `Bank_Accounts` ADD CONSTRAINT `Bank_Accounts_branchId_fkey` FOREIGN KEY (`branchId`) REFERENCES `Bank_Branches`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Bank_Account_Transactions` ADD CONSTRAINT `Bank_Account_Transactions_bankAccountId_fkey` FOREIGN KEY (`bankAccountId`) REFERENCES `Bank_Accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Bank_Account_Balance` ADD CONSTRAINT `Bank_Account_Balance_bankAccountId_fkey` FOREIGN KEY (`bankAccountId`) REFERENCES `Bank_Accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Inventory_Bank_Accounts` ADD CONSTRAINT `Inventory_Bank_Accounts_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Inventory_Bank_Accounts` ADD CONSTRAINT `Inventory_Bank_Accounts_bankAccountId_fkey` FOREIGN KEY (`bankAccountId`) REFERENCES `Bank_Accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Pos_Accounts` ADD CONSTRAINT `Pos_Accounts_inventoryId_bankAccountId_fkey` FOREIGN KEY (`inventoryId`, `bankAccountId`) REFERENCES `Inventory_Bank_Accounts`(`inventoryId`, `bankAccountId`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Inventory_Transfers` ADD CONSTRAINT `Inventory_Transfers_fromInventoryId_fkey` FOREIGN KEY (`fromInventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -495,37 +572,13 @@ ALTER TABLE `Inventory_Transfer_Items` ADD CONSTRAINT `Inventory_Transfer_Items_
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 `Inventory_Bank_Accounts` ADD CONSTRAINT `Inventory_Bank_Accounts_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
ALTER TABLE `Orders` ADD CONSTRAINT `Orders_customerId_fkey` FOREIGN KEY (`customerId`) REFERENCES `Customers`(`id`) ON DELETE SET NULL ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE `Inventory_Bank_Accounts` ADD CONSTRAINT `Inventory_Bank_Accounts_bankAccountId_fkey` FOREIGN KEY (`bankAccountId`) REFERENCES `Bank_Accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
ALTER TABLE `Order_Items` ADD CONSTRAINT `Order_Items_orderId_fkey` FOREIGN KEY (`orderId`) REFERENCES `Orders`(`id`) ON DELETE RESTRICT ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE `Pos_Accounts` ADD CONSTRAINT `Pos_Accounts_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Pos_Accounts` ADD CONSTRAINT `Pos_Accounts_bankAccountId_inventoryId_fkey` FOREIGN KEY (`bankAccountId`, `inventoryId`) REFERENCES `Inventory_Bank_Accounts`(`bankAccountId`, `inventoryId`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Pos_Accounts` ADD CONSTRAINT `Pos_Accounts_bankAccountId_fkey` FOREIGN KEY (`bankAccountId`) REFERENCES `Bank_Accounts`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Supplier_Ledger` ADD CONSTRAINT `Supplier_Ledger_supplierId_fkey` FOREIGN KEY (`supplierId`) REFERENCES `Suppliers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- 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 `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_Invoices` ADD CONSTRAINT `Sales_Invoices_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT 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;
ALTER TABLE `Order_Items` ADD CONSTRAINT `Order_Items_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE NO ACTION;
-- AddForeignKey
ALTER TABLE `Product_Variants` ADD CONSTRAINT `Product_Variants_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE NO ACTION;
@@ -552,7 +605,25 @@ ALTER TABLE `Purchase_Receipt_Items` ADD CONSTRAINT `Purchase_Receipt_Items_rece
ALTER TABLE `Purchase_Receipt_Payments` ADD CONSTRAINT `Purchase_Receipt_Payments_receiptId_fkey` FOREIGN KEY (`receiptId`) REFERENCES `Purchase_Receipts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Purchase_Receipt_Payments` ADD CONSTRAINT `Purchase_Receipt_Payments_bankAccountId_fkey` FOREIGN KEY (`bankAccountId`) REFERENCES `Bank_Accounts`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `Purchase_Receipt_Payments` ADD CONSTRAINT `Purchase_Receipt_Payments_bankAccountId_fkey` FOREIGN KEY (`bankAccountId`) REFERENCES `Bank_Accounts`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Purchase_Receipt_Payments` ADD CONSTRAINT `Purchase_Receipt_Payments_inventoryBankAccountInventoryId_i_fkey` FOREIGN KEY (`inventoryBankAccountInventoryId`, `inventoryBankAccountBankAccountId`) REFERENCES `Inventory_Bank_Accounts`(`inventoryId`, `bankAccountId`) ON DELETE SET NULL 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_Invoices` ADD CONSTRAINT `Sales_Invoices_posAccountId_fkey` FOREIGN KEY (`posAccountId`) REFERENCES `Pos_Accounts`(`id`) ON DELETE RESTRICT 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 `SalesInvoicePayment` ADD CONSTRAINT `SalesInvoicePayment_invoiceId_fkey` FOREIGN KEY (`invoiceId`) REFERENCES `Sales_Invoices`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Stock_Movements` ADD CONSTRAINT `Stock_Movements_counterInventoryId_fkey` FOREIGN KEY (`counterInventoryId`) REFERENCES `Inventories`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
@@ -582,7 +653,10 @@ ALTER TABLE `Stock_Adjustments` ADD CONSTRAINT `Stock_Adjustments_inventoryId_fk
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 `_Bank_Accounts_inventoryId_fkey` ADD CONSTRAINT `_Bank_Accounts_inventoryId_fkey_A_fkey` FOREIGN KEY (`A`) REFERENCES `Bank_Accounts`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `Stock_Reservations` ADD CONSTRAINT `Stock_Reservations_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `_Bank_Accounts_inventoryId_fkey` ADD CONSTRAINT `_Bank_Accounts_inventoryId_fkey_B_fkey` FOREIGN KEY (`B`) REFERENCES `Inventories`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `Stock_Reservations` ADD CONSTRAINT `Stock_Reservations_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `Supplier_Ledger` ADD CONSTRAINT `Supplier_Ledger_supplierId_fkey` FOREIGN KEY (`supplierId`) REFERENCES `Suppliers`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,21 @@
/*
Warnings:
- You are about to drop the column `totalPrice` on the `Order_Items` table. All the data in the column will be lost.
- You are about to drop the column `totalPrice` on the `Purchase_Receipt_Items` table. All the data in the column will be lost.
- You are about to drop the column `totalPrice` on the `Sales_Invoice_Items` table. All the data in the column will be lost.
- Added the required column `totalAmount` to the `Order_Items` table without a default value. This is not possible if the table is not empty.
- Added the required column `totalAmount` to the `Purchase_Receipt_Items` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `Order_Items` DROP COLUMN `totalPrice`,
ADD COLUMN `totalAmount` DECIMAL(15, 2) NOT NULL;
-- AlterTable
ALTER TABLE `Purchase_Receipt_Items` DROP COLUMN `totalPrice`,
ADD COLUMN `totalAmount` DECIMAL(15, 2) NOT NULL;
-- AlterTable
ALTER TABLE `Sales_Invoice_Items` DROP COLUMN `totalPrice`,
ADD COLUMN `totalAmount` DECIMAL(15, 2) NOT NULL DEFAULT 0.00;
@@ -0,0 +1,27 @@
/*
Warnings:
- You are about to drop the `SalesInvoicePayment` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE `SalesInvoicePayment` DROP FOREIGN KEY `SalesInvoicePayment_invoiceId_fkey`;
-- DropTable
DROP TABLE `SalesInvoicePayment`;
-- CreateTable
CREATE TABLE `Sales_Invoice_Payments` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`invoiceId` INTEGER NOT NULL,
`amount` DECIMAL(15, 2) NOT NULL,
`paymentMethod` ENUM('CASH', 'CARD', 'BANK', 'CHECK', 'OTHER') NOT NULL,
`paidAt` DATETIME(3) NOT NULL,
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
INDEX `Sales_Invoice_Payments_invoiceId_idx`(`invoiceId`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `Sales_Invoice_Payments` ADD CONSTRAINT `Sales_Invoice_Payments_invoiceId_fkey` FOREIGN KEY (`invoiceId`) REFERENCES `Sales_Invoices`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,8 @@
/*
Warnings:
- The values [REJECT] on the enum `Orders_status` will be removed. If these variants are still used in the database, this will fail.
*/
-- AlterTable
ALTER TABLE `Orders` MODIFY `status` ENUM('PENDING', 'REJECTED', 'CANCELED', 'DONE') NOT NULL DEFAULT 'PENDING';
+10 -10
View File
@@ -25,13 +25,13 @@ DECLARE fromInv INT;
-- OUT from source
INSERT INTO Stock_Movements
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
VALUES
('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, toInv, NOW(), latestQuantityInOrigin-NEW.count);
-- IN to destination
INSERT INTO Stock_Movements
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
VALUES
('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, fromInv, NOW(), latestQuantityInOrigin-NEW.count);
end;
@@ -66,7 +66,7 @@ DECLARE invId INT;
INSERT INTO Stock_Movements (
type,
quantity,
fee,
unitPrice,
totalCost,
referenceType,
referenceId,
@@ -80,7 +80,7 @@ DECLARE invId INT;
VALUES (
'IN',
NEW.count,
NEW.fee,
NEW.unitPrice,
NEW.total,
'PURCHASE',
NEW.receiptId,
@@ -157,7 +157,7 @@ DECLARE customer_id INT;
INSERT INTO Stock_Movements (
type,
quantity,
fee,
unitPrice,
totalCost,
referenceType,
referenceId,
@@ -171,7 +171,7 @@ DECLARE customer_id INT;
VALUES (
'OUT',
NEW.count,
NEW.fee,
NEW.unitPrice,
NEW.total,
'SALES',
NEW.invoiceId,
@@ -260,8 +260,8 @@ VALUES (
NEW.productId,
NEW.inventoryId,
- NEW.quantity,
- COALESCE(NEW.fee, 0) * NEW.quantity,
COALESCE(NEW.fee, 0),
- COALESCE(NEW.unitPrice, 0) * NEW.quantity,
COALESCE(NEW.unitPrice, 0),
NOW()
);
@@ -294,7 +294,7 @@ INSERT INTO
VALUES (
NEW.productId,
NEW.quantity,
NEW.fee,
NEW.unitPrice,
NEW.totalCost,
NEW.inventoryId,
NOW()
@@ -329,7 +329,7 @@ INSERT INTO
VALUES (
NEW.productId,
NEW.quantity,
NEW.fee,
NEW.unitPrice,
NEW.totalCost,
NEW.inventoryId,
NOW()
+29
View File
@@ -28,6 +28,35 @@ model BankAccount {
branch BankBranch @relation("Bank_Accounts_branchId_fkey", fields: [branchId], references: [id])
inventoryBankAccounts InventoryBankAccount[]
purchaseReceiptPayments PurchaseReceiptPayments[]
bankAccountTransactions BankAccountTransaction[]
bankAccountBalances BankAccountBalance[]
@@map("Bank_Accounts")
}
model BankAccountTransaction {
id Int @id @default(autoincrement())
bankAccountId Int
type BankAccountTransactionType
amount Decimal @db.Decimal(15, 2)
balanceAfter Decimal @db.Decimal(15, 2)
referenceId Int
referenceType BankTransactionRefType
description String? @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0)
bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])
@@index([bankAccountId])
@@map("Bank_Account_Transactions")
}
model BankAccountBalance {
bankAccountId Int @unique
balance Decimal @db.Decimal(15, 2)
updatedAt DateTime @updatedAt @db.Timestamp(0)
bankAccount BankAccount @relation(fields: [bankAccountId], references: [id])
@@map("Bank_Account_Balance")
}
+16 -1
View File
@@ -1,6 +1,7 @@
enum OrderStatus {
PENDING
REJECT
REJECTED
CANCELED
DONE
}
@@ -42,3 +43,17 @@ enum PurchaseReceiptStatus {
PARTIALLY_PAID
PAID
}
enum BankAccountTransactionType {
DEPOSIT
WITHDRAWAL
}
enum BankTransactionRefType {
PURCHASE_PAYMENT
PURCHASE_REFUND
POS_SALE
POS_REFUND
BANK_TRANSFER
MANUAL_ADJUSTMENT
}
+1
View File
@@ -15,6 +15,7 @@ model Inventory {
counterStockMovements StockMovement[] @relation("StockMovement_CounterInventory")
stockMovements StockMovement[] @relation("StockMovement_Inventory")
inventoryBankAccounts InventoryBankAccount[]
stockReservations StockReservation[]
@@map("Inventories")
}
+33
View File
@@ -0,0 +1,33 @@
model Order {
id Int @id @default(autoincrement())
orderNumber String @unique @db.VarChar(100)
status OrderStatus @default(PENDING)
totalAmount Decimal @db.Decimal(15, 2)
description String? @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0)
deletedAt DateTime? @db.Timestamp(0)
customerId Int?
customer Customer? @relation(fields: [customerId], references: [id], onUpdate: NoAction)
orderItems OrderItem[]
@@index([customerId])
@@map("Orders")
}
model OrderItem {
id Int @id @default(autoincrement())
quantity Decimal @db.Decimal(10, 0)
unitPrice Decimal @db.Decimal(15, 2)
totalAmount Decimal @db.Decimal(15, 2)
createdAt DateTime @default(now()) @db.Timestamp(0)
orderId Int
productId Int
order Order @relation(fields: [orderId], references: [id], onUpdate: NoAction)
product Product @relation(fields: [productId], references: [id], onUpdate: NoAction)
@@index([orderId])
@@index([productId])
@@map("Order_Items")
}
-51
View File
@@ -19,57 +19,6 @@ model Customer {
@@map("Customers")
}
model Order {
id Int @id @default(autoincrement())
orderNumber String @unique @db.VarChar(100)
status OrderStatus @default(PENDING)
paymentMethod PaymentMethodType @default(CARD)
totalAmount Decimal @db.Decimal(15, 2)
description String? @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0)
deletedAt DateTime? @db.Timestamp(0)
customerId Int
customer Customer @relation(fields: [customerId], references: [id], onUpdate: NoAction)
@@index([customerId])
@@map("Orders")
}
model SalesInvoice {
id Int @id @default(autoincrement())
code String @unique @db.VarChar(100)
totalAmount Decimal @db.Decimal(15, 2)
description String? @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0)
customerId Int?
posAccountId Int
items SalesInvoiceItem[]
customer Customer? @relation(fields: [customerId], references: [id])
posAccount PosAccount @relation(fields: [posAccountId], references: [id])
@@index([customerId])
@@index([posAccountId])
@@map("Sales_Invoices")
}
model SalesInvoiceItem {
id Int @id @default(autoincrement())
count Decimal @db.Decimal(10, 0)
fee Decimal @db.Decimal(15, 2)
total Decimal @db.Decimal(15, 2)
createdAt DateTime @default(now()) @db.Timestamp(0)
invoiceId Int
productId Int
invoice SalesInvoice @relation(fields: [invoiceId], references: [id])
product Product @relation(fields: [productId], references: [id])
@@index([invoiceId])
@@index([productId])
@@map("Sales_Invoice_Items")
}
model TriggerLog {
id Int @id @default(autoincrement())
message String @db.Text
+2
View File
@@ -43,6 +43,8 @@ model Product {
stockBalances StockBalance[] @relation("StockBalance_Product")
stockMovements StockMovement[] @relation("StockMovement_Product")
salesInvoiceItems SalesInvoiceItem[]
stockReservations StockReservation[]
orderItems OrderItem[]
@@index([brandId], map: "Products_brandId_fkey")
@@index([categoryId], map: "Products_categoryId_fkey")
+2 -2
View File
@@ -22,8 +22,8 @@ model PurchaseReceipt {
model PurchaseReceiptItem {
id Int @id @default(autoincrement())
count Decimal @db.Decimal(10, 0)
fee Decimal @db.Decimal(15, 2)
total Decimal @db.Decimal(15, 2)
unitPrice Decimal @db.Decimal(15, 2)
totalAmount Decimal @db.Decimal(15, 2)
receiptId Int
productId Int
description String? @db.Text
+48
View File
@@ -0,0 +1,48 @@
model SalesInvoice {
id Int @id @default(autoincrement())
code String @unique @db.VarChar(100)
totalAmount Decimal @db.Decimal(15, 2)
description String? @db.Text
createdAt DateTime @default(now()) @db.Timestamp(0)
updatedAt DateTime @updatedAt @db.Timestamp(0)
customerId Int?
posAccountId Int
customer Customer? @relation(fields: [customerId], references: [id])
posAccount PosAccount @relation(fields: [posAccountId], references: [id])
items SalesInvoiceItem[]
salesInvoicePayments SalesInvoicePayment[]
@@index([customerId])
@@index([posAccountId])
@@map("Sales_Invoices")
}
model SalesInvoiceItem {
id Int @id @default(autoincrement())
count Decimal @db.Decimal(10, 0)
unitPrice Decimal @default(0.00) @db.Decimal(15, 2)
totalAmount Decimal @default(0.00) @db.Decimal(15, 2)
createdAt DateTime @default(now()) @db.Timestamp(0)
invoiceId Int
productId Int
invoice SalesInvoice @relation(fields: [invoiceId], references: [id])
product Product @relation(fields: [productId], references: [id])
@@index([invoiceId])
@@index([productId])
@@map("Sales_Invoice_Items")
}
model SalesInvoicePayment {
id Int @id @default(autoincrement())
invoiceId Int
amount Decimal @db.Decimal(15, 2)
paymentMethod PaymentMethodType
paidAt DateTime
createdAt DateTime @default(now())
invoice SalesInvoice @relation(fields: [invoiceId], references: [id])
@@index([invoiceId])
@@map("Sales_Invoice_Payments")
}
+17 -1
View File
@@ -2,7 +2,7 @@ model StockMovement {
id Int @id @default(autoincrement())
type MovementType
quantity Decimal @db.Decimal(10, 0)
fee Decimal @db.Decimal(15, 2)
unitPrice Decimal @db.Decimal(15, 2)
totalCost Decimal @db.Decimal(15, 2)
referenceType MovementReferenceType
referenceId String
@@ -59,3 +59,19 @@ model StockAdjustment {
@@index([productId], map: "Stock_Adjustments_productId_fkey")
@@map("Stock_Adjustments")
}
model StockReservation {
id Int @id @default(autoincrement())
quantity Decimal @db.Decimal(10, 0)
expiresAt DateTime @db.Timestamp(0)
createdAt DateTime @default(now()) @db.Timestamp(0)
productId Int
inventoryId Int
orderId Int
inventory Inventory @relation(fields: [inventoryId], references: [id])
product Product @relation(fields: [productId], references: [id])
@@index([inventoryId])
@@index([productId])
@@map("Stock_Reservations")
}
+49 -61
View File
@@ -10,7 +10,6 @@ async function main() {
},
})
}
if ((await prisma.user.count()) === 0) {
const adminRole = await prisma.role.findUnique({ where: { name: 'Admin' } })
if (!adminRole) {
@@ -28,7 +27,6 @@ async function main() {
},
})
}
if ((await prisma.inventory.count()) === 0) {
await prisma.inventory.createMany({
data: [
@@ -48,19 +46,16 @@ async function main() {
],
})
}
if ((await prisma.productCategory.count()) === 0) {
await prisma.productCategory.createMany({
data: Array.from({ length: 10 }, (_, i) => ({ name: `دسته‌ی ${i + 1}` })),
})
}
if ((await prisma.productBrand.count()) === 0) {
await prisma.productBrand.createMany({
data: Array.from({ length: 10 }, (_, i) => ({ name: `برند ${i + 1}` })),
})
}
if ((await prisma.supplier.count()) === 0) {
await prisma.supplier.createMany({
data: Array.from({ length: 9 }, (_, i) => ({
@@ -71,7 +66,6 @@ async function main() {
})),
})
}
if ((await prisma.customer.count()) === 0) {
await prisma.customer.createMany({
data: Array.from({ length: 5 }, (_, i) => ({
@@ -82,12 +76,11 @@ async function main() {
})),
})
}
if ((await prisma.product.count()) === 0) {
const categories = await prisma.productCategory.findMany()
const brands = await prisma.productBrand.findMany()
await prisma.product.createMany({
data: Array.from({ length: 100 }, (_, i) => ({
data: Array.from({ length: 20 }, (_, i) => ({
name: `کالای ${i + 1}`,
sku: `SKU-${1000 + i + 1}`,
salePrice: parseInt((Math.random() * (100 - 10) + 10).toString()) * 10000,
@@ -96,7 +89,6 @@ async function main() {
})),
})
}
if ((await prisma.bank.count()) === 0) {
await prisma.bank.createMany({
data: [
@@ -231,7 +223,6 @@ async function main() {
],
})
}
if ((await prisma.bankBranch.count()) === 0) {
await prisma.bankBranch.createMany({
data: [
@@ -253,7 +244,6 @@ async function main() {
],
})
}
if ((await prisma.bankAccount.count()) === 0) {
await prisma.bankAccount.createMany({
data: [
@@ -278,56 +268,54 @@ async function main() {
],
})
}
if ((await prisma.inventoryBankAccount.count()) === 0) {
const inventories = await prisma.inventory.findMany()
const bankAccounts = await prisma.bankAccount.findMany()
if (inventories.length || bankAccounts.length) {
// Assign bank accounts to inventories
const inventoryBankAccounts = []
for (let i = 0; i < inventories.length; i++) {
const inventory = inventories[i]
const bankAccount = bankAccounts[i % bankAccounts.length] // Cycle through bank accounts
// @ts-ignore
inventoryBankAccounts.push({
inventoryId: inventory.id,
bankAccountId: bankAccount.id,
})
}
await prisma.inventoryBankAccount.createMany({
data: inventoryBankAccounts,
})
}
}
if ((await prisma.posAccount.count()) === 0) {
const inventories = await prisma.inventory.findMany({
where: { isPointOfSale: true },
})
const inventoryBankAccounts = await prisma.inventoryBankAccount.findMany()
const posAccounts = []
for (let i = 0; i < inventories.length; i++) {
const inventory = inventories[i]
// Find a bank account assigned to this inventory
const inventoryBankAccount = inventoryBankAccounts.find(
iba => iba.inventoryId === inventory.id,
)
if (inventoryBankAccount) {
// @ts-ignore
// if ((await prisma.inventoryBankAccount.count()) === 0) {
// const inventories = await prisma.inventory.findMany()
// const bankAccounts = await prisma.bankAccount.findMany()
// // Assign bank accounts to inventories
// const inventoryBankAccounts = []
// for (let i = 0; i < inventories.length; i++) {
// const inventory = inventories[i]
// const bankAccount = bankAccounts[i % bankAccounts.length] // Cycle through bank accounts
// inventoryBankAccounts.push({
// inventoryId: inventory.id,
// bankAccountId: bankAccount.id,
// })
// }
// await prisma.inventoryBankAccount.createMany({
// data: inventoryBankAccounts,
// })
// }
// if ((await prisma.posAccount.count()) === 0) {
// const inventories = await prisma.inventory.findMany({
// where: { isPointOfSale: true },
// })
// const inventoryBankAccounts = await prisma.inventoryBankAccount.findMany()
// const posAccounts = []
// for (let i = 0; i < inventories.length; i++) {
// const inventory = inventories[i]
// // Find a bank account assigned to this inventory
// const inventoryBankAccount = inventoryBankAccounts.find(
// iba => iba.inventoryId === inventory.id,
// )
// if (inventoryBankAccount) {
// posAccounts.push({
// name: `پوز ${inventory.name}`,
// code: `POS${(i + 1).toString().padStart(3, '0')}`,
// description: `پوز فروشگاه ${inventory.name}`,
// inventoryId: inventory.id,
// bankAccountId: inventoryBankAccount.bankAccountId,
// })
// }
// }
// await prisma.posAccount.createMany({
// data: posAccounts,
// })
// }
posAccounts.push({
name: `پوز ${inventory.name}`,
code: `POS${(i + 1).toString().padStart(3, '0')}`,
description: `پوز فروشگاه ${inventory.name}`,
inventoryId: inventory.id,
bankAccountId: inventoryBankAccount.bankAccountId,
})
}
}
await prisma.posAccount.createMany({
data: posAccounts,
})
}
// Seed purchase, transfer, and sales transactions
// const inventories = await prisma.inventory.findMany()
// const products = await prisma.product.findMany({ take: 5 }) // select 5 products for demo
@@ -343,7 +331,7 @@ async function main() {
// items: products.map(product => ({
// productId: product.id,
// count: 10,
// fee: Number(product.salePrice),
// unitPrice: Number(product.salePrice),
// total: 10 * Number(product.salePrice),
// })),
// })
@@ -1,332 +0,0 @@
-- AUTO-GENERATED MYSQL TRIGGER DUMP
-- Generated at: 2025-12-10T10:03:36.966Z
-- ------------------------------------------
-- Trigger: trg_transfer_item_after_insert
-- Event: INSERT
-- Table: Inventory_Transfer_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_transfer_item_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_transfer_item_after_insert` AFTER INSERT ON `Inventory_Transfer_Items` FOR EACH ROW begin
DECLARE fromInv INT;
DECLARE toInv INT;
SELECT fromInventoryId, toInventoryId INTO fromInv, toInv
FROM Inventory_Transfers WHERE id = NEW.transferId;
-- OUT from source
INSERT INTO Stock_Movements
(type, quantity, referenceType, referenceId, productId, inventoryId, createdAt)
VALUES
('OUT', NEW.count, 'InventoryTransfer', NEW.transferId, NEW.productId, fromInv, NOW());
-- IN to destination
INSERT INTO Stock_Movements
(type, quantity, referenceType, referenceId, productId, inventoryId, createdAt)
VALUES
('IN', NEW.count, 'InventoryTransfer', NEW.transferId, NEW.productId, toInv, NOW());
end;
-- ------------------------------------------
-- Trigger: trg_purchase_receipt_item_after_insert
-- Event: INSERT
-- Table: Purchase_Receipt_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_insert` AFTER INSERT ON `Purchase_Receipt_Items` FOR EACH ROW begin
INSERT INTO Stock_Movements
(
type,
quantity,
fee,
totalCost,
referenceType,
referenceId,
productId,
inventoryId,
avgCost,
createdAt
)
VALUES
(
'IN',
NEW.count,
NEW.fee,
NEW.total,
'PURCHASE',
NEW.receiptId,
NEW.productId,
(SELECT inventoryId FROM Purchase_Receipts WHERE id = NEW.receiptId),
NEW.total / NEW.count,
NOW()
);
end;
-- ------------------------------------------
-- Trigger: trg_purchase_receipt_item_after_update
-- Event: UPDATE
-- Table: Purchase_Receipt_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_update`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_update` AFTER UPDATE ON `Purchase_Receipt_Items` FOR EACH ROW begin
DELETE FROM Stock_Movements
WHERE referenceType = 'PURCHASE'
AND referenceId = NEW.receiptId
AND productId = NEW.productId;
INSERT INTO Stock_Movements
(
type,
quantity,
referenceType,
referenceId,
productId,
inventoryId,
createdAt
)
VALUES
(
'IN',
NEW.count,
'SALES',
NEW.id,
NEW.productId,
(SELECT inventoryId FROM Stores LIMIT 1),
NOW()
);
end;
-- ------------------------------------------
-- Trigger: trg_purchase_receipt_item_after_delete
-- Event: DELETE
-- Table: Purchase_Receipt_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_delete`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_delete` AFTER DELETE ON `Purchase_Receipt_Items` FOR EACH ROW begin
DELETE FROM Stock_Movements
WHERE referenceType = 'PURCHASE'
AND referenceId = OLD.receiptId
AND productId = OLD.productId;
end;
-- ------------------------------------------
-- Trigger: trg_sales_invoice_items_before_insert
-- Event: INSERT
-- Table: Sales_Invoice_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_before_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_before_insert` BEFORE INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin
DECLARE current_stock DECIMAL(10,2);
SELECT stock INTO current_stock
FROM stock_view
WHERE productId = NEW.productId
LIMIT 1;
IF current_stock IS NULL THEN
SET current_stock = 0;
END IF;
IF NEW.count > current_stock THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Not enough stock to complete sale.';
END IF;
end;
-- ------------------------------------------
-- Trigger: trg_sales_invoice_items_after_insert
-- Event: INSERT
-- Table: Sales_Invoice_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_after_insert` AFTER INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin
INSERT INTO Stock_Movements
(
type,
quantity,
referenceType,
referenceId,
productId,
inventoryId,
createdAt
)
VALUES
(
'IN',
NEW.count,
'PURCHASE',
NEW.id,
NEW.productId,
(SELECT inventoryId FROM Sales_Invoices WHERE id = NEW.id),
NOW()
);
end;
-- ------------------------------------------
-- Trigger: trg_stock_adjustment_after_insert
-- Event: INSERT
-- Table: Stock_Adjustments
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_adjustment_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_adjustment_after_insert` AFTER INSERT ON `Stock_Adjustments` FOR EACH ROW begin
INSERT INTO Stock_Movements
(type, quantity, referenceType, referenceId, productId, inventoryId, createdAt)
VALUES
('ADJUST', NEW.adjustedQuantity, 'ADJUSTMENT', NEW.id, NEW.productId, NEW.inventoryId, NOW());
end;
-- ------------------------------------------
-- Trigger: trg_stock_sale_insert
-- Event: INSERT
-- Table: Stock_Movements
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_sale_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN
IF NEW.referenceType = 'SALES' THEN
UPDATE stock_balance
SET
quantity = quantity - NEW.quantity,
totalCost = quantity * avgCost
WHERE productId = NEW.productId ;
END IF;
END;
-- ------------------------------------------
-- Trigger: trg_stock_purchase_insert
-- Event: INSERT
-- Table: Stock_Movements
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_purchase_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN
IF NEW.referenceType = 'PURCHASE' THEN
INSERT INTO stock_balance (productId, quantity, avgCost, totalCost)
VALUES (
NEW.productId,
NEW.quantity,
NEW.fee,
NEW.totalCost
)
ON DUPLICATE KEY UPDATE
quantity = quantity + NEW.quantity,
totalCost = totalCost + NEW.totalCost,
avgCost = totalCost / quantity;
END IF;
END;
-- ------------------------------------------
-- Trigger: trg_stock_movement_after_insert
-- Event: INSERT
-- Table: Stock_Movements
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_movement_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_movement_after_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW begin
UPDATE Products pv
SET pv.quantity = (
SELECT COALESCE(SUM(
CASE
WHEN type = 'IN' THEN quantity
WHEN type = 'OUT' THEN -quantity
WHEN type = 'ADJUST' THEN quantity
END
), 0)
FROM Stock_Movements
WHERE productId = NEW.productId
)
WHERE pv.id = NEW.productId;
end;
-- ------------------------------------------
-- Trigger: trg_stock_sale_update
-- Event: UPDATE
-- Table: Stock_Movements
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_sale_update`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_update` AFTER UPDATE ON `Stock_Movements` FOR EACH ROW BEGIN
IF OLD.referenceType = 'SALES' THEN
UPDATE stock_balance
SET
quantity = quantity + OLD.quantity,
totalCost = (quantity + OLD.quantity) * avgCost
WHERE productId = OLD.productId;
END IF;
IF NEW.referenceType = 'SALES' THEN
UPDATE stock_balance
SET
quantity = quantity - NEW.quantity,
totalCost = (quantity - NEW.quantity) * avgCost
WHERE productId = NEW.productId;
END IF;
END;
-- ------------------------------------------
-- Trigger: trg_stock_purchase_update
-- Event: UPDATE
-- Table: Stock_Movements
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_purchase_update`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_update` AFTER UPDATE ON `Stock_Movements` FOR EACH ROW BEGIN
IF OLD.referenceType = 'PURCHASE' THEN
UPDATE stock_balance
SET
quantity = quantity - OLD.quantity,
totalCost = totalCost - (OLD.quantity * OLD.fee)
WHERE productId = OLD.productId;
END IF;
IF NEW.referenceType = 'PURCHASE' THEN
INSERT INTO stock_balance (productId, quantity, avgCost, totalCost)
VALUES (
NEW.productId,
NEW.quantity,
NEW.fee,
NEW.totalCost
)
ON DUPLICATE KEY UPDATE
quantity = quantity + NEW.quantity,
totalCost = totalCost + NEW.totalCost,
avgCost = totalCost / quantity;
END IF;
END;
-- ------------------------------------------
-- Trigger: trg_stock_sale_delete
-- Event: DELETE
-- Table: Stock_Movements
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_sale_delete`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_delete` AFTER DELETE ON `Stock_Movements` FOR EACH ROW BEGIN
IF OLD.ReferenceType = 'SALES' THEN
UPDATE stock_balance
SET
quantity = quantity + OLD.quantity,
totalCost = (quantity + OLD.quantity) * avgCost
WHERE productId = OLD.productId;
END IF;
END;
-- ------------------------------------------
-- Trigger: trg_stock_purchase_delete
-- Event: DELETE
-- Table: Stock_Movements
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_purchase_delete`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_delete` AFTER DELETE ON `Stock_Movements` FOR EACH ROW BEGIN
IF OLD.referenceType = 'PURCHASE' THEN
UPDATE stock_balance
SET
quantity = quantity - OLD.quantity,
totalCost = totalCost - (OLD.quantity * OLD.fee),
avgCost = CASE
WHEN quantity - OLD.quantity = 0 THEN 0
ELSE (totalCost - (OLD.quantity * OLD.fee)) / (quantity - OLD.quantity)
END
WHERE productId = OLD.productId;
END IF;
END;
-5
View File
@@ -1,5 +0,0 @@
-- Auto-generated trigger dump
DELIMITER 8488
-- Trigger: 1
8488
DELIMITER ;
+299 -19
View File
@@ -1,7 +1,34 @@
-- AUTO-GENERATED MYSQL TRIGGER DUMP
-- Generated at: 2025-12-30T15:42:45.224Z
-- Generated at: 2026-01-04T09:46:30.365Z
-- ------------------------------------------
-- index: 1
-- Trigger: trg_bank_account_transaction_after_insert
-- Event: INSERT
-- Table: Bank_Account_Transactions
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_bank_account_transaction_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_bank_account_transaction_after_insert` AFTER INSERT ON `Bank_Account_Transactions` FOR EACH ROW BEGIN
IF NEW.type = 'DEPOSIT' THEN
UPDATE Bank_Account_Balance SET balance = balance + NEW.amount WHERE bankAccountId = NEW.bankAccountId;
ELSEIF NEW.type = 'WITHDRAWAL' THEN
UPDATE Bank_Account_Balance SET balance = balance - NEW.amount WHERE bankAccountId = NEW.bankAccountId;
END IF;
END;
-- ------------------------------------------
-- index: 2
-- Trigger: trg_bank_account_transaction_after_delete
-- Event: DELETE
-- Table: Bank_Account_Transactions
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_bank_account_transaction_after_delete`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_bank_account_transaction_after_delete` AFTER DELETE ON `Bank_Account_Transactions` FOR EACH ROW BEGIN
UPDATE Bank_Accounts SET balance = balance - OLD.amount;
END;
-- ------------------------------------------
-- index: 3
-- Trigger: trg_transfer_item_after_insert
-- Event: INSERT
-- Table: Inventory_Transfer_Items
@@ -27,18 +54,71 @@ DECLARE fromInv INT;
-- OUT from source
INSERT INTO Stock_Movements
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
VALUES
('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, toInv, NOW(), latestQuantityInOrigin-NEW.count);
-- IN to destination
INSERT INTO Stock_Movements
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
VALUES
('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, fromInv, NOW(), latestQuantityInOrigin-NEW.count);
end;
-- ------------------------------------------
-- index: 4
-- Trigger: trg_order_item_after_insert
-- Event: INSERT
-- Table: Order_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_order_item_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_item_after_insert` AFTER INSERT ON `Order_Items` FOR EACH ROW BEGIN
UPDATE Stock_Reservations SET quantity = quantity + NEW.quantity
WHERE orderId = NEW.orderId AND productId = NEW.productId;
END;
-- ------------------------------------------
-- index: 5
-- Trigger: trg_order_item_after_update
-- Event: UPDATE
-- Table: Order_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_order_item_after_update`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_item_after_update` AFTER UPDATE ON `Order_Items` FOR EACH ROW BEGIN
UPDATE Stock_Reservations
SET quantity = quantity - OLD.quantity + NEW.quantity
WHERE orderId = NEW.orderId AND productId = NEW.productId;
END;
-- ------------------------------------------
-- index: 6
-- Trigger: trg_order_item_after_delete
-- Event: DELETE
-- Table: Order_Items
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_order_item_after_delete`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_item_after_delete` AFTER DELETE ON `Order_Items` FOR EACH ROW BEGIN
UPDATE Stock_Reservations SET quantity = quantity - OLD.quantity
WHERE orderId = OLD.orderId AND productId = OLD.productId;
END;
-- ------------------------------------------
-- index: 7
-- Trigger: trg_order_after_cancel
-- Event: UPDATE
-- Table: Orders
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_order_after_cancel`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_order_after_cancel` AFTER UPDATE ON `Orders` FOR EACH ROW BEGIN
IF NEW.status = 'CANCELED' OR NEW.status = 'REJECTED' OR NEW.status = 'DONE' THEN
UPDATE Stock_Reservations sr SET quantity = 0
WHERE sr.orderId = NEW.id;
END IF;
END;
-- ------------------------------------------
-- index: 8
-- Trigger: trg_purchase_receipt_item_after_insert
-- Event: INSERT
-- Table: Purchase_Receipt_Items
@@ -67,7 +147,7 @@ DECLARE invId INT;
INSERT INTO Stock_Movements (
type,
quantity,
fee,
unitPrice,
totalCost,
referenceType,
referenceId,
@@ -81,15 +161,15 @@ DECLARE invId INT;
VALUES (
'IN',
NEW.count,
NEW.fee,
NEW.total,
NEW.unitPrice,
NEW.totalAmount,
'PURCHASE',
NEW.receiptId,
NEW.productId,
invId,
CASE
WHEN NEW.count = 0 THEN 0
ELSE NEW.total / NEW.count
ELSE NEW.totalAmount / NEW.count
END
,
@@ -101,16 +181,18 @@ DECLARE invId INT;
END;
-- ------------------------------------------
-- index: 9
-- Trigger: trg_pr_payment_before_insert
-- Event: INSERT
-- Table: Purchase_Receipt_Payments
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_pr_payment_before_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_before_insert` BEFORE INSERT ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN
DECLARE receiptTotal DECIMAL(14,2);
DECLARE paid DECIMAL(14,2);
INSERT INTO Trigger_Logs (name , message) VALUES ('trigger' , 'started');
SELECT totalAmount, paidAmount
INTO receiptTotal, paid
@@ -125,6 +207,121 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_before_insert` BEFORE INSERT ON
END;
-- ------------------------------------------
-- index: 10
-- Trigger: trg_purchase_payment_update_receipt
-- Event: INSERT
-- Table: Purchase_Receipt_Payments
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_purchase_payment_update_receipt`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_payment_update_receipt` AFTER INSERT ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN
DECLARE paid DECIMAL(15,2);
DECLARE total DECIMAL(15,2);
SELECT
COALESCE(SUM(
CASE WHEN type = 'PAYMENT' THEN amount ELSE -amount END
),0)
INTO paid
FROM Purchase_Receipt_Payments
WHERE receiptId = NEW.receiptId;
SELECT totalAmount INTO total
FROM Purchase_Receipts
WHERE id = NEW.receiptId;
UPDATE Purchase_Receipts
SET
paidAmount = paid,
status = CASE
WHEN paid = 0 THEN 'UNPAID'
WHEN paid < total THEN 'PARTIALLY_PAID'
ELSE 'PAID'
END
WHERE id = NEW.receiptId;
END;
-- ------------------------------------------
-- index: 11
-- Trigger: trg_purchase_payment_after_insert
-- Event: INSERT
-- Table: Purchase_Receipt_Payments
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_purchase_payment_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_payment_after_insert` AFTER INSERT ON `Purchase_Receipt_Payments` FOR EACH ROW BEGIN
DECLARE currentBalance DECIMAL(15, 2);
SELECT balance INTO currentBalance
FROM Bank_Account_Balance
WHERE
bankAccountId = NEW.bankAccountId FOR
UPDATE;
IF currentBalance IS NULL THEN SET currentBalance = 0;
INSERT INTO
Bank_Account_Balance (bankAccountId, balance, updatedAt)
VALUES (NEW.bankAccountId, 0, NOW());
END IF;
IF NEW.type = 'PAYMENT' THEN
SET
currentBalance = currentBalance - NEW.amount;
INSERT INTO
Bank_Account_Transactions (
bankAccountId,
type,
amount,
balanceAfter,
referenceType,
referenceId
)
VALUES (
NEW.bankAccountId,
'WITHDRAWAL',
NEW.amount,
currentBalance,
'PURCHASE_PAYMENT',
NEW.id
);
ELSE SET currentBalance = currentBalance + NEW.amount;
INSERT INTO
Bank_Account_Transactions (
bankAccountId,
type,
amount,
balanceAfter,
referenceType,
referenceId
)
VALUES (
NEW.bankAccountId,
'DEPOSIT',
NEW.amount,
currentBalance,
'PURCHASE_REFUND',
NEW.id
);
END IF;
UPDATE Bank_Account_Balance
SET
balance = currentBalance
WHERE
bankAccountId = NEW.bankAccountId;
END;
-- ------------------------------------------
-- index: 12
-- Trigger: trg_pr_payment_after_insert
-- Event: INSERT
-- Table: Purchase_Receipt_Payments
@@ -134,7 +331,8 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_after_insert` AFTER INSERT ON `
DECLARE receiptTotal DECIMAL(14,2) Default 0;
DECLARE newPaid DECIMAL(14,2) Default 0;
DECLARE _supplierId INT;
DECLARE lastBalance DECIMAL(14,2)Default 0;
DECLARE lastBalance DECIMAL(14,2) Default 0;
-- Lock receipt row
SELECT COALESCE(totalAmount, 0), COALESCE(paidAmount, 0), supplierId
@@ -143,8 +341,6 @@ SELECT COALESCE(totalAmount, 0), COALESCE(paidAmount, 0), supplierId
WHERE id = NEW.receiptId
FOR UPDATE;
INSERT INTO Trigger_Logs (name, message) VALUES ('supplierId', _supplierId);
-- Apply payment or refund
IF NEW.type = 'PAYMENT' THEN
SET newPaid = newPaid + NEW.amount;
@@ -172,6 +368,8 @@ SELECT COALESCE(totalAmount, 0), COALESCE(paidAmount, 0), supplierId
ORDER BY id DESC
LIMIT 1;
-- Insert supplier ledger
INSERT INTO Supplier_Ledger
(
@@ -198,6 +396,7 @@ SELECT COALESCE(totalAmount, 0), COALESCE(paidAmount, 0), supplierId
END;
-- ------------------------------------------
-- index: 13
-- Trigger: trg_pr_payment_after_delete
-- Event: DELETE
-- Table: Purchase_Receipt_Payments
@@ -232,6 +431,7 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_pr_payment_after_delete` AFTER DELETE ON `
END;
-- ------------------------------------------
-- index: 14
-- Trigger: trg_purchase_receipt_after_insert
-- Event: INSERT
-- Table: Purchase_Receipts
@@ -270,6 +470,7 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_after_insert` AFTER INSER
END;
-- ------------------------------------------
-- index: 15
-- Trigger: trg_sales_invoice_items_before_insert
-- Event: INSERT
-- Table: Sales_Invoice_Items
@@ -302,6 +503,7 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_before_insert` BEFORE
end;
-- ------------------------------------------
-- index: 16
-- Trigger: trg_sales_invoice_items_after_insert
-- Event: INSERT
-- Table: Sales_Invoice_Items
@@ -340,7 +542,7 @@ DECLARE pos_id INT;
INSERT INTO Stock_Movements (
type,
quantity,
fee,
unitPrice,
totalCost,
referenceType,
referenceId,
@@ -354,8 +556,8 @@ DECLARE pos_id INT;
VALUES (
'OUT',
NEW.count,
NEW.fee,
NEW.total,
NEW.unitPrice,
NEW.totalAmount,
'SALES',
NEW.invoiceId,
NEW.productId,
@@ -363,7 +565,7 @@ DECLARE pos_id INT;
CASE
WHEN NEW.count = 0 THEN 0
ELSE NEW.total / NEW.count
ELSE NEW.totalAmount / NEW.count
END,
current_stock - NEW.count,
customer_id,
@@ -374,6 +576,82 @@ DECLARE pos_id INT;
END;
-- ------------------------------------------
-- index: 17
-- Trigger: trg_sales_invoice_payment_after_insert
-- Event: INSERT
-- Table: Sales_Invoice_Payments
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_sales_invoice_payment_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_payment_after_insert` AFTER INSERT ON `Sales_Invoice_Payments` FOR EACH ROW BEGIN
DECLARE currentBalance DECIMAL(15,2);
DECLARE bankAccountId INT;
SELECT pa.bankAccountId INTO bankAccountId
FROM Pos_Accounts pa
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
WHERE si.id = NEW.invoiceId;
SELECT balance INTO currentBalance
FROM Bank_Account_Balance
WHERE bankAccountId = bankAccountId
FOR UPDATE;
IF currentBalance IS NULL THEN
SET currentBalance = 0;
INSERT INTO Bank_Account_Balance (bankAccountId, balance)
VALUES (bankAccountId, 0);
END IF;
SET currentBalance = currentBalance + NEW.amount;
INSERT INTO Bank_Account_Transactions
(bankAccountId, type, amount, balanceAfter, referenceType, referenceId)
VALUES
(bankAccountId, 'DEPOSIT', NEW.amount, currentBalance, 'POS_SALE', NEW.id);
UPDATE Bank_Account_Balance
SET balance = currentBalance
WHERE bankAccountId = bankAccountId;
END;
-- ------------------------------------------
-- index: 18
-- Trigger: trg_pos_account_payment_after_insert
-- Event: INSERT
-- Table: Sales_Invoice_Payments
-- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_pos_account_payment_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_pos_account_payment_after_insert` AFTER INSERT ON `Sales_Invoice_Payments` FOR EACH ROW BEGIN
DECLARE _bankAccountId INT;
IF(NEW.paymentMethod != 'CASH') THEN
SELECT cashBankAccountId INTO _bankAccountId
FROM Pos_Accounts pa
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
WHERE si.id = NEW.invoiceId;
End IF;
INSERT INTO Bank_Account_Transactions (
bankAccountId,
type,
amount,
balanceAfter,
referenceType,
referenceId
)
VALUES(
_bankAccountId,
'DEPOSIT',
NEW.amount,
0,
'POS_SALE',
NEW.id
);
END;
-- ------------------------------------------
-- index: 19
-- Trigger: trg_stock_transfer
-- Event: INSERT
-- Table: Stock_Movements
@@ -442,8 +720,8 @@ VALUES (
NEW.productId,
NEW.inventoryId,
- NEW.quantity,
- COALESCE(NEW.fee, 0) * NEW.quantity,
COALESCE(NEW.fee, 0),
- COALESCE(NEW.unitPrice, 0) * NEW.quantity,
COALESCE(NEW.unitPrice, 0),
NOW()
);
@@ -456,6 +734,7 @@ END IF;
END;
-- ------------------------------------------
-- index: 20
-- Trigger: trg_stock_purchase_insert
-- Event: INSERT
-- Table: Stock_Movements
@@ -475,7 +754,7 @@ INSERT INTO
VALUES (
NEW.productId,
NEW.quantity,
NEW.fee,
NEW.unitPrice,
NEW.totalCost,
NEW.inventoryId,
NOW()
@@ -490,6 +769,7 @@ END IF;
END;
-- ------------------------------------------
-- index: 21
-- Trigger: trg_stock_sale_insert
-- Event: INSERT
-- Table: Stock_Movements
@@ -509,7 +789,7 @@ INSERT INTO
VALUES (
NEW.productId,
NEW.quantity,
NEW.fee,
NEW.unitPrice,
NEW.totalCost,
NEW.inventoryId,
NOW()
File diff suppressed because it is too large Load Diff
+633
View File
@@ -0,0 +1,633 @@
-- Stored Procedures equivalent to triggers
DELIMITER //
-- Procedure for trg_bank_account_transaction_after_insert
CREATE PROCEDURE update_bank_balance(IN p_bankAccountId INT, IN p_type VARCHAR(20), IN p_amount DECIMAL(15,2))
BEGIN
IF p_type = 'DEPOSIT' THEN
UPDATE Bank_Account_Balance SET balance = balance + p_amount WHERE bankAccountId = p_bankAccountId;
ELSEIF p_type = 'WITHDRAWAL' THEN
UPDATE Bank_Account_Balance SET balance = balance - p_amount WHERE bankAccountId = p_bankAccountId;
END IF;
END //
-- Procedure for trg_bank_account_transaction_after_delete
CREATE PROCEDURE update_bank_balance_on_delete(IN p_bankAccountId INT, IN p_amount DECIMAL(15,2))
BEGIN
UPDATE Bank_Accounts SET balance = balance - p_amount WHERE id = p_bankAccountId;
END //
-- Procedure for trg_transfer_item_after_insert
CREATE PROCEDURE process_transfer_item(IN p_transferId INT, IN p_productId INT, IN p_count DECIMAL(10,2))
BEGIN
DECLARE fromInv INT;
DECLARE toInv INT;
DECLARE _avgCost DECIMAL(10,2);
DECLARE latestQuantityInOrigin DECIMAL(10,2);
DECLARE latestQuantityInDestination DECIMAL(10,2);
SELECT fromInventoryId, toInventoryId INTO fromInv, toInv
FROM Inventory_Transfers WHERE id = p_transferId;
SELECT COALESCE(avgCost, 0), COALESCE(quantity, 0) INTO _avgCost, latestQuantityInOrigin FROM Stock_Balance
WHERE ProductId = p_productId AND inventoryId = fromInv LIMIT 1;
SELECT COALESCE(quantity, 0) INTO latestQuantityInDestination FROM Stock_Balance
WHERE ProductId = p_productId AND inventoryId = toInv LIMIT 1;
-- OUT from source
INSERT INTO Stock_Movements
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
VALUES
('OUT', p_count, _avgCost, _avgCost*p_count, _avgCost, 'INVENTORY_TRANSFER', p_transferId, p_productId, fromInv, toInv, NOW(), latestQuantityInOrigin-p_count);
-- IN to destination
INSERT INTO Stock_Movements
(type, quantity, unitPrice, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, counterInventoryId, createdAt, remainedInStock)
VALUES
('IN', p_count, _avgCost, _avgCost*p_count, _avgCost, 'INVENTORY_TRANSFER', p_transferId, p_productId, toInv, fromInv, NOW(), latestQuantityInOrigin-p_count);
END //
-- Procedure for trg_order_item_after_insert
CREATE PROCEDURE update_stock_reservation_insert(IN p_orderId INT, IN p_productId INT, IN p_quantity DECIMAL(10,2))
BEGIN
UPDATE Stock_Reservations SET quantity = quantity + p_quantity
WHERE orderId = p_orderId AND productId = p_productId;
END //
-- Procedure for trg_order_item_after_update
CREATE PROCEDURE update_stock_reservation_update(IN p_orderId INT, IN p_productId INT, IN p_old_quantity DECIMAL(10,2), IN p_new_quantity DECIMAL(10,2))
BEGIN
UPDATE Stock_Reservations
SET quantity = quantity - p_old_quantity + p_new_quantity
WHERE orderId = p_orderId AND productId = p_productId;
END //
-- Procedure for trg_order_item_after_delete
CREATE PROCEDURE update_stock_reservation_delete(IN p_orderId INT, IN p_productId INT, IN p_quantity DECIMAL(10,2))
BEGIN
UPDATE Stock_Reservations SET quantity = quantity - p_quantity
WHERE orderId = p_orderId AND productId = p_productId;
END //
-- Procedure for trg_order_after_cancel
CREATE PROCEDURE cancel_order_stock(IN p_orderId INT, IN p_status VARCHAR(20))
BEGIN
IF p_status = 'CANCELED' OR p_status = 'REJECTED' OR p_status = 'DONE' THEN
UPDATE Stock_Reservations sr SET quantity = 0
WHERE sr.orderId = p_orderId;
END IF;
END //
-- Procedure for trg_purchase_receipt_item_after_insert
CREATE PROCEDURE process_purchase_item(IN p_receiptId INT, IN p_productId INT, IN p_count DECIMAL(10,2), IN p_unitPrice DECIMAL(15,2), IN p_totalAmount DECIMAL(15,2))
BEGIN
DECLARE latestQuantity DECIMAL(10, 2) DEFAULT 0;
DECLARE invId INT;
DECLARE suppId INT;
-- Get inventory & supplier from
SELECT inventoryId, supplierId
INTO invId, suppId
FROM Purchase_Receipts
WHERE id = p_receiptId;
-- Get current stock quantity (if exists)
SELECT COALESCE(quantity, 0)
INTO latestQuantity
FROM Stock_Balance sb
WHERE sb.inventoryId = invId
AND sb.productId = p_productId
LIMIT 1;
-- Insert stock movement
INSERT INTO Stock_Movements (
type,
quantity,
unitPrice,
totalCost,
referenceType,
referenceId,
productId,
inventoryId,
avgCost,
supplierId,
remainedInStock,
createdAt
)
VALUES (
'IN',
p_count,
p_unitPrice,
p_totalAmount,
'PURCHASE',
p_receiptId,
p_productId,
invId,
CASE
WHEN p_count = 0 THEN 0
ELSE p_totalAmount / p_count
END,
suppId,
latestQuantity + p_count,
NOW()
);
END //
-- Procedure for trg_pr_payment_before_insert
CREATE PROCEDURE validate_payment_before_insert(IN p_receiptId INT, IN p_type VARCHAR(20), IN p_amount DECIMAL(15,2))
BEGIN
DECLARE receiptTotal DECIMAL(14,2);
DECLARE paid DECIMAL(14,2);
SELECT totalAmount, paidAmount
INTO receiptTotal, paid
FROM Purchase_Receipts
WHERE id = p_receiptId
FOR UPDATE;
IF p_type = 'PAYMENT' AND paid + p_amount > receiptTotal THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'مجموع مبلغ پرداختی بیشتر از مبلغ فاکتور است.';
END IF;
END //
-- Procedure for trg_purchase_payment_update_receipt
CREATE PROCEDURE update_receipt_payment(IN p_receiptId INT)
BEGIN
DECLARE paid DECIMAL(15,2);
DECLARE total DECIMAL(15,2);
SELECT
COALESCE(SUM(
CASE WHEN type = 'PAYMENT' THEN amount ELSE -amount END
),0)
INTO paid
FROM Purchase_Receipt_Payments
WHERE receiptId = p_receiptId;
SELECT totalAmount INTO total
FROM Purchase_Receipts
WHERE id = p_receiptId;
UPDATE Purchase_Receipts
SET
paidAmount = paid,
status = CASE
WHEN paid = 0 THEN 'UNPAID'
WHEN paid < total THEN 'PARTIALLY_PAID'
ELSE 'PAID'
END
WHERE id = p_receiptId;
END //
-- Procedure for trg_purchase_payment_after_insert
CREATE PROCEDURE process_purchase_payment(IN p_bankAccountId INT, IN p_type VARCHAR(20), IN p_amount DECIMAL(15,2), IN p_id INT)
BEGIN
DECLARE currentBalance DECIMAL(15, 2);
SELECT balance INTO currentBalance
FROM Bank_Account_Balance
WHERE bankAccountId = p_bankAccountId FOR UPDATE;
IF currentBalance IS NULL THEN SET currentBalance = 0;
INSERT INTO Bank_Account_Balance (bankAccountId, balance, updatedAt)
VALUES (p_bankAccountId, 0, NOW());
END IF;
IF p_type = 'PAYMENT' THEN
SET currentBalance = currentBalance - p_amount;
INSERT INTO Bank_Account_Transactions (
bankAccountId,
type,
amount,
balanceAfter,
referenceType,
referenceId
)
VALUES (
p_bankAccountId,
'WITHDRAWAL',
p_amount,
currentBalance,
'PURCHASE_PAYMENT',
p_id
);
ELSE
SET currentBalance = currentBalance + p_amount;
INSERT INTO Bank_Account_Transactions (
bankAccountId,
type,
amount,
balanceAfter,
referenceType,
referenceId
)
VALUES (
p_bankAccountId,
'DEPOSIT',
p_amount,
currentBalance,
'PURCHASE_REFUND',
p_id
);
END IF;
UPDATE Bank_Account_Balance
SET balance = currentBalance
WHERE bankAccountId = p_bankAccountId;
END //
-- Procedure for trg_pr_payment_after_insert
CREATE PROCEDURE update_supplier_ledger(IN p_receiptId INT, IN p_type VARCHAR(20), IN p_amount DECIMAL(15,2), IN p_id INT)
BEGIN
DECLARE receiptTotal DECIMAL(14,2) DEFAULT 0;
DECLARE newPaid DECIMAL(14,2) DEFAULT 0;
DECLARE _supplierId INT;
DECLARE lastBalance DECIMAL(14,2) DEFAULT 0;
-- Lock receipt row
SELECT COALESCE(totalAmount, 0), COALESCE(paidAmount, 0), supplierId
INTO receiptTotal, newPaid, _supplierId
FROM Purchase_Receipts
WHERE id = p_receiptId
FOR UPDATE;
-- Apply payment or refund
IF p_type = 'PAYMENT' THEN
SET newPaid = newPaid + p_amount;
ELSE
SET newPaid = newPaid - p_amount;
END IF;
-- Update receipt
UPDATE Purchase_Receipts
SET
paidAmount = newPaid,
status =
CASE
WHEN newPaid = 0 THEN 'UNPAID'
WHEN newPaid < receiptTotal THEN 'PARTIALLY_PAID'
ELSE 'PAID'
END
WHERE id = p_receiptId;
-- Get last supplier balance
SELECT IFNULL(balance, 0)
INTO lastBalance
FROM Supplier_Ledger
WHERE supplierId = _supplierId
ORDER BY id DESC
LIMIT 1;
-- Insert supplier ledger
INSERT INTO Supplier_Ledger
(
supplierId,
debit,
credit,
balance,
sourceType,
sourceId,
createdAt
)
VALUES
(
_supplierId,
IF(p_type = 'REFUND', p_amount, 0),
IF(p_type = 'PAYMENT', p_amount, 0),
lastBalance
+ IF(p_type = 'PAYMENT', p_amount, 0)
- IF(p_type = 'REFUND', p_amount, 0),
'PAYMENT',
p_id,
NOW()
);
END //
-- Procedure for trg_pr_payment_after_delete
CREATE PROCEDURE update_receipt_on_payment_delete(IN p_receiptId INT, IN p_type VARCHAR(20), IN p_amount DECIMAL(15,2))
BEGIN
DECLARE receiptTotal DECIMAL(14,2);
DECLARE newPaid DECIMAL(14,2);
SELECT totalAmount, paidAmount
INTO receiptTotal, newPaid
FROM Purchase_Receipts
WHERE id = p_receiptId
FOR UPDATE;
IF p_type = 'PAYMENT' THEN
SET newPaid = newPaid - p_amount;
ELSE
SET newPaid = newPaid + p_amount;
END IF;
UPDATE Purchase_Receipts
SET
paidAmount = newPaid,
status =
CASE
WHEN newPaid = 0 THEN 'UNPAID'
WHEN newPaid < receiptTotal THEN 'PARTIALLY_PAID'
ELSE 'PAID'
END
WHERE id = p_receiptId;
END //
-- Procedure for trg_purchase_receipt_after_insert
CREATE PROCEDURE insert_supplier_ledger_purchase(IN p_supplierId INT, IN p_totalAmount DECIMAL(15,2), IN p_id INT)
BEGIN
DECLARE lastBalance DECIMAL(14,2) DEFAULT 0;
SELECT COALESCE(balance, 0)
INTO lastBalance
FROM Supplier_Ledger
WHERE supplierId = p_supplierId
ORDER BY id DESC
LIMIT 1;
INSERT INTO Supplier_Ledger
(
supplierId,
debit,
credit,
balance,
sourceType,
sourceId,
createdAt
)
VALUES
(
p_supplierId,
p_totalAmount,
0,
lastBalance - p_totalAmount,
'PURCHASE',
p_id,
NOW()
);
END //
-- Procedure for trg_sales_invoice_items_before_insert
CREATE PROCEDURE validate_stock_before_sale(IN p_invoiceId INT, IN p_productId INT, IN p_count DECIMAL(10,2))
BEGIN
DECLARE current_stock DECIMAL(10, 2);
DECLARE inventory_id INT;
SELECT pa.inventoryId INTO inventory_id
FROM Pos_Accounts pa
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
WHERE si.id = p_invoiceId;
SELECT COALESCE(quantity, 0) INTO current_stock
FROM Stock_Balance sb
WHERE productId = p_productId AND sb.inventoryId = inventory_id
LIMIT 1;
IF p_count > current_stock THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'موجودی کالا در انبار کافی نیست.';
END IF;
END //
-- Procedure for trg_sales_invoice_items_after_insert
CREATE PROCEDURE process_sale_item(IN p_invoiceId INT, IN p_productId INT, IN p_count DECIMAL(10,2), IN p_unitPrice DECIMAL(15,2), IN p_totalAmount DECIMAL(15,2))
BEGIN
DECLARE current_stock DECIMAL(10, 2);
DECLARE inventory_id INT;
DECLARE customer_id INT;
DECLARE pos_id INT;
SELECT posAccountId, customerId INTO pos_id, customer_id
FROM Sales_Invoices si
WHERE si.id = p_invoiceId
LIMIT 1;
SELECT pa.inventoryId INTO inventory_id
FROM Pos_Accounts pa
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
WHERE si.id = p_invoiceId;
SELECT COALESCE(quantity, 0) INTO current_stock
FROM Stock_Balance sb
WHERE productId = p_productId AND sb.inventoryId = inventory_id
LIMIT 1;
INSERT INTO Stock_Movements (
type,
quantity,
unitPrice,
totalCost,
referenceType,
referenceId,
productId,
inventoryId,
avgCost,
remainedInStock,
customerId,
createdAt
)
VALUES (
'OUT',
p_count,
p_unitPrice,
p_totalAmount,
'SALES',
p_invoiceId,
p_productId,
inventory_id,
CASE
WHEN p_count = 0 THEN 0
ELSE p_totalAmount / p_count
END,
current_stock - p_count,
customer_id,
NOW()
);
END //
-- Procedure for trg_sales_invoice_payment_after_insert
CREATE PROCEDURE process_sale_payment(IN p_invoiceId INT, IN p_amount DECIMAL(15,2), IN p_id INT)
BEGIN
DECLARE currentBalance DECIMAL(15,2);
DECLARE bankAccountId INT;
SELECT pa.bankAccountId INTO bankAccountId
FROM Pos_Accounts pa
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
WHERE si.id = p_invoiceId;
SELECT balance INTO currentBalance
FROM Bank_Account_Balance
WHERE bankAccountId = bankAccountId
FOR UPDATE;
IF currentBalance IS NULL THEN
SET currentBalance = 0;
INSERT INTO Bank_Account_Balance (bankAccountId, balance, updatedAt)
VALUES (bankAccountId, 0, NOW());
END IF;
SET currentBalance = currentBalance + p_amount;
INSERT INTO Bank_Account_Transactions
(bankAccountId, type, amount, balanceAfter, referenceType, referenceId)
VALUES
(bankAccountId, 'DEPOSIT', p_amount, currentBalance, 'POS_SALE', p_id);
UPDATE Bank_Account_Balance
SET balance = currentBalance
WHERE bankAccountId = bankAccountId;
END //
-- Procedure for trg_pos_account_payment_after_insert
CREATE PROCEDURE process_pos_payment(IN p_invoiceId INT, IN p_paymentMethod VARCHAR(20), IN p_amount DECIMAL(15,2), IN p_id INT)
BEGIN
DECLARE _bankAccountId INT;
IF(p_paymentMethod != 'CASH') THEN
SELECT cashBankAccountId INTO _bankAccountId
FROM Pos_Accounts pa
INNER JOIN Sales_Invoices si ON pa.id = si.posAccountId
WHERE si.id = p_invoiceId;
END IF;
INSERT INTO Bank_Account_Transactions (
bankAccountId,
type,
amount,
balanceAfter,
referenceType,
referenceId
)
VALUES(
_bankAccountId,
'DEPOSIT',
p_amount,
0,
'POS_SALE',
p_id
);
END //
-- Procedure for trg_stock_transfer
CREATE PROCEDURE update_stock_balance_transfer(IN p_productId INT, IN p_inventoryId INT, IN p_quantity DECIMAL(10,2), IN p_unitPrice DECIMAL(15,2), IN p_totalCost DECIMAL(15,2), IN p_type VARCHAR(10))
BEGIN
IF p_type = 'IN' THEN
INSERT INTO Stock_Balance (
productId,
inventoryId,
quantity,
totalCost,
avgCost,
updatedAt
)
VALUES (
p_productId,
p_inventoryId,
p_quantity,
p_totalCost,
CASE
WHEN p_quantity = 0 THEN 0
ELSE p_totalCost / p_quantity
END,
NOW()
)
ON DUPLICATE KEY UPDATE
quantity = quantity + p_quantity,
totalCost = totalCost + p_totalCost,
avgCost = CASE
WHEN (quantity + p_quantity) = 0 THEN 0
ELSE (totalCost + p_totalCost) / (quantity + p_quantity)
END,
updatedAt = NOW();
END IF;
IF p_type = 'OUT' THEN
IF EXISTS (
SELECT 1
FROM Stock_Balance sb
WHERE sb.productId = p_productId AND sb.inventoryId = p_inventoryId
) THEN
UPDATE Stock_Balance sb
SET
sb.quantity = sb.quantity - p_quantity,
sb.totalCost = sb.totalCost - (sb.avgCost * p_quantity),
sb.updatedAt = NOW()
WHERE
sb.productId = p_productId
AND sb.inventoryId = p_inventoryId;
ELSE
INSERT INTO Stock_Balance (
productId,
inventoryId,
quantity,
totalCost,
avgCost,
updatedAt
)
VALUES (
p_productId,
p_inventoryId,
- p_quantity,
- COALESCE(p_unitPrice, 0) * p_quantity,
COALESCE(p_unitPrice, 0),
NOW()
);
END IF;
END IF;
END //
-- Procedure for trg_stock_purchase_insert
CREATE PROCEDURE update_stock_balance_purchase(IN p_productId INT, IN p_quantity DECIMAL(10,2), IN p_unitPrice DECIMAL(15,2), IN p_totalCost DECIMAL(15,2), IN p_inventoryId INT)
BEGIN
INSERT INTO Stock_Balance (
productId,
quantity,
avgCost,
totalCost,
inventoryId,
updatedAt
)
VALUES (
p_productId,
p_quantity,
p_unitPrice,
p_totalCost,
p_inventoryId,
NOW()
)
ON DUPLICATE KEY UPDATE
quantity = quantity + p_quantity,
totalCost = totalCost + p_totalCost,
avgCost = totalCost / quantity;
END //
-- Procedure for trg_stock_sale_insert
CREATE PROCEDURE update_stock_balance_sale(IN p_productId INT, IN p_quantity DECIMAL(10,2), IN p_unitPrice DECIMAL(15,2), IN p_totalCost DECIMAL(15,2), IN p_inventoryId INT)
BEGIN
INSERT INTO Stock_Balance (
productId,
quantity,
avgCost,
totalCost,
inventoryId,
updatedAt
)
VALUES (
p_productId,
p_quantity,
p_unitPrice,
p_totalCost,
p_inventoryId,
NOW()
)
ON DUPLICATE KEY UPDATE
quantity = quantity - p_quantity,
totalCost = totalCost - p_totalCost,
avgCost = totalCost / quantity;
END //
DELIMITER ;
+2 -1
View File
@@ -33,7 +33,7 @@ async function main() {
let sqlOutput = '-- AUTO-GENERATED MYSQL TRIGGER DUMP\n'
sqlOutput += '-- Generated at: ' + new Date().toISOString() + '\n\n'
for (const trg of triggers) {
for (const [index, trg] of triggers.entries()) {
const name = trg.Trigger
console.log(`📥 Extracting trigger: ${name}`)
@@ -42,6 +42,7 @@ async function main() {
const createStatement = rows[0]['SQL Original Statement']
sqlOutput += `-- ------------------------------------------\n`
sqlOutput += `-- index: ${index + 1}\n`
sqlOutput += `-- Trigger: ${name}\n`
sqlOutput += `-- Event: ${trg.Event}\n`
sqlOutput += `-- Table: ${trg.Table}\n`
+2
View File
@@ -12,6 +12,7 @@ import { CardexModule } from './modules/cardex/cardex.module'
import { InventoriesModule } from './modules/inventories/inventories.module'
import { PosModule } from './modules/pos/pos.module'
import { PurchaseReceiptPaymentsModule } from './modules/purchase-receipt-payments/purchase-receipt-payments.module'
import { StatisticsModule } from './modules/statistics/statistics.module'
import { SuppliersModule } from './modules/suppliers/suppliers.module'
import { PrismaModule } from './prisma/prisma.module'
import { ProductBrandsModule } from './product-brands/product-brands.module'
@@ -56,6 +57,7 @@ import { UsersModule } from './users/users.module'
BanksModule,
BankBranchesModule,
BankAccountsModule,
StatisticsModule,
],
controllers: [AppController],
providers: [AppService],
+34 -9
View File
@@ -47,6 +47,16 @@ export type BankBranch = Prisma.BankBranchModel
*
*/
export type BankAccount = Prisma.BankAccountModel
/**
* Model BankAccountTransaction
*
*/
export type BankAccountTransaction = Prisma.BankAccountTransactionModel
/**
* Model BankAccountBalance
*
*/
export type BankAccountBalance = Prisma.BankAccountBalanceModel
/**
* Model Inventory
*
@@ -77,26 +87,21 @@ export type InventoryTransferItem = Prisma.InventoryTransferItemModel
*
*/
export type Bank = Prisma.BankModel
/**
* Model Customer
*
*/
export type Customer = Prisma.CustomerModel
/**
* Model Order
*
*/
export type Order = Prisma.OrderModel
/**
* Model SalesInvoice
* Model OrderItem
*
*/
export type SalesInvoice = Prisma.SalesInvoiceModel
export type OrderItem = Prisma.OrderItemModel
/**
* Model SalesInvoiceItem
* Model Customer
*
*/
export type SalesInvoiceItem = Prisma.SalesInvoiceItemModel
export type Customer = Prisma.CustomerModel
/**
* Model TriggerLog
*
@@ -137,6 +142,21 @@ export type PurchaseReceiptItem = Prisma.PurchaseReceiptItemModel
*
*/
export type PurchaseReceiptPayments = Prisma.PurchaseReceiptPaymentsModel
/**
* Model SalesInvoice
*
*/
export type SalesInvoice = Prisma.SalesInvoiceModel
/**
* Model SalesInvoiceItem
*
*/
export type SalesInvoiceItem = Prisma.SalesInvoiceItemModel
/**
* Model SalesInvoicePayment
*
*/
export type SalesInvoicePayment = Prisma.SalesInvoicePaymentModel
/**
* Model StockMovement
*
@@ -152,6 +172,11 @@ export type StockBalance = Prisma.StockBalanceModel
*
*/
export type StockAdjustment = Prisma.StockAdjustmentModel
/**
* Model StockReservation
*
*/
export type StockReservation = Prisma.StockReservationModel
/**
* Model Supplier
*
+34 -9
View File
@@ -67,6 +67,16 @@ export type BankBranch = Prisma.BankBranchModel
*
*/
export type BankAccount = Prisma.BankAccountModel
/**
* Model BankAccountTransaction
*
*/
export type BankAccountTransaction = Prisma.BankAccountTransactionModel
/**
* Model BankAccountBalance
*
*/
export type BankAccountBalance = Prisma.BankAccountBalanceModel
/**
* Model Inventory
*
@@ -97,26 +107,21 @@ export type InventoryTransferItem = Prisma.InventoryTransferItemModel
*
*/
export type Bank = Prisma.BankModel
/**
* Model Customer
*
*/
export type Customer = Prisma.CustomerModel
/**
* Model Order
*
*/
export type Order = Prisma.OrderModel
/**
* Model SalesInvoice
* Model OrderItem
*
*/
export type SalesInvoice = Prisma.SalesInvoiceModel
export type OrderItem = Prisma.OrderItemModel
/**
* Model SalesInvoiceItem
* Model Customer
*
*/
export type SalesInvoiceItem = Prisma.SalesInvoiceItemModel
export type Customer = Prisma.CustomerModel
/**
* Model TriggerLog
*
@@ -157,6 +162,21 @@ export type PurchaseReceiptItem = Prisma.PurchaseReceiptItemModel
*
*/
export type PurchaseReceiptPayments = Prisma.PurchaseReceiptPaymentsModel
/**
* Model SalesInvoice
*
*/
export type SalesInvoice = Prisma.SalesInvoiceModel
/**
* Model SalesInvoiceItem
*
*/
export type SalesInvoiceItem = Prisma.SalesInvoiceItemModel
/**
* Model SalesInvoicePayment
*
*/
export type SalesInvoicePayment = Prisma.SalesInvoicePaymentModel
/**
* Model StockMovement
*
@@ -172,6 +192,11 @@ export type StockBalance = Prisma.StockBalanceModel
*
*/
export type StockAdjustment = Prisma.StockAdjustmentModel
/**
* Model StockReservation
*
*/
export type StockReservation = Prisma.StockReservationModel
/**
* Model Supplier
*
+112 -44
View File
@@ -226,6 +226,13 @@ export type BoolWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedBoolFilter<$PrismaModel>
}
export type EnumBankAccountTransactionTypeFilter<$PrismaModel = never> = {
equals?: $Enums.BankAccountTransactionType | Prisma.EnumBankAccountTransactionTypeFieldRefInput<$PrismaModel>
in?: $Enums.BankAccountTransactionType[]
notIn?: $Enums.BankAccountTransactionType[]
not?: Prisma.NestedEnumBankAccountTransactionTypeFilter<$PrismaModel> | $Enums.BankAccountTransactionType
}
export type DecimalFilter<$PrismaModel = never> = {
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
@@ -237,6 +244,23 @@ export type DecimalFilter<$PrismaModel = never> = {
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
}
export type EnumBankTransactionRefTypeFilter<$PrismaModel = never> = {
equals?: $Enums.BankTransactionRefType | Prisma.EnumBankTransactionRefTypeFieldRefInput<$PrismaModel>
in?: $Enums.BankTransactionRefType[]
notIn?: $Enums.BankTransactionRefType[]
not?: Prisma.NestedEnumBankTransactionRefTypeFilter<$PrismaModel> | $Enums.BankTransactionRefType
}
export type EnumBankAccountTransactionTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.BankAccountTransactionType | Prisma.EnumBankAccountTransactionTypeFieldRefInput<$PrismaModel>
in?: $Enums.BankAccountTransactionType[]
notIn?: $Enums.BankAccountTransactionType[]
not?: Prisma.NestedEnumBankAccountTransactionTypeWithAggregatesFilter<$PrismaModel> | $Enums.BankAccountTransactionType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumBankAccountTransactionTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumBankAccountTransactionTypeFilter<$PrismaModel>
}
export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
@@ -253,6 +277,16 @@ export type DecimalWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
}
export type EnumBankTransactionRefTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.BankTransactionRefType | Prisma.EnumBankTransactionRefTypeFieldRefInput<$PrismaModel>
in?: $Enums.BankTransactionRefType[]
notIn?: $Enums.BankTransactionRefType[]
not?: Prisma.NestedEnumBankTransactionRefTypeWithAggregatesFilter<$PrismaModel> | $Enums.BankTransactionRefType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumBankTransactionRefTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumBankTransactionRefTypeFilter<$PrismaModel>
}
export type EnumOrderStatusFilter<$PrismaModel = never> = {
equals?: $Enums.OrderStatus | Prisma.EnumOrderStatusFieldRefInput<$PrismaModel>
in?: $Enums.OrderStatus[]
@@ -260,33 +294,6 @@ export type EnumOrderStatusFilter<$PrismaModel = never> = {
not?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> | $Enums.OrderStatus
}
export type EnumPaymentMethodTypeFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentMethodType[]
notIn?: $Enums.PaymentMethodType[]
not?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> | $Enums.PaymentMethodType
}
export type EnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = {
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 EnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentMethodType[]
notIn?: $Enums.PaymentMethodType[]
not?: Prisma.NestedEnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel> | $Enums.PaymentMethodType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel>
}
export type IntNullableFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
@@ -298,6 +305,16 @@ export type IntNullableFilter<$PrismaModel = never> = {
not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null
}
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 IntNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
@@ -358,6 +375,13 @@ export type EnumPurchaseReceiptStatusWithAggregatesFilter<$PrismaModel = never>
_max?: Prisma.NestedEnumPurchaseReceiptStatusFilter<$PrismaModel>
}
export type EnumPaymentMethodTypeFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentMethodType[]
notIn?: $Enums.PaymentMethodType[]
not?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> | $Enums.PaymentMethodType
}
export type EnumPaymentTypeFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentType | Prisma.EnumPaymentTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentType[]
@@ -365,6 +389,16 @@ export type EnumPaymentTypeFilter<$PrismaModel = never> = {
not?: Prisma.NestedEnumPaymentTypeFilter<$PrismaModel> | $Enums.PaymentType
}
export type EnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentMethodType[]
notIn?: $Enums.PaymentMethodType[]
not?: Prisma.NestedEnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel> | $Enums.PaymentMethodType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel>
}
export type EnumPaymentTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentType | Prisma.EnumPaymentTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentType[]
@@ -628,6 +662,13 @@ export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedBoolFilter<$PrismaModel>
}
export type NestedEnumBankAccountTransactionTypeFilter<$PrismaModel = never> = {
equals?: $Enums.BankAccountTransactionType | Prisma.EnumBankAccountTransactionTypeFieldRefInput<$PrismaModel>
in?: $Enums.BankAccountTransactionType[]
notIn?: $Enums.BankAccountTransactionType[]
not?: Prisma.NestedEnumBankAccountTransactionTypeFilter<$PrismaModel> | $Enums.BankAccountTransactionType
}
export type NestedDecimalFilter<$PrismaModel = never> = {
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
@@ -639,6 +680,23 @@ export type NestedDecimalFilter<$PrismaModel = never> = {
not?: Prisma.NestedDecimalFilter<$PrismaModel> | runtime.Decimal | runtime.DecimalJsLike | number | string
}
export type NestedEnumBankTransactionRefTypeFilter<$PrismaModel = never> = {
equals?: $Enums.BankTransactionRefType | Prisma.EnumBankTransactionRefTypeFieldRefInput<$PrismaModel>
in?: $Enums.BankTransactionRefType[]
notIn?: $Enums.BankTransactionRefType[]
not?: Prisma.NestedEnumBankTransactionRefTypeFilter<$PrismaModel> | $Enums.BankTransactionRefType
}
export type NestedEnumBankAccountTransactionTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.BankAccountTransactionType | Prisma.EnumBankAccountTransactionTypeFieldRefInput<$PrismaModel>
in?: $Enums.BankAccountTransactionType[]
notIn?: $Enums.BankAccountTransactionType[]
not?: Prisma.NestedEnumBankAccountTransactionTypeWithAggregatesFilter<$PrismaModel> | $Enums.BankAccountTransactionType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumBankAccountTransactionTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumBankAccountTransactionTypeFilter<$PrismaModel>
}
export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = {
equals?: runtime.Decimal | runtime.DecimalJsLike | number | string | Prisma.DecimalFieldRefInput<$PrismaModel>
in?: runtime.Decimal[] | runtime.DecimalJsLike[] | number[] | string[]
@@ -655,6 +713,16 @@ export type NestedDecimalWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedDecimalFilter<$PrismaModel>
}
export type NestedEnumBankTransactionRefTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.BankTransactionRefType | Prisma.EnumBankTransactionRefTypeFieldRefInput<$PrismaModel>
in?: $Enums.BankTransactionRefType[]
notIn?: $Enums.BankTransactionRefType[]
not?: Prisma.NestedEnumBankTransactionRefTypeWithAggregatesFilter<$PrismaModel> | $Enums.BankTransactionRefType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumBankTransactionRefTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumBankTransactionRefTypeFilter<$PrismaModel>
}
export type NestedEnumOrderStatusFilter<$PrismaModel = never> = {
equals?: $Enums.OrderStatus | Prisma.EnumOrderStatusFieldRefInput<$PrismaModel>
in?: $Enums.OrderStatus[]
@@ -662,13 +730,6 @@ export type NestedEnumOrderStatusFilter<$PrismaModel = never> = {
not?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel> | $Enums.OrderStatus
}
export type NestedEnumPaymentMethodTypeFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentMethodType[]
notIn?: $Enums.PaymentMethodType[]
not?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> | $Enums.PaymentMethodType
}
export type NestedEnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.OrderStatus | Prisma.EnumOrderStatusFieldRefInput<$PrismaModel>
in?: $Enums.OrderStatus[]
@@ -679,16 +740,6 @@ export type NestedEnumOrderStatusWithAggregatesFilter<$PrismaModel = never> = {
_max?: Prisma.NestedEnumOrderStatusFilter<$PrismaModel>
}
export type NestedEnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentMethodType[]
notIn?: $Enums.PaymentMethodType[]
not?: Prisma.NestedEnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel> | $Enums.PaymentMethodType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel>
}
export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = {
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
in?: number[] | null
@@ -760,6 +811,13 @@ export type NestedEnumPurchaseReceiptStatusWithAggregatesFilter<$PrismaModel = n
_max?: Prisma.NestedEnumPurchaseReceiptStatusFilter<$PrismaModel>
}
export type NestedEnumPaymentMethodTypeFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentMethodType[]
notIn?: $Enums.PaymentMethodType[]
not?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel> | $Enums.PaymentMethodType
}
export type NestedEnumPaymentTypeFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentType | Prisma.EnumPaymentTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentType[]
@@ -767,6 +825,16 @@ export type NestedEnumPaymentTypeFilter<$PrismaModel = never> = {
not?: Prisma.NestedEnumPaymentTypeFilter<$PrismaModel> | $Enums.PaymentType
}
export type NestedEnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentMethodType | Prisma.EnumPaymentMethodTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentMethodType[]
notIn?: $Enums.PaymentMethodType[]
not?: Prisma.NestedEnumPaymentMethodTypeWithAggregatesFilter<$PrismaModel> | $Enums.PaymentMethodType
_count?: Prisma.NestedIntFilter<$PrismaModel>
_min?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel>
_max?: Prisma.NestedEnumPaymentMethodTypeFilter<$PrismaModel>
}
export type NestedEnumPaymentTypeWithAggregatesFilter<$PrismaModel = never> = {
equals?: $Enums.PaymentType | Prisma.EnumPaymentTypeFieldRefInput<$PrismaModel>
in?: $Enums.PaymentType[]
+22 -1
View File
@@ -11,7 +11,8 @@
export const OrderStatus = {
PENDING: 'PENDING',
REJECT: 'REJECT',
REJECTED: 'REJECTED',
CANCELED: 'CANCELED',
DONE: 'DONE'
} as const
@@ -73,3 +74,23 @@ export const PurchaseReceiptStatus = {
} as const
export type PurchaseReceiptStatus = (typeof PurchaseReceiptStatus)[keyof typeof PurchaseReceiptStatus]
export const BankAccountTransactionType = {
DEPOSIT: 'DEPOSIT',
WITHDRAWAL: 'WITHDRAWAL'
} as const
export type BankAccountTransactionType = (typeof BankAccountTransactionType)[keyof typeof BankAccountTransactionType]
export const BankTransactionRefType = {
PURCHASE_PAYMENT: 'PURCHASE_PAYMENT',
PURCHASE_REFUND: 'PURCHASE_REFUND',
POS_SALE: 'POS_SALE',
POS_REFUND: 'POS_REFUND',
BANK_TRANSFER: 'BANK_TRANSFER',
MANUAL_ADJUSTMENT: 'MANUAL_ADJUSTMENT'
} as const
export type BankTransactionRefType = (typeof BankTransactionRefType)[keyof typeof BankTransactionRefType]
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -57,16 +57,17 @@ export const ModelName = {
RefreshToken: 'RefreshToken',
BankBranch: 'BankBranch',
BankAccount: 'BankAccount',
BankAccountTransaction: 'BankAccountTransaction',
BankAccountBalance: 'BankAccountBalance',
Inventory: 'Inventory',
InventoryBankAccount: 'InventoryBankAccount',
PosAccount: 'PosAccount',
InventoryTransfer: 'InventoryTransfer',
InventoryTransferItem: 'InventoryTransferItem',
Bank: 'Bank',
Customer: 'Customer',
Order: 'Order',
SalesInvoice: 'SalesInvoice',
SalesInvoiceItem: 'SalesInvoiceItem',
OrderItem: 'OrderItem',
Customer: 'Customer',
TriggerLog: 'TriggerLog',
ProductVariant: 'ProductVariant',
Product: 'Product',
@@ -75,9 +76,13 @@ export const ModelName = {
PurchaseReceipt: 'PurchaseReceipt',
PurchaseReceiptItem: 'PurchaseReceiptItem',
PurchaseReceiptPayments: 'PurchaseReceiptPayments',
SalesInvoice: 'SalesInvoice',
SalesInvoiceItem: 'SalesInvoiceItem',
SalesInvoicePayment: 'SalesInvoicePayment',
StockMovement: 'StockMovement',
StockBalance: 'StockBalance',
StockAdjustment: 'StockAdjustment',
StockReservation: 'StockReservation',
Supplier: 'Supplier',
SupplierLedger: 'SupplierLedger'
} as const
@@ -179,6 +184,30 @@ export const BankAccountScalarFieldEnum = {
export type BankAccountScalarFieldEnum = (typeof BankAccountScalarFieldEnum)[keyof typeof BankAccountScalarFieldEnum]
export const BankAccountTransactionScalarFieldEnum = {
id: 'id',
bankAccountId: 'bankAccountId',
type: 'type',
amount: 'amount',
balanceAfter: 'balanceAfter',
referenceId: 'referenceId',
referenceType: 'referenceType',
description: 'description',
createdAt: 'createdAt'
} as const
export type BankAccountTransactionScalarFieldEnum = (typeof BankAccountTransactionScalarFieldEnum)[keyof typeof BankAccountTransactionScalarFieldEnum]
export const BankAccountBalanceScalarFieldEnum = {
bankAccountId: 'bankAccountId',
balance: 'balance',
updatedAt: 'updatedAt'
} as const
export type BankAccountBalanceScalarFieldEnum = (typeof BankAccountBalanceScalarFieldEnum)[keyof typeof BankAccountBalanceScalarFieldEnum]
export const InventoryScalarFieldEnum = {
id: 'id',
name: 'name',
@@ -250,6 +279,34 @@ export const BankScalarFieldEnum = {
export type BankScalarFieldEnum = (typeof BankScalarFieldEnum)[keyof typeof BankScalarFieldEnum]
export const OrderScalarFieldEnum = {
id: 'id',
orderNumber: 'orderNumber',
status: 'status',
totalAmount: 'totalAmount',
description: 'description',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt',
customerId: 'customerId'
} as const
export type OrderScalarFieldEnum = (typeof OrderScalarFieldEnum)[keyof typeof OrderScalarFieldEnum]
export const OrderItemScalarFieldEnum = {
id: 'id',
quantity: 'quantity',
unitPrice: 'unitPrice',
totalAmount: 'totalAmount',
createdAt: 'createdAt',
orderId: 'orderId',
productId: 'productId'
} as const
export type OrderItemScalarFieldEnum = (typeof OrderItemScalarFieldEnum)[keyof typeof OrderItemScalarFieldEnum]
export const CustomerScalarFieldEnum = {
id: 'id',
firstName: 'firstName',
@@ -269,49 +326,6 @@ export const CustomerScalarFieldEnum = {
export type CustomerScalarFieldEnum = (typeof CustomerScalarFieldEnum)[keyof typeof CustomerScalarFieldEnum]
export const OrderScalarFieldEnum = {
id: 'id',
orderNumber: 'orderNumber',
status: 'status',
paymentMethod: 'paymentMethod',
totalAmount: 'totalAmount',
description: 'description',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
deletedAt: 'deletedAt',
customerId: 'customerId'
} as const
export type OrderScalarFieldEnum = (typeof OrderScalarFieldEnum)[keyof typeof OrderScalarFieldEnum]
export const SalesInvoiceScalarFieldEnum = {
id: 'id',
code: 'code',
totalAmount: 'totalAmount',
description: 'description',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
customerId: 'customerId',
posAccountId: 'posAccountId'
} 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 TriggerLogScalarFieldEnum = {
id: 'id',
message: 'message',
@@ -407,8 +421,8 @@ export type PurchaseReceiptScalarFieldEnum = (typeof PurchaseReceiptScalarFieldE
export const PurchaseReceiptItemScalarFieldEnum = {
id: 'id',
count: 'count',
fee: 'fee',
total: 'total',
unitPrice: 'unitPrice',
totalAmount: 'totalAmount',
receiptId: 'receiptId',
productId: 'productId',
description: 'description',
@@ -435,11 +449,50 @@ export const PurchaseReceiptPaymentsScalarFieldEnum = {
export type PurchaseReceiptPaymentsScalarFieldEnum = (typeof PurchaseReceiptPaymentsScalarFieldEnum)[keyof typeof PurchaseReceiptPaymentsScalarFieldEnum]
export const SalesInvoiceScalarFieldEnum = {
id: 'id',
code: 'code',
totalAmount: 'totalAmount',
description: 'description',
createdAt: 'createdAt',
updatedAt: 'updatedAt',
customerId: 'customerId',
posAccountId: 'posAccountId'
} as const
export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum]
export const SalesInvoiceItemScalarFieldEnum = {
id: 'id',
count: 'count',
unitPrice: 'unitPrice',
totalAmount: 'totalAmount',
createdAt: 'createdAt',
invoiceId: 'invoiceId',
productId: 'productId'
} as const
export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum]
export const SalesInvoicePaymentScalarFieldEnum = {
id: 'id',
invoiceId: 'invoiceId',
amount: 'amount',
paymentMethod: 'paymentMethod',
paidAt: 'paidAt',
createdAt: 'createdAt'
} as const
export type SalesInvoicePaymentScalarFieldEnum = (typeof SalesInvoicePaymentScalarFieldEnum)[keyof typeof SalesInvoicePaymentScalarFieldEnum]
export const StockMovementScalarFieldEnum = {
id: 'id',
type: 'type',
quantity: 'quantity',
fee: 'fee',
unitPrice: 'unitPrice',
totalCost: 'totalCost',
referenceType: 'referenceType',
referenceId: 'referenceId',
@@ -481,6 +534,19 @@ export const StockAdjustmentScalarFieldEnum = {
export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldEnum)[keyof typeof StockAdjustmentScalarFieldEnum]
export const StockReservationScalarFieldEnum = {
id: 'id',
quantity: 'quantity',
expiresAt: 'expiresAt',
createdAt: 'createdAt',
productId: 'productId',
inventoryId: 'inventoryId',
orderId: 'orderId'
} as const
export type StockReservationScalarFieldEnum = (typeof StockReservationScalarFieldEnum)[keyof typeof StockReservationScalarFieldEnum]
export const SupplierScalarFieldEnum = {
id: 'id',
firstName: 'firstName',
@@ -608,6 +674,13 @@ export const BankAccountOrderByRelevanceFieldEnum = {
export type BankAccountOrderByRelevanceFieldEnum = (typeof BankAccountOrderByRelevanceFieldEnum)[keyof typeof BankAccountOrderByRelevanceFieldEnum]
export const BankAccountTransactionOrderByRelevanceFieldEnum = {
description: 'description'
} as const
export type BankAccountTransactionOrderByRelevanceFieldEnum = (typeof BankAccountTransactionOrderByRelevanceFieldEnum)[keyof typeof BankAccountTransactionOrderByRelevanceFieldEnum]
export const InventoryOrderByRelevanceFieldEnum = {
name: 'name',
location: 'location'
@@ -641,6 +714,14 @@ export const BankOrderByRelevanceFieldEnum = {
export type BankOrderByRelevanceFieldEnum = (typeof BankOrderByRelevanceFieldEnum)[keyof typeof BankOrderByRelevanceFieldEnum]
export const OrderOrderByRelevanceFieldEnum = {
orderNumber: 'orderNumber',
description: 'description'
} as const
export type OrderOrderByRelevanceFieldEnum = (typeof OrderOrderByRelevanceFieldEnum)[keyof typeof OrderOrderByRelevanceFieldEnum]
export const CustomerOrderByRelevanceFieldEnum = {
firstName: 'firstName',
lastName: 'lastName',
@@ -655,22 +736,6 @@ export const CustomerOrderByRelevanceFieldEnum = {
export type CustomerOrderByRelevanceFieldEnum = (typeof CustomerOrderByRelevanceFieldEnum)[keyof typeof CustomerOrderByRelevanceFieldEnum]
export const OrderOrderByRelevanceFieldEnum = {
orderNumber: 'orderNumber',
description: 'description'
} as const
export type OrderOrderByRelevanceFieldEnum = (typeof OrderOrderByRelevanceFieldEnum)[keyof typeof OrderOrderByRelevanceFieldEnum]
export const SalesInvoiceOrderByRelevanceFieldEnum = {
code: 'code',
description: 'description'
} as const
export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum]
export const TriggerLogOrderByRelevanceFieldEnum = {
message: 'message',
name: 'name'
@@ -740,6 +805,14 @@ export const PurchaseReceiptPaymentsOrderByRelevanceFieldEnum = {
export type PurchaseReceiptPaymentsOrderByRelevanceFieldEnum = (typeof PurchaseReceiptPaymentsOrderByRelevanceFieldEnum)[keyof typeof PurchaseReceiptPaymentsOrderByRelevanceFieldEnum]
export const SalesInvoiceOrderByRelevanceFieldEnum = {
code: 'code',
description: 'description'
} as const
export type SalesInvoiceOrderByRelevanceFieldEnum = (typeof SalesInvoiceOrderByRelevanceFieldEnum)[keyof typeof SalesInvoiceOrderByRelevanceFieldEnum]
export const StockMovementOrderByRelevanceFieldEnum = {
referenceId: 'referenceId'
} as const
+8 -3
View File
@@ -14,16 +14,17 @@ export type * from './models/OtpCode.js'
export type * from './models/RefreshToken.js'
export type * from './models/BankBranch.js'
export type * from './models/BankAccount.js'
export type * from './models/BankAccountTransaction.js'
export type * from './models/BankAccountBalance.js'
export type * from './models/Inventory.js'
export type * from './models/InventoryBankAccount.js'
export type * from './models/PosAccount.js'
export type * from './models/InventoryTransfer.js'
export type * from './models/InventoryTransferItem.js'
export type * from './models/Bank.js'
export type * from './models/Customer.js'
export type * from './models/Order.js'
export type * from './models/SalesInvoice.js'
export type * from './models/SalesInvoiceItem.js'
export type * from './models/OrderItem.js'
export type * from './models/Customer.js'
export type * from './models/TriggerLog.js'
export type * from './models/ProductVariant.js'
export type * from './models/Product.js'
@@ -32,9 +33,13 @@ export type * from './models/ProductCategory.js'
export type * from './models/PurchaseReceipt.js'
export type * from './models/PurchaseReceiptItem.js'
export type * from './models/PurchaseReceiptPayments.js'
export type * from './models/SalesInvoice.js'
export type * from './models/SalesInvoiceItem.js'
export type * from './models/SalesInvoicePayment.js'
export type * from './models/StockMovement.js'
export type * from './models/StockBalance.js'
export type * from './models/StockAdjustment.js'
export type * from './models/StockReservation.js'
export type * from './models/Supplier.js'
export type * from './models/SupplierLedger.js'
export type * from './commonInputTypes.js'
+288
View File
@@ -255,6 +255,8 @@ export type BankAccountWhereInput = {
branch?: Prisma.XOR<Prisma.BankBranchScalarRelationFilter, Prisma.BankBranchWhereInput>
inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter
bankAccountTransactions?: Prisma.BankAccountTransactionListRelationFilter
bankAccountBalances?: Prisma.BankAccountBalanceListRelationFilter
}
export type BankAccountOrderByWithRelationInput = {
@@ -270,6 +272,8 @@ export type BankAccountOrderByWithRelationInput = {
branch?: Prisma.BankBranchOrderByWithRelationInput
inventoryBankAccounts?: Prisma.InventoryBankAccountOrderByRelationAggregateInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsOrderByRelationAggregateInput
bankAccountTransactions?: Prisma.BankAccountTransactionOrderByRelationAggregateInput
bankAccountBalances?: Prisma.BankAccountBalanceOrderByRelationAggregateInput
_relevance?: Prisma.BankAccountOrderByRelevanceInput
}
@@ -289,6 +293,8 @@ export type BankAccountWhereUniqueInput = Prisma.AtLeast<{
branch?: Prisma.XOR<Prisma.BankBranchScalarRelationFilter, Prisma.BankBranchWhereInput>
inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsListRelationFilter
bankAccountTransactions?: Prisma.BankAccountTransactionListRelationFilter
bankAccountBalances?: Prisma.BankAccountBalanceListRelationFilter
}, "id" | "accountNumber" | "cardNumber" | "iban">
export type BankAccountOrderByWithAggregationInput = {
@@ -334,6 +340,8 @@ export type BankAccountCreateInput = {
branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput
bankAccountTransactions?: Prisma.BankAccountTransactionCreateNestedManyWithoutBankAccountInput
bankAccountBalances?: Prisma.BankAccountBalanceCreateNestedManyWithoutBankAccountInput
}
export type BankAccountUncheckedCreateInput = {
@@ -348,6 +356,8 @@ export type BankAccountUncheckedCreateInput = {
deletedAt?: Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput
bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedCreateNestedManyWithoutBankAccountInput
bankAccountBalances?: Prisma.BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput
}
export type BankAccountUpdateInput = {
@@ -361,6 +371,8 @@ export type BankAccountUpdateInput = {
branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput
bankAccountTransactions?: Prisma.BankAccountTransactionUpdateManyWithoutBankAccountNestedInput
bankAccountBalances?: Prisma.BankAccountBalanceUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountUncheckedUpdateInput = {
@@ -375,6 +387,8 @@ export type BankAccountUncheckedUpdateInput = {
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput
bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedUpdateManyWithoutBankAccountNestedInput
bankAccountBalances?: Prisma.BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountCreateManyInput = {
@@ -520,6 +534,34 @@ export type BankAccountUncheckedUpdateManyWithoutBranchNestedInput = {
deleteMany?: Prisma.BankAccountScalarWhereInput | Prisma.BankAccountScalarWhereInput[]
}
export type BankAccountCreateNestedOneWithoutBankAccountTransactionsInput = {
create?: Prisma.XOR<Prisma.BankAccountCreateWithoutBankAccountTransactionsInput, Prisma.BankAccountUncheckedCreateWithoutBankAccountTransactionsInput>
connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutBankAccountTransactionsInput
connect?: Prisma.BankAccountWhereUniqueInput
}
export type BankAccountUpdateOneRequiredWithoutBankAccountTransactionsNestedInput = {
create?: Prisma.XOR<Prisma.BankAccountCreateWithoutBankAccountTransactionsInput, Prisma.BankAccountUncheckedCreateWithoutBankAccountTransactionsInput>
connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutBankAccountTransactionsInput
upsert?: Prisma.BankAccountUpsertWithoutBankAccountTransactionsInput
connect?: Prisma.BankAccountWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.BankAccountUpdateToOneWithWhereWithoutBankAccountTransactionsInput, Prisma.BankAccountUpdateWithoutBankAccountTransactionsInput>, Prisma.BankAccountUncheckedUpdateWithoutBankAccountTransactionsInput>
}
export type BankAccountCreateNestedOneWithoutBankAccountBalancesInput = {
create?: Prisma.XOR<Prisma.BankAccountCreateWithoutBankAccountBalancesInput, Prisma.BankAccountUncheckedCreateWithoutBankAccountBalancesInput>
connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutBankAccountBalancesInput
connect?: Prisma.BankAccountWhereUniqueInput
}
export type BankAccountUpdateOneRequiredWithoutBankAccountBalancesNestedInput = {
create?: Prisma.XOR<Prisma.BankAccountCreateWithoutBankAccountBalancesInput, Prisma.BankAccountUncheckedCreateWithoutBankAccountBalancesInput>
connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutBankAccountBalancesInput
upsert?: Prisma.BankAccountUpsertWithoutBankAccountBalancesInput
connect?: Prisma.BankAccountWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.BankAccountUpdateToOneWithWhereWithoutBankAccountBalancesInput, Prisma.BankAccountUpdateWithoutBankAccountBalancesInput>, Prisma.BankAccountUncheckedUpdateWithoutBankAccountBalancesInput>
}
export type BankAccountCreateNestedOneWithoutInventoryBankAccountsInput = {
create?: Prisma.XOR<Prisma.BankAccountCreateWithoutInventoryBankAccountsInput, Prisma.BankAccountUncheckedCreateWithoutInventoryBankAccountsInput>
connectOrCreate?: Prisma.BankAccountCreateOrConnectWithoutInventoryBankAccountsInput
@@ -558,6 +600,8 @@ export type BankAccountCreateWithoutBranchInput = {
deletedAt?: Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput
bankAccountTransactions?: Prisma.BankAccountTransactionCreateNestedManyWithoutBankAccountInput
bankAccountBalances?: Prisma.BankAccountBalanceCreateNestedManyWithoutBankAccountInput
}
export type BankAccountUncheckedCreateWithoutBranchInput = {
@@ -571,6 +615,8 @@ export type BankAccountUncheckedCreateWithoutBranchInput = {
deletedAt?: Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput
bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedCreateNestedManyWithoutBankAccountInput
bankAccountBalances?: Prisma.BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput
}
export type BankAccountCreateOrConnectWithoutBranchInput = {
@@ -614,6 +660,154 @@ export type BankAccountScalarWhereInput = {
deletedAt?: Prisma.DateTimeNullableFilter<"BankAccount"> | Date | string | null
}
export type BankAccountCreateWithoutBankAccountTransactionsInput = {
accountNumber?: string | null
cardNumber?: string | null
name: string
iban?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput
bankAccountBalances?: Prisma.BankAccountBalanceCreateNestedManyWithoutBankAccountInput
}
export type BankAccountUncheckedCreateWithoutBankAccountTransactionsInput = {
id?: number
accountNumber?: string | null
cardNumber?: string | null
name: string
iban?: string | null
branchId: number
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput
bankAccountBalances?: Prisma.BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput
}
export type BankAccountCreateOrConnectWithoutBankAccountTransactionsInput = {
where: Prisma.BankAccountWhereUniqueInput
create: Prisma.XOR<Prisma.BankAccountCreateWithoutBankAccountTransactionsInput, Prisma.BankAccountUncheckedCreateWithoutBankAccountTransactionsInput>
}
export type BankAccountUpsertWithoutBankAccountTransactionsInput = {
update: Prisma.XOR<Prisma.BankAccountUpdateWithoutBankAccountTransactionsInput, Prisma.BankAccountUncheckedUpdateWithoutBankAccountTransactionsInput>
create: Prisma.XOR<Prisma.BankAccountCreateWithoutBankAccountTransactionsInput, Prisma.BankAccountUncheckedCreateWithoutBankAccountTransactionsInput>
where?: Prisma.BankAccountWhereInput
}
export type BankAccountUpdateToOneWithWhereWithoutBankAccountTransactionsInput = {
where?: Prisma.BankAccountWhereInput
data: Prisma.XOR<Prisma.BankAccountUpdateWithoutBankAccountTransactionsInput, Prisma.BankAccountUncheckedUpdateWithoutBankAccountTransactionsInput>
}
export type BankAccountUpdateWithoutBankAccountTransactionsInput = {
accountNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
cardNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
name?: Prisma.StringFieldUpdateOperationsInput | string
iban?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput
bankAccountBalances?: Prisma.BankAccountBalanceUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountUncheckedUpdateWithoutBankAccountTransactionsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
accountNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
cardNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
name?: Prisma.StringFieldUpdateOperationsInput | string
iban?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
branchId?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput
bankAccountBalances?: Prisma.BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountCreateWithoutBankAccountBalancesInput = {
accountNumber?: string | null
cardNumber?: string | null
name: string
iban?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput
bankAccountTransactions?: Prisma.BankAccountTransactionCreateNestedManyWithoutBankAccountInput
}
export type BankAccountUncheckedCreateWithoutBankAccountBalancesInput = {
id?: number
accountNumber?: string | null
cardNumber?: string | null
name: string
iban?: string | null
branchId: number
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput
bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedCreateNestedManyWithoutBankAccountInput
}
export type BankAccountCreateOrConnectWithoutBankAccountBalancesInput = {
where: Prisma.BankAccountWhereUniqueInput
create: Prisma.XOR<Prisma.BankAccountCreateWithoutBankAccountBalancesInput, Prisma.BankAccountUncheckedCreateWithoutBankAccountBalancesInput>
}
export type BankAccountUpsertWithoutBankAccountBalancesInput = {
update: Prisma.XOR<Prisma.BankAccountUpdateWithoutBankAccountBalancesInput, Prisma.BankAccountUncheckedUpdateWithoutBankAccountBalancesInput>
create: Prisma.XOR<Prisma.BankAccountCreateWithoutBankAccountBalancesInput, Prisma.BankAccountUncheckedCreateWithoutBankAccountBalancesInput>
where?: Prisma.BankAccountWhereInput
}
export type BankAccountUpdateToOneWithWhereWithoutBankAccountBalancesInput = {
where?: Prisma.BankAccountWhereInput
data: Prisma.XOR<Prisma.BankAccountUpdateWithoutBankAccountBalancesInput, Prisma.BankAccountUncheckedUpdateWithoutBankAccountBalancesInput>
}
export type BankAccountUpdateWithoutBankAccountBalancesInput = {
accountNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
cardNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
name?: Prisma.StringFieldUpdateOperationsInput | string
iban?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput
bankAccountTransactions?: Prisma.BankAccountTransactionUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountUncheckedUpdateWithoutBankAccountBalancesInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
accountNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
cardNumber?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
name?: Prisma.StringFieldUpdateOperationsInput | string
iban?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
branchId?: Prisma.IntFieldUpdateOperationsInput | number
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput
bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountCreateWithoutInventoryBankAccountsInput = {
accountNumber?: string | null
cardNumber?: string | null
@@ -624,6 +818,8 @@ export type BankAccountCreateWithoutInventoryBankAccountsInput = {
deletedAt?: Date | string | null
branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsCreateNestedManyWithoutBankAccountInput
bankAccountTransactions?: Prisma.BankAccountTransactionCreateNestedManyWithoutBankAccountInput
bankAccountBalances?: Prisma.BankAccountBalanceCreateNestedManyWithoutBankAccountInput
}
export type BankAccountUncheckedCreateWithoutInventoryBankAccountsInput = {
@@ -637,6 +833,8 @@ export type BankAccountUncheckedCreateWithoutInventoryBankAccountsInput = {
updatedAt?: Date | string
deletedAt?: Date | string | null
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedCreateNestedManyWithoutBankAccountInput
bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedCreateNestedManyWithoutBankAccountInput
bankAccountBalances?: Prisma.BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput
}
export type BankAccountCreateOrConnectWithoutInventoryBankAccountsInput = {
@@ -665,6 +863,8 @@ export type BankAccountUpdateWithoutInventoryBankAccountsInput = {
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput
bankAccountTransactions?: Prisma.BankAccountTransactionUpdateManyWithoutBankAccountNestedInput
bankAccountBalances?: Prisma.BankAccountBalanceUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput = {
@@ -678,6 +878,8 @@ export type BankAccountUncheckedUpdateWithoutInventoryBankAccountsInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput
bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedUpdateManyWithoutBankAccountNestedInput
bankAccountBalances?: Prisma.BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountCreateWithoutPurchaseReceiptPaymentsInput = {
@@ -690,6 +892,8 @@ export type BankAccountCreateWithoutPurchaseReceiptPaymentsInput = {
deletedAt?: Date | string | null
branch: Prisma.BankBranchCreateNestedOneWithoutBankAccountsInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutBankAccountInput
bankAccountTransactions?: Prisma.BankAccountTransactionCreateNestedManyWithoutBankAccountInput
bankAccountBalances?: Prisma.BankAccountBalanceCreateNestedManyWithoutBankAccountInput
}
export type BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput = {
@@ -703,6 +907,8 @@ export type BankAccountUncheckedCreateWithoutPurchaseReceiptPaymentsInput = {
updatedAt?: Date | string
deletedAt?: Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutBankAccountInput
bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedCreateNestedManyWithoutBankAccountInput
bankAccountBalances?: Prisma.BankAccountBalanceUncheckedCreateNestedManyWithoutBankAccountInput
}
export type BankAccountCreateOrConnectWithoutPurchaseReceiptPaymentsInput = {
@@ -731,6 +937,8 @@ export type BankAccountUpdateWithoutPurchaseReceiptPaymentsInput = {
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
branch?: Prisma.BankBranchUpdateOneRequiredWithoutBankAccountsNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput
bankAccountTransactions?: Prisma.BankAccountTransactionUpdateManyWithoutBankAccountNestedInput
bankAccountBalances?: Prisma.BankAccountBalanceUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput = {
@@ -744,6 +952,8 @@ export type BankAccountUncheckedUpdateWithoutPurchaseReceiptPaymentsInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput
bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedUpdateManyWithoutBankAccountNestedInput
bankAccountBalances?: Prisma.BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountCreateManyBranchInput = {
@@ -767,6 +977,8 @@ export type BankAccountUpdateWithoutBranchInput = {
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUpdateManyWithoutBankAccountNestedInput
bankAccountTransactions?: Prisma.BankAccountTransactionUpdateManyWithoutBankAccountNestedInput
bankAccountBalances?: Prisma.BankAccountBalanceUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountUncheckedUpdateWithoutBranchInput = {
@@ -780,6 +992,8 @@ export type BankAccountUncheckedUpdateWithoutBranchInput = {
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutBankAccountNestedInput
purchaseReceiptPayments?: Prisma.PurchaseReceiptPaymentsUncheckedUpdateManyWithoutBankAccountNestedInput
bankAccountTransactions?: Prisma.BankAccountTransactionUncheckedUpdateManyWithoutBankAccountNestedInput
bankAccountBalances?: Prisma.BankAccountBalanceUncheckedUpdateManyWithoutBankAccountNestedInput
}
export type BankAccountUncheckedUpdateManyWithoutBranchInput = {
@@ -801,11 +1015,15 @@ export type BankAccountUncheckedUpdateManyWithoutBranchInput = {
export type BankAccountCountOutputType = {
inventoryBankAccounts: number
purchaseReceiptPayments: number
bankAccountTransactions: number
bankAccountBalances: number
}
export type BankAccountCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
inventoryBankAccounts?: boolean | BankAccountCountOutputTypeCountInventoryBankAccountsArgs
purchaseReceiptPayments?: boolean | BankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs
bankAccountTransactions?: boolean | BankAccountCountOutputTypeCountBankAccountTransactionsArgs
bankAccountBalances?: boolean | BankAccountCountOutputTypeCountBankAccountBalancesArgs
}
/**
@@ -832,6 +1050,20 @@ export type BankAccountCountOutputTypeCountPurchaseReceiptPaymentsArgs<ExtArgs e
where?: Prisma.PurchaseReceiptPaymentsWhereInput
}
/**
* BankAccountCountOutputType without action
*/
export type BankAccountCountOutputTypeCountBankAccountTransactionsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.BankAccountTransactionWhereInput
}
/**
* BankAccountCountOutputType without action
*/
export type BankAccountCountOutputTypeCountBankAccountBalancesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.BankAccountBalanceWhereInput
}
export type BankAccountSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
@@ -846,6 +1078,8 @@ export type BankAccountSelect<ExtArgs extends runtime.Types.Extensions.InternalA
branch?: boolean | Prisma.BankBranchDefaultArgs<ExtArgs>
inventoryBankAccounts?: boolean | Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs>
purchaseReceiptPayments?: boolean | Prisma.BankAccount$purchaseReceiptPaymentsArgs<ExtArgs>
bankAccountTransactions?: boolean | Prisma.BankAccount$bankAccountTransactionsArgs<ExtArgs>
bankAccountBalances?: boolean | Prisma.BankAccount$bankAccountBalancesArgs<ExtArgs>
_count?: boolean | Prisma.BankAccountCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["bankAccount"]>
@@ -868,6 +1102,8 @@ export type BankAccountInclude<ExtArgs extends runtime.Types.Extensions.Internal
branch?: boolean | Prisma.BankBranchDefaultArgs<ExtArgs>
inventoryBankAccounts?: boolean | Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs>
purchaseReceiptPayments?: boolean | Prisma.BankAccount$purchaseReceiptPaymentsArgs<ExtArgs>
bankAccountTransactions?: boolean | Prisma.BankAccount$bankAccountTransactionsArgs<ExtArgs>
bankAccountBalances?: boolean | Prisma.BankAccount$bankAccountBalancesArgs<ExtArgs>
_count?: boolean | Prisma.BankAccountCountOutputTypeDefaultArgs<ExtArgs>
}
@@ -877,6 +1113,8 @@ export type $BankAccountPayload<ExtArgs extends runtime.Types.Extensions.Interna
branch: Prisma.$BankBranchPayload<ExtArgs>
inventoryBankAccounts: Prisma.$InventoryBankAccountPayload<ExtArgs>[]
purchaseReceiptPayments: Prisma.$PurchaseReceiptPaymentsPayload<ExtArgs>[]
bankAccountTransactions: Prisma.$BankAccountTransactionPayload<ExtArgs>[]
bankAccountBalances: Prisma.$BankAccountBalancePayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
@@ -1231,6 +1469,8 @@ export interface Prisma__BankAccountClient<T, Null = never, ExtArgs extends runt
branch<T extends Prisma.BankBranchDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankBranchDefaultArgs<ExtArgs>>): Prisma.Prisma__BankBranchClient<runtime.Types.Result.GetResult<Prisma.$BankBranchPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
inventoryBankAccounts<T extends Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankAccount$inventoryBankAccountsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$InventoryBankAccountPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
purchaseReceiptPayments<T extends Prisma.BankAccount$purchaseReceiptPaymentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankAccount$purchaseReceiptPaymentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PurchaseReceiptPaymentsPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
bankAccountTransactions<T extends Prisma.BankAccount$bankAccountTransactionsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankAccount$bankAccountTransactionsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$BankAccountTransactionPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
bankAccountBalances<T extends Prisma.BankAccount$bankAccountBalancesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.BankAccount$bankAccountBalancesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$BankAccountBalancePayload<ExtArgs>, 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.
@@ -1659,6 +1899,54 @@ export type BankAccount$purchaseReceiptPaymentsArgs<ExtArgs extends runtime.Type
distinct?: Prisma.PurchaseReceiptPaymentsScalarFieldEnum | Prisma.PurchaseReceiptPaymentsScalarFieldEnum[]
}
/**
* BankAccount.bankAccountTransactions
*/
export type BankAccount$bankAccountTransactionsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the BankAccountTransaction
*/
select?: Prisma.BankAccountTransactionSelect<ExtArgs> | null
/**
* Omit specific fields from the BankAccountTransaction
*/
omit?: Prisma.BankAccountTransactionOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.BankAccountTransactionInclude<ExtArgs> | null
where?: Prisma.BankAccountTransactionWhereInput
orderBy?: Prisma.BankAccountTransactionOrderByWithRelationInput | Prisma.BankAccountTransactionOrderByWithRelationInput[]
cursor?: Prisma.BankAccountTransactionWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.BankAccountTransactionScalarFieldEnum | Prisma.BankAccountTransactionScalarFieldEnum[]
}
/**
* BankAccount.bankAccountBalances
*/
export type BankAccount$bankAccountBalancesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the BankAccountBalance
*/
select?: Prisma.BankAccountBalanceSelect<ExtArgs> | null
/**
* Omit specific fields from the BankAccountBalance
*/
omit?: Prisma.BankAccountBalanceOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.BankAccountBalanceInclude<ExtArgs> | null
where?: Prisma.BankAccountBalanceWhereInput
orderBy?: Prisma.BankAccountBalanceOrderByWithRelationInput | Prisma.BankAccountBalanceOrderByWithRelationInput[]
cursor?: Prisma.BankAccountBalanceWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.BankAccountBalanceScalarFieldEnum | Prisma.BankAccountBalanceScalarFieldEnum[]
}
/**
* BankAccount without action
*/
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+8 -11
View File
@@ -488,6 +488,11 @@ export type CustomerUncheckedUpdateManyInput = {
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
}
export type CustomerNullableScalarRelationFilter = {
is?: Prisma.CustomerWhereInput | null
isNot?: Prisma.CustomerWhereInput | null
}
export type CustomerOrderByRelevanceInput = {
fields: Prisma.CustomerOrderByRelevanceFieldEnum | Prisma.CustomerOrderByRelevanceFieldEnum[]
sort: Prisma.SortOrder
@@ -550,26 +555,18 @@ 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<Prisma.CustomerCreateWithoutOrdersInput, Prisma.CustomerUncheckedCreateWithoutOrdersInput>
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutOrdersInput
connect?: Prisma.CustomerWhereUniqueInput
}
export type CustomerUpdateOneRequiredWithoutOrdersNestedInput = {
export type CustomerUpdateOneWithoutOrdersNestedInput = {
create?: Prisma.XOR<Prisma.CustomerCreateWithoutOrdersInput, Prisma.CustomerUncheckedCreateWithoutOrdersInput>
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutOrdersInput
upsert?: Prisma.CustomerUpsertWithoutOrdersInput
disconnect?: Prisma.CustomerWhereInput | boolean
delete?: Prisma.CustomerWhereInput | boolean
connect?: Prisma.CustomerWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutOrdersInput, Prisma.CustomerUpdateWithoutOrdersInput>, Prisma.CustomerUncheckedUpdateWithoutOrdersInput>
}
+180
View File
@@ -248,6 +248,7 @@ export type InventoryWhereInput = {
counterStockMovements?: Prisma.StockMovementListRelationFilter
stockMovements?: Prisma.StockMovementListRelationFilter
inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter
stockReservations?: Prisma.StockReservationListRelationFilter
}
export type InventoryOrderByWithRelationInput = {
@@ -267,6 +268,7 @@ export type InventoryOrderByWithRelationInput = {
counterStockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
inventoryBankAccounts?: Prisma.InventoryBankAccountOrderByRelationAggregateInput
stockReservations?: Prisma.StockReservationOrderByRelationAggregateInput
_relevance?: Prisma.InventoryOrderByRelevanceInput
}
@@ -290,6 +292,7 @@ export type InventoryWhereUniqueInput = Prisma.AtLeast<{
counterStockMovements?: Prisma.StockMovementListRelationFilter
stockMovements?: Prisma.StockMovementListRelationFilter
inventoryBankAccounts?: Prisma.InventoryBankAccountListRelationFilter
stockReservations?: Prisma.StockReservationListRelationFilter
}, "id">
export type InventoryOrderByWithAggregationInput = {
@@ -338,6 +341,7 @@ export type InventoryCreateInput = {
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateInput = {
@@ -357,6 +361,7 @@ export type InventoryUncheckedCreateInput = {
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryUpdateInput = {
@@ -375,6 +380,7 @@ export type InventoryUpdateInput = {
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateInput = {
@@ -394,6 +400,7 @@ export type InventoryUncheckedUpdateInput = {
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutInventoryNestedInput
}
export type InventoryCreateManyInput = {
@@ -599,6 +606,20 @@ export type InventoryUpdateOneRequiredWithoutStockAdjustmentsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.InventoryUpdateToOneWithWhereWithoutStockAdjustmentsInput, Prisma.InventoryUpdateWithoutStockAdjustmentsInput>, Prisma.InventoryUncheckedUpdateWithoutStockAdjustmentsInput>
}
export type InventoryCreateNestedOneWithoutStockReservationsInput = {
create?: Prisma.XOR<Prisma.InventoryCreateWithoutStockReservationsInput, Prisma.InventoryUncheckedCreateWithoutStockReservationsInput>
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockReservationsInput
connect?: Prisma.InventoryWhereUniqueInput
}
export type InventoryUpdateOneRequiredWithoutStockReservationsNestedInput = {
create?: Prisma.XOR<Prisma.InventoryCreateWithoutStockReservationsInput, Prisma.InventoryUncheckedCreateWithoutStockReservationsInput>
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockReservationsInput
upsert?: Prisma.InventoryUpsertWithoutStockReservationsInput
connect?: Prisma.InventoryWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.InventoryUpdateToOneWithWhereWithoutStockReservationsInput, Prisma.InventoryUpdateWithoutStockReservationsInput>, Prisma.InventoryUncheckedUpdateWithoutStockReservationsInput>
}
export type InventoryCreateWithoutInventoryBankAccountsInput = {
name: string
location?: string | null
@@ -614,6 +635,7 @@ export type InventoryCreateWithoutInventoryBankAccountsInput = {
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateWithoutInventoryBankAccountsInput = {
@@ -632,6 +654,7 @@ export type InventoryUncheckedCreateWithoutInventoryBankAccountsInput = {
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryCreateOrConnectWithoutInventoryBankAccountsInput = {
@@ -665,6 +688,7 @@ export type InventoryUpdateWithoutInventoryBankAccountsInput = {
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateWithoutInventoryBankAccountsInput = {
@@ -683,6 +707,7 @@ export type InventoryUncheckedUpdateWithoutInventoryBankAccountsInput = {
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutInventoryNestedInput
}
export type InventoryCreateWithoutInventoryTransfersFromInput = {
@@ -700,6 +725,7 @@ export type InventoryCreateWithoutInventoryTransfersFromInput = {
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = {
@@ -718,6 +744,7 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = {
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryCreateOrConnectWithoutInventoryTransfersFromInput = {
@@ -740,6 +767,7 @@ export type InventoryCreateWithoutInventoryTransfersToInput = {
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = {
@@ -758,6 +786,7 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = {
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryCreateOrConnectWithoutInventoryTransfersToInput = {
@@ -791,6 +820,7 @@ export type InventoryUpdateWithoutInventoryTransfersFromInput = {
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = {
@@ -809,6 +839,7 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = {
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutInventoryNestedInput
}
export type InventoryUpsertWithoutInventoryTransfersToInput = {
@@ -837,6 +868,7 @@ export type InventoryUpdateWithoutInventoryTransfersToInput = {
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = {
@@ -855,6 +887,7 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = {
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutInventoryNestedInput
}
export type InventoryCreateWithoutPurchaseReceiptsInput = {
@@ -872,6 +905,7 @@ export type InventoryCreateWithoutPurchaseReceiptsInput = {
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = {
@@ -890,6 +924,7 @@ export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = {
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryCreateOrConnectWithoutPurchaseReceiptsInput = {
@@ -923,6 +958,7 @@ export type InventoryUpdateWithoutPurchaseReceiptsInput = {
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = {
@@ -941,6 +977,7 @@ export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = {
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutInventoryNestedInput
}
export type InventoryCreateWithoutCounterStockMovementsInput = {
@@ -958,6 +995,7 @@ export type InventoryCreateWithoutCounterStockMovementsInput = {
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateWithoutCounterStockMovementsInput = {
@@ -976,6 +1014,7 @@ export type InventoryUncheckedCreateWithoutCounterStockMovementsInput = {
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryCreateOrConnectWithoutCounterStockMovementsInput = {
@@ -998,6 +1037,7 @@ export type InventoryCreateWithoutStockMovementsInput = {
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateWithoutStockMovementsInput = {
@@ -1016,6 +1056,7 @@ export type InventoryUncheckedCreateWithoutStockMovementsInput = {
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryCreateOrConnectWithoutStockMovementsInput = {
@@ -1049,6 +1090,7 @@ export type InventoryUpdateWithoutCounterStockMovementsInput = {
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateWithoutCounterStockMovementsInput = {
@@ -1067,6 +1109,7 @@ export type InventoryUncheckedUpdateWithoutCounterStockMovementsInput = {
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutInventoryNestedInput
}
export type InventoryUpsertWithoutStockMovementsInput = {
@@ -1095,6 +1138,7 @@ export type InventoryUpdateWithoutStockMovementsInput = {
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateWithoutStockMovementsInput = {
@@ -1113,6 +1157,7 @@ export type InventoryUncheckedUpdateWithoutStockMovementsInput = {
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutInventoryNestedInput
}
export type InventoryCreateWithoutStockBalancesInput = {
@@ -1130,6 +1175,7 @@ export type InventoryCreateWithoutStockBalancesInput = {
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateWithoutStockBalancesInput = {
@@ -1148,6 +1194,7 @@ export type InventoryUncheckedCreateWithoutStockBalancesInput = {
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryCreateOrConnectWithoutStockBalancesInput = {
@@ -1181,6 +1228,7 @@ export type InventoryUpdateWithoutStockBalancesInput = {
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateWithoutStockBalancesInput = {
@@ -1199,6 +1247,7 @@ export type InventoryUncheckedUpdateWithoutStockBalancesInput = {
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutInventoryNestedInput
}
export type InventoryCreateWithoutStockAdjustmentsInput = {
@@ -1216,6 +1265,7 @@ export type InventoryCreateWithoutStockAdjustmentsInput = {
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = {
@@ -1234,6 +1284,7 @@ export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = {
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryCreateOrConnectWithoutStockAdjustmentsInput = {
@@ -1267,6 +1318,7 @@ export type InventoryUpdateWithoutStockAdjustmentsInput = {
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = {
@@ -1285,6 +1337,97 @@ export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = {
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutInventoryNestedInput
}
export type InventoryCreateWithoutStockReservationsInput = {
name: string
location?: string | null
isActive?: boolean
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
isPointOfSale?: boolean
inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput
inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateWithoutStockReservationsInput = {
id?: number
name: string
location?: string | null
isActive?: boolean
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
isPointOfSale?: boolean
inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput
inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryCreateOrConnectWithoutStockReservationsInput = {
where: Prisma.InventoryWhereUniqueInput
create: Prisma.XOR<Prisma.InventoryCreateWithoutStockReservationsInput, Prisma.InventoryUncheckedCreateWithoutStockReservationsInput>
}
export type InventoryUpsertWithoutStockReservationsInput = {
update: Prisma.XOR<Prisma.InventoryUpdateWithoutStockReservationsInput, Prisma.InventoryUncheckedUpdateWithoutStockReservationsInput>
create: Prisma.XOR<Prisma.InventoryCreateWithoutStockReservationsInput, Prisma.InventoryUncheckedCreateWithoutStockReservationsInput>
where?: Prisma.InventoryWhereInput
}
export type InventoryUpdateToOneWithWhereWithoutStockReservationsInput = {
where?: Prisma.InventoryWhereInput
data: Prisma.XOR<Prisma.InventoryUpdateWithoutStockReservationsInput, Prisma.InventoryUncheckedUpdateWithoutStockReservationsInput>
}
export type InventoryUpdateWithoutStockReservationsInput = {
name?: Prisma.StringFieldUpdateOperationsInput | string
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput
inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateWithoutStockReservationsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
name?: Prisma.StringFieldUpdateOperationsInput | string
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput
inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
inventoryBankAccounts?: Prisma.InventoryBankAccountUncheckedUpdateManyWithoutInventoryNestedInput
}
@@ -1301,6 +1444,7 @@ export type InventoryCountOutputType = {
counterStockMovements: number
stockMovements: number
inventoryBankAccounts: number
stockReservations: number
}
export type InventoryCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -1312,6 +1456,7 @@ export type InventoryCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensi
counterStockMovements?: boolean | InventoryCountOutputTypeCountCounterStockMovementsArgs
stockMovements?: boolean | InventoryCountOutputTypeCountStockMovementsArgs
inventoryBankAccounts?: boolean | InventoryCountOutputTypeCountInventoryBankAccountsArgs
stockReservations?: boolean | InventoryCountOutputTypeCountStockReservationsArgs
}
/**
@@ -1380,6 +1525,13 @@ export type InventoryCountOutputTypeCountInventoryBankAccountsArgs<ExtArgs exten
where?: Prisma.InventoryBankAccountWhereInput
}
/**
* InventoryCountOutputType without action
*/
export type InventoryCountOutputTypeCountStockReservationsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.StockReservationWhereInput
}
export type InventorySelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
@@ -1398,6 +1550,7 @@ export type InventorySelect<ExtArgs extends runtime.Types.Extensions.InternalArg
counterStockMovements?: boolean | Prisma.Inventory$counterStockMovementsArgs<ExtArgs>
stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs<ExtArgs>
inventoryBankAccounts?: boolean | Prisma.Inventory$inventoryBankAccountsArgs<ExtArgs>
stockReservations?: boolean | Prisma.Inventory$stockReservationsArgs<ExtArgs>
_count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["inventory"]>
@@ -1424,6 +1577,7 @@ export type InventoryInclude<ExtArgs extends runtime.Types.Extensions.InternalAr
counterStockMovements?: boolean | Prisma.Inventory$counterStockMovementsArgs<ExtArgs>
stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs<ExtArgs>
inventoryBankAccounts?: boolean | Prisma.Inventory$inventoryBankAccountsArgs<ExtArgs>
stockReservations?: boolean | Prisma.Inventory$stockReservationsArgs<ExtArgs>
_count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs<ExtArgs>
}
@@ -1438,6 +1592,7 @@ export type $InventoryPayload<ExtArgs extends runtime.Types.Extensions.InternalA
counterStockMovements: Prisma.$StockMovementPayload<ExtArgs>[]
stockMovements: Prisma.$StockMovementPayload<ExtArgs>[]
inventoryBankAccounts: Prisma.$InventoryBankAccountPayload<ExtArgs>[]
stockReservations: Prisma.$StockReservationPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
@@ -1796,6 +1951,7 @@ export interface Prisma__InventoryClient<T, Null = never, ExtArgs extends runtim
counterStockMovements<T extends Prisma.Inventory$counterStockMovementsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$counterStockMovementsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockMovementPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
stockMovements<T extends Prisma.Inventory$stockMovementsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$stockMovementsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockMovementPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
inventoryBankAccounts<T extends Prisma.Inventory$inventoryBankAccountsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$inventoryBankAccountsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$InventoryBankAccountPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
stockReservations<T extends Prisma.Inventory$stockReservationsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$stockReservationsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockReservationPayload<ExtArgs>, 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.
@@ -2367,6 +2523,30 @@ export type Inventory$inventoryBankAccountsArgs<ExtArgs extends runtime.Types.Ex
distinct?: Prisma.InventoryBankAccountScalarFieldEnum | Prisma.InventoryBankAccountScalarFieldEnum[]
}
/**
* Inventory.stockReservations
*/
export type Inventory$stockReservationsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the StockReservation
*/
select?: Prisma.StockReservationSelect<ExtArgs> | null
/**
* Omit specific fields from the StockReservation
*/
omit?: Prisma.StockReservationOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.StockReservationInclude<ExtArgs> | null
where?: Prisma.StockReservationWhereInput
orderBy?: Prisma.StockReservationOrderByWithRelationInput | Prisma.StockReservationOrderByWithRelationInput[]
cursor?: Prisma.StockReservationWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.StockReservationScalarFieldEnum | Prisma.StockReservationScalarFieldEnum[]
}
/**
* Inventory without action
*/
@@ -398,14 +398,6 @@ export type InventoryTransferItemUncheckedUpdateManyWithoutTransferNestedInput =
deleteMany?: Prisma.InventoryTransferItemScalarWhereInput | Prisma.InventoryTransferItemScalarWhereInput[]
}
export type DecimalFieldUpdateOperationsInput = {
set?: runtime.Decimal | runtime.DecimalJsLike | number | string
increment?: runtime.Decimal | runtime.DecimalJsLike | number | string
decrement?: runtime.Decimal | runtime.DecimalJsLike | number | string
multiply?: runtime.Decimal | runtime.DecimalJsLike | number | string
divide?: runtime.Decimal | runtime.DecimalJsLike | number | string
}
export type InventoryTransferItemCreateNestedManyWithoutProductInput = {
create?: Prisma.XOR<Prisma.InventoryTransferItemCreateWithoutProductInput, Prisma.InventoryTransferItemUncheckedCreateWithoutProductInput> | Prisma.InventoryTransferItemCreateWithoutProductInput[] | Prisma.InventoryTransferItemUncheckedCreateWithoutProductInput[]
connectOrCreate?: Prisma.InventoryTransferItemCreateOrConnectWithoutProductInput | Prisma.InventoryTransferItemCreateOrConnectWithoutProductInput[]
+214 -73
View File
@@ -42,7 +42,6 @@ export type OrderMinAggregateOutputType = {
id: number | null
orderNumber: string | null
status: $Enums.OrderStatus | null
paymentMethod: $Enums.PaymentMethodType | null
totalAmount: runtime.Decimal | null
description: string | null
createdAt: Date | null
@@ -55,7 +54,6 @@ export type OrderMaxAggregateOutputType = {
id: number | null
orderNumber: string | null
status: $Enums.OrderStatus | null
paymentMethod: $Enums.PaymentMethodType | null
totalAmount: runtime.Decimal | null
description: string | null
createdAt: Date | null
@@ -68,7 +66,6 @@ export type OrderCountAggregateOutputType = {
id: number
orderNumber: number
status: number
paymentMethod: number
totalAmount: number
description: number
createdAt: number
@@ -95,7 +92,6 @@ export type OrderMinAggregateInputType = {
id?: true
orderNumber?: true
status?: true
paymentMethod?: true
totalAmount?: true
description?: true
createdAt?: true
@@ -108,7 +104,6 @@ export type OrderMaxAggregateInputType = {
id?: true
orderNumber?: true
status?: true
paymentMethod?: true
totalAmount?: true
description?: true
createdAt?: true
@@ -121,7 +116,6 @@ export type OrderCountAggregateInputType = {
id?: true
orderNumber?: true
status?: true
paymentMethod?: true
totalAmount?: true
description?: true
createdAt?: true
@@ -221,13 +215,12 @@ export type OrderGroupByOutputType = {
id: number
orderNumber: string
status: $Enums.OrderStatus
paymentMethod: $Enums.PaymentMethodType
totalAmount: runtime.Decimal
description: string | null
createdAt: Date
updatedAt: Date
deletedAt: Date | null
customerId: number
customerId: number | null
_count: OrderCountAggregateOutputType | null
_avg: OrderAvgAggregateOutputType | null
_sum: OrderSumAggregateOutputType | null
@@ -257,28 +250,28 @@ export type OrderWhereInput = {
id?: Prisma.IntFilter<"Order"> | number
orderNumber?: Prisma.StringFilter<"Order"> | string
status?: Prisma.EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"Order"> | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.StringNullableFilter<"Order"> | string | null
createdAt?: Prisma.DateTimeFilter<"Order"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"Order"> | Date | string
deletedAt?: Prisma.DateTimeNullableFilter<"Order"> | Date | string | null
customerId?: Prisma.IntFilter<"Order"> | number
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
customerId?: Prisma.IntNullableFilter<"Order"> | number | null
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
orderItems?: Prisma.OrderItemListRelationFilter
}
export type OrderOrderByWithRelationInput = {
id?: Prisma.SortOrder
orderNumber?: Prisma.SortOrder
status?: Prisma.SortOrder
paymentMethod?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder
customerId?: Prisma.SortOrder
customerId?: Prisma.SortOrderInput | Prisma.SortOrder
customer?: Prisma.CustomerOrderByWithRelationInput
orderItems?: Prisma.OrderItemOrderByRelationAggregateInput
_relevance?: Prisma.OrderOrderByRelevanceInput
}
@@ -289,27 +282,26 @@ export type OrderWhereUniqueInput = Prisma.AtLeast<{
OR?: Prisma.OrderWhereInput[]
NOT?: Prisma.OrderWhereInput | Prisma.OrderWhereInput[]
status?: Prisma.EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"Order"> | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.StringNullableFilter<"Order"> | string | null
createdAt?: Prisma.DateTimeFilter<"Order"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"Order"> | Date | string
deletedAt?: Prisma.DateTimeNullableFilter<"Order"> | Date | string | null
customerId?: Prisma.IntFilter<"Order"> | number
customer?: Prisma.XOR<Prisma.CustomerScalarRelationFilter, Prisma.CustomerWhereInput>
customerId?: Prisma.IntNullableFilter<"Order"> | number | null
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
orderItems?: Prisma.OrderItemListRelationFilter
}, "id" | "orderNumber">
export type OrderOrderByWithAggregationInput = {
id?: Prisma.SortOrder
orderNumber?: Prisma.SortOrder
status?: Prisma.SortOrder
paymentMethod?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
createdAt?: Prisma.SortOrder
updatedAt?: Prisma.SortOrder
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder
customerId?: Prisma.SortOrder
customerId?: Prisma.SortOrderInput | Prisma.SortOrder
_count?: Prisma.OrderCountOrderByAggregateInput
_avg?: Prisma.OrderAvgOrderByAggregateInput
_max?: Prisma.OrderMaxOrderByAggregateInput
@@ -324,82 +316,79 @@ export type OrderScalarWhereWithAggregatesInput = {
id?: Prisma.IntWithAggregatesFilter<"Order"> | number
orderNumber?: Prisma.StringWithAggregatesFilter<"Order"> | string
status?: Prisma.EnumOrderStatusWithAggregatesFilter<"Order"> | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeWithAggregatesFilter<"Order"> | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalWithAggregatesFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.StringNullableWithAggregatesFilter<"Order"> | string | null
createdAt?: Prisma.DateTimeWithAggregatesFilter<"Order"> | Date | string
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Order"> | Date | string
deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Order"> | Date | string | null
customerId?: Prisma.IntWithAggregatesFilter<"Order"> | number
customerId?: Prisma.IntNullableWithAggregatesFilter<"Order"> | number | null
}
export type OrderCreateInput = {
orderNumber: string
status?: $Enums.OrderStatus
paymentMethod?: $Enums.PaymentMethodType
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
customer: Prisma.CustomerCreateNestedOneWithoutOrdersInput
customer?: Prisma.CustomerCreateNestedOneWithoutOrdersInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutOrderInput
}
export type OrderUncheckedCreateInput = {
id?: number
orderNumber: string
status?: $Enums.OrderStatus
paymentMethod?: $Enums.PaymentMethodType
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
customerId: number
customerId?: number | null
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutOrderInput
}
export type OrderUpdateInput = {
orderNumber?: Prisma.StringFieldUpdateOperationsInput | string
status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
customer?: Prisma.CustomerUpdateOneRequiredWithoutOrdersNestedInput
customer?: Prisma.CustomerUpdateOneWithoutOrdersNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutOrderNestedInput
}
export type OrderUncheckedUpdateInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
orderNumber?: Prisma.StringFieldUpdateOperationsInput | string
status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
customerId?: Prisma.IntFieldUpdateOperationsInput | number
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutOrderNestedInput
}
export type OrderCreateManyInput = {
id?: number
orderNumber: string
status?: $Enums.OrderStatus
paymentMethod?: $Enums.PaymentMethodType
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
customerId: number
customerId?: number | null
}
export type OrderUpdateManyMutationInput = {
orderNumber?: Prisma.StringFieldUpdateOperationsInput | string
status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@@ -411,23 +400,12 @@ export type OrderUncheckedUpdateManyInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
orderNumber?: Prisma.StringFieldUpdateOperationsInput | string
status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
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
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
}
export type OrderOrderByRelevanceInput = {
@@ -440,7 +418,6 @@ export type OrderCountOrderByAggregateInput = {
id?: Prisma.SortOrder
orderNumber?: Prisma.SortOrder
status?: Prisma.SortOrder
paymentMethod?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
@@ -459,7 +436,6 @@ export type OrderMaxOrderByAggregateInput = {
id?: Prisma.SortOrder
orderNumber?: Prisma.SortOrder
status?: Prisma.SortOrder
paymentMethod?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
@@ -472,7 +448,6 @@ export type OrderMinOrderByAggregateInput = {
id?: Prisma.SortOrder
orderNumber?: Prisma.SortOrder
status?: Prisma.SortOrder
paymentMethod?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
description?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
@@ -487,6 +462,47 @@ export type OrderSumOrderByAggregateInput = {
customerId?: Prisma.SortOrder
}
export type OrderScalarRelationFilter = {
is?: Prisma.OrderWhereInput
isNot?: Prisma.OrderWhereInput
}
export type OrderListRelationFilter = {
every?: Prisma.OrderWhereInput
some?: Prisma.OrderWhereInput
none?: Prisma.OrderWhereInput
}
export type OrderOrderByRelationAggregateInput = {
_count?: Prisma.SortOrder
}
export type EnumOrderStatusFieldUpdateOperationsInput = {
set?: $Enums.OrderStatus
}
export type NullableIntFieldUpdateOperationsInput = {
set?: number | null
increment?: number
decrement?: number
multiply?: number
divide?: number
}
export type OrderCreateNestedOneWithoutOrderItemsInput = {
create?: Prisma.XOR<Prisma.OrderCreateWithoutOrderItemsInput, Prisma.OrderUncheckedCreateWithoutOrderItemsInput>
connectOrCreate?: Prisma.OrderCreateOrConnectWithoutOrderItemsInput
connect?: Prisma.OrderWhereUniqueInput
}
export type OrderUpdateOneRequiredWithoutOrderItemsNestedInput = {
create?: Prisma.XOR<Prisma.OrderCreateWithoutOrderItemsInput, Prisma.OrderUncheckedCreateWithoutOrderItemsInput>
connectOrCreate?: Prisma.OrderCreateOrConnectWithoutOrderItemsInput
upsert?: Prisma.OrderUpsertWithoutOrderItemsInput
connect?: Prisma.OrderWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.OrderUpdateToOneWithWhereWithoutOrderItemsInput, Prisma.OrderUpdateWithoutOrderItemsInput>, Prisma.OrderUncheckedUpdateWithoutOrderItemsInput>
}
export type OrderCreateNestedManyWithoutCustomerInput = {
create?: Prisma.XOR<Prisma.OrderCreateWithoutCustomerInput, Prisma.OrderUncheckedCreateWithoutCustomerInput> | Prisma.OrderCreateWithoutCustomerInput[] | Prisma.OrderUncheckedCreateWithoutCustomerInput[]
connectOrCreate?: Prisma.OrderCreateOrConnectWithoutCustomerInput | Prisma.OrderCreateOrConnectWithoutCustomerInput[]
@@ -529,35 +545,89 @@ export type OrderUncheckedUpdateManyWithoutCustomerNestedInput = {
deleteMany?: Prisma.OrderScalarWhereInput | Prisma.OrderScalarWhereInput[]
}
export type EnumOrderStatusFieldUpdateOperationsInput = {
set?: $Enums.OrderStatus
}
export type EnumPaymentMethodTypeFieldUpdateOperationsInput = {
set?: $Enums.PaymentMethodType
}
export type OrderCreateWithoutCustomerInput = {
export type OrderCreateWithoutOrderItemsInput = {
orderNumber: string
status?: $Enums.OrderStatus
paymentMethod?: $Enums.PaymentMethodType
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
customer?: Prisma.CustomerCreateNestedOneWithoutOrdersInput
}
export type OrderUncheckedCreateWithoutOrderItemsInput = {
id?: number
orderNumber: string
status?: $Enums.OrderStatus
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
customerId?: number | null
}
export type OrderCreateOrConnectWithoutOrderItemsInput = {
where: Prisma.OrderWhereUniqueInput
create: Prisma.XOR<Prisma.OrderCreateWithoutOrderItemsInput, Prisma.OrderUncheckedCreateWithoutOrderItemsInput>
}
export type OrderUpsertWithoutOrderItemsInput = {
update: Prisma.XOR<Prisma.OrderUpdateWithoutOrderItemsInput, Prisma.OrderUncheckedUpdateWithoutOrderItemsInput>
create: Prisma.XOR<Prisma.OrderCreateWithoutOrderItemsInput, Prisma.OrderUncheckedCreateWithoutOrderItemsInput>
where?: Prisma.OrderWhereInput
}
export type OrderUpdateToOneWithWhereWithoutOrderItemsInput = {
where?: Prisma.OrderWhereInput
data: Prisma.XOR<Prisma.OrderUpdateWithoutOrderItemsInput, Prisma.OrderUncheckedUpdateWithoutOrderItemsInput>
}
export type OrderUpdateWithoutOrderItemsInput = {
orderNumber?: Prisma.StringFieldUpdateOperationsInput | string
status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
customer?: Prisma.CustomerUpdateOneWithoutOrdersNestedInput
}
export type OrderUncheckedUpdateWithoutOrderItemsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
orderNumber?: Prisma.StringFieldUpdateOperationsInput | string
status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
}
export type OrderCreateWithoutCustomerInput = {
orderNumber: string
status?: $Enums.OrderStatus
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
orderItems?: Prisma.OrderItemCreateNestedManyWithoutOrderInput
}
export type OrderUncheckedCreateWithoutCustomerInput = {
id?: number
orderNumber: string
status?: $Enums.OrderStatus
paymentMethod?: $Enums.PaymentMethodType
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutOrderInput
}
export type OrderCreateOrConnectWithoutCustomerInput = {
@@ -593,20 +663,18 @@ export type OrderScalarWhereInput = {
id?: Prisma.IntFilter<"Order"> | number
orderNumber?: Prisma.StringFilter<"Order"> | string
status?: Prisma.EnumOrderStatusFilter<"Order"> | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeFilter<"Order"> | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalFilter<"Order"> | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.StringNullableFilter<"Order"> | string | null
createdAt?: Prisma.DateTimeFilter<"Order"> | Date | string
updatedAt?: Prisma.DateTimeFilter<"Order"> | Date | string
deletedAt?: Prisma.DateTimeNullableFilter<"Order"> | Date | string | null
customerId?: Prisma.IntFilter<"Order"> | number
customerId?: Prisma.IntNullableFilter<"Order"> | number | null
}
export type OrderCreateManyCustomerInput = {
id?: number
orderNumber: string
status?: $Enums.OrderStatus
paymentMethod?: $Enums.PaymentMethodType
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
@@ -617,31 +685,30 @@ export type OrderCreateManyCustomerInput = {
export type OrderUpdateWithoutCustomerInput = {
orderNumber?: Prisma.StringFieldUpdateOperationsInput | string
status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
orderItems?: Prisma.OrderItemUpdateManyWithoutOrderNestedInput
}
export type OrderUncheckedUpdateWithoutCustomerInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
orderNumber?: Prisma.StringFieldUpdateOperationsInput | string
status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutOrderNestedInput
}
export type OrderUncheckedUpdateManyWithoutCustomerInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
orderNumber?: Prisma.StringFieldUpdateOperationsInput | string
status?: Prisma.EnumOrderStatusFieldUpdateOperationsInput | $Enums.OrderStatus
paymentMethod?: Prisma.EnumPaymentMethodTypeFieldUpdateOperationsInput | $Enums.PaymentMethodType
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@@ -650,19 +717,49 @@ export type OrderUncheckedUpdateManyWithoutCustomerInput = {
}
/**
* Count Type OrderCountOutputType
*/
export type OrderCountOutputType = {
orderItems: number
}
export type OrderCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
orderItems?: boolean | OrderCountOutputTypeCountOrderItemsArgs
}
/**
* OrderCountOutputType without action
*/
export type OrderCountOutputTypeDefaultArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the OrderCountOutputType
*/
select?: Prisma.OrderCountOutputTypeSelect<ExtArgs> | null
}
/**
* OrderCountOutputType without action
*/
export type OrderCountOutputTypeCountOrderItemsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.OrderItemWhereInput
}
export type OrderSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
orderNumber?: boolean
status?: boolean
paymentMethod?: boolean
totalAmount?: boolean
description?: boolean
createdAt?: boolean
updatedAt?: boolean
deletedAt?: boolean
customerId?: boolean
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
customer?: boolean | Prisma.Order$customerArgs<ExtArgs>
orderItems?: boolean | Prisma.Order$orderItemsArgs<ExtArgs>
_count?: boolean | Prisma.OrderCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["order"]>
@@ -671,7 +768,6 @@ export type OrderSelectScalar = {
id?: boolean
orderNumber?: boolean
status?: boolean
paymentMethod?: boolean
totalAmount?: boolean
description?: boolean
createdAt?: boolean
@@ -680,27 +776,29 @@ export type OrderSelectScalar = {
customerId?: boolean
}
export type OrderOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "orderNumber" | "status" | "paymentMethod" | "totalAmount" | "description" | "createdAt" | "updatedAt" | "deletedAt" | "customerId", ExtArgs["result"]["order"]>
export type OrderOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "orderNumber" | "status" | "totalAmount" | "description" | "createdAt" | "updatedAt" | "deletedAt" | "customerId", ExtArgs["result"]["order"]>
export type OrderInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
customer?: boolean | Prisma.CustomerDefaultArgs<ExtArgs>
customer?: boolean | Prisma.Order$customerArgs<ExtArgs>
orderItems?: boolean | Prisma.Order$orderItemsArgs<ExtArgs>
_count?: boolean | Prisma.OrderCountOutputTypeDefaultArgs<ExtArgs>
}
export type $OrderPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
name: "Order"
objects: {
customer: Prisma.$CustomerPayload<ExtArgs>
customer: Prisma.$CustomerPayload<ExtArgs> | null
orderItems: Prisma.$OrderItemPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
orderNumber: string
status: $Enums.OrderStatus
paymentMethod: $Enums.PaymentMethodType
totalAmount: runtime.Decimal
description: string | null
createdAt: Date
updatedAt: Date
deletedAt: Date | null
customerId: number
customerId: number | null
}, ExtArgs["result"]["order"]>
composites: {}
}
@@ -1041,7 +1139,8 @@ readonly fields: OrderFieldRefs;
*/
export interface Prisma__OrderClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
readonly [Symbol.toStringTag]: "PrismaPromise"
customer<T extends Prisma.CustomerDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.CustomerDefaultArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
customer<T extends Prisma.Order$customerArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Order$customerArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
orderItems<T extends Prisma.Order$orderItemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Order$orderItemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$OrderItemPayload<ExtArgs>, 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.
@@ -1074,7 +1173,6 @@ 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", 'PaymentMethodType'>
readonly totalAmount: Prisma.FieldRef<"Order", 'Decimal'>
readonly description: Prisma.FieldRef<"Order", 'String'>
readonly createdAt: Prisma.FieldRef<"Order", 'DateTime'>
@@ -1423,6 +1521,49 @@ export type OrderDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.Interna
limit?: number
}
/**
* Order.customer
*/
export type Order$customerArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Customer
*/
select?: Prisma.CustomerSelect<ExtArgs> | null
/**
* Omit specific fields from the Customer
*/
omit?: Prisma.CustomerOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.CustomerInclude<ExtArgs> | null
where?: Prisma.CustomerWhereInput
}
/**
* Order.orderItems
*/
export type Order$orderItemsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the OrderItem
*/
select?: Prisma.OrderItemSelect<ExtArgs> | null
/**
* Omit specific fields from the OrderItem
*/
omit?: Prisma.OrderItemOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.OrderItemInclude<ExtArgs> | null
where?: Prisma.OrderItemWhereInput
orderBy?: Prisma.OrderItemOrderByWithRelationInput | Prisma.OrderItemOrderByWithRelationInput[]
cursor?: Prisma.OrderItemWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.OrderItemScalarFieldEnum | Prisma.OrderItemScalarFieldEnum[]
}
/**
* Order without action
*/
File diff suppressed because it is too large Load Diff
+419 -19
View File
@@ -297,6 +297,8 @@ export type ProductWhereInput = {
stockBalances?: Prisma.StockBalanceListRelationFilter
stockMovements?: Prisma.StockMovementListRelationFilter
salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter
stockReservations?: Prisma.StockReservationListRelationFilter
orderItems?: Prisma.OrderItemListRelationFilter
}
export type ProductOrderByWithRelationInput = {
@@ -321,6 +323,8 @@ export type ProductOrderByWithRelationInput = {
stockBalances?: Prisma.StockBalanceOrderByRelationAggregateInput
stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
salesInvoiceItems?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
stockReservations?: Prisma.StockReservationOrderByRelationAggregateInput
orderItems?: Prisma.OrderItemOrderByRelationAggregateInput
_relevance?: Prisma.ProductOrderByRelevanceInput
}
@@ -349,6 +353,8 @@ export type ProductWhereUniqueInput = Prisma.AtLeast<{
stockBalances?: Prisma.StockBalanceListRelationFilter
stockMovements?: Prisma.StockMovementListRelationFilter
salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter
stockReservations?: Prisma.StockReservationListRelationFilter
orderItems?: Prisma.OrderItemListRelationFilter
}, "id" | "sku" | "barcode">
export type ProductOrderByWithAggregationInput = {
@@ -408,6 +414,8 @@ export type ProductCreateInput = {
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateInput = {
@@ -430,6 +438,8 @@ export type ProductUncheckedCreateInput = {
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductUpdateInput = {
@@ -451,6 +461,8 @@ export type ProductUpdateInput = {
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateInput = {
@@ -473,6 +485,8 @@ export type ProductUncheckedUpdateInput = {
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductCreateManyInput = {
@@ -613,18 +627,18 @@ export type ProductUpdateOneRequiredWithoutInventoryTransferItemsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.ProductUpdateToOneWithWhereWithoutInventoryTransferItemsInput, Prisma.ProductUpdateWithoutInventoryTransferItemsInput>, Prisma.ProductUncheckedUpdateWithoutInventoryTransferItemsInput>
}
export type ProductCreateNestedOneWithoutSalesInvoiceItemsInput = {
create?: Prisma.XOR<Prisma.ProductCreateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedCreateWithoutSalesInvoiceItemsInput>
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutSalesInvoiceItemsInput
export type ProductCreateNestedOneWithoutOrderItemsInput = {
create?: Prisma.XOR<Prisma.ProductCreateWithoutOrderItemsInput, Prisma.ProductUncheckedCreateWithoutOrderItemsInput>
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutOrderItemsInput
connect?: Prisma.ProductWhereUniqueInput
}
export type ProductUpdateOneRequiredWithoutSalesInvoiceItemsNestedInput = {
create?: Prisma.XOR<Prisma.ProductCreateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedCreateWithoutSalesInvoiceItemsInput>
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutSalesInvoiceItemsInput
upsert?: Prisma.ProductUpsertWithoutSalesInvoiceItemsInput
export type ProductUpdateOneRequiredWithoutOrderItemsNestedInput = {
create?: Prisma.XOR<Prisma.ProductCreateWithoutOrderItemsInput, Prisma.ProductUncheckedCreateWithoutOrderItemsInput>
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutOrderItemsInput
upsert?: Prisma.ProductUpsertWithoutOrderItemsInput
connect?: Prisma.ProductWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.ProductUpdateToOneWithWhereWithoutSalesInvoiceItemsInput, Prisma.ProductUpdateWithoutSalesInvoiceItemsInput>, Prisma.ProductUncheckedUpdateWithoutSalesInvoiceItemsInput>
update?: Prisma.XOR<Prisma.XOR<Prisma.ProductUpdateToOneWithWhereWithoutOrderItemsInput, Prisma.ProductUpdateWithoutOrderItemsInput>, Prisma.ProductUncheckedUpdateWithoutOrderItemsInput>
}
export type ProductCreateNestedOneWithoutVariantsInput = {
@@ -739,6 +753,20 @@ export type ProductUpdateOneRequiredWithoutPurchaseReceiptItemsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.ProductUpdateToOneWithWhereWithoutPurchaseReceiptItemsInput, Prisma.ProductUpdateWithoutPurchaseReceiptItemsInput>, Prisma.ProductUncheckedUpdateWithoutPurchaseReceiptItemsInput>
}
export type ProductCreateNestedOneWithoutSalesInvoiceItemsInput = {
create?: Prisma.XOR<Prisma.ProductCreateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedCreateWithoutSalesInvoiceItemsInput>
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutSalesInvoiceItemsInput
connect?: Prisma.ProductWhereUniqueInput
}
export type ProductUpdateOneRequiredWithoutSalesInvoiceItemsNestedInput = {
create?: Prisma.XOR<Prisma.ProductCreateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedCreateWithoutSalesInvoiceItemsInput>
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutSalesInvoiceItemsInput
upsert?: Prisma.ProductUpsertWithoutSalesInvoiceItemsInput
connect?: Prisma.ProductWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.ProductUpdateToOneWithWhereWithoutSalesInvoiceItemsInput, Prisma.ProductUpdateWithoutSalesInvoiceItemsInput>, Prisma.ProductUncheckedUpdateWithoutSalesInvoiceItemsInput>
}
export type ProductCreateNestedOneWithoutStockMovementsInput = {
create?: Prisma.XOR<Prisma.ProductCreateWithoutStockMovementsInput, Prisma.ProductUncheckedCreateWithoutStockMovementsInput>
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutStockMovementsInput
@@ -781,6 +809,20 @@ export type ProductUpdateOneRequiredWithoutStockAdjustmentsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.ProductUpdateToOneWithWhereWithoutStockAdjustmentsInput, Prisma.ProductUpdateWithoutStockAdjustmentsInput>, Prisma.ProductUncheckedUpdateWithoutStockAdjustmentsInput>
}
export type ProductCreateNestedOneWithoutStockReservationsInput = {
create?: Prisma.XOR<Prisma.ProductCreateWithoutStockReservationsInput, Prisma.ProductUncheckedCreateWithoutStockReservationsInput>
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutStockReservationsInput
connect?: Prisma.ProductWhereUniqueInput
}
export type ProductUpdateOneRequiredWithoutStockReservationsNestedInput = {
create?: Prisma.XOR<Prisma.ProductCreateWithoutStockReservationsInput, Prisma.ProductUncheckedCreateWithoutStockReservationsInput>
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutStockReservationsInput
upsert?: Prisma.ProductUpsertWithoutStockReservationsInput
connect?: Prisma.ProductWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.ProductUpdateToOneWithWhereWithoutStockReservationsInput, Prisma.ProductUpdateWithoutStockReservationsInput>, Prisma.ProductUncheckedUpdateWithoutStockReservationsInput>
}
export type ProductCreateWithoutInventoryTransferItemsInput = {
name: string
description?: string | null
@@ -799,6 +841,8 @@ export type ProductCreateWithoutInventoryTransferItemsInput = {
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateWithoutInventoryTransferItemsInput = {
@@ -820,6 +864,8 @@ export type ProductUncheckedCreateWithoutInventoryTransferItemsInput = {
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutInventoryTransferItemsInput = {
@@ -856,6 +902,8 @@ export type ProductUpdateWithoutInventoryTransferItemsInput = {
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateWithoutInventoryTransferItemsInput = {
@@ -877,9 +925,11 @@ export type ProductUncheckedUpdateWithoutInventoryTransferItemsInput = {
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductCreateWithoutSalesInvoiceItemsInput = {
export type ProductCreateWithoutOrderItemsInput = {
name: string
description?: string | null
sku?: string | null
@@ -897,9 +947,11 @@ export type ProductCreateWithoutSalesInvoiceItemsInput = {
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateWithoutSalesInvoiceItemsInput = {
export type ProductUncheckedCreateWithoutOrderItemsInput = {
id?: number
name: string
description?: string | null
@@ -918,25 +970,27 @@ export type ProductUncheckedCreateWithoutSalesInvoiceItemsInput = {
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutSalesInvoiceItemsInput = {
export type ProductCreateOrConnectWithoutOrderItemsInput = {
where: Prisma.ProductWhereUniqueInput
create: Prisma.XOR<Prisma.ProductCreateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedCreateWithoutSalesInvoiceItemsInput>
create: Prisma.XOR<Prisma.ProductCreateWithoutOrderItemsInput, Prisma.ProductUncheckedCreateWithoutOrderItemsInput>
}
export type ProductUpsertWithoutSalesInvoiceItemsInput = {
update: Prisma.XOR<Prisma.ProductUpdateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedUpdateWithoutSalesInvoiceItemsInput>
create: Prisma.XOR<Prisma.ProductCreateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedCreateWithoutSalesInvoiceItemsInput>
export type ProductUpsertWithoutOrderItemsInput = {
update: Prisma.XOR<Prisma.ProductUpdateWithoutOrderItemsInput, Prisma.ProductUncheckedUpdateWithoutOrderItemsInput>
create: Prisma.XOR<Prisma.ProductCreateWithoutOrderItemsInput, Prisma.ProductUncheckedCreateWithoutOrderItemsInput>
where?: Prisma.ProductWhereInput
}
export type ProductUpdateToOneWithWhereWithoutSalesInvoiceItemsInput = {
export type ProductUpdateToOneWithWhereWithoutOrderItemsInput = {
where?: Prisma.ProductWhereInput
data: Prisma.XOR<Prisma.ProductUpdateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedUpdateWithoutSalesInvoiceItemsInput>
data: Prisma.XOR<Prisma.ProductUpdateWithoutOrderItemsInput, Prisma.ProductUncheckedUpdateWithoutOrderItemsInput>
}
export type ProductUpdateWithoutSalesInvoiceItemsInput = {
export type ProductUpdateWithoutOrderItemsInput = {
name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
@@ -954,9 +1008,11 @@ export type ProductUpdateWithoutSalesInvoiceItemsInput = {
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateWithoutSalesInvoiceItemsInput = {
export type ProductUncheckedUpdateWithoutOrderItemsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
name?: Prisma.StringFieldUpdateOperationsInput | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
@@ -975,6 +1031,8 @@ export type ProductUncheckedUpdateWithoutSalesInvoiceItemsInput = {
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductCreateWithoutVariantsInput = {
@@ -995,6 +1053,8 @@ export type ProductCreateWithoutVariantsInput = {
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateWithoutVariantsInput = {
@@ -1016,6 +1076,8 @@ export type ProductUncheckedCreateWithoutVariantsInput = {
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutVariantsInput = {
@@ -1052,6 +1114,8 @@ export type ProductUpdateWithoutVariantsInput = {
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateWithoutVariantsInput = {
@@ -1073,6 +1137,8 @@ export type ProductUncheckedUpdateWithoutVariantsInput = {
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductCreateWithoutBrandInput = {
@@ -1093,6 +1159,8 @@ export type ProductCreateWithoutBrandInput = {
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateWithoutBrandInput = {
@@ -1114,6 +1182,8 @@ export type ProductUncheckedCreateWithoutBrandInput = {
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutBrandInput = {
@@ -1178,6 +1248,8 @@ export type ProductCreateWithoutCategoryInput = {
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateWithoutCategoryInput = {
@@ -1199,6 +1271,8 @@ export type ProductUncheckedCreateWithoutCategoryInput = {
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutCategoryInput = {
@@ -1245,6 +1319,8 @@ export type ProductCreateWithoutPurchaseReceiptItemsInput = {
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateWithoutPurchaseReceiptItemsInput = {
@@ -1266,6 +1342,8 @@ export type ProductUncheckedCreateWithoutPurchaseReceiptItemsInput = {
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutPurchaseReceiptItemsInput = {
@@ -1302,6 +1380,8 @@ export type ProductUpdateWithoutPurchaseReceiptItemsInput = {
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateWithoutPurchaseReceiptItemsInput = {
@@ -1323,6 +1403,114 @@ export type ProductUncheckedUpdateWithoutPurchaseReceiptItemsInput = {
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductCreateWithoutSalesInvoiceItemsInput = {
name: string
description?: string | null
sku?: string | null
barcode?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
salePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
minimumStockAlertLevel?: runtime.Decimal | runtime.DecimalJsLike | number | string
inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput
variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput
brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput
category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput
purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
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
salePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
minimumStockAlertLevel?: runtime.Decimal | runtime.DecimalJsLike | number | string
inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput
variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutSalesInvoiceItemsInput = {
where: Prisma.ProductWhereUniqueInput
create: Prisma.XOR<Prisma.ProductCreateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedCreateWithoutSalesInvoiceItemsInput>
}
export type ProductUpsertWithoutSalesInvoiceItemsInput = {
update: Prisma.XOR<Prisma.ProductUpdateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedUpdateWithoutSalesInvoiceItemsInput>
create: Prisma.XOR<Prisma.ProductCreateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedCreateWithoutSalesInvoiceItemsInput>
where?: Prisma.ProductWhereInput
}
export type ProductUpdateToOneWithWhereWithoutSalesInvoiceItemsInput = {
where?: Prisma.ProductWhereInput
data: Prisma.XOR<Prisma.ProductUpdateWithoutSalesInvoiceItemsInput, Prisma.ProductUncheckedUpdateWithoutSalesInvoiceItemsInput>
}
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
salePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
minimumStockAlertLevel?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput
variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput
brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput
category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
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
salePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
minimumStockAlertLevel?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput
variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductCreateWithoutStockMovementsInput = {
@@ -1343,6 +1531,8 @@ export type ProductCreateWithoutStockMovementsInput = {
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateWithoutStockMovementsInput = {
@@ -1364,6 +1554,8 @@ export type ProductUncheckedCreateWithoutStockMovementsInput = {
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutStockMovementsInput = {
@@ -1400,6 +1592,8 @@ export type ProductUpdateWithoutStockMovementsInput = {
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateWithoutStockMovementsInput = {
@@ -1421,6 +1615,8 @@ export type ProductUncheckedUpdateWithoutStockMovementsInput = {
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductCreateWithoutStockBalancesInput = {
@@ -1441,6 +1637,8 @@ export type ProductCreateWithoutStockBalancesInput = {
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateWithoutStockBalancesInput = {
@@ -1462,6 +1660,8 @@ export type ProductUncheckedCreateWithoutStockBalancesInput = {
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutStockBalancesInput = {
@@ -1498,6 +1698,8 @@ export type ProductUpdateWithoutStockBalancesInput = {
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateWithoutStockBalancesInput = {
@@ -1519,6 +1721,8 @@ export type ProductUncheckedUpdateWithoutStockBalancesInput = {
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductCreateWithoutStockAdjustmentsInput = {
@@ -1539,6 +1743,8 @@ export type ProductCreateWithoutStockAdjustmentsInput = {
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateWithoutStockAdjustmentsInput = {
@@ -1560,6 +1766,8 @@ export type ProductUncheckedCreateWithoutStockAdjustmentsInput = {
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
stockReservations?: Prisma.StockReservationUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutStockAdjustmentsInput = {
@@ -1596,6 +1804,8 @@ export type ProductUpdateWithoutStockAdjustmentsInput = {
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateWithoutStockAdjustmentsInput = {
@@ -1617,6 +1827,114 @@ export type ProductUncheckedUpdateWithoutStockAdjustmentsInput = {
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductCreateWithoutStockReservationsInput = {
name: string
description?: string | null
sku?: string | null
barcode?: string | null
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
salePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
minimumStockAlertLevel?: runtime.Decimal | runtime.DecimalJsLike | number | string
inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput
variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput
brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput
category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput
purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemCreateNestedManyWithoutProductInput
}
export type ProductUncheckedCreateWithoutStockReservationsInput = {
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
salePrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
minimumStockAlertLevel?: runtime.Decimal | runtime.DecimalJsLike | number | string
inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput
variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
orderItems?: Prisma.OrderItemUncheckedCreateNestedManyWithoutProductInput
}
export type ProductCreateOrConnectWithoutStockReservationsInput = {
where: Prisma.ProductWhereUniqueInput
create: Prisma.XOR<Prisma.ProductCreateWithoutStockReservationsInput, Prisma.ProductUncheckedCreateWithoutStockReservationsInput>
}
export type ProductUpsertWithoutStockReservationsInput = {
update: Prisma.XOR<Prisma.ProductUpdateWithoutStockReservationsInput, Prisma.ProductUncheckedUpdateWithoutStockReservationsInput>
create: Prisma.XOR<Prisma.ProductCreateWithoutStockReservationsInput, Prisma.ProductUncheckedCreateWithoutStockReservationsInput>
where?: Prisma.ProductWhereInput
}
export type ProductUpdateToOneWithWhereWithoutStockReservationsInput = {
where?: Prisma.ProductWhereInput
data: Prisma.XOR<Prisma.ProductUpdateWithoutStockReservationsInput, Prisma.ProductUncheckedUpdateWithoutStockReservationsInput>
}
export type ProductUpdateWithoutStockReservationsInput = {
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
salePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
minimumStockAlertLevel?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput
variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput
brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput
category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateWithoutStockReservationsInput = {
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
salePrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
minimumStockAlertLevel?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput
variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductCreateManyBrandInput = {
@@ -1651,6 +1969,8 @@ export type ProductUpdateWithoutBrandInput = {
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateWithoutBrandInput = {
@@ -1672,6 +1992,8 @@ export type ProductUncheckedUpdateWithoutBrandInput = {
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateManyWithoutBrandInput = {
@@ -1720,6 +2042,8 @@ export type ProductUpdateWithoutCategoryInput = {
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateWithoutCategoryInput = {
@@ -1741,6 +2065,8 @@ export type ProductUncheckedUpdateWithoutCategoryInput = {
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
stockReservations?: Prisma.StockReservationUncheckedUpdateManyWithoutProductNestedInput
orderItems?: Prisma.OrderItemUncheckedUpdateManyWithoutProductNestedInput
}
export type ProductUncheckedUpdateManyWithoutCategoryInput = {
@@ -1770,6 +2096,8 @@ export type ProductCountOutputType = {
stockBalances: number
stockMovements: number
salesInvoiceItems: number
stockReservations: number
orderItems: number
}
export type ProductCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -1780,6 +2108,8 @@ export type ProductCountOutputTypeSelect<ExtArgs extends runtime.Types.Extension
stockBalances?: boolean | ProductCountOutputTypeCountStockBalancesArgs
stockMovements?: boolean | ProductCountOutputTypeCountStockMovementsArgs
salesInvoiceItems?: boolean | ProductCountOutputTypeCountSalesInvoiceItemsArgs
stockReservations?: boolean | ProductCountOutputTypeCountStockReservationsArgs
orderItems?: boolean | ProductCountOutputTypeCountOrderItemsArgs
}
/**
@@ -1841,6 +2171,20 @@ export type ProductCountOutputTypeCountSalesInvoiceItemsArgs<ExtArgs extends run
where?: Prisma.SalesInvoiceItemWhereInput
}
/**
* ProductCountOutputType without action
*/
export type ProductCountOutputTypeCountStockReservationsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.StockReservationWhereInput
}
/**
* ProductCountOutputType without action
*/
export type ProductCountOutputTypeCountOrderItemsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.OrderItemWhereInput
}
export type ProductSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
@@ -1864,6 +2208,8 @@ export type ProductSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
stockBalances?: boolean | Prisma.Product$stockBalancesArgs<ExtArgs>
stockMovements?: boolean | Prisma.Product$stockMovementsArgs<ExtArgs>
salesInvoiceItems?: boolean | Prisma.Product$salesInvoiceItemsArgs<ExtArgs>
stockReservations?: boolean | Prisma.Product$stockReservationsArgs<ExtArgs>
orderItems?: boolean | Prisma.Product$orderItemsArgs<ExtArgs>
_count?: boolean | Prisma.ProductCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["product"]>
@@ -1895,6 +2241,8 @@ export type ProductInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs
stockBalances?: boolean | Prisma.Product$stockBalancesArgs<ExtArgs>
stockMovements?: boolean | Prisma.Product$stockMovementsArgs<ExtArgs>
salesInvoiceItems?: boolean | Prisma.Product$salesInvoiceItemsArgs<ExtArgs>
stockReservations?: boolean | Prisma.Product$stockReservationsArgs<ExtArgs>
orderItems?: boolean | Prisma.Product$orderItemsArgs<ExtArgs>
_count?: boolean | Prisma.ProductCountOutputTypeDefaultArgs<ExtArgs>
}
@@ -1910,6 +2258,8 @@ export type $ProductPayload<ExtArgs extends runtime.Types.Extensions.InternalArg
stockBalances: Prisma.$StockBalancePayload<ExtArgs>[]
stockMovements: Prisma.$StockMovementPayload<ExtArgs>[]
salesInvoiceItems: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
stockReservations: Prisma.$StockReservationPayload<ExtArgs>[]
orderItems: Prisma.$OrderItemPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
@@ -2273,6 +2623,8 @@ export interface Prisma__ProductClient<T, Null = never, ExtArgs extends runtime.
stockBalances<T extends Prisma.Product$stockBalancesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$stockBalancesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockBalancePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
stockMovements<T extends Prisma.Product$stockMovementsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$stockMovementsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockMovementPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
salesInvoiceItems<T extends Prisma.Product$salesInvoiceItemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$salesInvoiceItemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
stockReservations<T extends Prisma.Product$stockReservationsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$stockReservationsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockReservationPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
orderItems<T extends Prisma.Product$orderItemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$orderItemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$OrderItemPayload<ExtArgs>, 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.
@@ -2862,6 +3214,54 @@ export type Product$salesInvoiceItemsArgs<ExtArgs extends runtime.Types.Extensio
distinct?: Prisma.SalesInvoiceItemScalarFieldEnum | Prisma.SalesInvoiceItemScalarFieldEnum[]
}
/**
* Product.stockReservations
*/
export type Product$stockReservationsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the StockReservation
*/
select?: Prisma.StockReservationSelect<ExtArgs> | null
/**
* Omit specific fields from the StockReservation
*/
omit?: Prisma.StockReservationOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.StockReservationInclude<ExtArgs> | null
where?: Prisma.StockReservationWhereInput
orderBy?: Prisma.StockReservationOrderByWithRelationInput | Prisma.StockReservationOrderByWithRelationInput[]
cursor?: Prisma.StockReservationWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.StockReservationScalarFieldEnum | Prisma.StockReservationScalarFieldEnum[]
}
/**
* Product.orderItems
*/
export type Product$orderItemsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the OrderItem
*/
select?: Prisma.OrderItemSelect<ExtArgs> | null
/**
* Omit specific fields from the OrderItem
*/
omit?: Prisma.OrderItemOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.OrderItemInclude<ExtArgs> | null
where?: Prisma.OrderItemWhereInput
orderBy?: Prisma.OrderItemOrderByWithRelationInput | Prisma.OrderItemOrderByWithRelationInput[]
cursor?: Prisma.OrderItemWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.OrderItemScalarFieldEnum | Prisma.OrderItemScalarFieldEnum[]
}
/**
* Product without action
*/
@@ -29,8 +29,8 @@ export type AggregatePurchaseReceiptItem = {
export type PurchaseReceiptItemAvgAggregateOutputType = {
id: number | null
count: runtime.Decimal | null
fee: runtime.Decimal | null
total: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalAmount: runtime.Decimal | null
receiptId: number | null
productId: number | null
}
@@ -38,8 +38,8 @@ export type PurchaseReceiptItemAvgAggregateOutputType = {
export type PurchaseReceiptItemSumAggregateOutputType = {
id: number | null
count: runtime.Decimal | null
fee: runtime.Decimal | null
total: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalAmount: runtime.Decimal | null
receiptId: number | null
productId: number | null
}
@@ -47,8 +47,8 @@ export type PurchaseReceiptItemSumAggregateOutputType = {
export type PurchaseReceiptItemMinAggregateOutputType = {
id: number | null
count: runtime.Decimal | null
fee: runtime.Decimal | null
total: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalAmount: runtime.Decimal | null
receiptId: number | null
productId: number | null
description: string | null
@@ -58,8 +58,8 @@ export type PurchaseReceiptItemMinAggregateOutputType = {
export type PurchaseReceiptItemMaxAggregateOutputType = {
id: number | null
count: runtime.Decimal | null
fee: runtime.Decimal | null
total: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalAmount: runtime.Decimal | null
receiptId: number | null
productId: number | null
description: string | null
@@ -69,8 +69,8 @@ export type PurchaseReceiptItemMaxAggregateOutputType = {
export type PurchaseReceiptItemCountAggregateOutputType = {
id: number
count: number
fee: number
total: number
unitPrice: number
totalAmount: number
receiptId: number
productId: number
description: number
@@ -82,8 +82,8 @@ export type PurchaseReceiptItemCountAggregateOutputType = {
export type PurchaseReceiptItemAvgAggregateInputType = {
id?: true
count?: true
fee?: true
total?: true
unitPrice?: true
totalAmount?: true
receiptId?: true
productId?: true
}
@@ -91,8 +91,8 @@ export type PurchaseReceiptItemAvgAggregateInputType = {
export type PurchaseReceiptItemSumAggregateInputType = {
id?: true
count?: true
fee?: true
total?: true
unitPrice?: true
totalAmount?: true
receiptId?: true
productId?: true
}
@@ -100,8 +100,8 @@ export type PurchaseReceiptItemSumAggregateInputType = {
export type PurchaseReceiptItemMinAggregateInputType = {
id?: true
count?: true
fee?: true
total?: true
unitPrice?: true
totalAmount?: true
receiptId?: true
productId?: true
description?: true
@@ -111,8 +111,8 @@ export type PurchaseReceiptItemMinAggregateInputType = {
export type PurchaseReceiptItemMaxAggregateInputType = {
id?: true
count?: true
fee?: true
total?: true
unitPrice?: true
totalAmount?: true
receiptId?: true
productId?: true
description?: true
@@ -122,8 +122,8 @@ export type PurchaseReceiptItemMaxAggregateInputType = {
export type PurchaseReceiptItemCountAggregateInputType = {
id?: true
count?: true
fee?: true
total?: true
unitPrice?: true
totalAmount?: true
receiptId?: true
productId?: true
description?: true
@@ -220,8 +220,8 @@ export type PurchaseReceiptItemGroupByArgs<ExtArgs extends runtime.Types.Extensi
export type PurchaseReceiptItemGroupByOutputType = {
id: number
count: runtime.Decimal
fee: runtime.Decimal
total: runtime.Decimal
unitPrice: runtime.Decimal
totalAmount: runtime.Decimal
receiptId: number
productId: number
description: string | null
@@ -254,8 +254,8 @@ export type 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
unitPrice?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
productId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
description?: Prisma.StringNullableFilter<"PurchaseReceiptItem"> | string | null
@@ -267,8 +267,8 @@ export type PurchaseReceiptItemWhereInput = {
export type PurchaseReceiptItemOrderByWithRelationInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
@@ -284,8 +284,8 @@ export type PurchaseReceiptItemWhereUniqueInput = Prisma.AtLeast<{
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
unitPrice?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
productId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
description?: Prisma.StringNullableFilter<"PurchaseReceiptItem"> | string | null
@@ -297,8 +297,8 @@ export type PurchaseReceiptItemWhereUniqueInput = Prisma.AtLeast<{
export type PurchaseReceiptItemOrderByWithAggregationInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
description?: Prisma.SortOrderInput | Prisma.SortOrder
@@ -316,8 +316,8 @@ export type 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
unitPrice?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalWithAggregatesFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptItem"> | number
productId?: Prisma.IntWithAggregatesFilter<"PurchaseReceiptItem"> | number
description?: Prisma.StringNullableWithAggregatesFilter<"PurchaseReceiptItem"> | string | null
@@ -326,8 +326,8 @@ export type PurchaseReceiptItemScalarWhereWithAggregatesInput = {
export type PurchaseReceiptItemCreateInput = {
count: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
total: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
product: Prisma.ProductCreateNestedOneWithoutPurchaseReceiptItemsInput
@@ -337,8 +337,8 @@ export type PurchaseReceiptItemCreateInput = {
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
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId: number
productId: number
description?: string | null
@@ -347,8 +347,8 @@ export type PurchaseReceiptItemUncheckedCreateInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
product?: Prisma.ProductUpdateOneRequiredWithoutPurchaseReceiptItemsNestedInput
@@ -358,8 +358,8 @@ export type PurchaseReceiptItemUpdateInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
productId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
@@ -369,8 +369,8 @@ export type PurchaseReceiptItemUncheckedUpdateInput = {
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
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId: number
productId: number
description?: string | null
@@ -379,8 +379,8 @@ export type PurchaseReceiptItemCreateManyInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
}
@@ -388,8 +388,8 @@ export type PurchaseReceiptItemUpdateManyMutationInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
productId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
@@ -415,8 +415,8 @@ export type PurchaseReceiptItemOrderByRelevanceInput = {
export type PurchaseReceiptItemCountOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
description?: Prisma.SortOrder
@@ -426,8 +426,8 @@ export type PurchaseReceiptItemCountOrderByAggregateInput = {
export type PurchaseReceiptItemAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
}
@@ -435,8 +435,8 @@ export type PurchaseReceiptItemAvgOrderByAggregateInput = {
export type PurchaseReceiptItemMaxOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
description?: Prisma.SortOrder
@@ -446,8 +446,8 @@ export type PurchaseReceiptItemMaxOrderByAggregateInput = {
export type PurchaseReceiptItemMinOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
description?: Prisma.SortOrder
@@ -457,8 +457,8 @@ export type PurchaseReceiptItemMinOrderByAggregateInput = {
export type PurchaseReceiptItemSumOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
receiptId?: Prisma.SortOrder
productId?: Prisma.SortOrder
}
@@ -549,8 +549,8 @@ export type PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptNestedInput = {
export type PurchaseReceiptItemCreateWithoutProductInput = {
count: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
total: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
receipt: Prisma.PurchaseReceiptCreateNestedOneWithoutItemsInput
@@ -559,8 +559,8 @@ export type PurchaseReceiptItemCreateWithoutProductInput = {
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
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId: number
description?: string | null
createdAt?: Date | string
@@ -598,8 +598,8 @@ export type 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
unitPrice?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFilter<"PurchaseReceiptItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
productId?: Prisma.IntFilter<"PurchaseReceiptItem"> | number
description?: Prisma.StringNullableFilter<"PurchaseReceiptItem"> | string | null
@@ -608,8 +608,8 @@ export type PurchaseReceiptItemScalarWhereInput = {
export type PurchaseReceiptItemCreateWithoutReceiptInput = {
count: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
total: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
product: Prisma.ProductCreateNestedOneWithoutPurchaseReceiptItemsInput
@@ -618,8 +618,8 @@ export type PurchaseReceiptItemCreateWithoutReceiptInput = {
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
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
productId: number
description?: string | null
createdAt?: Date | string
@@ -654,8 +654,8 @@ export type PurchaseReceiptItemUpdateManyWithWhereWithoutReceiptInput = {
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
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId: number
description?: string | null
createdAt?: Date | string
@@ -663,8 +663,8 @@ export type PurchaseReceiptItemCreateManyProductInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
receipt?: Prisma.PurchaseReceiptUpdateOneRequiredWithoutItemsNestedInput
@@ -673,8 +673,8 @@ export type PurchaseReceiptItemUpdateWithoutProductInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@@ -683,8 +683,8 @@ export type PurchaseReceiptItemUncheckedUpdateWithoutProductInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
receiptId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@@ -693,8 +693,8 @@ export type PurchaseReceiptItemUncheckedUpdateManyWithoutProductInput = {
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
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
productId: number
description?: string | null
createdAt?: Date | string
@@ -702,8 +702,8 @@ export type PurchaseReceiptItemCreateManyReceiptInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
product?: Prisma.ProductUpdateOneRequiredWithoutPurchaseReceiptItemsNestedInput
@@ -712,8 +712,8 @@ export type PurchaseReceiptItemUpdateWithoutReceiptInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@@ -722,8 +722,8 @@ export type PurchaseReceiptItemUncheckedUpdateWithoutReceiptInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
@@ -734,8 +734,8 @@ export type PurchaseReceiptItemUncheckedUpdateManyWithoutReceiptInput = {
export type PurchaseReceiptItemSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
count?: boolean
fee?: boolean
total?: boolean
unitPrice?: boolean
totalAmount?: boolean
receiptId?: boolean
productId?: boolean
description?: boolean
@@ -749,15 +749,15 @@ export type PurchaseReceiptItemSelect<ExtArgs extends runtime.Types.Extensions.I
export type PurchaseReceiptItemSelectScalar = {
id?: boolean
count?: boolean
fee?: boolean
total?: boolean
unitPrice?: boolean
totalAmount?: boolean
receiptId?: boolean
productId?: boolean
description?: boolean
createdAt?: boolean
}
export type PurchaseReceiptItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "count" | "fee" | "total" | "receiptId" | "productId" | "description" | "createdAt", ExtArgs["result"]["purchaseReceiptItem"]>
export type PurchaseReceiptItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "count" | "unitPrice" | "totalAmount" | "receiptId" | "productId" | "description" | "createdAt", ExtArgs["result"]["purchaseReceiptItem"]>
export type PurchaseReceiptItemInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
product?: boolean | Prisma.ProductDefaultArgs<ExtArgs>
receipt?: boolean | Prisma.PurchaseReceiptDefaultArgs<ExtArgs>
@@ -772,8 +772,8 @@ export type $PurchaseReceiptItemPayload<ExtArgs extends runtime.Types.Extensions
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
count: runtime.Decimal
fee: runtime.Decimal
total: runtime.Decimal
unitPrice: runtime.Decimal
totalAmount: runtime.Decimal
receiptId: number
productId: number
description: string | null
@@ -1151,8 +1151,8 @@ export interface Prisma__PurchaseReceiptItemClient<T, Null = never, ExtArgs exte
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 unitPrice: Prisma.FieldRef<"PurchaseReceiptItem", 'Decimal'>
readonly totalAmount: Prisma.FieldRef<"PurchaseReceiptItem", 'Decimal'>
readonly receiptId: Prisma.FieldRef<"PurchaseReceiptItem", 'Int'>
readonly productId: Prisma.FieldRef<"PurchaseReceiptItem", 'Int'>
readonly description: Prisma.FieldRef<"PurchaseReceiptItem", 'String'>
@@ -654,6 +654,10 @@ export type PurchaseReceiptPaymentsUncheckedUpdateManyWithoutReceiptNestedInput
deleteMany?: Prisma.PurchaseReceiptPaymentsScalarWhereInput | Prisma.PurchaseReceiptPaymentsScalarWhereInput[]
}
export type EnumPaymentMethodTypeFieldUpdateOperationsInput = {
set?: $Enums.PaymentMethodType
}
export type EnumPaymentTypeFieldUpdateOperationsInput = {
set?: $Enums.PaymentType
}
+153 -29
View File
@@ -252,9 +252,10 @@ export type SalesInvoiceWhereInput = {
updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null
posAccountId?: Prisma.IntFilter<"SalesInvoice"> | number
items?: Prisma.SalesInvoiceItemListRelationFilter
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
posAccount?: Prisma.XOR<Prisma.PosAccountScalarRelationFilter, Prisma.PosAccountWhereInput>
items?: Prisma.SalesInvoiceItemListRelationFilter
salesInvoicePayments?: Prisma.SalesInvoicePaymentListRelationFilter
}
export type SalesInvoiceOrderByWithRelationInput = {
@@ -266,9 +267,10 @@ export type SalesInvoiceOrderByWithRelationInput = {
updatedAt?: Prisma.SortOrder
customerId?: Prisma.SortOrderInput | Prisma.SortOrder
posAccountId?: Prisma.SortOrder
items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
customer?: Prisma.CustomerOrderByWithRelationInput
posAccount?: Prisma.PosAccountOrderByWithRelationInput
items?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentOrderByRelationAggregateInput
_relevance?: Prisma.SalesInvoiceOrderByRelevanceInput
}
@@ -284,9 +286,10 @@ export type SalesInvoiceWhereUniqueInput = Prisma.AtLeast<{
updatedAt?: Prisma.DateTimeFilter<"SalesInvoice"> | Date | string
customerId?: Prisma.IntNullableFilter<"SalesInvoice"> | number | null
posAccountId?: Prisma.IntFilter<"SalesInvoice"> | number
items?: Prisma.SalesInvoiceItemListRelationFilter
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
posAccount?: Prisma.XOR<Prisma.PosAccountScalarRelationFilter, Prisma.PosAccountWhereInput>
items?: Prisma.SalesInvoiceItemListRelationFilter
salesInvoicePayments?: Prisma.SalesInvoicePaymentListRelationFilter
}, "id" | "code">
export type SalesInvoiceOrderByWithAggregationInput = {
@@ -325,9 +328,10 @@ export type SalesInvoiceCreateInput = {
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput
posAccount: Prisma.PosAccountCreateNestedOneWithoutSalesInvoicesInput
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceUncheckedCreateInput = {
@@ -340,6 +344,7 @@ export type SalesInvoiceUncheckedCreateInput = {
customerId?: number | null
posAccountId: number
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceUpdateInput = {
@@ -348,9 +353,10 @@ export type SalesInvoiceUpdateInput = {
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput
posAccount?: Prisma.PosAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceUncheckedUpdateInput = {
@@ -363,6 +369,7 @@ export type SalesInvoiceUncheckedUpdateInput = {
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
posAccountId?: Prisma.IntFieldUpdateOperationsInput | number
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceCreateManyInput = {
@@ -547,14 +554,6 @@ export type SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput = {
deleteMany?: Prisma.SalesInvoiceScalarWhereInput | Prisma.SalesInvoiceScalarWhereInput[]
}
export type NullableIntFieldUpdateOperationsInput = {
set?: number | null
increment?: number
decrement?: number
multiply?: number
divide?: number
}
export type SalesInvoiceCreateNestedOneWithoutItemsInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutItemsInput, Prisma.SalesInvoiceUncheckedCreateWithoutItemsInput>
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutItemsInput
@@ -569,14 +568,29 @@ export type SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.SalesInvoiceUpdateToOneWithWhereWithoutItemsInput, Prisma.SalesInvoiceUpdateWithoutItemsInput>, Prisma.SalesInvoiceUncheckedUpdateWithoutItemsInput>
}
export type SalesInvoiceCreateNestedOneWithoutSalesInvoicePaymentsInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput>
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutSalesInvoicePaymentsInput
connect?: Prisma.SalesInvoiceWhereUniqueInput
}
export type SalesInvoiceUpdateOneRequiredWithoutSalesInvoicePaymentsNestedInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput>
connectOrCreate?: Prisma.SalesInvoiceCreateOrConnectWithoutSalesInvoicePaymentsInput
upsert?: Prisma.SalesInvoiceUpsertWithoutSalesInvoicePaymentsInput
connect?: Prisma.SalesInvoiceWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.SalesInvoiceUpdateToOneWithWhereWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUpdateWithoutSalesInvoicePaymentsInput>, Prisma.SalesInvoiceUncheckedUpdateWithoutSalesInvoicePaymentsInput>
}
export type SalesInvoiceCreateWithoutPosAccountInput = {
code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceUncheckedCreateWithoutPosAccountInput = {
@@ -588,6 +602,7 @@ export type SalesInvoiceUncheckedCreateWithoutPosAccountInput = {
updatedAt?: Date | string
customerId?: number | null
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceCreateOrConnectWithoutPosAccountInput = {
@@ -636,8 +651,9 @@ export type SalesInvoiceCreateWithoutCustomerInput = {
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
posAccount: Prisma.PosAccountCreateNestedOneWithoutSalesInvoicesInput
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceUncheckedCreateWithoutCustomerInput = {
@@ -649,6 +665,7 @@ export type SalesInvoiceUncheckedCreateWithoutCustomerInput = {
updatedAt?: Date | string
posAccountId: number
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceCreateOrConnectWithoutCustomerInput = {
@@ -685,6 +702,7 @@ export type SalesInvoiceCreateWithoutItemsInput = {
updatedAt?: Date | string
customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput
posAccount: Prisma.PosAccountCreateNestedOneWithoutSalesInvoicesInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceUncheckedCreateWithoutItemsInput = {
@@ -696,6 +714,7 @@ export type SalesInvoiceUncheckedCreateWithoutItemsInput = {
updatedAt?: Date | string
customerId?: number | null
posAccountId: number
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceCreateOrConnectWithoutItemsInput = {
@@ -722,6 +741,7 @@ export type SalesInvoiceUpdateWithoutItemsInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput
posAccount?: Prisma.PosAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceUncheckedUpdateWithoutItemsInput = {
@@ -733,6 +753,69 @@ export type SalesInvoiceUncheckedUpdateWithoutItemsInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
posAccountId?: Prisma.IntFieldUpdateOperationsInput | number
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceCreateWithoutSalesInvoicePaymentsInput = {
code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
customer?: Prisma.CustomerCreateNestedOneWithoutSalesInvoicesInput
posAccount: Prisma.PosAccountCreateNestedOneWithoutSalesInvoicesInput
items?: Prisma.SalesInvoiceItemCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput = {
id?: number
code: string
totalAmount: runtime.Decimal | runtime.DecimalJsLike | number | string
description?: string | null
createdAt?: Date | string
updatedAt?: Date | string
customerId?: number | null
posAccountId: number
items?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput
}
export type SalesInvoiceCreateOrConnectWithoutSalesInvoicePaymentsInput = {
where: Prisma.SalesInvoiceWhereUniqueInput
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput>
}
export type SalesInvoiceUpsertWithoutSalesInvoicePaymentsInput = {
update: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedUpdateWithoutSalesInvoicePaymentsInput>
create: Prisma.XOR<Prisma.SalesInvoiceCreateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedCreateWithoutSalesInvoicePaymentsInput>
where?: Prisma.SalesInvoiceWhereInput
}
export type SalesInvoiceUpdateToOneWithWhereWithoutSalesInvoicePaymentsInput = {
where?: Prisma.SalesInvoiceWhereInput
data: Prisma.XOR<Prisma.SalesInvoiceUpdateWithoutSalesInvoicePaymentsInput, Prisma.SalesInvoiceUncheckedUpdateWithoutSalesInvoicePaymentsInput>
}
export type SalesInvoiceUpdateWithoutSalesInvoicePaymentsInput = {
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
posAccount?: Prisma.PosAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceUncheckedUpdateWithoutSalesInvoicePaymentsInput = {
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
posAccountId?: Prisma.IntFieldUpdateOperationsInput | number
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceCreateManyPosAccountInput = {
@@ -751,8 +834,9 @@ export type SalesInvoiceUpdateWithoutPosAccountInput = {
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
customer?: Prisma.CustomerUpdateOneWithoutSalesInvoicesNestedInput
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceUncheckedUpdateWithoutPosAccountInput = {
@@ -764,6 +848,7 @@ export type SalesInvoiceUncheckedUpdateWithoutPosAccountInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceUncheckedUpdateManyWithoutPosAccountInput = {
@@ -792,8 +877,9 @@ export type SalesInvoiceUpdateWithoutCustomerInput = {
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
posAccount?: Prisma.PosAccountUpdateOneRequiredWithoutSalesInvoicesNestedInput
items?: Prisma.SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = {
@@ -805,6 +891,7 @@ export type SalesInvoiceUncheckedUpdateWithoutCustomerInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
posAccountId?: Prisma.IntFieldUpdateOperationsInput | number
items?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput
salesInvoicePayments?: Prisma.SalesInvoicePaymentUncheckedUpdateManyWithoutInvoiceNestedInput
}
export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = {
@@ -824,10 +911,12 @@ export type SalesInvoiceUncheckedUpdateManyWithoutCustomerInput = {
export type SalesInvoiceCountOutputType = {
items: number
salesInvoicePayments: number
}
export type SalesInvoiceCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
items?: boolean | SalesInvoiceCountOutputTypeCountItemsArgs
salesInvoicePayments?: boolean | SalesInvoiceCountOutputTypeCountSalesInvoicePaymentsArgs
}
/**
@@ -847,6 +936,13 @@ export type SalesInvoiceCountOutputTypeCountItemsArgs<ExtArgs extends runtime.Ty
where?: Prisma.SalesInvoiceItemWhereInput
}
/**
* SalesInvoiceCountOutputType without action
*/
export type SalesInvoiceCountOutputTypeCountSalesInvoicePaymentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.SalesInvoicePaymentWhereInput
}
export type SalesInvoiceSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
@@ -857,9 +953,10 @@ export type SalesInvoiceSelect<ExtArgs extends runtime.Types.Extensions.Internal
updatedAt?: boolean
customerId?: boolean
posAccountId?: boolean
items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs>
customer?: boolean | Prisma.SalesInvoice$customerArgs<ExtArgs>
posAccount?: boolean | Prisma.PosAccountDefaultArgs<ExtArgs>
items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs>
salesInvoicePayments?: boolean | Prisma.SalesInvoice$salesInvoicePaymentsArgs<ExtArgs>
_count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["salesInvoice"]>
@@ -878,18 +975,20 @@ export type SalesInvoiceSelectScalar = {
export type SalesInvoiceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "code" | "totalAmount" | "description" | "createdAt" | "updatedAt" | "customerId" | "posAccountId", ExtArgs["result"]["salesInvoice"]>
export type SalesInvoiceInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs>
customer?: boolean | Prisma.SalesInvoice$customerArgs<ExtArgs>
posAccount?: boolean | Prisma.PosAccountDefaultArgs<ExtArgs>
items?: boolean | Prisma.SalesInvoice$itemsArgs<ExtArgs>
salesInvoicePayments?: boolean | Prisma.SalesInvoice$salesInvoicePaymentsArgs<ExtArgs>
_count?: boolean | Prisma.SalesInvoiceCountOutputTypeDefaultArgs<ExtArgs>
}
export type $SalesInvoicePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
name: "SalesInvoice"
objects: {
items: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
customer: Prisma.$CustomerPayload<ExtArgs> | null
posAccount: Prisma.$PosAccountPayload<ExtArgs>
items: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
salesInvoicePayments: Prisma.$SalesInvoicePaymentPayload<ExtArgs>[]
}
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
@@ -1240,9 +1339,10 @@ readonly fields: SalesInvoiceFieldRefs;
*/
export interface Prisma__SalesInvoiceClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
readonly [Symbol.toStringTag]: "PrismaPromise"
items<T extends Prisma.SalesInvoice$itemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$itemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
customer<T extends Prisma.SalesInvoice$customerArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$customerArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
posAccount<T extends Prisma.PosAccountDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.PosAccountDefaultArgs<ExtArgs>>): Prisma.Prisma__PosAccountClient<runtime.Types.Result.GetResult<Prisma.$PosAccountPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
items<T extends Prisma.SalesInvoice$itemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$itemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
salesInvoicePayments<T extends Prisma.SalesInvoice$salesInvoicePaymentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.SalesInvoice$salesInvoicePaymentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePaymentPayload<ExtArgs>, 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.
@@ -1622,6 +1722,25 @@ export type SalesInvoiceDeleteManyArgs<ExtArgs extends runtime.Types.Extensions.
limit?: number
}
/**
* SalesInvoice.customer
*/
export type SalesInvoice$customerArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Customer
*/
select?: Prisma.CustomerSelect<ExtArgs> | null
/**
* Omit specific fields from the Customer
*/
omit?: Prisma.CustomerOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.CustomerInclude<ExtArgs> | null
where?: Prisma.CustomerWhereInput
}
/**
* SalesInvoice.items
*/
@@ -1647,22 +1766,27 @@ export type SalesInvoice$itemsArgs<ExtArgs extends runtime.Types.Extensions.Inte
}
/**
* SalesInvoice.customer
* SalesInvoice.salesInvoicePayments
*/
export type SalesInvoice$customerArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
export type SalesInvoice$salesInvoicePaymentsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Customer
* Select specific fields to fetch from the SalesInvoicePayment
*/
select?: Prisma.CustomerSelect<ExtArgs> | null
select?: Prisma.SalesInvoicePaymentSelect<ExtArgs> | null
/**
* Omit specific fields from the Customer
* Omit specific fields from the SalesInvoicePayment
*/
omit?: Prisma.CustomerOmit<ExtArgs> | null
omit?: Prisma.SalesInvoicePaymentOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.CustomerInclude<ExtArgs> | null
where?: Prisma.CustomerWhereInput
include?: Prisma.SalesInvoicePaymentInclude<ExtArgs> | null
where?: Prisma.SalesInvoicePaymentWhereInput
orderBy?: Prisma.SalesInvoicePaymentOrderByWithRelationInput | Prisma.SalesInvoicePaymentOrderByWithRelationInput[]
cursor?: Prisma.SalesInvoicePaymentWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.SalesInvoicePaymentScalarFieldEnum | Prisma.SalesInvoicePaymentScalarFieldEnum[]
}
/**
+190 -190
View File
@@ -29,8 +29,8 @@ export type AggregateSalesInvoiceItem = {
export type SalesInvoiceItemAvgAggregateOutputType = {
id: number | null
count: runtime.Decimal | null
fee: runtime.Decimal | null
total: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalAmount: runtime.Decimal | null
invoiceId: number | null
productId: number | null
}
@@ -38,8 +38,8 @@ export type SalesInvoiceItemAvgAggregateOutputType = {
export type SalesInvoiceItemSumAggregateOutputType = {
id: number | null
count: runtime.Decimal | null
fee: runtime.Decimal | null
total: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalAmount: runtime.Decimal | null
invoiceId: number | null
productId: number | null
}
@@ -47,8 +47,8 @@ export type SalesInvoiceItemSumAggregateOutputType = {
export type SalesInvoiceItemMinAggregateOutputType = {
id: number | null
count: runtime.Decimal | null
fee: runtime.Decimal | null
total: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalAmount: runtime.Decimal | null
createdAt: Date | null
invoiceId: number | null
productId: number | null
@@ -57,8 +57,8 @@ export type SalesInvoiceItemMinAggregateOutputType = {
export type SalesInvoiceItemMaxAggregateOutputType = {
id: number | null
count: runtime.Decimal | null
fee: runtime.Decimal | null
total: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalAmount: runtime.Decimal | null
createdAt: Date | null
invoiceId: number | null
productId: number | null
@@ -67,8 +67,8 @@ export type SalesInvoiceItemMaxAggregateOutputType = {
export type SalesInvoiceItemCountAggregateOutputType = {
id: number
count: number
fee: number
total: number
unitPrice: number
totalAmount: number
createdAt: number
invoiceId: number
productId: number
@@ -79,8 +79,8 @@ export type SalesInvoiceItemCountAggregateOutputType = {
export type SalesInvoiceItemAvgAggregateInputType = {
id?: true
count?: true
fee?: true
total?: true
unitPrice?: true
totalAmount?: true
invoiceId?: true
productId?: true
}
@@ -88,8 +88,8 @@ export type SalesInvoiceItemAvgAggregateInputType = {
export type SalesInvoiceItemSumAggregateInputType = {
id?: true
count?: true
fee?: true
total?: true
unitPrice?: true
totalAmount?: true
invoiceId?: true
productId?: true
}
@@ -97,8 +97,8 @@ export type SalesInvoiceItemSumAggregateInputType = {
export type SalesInvoiceItemMinAggregateInputType = {
id?: true
count?: true
fee?: true
total?: true
unitPrice?: true
totalAmount?: true
createdAt?: true
invoiceId?: true
productId?: true
@@ -107,8 +107,8 @@ export type SalesInvoiceItemMinAggregateInputType = {
export type SalesInvoiceItemMaxAggregateInputType = {
id?: true
count?: true
fee?: true
total?: true
unitPrice?: true
totalAmount?: true
createdAt?: true
invoiceId?: true
productId?: true
@@ -117,8 +117,8 @@ export type SalesInvoiceItemMaxAggregateInputType = {
export type SalesInvoiceItemCountAggregateInputType = {
id?: true
count?: true
fee?: true
total?: true
unitPrice?: true
totalAmount?: true
createdAt?: true
invoiceId?: true
productId?: true
@@ -214,8 +214,8 @@ export type SalesInvoiceItemGroupByArgs<ExtArgs extends runtime.Types.Extensions
export type SalesInvoiceItemGroupByOutputType = {
id: number
count: runtime.Decimal
fee: runtime.Decimal
total: runtime.Decimal
unitPrice: runtime.Decimal
totalAmount: runtime.Decimal
createdAt: Date
invoiceId: number
productId: number
@@ -247,8 +247,8 @@ export type 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
unitPrice?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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
@@ -259,8 +259,8 @@ export type SalesInvoiceItemWhereInput = {
export type SalesInvoiceItemOrderByWithRelationInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
productId?: Prisma.SortOrder
@@ -274,8 +274,8 @@ export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{
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
unitPrice?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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
@@ -286,8 +286,8 @@ export type SalesInvoiceItemWhereUniqueInput = Prisma.AtLeast<{
export type SalesInvoiceItemOrderByWithAggregationInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
productId?: Prisma.SortOrder
@@ -304,8 +304,8 @@ export type 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
unitPrice?: Prisma.DecimalWithAggregatesFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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
@@ -313,8 +313,8 @@ export type SalesInvoiceItemScalarWhereWithAggregatesInput = {
export type SalesInvoiceItemCreateInput = {
count: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
total: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
product: Prisma.ProductCreateNestedOneWithoutSalesInvoiceItemsInput
@@ -323,8 +323,8 @@ export type SalesInvoiceItemCreateInput = {
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
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string
invoiceId: number
productId: number
@@ -332,8 +332,8 @@ export type SalesInvoiceItemUncheckedCreateInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
product?: Prisma.ProductUpdateOneRequiredWithoutSalesInvoiceItemsNestedInput
@@ -342,8 +342,8 @@ export type SalesInvoiceItemUpdateInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number
productId?: Prisma.IntFieldUpdateOperationsInput | number
@@ -352,8 +352,8 @@ export type SalesInvoiceItemUncheckedUpdateInput = {
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
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string
invoiceId: number
productId: number
@@ -361,16 +361,16 @@ export type SalesInvoiceItemCreateManyInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number
productId?: Prisma.IntFieldUpdateOperationsInput | number
@@ -389,8 +389,8 @@ export type SalesInvoiceItemOrderByRelationAggregateInput = {
export type SalesInvoiceItemCountOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
productId?: Prisma.SortOrder
@@ -399,8 +399,8 @@ export type SalesInvoiceItemCountOrderByAggregateInput = {
export type SalesInvoiceItemAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
productId?: Prisma.SortOrder
}
@@ -408,8 +408,8 @@ export type SalesInvoiceItemAvgOrderByAggregateInput = {
export type SalesInvoiceItemMaxOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
productId?: Prisma.SortOrder
@@ -418,8 +418,8 @@ export type SalesInvoiceItemMaxOrderByAggregateInput = {
export type SalesInvoiceItemMinOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
createdAt?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
productId?: Prisma.SortOrder
@@ -428,54 +428,12 @@ export type SalesInvoiceItemMinOrderByAggregateInput = {
export type SalesInvoiceItemSumOrderByAggregateInput = {
id?: Prisma.SortOrder
count?: Prisma.SortOrder
fee?: Prisma.SortOrder
total?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalAmount?: Prisma.SortOrder
invoiceId?: Prisma.SortOrder
productId?: Prisma.SortOrder
}
export type SalesInvoiceItemCreateNestedManyWithoutInvoiceInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceItemCreateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput> | 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> | 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> | 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> | 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 SalesInvoiceItemCreateNestedManyWithoutProductInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceItemCreateWithoutProductInput, Prisma.SalesInvoiceItemUncheckedCreateWithoutProductInput> | Prisma.SalesInvoiceItemCreateWithoutProductInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutProductInput[]
connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutProductInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutProductInput[]
@@ -518,66 +476,52 @@ export type SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput = {
deleteMany?: Prisma.SalesInvoiceItemScalarWhereInput | Prisma.SalesInvoiceItemScalarWhereInput[]
}
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 SalesInvoiceItemCreateNestedManyWithoutInvoiceInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceItemCreateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput> | Prisma.SalesInvoiceItemCreateWithoutInvoiceInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput[]
connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput[]
createMany?: Prisma.SalesInvoiceItemCreateManyInvoiceInputEnvelope
connect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[]
}
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 SalesInvoiceItemUncheckedCreateNestedManyWithoutInvoiceInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceItemCreateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput> | Prisma.SalesInvoiceItemCreateWithoutInvoiceInput[] | Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput[]
connectOrCreate?: Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput | Prisma.SalesInvoiceItemCreateOrConnectWithoutInvoiceInput[]
createMany?: Prisma.SalesInvoiceItemCreateManyInvoiceInputEnvelope
connect?: Prisma.SalesInvoiceItemWhereUniqueInput | Prisma.SalesInvoiceItemWhereUniqueInput[]
}
export type SalesInvoiceItemCreateOrConnectWithoutInvoiceInput = {
where: Prisma.SalesInvoiceItemWhereUniqueInput
create: Prisma.XOR<Prisma.SalesInvoiceItemCreateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput>
export type SalesInvoiceItemUpdateManyWithoutInvoiceNestedInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceItemCreateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput> | 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 SalesInvoiceItemCreateManyInvoiceInputEnvelope = {
data: Prisma.SalesInvoiceItemCreateManyInvoiceInput | Prisma.SalesInvoiceItemCreateManyInvoiceInput[]
skipDuplicates?: boolean
}
export type SalesInvoiceItemUpsertWithWhereUniqueWithoutInvoiceInput = {
where: Prisma.SalesInvoiceItemWhereUniqueInput
update: Prisma.XOR<Prisma.SalesInvoiceItemUpdateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput>
create: Prisma.XOR<Prisma.SalesInvoiceItemCreateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput>
}
export type SalesInvoiceItemUpdateWithWhereUniqueWithoutInvoiceInput = {
where: Prisma.SalesInvoiceItemWhereUniqueInput
data: Prisma.XOR<Prisma.SalesInvoiceItemUpdateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput>
}
export type SalesInvoiceItemUpdateManyWithWhereWithoutInvoiceInput = {
where: Prisma.SalesInvoiceItemScalarWhereInput
data: Prisma.XOR<Prisma.SalesInvoiceItemUpdateManyMutationInput, Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput>
}
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 SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceNestedInput = {
create?: Prisma.XOR<Prisma.SalesInvoiceItemCreateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput> | 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
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string
invoice: Prisma.SalesInvoiceCreateNestedOneWithoutItemsInput
}
@@ -585,8 +529,8 @@ export type SalesInvoiceItemCreateWithoutProductInput = {
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
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string
invoiceId: number
}
@@ -617,54 +561,75 @@ export type SalesInvoiceItemUpdateManyWithWhereWithoutProductInput = {
data: Prisma.XOR<Prisma.SalesInvoiceItemUpdateManyMutationInput, Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductInput>
}
export type SalesInvoiceItemCreateManyInvoiceInput = {
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
unitPrice?: Prisma.DecimalFilter<"SalesInvoiceItem"> | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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 SalesInvoiceItemCreateOrConnectWithoutInvoiceInput = {
where: Prisma.SalesInvoiceItemWhereUniqueInput
create: Prisma.XOR<Prisma.SalesInvoiceItemCreateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput>
}
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 SalesInvoiceItemCreateManyInvoiceInputEnvelope = {
data: Prisma.SalesInvoiceItemCreateManyInvoiceInput | Prisma.SalesInvoiceItemCreateManyInvoiceInput[]
skipDuplicates?: boolean
}
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 SalesInvoiceItemUpsertWithWhereUniqueWithoutInvoiceInput = {
where: Prisma.SalesInvoiceItemWhereUniqueInput
update: Prisma.XOR<Prisma.SalesInvoiceItemUpdateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput>
create: Prisma.XOR<Prisma.SalesInvoiceItemCreateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedCreateWithoutInvoiceInput>
}
export type SalesInvoiceItemUpdateWithWhereUniqueWithoutInvoiceInput = {
where: Prisma.SalesInvoiceItemWhereUniqueInput
data: Prisma.XOR<Prisma.SalesInvoiceItemUpdateWithoutInvoiceInput, Prisma.SalesInvoiceItemUncheckedUpdateWithoutInvoiceInput>
}
export type SalesInvoiceItemUpdateManyWithWhereWithoutInvoiceInput = {
where: Prisma.SalesInvoiceItemScalarWhereInput
data: Prisma.XOR<Prisma.SalesInvoiceItemUpdateManyMutationInput, Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutInvoiceInput>
}
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
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoice?: Prisma.SalesInvoiceUpdateOneRequiredWithoutItemsNestedInput
}
@@ -672,8 +637,8 @@ export type SalesInvoiceItemUpdateWithoutProductInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
invoiceId?: Prisma.IntFieldUpdateOperationsInput | number
}
@@ -681,19 +646,54 @@ export type SalesInvoiceItemUncheckedUpdateWithoutProductInput = {
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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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
unitPrice?: runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Date | string
productId: number
}
export type SalesInvoiceItemUpdateWithoutInvoiceInput = {
count?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: 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
unitPrice?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
totalAmount?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
}
export type SalesInvoiceItemSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean
count?: boolean
fee?: boolean
total?: boolean
unitPrice?: boolean
totalAmount?: boolean
createdAt?: boolean
invoiceId?: boolean
productId?: boolean
@@ -706,14 +706,14 @@ export type SalesInvoiceItemSelect<ExtArgs extends runtime.Types.Extensions.Inte
export type SalesInvoiceItemSelectScalar = {
id?: boolean
count?: boolean
fee?: boolean
total?: boolean
unitPrice?: boolean
totalAmount?: boolean
createdAt?: boolean
invoiceId?: boolean
productId?: boolean
}
export type SalesInvoiceItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "count" | "fee" | "total" | "createdAt" | "invoiceId" | "productId", ExtArgs["result"]["salesInvoiceItem"]>
export type SalesInvoiceItemOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "count" | "unitPrice" | "totalAmount" | "createdAt" | "invoiceId" | "productId", ExtArgs["result"]["salesInvoiceItem"]>
export type SalesInvoiceItemInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
invoice?: boolean | Prisma.SalesInvoiceDefaultArgs<ExtArgs>
product?: boolean | Prisma.ProductDefaultArgs<ExtArgs>
@@ -728,8 +728,8 @@ export type $SalesInvoiceItemPayload<ExtArgs extends runtime.Types.Extensions.In
scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number
count: runtime.Decimal
fee: runtime.Decimal
total: runtime.Decimal
unitPrice: runtime.Decimal
totalAmount: runtime.Decimal
createdAt: Date
invoiceId: number
productId: number
@@ -1106,8 +1106,8 @@ export interface Prisma__SalesInvoiceItemClient<T, Null = never, ExtArgs extends
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 unitPrice: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
readonly totalAmount: Prisma.FieldRef<"SalesInvoiceItem", 'Decimal'>
readonly createdAt: Prisma.FieldRef<"SalesInvoiceItem", 'DateTime'>
readonly invoiceId: Prisma.FieldRef<"SalesInvoiceItem", 'Int'>
readonly productId: Prisma.FieldRef<"SalesInvoiceItem", 'Int'>
File diff suppressed because it is too large Load Diff
+64 -64
View File
@@ -29,7 +29,7 @@ export type AggregateStockMovement = {
export type StockMovementAvgAggregateOutputType = {
id: number | null
quantity: runtime.Decimal | null
fee: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalCost: runtime.Decimal | null
productId: number | null
inventoryId: number | null
@@ -43,7 +43,7 @@ export type StockMovementAvgAggregateOutputType = {
export type StockMovementSumAggregateOutputType = {
id: number | null
quantity: runtime.Decimal | null
fee: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalCost: runtime.Decimal | null
productId: number | null
inventoryId: number | null
@@ -58,7 +58,7 @@ export type StockMovementMinAggregateOutputType = {
id: number | null
type: $Enums.MovementType | null
quantity: runtime.Decimal | null
fee: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalCost: runtime.Decimal | null
referenceType: $Enums.MovementReferenceType | null
referenceId: string | null
@@ -76,7 +76,7 @@ export type StockMovementMaxAggregateOutputType = {
id: number | null
type: $Enums.MovementType | null
quantity: runtime.Decimal | null
fee: runtime.Decimal | null
unitPrice: runtime.Decimal | null
totalCost: runtime.Decimal | null
referenceType: $Enums.MovementReferenceType | null
referenceId: string | null
@@ -94,7 +94,7 @@ export type StockMovementCountAggregateOutputType = {
id: number
type: number
quantity: number
fee: number
unitPrice: number
totalCost: number
referenceType: number
referenceId: number
@@ -113,7 +113,7 @@ export type StockMovementCountAggregateOutputType = {
export type StockMovementAvgAggregateInputType = {
id?: true
quantity?: true
fee?: true
unitPrice?: true
totalCost?: true
productId?: true
inventoryId?: true
@@ -127,7 +127,7 @@ export type StockMovementAvgAggregateInputType = {
export type StockMovementSumAggregateInputType = {
id?: true
quantity?: true
fee?: true
unitPrice?: true
totalCost?: true
productId?: true
inventoryId?: true
@@ -142,7 +142,7 @@ export type StockMovementMinAggregateInputType = {
id?: true
type?: true
quantity?: true
fee?: true
unitPrice?: true
totalCost?: true
referenceType?: true
referenceId?: true
@@ -160,7 +160,7 @@ export type StockMovementMaxAggregateInputType = {
id?: true
type?: true
quantity?: true
fee?: true
unitPrice?: true
totalCost?: true
referenceType?: true
referenceId?: true
@@ -178,7 +178,7 @@ export type StockMovementCountAggregateInputType = {
id?: true
type?: true
quantity?: true
fee?: true
unitPrice?: true
totalCost?: true
referenceType?: true
referenceId?: true
@@ -283,7 +283,7 @@ export type StockMovementGroupByOutputType = {
id: number
type: $Enums.MovementType
quantity: runtime.Decimal
fee: runtime.Decimal
unitPrice: runtime.Decimal
totalCost: runtime.Decimal
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -324,7 +324,7 @@ export type 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
unitPrice?: 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
@@ -347,7 +347,7 @@ export type StockMovementOrderByWithRelationInput = {
id?: Prisma.SortOrder
type?: Prisma.SortOrder
quantity?: Prisma.SortOrder
fee?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalCost?: Prisma.SortOrder
referenceType?: Prisma.SortOrder
referenceId?: Prisma.SortOrder
@@ -374,7 +374,7 @@ export type StockMovementWhereUniqueInput = Prisma.AtLeast<{
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
unitPrice?: 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
@@ -397,7 +397,7 @@ export type StockMovementOrderByWithAggregationInput = {
id?: Prisma.SortOrder
type?: Prisma.SortOrder
quantity?: Prisma.SortOrder
fee?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalCost?: Prisma.SortOrder
referenceType?: Prisma.SortOrder
referenceId?: Prisma.SortOrder
@@ -423,7 +423,7 @@ export type 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
unitPrice?: 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
@@ -440,7 +440,7 @@ export type StockMovementScalarWhereWithAggregatesInput = {
export type StockMovementCreateInput = {
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -458,7 +458,7 @@ export type StockMovementUncheckedCreateInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -475,7 +475,7 @@ export type StockMovementUncheckedCreateInput = {
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
unitPrice?: 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
@@ -493,7 +493,7 @@ 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
unitPrice?: 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
@@ -511,7 +511,7 @@ export type StockMovementCreateManyInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -528,7 +528,7 @@ export type StockMovementCreateManyInput = {
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
unitPrice?: 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
@@ -541,7 +541,7 @@ 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
unitPrice?: 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
@@ -575,7 +575,7 @@ export type StockMovementCountOrderByAggregateInput = {
id?: Prisma.SortOrder
type?: Prisma.SortOrder
quantity?: Prisma.SortOrder
fee?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalCost?: Prisma.SortOrder
referenceType?: Prisma.SortOrder
referenceId?: Prisma.SortOrder
@@ -592,7 +592,7 @@ export type StockMovementCountOrderByAggregateInput = {
export type StockMovementAvgOrderByAggregateInput = {
id?: Prisma.SortOrder
quantity?: Prisma.SortOrder
fee?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalCost?: Prisma.SortOrder
productId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
@@ -607,7 +607,7 @@ export type StockMovementMaxOrderByAggregateInput = {
id?: Prisma.SortOrder
type?: Prisma.SortOrder
quantity?: Prisma.SortOrder
fee?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalCost?: Prisma.SortOrder
referenceType?: Prisma.SortOrder
referenceId?: Prisma.SortOrder
@@ -625,7 +625,7 @@ export type StockMovementMinOrderByAggregateInput = {
id?: Prisma.SortOrder
type?: Prisma.SortOrder
quantity?: Prisma.SortOrder
fee?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalCost?: Prisma.SortOrder
referenceType?: Prisma.SortOrder
referenceId?: Prisma.SortOrder
@@ -642,7 +642,7 @@ export type StockMovementMinOrderByAggregateInput = {
export type StockMovementSumOrderByAggregateInput = {
id?: Prisma.SortOrder
quantity?: Prisma.SortOrder
fee?: Prisma.SortOrder
unitPrice?: Prisma.SortOrder
totalCost?: Prisma.SortOrder
productId?: Prisma.SortOrder
inventoryId?: Prisma.SortOrder
@@ -874,7 +874,7 @@ export type StockMovementUncheckedUpdateManyWithoutSupplierNestedInput = {
export type StockMovementCreateWithoutCounterInventoryInput = {
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -891,7 +891,7 @@ export type StockMovementUncheckedCreateWithoutCounterInventoryInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -917,7 +917,7 @@ export type StockMovementCreateManyCounterInventoryInputEnvelope = {
export type StockMovementCreateWithoutInventoryInput = {
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -934,7 +934,7 @@ export type StockMovementUncheckedCreateWithoutInventoryInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -980,7 +980,7 @@ export type 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
unitPrice?: 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
@@ -1013,7 +1013,7 @@ export type StockMovementUpdateManyWithWhereWithoutInventoryInput = {
export type StockMovementCreateWithoutCustomerInput = {
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1030,7 +1030,7 @@ export type StockMovementUncheckedCreateWithoutCustomerInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1072,7 +1072,7 @@ export type StockMovementUpdateManyWithWhereWithoutCustomerInput = {
export type StockMovementCreateWithoutProductInput = {
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1089,7 +1089,7 @@ export type StockMovementUncheckedCreateWithoutProductInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1131,7 +1131,7 @@ export type StockMovementUpdateManyWithWhereWithoutProductInput = {
export type StockMovementCreateWithoutSupplierInput = {
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1148,7 +1148,7 @@ export type StockMovementUncheckedCreateWithoutSupplierInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1191,7 +1191,7 @@ export type StockMovementCreateManyCounterInventoryInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1208,7 +1208,7 @@ export type StockMovementCreateManyInventoryInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1224,7 +1224,7 @@ export type StockMovementCreateManyInventoryInput = {
export type StockMovementUpdateWithoutCounterInventoryInput = {
type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: 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
@@ -1241,7 +1241,7 @@ export type StockMovementUncheckedUpdateWithoutCounterInventoryInput = {
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
unitPrice?: 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
@@ -1258,7 +1258,7 @@ export type StockMovementUncheckedUpdateManyWithoutCounterInventoryInput = {
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
unitPrice?: 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
@@ -1274,7 +1274,7 @@ export type StockMovementUncheckedUpdateManyWithoutCounterInventoryInput = {
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
unitPrice?: 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
@@ -1291,7 +1291,7 @@ 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
unitPrice?: 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
@@ -1308,7 +1308,7 @@ 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
unitPrice?: 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
@@ -1325,7 +1325,7 @@ export type StockMovementCreateManyCustomerInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1341,7 +1341,7 @@ export type StockMovementCreateManyCustomerInput = {
export type StockMovementUpdateWithoutCustomerInput = {
type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: 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
@@ -1358,7 +1358,7 @@ export type StockMovementUncheckedUpdateWithoutCustomerInput = {
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
unitPrice?: 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
@@ -1375,7 +1375,7 @@ export type StockMovementUncheckedUpdateManyWithoutCustomerInput = {
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
unitPrice?: 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
@@ -1392,7 +1392,7 @@ export type StockMovementCreateManyProductInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1408,7 +1408,7 @@ export type StockMovementCreateManyProductInput = {
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
unitPrice?: 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
@@ -1425,7 +1425,7 @@ 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
unitPrice?: 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
@@ -1442,7 +1442,7 @@ 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
unitPrice?: 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
@@ -1459,7 +1459,7 @@ export type StockMovementCreateManySupplierInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1475,7 +1475,7 @@ export type StockMovementCreateManySupplierInput = {
export type StockMovementUpdateWithoutSupplierInput = {
type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: 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
@@ -1492,7 +1492,7 @@ export type StockMovementUncheckedUpdateWithoutSupplierInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: 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
@@ -1509,7 +1509,7 @@ export type StockMovementUncheckedUpdateManyWithoutSupplierInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
unitPrice?: 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
@@ -1528,7 +1528,7 @@ export type StockMovementSelect<ExtArgs extends runtime.Types.Extensions.Interna
id?: boolean
type?: boolean
quantity?: boolean
fee?: boolean
unitPrice?: boolean
totalCost?: boolean
referenceType?: boolean
referenceId?: boolean
@@ -1553,7 +1553,7 @@ export type StockMovementSelectScalar = {
id?: boolean
type?: boolean
quantity?: boolean
fee?: boolean
unitPrice?: boolean
totalCost?: boolean
referenceType?: boolean
referenceId?: boolean
@@ -1567,7 +1567,7 @@ export type StockMovementSelectScalar = {
customerId?: boolean
}
export type StockMovementOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "type" | "quantity" | "fee" | "totalCost" | "referenceType" | "referenceId" | "createdAt" | "productId" | "inventoryId" | "avgCost" | "supplierId" | "remainedInStock" | "counterInventoryId" | "customerId", ExtArgs["result"]["stockMovement"]>
export type StockMovementOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "type" | "quantity" | "unitPrice" | "totalCost" | "referenceType" | "referenceId" | "createdAt" | "productId" | "inventoryId" | "avgCost" | "supplierId" | "remainedInStock" | "counterInventoryId" | "customerId", ExtArgs["result"]["stockMovement"]>
export type StockMovementInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
counterInventory?: boolean | Prisma.StockMovement$counterInventoryArgs<ExtArgs>
customer?: boolean | Prisma.StockMovement$customerArgs<ExtArgs>
@@ -1589,7 +1589,7 @@ export type $StockMovementPayload<ExtArgs extends runtime.Types.Extensions.Inter
id: number
type: $Enums.MovementType
quantity: runtime.Decimal
fee: runtime.Decimal
unitPrice: runtime.Decimal
totalCost: runtime.Decimal
referenceType: $Enums.MovementReferenceType
referenceId: string
@@ -1978,7 +1978,7 @@ 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 unitPrice: Prisma.FieldRef<"StockMovement", 'Decimal'>
readonly totalCost: Prisma.FieldRef<"StockMovement", 'Decimal'>
readonly referenceType: Prisma.FieldRef<"StockMovement", 'MovementReferenceType'>
readonly referenceId: Prisma.FieldRef<"StockMovement", 'String'>
File diff suppressed because it is too large Load Diff
@@ -92,13 +92,13 @@ export class InventoriesService {
console.log(movements)
const mapped = movements.map(movement => {
const { id, quantity, fee, totalCost, avgCost, product } = movement
const { id, quantity, unitPrice, totalCost, avgCost, product } = movement
if (info === null) {
info = {
date: movement.createdAt,
type: movement.type,
quantity: Number(movement.quantity),
fee: Number(movement.fee),
unitPrice: Number(movement.unitPrice),
totalCost: Number(movement.totalCost),
referenceType: movement.referenceType,
referenceId: movement.referenceId,
@@ -107,13 +107,13 @@ export class InventoriesService {
}
} else {
info.quantity += Number(movement.quantity)
info.fee += Number(movement.fee)
info.unitPrice += Number(movement.unitPrice)
info.totalCost += Number(movement.totalCost)
}
return {
id,
quantity: Number(quantity),
fee: Number(fee),
unitPrice: Number(unitPrice),
totalCost: Number(totalCost),
avgCost: Number(avgCost),
product,
+1 -1
View File
@@ -33,5 +33,5 @@ export class CreateOrderItemDto {
@ApiProperty()
@IsNumber()
@Type(() => Number)
fee: number
unitPrice: number
}
+6 -3
View File
@@ -170,7 +170,10 @@ export class PosService {
const newCode = String(Number(lastCode) + 1)
const totalAmount = data.items.reduce((acc, item) => acc + item.count * item.fee, 0)
const totalAmount = data.items.reduce(
(acc, item) => acc + item.count * item.unitPrice,
0,
)
const preparedOrder: SalesInvoiceCreateInput = {
...res,
@@ -182,8 +185,8 @@ export class PosService {
create: items.map(item => ({
product: { connect: { id: Number(item.productId) } },
count: item.count,
fee: item.fee,
total: item.count * item.fee,
unitPrice: item.unitPrice,
total: item.count * item.unitPrice,
})),
},
}
@@ -0,0 +1,17 @@
SELECT p.id
FROM Products p
WHERE (
SELECT COALESCE(SUM(sb.quantity), 0)
FROM Stock_Balance sb
WHERE
sb.productId = p.id
) < p.minimumStockAlertLevel
ORDER BY (
p.minimumStockAlertLevel - (
SELECT COALESCE(SUM(sb.quantity), 0)
FROM Stock_Balance sb
WHERE
sb.productId = p.id
)
) DESC
LIMIT 10
@@ -0,0 +1,27 @@
import { Controller, Get } from '@nestjs/common'
import { StatisticsService } from './statistics.service'
@Controller('statistics')
export class StatisticsController {
constructor(private readonly statisticsService: StatisticsService) {}
@Get('top-last-sales')
getTopLastSales() {
return this.statisticsService.getTopLastSales()
}
@Get('top-alert-stocks')
getTopAlertStocks() {
return this.statisticsService.getTopAlertStocks()
}
@Get('top-supplier-debts')
getTopSupplierDebts() {
return this.statisticsService.getTopSupplierDebts()
}
@Get('top-sales')
getTopSellProducts() {
return this.statisticsService.getTopSellProducts()
}
}
@@ -0,0 +1,10 @@
import { Module } from '@nestjs/common'
import { PrismaService } from '../../prisma/prisma.service'
import { StatisticsController } from './statistics.controller'
import { StatisticsService } from './statistics.service'
@Module({
controllers: [StatisticsController],
providers: [StatisticsService, PrismaService],
})
export class StatisticsModule {}
@@ -0,0 +1,184 @@
import { Injectable } from '@nestjs/common'
import * as fs from 'fs'
import * as path from 'path'
import { ResponseMapper } from '../../common/response/response-mapper'
import { PrismaService } from '../../prisma/prisma.service'
@Injectable()
export class StatisticsService {
constructor(private prisma: PrismaService) {}
private readSqlFile(filename: string): string {
const filePath = path.join(__dirname, 'queries', filename)
return fs.readFileSync(filePath, 'utf8')
}
async getTopLastSales() {
const sales = await this.prisma.salesInvoice.findMany({
take: 10,
orderBy: { createdAt: 'desc' },
include: {
customer: { select: { id: true, firstName: true, lastName: true } },
posAccount: { select: { id: true, name: true } },
items: {
include: {
product: { select: { id: true, name: true } },
},
},
},
})
const mapped = sales.map(sale => ({
...sale,
totalAmount: Number(sale.totalAmount),
itemsCount: sale.items.length,
}))
return ResponseMapper.list(mapped)
}
async getTopAlertStocks() {
const productIds = await this.prisma.$queryRaw<{ id: number }[]>`
SELECT p.id
FROM Products p
WHERE (SELECT COALESCE(SUM(sb.quantity), 0) FROM Stock_Balance sb WHERE sb.productId = p.id) < p.minimumStockAlertLevel
-- ORDER BY (p.minimumStockAlertLevel - (SELECT COALESCE(SUM(sb.quantity), 0) FROM stock_balance sb WHERE sb.productId = p.id)) DESC
LIMIT 10
`
const ids = productIds.map(p => p.id)
if (ids.length === 0) {
return ResponseMapper.list([])
}
const products = await this.prisma.product.findMany({
where: { id: { in: ids } },
select: {
id: true,
name: true,
sku: true,
minimumStockAlertLevel: true,
stockBalances: {
select: {
quantity: true,
inventory: { select: { id: true, name: true } },
},
},
category: { select: { id: true, name: true } },
brand: { select: { id: true, name: true } },
},
})
const mappedData = products.map(product => ({
...product,
stock: product.stockBalances.reduce((acc, sb) => acc + Number(sb.quantity), 0),
deficit:
Number(product.minimumStockAlertLevel) -
product.stockBalances.reduce((acc, sb) => acc + Number(sb.quantity), 0),
}))
return ResponseMapper.list(mappedData)
}
async getTopSupplierDebts() {
// Get unpaid receipts
const receipts = await this.prisma.purchaseReceipt.findMany({
where: {
status: { not: 'PAID' },
},
select: {
id: true,
totalAmount: true,
paidAmount: true,
supplierId: true,
},
})
const debtMap = new Map<
number,
{ supplierId: number; totalDebt: number; unpaidReceipts: number }
>()
for (const receipt of receipts) {
const debt = Number(receipt.totalAmount) - Number(receipt.paidAmount)
if (debt > 0) {
const existing = debtMap.get(receipt.supplierId)
if (existing) {
existing.totalDebt += debt
existing.unpaidReceipts += 1
} else {
debtMap.set(receipt.supplierId, {
supplierId: receipt.supplierId,
totalDebt: debt,
unpaidReceipts: 1,
})
}
}
}
const supplierIds = Array.from(debtMap.keys())
const suppliers = await this.prisma.supplier.findMany({
where: { id: { in: supplierIds } },
select: { id: true, firstName: true, lastName: true },
})
const supplierMap = new Map(
suppliers.map(s => [s.id, `${s.firstName} ${s.lastName}`.trim()]),
)
const mapped = Array.from(debtMap.values())
.map(item => ({
id: item.supplierId,
name: supplierMap.get(item.supplierId) || 'Unknown',
totalDebt: item.totalDebt,
unpaidReceipts: item.unpaidReceipts,
}))
.sort((a, b) => b.totalDebt - a.totalDebt)
.slice(0, 10)
return ResponseMapper.list(mapped)
}
async getTopSellProducts() {
const productData = await this.prisma.$queryRaw<any[]>`
SELECT p.id, p.name, p.sku, COALESCE(SUM(sii.count), 0) as totalSold
FROM Products p
LEFT JOIN Sales_Invoice_Items sii ON p.id = sii.productId
GROUP BY p.id
HAVING totalSold > 0
ORDER BY totalSold DESC
LIMIT 10
`
const ids = productData.map(p => p.id)
if (ids.length === 0) {
return ResponseMapper.list([])
}
const products = await this.prisma.product.findMany({
where: { id: { in: ids } },
select: {
id: true,
category: { select: { id: true, name: true } },
brand: { select: { id: true, name: true } },
},
})
const productMap = new Map(
products.map(p => [p.id, { category: p.category, brand: p.brand }]),
)
const mapped = productData.map(product => ({
id: product.id,
name: product.name,
sku: product.sku,
totalSold: Number(product.totalSold),
category: productMap.get(product.id)?.category,
brand: productMap.get(product.id)?.brand,
}))
return ResponseMapper.list(mapped)
}
}
@@ -23,8 +23,8 @@ export class SupplierInvoicesService {
select: {
id: true,
count: true,
fee: true,
total: true,
unitPrice: true,
totalAmount: true,
product: {
select: {
id: true,
@@ -149,6 +149,8 @@ export class SupplierInvoicesService {
async createPayment(invoiceId: number, data: CreateReceiptPaymentDto) {
const { bankAccountId, ...rest } = data
console.log(data)
const payment = await this.prisma.purchaseReceiptPayments.create({
data: {
...rest,
@@ -10,12 +10,12 @@ export class CreatePurchaseReceiptItemDto {
@Type(() => Number)
@IsNumber()
@Min(0)
fee: number
unitPrice: number
@Type(() => Number)
@IsNumber()
@Min(0)
total: number
totalAmount: number
@Type(() => Number)
@IsNotEmpty()
@@ -10,7 +10,7 @@ export class UpdatePurchaseReceiptItemDto {
@IsOptional()
@Type(() => Number)
@IsNumber()
fee?: number
unitPrice?: number
@IsOptional()
@Type(() => Number)
@@ -17,7 +17,7 @@ export class PurchaseReceiptItemsService {
payload.receipt = { connect: { id: Number(payload.receiptId) } }
delete payload.receiptId
}
payload.fee = String(payload.fee)
payload.unitPrice = String(payload.unitPrice)
payload.count = String(payload.count)
payload.total = String(payload.total)
const item = await this.prisma.purchaseReceiptItem.create({ data: payload })
@@ -21,8 +21,8 @@ export class PurchaseReceiptsService {
create: dto.items.map((item, idx) => {
const mapped = {
count: new Prisma.Decimal(item.count ?? 0),
fee: new Prisma.Decimal(item.fee ?? 0),
total: new Prisma.Decimal(item.total ?? 0),
unitPrice: new Prisma.Decimal(item.unitPrice ?? 0),
totalAmount: new Prisma.Decimal(item.totalAmount ?? 0),
description: item.description ?? null,
product: { connect: { id: item.productId } },
}
@@ -34,6 +34,10 @@ export class PurchaseReceiptsService {
const item = await this.prisma.purchaseReceipt.create({
data,
include: { items: true },
omit: {
supplierId: true,
inventoryId: true,
},
})
return ResponseMapper.create(item)
}
@@ -8,7 +8,7 @@ export class CreateSalesInvoiceItemDto {
@Type(() => Number)
@IsNumber()
fee: number
unitPrice: number
@Type(() => Number)
@IsNumber()
@@ -10,7 +10,7 @@ export class UpdateSalesInvoiceItemDto {
@IsOptional()
@Type(() => Number)
@IsNumber()
fee?: number
unitPrice?: number
@IsOptional()
@Type(() => Number)
@@ -12,7 +12,7 @@ export class CreateStockMovementDto {
@Type(() => Number)
@IsNumber()
fee: number
unitPrice: number
@Type(() => Number)
@IsNumber()