feat(cardex): enhance stock movement retrieval with additional fields and optimized mapping

refactor(migration): update Stock_Movements table to include counterInventoryId and customerId, add foreign key constraints, and implement triggers for inventory management
This commit is contained in:
2025-12-23 20:35:44 +03:30
parent c6a86719dd
commit 89c57a69c1
10 changed files with 1366 additions and 143 deletions
@@ -0,0 +1,357 @@
-- AlterTable
ALTER TABLE `Stock_Movements`
ADD COLUMN `counterInventoryId` INTEGER NULL,
ADD COLUMN `customerId` INTEGER NULL;
-- AddForeignKey
ALTER TABLE `Stock_Movements`
ADD CONSTRAINT `Stock_Movements_customerId_fkey` FOREIGN KEY (`customerId`) REFERENCES `Customers` (`id`) ON DELETE SET NULL 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;
-- ------------------------------------------
-- 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;
+6
View File
@@ -156,6 +156,7 @@ model Customer {
salesInvoices SalesInvoice[] @relation("Customer_Sales_Invoices") salesInvoices SalesInvoice[] @relation("Customer_Sales_Invoices")
@@map("Customers") @@map("Customers")
stockMovements StockMovement[] @relation("StockMovement_Customer")
} }
model Inventory { model Inventory {
@@ -173,6 +174,7 @@ model Inventory {
purchaseReceipts PurchaseReceipt[] purchaseReceipts PurchaseReceipt[]
stockAdjustments StockAdjustment[] @relation("Inventory_Stock_Adjustments") stockAdjustments StockAdjustment[] @relation("Inventory_Stock_Adjustments")
stockMovements StockMovement[] @relation("StockMovement_Inventory") stockMovements StockMovement[] @relation("StockMovement_Inventory")
counterStockMovements StockMovement[] @relation("StockMovement_CounterInventory")
stockBalances StockBalance[] @relation("StockBalance_inventory") stockBalances StockBalance[] @relation("StockBalance_inventory")
salesInvoices SalesInvoice[] @relation("Inventory_SalesInvoices") salesInvoices SalesInvoice[] @relation("Inventory_SalesInvoices")
@@ -317,6 +319,10 @@ model StockMovement {
product Product @relation("StockMovement_Product", fields: [productId], references: [id]) product Product @relation("StockMovement_Product", fields: [productId], references: [id])
supplierId Int? supplierId Int?
supplier Supplier? @relation("StockMovement_Supplier", fields: [supplierId], references: [id]) supplier Supplier? @relation("StockMovement_Supplier", fields: [supplierId], references: [id])
customerId Int?
customer Customer? @relation("StockMovement_Customer", fields: [customerId], references: [id])
counterInventoryId Int?
counterInventory Inventory? @relation("StockMovement_CounterInventory", fields: [counterInventoryId], references: [id])
@@index([inventoryId], map: "Stock_Movements_inventoryId_fkey") @@index([inventoryId], map: "Stock_Movements_inventoryId_fkey")
@@index([productId], map: "Stock_Movements_productId_fkey") @@index([productId], map: "Stock_Movements_productId_fkey")
+67 -38
View File
@@ -1,5 +1,5 @@
-- AUTO-GENERATED MYSQL TRIGGER DUMP -- AUTO-GENERATED MYSQL TRIGGER DUMP
-- Generated at: 2025-12-21T08:07:11.406Z -- Generated at: 2025-12-22T15:32:20.184Z
-- ------------------------------------------ -- ------------------------------------------
-- Trigger: trg_transfer_item_after_insert -- Trigger: trg_transfer_item_after_insert
@@ -7,8 +7,8 @@
-- Table: Inventory_Transfer_Items -- Table: Inventory_Transfer_Items
-- ------------------------------------------ -- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_transfer_item_after_insert`; 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
CREATE DEFINER=`pos`@`%` TRIGGER `trg_transfer_item_after_insert` AFTER INSERT ON `Inventory_Transfer_Items` FOR EACH ROW begin
DECLARE fromInv INT; DECLARE fromInv INT;
DECLARE toInv INT; DECLARE toInv INT;
@@ -28,15 +28,15 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_transfer_item_after_insert` AFTER INSERT O
-- OUT from source -- OUT from source
INSERT INTO Stock_Movements INSERT INTO Stock_Movements
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, createdAt, remainedInStock) (type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, cuonterInventoryId, createdAt, remainedInStock)
VALUES VALUES
('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, NOW(), latestQuantityInOrigin-NEW.count); ('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, toInv, NOW(), latestQuantityInOrigin-NEW.count);
-- IN to destination -- IN to destination
INSERT INTO Stock_Movements INSERT INTO Stock_Movements
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, createdAt, remainedInStock) (type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, cuonterInventoryId, createdAt, remainedInStock)
VALUES VALUES
('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, NOW(), latestQuantityInOrigin-NEW.count); ('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, fromInv, NOW(), latestQuantityInOrigin-NEW.count);
end; end;
-- ------------------------------------------ -- ------------------------------------------
@@ -45,8 +45,9 @@ end;
-- Table: Purchase_Receipt_Items -- Table: Purchase_Receipt_Items
-- ------------------------------------------ -- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_insert`; DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_insert` AFTER INSERT ON `Purchase_Receipt_Items` FOR EACH ROW BEGIN
DECLARE latestQuantity DECIMAL(10,2) DEFAULT 0; CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_insert` AFTER INSERT ON `Purchase_Receipt_Items` FOR EACH ROW BEGIN DECLARE latestQuantity DECIMAL(10, 2) DEFAULT 0;
DECLARE invId INT; DECLARE invId INT;
DECLARE suppId INT; DECLARE suppId INT;
@@ -91,11 +92,14 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_insert` AFTER
CASE CASE
WHEN NEW.count = 0 THEN 0 WHEN NEW.count = 0 THEN 0
ELSE NEW.total / NEW.count ELSE NEW.total / NEW.count
END, END
,
suppId, suppId,
latestQuantity + NEW.count, latestQuantity + NEW.count,
NOW() NOW()
); );
END; END;
-- ------------------------------------------ -- ------------------------------------------
@@ -104,8 +108,9 @@ END;
-- Table: Sales_Invoice_Items -- Table: Sales_Invoice_Items
-- ------------------------------------------ -- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_before_insert`; 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); 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; DECLARE inventory_id INT;
@@ -133,12 +138,14 @@ end;
-- Table: Sales_Invoice_Items -- Table: Sales_Invoice_Items
-- ------------------------------------------ -- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_after_insert`; 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); 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 inventory_id INT;
DECLARE customer_id INT;
SELECT inventoryId INTO inventory_id SELECT inventoryId , customerId INTO inventory_id, customer_id
FROM Sales_Invoices si FROM Sales_Invoices si
WHERE si.id = NEW.invoiceId WHERE si.id = NEW.invoiceId
LIMIT 1; LIMIT 1;
@@ -161,6 +168,7 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_after_insert` AFTER IN
inventoryId, inventoryId,
avgCost, avgCost,
remainedInStock, remainedInStock,
customerId,
createdAt createdAt
) )
VALUES ( VALUES (
@@ -172,14 +180,18 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_after_insert` AFTER IN
NEW.invoiceId, NEW.invoiceId,
NEW.productId, NEW.productId,
inventory_id, inventory_id,
CASE CASE
WHEN NEW.count = 0 THEN 0 WHEN NEW.count = 0 THEN 0
ELSE NEW.total / NEW.count ELSE NEW.total / NEW.count
END, END,
current_stock + NEW.count, current_stock + NEW.count,
customer_id,
NOW() NOW()
); );
end;
END;
-- ------------------------------------------ -- ------------------------------------------
-- Trigger: trg_stock_transfer -- Trigger: trg_stock_transfer
@@ -187,12 +199,10 @@ end;
-- Table: Stock_Movements -- Table: Stock_Movements
-- ------------------------------------------ -- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_transfer`; DROP TRIGGER IF EXISTS `trg_stock_transfer`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_transfer` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN
IF NEW.referenceType = 'INVENTORY_TRANSFER' THEN CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_transfer` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN IF NEW.referenceType = 'INVENTORY_TRANSFER' THEN IF NEW.type = 'IN' THEN
INSERT INTO
IF NEW.type = 'IN' THEN Stock_Balance (
INSERT INTO Stock_Balance (
productId, productId,
inventoryId, inventoryId,
quantity, quantity,
@@ -219,29 +229,29 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_transfer` AFTER INSERT ON `Stock_Mov
ELSE (totalCost + NEW.totalCost) / (quantity + NEW.quantity) ELSE (totalCost + NEW.totalCost) / (quantity + NEW.quantity)
END, END,
updatedAt = NOW(); updatedAt = NOW();
END IF; END IF;
IF NEW.type = 'OUT' THEN IF EXISTS (
IF NEW.type = 'OUT' THEN SELECT 1
FROM Stock_Balance sb
WHERE
IF EXISTS( sb.productId = NEW.productId
SELECT 1 FROM Stock_Balance sb
WHERE sb.productId = NEW.productId
AND sb.inventoryId = NEW.inventoryId AND sb.inventoryId = NEW.inventoryId
) THEN ) THEN
UPDATE Stock_Balance sb UPDATE Stock_Balance sb
SET SET
sb.quantity = sb.quantity - NEW.quantity, sb.quantity = sb.quantity - NEW.quantity,
sb.totalCost = sb.totalCost - (sb.avgCost * NEW.quantity), sb.totalCost = sb.totalCost - (sb.avgCost * NEW.quantity),
sb.updatedAt = NOW() sb.updatedAt = NOW()
WHERE sb.productId = NEW.productId WHERE
sb.productId = NEW.productId
AND sb.inventoryId = NEW.inventoryId; AND sb.inventoryId = NEW.inventoryId;
ELSE ELSE
INSERT INTO Stock_Balance ( INSERT INTO
Stock_Balance (
productId, productId,
inventoryId, inventoryId,
quantity, quantity,
@@ -257,11 +267,13 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_transfer` AFTER INSERT ON `Stock_Mov
COALESCE(NEW.fee, 0), COALESCE(NEW.fee, 0),
NOW() NOW()
); );
END IF;
END IF; END IF;
END IF; END IF;
END IF;
END; END;
-- ------------------------------------------ -- ------------------------------------------
@@ -270,10 +282,18 @@ END;
-- Table: Stock_Movements -- Table: Stock_Movements
-- ------------------------------------------ -- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_purchase_insert`; 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, inventoryId, updatedAt) 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,
inventoryId,
updatedAt
)
VALUES ( VALUES (
NEW.productId, NEW.productId,
NEW.quantity, NEW.quantity,
@@ -288,6 +308,7 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_insert` AFTER INSERT ON `St
avgCost = totalCost / quantity; avgCost = totalCost / quantity;
END IF; END IF;
END; END;
-- ------------------------------------------ -- ------------------------------------------
@@ -296,10 +317,18 @@ END;
-- Table: Stock_Movements -- Table: Stock_Movements
-- ------------------------------------------ -- ------------------------------------------
DROP TRIGGER IF EXISTS `trg_stock_sale_insert`; DROP TRIGGER IF EXISTS `trg_stock_sale_insert`;
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN
IF NEW.referenceType = 'SALES' THEN
INSERT INTO Stock_Balance (productId, quantity, avgCost, totalCost, inventoryId, updatedAt) CREATE DEFINER=`pos`@`%` 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 ( VALUES (
NEW.productId, NEW.productId,
NEW.quantity, NEW.quantity,
@@ -314,5 +343,5 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_insert` AFTER INSERT ON `Stock_
avgCost = totalCost / quantity; avgCost = totalCost / quantity;
END IF; END IF;
END;
END;
File diff suppressed because one or more lines are too long
@@ -2403,7 +2403,9 @@ export const StockMovementScalarFieldEnum = {
inventoryId: 'inventoryId', inventoryId: 'inventoryId',
avgCost: 'avgCost', avgCost: 'avgCost',
remainedInStock: 'remainedInStock', remainedInStock: 'remainedInStock',
supplierId: 'supplierId' supplierId: 'supplierId',
customerId: 'customerId',
counterInventoryId: 'counterInventoryId'
} as const } as const
export type StockMovementScalarFieldEnum = (typeof StockMovementScalarFieldEnum)[keyof typeof StockMovementScalarFieldEnum] export type StockMovementScalarFieldEnum = (typeof StockMovementScalarFieldEnum)[keyof typeof StockMovementScalarFieldEnum]
@@ -356,7 +356,9 @@ export const StockMovementScalarFieldEnum = {
inventoryId: 'inventoryId', inventoryId: 'inventoryId',
avgCost: 'avgCost', avgCost: 'avgCost',
remainedInStock: 'remainedInStock', remainedInStock: 'remainedInStock',
supplierId: 'supplierId' supplierId: 'supplierId',
customerId: 'customerId',
counterInventoryId: 'counterInventoryId'
} as const } as const
export type StockMovementScalarFieldEnum = (typeof StockMovementScalarFieldEnum)[keyof typeof StockMovementScalarFieldEnum] export type StockMovementScalarFieldEnum = (typeof StockMovementScalarFieldEnum)[keyof typeof StockMovementScalarFieldEnum]
+154
View File
@@ -282,6 +282,7 @@ export type CustomerWhereInput = {
deletedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null deletedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null
orders?: Prisma.OrderListRelationFilter orders?: Prisma.OrderListRelationFilter
salesInvoices?: Prisma.SalesInvoiceListRelationFilter salesInvoices?: Prisma.SalesInvoiceListRelationFilter
stockMovements?: Prisma.StockMovementListRelationFilter
} }
export type CustomerOrderByWithRelationInput = { export type CustomerOrderByWithRelationInput = {
@@ -300,6 +301,7 @@ export type CustomerOrderByWithRelationInput = {
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder
orders?: Prisma.OrderOrderByRelationAggregateInput orders?: Prisma.OrderOrderByRelationAggregateInput
salesInvoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput salesInvoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput
stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
_relevance?: Prisma.CustomerOrderByRelevanceInput _relevance?: Prisma.CustomerOrderByRelevanceInput
} }
@@ -322,6 +324,7 @@ export type CustomerWhereUniqueInput = Prisma.AtLeast<{
deletedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null deletedAt?: Prisma.DateTimeNullableFilter<"Customer"> | Date | string | null
orders?: Prisma.OrderListRelationFilter orders?: Prisma.OrderListRelationFilter
salesInvoices?: Prisma.SalesInvoiceListRelationFilter salesInvoices?: Prisma.SalesInvoiceListRelationFilter
stockMovements?: Prisma.StockMovementListRelationFilter
}, "id" | "mobileNumber"> }, "id" | "mobileNumber">
export type CustomerOrderByWithAggregationInput = { export type CustomerOrderByWithAggregationInput = {
@@ -379,6 +382,7 @@ export type CustomerCreateInput = {
deletedAt?: Date | string | null deletedAt?: Date | string | null
orders?: Prisma.OrderCreateNestedManyWithoutCustomerInput orders?: Prisma.OrderCreateNestedManyWithoutCustomerInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutCustomerInput
} }
export type CustomerUncheckedCreateInput = { export type CustomerUncheckedCreateInput = {
@@ -397,6 +401,7 @@ export type CustomerUncheckedCreateInput = {
deletedAt?: Date | string | null deletedAt?: Date | string | null
orders?: Prisma.OrderUncheckedCreateNestedManyWithoutCustomerInput orders?: Prisma.OrderUncheckedCreateNestedManyWithoutCustomerInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCustomerInput
} }
export type CustomerUpdateInput = { export type CustomerUpdateInput = {
@@ -414,6 +419,7 @@ export type CustomerUpdateInput = {
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
orders?: Prisma.OrderUpdateManyWithoutCustomerNestedInput orders?: Prisma.OrderUpdateManyWithoutCustomerNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutCustomerNestedInput
} }
export type CustomerUncheckedUpdateInput = { export type CustomerUncheckedUpdateInput = {
@@ -432,6 +438,7 @@ export type CustomerUncheckedUpdateInput = {
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
orders?: Prisma.OrderUncheckedUpdateManyWithoutCustomerNestedInput orders?: Prisma.OrderUncheckedUpdateManyWithoutCustomerNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCustomerNestedInput
} }
export type CustomerCreateManyInput = { export type CustomerCreateManyInput = {
@@ -583,6 +590,22 @@ export type CustomerUpdateOneWithoutSalesInvoicesNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutSalesInvoicesInput, Prisma.CustomerUpdateWithoutSalesInvoicesInput>, Prisma.CustomerUncheckedUpdateWithoutSalesInvoicesInput> update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutSalesInvoicesInput, Prisma.CustomerUpdateWithoutSalesInvoicesInput>, Prisma.CustomerUncheckedUpdateWithoutSalesInvoicesInput>
} }
export type CustomerCreateNestedOneWithoutStockMovementsInput = {
create?: Prisma.XOR<Prisma.CustomerCreateWithoutStockMovementsInput, Prisma.CustomerUncheckedCreateWithoutStockMovementsInput>
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutStockMovementsInput
connect?: Prisma.CustomerWhereUniqueInput
}
export type CustomerUpdateOneWithoutStockMovementsNestedInput = {
create?: Prisma.XOR<Prisma.CustomerCreateWithoutStockMovementsInput, Prisma.CustomerUncheckedCreateWithoutStockMovementsInput>
connectOrCreate?: Prisma.CustomerCreateOrConnectWithoutStockMovementsInput
upsert?: Prisma.CustomerUpsertWithoutStockMovementsInput
disconnect?: Prisma.CustomerWhereInput | boolean
delete?: Prisma.CustomerWhereInput | boolean
connect?: Prisma.CustomerWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.CustomerUpdateToOneWithWhereWithoutStockMovementsInput, Prisma.CustomerUpdateWithoutStockMovementsInput>, Prisma.CustomerUncheckedUpdateWithoutStockMovementsInput>
}
export type CustomerCreateWithoutOrdersInput = { export type CustomerCreateWithoutOrdersInput = {
firstName: string firstName: string
lastName: string lastName: string
@@ -597,6 +620,7 @@ export type CustomerCreateWithoutOrdersInput = {
updatedAt?: Date | string updatedAt?: Date | string
deletedAt?: Date | string | null deletedAt?: Date | string | null
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutCustomerInput
} }
export type CustomerUncheckedCreateWithoutOrdersInput = { export type CustomerUncheckedCreateWithoutOrdersInput = {
@@ -614,6 +638,7 @@ export type CustomerUncheckedCreateWithoutOrdersInput = {
updatedAt?: Date | string updatedAt?: Date | string
deletedAt?: Date | string | null deletedAt?: Date | string | null
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCustomerInput
} }
export type CustomerCreateOrConnectWithoutOrdersInput = { export type CustomerCreateOrConnectWithoutOrdersInput = {
@@ -646,6 +671,7 @@ export type CustomerUpdateWithoutOrdersInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutCustomerNestedInput
} }
export type CustomerUncheckedUpdateWithoutOrdersInput = { export type CustomerUncheckedUpdateWithoutOrdersInput = {
@@ -663,6 +689,7 @@ export type CustomerUncheckedUpdateWithoutOrdersInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCustomerNestedInput
} }
export type CustomerCreateWithoutSalesInvoicesInput = { export type CustomerCreateWithoutSalesInvoicesInput = {
@@ -679,6 +706,7 @@ export type CustomerCreateWithoutSalesInvoicesInput = {
updatedAt?: Date | string updatedAt?: Date | string
deletedAt?: Date | string | null deletedAt?: Date | string | null
orders?: Prisma.OrderCreateNestedManyWithoutCustomerInput orders?: Prisma.OrderCreateNestedManyWithoutCustomerInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutCustomerInput
} }
export type CustomerUncheckedCreateWithoutSalesInvoicesInput = { export type CustomerUncheckedCreateWithoutSalesInvoicesInput = {
@@ -696,6 +724,7 @@ export type CustomerUncheckedCreateWithoutSalesInvoicesInput = {
updatedAt?: Date | string updatedAt?: Date | string
deletedAt?: Date | string | null deletedAt?: Date | string | null
orders?: Prisma.OrderUncheckedCreateNestedManyWithoutCustomerInput orders?: Prisma.OrderUncheckedCreateNestedManyWithoutCustomerInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCustomerInput
} }
export type CustomerCreateOrConnectWithoutSalesInvoicesInput = { export type CustomerCreateOrConnectWithoutSalesInvoicesInput = {
@@ -728,6 +757,7 @@ export type CustomerUpdateWithoutSalesInvoicesInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
orders?: Prisma.OrderUpdateManyWithoutCustomerNestedInput orders?: Prisma.OrderUpdateManyWithoutCustomerNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutCustomerNestedInput
} }
export type CustomerUncheckedUpdateWithoutSalesInvoicesInput = { export type CustomerUncheckedUpdateWithoutSalesInvoicesInput = {
@@ -745,6 +775,93 @@ export type CustomerUncheckedUpdateWithoutSalesInvoicesInput = {
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
orders?: Prisma.OrderUncheckedUpdateManyWithoutCustomerNestedInput orders?: Prisma.OrderUncheckedUpdateManyWithoutCustomerNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCustomerNestedInput
}
export type CustomerCreateWithoutStockMovementsInput = {
firstName: string
lastName: string
email?: string | null
mobileNumber: string
address?: string | null
city?: string | null
state?: string | null
country?: string | null
isActive?: boolean
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
orders?: Prisma.OrderCreateNestedManyWithoutCustomerInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutCustomerInput
}
export type CustomerUncheckedCreateWithoutStockMovementsInput = {
id?: number
firstName: string
lastName: string
email?: string | null
mobileNumber: string
address?: string | null
city?: string | null
state?: string | null
country?: string | null
isActive?: boolean
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
orders?: Prisma.OrderUncheckedCreateNestedManyWithoutCustomerInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutCustomerInput
}
export type CustomerCreateOrConnectWithoutStockMovementsInput = {
where: Prisma.CustomerWhereUniqueInput
create: Prisma.XOR<Prisma.CustomerCreateWithoutStockMovementsInput, Prisma.CustomerUncheckedCreateWithoutStockMovementsInput>
}
export type CustomerUpsertWithoutStockMovementsInput = {
update: Prisma.XOR<Prisma.CustomerUpdateWithoutStockMovementsInput, Prisma.CustomerUncheckedUpdateWithoutStockMovementsInput>
create: Prisma.XOR<Prisma.CustomerCreateWithoutStockMovementsInput, Prisma.CustomerUncheckedCreateWithoutStockMovementsInput>
where?: Prisma.CustomerWhereInput
}
export type CustomerUpdateToOneWithWhereWithoutStockMovementsInput = {
where?: Prisma.CustomerWhereInput
data: Prisma.XOR<Prisma.CustomerUpdateWithoutStockMovementsInput, Prisma.CustomerUncheckedUpdateWithoutStockMovementsInput>
}
export type CustomerUpdateWithoutStockMovementsInput = {
firstName?: Prisma.StringFieldUpdateOperationsInput | string
lastName?: Prisma.StringFieldUpdateOperationsInput | string
email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
orders?: Prisma.OrderUpdateManyWithoutCustomerNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutCustomerNestedInput
}
export type CustomerUncheckedUpdateWithoutStockMovementsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
firstName?: Prisma.StringFieldUpdateOperationsInput | string
lastName?: Prisma.StringFieldUpdateOperationsInput | string
email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
orders?: Prisma.OrderUncheckedUpdateManyWithoutCustomerNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutCustomerNestedInput
} }
@@ -755,11 +872,13 @@ export type CustomerUncheckedUpdateWithoutSalesInvoicesInput = {
export type CustomerCountOutputType = { export type CustomerCountOutputType = {
orders: number orders: number
salesInvoices: number salesInvoices: number
stockMovements: number
} }
export type CustomerCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type CustomerCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
orders?: boolean | CustomerCountOutputTypeCountOrdersArgs orders?: boolean | CustomerCountOutputTypeCountOrdersArgs
salesInvoices?: boolean | CustomerCountOutputTypeCountSalesInvoicesArgs salesInvoices?: boolean | CustomerCountOutputTypeCountSalesInvoicesArgs
stockMovements?: boolean | CustomerCountOutputTypeCountStockMovementsArgs
} }
/** /**
@@ -786,6 +905,13 @@ export type CustomerCountOutputTypeCountSalesInvoicesArgs<ExtArgs extends runtim
where?: Prisma.SalesInvoiceWhereInput where?: Prisma.SalesInvoiceWhereInput
} }
/**
* CustomerCountOutputType without action
*/
export type CustomerCountOutputTypeCountStockMovementsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.StockMovementWhereInput
}
export type CustomerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{ export type CustomerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
id?: boolean id?: boolean
@@ -803,6 +929,7 @@ export type CustomerSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
deletedAt?: boolean deletedAt?: boolean
orders?: boolean | Prisma.Customer$ordersArgs<ExtArgs> orders?: boolean | Prisma.Customer$ordersArgs<ExtArgs>
salesInvoices?: boolean | Prisma.Customer$salesInvoicesArgs<ExtArgs> salesInvoices?: boolean | Prisma.Customer$salesInvoicesArgs<ExtArgs>
stockMovements?: boolean | Prisma.Customer$stockMovementsArgs<ExtArgs>
_count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs<ExtArgs>
}, ExtArgs["result"]["customer"]> }, ExtArgs["result"]["customer"]>
@@ -828,6 +955,7 @@ export type CustomerOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs =
export type CustomerInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type CustomerInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
orders?: boolean | Prisma.Customer$ordersArgs<ExtArgs> orders?: boolean | Prisma.Customer$ordersArgs<ExtArgs>
salesInvoices?: boolean | Prisma.Customer$salesInvoicesArgs<ExtArgs> salesInvoices?: boolean | Prisma.Customer$salesInvoicesArgs<ExtArgs>
stockMovements?: boolean | Prisma.Customer$stockMovementsArgs<ExtArgs>
_count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.CustomerCountOutputTypeDefaultArgs<ExtArgs>
} }
@@ -836,6 +964,7 @@ export type $CustomerPayload<ExtArgs extends runtime.Types.Extensions.InternalAr
objects: { objects: {
orders: Prisma.$OrderPayload<ExtArgs>[] orders: Prisma.$OrderPayload<ExtArgs>[]
salesInvoices: Prisma.$SalesInvoicePayload<ExtArgs>[] salesInvoices: Prisma.$SalesInvoicePayload<ExtArgs>[]
stockMovements: Prisma.$StockMovementPayload<ExtArgs>[]
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: number
@@ -1193,6 +1322,7 @@ export interface Prisma__CustomerClient<T, Null = never, ExtArgs extends runtime
readonly [Symbol.toStringTag]: "PrismaPromise" readonly [Symbol.toStringTag]: "PrismaPromise"
orders<T extends Prisma.Customer$ordersArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$ordersArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$OrderPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> orders<T extends Prisma.Customer$ordersArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$ordersArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$OrderPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
salesInvoices<T extends Prisma.Customer$salesInvoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$salesInvoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> salesInvoices<T extends Prisma.Customer$salesInvoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$salesInvoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
stockMovements<T extends Prisma.Customer$stockMovementsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Customer$stockMovementsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockMovementPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/** /**
* Attaches callbacks for the resolution and/or rejection of the Promise. * Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved. * @param onfulfilled The callback to execute when the Promise is resolved.
@@ -1625,6 +1755,30 @@ export type Customer$salesInvoicesArgs<ExtArgs extends runtime.Types.Extensions.
distinct?: Prisma.SalesInvoiceScalarFieldEnum | Prisma.SalesInvoiceScalarFieldEnum[] distinct?: Prisma.SalesInvoiceScalarFieldEnum | Prisma.SalesInvoiceScalarFieldEnum[]
} }
/**
* Customer.stockMovements
*/
export type Customer$stockMovementsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the StockMovement
*/
select?: Prisma.StockMovementSelect<ExtArgs> | null
/**
* Omit specific fields from the StockMovement
*/
omit?: Prisma.StockMovementOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.StockMovementInclude<ExtArgs> | null
where?: Prisma.StockMovementWhereInput
orderBy?: Prisma.StockMovementOrderByWithRelationInput | Prisma.StockMovementOrderByWithRelationInput[]
cursor?: Prisma.StockMovementWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[]
}
/** /**
* Customer without action * Customer without action
*/ */
+187
View File
@@ -246,6 +246,7 @@ export type InventoryWhereInput = {
purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter
stockAdjustments?: Prisma.StockAdjustmentListRelationFilter stockAdjustments?: Prisma.StockAdjustmentListRelationFilter
stockMovements?: Prisma.StockMovementListRelationFilter stockMovements?: Prisma.StockMovementListRelationFilter
counterStockMovements?: Prisma.StockMovementListRelationFilter
stockBalances?: Prisma.StockBalanceListRelationFilter stockBalances?: Prisma.StockBalanceListRelationFilter
salesInvoices?: Prisma.SalesInvoiceListRelationFilter salesInvoices?: Prisma.SalesInvoiceListRelationFilter
} }
@@ -265,6 +266,7 @@ export type InventoryOrderByWithRelationInput = {
purchaseReceipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput purchaseReceipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput
stockAdjustments?: Prisma.StockAdjustmentOrderByRelationAggregateInput stockAdjustments?: Prisma.StockAdjustmentOrderByRelationAggregateInput
stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
counterStockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
stockBalances?: Prisma.StockBalanceOrderByRelationAggregateInput stockBalances?: Prisma.StockBalanceOrderByRelationAggregateInput
salesInvoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput salesInvoices?: Prisma.SalesInvoiceOrderByRelationAggregateInput
_relevance?: Prisma.InventoryOrderByRelevanceInput _relevance?: Prisma.InventoryOrderByRelevanceInput
@@ -288,6 +290,7 @@ export type InventoryWhereUniqueInput = Prisma.AtLeast<{
purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter
stockAdjustments?: Prisma.StockAdjustmentListRelationFilter stockAdjustments?: Prisma.StockAdjustmentListRelationFilter
stockMovements?: Prisma.StockMovementListRelationFilter stockMovements?: Prisma.StockMovementListRelationFilter
counterStockMovements?: Prisma.StockMovementListRelationFilter
stockBalances?: Prisma.StockBalanceListRelationFilter stockBalances?: Prisma.StockBalanceListRelationFilter
salesInvoices?: Prisma.SalesInvoiceListRelationFilter salesInvoices?: Prisma.SalesInvoiceListRelationFilter
}, "id"> }, "id">
@@ -336,6 +339,7 @@ export type InventoryCreateInput = {
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput
} }
@@ -355,6 +359,7 @@ export type InventoryUncheckedCreateInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput
} }
@@ -373,6 +378,7 @@ export type InventoryUpdateInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput
} }
@@ -392,6 +398,7 @@ export type InventoryUncheckedUpdateInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput
} }
@@ -480,6 +487,11 @@ export type InventoryScalarRelationFilter = {
isNot?: Prisma.InventoryWhereInput isNot?: Prisma.InventoryWhereInput
} }
export type InventoryNullableScalarRelationFilter = {
is?: Prisma.InventoryWhereInput | null
isNot?: Prisma.InventoryWhereInput | null
}
export type InventoryCreateNestedOneWithoutProductChargesInput = { export type InventoryCreateNestedOneWithoutProductChargesInput = {
create?: Prisma.XOR<Prisma.InventoryCreateWithoutProductChargesInput, Prisma.InventoryUncheckedCreateWithoutProductChargesInput> create?: Prisma.XOR<Prisma.InventoryCreateWithoutProductChargesInput, Prisma.InventoryUncheckedCreateWithoutProductChargesInput>
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutProductChargesInput connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutProductChargesInput
@@ -528,6 +540,12 @@ export type InventoryCreateNestedOneWithoutStockMovementsInput = {
connect?: Prisma.InventoryWhereUniqueInput connect?: Prisma.InventoryWhereUniqueInput
} }
export type InventoryCreateNestedOneWithoutCounterStockMovementsInput = {
create?: Prisma.XOR<Prisma.InventoryCreateWithoutCounterStockMovementsInput, Prisma.InventoryUncheckedCreateWithoutCounterStockMovementsInput>
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutCounterStockMovementsInput
connect?: Prisma.InventoryWhereUniqueInput
}
export type InventoryUpdateOneRequiredWithoutStockMovementsNestedInput = { export type InventoryUpdateOneRequiredWithoutStockMovementsNestedInput = {
create?: Prisma.XOR<Prisma.InventoryCreateWithoutStockMovementsInput, Prisma.InventoryUncheckedCreateWithoutStockMovementsInput> create?: Prisma.XOR<Prisma.InventoryCreateWithoutStockMovementsInput, Prisma.InventoryUncheckedCreateWithoutStockMovementsInput>
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockMovementsInput connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockMovementsInput
@@ -536,6 +554,16 @@ export type InventoryUpdateOneRequiredWithoutStockMovementsNestedInput = {
update?: Prisma.XOR<Prisma.XOR<Prisma.InventoryUpdateToOneWithWhereWithoutStockMovementsInput, Prisma.InventoryUpdateWithoutStockMovementsInput>, Prisma.InventoryUncheckedUpdateWithoutStockMovementsInput> update?: Prisma.XOR<Prisma.XOR<Prisma.InventoryUpdateToOneWithWhereWithoutStockMovementsInput, Prisma.InventoryUpdateWithoutStockMovementsInput>, Prisma.InventoryUncheckedUpdateWithoutStockMovementsInput>
} }
export type InventoryUpdateOneWithoutCounterStockMovementsNestedInput = {
create?: Prisma.XOR<Prisma.InventoryCreateWithoutCounterStockMovementsInput, Prisma.InventoryUncheckedCreateWithoutCounterStockMovementsInput>
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutCounterStockMovementsInput
upsert?: Prisma.InventoryUpsertWithoutCounterStockMovementsInput
disconnect?: Prisma.InventoryWhereInput | boolean
delete?: Prisma.InventoryWhereInput | boolean
connect?: Prisma.InventoryWhereUniqueInput
update?: Prisma.XOR<Prisma.XOR<Prisma.InventoryUpdateToOneWithWhereWithoutCounterStockMovementsInput, Prisma.InventoryUpdateWithoutCounterStockMovementsInput>, Prisma.InventoryUncheckedUpdateWithoutCounterStockMovementsInput>
}
export type InventoryCreateNestedOneWithoutStockBalancesInput = { export type InventoryCreateNestedOneWithoutStockBalancesInput = {
create?: Prisma.XOR<Prisma.InventoryCreateWithoutStockBalancesInput, Prisma.InventoryUncheckedCreateWithoutStockBalancesInput> create?: Prisma.XOR<Prisma.InventoryCreateWithoutStockBalancesInput, Prisma.InventoryUncheckedCreateWithoutStockBalancesInput>
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockBalancesInput connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockBalancesInput
@@ -605,6 +633,7 @@ export type InventoryCreateWithoutProductChargesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput
} }
@@ -623,6 +652,7 @@ export type InventoryUncheckedCreateWithoutProductChargesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput
} }
@@ -656,6 +686,7 @@ export type InventoryUpdateWithoutProductChargesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput
} }
@@ -674,6 +705,7 @@ export type InventoryUncheckedUpdateWithoutProductChargesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput
} }
@@ -691,6 +723,7 @@ export type InventoryCreateWithoutPurchaseReceiptsInput = {
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput
} }
@@ -709,6 +742,7 @@ export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = {
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput
} }
@@ -742,6 +776,7 @@ export type InventoryUpdateWithoutPurchaseReceiptsInput = {
productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput
} }
@@ -760,6 +795,7 @@ export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = {
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput
} }
@@ -778,6 +814,7 @@ export type InventoryCreateWithoutSalesInvoicesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
} }
@@ -796,6 +833,7 @@ export type InventoryUncheckedCreateWithoutSalesInvoicesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
} }
@@ -829,6 +867,7 @@ export type InventoryUpdateWithoutSalesInvoicesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
} }
@@ -847,6 +886,7 @@ export type InventoryUncheckedUpdateWithoutSalesInvoicesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
} }
@@ -863,6 +903,7 @@ export type InventoryCreateWithoutStockMovementsInput = {
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput
} }
@@ -881,6 +922,7 @@ export type InventoryUncheckedCreateWithoutStockMovementsInput = {
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput
} }
@@ -890,6 +932,48 @@ export type InventoryCreateOrConnectWithoutStockMovementsInput = {
create: Prisma.XOR<Prisma.InventoryCreateWithoutStockMovementsInput, Prisma.InventoryUncheckedCreateWithoutStockMovementsInput> create: Prisma.XOR<Prisma.InventoryCreateWithoutStockMovementsInput, Prisma.InventoryUncheckedCreateWithoutStockMovementsInput>
} }
export type InventoryCreateWithoutCounterStockMovementsInput = {
name: string
location?: string | null
isActive?: boolean
isPointOfSale?: boolean
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
inventoryTransfersFrom?: Prisma.InventoryTransferCreateNestedManyWithoutFromInventoryInput
inventoryTransfersTo?: Prisma.InventoryTransferCreateNestedManyWithoutToInventoryInput
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput
}
export type InventoryUncheckedCreateWithoutCounterStockMovementsInput = {
id?: number
name: string
location?: string | null
isActive?: boolean
isPointOfSale?: boolean
createdAt?: Date | string
updatedAt?: Date | string
deletedAt?: Date | string | null
inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutFromInventoryInput
inventoryTransfersTo?: Prisma.InventoryTransferUncheckedCreateNestedManyWithoutToInventoryInput
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput
}
export type InventoryCreateOrConnectWithoutCounterStockMovementsInput = {
where: Prisma.InventoryWhereUniqueInput
create: Prisma.XOR<Prisma.InventoryCreateWithoutCounterStockMovementsInput, Prisma.InventoryUncheckedCreateWithoutCounterStockMovementsInput>
}
export type InventoryUpsertWithoutStockMovementsInput = { export type InventoryUpsertWithoutStockMovementsInput = {
update: Prisma.XOR<Prisma.InventoryUpdateWithoutStockMovementsInput, Prisma.InventoryUncheckedUpdateWithoutStockMovementsInput> update: Prisma.XOR<Prisma.InventoryUpdateWithoutStockMovementsInput, Prisma.InventoryUncheckedUpdateWithoutStockMovementsInput>
create: Prisma.XOR<Prisma.InventoryCreateWithoutStockMovementsInput, Prisma.InventoryUncheckedCreateWithoutStockMovementsInput> create: Prisma.XOR<Prisma.InventoryCreateWithoutStockMovementsInput, Prisma.InventoryUncheckedCreateWithoutStockMovementsInput>
@@ -914,6 +998,7 @@ export type InventoryUpdateWithoutStockMovementsInput = {
productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput
} }
@@ -932,6 +1017,55 @@ export type InventoryUncheckedUpdateWithoutStockMovementsInput = {
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput
}
export type InventoryUpsertWithoutCounterStockMovementsInput = {
update: Prisma.XOR<Prisma.InventoryUpdateWithoutCounterStockMovementsInput, Prisma.InventoryUncheckedUpdateWithoutCounterStockMovementsInput>
create: Prisma.XOR<Prisma.InventoryCreateWithoutCounterStockMovementsInput, Prisma.InventoryUncheckedCreateWithoutCounterStockMovementsInput>
where?: Prisma.InventoryWhereInput
}
export type InventoryUpdateToOneWithWhereWithoutCounterStockMovementsInput = {
where?: Prisma.InventoryWhereInput
data: Prisma.XOR<Prisma.InventoryUpdateWithoutCounterStockMovementsInput, Prisma.InventoryUncheckedUpdateWithoutCounterStockMovementsInput>
}
export type InventoryUpdateWithoutCounterStockMovementsInput = {
name?: Prisma.StringFieldUpdateOperationsInput | string
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryTransfersFrom?: Prisma.InventoryTransferUpdateManyWithoutFromInventoryNestedInput
inventoryTransfersTo?: Prisma.InventoryTransferUpdateManyWithoutToInventoryNestedInput
productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput
}
export type InventoryUncheckedUpdateWithoutCounterStockMovementsInput = {
id?: Prisma.IntFieldUpdateOperationsInput | number
name?: Prisma.StringFieldUpdateOperationsInput | string
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
inventoryTransfersFrom?: Prisma.InventoryTransferUncheckedUpdateManyWithoutFromInventoryNestedInput
inventoryTransfersTo?: Prisma.InventoryTransferUncheckedUpdateManyWithoutToInventoryNestedInput
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput
} }
@@ -950,6 +1084,7 @@ export type InventoryCreateWithoutStockBalancesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput
} }
@@ -968,6 +1103,7 @@ export type InventoryUncheckedCreateWithoutStockBalancesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput
} }
@@ -1001,6 +1137,7 @@ export type InventoryUpdateWithoutStockBalancesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput
} }
@@ -1019,6 +1156,7 @@ export type InventoryUncheckedUpdateWithoutStockBalancesInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput
} }
@@ -1035,6 +1173,7 @@ export type InventoryCreateWithoutInventoryTransfersFromInput = {
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput
} }
@@ -1053,6 +1192,7 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput
} }
@@ -1075,6 +1215,7 @@ export type InventoryCreateWithoutInventoryTransfersToInput = {
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput
} }
@@ -1093,6 +1234,7 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput
} }
@@ -1126,6 +1268,7 @@ export type InventoryUpdateWithoutInventoryTransfersFromInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput
} }
@@ -1144,6 +1287,7 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput
} }
@@ -1172,6 +1316,7 @@ export type InventoryUpdateWithoutInventoryTransfersToInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput
} }
@@ -1190,6 +1335,7 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = {
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput
} }
@@ -1207,6 +1353,7 @@ export type InventoryCreateWithoutStockAdjustmentsInput = {
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceCreateNestedManyWithoutInventoryInput
} }
@@ -1225,6 +1372,7 @@ export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = {
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
counterStockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput salesInvoices?: Prisma.SalesInvoiceUncheckedCreateNestedManyWithoutInventoryInput
} }
@@ -1258,6 +1406,7 @@ export type InventoryUpdateWithoutStockAdjustmentsInput = {
productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUpdateManyWithoutInventoryNestedInput
} }
@@ -1276,6 +1425,7 @@ export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = {
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
counterStockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput salesInvoices?: Prisma.SalesInvoiceUncheckedUpdateManyWithoutInventoryNestedInput
} }
@@ -1292,6 +1442,7 @@ export type InventoryCountOutputType = {
purchaseReceipts: number purchaseReceipts: number
stockAdjustments: number stockAdjustments: number
stockMovements: number stockMovements: number
counterStockMovements: number
stockBalances: number stockBalances: number
salesInvoices: number salesInvoices: number
} }
@@ -1303,6 +1454,7 @@ export type InventoryCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensi
purchaseReceipts?: boolean | InventoryCountOutputTypeCountPurchaseReceiptsArgs purchaseReceipts?: boolean | InventoryCountOutputTypeCountPurchaseReceiptsArgs
stockAdjustments?: boolean | InventoryCountOutputTypeCountStockAdjustmentsArgs stockAdjustments?: boolean | InventoryCountOutputTypeCountStockAdjustmentsArgs
stockMovements?: boolean | InventoryCountOutputTypeCountStockMovementsArgs stockMovements?: boolean | InventoryCountOutputTypeCountStockMovementsArgs
counterStockMovements?: boolean | InventoryCountOutputTypeCountCounterStockMovementsArgs
stockBalances?: boolean | InventoryCountOutputTypeCountStockBalancesArgs stockBalances?: boolean | InventoryCountOutputTypeCountStockBalancesArgs
salesInvoices?: boolean | InventoryCountOutputTypeCountSalesInvoicesArgs salesInvoices?: boolean | InventoryCountOutputTypeCountSalesInvoicesArgs
} }
@@ -1359,6 +1511,13 @@ export type InventoryCountOutputTypeCountStockMovementsArgs<ExtArgs extends runt
where?: Prisma.StockMovementWhereInput where?: Prisma.StockMovementWhereInput
} }
/**
* InventoryCountOutputType without action
*/
export type InventoryCountOutputTypeCountCounterStockMovementsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
where?: Prisma.StockMovementWhereInput
}
/** /**
* InventoryCountOutputType without action * InventoryCountOutputType without action
*/ */
@@ -1389,6 +1548,7 @@ export type InventorySelect<ExtArgs extends runtime.Types.Extensions.InternalArg
purchaseReceipts?: boolean | Prisma.Inventory$purchaseReceiptsArgs<ExtArgs> purchaseReceipts?: boolean | Prisma.Inventory$purchaseReceiptsArgs<ExtArgs>
stockAdjustments?: boolean | Prisma.Inventory$stockAdjustmentsArgs<ExtArgs> stockAdjustments?: boolean | Prisma.Inventory$stockAdjustmentsArgs<ExtArgs>
stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs<ExtArgs> stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs<ExtArgs>
counterStockMovements?: boolean | Prisma.Inventory$counterStockMovementsArgs<ExtArgs>
stockBalances?: boolean | Prisma.Inventory$stockBalancesArgs<ExtArgs> stockBalances?: boolean | Prisma.Inventory$stockBalancesArgs<ExtArgs>
salesInvoices?: boolean | Prisma.Inventory$salesInvoicesArgs<ExtArgs> salesInvoices?: boolean | Prisma.Inventory$salesInvoicesArgs<ExtArgs>
_count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs<ExtArgs>
@@ -1415,6 +1575,7 @@ export type InventoryInclude<ExtArgs extends runtime.Types.Extensions.InternalAr
purchaseReceipts?: boolean | Prisma.Inventory$purchaseReceiptsArgs<ExtArgs> purchaseReceipts?: boolean | Prisma.Inventory$purchaseReceiptsArgs<ExtArgs>
stockAdjustments?: boolean | Prisma.Inventory$stockAdjustmentsArgs<ExtArgs> stockAdjustments?: boolean | Prisma.Inventory$stockAdjustmentsArgs<ExtArgs>
stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs<ExtArgs> stockMovements?: boolean | Prisma.Inventory$stockMovementsArgs<ExtArgs>
counterStockMovements?: boolean | Prisma.Inventory$counterStockMovementsArgs<ExtArgs>
stockBalances?: boolean | Prisma.Inventory$stockBalancesArgs<ExtArgs> stockBalances?: boolean | Prisma.Inventory$stockBalancesArgs<ExtArgs>
salesInvoices?: boolean | Prisma.Inventory$salesInvoicesArgs<ExtArgs> salesInvoices?: boolean | Prisma.Inventory$salesInvoicesArgs<ExtArgs>
_count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs<ExtArgs> _count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs<ExtArgs>
@@ -1429,6 +1590,7 @@ export type $InventoryPayload<ExtArgs extends runtime.Types.Extensions.InternalA
purchaseReceipts: Prisma.$PurchaseReceiptPayload<ExtArgs>[] purchaseReceipts: Prisma.$PurchaseReceiptPayload<ExtArgs>[]
stockAdjustments: Prisma.$StockAdjustmentPayload<ExtArgs>[] stockAdjustments: Prisma.$StockAdjustmentPayload<ExtArgs>[]
stockMovements: Prisma.$StockMovementPayload<ExtArgs>[] stockMovements: Prisma.$StockMovementPayload<ExtArgs>[]
counterStockMovements: Prisma.$StockMovementPayload<ExtArgs>[]
stockBalances: Prisma.$StockBalancePayload<ExtArgs>[] stockBalances: Prisma.$StockBalancePayload<ExtArgs>[]
salesInvoices: Prisma.$SalesInvoicePayload<ExtArgs>[] salesInvoices: Prisma.$SalesInvoicePayload<ExtArgs>[]
} }
@@ -1787,6 +1949,7 @@ export interface Prisma__InventoryClient<T, Null = never, ExtArgs extends runtim
purchaseReceipts<T extends Prisma.Inventory$purchaseReceiptsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$purchaseReceiptsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PurchaseReceiptPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> purchaseReceipts<T extends Prisma.Inventory$purchaseReceiptsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$purchaseReceiptsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PurchaseReceiptPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
stockAdjustments<T extends Prisma.Inventory$stockAdjustmentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$stockAdjustmentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockAdjustmentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> stockAdjustments<T extends Prisma.Inventory$stockAdjustmentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$stockAdjustmentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockAdjustmentPayload<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> 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>
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>
stockBalances<T extends Prisma.Inventory$stockBalancesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$stockBalancesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockBalancePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> stockBalances<T extends Prisma.Inventory$stockBalancesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$stockBalancesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockBalancePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
salesInvoices<T extends Prisma.Inventory$salesInvoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$salesInvoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null> salesInvoices<T extends Prisma.Inventory$salesInvoicesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Inventory$salesInvoicesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoicePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
/** /**
@@ -2312,6 +2475,30 @@ export type Inventory$stockMovementsArgs<ExtArgs extends runtime.Types.Extension
distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[] distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[]
} }
/**
* Inventory.counterStockMovements
*/
export type Inventory$counterStockMovementsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the StockMovement
*/
select?: Prisma.StockMovementSelect<ExtArgs> | null
/**
* Omit specific fields from the StockMovement
*/
omit?: Prisma.StockMovementOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.StockMovementInclude<ExtArgs> | null
where?: Prisma.StockMovementWhereInput
orderBy?: Prisma.StockMovementOrderByWithRelationInput | Prisma.StockMovementOrderByWithRelationInput[]
cursor?: Prisma.StockMovementWhereUniqueInput
take?: number
skip?: number
distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[]
}
/** /**
* Inventory.stockBalances * Inventory.stockBalances
*/ */
+489 -1
View File
@@ -36,6 +36,8 @@ export type StockMovementAvgAggregateOutputType = {
avgCost: runtime.Decimal | null avgCost: runtime.Decimal | null
remainedInStock: runtime.Decimal | null remainedInStock: runtime.Decimal | null
supplierId: number | null supplierId: number | null
customerId: number | null
counterInventoryId: number | null
} }
export type StockMovementSumAggregateOutputType = { export type StockMovementSumAggregateOutputType = {
@@ -48,6 +50,8 @@ export type StockMovementSumAggregateOutputType = {
avgCost: runtime.Decimal | null avgCost: runtime.Decimal | null
remainedInStock: runtime.Decimal | null remainedInStock: runtime.Decimal | null
supplierId: number | null supplierId: number | null
customerId: number | null
counterInventoryId: number | null
} }
export type StockMovementMinAggregateOutputType = { export type StockMovementMinAggregateOutputType = {
@@ -64,6 +68,8 @@ export type StockMovementMinAggregateOutputType = {
avgCost: runtime.Decimal | null avgCost: runtime.Decimal | null
remainedInStock: runtime.Decimal | null remainedInStock: runtime.Decimal | null
supplierId: number | null supplierId: number | null
customerId: number | null
counterInventoryId: number | null
} }
export type StockMovementMaxAggregateOutputType = { export type StockMovementMaxAggregateOutputType = {
@@ -80,6 +86,8 @@ export type StockMovementMaxAggregateOutputType = {
avgCost: runtime.Decimal | null avgCost: runtime.Decimal | null
remainedInStock: runtime.Decimal | null remainedInStock: runtime.Decimal | null
supplierId: number | null supplierId: number | null
customerId: number | null
counterInventoryId: number | null
} }
export type StockMovementCountAggregateOutputType = { export type StockMovementCountAggregateOutputType = {
@@ -96,6 +104,8 @@ export type StockMovementCountAggregateOutputType = {
avgCost: number avgCost: number
remainedInStock: number remainedInStock: number
supplierId: number supplierId: number
customerId: number
counterInventoryId: number
_all: number _all: number
} }
@@ -110,6 +120,8 @@ export type StockMovementAvgAggregateInputType = {
avgCost?: true avgCost?: true
remainedInStock?: true remainedInStock?: true
supplierId?: true supplierId?: true
customerId?: true
counterInventoryId?: true
} }
export type StockMovementSumAggregateInputType = { export type StockMovementSumAggregateInputType = {
@@ -122,6 +134,8 @@ export type StockMovementSumAggregateInputType = {
avgCost?: true avgCost?: true
remainedInStock?: true remainedInStock?: true
supplierId?: true supplierId?: true
customerId?: true
counterInventoryId?: true
} }
export type StockMovementMinAggregateInputType = { export type StockMovementMinAggregateInputType = {
@@ -138,6 +152,8 @@ export type StockMovementMinAggregateInputType = {
avgCost?: true avgCost?: true
remainedInStock?: true remainedInStock?: true
supplierId?: true supplierId?: true
customerId?: true
counterInventoryId?: true
} }
export type StockMovementMaxAggregateInputType = { export type StockMovementMaxAggregateInputType = {
@@ -154,6 +170,8 @@ export type StockMovementMaxAggregateInputType = {
avgCost?: true avgCost?: true
remainedInStock?: true remainedInStock?: true
supplierId?: true supplierId?: true
customerId?: true
counterInventoryId?: true
} }
export type StockMovementCountAggregateInputType = { export type StockMovementCountAggregateInputType = {
@@ -170,6 +188,8 @@ export type StockMovementCountAggregateInputType = {
avgCost?: true avgCost?: true
remainedInStock?: true remainedInStock?: true
supplierId?: true supplierId?: true
customerId?: true
counterInventoryId?: true
_all?: true _all?: true
} }
@@ -273,6 +293,8 @@ export type StockMovementGroupByOutputType = {
avgCost: runtime.Decimal avgCost: runtime.Decimal
remainedInStock: runtime.Decimal remainedInStock: runtime.Decimal
supplierId: number | null supplierId: number | null
customerId: number | null
counterInventoryId: number | null
_count: StockMovementCountAggregateOutputType | null _count: StockMovementCountAggregateOutputType | null
_avg: StockMovementAvgAggregateOutputType | null _avg: StockMovementAvgAggregateOutputType | null
_sum: StockMovementSumAggregateOutputType | null _sum: StockMovementSumAggregateOutputType | null
@@ -312,9 +334,13 @@ export type StockMovementWhereInput = {
avgCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.IntNullableFilter<"StockMovement"> | number | null supplierId?: Prisma.IntNullableFilter<"StockMovement"> | number | null
customerId?: Prisma.IntNullableFilter<"StockMovement"> | number | null
counterInventoryId?: Prisma.IntNullableFilter<"StockMovement"> | number | null
inventory?: Prisma.XOR<Prisma.InventoryScalarRelationFilter, Prisma.InventoryWhereInput> inventory?: Prisma.XOR<Prisma.InventoryScalarRelationFilter, Prisma.InventoryWhereInput>
product?: Prisma.XOR<Prisma.ProductScalarRelationFilter, Prisma.ProductWhereInput> product?: Prisma.XOR<Prisma.ProductScalarRelationFilter, Prisma.ProductWhereInput>
supplier?: Prisma.XOR<Prisma.SupplierNullableScalarRelationFilter, Prisma.SupplierWhereInput> | null supplier?: Prisma.XOR<Prisma.SupplierNullableScalarRelationFilter, Prisma.SupplierWhereInput> | null
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
counterInventory?: Prisma.XOR<Prisma.InventoryNullableScalarRelationFilter, Prisma.InventoryWhereInput> | null
} }
export type StockMovementOrderByWithRelationInput = { export type StockMovementOrderByWithRelationInput = {
@@ -331,9 +357,13 @@ export type StockMovementOrderByWithRelationInput = {
avgCost?: Prisma.SortOrder avgCost?: Prisma.SortOrder
remainedInStock?: Prisma.SortOrder remainedInStock?: Prisma.SortOrder
supplierId?: Prisma.SortOrderInput | Prisma.SortOrder supplierId?: Prisma.SortOrderInput | Prisma.SortOrder
customerId?: Prisma.SortOrderInput | Prisma.SortOrder
counterInventoryId?: Prisma.SortOrderInput | Prisma.SortOrder
inventory?: Prisma.InventoryOrderByWithRelationInput inventory?: Prisma.InventoryOrderByWithRelationInput
product?: Prisma.ProductOrderByWithRelationInput product?: Prisma.ProductOrderByWithRelationInput
supplier?: Prisma.SupplierOrderByWithRelationInput supplier?: Prisma.SupplierOrderByWithRelationInput
customer?: Prisma.CustomerOrderByWithRelationInput
counterInventory?: Prisma.InventoryOrderByWithRelationInput
_relevance?: Prisma.StockMovementOrderByRelevanceInput _relevance?: Prisma.StockMovementOrderByRelevanceInput
} }
@@ -354,9 +384,13 @@ export type StockMovementWhereUniqueInput = Prisma.AtLeast<{
avgCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.IntNullableFilter<"StockMovement"> | number | null supplierId?: Prisma.IntNullableFilter<"StockMovement"> | number | null
customerId?: Prisma.IntNullableFilter<"StockMovement"> | number | null
counterInventoryId?: Prisma.IntNullableFilter<"StockMovement"> | number | null
inventory?: Prisma.XOR<Prisma.InventoryScalarRelationFilter, Prisma.InventoryWhereInput> inventory?: Prisma.XOR<Prisma.InventoryScalarRelationFilter, Prisma.InventoryWhereInput>
product?: Prisma.XOR<Prisma.ProductScalarRelationFilter, Prisma.ProductWhereInput> product?: Prisma.XOR<Prisma.ProductScalarRelationFilter, Prisma.ProductWhereInput>
supplier?: Prisma.XOR<Prisma.SupplierNullableScalarRelationFilter, Prisma.SupplierWhereInput> | null supplier?: Prisma.XOR<Prisma.SupplierNullableScalarRelationFilter, Prisma.SupplierWhereInput> | null
customer?: Prisma.XOR<Prisma.CustomerNullableScalarRelationFilter, Prisma.CustomerWhereInput> | null
counterInventory?: Prisma.XOR<Prisma.InventoryNullableScalarRelationFilter, Prisma.InventoryWhereInput> | null
}, "id"> }, "id">
export type StockMovementOrderByWithAggregationInput = { export type StockMovementOrderByWithAggregationInput = {
@@ -373,6 +407,8 @@ export type StockMovementOrderByWithAggregationInput = {
avgCost?: Prisma.SortOrder avgCost?: Prisma.SortOrder
remainedInStock?: Prisma.SortOrder remainedInStock?: Prisma.SortOrder
supplierId?: Prisma.SortOrderInput | Prisma.SortOrder supplierId?: Prisma.SortOrderInput | Prisma.SortOrder
customerId?: Prisma.SortOrderInput | Prisma.SortOrder
counterInventoryId?: Prisma.SortOrderInput | Prisma.SortOrder
_count?: Prisma.StockMovementCountOrderByAggregateInput _count?: Prisma.StockMovementCountOrderByAggregateInput
_avg?: Prisma.StockMovementAvgOrderByAggregateInput _avg?: Prisma.StockMovementAvgOrderByAggregateInput
_max?: Prisma.StockMovementMaxOrderByAggregateInput _max?: Prisma.StockMovementMaxOrderByAggregateInput
@@ -397,6 +433,8 @@ export type StockMovementScalarWhereWithAggregatesInput = {
avgCost?: Prisma.DecimalWithAggregatesFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalWithAggregatesFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalWithAggregatesFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalWithAggregatesFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.IntNullableWithAggregatesFilter<"StockMovement"> | number | null supplierId?: Prisma.IntNullableWithAggregatesFilter<"StockMovement"> | number | null
customerId?: Prisma.IntNullableWithAggregatesFilter<"StockMovement"> | number | null
counterInventoryId?: Prisma.IntNullableWithAggregatesFilter<"StockMovement"> | number | null
} }
export type StockMovementCreateInput = { export type StockMovementCreateInput = {
@@ -412,6 +450,8 @@ export type StockMovementCreateInput = {
inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput
product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput
supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput
customer?: Prisma.CustomerCreateNestedOneWithoutStockMovementsInput
counterInventory?: Prisma.InventoryCreateNestedOneWithoutCounterStockMovementsInput
} }
export type StockMovementUncheckedCreateInput = { export type StockMovementUncheckedCreateInput = {
@@ -428,6 +468,8 @@ export type StockMovementUncheckedCreateInput = {
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: number | null supplierId?: number | null
customerId?: number | null
counterInventoryId?: number | null
} }
export type StockMovementUpdateInput = { export type StockMovementUpdateInput = {
@@ -443,6 +485,8 @@ export type StockMovementUpdateInput = {
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput
product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput
supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput
customer?: Prisma.CustomerUpdateOneWithoutStockMovementsNestedInput
counterInventory?: Prisma.InventoryUpdateOneWithoutCounterStockMovementsNestedInput
} }
export type StockMovementUncheckedUpdateInput = { export type StockMovementUncheckedUpdateInput = {
@@ -459,6 +503,8 @@ export type StockMovementUncheckedUpdateInput = {
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
} }
export type StockMovementCreateManyInput = { export type StockMovementCreateManyInput = {
@@ -475,6 +521,8 @@ export type StockMovementCreateManyInput = {
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: number | null supplierId?: number | null
customerId?: number | null
counterInventoryId?: number | null
} }
export type StockMovementUpdateManyMutationInput = { export type StockMovementUpdateManyMutationInput = {
@@ -503,6 +551,8 @@ export type StockMovementUncheckedUpdateManyInput = {
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
} }
export type StockMovementListRelationFilter = { export type StockMovementListRelationFilter = {
@@ -535,6 +585,8 @@ export type StockMovementCountOrderByAggregateInput = {
avgCost?: Prisma.SortOrder avgCost?: Prisma.SortOrder
remainedInStock?: Prisma.SortOrder remainedInStock?: Prisma.SortOrder
supplierId?: Prisma.SortOrder supplierId?: Prisma.SortOrder
customerId?: Prisma.SortOrder
counterInventoryId?: Prisma.SortOrder
} }
export type StockMovementAvgOrderByAggregateInput = { export type StockMovementAvgOrderByAggregateInput = {
@@ -547,6 +599,8 @@ export type StockMovementAvgOrderByAggregateInput = {
avgCost?: Prisma.SortOrder avgCost?: Prisma.SortOrder
remainedInStock?: Prisma.SortOrder remainedInStock?: Prisma.SortOrder
supplierId?: Prisma.SortOrder supplierId?: Prisma.SortOrder
customerId?: Prisma.SortOrder
counterInventoryId?: Prisma.SortOrder
} }
export type StockMovementMaxOrderByAggregateInput = { export type StockMovementMaxOrderByAggregateInput = {
@@ -563,6 +617,8 @@ export type StockMovementMaxOrderByAggregateInput = {
avgCost?: Prisma.SortOrder avgCost?: Prisma.SortOrder
remainedInStock?: Prisma.SortOrder remainedInStock?: Prisma.SortOrder
supplierId?: Prisma.SortOrder supplierId?: Prisma.SortOrder
customerId?: Prisma.SortOrder
counterInventoryId?: Prisma.SortOrder
} }
export type StockMovementMinOrderByAggregateInput = { export type StockMovementMinOrderByAggregateInput = {
@@ -579,6 +635,8 @@ export type StockMovementMinOrderByAggregateInput = {
avgCost?: Prisma.SortOrder avgCost?: Prisma.SortOrder
remainedInStock?: Prisma.SortOrder remainedInStock?: Prisma.SortOrder
supplierId?: Prisma.SortOrder supplierId?: Prisma.SortOrder
customerId?: Prisma.SortOrder
counterInventoryId?: Prisma.SortOrder
} }
export type StockMovementSumOrderByAggregateInput = { export type StockMovementSumOrderByAggregateInput = {
@@ -591,6 +649,8 @@ export type StockMovementSumOrderByAggregateInput = {
avgCost?: Prisma.SortOrder avgCost?: Prisma.SortOrder
remainedInStock?: Prisma.SortOrder remainedInStock?: Prisma.SortOrder
supplierId?: Prisma.SortOrder supplierId?: Prisma.SortOrder
customerId?: Prisma.SortOrder
counterInventoryId?: Prisma.SortOrder
} }
export type StockMovementCreateNestedManyWithoutProductInput = { export type StockMovementCreateNestedManyWithoutProductInput = {
@@ -677,6 +737,48 @@ export type StockMovementUncheckedUpdateManyWithoutSupplierNestedInput = {
deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[]
} }
export type StockMovementCreateNestedManyWithoutCustomerInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutCustomerInput, Prisma.StockMovementUncheckedCreateWithoutCustomerInput> | Prisma.StockMovementCreateWithoutCustomerInput[] | Prisma.StockMovementUncheckedCreateWithoutCustomerInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutCustomerInput | Prisma.StockMovementCreateOrConnectWithoutCustomerInput[]
createMany?: Prisma.StockMovementCreateManyCustomerInputEnvelope
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
}
export type StockMovementUncheckedCreateNestedManyWithoutCustomerInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutCustomerInput, Prisma.StockMovementUncheckedCreateWithoutCustomerInput> | Prisma.StockMovementCreateWithoutCustomerInput[] | Prisma.StockMovementUncheckedCreateWithoutCustomerInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutCustomerInput | Prisma.StockMovementCreateOrConnectWithoutCustomerInput[]
createMany?: Prisma.StockMovementCreateManyCustomerInputEnvelope
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
}
export type StockMovementUpdateManyWithoutCustomerNestedInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutCustomerInput, Prisma.StockMovementUncheckedCreateWithoutCustomerInput> | Prisma.StockMovementCreateWithoutCustomerInput[] | Prisma.StockMovementUncheckedCreateWithoutCustomerInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutCustomerInput | Prisma.StockMovementCreateOrConnectWithoutCustomerInput[]
upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutCustomerInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutCustomerInput[]
createMany?: Prisma.StockMovementCreateManyCustomerInputEnvelope
set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutCustomerInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutCustomerInput[]
updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutCustomerInput | Prisma.StockMovementUpdateManyWithWhereWithoutCustomerInput[]
deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[]
}
export type StockMovementUncheckedUpdateManyWithoutCustomerNestedInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutCustomerInput, Prisma.StockMovementUncheckedCreateWithoutCustomerInput> | Prisma.StockMovementCreateWithoutCustomerInput[] | Prisma.StockMovementUncheckedCreateWithoutCustomerInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutCustomerInput | Prisma.StockMovementCreateOrConnectWithoutCustomerInput[]
upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutCustomerInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutCustomerInput[]
createMany?: Prisma.StockMovementCreateManyCustomerInputEnvelope
set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutCustomerInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutCustomerInput[]
updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutCustomerInput | Prisma.StockMovementUpdateManyWithWhereWithoutCustomerInput[]
deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[]
}
export type StockMovementCreateNestedManyWithoutInventoryInput = { export type StockMovementCreateNestedManyWithoutInventoryInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutInventoryInput, Prisma.StockMovementUncheckedCreateWithoutInventoryInput> | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[] create?: Prisma.XOR<Prisma.StockMovementCreateWithoutInventoryInput, Prisma.StockMovementUncheckedCreateWithoutInventoryInput> | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[] connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[]
@@ -684,6 +786,13 @@ export type StockMovementCreateNestedManyWithoutInventoryInput = {
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
} }
export type StockMovementCreateNestedManyWithoutCounterInventoryInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutCounterInventoryInput, Prisma.StockMovementUncheckedCreateWithoutCounterInventoryInput> | Prisma.StockMovementCreateWithoutCounterInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutCounterInventoryInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutCounterInventoryInput | Prisma.StockMovementCreateOrConnectWithoutCounterInventoryInput[]
createMany?: Prisma.StockMovementCreateManyCounterInventoryInputEnvelope
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
}
export type StockMovementUncheckedCreateNestedManyWithoutInventoryInput = { export type StockMovementUncheckedCreateNestedManyWithoutInventoryInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutInventoryInput, Prisma.StockMovementUncheckedCreateWithoutInventoryInput> | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[] create?: Prisma.XOR<Prisma.StockMovementCreateWithoutInventoryInput, Prisma.StockMovementUncheckedCreateWithoutInventoryInput> | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[] connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[]
@@ -691,6 +800,13 @@ export type StockMovementUncheckedCreateNestedManyWithoutInventoryInput = {
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[] connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
} }
export type StockMovementUncheckedCreateNestedManyWithoutCounterInventoryInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutCounterInventoryInput, Prisma.StockMovementUncheckedCreateWithoutCounterInventoryInput> | Prisma.StockMovementCreateWithoutCounterInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutCounterInventoryInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutCounterInventoryInput | Prisma.StockMovementCreateOrConnectWithoutCounterInventoryInput[]
createMany?: Prisma.StockMovementCreateManyCounterInventoryInputEnvelope
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
}
export type StockMovementUpdateManyWithoutInventoryNestedInput = { export type StockMovementUpdateManyWithoutInventoryNestedInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutInventoryInput, Prisma.StockMovementUncheckedCreateWithoutInventoryInput> | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[] create?: Prisma.XOR<Prisma.StockMovementCreateWithoutInventoryInput, Prisma.StockMovementUncheckedCreateWithoutInventoryInput> | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[] connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[]
@@ -705,6 +821,20 @@ export type StockMovementUpdateManyWithoutInventoryNestedInput = {
deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[]
} }
export type StockMovementUpdateManyWithoutCounterInventoryNestedInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutCounterInventoryInput, Prisma.StockMovementUncheckedCreateWithoutCounterInventoryInput> | Prisma.StockMovementCreateWithoutCounterInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutCounterInventoryInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutCounterInventoryInput | Prisma.StockMovementCreateOrConnectWithoutCounterInventoryInput[]
upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutCounterInventoryInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutCounterInventoryInput[]
createMany?: Prisma.StockMovementCreateManyCounterInventoryInputEnvelope
set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutCounterInventoryInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutCounterInventoryInput[]
updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutCounterInventoryInput | Prisma.StockMovementUpdateManyWithWhereWithoutCounterInventoryInput[]
deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[]
}
export type StockMovementUncheckedUpdateManyWithoutInventoryNestedInput = { export type StockMovementUncheckedUpdateManyWithoutInventoryNestedInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutInventoryInput, Prisma.StockMovementUncheckedCreateWithoutInventoryInput> | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[] create?: Prisma.XOR<Prisma.StockMovementCreateWithoutInventoryInput, Prisma.StockMovementUncheckedCreateWithoutInventoryInput> | Prisma.StockMovementCreateWithoutInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutInventoryInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[] connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutInventoryInput | Prisma.StockMovementCreateOrConnectWithoutInventoryInput[]
@@ -719,6 +849,20 @@ export type StockMovementUncheckedUpdateManyWithoutInventoryNestedInput = {
deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[] deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[]
} }
export type StockMovementUncheckedUpdateManyWithoutCounterInventoryNestedInput = {
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutCounterInventoryInput, Prisma.StockMovementUncheckedCreateWithoutCounterInventoryInput> | Prisma.StockMovementCreateWithoutCounterInventoryInput[] | Prisma.StockMovementUncheckedCreateWithoutCounterInventoryInput[]
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutCounterInventoryInput | Prisma.StockMovementCreateOrConnectWithoutCounterInventoryInput[]
upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutCounterInventoryInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutCounterInventoryInput[]
createMany?: Prisma.StockMovementCreateManyCounterInventoryInputEnvelope
set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutCounterInventoryInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutCounterInventoryInput[]
updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutCounterInventoryInput | Prisma.StockMovementUpdateManyWithWhereWithoutCounterInventoryInput[]
deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[]
}
export type EnumMovementTypeFieldUpdateOperationsInput = { export type EnumMovementTypeFieldUpdateOperationsInput = {
set?: $Enums.MovementType set?: $Enums.MovementType
} }
@@ -739,6 +883,8 @@ export type StockMovementCreateWithoutProductInput = {
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput
supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput
customer?: Prisma.CustomerCreateNestedOneWithoutStockMovementsInput
counterInventory?: Prisma.InventoryCreateNestedOneWithoutCounterStockMovementsInput
} }
export type StockMovementUncheckedCreateWithoutProductInput = { export type StockMovementUncheckedCreateWithoutProductInput = {
@@ -754,6 +900,8 @@ export type StockMovementUncheckedCreateWithoutProductInput = {
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: number | null supplierId?: number | null
customerId?: number | null
counterInventoryId?: number | null
} }
export type StockMovementCreateOrConnectWithoutProductInput = { export type StockMovementCreateOrConnectWithoutProductInput = {
@@ -799,6 +947,8 @@ export type StockMovementScalarWhereInput = {
avgCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFilter<"StockMovement"> | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.IntNullableFilter<"StockMovement"> | number | null supplierId?: Prisma.IntNullableFilter<"StockMovement"> | number | null
customerId?: Prisma.IntNullableFilter<"StockMovement"> | number | null
counterInventoryId?: Prisma.IntNullableFilter<"StockMovement"> | number | null
} }
export type StockMovementCreateWithoutSupplierInput = { export type StockMovementCreateWithoutSupplierInput = {
@@ -813,6 +963,8 @@ export type StockMovementCreateWithoutSupplierInput = {
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput
product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput
customer?: Prisma.CustomerCreateNestedOneWithoutStockMovementsInput
counterInventory?: Prisma.InventoryCreateNestedOneWithoutCounterStockMovementsInput
} }
export type StockMovementUncheckedCreateWithoutSupplierInput = { export type StockMovementUncheckedCreateWithoutSupplierInput = {
@@ -828,6 +980,8 @@ export type StockMovementUncheckedCreateWithoutSupplierInput = {
inventoryId: number inventoryId: number
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
customerId?: number | null
counterInventoryId?: number | null
} }
export type StockMovementCreateOrConnectWithoutSupplierInput = { export type StockMovementCreateOrConnectWithoutSupplierInput = {
@@ -856,6 +1010,65 @@ export type StockMovementUpdateManyWithWhereWithoutSupplierInput = {
data: Prisma.XOR<Prisma.StockMovementUpdateManyMutationInput, Prisma.StockMovementUncheckedUpdateManyWithoutSupplierInput> data: Prisma.XOR<Prisma.StockMovementUpdateManyMutationInput, Prisma.StockMovementUncheckedUpdateManyWithoutSupplierInput>
} }
export type StockMovementCreateWithoutCustomerInput = {
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
createdAt?: Date | string
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput
product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput
supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput
counterInventory?: Prisma.InventoryCreateNestedOneWithoutCounterStockMovementsInput
}
export type StockMovementUncheckedCreateWithoutCustomerInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
createdAt?: Date | string
productId: number
inventoryId: number
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: number | null
counterInventoryId?: number | null
}
export type StockMovementCreateOrConnectWithoutCustomerInput = {
where: Prisma.StockMovementWhereUniqueInput
create: Prisma.XOR<Prisma.StockMovementCreateWithoutCustomerInput, Prisma.StockMovementUncheckedCreateWithoutCustomerInput>
}
export type StockMovementCreateManyCustomerInputEnvelope = {
data: Prisma.StockMovementCreateManyCustomerInput | Prisma.StockMovementCreateManyCustomerInput[]
skipDuplicates?: boolean
}
export type StockMovementUpsertWithWhereUniqueWithoutCustomerInput = {
where: Prisma.StockMovementWhereUniqueInput
update: Prisma.XOR<Prisma.StockMovementUpdateWithoutCustomerInput, Prisma.StockMovementUncheckedUpdateWithoutCustomerInput>
create: Prisma.XOR<Prisma.StockMovementCreateWithoutCustomerInput, Prisma.StockMovementUncheckedCreateWithoutCustomerInput>
}
export type StockMovementUpdateWithWhereUniqueWithoutCustomerInput = {
where: Prisma.StockMovementWhereUniqueInput
data: Prisma.XOR<Prisma.StockMovementUpdateWithoutCustomerInput, Prisma.StockMovementUncheckedUpdateWithoutCustomerInput>
}
export type StockMovementUpdateManyWithWhereWithoutCustomerInput = {
where: Prisma.StockMovementScalarWhereInput
data: Prisma.XOR<Prisma.StockMovementUpdateManyMutationInput, Prisma.StockMovementUncheckedUpdateManyWithoutCustomerInput>
}
export type StockMovementCreateWithoutInventoryInput = { export type StockMovementCreateWithoutInventoryInput = {
type: $Enums.MovementType type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
@@ -868,6 +1081,8 @@ export type StockMovementCreateWithoutInventoryInput = {
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput
supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput
customer?: Prisma.CustomerCreateNestedOneWithoutStockMovementsInput
counterInventory?: Prisma.InventoryCreateNestedOneWithoutCounterStockMovementsInput
} }
export type StockMovementUncheckedCreateWithoutInventoryInput = { export type StockMovementUncheckedCreateWithoutInventoryInput = {
@@ -883,6 +1098,8 @@ export type StockMovementUncheckedCreateWithoutInventoryInput = {
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: number | null supplierId?: number | null
customerId?: number | null
counterInventoryId?: number | null
} }
export type StockMovementCreateOrConnectWithoutInventoryInput = { export type StockMovementCreateOrConnectWithoutInventoryInput = {
@@ -895,6 +1112,49 @@ export type StockMovementCreateManyInventoryInputEnvelope = {
skipDuplicates?: boolean skipDuplicates?: boolean
} }
export type StockMovementCreateWithoutCounterInventoryInput = {
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
createdAt?: Date | string
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput
product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput
supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput
customer?: Prisma.CustomerCreateNestedOneWithoutStockMovementsInput
}
export type StockMovementUncheckedCreateWithoutCounterInventoryInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
createdAt?: Date | string
productId: number
inventoryId: number
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: number | null
customerId?: number | null
}
export type StockMovementCreateOrConnectWithoutCounterInventoryInput = {
where: Prisma.StockMovementWhereUniqueInput
create: Prisma.XOR<Prisma.StockMovementCreateWithoutCounterInventoryInput, Prisma.StockMovementUncheckedCreateWithoutCounterInventoryInput>
}
export type StockMovementCreateManyCounterInventoryInputEnvelope = {
data: Prisma.StockMovementCreateManyCounterInventoryInput | Prisma.StockMovementCreateManyCounterInventoryInput[]
skipDuplicates?: boolean
}
export type StockMovementUpsertWithWhereUniqueWithoutInventoryInput = { export type StockMovementUpsertWithWhereUniqueWithoutInventoryInput = {
where: Prisma.StockMovementWhereUniqueInput where: Prisma.StockMovementWhereUniqueInput
update: Prisma.XOR<Prisma.StockMovementUpdateWithoutInventoryInput, Prisma.StockMovementUncheckedUpdateWithoutInventoryInput> update: Prisma.XOR<Prisma.StockMovementUpdateWithoutInventoryInput, Prisma.StockMovementUncheckedUpdateWithoutInventoryInput>
@@ -911,6 +1171,22 @@ export type StockMovementUpdateManyWithWhereWithoutInventoryInput = {
data: Prisma.XOR<Prisma.StockMovementUpdateManyMutationInput, Prisma.StockMovementUncheckedUpdateManyWithoutInventoryInput> data: Prisma.XOR<Prisma.StockMovementUpdateManyMutationInput, Prisma.StockMovementUncheckedUpdateManyWithoutInventoryInput>
} }
export type StockMovementUpsertWithWhereUniqueWithoutCounterInventoryInput = {
where: Prisma.StockMovementWhereUniqueInput
update: Prisma.XOR<Prisma.StockMovementUpdateWithoutCounterInventoryInput, Prisma.StockMovementUncheckedUpdateWithoutCounterInventoryInput>
create: Prisma.XOR<Prisma.StockMovementCreateWithoutCounterInventoryInput, Prisma.StockMovementUncheckedCreateWithoutCounterInventoryInput>
}
export type StockMovementUpdateWithWhereUniqueWithoutCounterInventoryInput = {
where: Prisma.StockMovementWhereUniqueInput
data: Prisma.XOR<Prisma.StockMovementUpdateWithoutCounterInventoryInput, Prisma.StockMovementUncheckedUpdateWithoutCounterInventoryInput>
}
export type StockMovementUpdateManyWithWhereWithoutCounterInventoryInput = {
where: Prisma.StockMovementScalarWhereInput
data: Prisma.XOR<Prisma.StockMovementUpdateManyMutationInput, Prisma.StockMovementUncheckedUpdateManyWithoutCounterInventoryInput>
}
export type StockMovementCreateManyProductInput = { export type StockMovementCreateManyProductInput = {
id?: number id?: number
type: $Enums.MovementType type: $Enums.MovementType
@@ -924,6 +1200,8 @@ export type StockMovementCreateManyProductInput = {
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: number | null supplierId?: number | null
customerId?: number | null
counterInventoryId?: number | null
} }
export type StockMovementUpdateWithoutProductInput = { export type StockMovementUpdateWithoutProductInput = {
@@ -938,6 +1216,8 @@ export type StockMovementUpdateWithoutProductInput = {
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput
supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput
customer?: Prisma.CustomerUpdateOneWithoutStockMovementsNestedInput
counterInventory?: Prisma.InventoryUpdateOneWithoutCounterStockMovementsNestedInput
} }
export type StockMovementUncheckedUpdateWithoutProductInput = { export type StockMovementUncheckedUpdateWithoutProductInput = {
@@ -953,6 +1233,8 @@ export type StockMovementUncheckedUpdateWithoutProductInput = {
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
} }
export type StockMovementUncheckedUpdateManyWithoutProductInput = { export type StockMovementUncheckedUpdateManyWithoutProductInput = {
@@ -968,6 +1250,8 @@ export type StockMovementUncheckedUpdateManyWithoutProductInput = {
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
} }
export type StockMovementCreateManySupplierInput = { export type StockMovementCreateManySupplierInput = {
@@ -983,6 +1267,8 @@ export type StockMovementCreateManySupplierInput = {
inventoryId: number inventoryId: number
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
customerId?: number | null
counterInventoryId?: number | null
} }
export type StockMovementUpdateWithoutSupplierInput = { export type StockMovementUpdateWithoutSupplierInput = {
@@ -997,6 +1283,8 @@ export type StockMovementUpdateWithoutSupplierInput = {
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput
product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput
customer?: Prisma.CustomerUpdateOneWithoutStockMovementsNestedInput
counterInventory?: Prisma.InventoryUpdateOneWithoutCounterStockMovementsNestedInput
} }
export type StockMovementUncheckedUpdateWithoutSupplierInput = { export type StockMovementUncheckedUpdateWithoutSupplierInput = {
@@ -1012,6 +1300,8 @@ export type StockMovementUncheckedUpdateWithoutSupplierInput = {
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
} }
export type StockMovementUncheckedUpdateManyWithoutSupplierInput = { export type StockMovementUncheckedUpdateManyWithoutSupplierInput = {
@@ -1027,6 +1317,75 @@ export type StockMovementUncheckedUpdateManyWithoutSupplierInput = {
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
}
export type StockMovementCreateManyCustomerInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
createdAt?: Date | string
productId: number
inventoryId: number
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: number | null
counterInventoryId?: number | null
}
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
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput
product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput
supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput
counterInventory?: Prisma.InventoryUpdateOneWithoutCounterStockMovementsNestedInput
}
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
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
}
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
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
} }
export type StockMovementCreateManyInventoryInput = { export type StockMovementCreateManyInventoryInput = {
@@ -1042,6 +1401,25 @@ export type StockMovementCreateManyInventoryInput = {
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: number | null supplierId?: number | null
customerId?: number | null
counterInventoryId?: number | null
}
export type StockMovementCreateManyCounterInventoryInput = {
id?: number
type: $Enums.MovementType
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
fee: runtime.Decimal | runtime.DecimalJsLike | number | string
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType: $Enums.MovementReferenceType
referenceId: string
createdAt?: Date | string
productId: number
inventoryId: number
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: number | null
customerId?: number | null
} }
export type StockMovementUpdateWithoutInventoryInput = { export type StockMovementUpdateWithoutInventoryInput = {
@@ -1056,6 +1434,8 @@ export type StockMovementUpdateWithoutInventoryInput = {
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput
supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput
customer?: Prisma.CustomerUpdateOneWithoutStockMovementsNestedInput
counterInventory?: Prisma.InventoryUpdateOneWithoutCounterStockMovementsNestedInput
} }
export type StockMovementUncheckedUpdateWithoutInventoryInput = { export type StockMovementUncheckedUpdateWithoutInventoryInput = {
@@ -1071,6 +1451,8 @@ export type StockMovementUncheckedUpdateWithoutInventoryInput = {
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
} }
export type StockMovementUncheckedUpdateManyWithoutInventoryInput = { export type StockMovementUncheckedUpdateManyWithoutInventoryInput = {
@@ -1086,6 +1468,58 @@ export type StockMovementUncheckedUpdateManyWithoutInventoryInput = {
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
counterInventoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
}
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
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput
product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput
supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput
customer?: Prisma.CustomerUpdateOneWithoutStockMovementsNestedInput
}
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
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
}
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
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
referenceType?: Prisma.EnumMovementReferenceTypeFieldUpdateOperationsInput | $Enums.MovementReferenceType
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
productId?: Prisma.IntFieldUpdateOperationsInput | number
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
remainedInStock?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
customerId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
} }
@@ -1104,9 +1538,13 @@ export type StockMovementSelect<ExtArgs extends runtime.Types.Extensions.Interna
avgCost?: boolean avgCost?: boolean
remainedInStock?: boolean remainedInStock?: boolean
supplierId?: boolean supplierId?: boolean
customerId?: boolean
counterInventoryId?: boolean
inventory?: boolean | Prisma.InventoryDefaultArgs<ExtArgs> inventory?: boolean | Prisma.InventoryDefaultArgs<ExtArgs>
product?: boolean | Prisma.ProductDefaultArgs<ExtArgs> product?: boolean | Prisma.ProductDefaultArgs<ExtArgs>
supplier?: boolean | Prisma.StockMovement$supplierArgs<ExtArgs> supplier?: boolean | Prisma.StockMovement$supplierArgs<ExtArgs>
customer?: boolean | Prisma.StockMovement$customerArgs<ExtArgs>
counterInventory?: boolean | Prisma.StockMovement$counterInventoryArgs<ExtArgs>
}, ExtArgs["result"]["stockMovement"]> }, ExtArgs["result"]["stockMovement"]>
@@ -1125,13 +1563,17 @@ export type StockMovementSelectScalar = {
avgCost?: boolean avgCost?: boolean
remainedInStock?: boolean remainedInStock?: boolean
supplierId?: boolean supplierId?: boolean
customerId?: boolean
counterInventoryId?: 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" | "remainedInStock" | "supplierId", ExtArgs["result"]["stockMovement"]> 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" | "remainedInStock" | "supplierId" | "customerId" | "counterInventoryId", ExtArgs["result"]["stockMovement"]>
export type StockMovementInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type StockMovementInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
inventory?: boolean | Prisma.InventoryDefaultArgs<ExtArgs> inventory?: boolean | Prisma.InventoryDefaultArgs<ExtArgs>
product?: boolean | Prisma.ProductDefaultArgs<ExtArgs> product?: boolean | Prisma.ProductDefaultArgs<ExtArgs>
supplier?: boolean | Prisma.StockMovement$supplierArgs<ExtArgs> supplier?: boolean | Prisma.StockMovement$supplierArgs<ExtArgs>
customer?: boolean | Prisma.StockMovement$customerArgs<ExtArgs>
counterInventory?: boolean | Prisma.StockMovement$counterInventoryArgs<ExtArgs>
} }
export type $StockMovementPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = { export type $StockMovementPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
@@ -1140,6 +1582,8 @@ export type $StockMovementPayload<ExtArgs extends runtime.Types.Extensions.Inter
inventory: Prisma.$InventoryPayload<ExtArgs> inventory: Prisma.$InventoryPayload<ExtArgs>
product: Prisma.$ProductPayload<ExtArgs> product: Prisma.$ProductPayload<ExtArgs>
supplier: Prisma.$SupplierPayload<ExtArgs> | null supplier: Prisma.$SupplierPayload<ExtArgs> | null
customer: Prisma.$CustomerPayload<ExtArgs> | null
counterInventory: Prisma.$InventoryPayload<ExtArgs> | null
} }
scalars: runtime.Types.Extensions.GetPayloadResult<{ scalars: runtime.Types.Extensions.GetPayloadResult<{
id: number id: number
@@ -1155,6 +1599,8 @@ export type $StockMovementPayload<ExtArgs extends runtime.Types.Extensions.Inter
avgCost: runtime.Decimal avgCost: runtime.Decimal
remainedInStock: runtime.Decimal remainedInStock: runtime.Decimal
supplierId: number | null supplierId: number | null
customerId: number | null
counterInventoryId: number | null
}, ExtArgs["result"]["stockMovement"]> }, ExtArgs["result"]["stockMovement"]>
composites: {} composites: {}
} }
@@ -1498,6 +1944,8 @@ export interface Prisma__StockMovementClient<T, Null = never, ExtArgs extends ru
inventory<T extends Prisma.InventoryDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.InventoryDefaultArgs<ExtArgs>>): Prisma.Prisma__InventoryClient<runtime.Types.Result.GetResult<Prisma.$InventoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> inventory<T extends Prisma.InventoryDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.InventoryDefaultArgs<ExtArgs>>): Prisma.Prisma__InventoryClient<runtime.Types.Result.GetResult<Prisma.$InventoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
product<T extends Prisma.ProductDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ProductDefaultArgs<ExtArgs>>): Prisma.Prisma__ProductClient<runtime.Types.Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> product<T extends Prisma.ProductDefaultArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.ProductDefaultArgs<ExtArgs>>): Prisma.Prisma__ProductClient<runtime.Types.Result.GetResult<Prisma.$ProductPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions>
supplier<T extends Prisma.StockMovement$supplierArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.StockMovement$supplierArgs<ExtArgs>>): Prisma.Prisma__SupplierClient<runtime.Types.Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> supplier<T extends Prisma.StockMovement$supplierArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.StockMovement$supplierArgs<ExtArgs>>): Prisma.Prisma__SupplierClient<runtime.Types.Result.GetResult<Prisma.$SupplierPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
customer<T extends Prisma.StockMovement$customerArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.StockMovement$customerArgs<ExtArgs>>): Prisma.Prisma__CustomerClient<runtime.Types.Result.GetResult<Prisma.$CustomerPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
counterInventory<T extends Prisma.StockMovement$counterInventoryArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.StockMovement$counterInventoryArgs<ExtArgs>>): Prisma.Prisma__InventoryClient<runtime.Types.Result.GetResult<Prisma.$InventoryPayload<ExtArgs>, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions>
/** /**
* Attaches callbacks for the resolution and/or rejection of the Promise. * Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved. * @param onfulfilled The callback to execute when the Promise is resolved.
@@ -1540,6 +1988,8 @@ export interface StockMovementFieldRefs {
readonly avgCost: Prisma.FieldRef<"StockMovement", 'Decimal'> readonly avgCost: Prisma.FieldRef<"StockMovement", 'Decimal'>
readonly remainedInStock: Prisma.FieldRef<"StockMovement", 'Decimal'> readonly remainedInStock: Prisma.FieldRef<"StockMovement", 'Decimal'>
readonly supplierId: Prisma.FieldRef<"StockMovement", 'Int'> readonly supplierId: Prisma.FieldRef<"StockMovement", 'Int'>
readonly customerId: Prisma.FieldRef<"StockMovement", 'Int'>
readonly counterInventoryId: Prisma.FieldRef<"StockMovement", 'Int'>
} }
@@ -1901,6 +2351,44 @@ export type StockMovement$supplierArgs<ExtArgs extends runtime.Types.Extensions.
where?: Prisma.SupplierWhereInput where?: Prisma.SupplierWhereInput
} }
/**
* StockMovement.customer
*/
export type StockMovement$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
}
/**
* StockMovement.counterInventory
*/
export type StockMovement$counterInventoryArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
/**
* Select specific fields to fetch from the Inventory
*/
select?: Prisma.InventorySelect<ExtArgs> | null
/**
* Omit specific fields from the Inventory
*/
omit?: Prisma.InventoryOmit<ExtArgs> | null
/**
* Choose, which related nodes to fetch as well
*/
include?: Prisma.InventoryInclude<ExtArgs> | null
where?: Prisma.InventoryWhereInput
}
/** /**
* StockMovement without action * StockMovement without action
*/ */
+21 -23
View File
@@ -26,31 +26,29 @@ export class CardexService {
const items = await this.prisma.stockMovement.findMany({ const items = await this.prisma.stockMovement.findMany({
where, where,
include: { product: true, inventory: true }, include: {
product: { select: { id: true, name: true, sku: true } },
inventory: { select: { id: true, name: true } },
counterInventory: {
select: { id: true, name: true },
},
supplier: {
select: { id: true, firstName: true, lastName: true },
},
customer: {
select: { id: true, firstName: true, lastName: true },
},
},
omit: {
productId: true,
inventoryId: true,
counterInventoryId: true,
supplierId: true,
customerId: true,
},
orderBy: { createdAt: 'desc' }, orderBy: { createdAt: 'desc' },
}) })
const mapped = items.map(i => ({ return ResponseMapper.list(items)
id: i.id,
type: i.type,
quantity: Number(i.quantity),
fee: Number(i.fee),
totalCost: Number(i.totalCost),
referenceType: i.referenceType,
referenceId: i.referenceId,
createdAt: i.createdAt,
avgCost: Number(i.avgCost),
product: {
name: i.product.name,
sku: i.product.sku,
id: i.productId,
},
inventory: {
name: i.inventory.name,
id: i.inventoryId,
},
}))
return ResponseMapper.list(mapped)
} }
} }