Add SQL query for average cost retrieval and generate TriggerLog model
This commit is contained in:
Vendored
+4
-1
@@ -11,5 +11,8 @@
|
|||||||
"[typescript]": {
|
"[typescript]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
},
|
},
|
||||||
"editor.formatOnSave": true
|
"editor.formatOnSave": true,
|
||||||
|
"cSpell.words": [
|
||||||
|
"Cardex"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,9 @@
|
|||||||
"@prisma/client": "^7.1.0",
|
"@prisma/client": "^7.1.0",
|
||||||
"class-transformer": "^0.5.1",
|
"class-transformer": "^0.5.1",
|
||||||
"class-validator": "^0.14.3",
|
"class-validator": "^0.14.3",
|
||||||
|
"dayjs": "^1.11.19",
|
||||||
"dotenv": "^17.2.3",
|
"dotenv": "^17.2.3",
|
||||||
|
"jalaliday": "^3.1.1",
|
||||||
"mysql2": "^3.15.3",
|
"mysql2": "^3.15.3",
|
||||||
"reflect-metadata": "^0.2.2",
|
"reflect-metadata": "^0.2.2",
|
||||||
"rxjs": "^7.8.1"
|
"rxjs": "^7.8.1"
|
||||||
|
|||||||
Generated
+20
@@ -32,9 +32,15 @@ importers:
|
|||||||
class-validator:
|
class-validator:
|
||||||
specifier: ^0.14.3
|
specifier: ^0.14.3
|
||||||
version: 0.14.3
|
version: 0.14.3
|
||||||
|
dayjs:
|
||||||
|
specifier: ^1.11.19
|
||||||
|
version: 1.11.19
|
||||||
dotenv:
|
dotenv:
|
||||||
specifier: ^17.2.3
|
specifier: ^17.2.3
|
||||||
version: 17.2.3
|
version: 17.2.3
|
||||||
|
jalaliday:
|
||||||
|
specifier: ^3.1.1
|
||||||
|
version: 3.1.1(dayjs@1.11.19)
|
||||||
mysql2:
|
mysql2:
|
||||||
specifier: ^3.15.3
|
specifier: ^3.15.3
|
||||||
version: 3.15.3
|
version: 3.15.3
|
||||||
@@ -1770,6 +1776,9 @@ packages:
|
|||||||
csstype@3.2.3:
|
csstype@3.2.3:
|
||||||
resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
|
resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==}
|
||||||
|
|
||||||
|
dayjs@1.11.19:
|
||||||
|
resolution: {integrity: sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==}
|
||||||
|
|
||||||
debug@4.4.3:
|
debug@4.4.3:
|
||||||
resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
|
resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
|
||||||
engines: {node: '>=6.0'}
|
engines: {node: '>=6.0'}
|
||||||
@@ -2363,6 +2372,11 @@ packages:
|
|||||||
jackspeak@3.4.3:
|
jackspeak@3.4.3:
|
||||||
resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==}
|
resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==}
|
||||||
|
|
||||||
|
jalaliday@3.1.1:
|
||||||
|
resolution: {integrity: sha512-exZzDOfp/32Gj2YkEHNhBBMcltBCTrIe8RXLTfpCvdjYHNfbYSQiNeFVf4RR59FV+2fixUOCEFfzOzyXfgenlg==}
|
||||||
|
peerDependencies:
|
||||||
|
dayjs: ^1.11.13
|
||||||
|
|
||||||
jest-changed-files@30.2.0:
|
jest-changed-files@30.2.0:
|
||||||
resolution: {integrity: sha512-L8lR1ChrRnSdfeOvTrwZMlnWV8G/LLjQ0nG9MBclwWZidA2N5FviRki0Bvh20WRMOX31/JYvzdqTJrk5oBdydQ==}
|
resolution: {integrity: sha512-L8lR1ChrRnSdfeOvTrwZMlnWV8G/LLjQ0nG9MBclwWZidA2N5FviRki0Bvh20WRMOX31/JYvzdqTJrk5oBdydQ==}
|
||||||
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
|
engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0}
|
||||||
@@ -5364,6 +5378,8 @@ snapshots:
|
|||||||
|
|
||||||
csstype@3.2.3: {}
|
csstype@3.2.3: {}
|
||||||
|
|
||||||
|
dayjs@1.11.19: {}
|
||||||
|
|
||||||
debug@4.4.3:
|
debug@4.4.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
ms: 2.1.3
|
ms: 2.1.3
|
||||||
@@ -5995,6 +6011,10 @@ snapshots:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@pkgjs/parseargs': 0.11.0
|
'@pkgjs/parseargs': 0.11.0
|
||||||
|
|
||||||
|
jalaliday@3.1.1(dayjs@1.11.19):
|
||||||
|
dependencies:
|
||||||
|
dayjs: 1.11.19
|
||||||
|
|
||||||
jest-changed-files@30.2.0:
|
jest-changed-files@30.2.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
execa: 5.1.1
|
execa: 5.1.1
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to alter the column `quantity` on the `Stock_Balance` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Decimal(10,2)`.
|
||||||
|
- You are about to alter the column `totalCost` on the `Stock_Balance` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Decimal(10,2)`.
|
||||||
|
- You are about to alter the column `avgCost` on the `Stock_Balance` table. The data in that column could be lost. The data in that column will be cast from `Decimal(65,30)` to `Decimal(10,2)`.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Stock_Balance` MODIFY `quantity` DECIMAL(10, 2) NOT NULL,
|
||||||
|
MODIFY `totalCost` DECIMAL(10, 2) NOT NULL,
|
||||||
|
MODIFY `avgCost` DECIMAL(10, 2) NOT NULL;
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- The primary key for the `Stock_Balance` table will be changed. If it partially fails, the table could be left without primary key constraint.
|
||||||
|
- You are about to drop the column `ProductId` on the `Stock_Balance` table. All the data in the column will be lost.
|
||||||
|
- Added the required column `inventoryId` to the `Stock_Balance` table without a default value. This is not possible if the table is not empty.
|
||||||
|
- Added the required column `productId` to the `Stock_Balance` table without a default value. This is not possible if the table is not empty.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Stock_Balance` DROP PRIMARY KEY,
|
||||||
|
DROP COLUMN `ProductId`,
|
||||||
|
ADD COLUMN `inventoryId` INTEGER NOT NULL,
|
||||||
|
ADD COLUMN `productId` INTEGER NOT NULL,
|
||||||
|
ADD PRIMARY KEY (`productId`);
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE `Stock_Balance` ADD CONSTRAINT `Stock_Balance_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE `Stock_Balance` ADD CONSTRAINT `Stock_Balance_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Inventories` ADD COLUMN `isPointOfSale` BOOLEAN NOT NULL DEFAULT false;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Stock_Movements` MODIFY `referenceType` ENUM('PURCHASE', 'SALES', 'ADJUSTMENT', 'INVENTORY_TRANSFER') NOT NULL;
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- The primary key for the `Stock_Balance` table will be changed. If it partially fails, the table could be left without primary key constraint.
|
||||||
|
- You are about to alter the column `quantity` on the `Stock_Balance` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(14,3)`.
|
||||||
|
- You are about to alter the column `totalCost` on the `Stock_Balance` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(14,2)`.
|
||||||
|
- You are about to alter the column `avgCost` on the `Stock_Balance` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,2)` to `Decimal(14,2)`.
|
||||||
|
- A unique constraint covering the columns `[productId,inventoryId]` on the table `Stock_Balance` will be added. If there are existing duplicate values, this will fail.
|
||||||
|
- Added the required column `id` to the `Stock_Balance` table without a default value. This is not possible if the table is not empty.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE `Stock_Balance` DROP FOREIGN KEY `Stock_Balance_inventoryId_fkey`;
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE `Stock_Balance` DROP FOREIGN KEY `Stock_Balance_productId_fkey`;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Products` ADD COLUMN `stockBalanceId` INTEGER NULL;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Stock_Balance` DROP PRIMARY KEY,
|
||||||
|
ADD COLUMN `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||||
|
ADD COLUMN `id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
|
MODIFY `quantity` DECIMAL(14, 3) NOT NULL DEFAULT 0,
|
||||||
|
MODIFY `totalCost` DECIMAL(14, 2) NOT NULL DEFAULT 0,
|
||||||
|
MODIFY `updatedAt` DATETIME(3) NOT NULL,
|
||||||
|
MODIFY `avgCost` DECIMAL(14, 2) NOT NULL DEFAULT 0,
|
||||||
|
ADD PRIMARY KEY (`id`);
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE `Trigger_Logs` (
|
||||||
|
`id` INTEGER NOT NULL AUTO_INCREMENT,
|
||||||
|
`message` TEXT NOT NULL,
|
||||||
|
`createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0),
|
||||||
|
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE `_StockBalance_product` (
|
||||||
|
`A` INTEGER NOT NULL,
|
||||||
|
`B` INTEGER NOT NULL,
|
||||||
|
|
||||||
|
UNIQUE INDEX `_StockBalance_product_AB_unique`(`A`, `B`),
|
||||||
|
INDEX `_StockBalance_product_B_index`(`B`)
|
||||||
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE `_StockBalance_inventory` (
|
||||||
|
`A` INTEGER NOT NULL,
|
||||||
|
`B` INTEGER NOT NULL,
|
||||||
|
|
||||||
|
UNIQUE INDEX `_StockBalance_inventory_AB_unique`(`A`, `B`),
|
||||||
|
INDEX `_StockBalance_inventory_B_index`(`B`)
|
||||||
|
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX `Stock_Balance_productId_idx` ON `Stock_Balance`(`productId`);
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX `Stock_Balance_productId_inventoryId_key` ON `Stock_Balance`(`productId`, `inventoryId`);
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE `_StockBalance_product` ADD CONSTRAINT `_StockBalance_product_A_fkey` FOREIGN KEY (`A`) REFERENCES `Products`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE `_StockBalance_product` ADD CONSTRAINT `_StockBalance_product_B_fkey` FOREIGN KEY (`B`) REFERENCES `Stock_Balance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE `_StockBalance_inventory` ADD CONSTRAINT `_StockBalance_inventory_A_fkey` FOREIGN KEY (`A`) REFERENCES `Inventories`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE `_StockBalance_inventory` ADD CONSTRAINT `_StockBalance_inventory_B_fkey` FOREIGN KEY (`B`) REFERENCES `Stock_Balance`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- RenameIndex
|
||||||
|
ALTER TABLE `Stock_Balance` RENAME INDEX `Stock_Balance_inventoryId_fkey` TO `Stock_Balance_inventoryId_idx`;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- Added the required column `name` to the `Trigger_Logs` table without a default value. This is not possible if the table is not empty.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Stock_Balance` MODIFY `updatedAt` TIMESTAMP(0) NOT NULL,
|
||||||
|
MODIFY `createdAt` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0);
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Trigger_Logs` ADD COLUMN `name` TEXT NOT NULL;
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to drop the column `stockBalanceId` on the `Products` table. All the data in the column will be lost.
|
||||||
|
- You are about to drop the `_StockBalance_inventory` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
- You are about to drop the `_StockBalance_product` table. If the table is not empty, all the data it contains will be lost.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE `_StockBalance_inventory` DROP FOREIGN KEY `_StockBalance_inventory_A_fkey`;
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE `_StockBalance_inventory` DROP FOREIGN KEY `_StockBalance_inventory_B_fkey`;
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE `_StockBalance_product` DROP FOREIGN KEY `_StockBalance_product_A_fkey`;
|
||||||
|
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE `_StockBalance_product` DROP FOREIGN KEY `_StockBalance_product_B_fkey`;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Products` DROP COLUMN `stockBalanceId`;
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Stock_Movements` ADD COLUMN `supplierId` INTEGER NULL;
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE `_StockBalance_inventory`;
|
||||||
|
|
||||||
|
-- DropTable
|
||||||
|
DROP TABLE `_StockBalance_product`;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE `Stock_Movements` ADD CONSTRAINT `Stock_Movements_supplierId_fkey` FOREIGN KEY (`supplierId`) REFERENCES `Suppliers`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE `Stock_Balance` ADD CONSTRAINT `Stock_Balance_productId_fkey` FOREIGN KEY (`productId`) REFERENCES `Products`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE `Stock_Balance` ADD CONSTRAINT `Stock_Balance_inventoryId_fkey` FOREIGN KEY (`inventoryId`) REFERENCES `Inventories`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- Added the required column `remainedInStock` to the `Stock_Movements` table without a default value. This is not possible if the table is not empty.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Stock_Movements` ADD COLUMN `remainedInStock` DECIMAL(10, 2) NOT NULL;
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE `Stock_Movements` MODIFY `remainedInStock` DECIMAL(10, 2) NOT NULL DEFAULT 0;
|
||||||
+36
-5
@@ -82,6 +82,8 @@ model Product {
|
|||||||
stockAdjustments StockAdjustment[] @relation("Product_Stock_Adjustments")
|
stockAdjustments StockAdjustment[] @relation("Product_Stock_Adjustments")
|
||||||
stockMovements StockMovement[] @relation("StockMovement_Product")
|
stockMovements StockMovement[] @relation("StockMovement_Product")
|
||||||
|
|
||||||
|
stockBalances StockBalance[] @relation("StockBalance_Product")
|
||||||
|
|
||||||
@@index([brandId], map: "Products_brandId_fkey")
|
@@index([brandId], map: "Products_brandId_fkey")
|
||||||
@@index([categoryId], map: "Products_categoryId_fkey")
|
@@index([categoryId], map: "Products_categoryId_fkey")
|
||||||
@@map("Products")
|
@@map("Products")
|
||||||
@@ -129,6 +131,7 @@ model Supplier {
|
|||||||
deletedAt DateTime? @db.Timestamp(0)
|
deletedAt DateTime? @db.Timestamp(0)
|
||||||
productCharges ProductCharge[] @relation("Supplier_Product_Charges")
|
productCharges ProductCharge[] @relation("Supplier_Product_Charges")
|
||||||
purchaseReceipts PurchaseReceipt[]
|
purchaseReceipts PurchaseReceipt[]
|
||||||
|
stockMovements StockMovement[] @relation("StockMovement_Supplier")
|
||||||
|
|
||||||
@@map("Suppliers")
|
@@map("Suppliers")
|
||||||
}
|
}
|
||||||
@@ -158,6 +161,7 @@ model Inventory {
|
|||||||
name String @db.VarChar(255)
|
name String @db.VarChar(255)
|
||||||
location String? @db.VarChar(255)
|
location String? @db.VarChar(255)
|
||||||
isActive Boolean @default(true)
|
isActive Boolean @default(true)
|
||||||
|
isPointOfSale Boolean @default(false)
|
||||||
createdAt DateTime @default(now()) @db.Timestamp(0)
|
createdAt DateTime @default(now()) @db.Timestamp(0)
|
||||||
updatedAt DateTime @updatedAt @db.Timestamp(0)
|
updatedAt DateTime @updatedAt @db.Timestamp(0)
|
||||||
deletedAt DateTime? @db.Timestamp(0)
|
deletedAt DateTime? @db.Timestamp(0)
|
||||||
@@ -167,6 +171,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")
|
||||||
|
stockBalances StockBalance[] @relation("StockBalance_inventory")
|
||||||
|
|
||||||
@@map("Inventories")
|
@@map("Inventories")
|
||||||
}
|
}
|
||||||
@@ -301,8 +306,11 @@ model StockMovement {
|
|||||||
productId Int
|
productId Int
|
||||||
inventoryId Int
|
inventoryId Int
|
||||||
avgCost Decimal @db.Decimal(10, 2)
|
avgCost Decimal @db.Decimal(10, 2)
|
||||||
|
remainedInStock Decimal @default(0) @db.Decimal(10, 2)
|
||||||
inventory Inventory @relation("StockMovement_Inventory", fields: [inventoryId], references: [id])
|
inventory Inventory @relation("StockMovement_Inventory", fields: [inventoryId], references: [id])
|
||||||
product Product @relation("StockMovement_Product", fields: [productId], references: [id])
|
product Product @relation("StockMovement_Product", fields: [productId], references: [id])
|
||||||
|
supplierId Int?
|
||||||
|
supplier Supplier? @relation("StockMovement_Supplier", fields: [supplierId], 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")
|
||||||
@@ -310,12 +318,25 @@ model StockMovement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model StockBalance {
|
model StockBalance {
|
||||||
quantity Decimal
|
id Int @id @default(autoincrement())
|
||||||
totalCost Decimal
|
|
||||||
updatedAt DateTime @default(now()) @updatedAt @db.Timestamp(0)
|
|
||||||
ProductId Int @id
|
|
||||||
avgCost Decimal
|
|
||||||
|
|
||||||
|
productId Int
|
||||||
|
inventoryId Int
|
||||||
|
|
||||||
|
quantity Decimal @default(0) @db.Decimal(14, 3)
|
||||||
|
|
||||||
|
avgCost Decimal @default(0) @db.Decimal(14, 2)
|
||||||
|
totalCost Decimal @default(0) @db.Decimal(14, 2)
|
||||||
|
|
||||||
|
createdAt DateTime @default(now()) @db.Timestamp(0)
|
||||||
|
updatedAt DateTime @updatedAt @db.Timestamp(0)
|
||||||
|
|
||||||
|
product Product @relation("StockBalance_Product", fields: [productId], references: [id])
|
||||||
|
inventory Inventory @relation("StockBalance_inventory", fields: [inventoryId], references: [id])
|
||||||
|
|
||||||
|
@@unique([productId, inventoryId])
|
||||||
|
@@index([productId])
|
||||||
|
@@index([inventoryId])
|
||||||
@@map("Stock_Balance")
|
@@map("Stock_Balance")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,6 +453,7 @@ enum MovementReferenceType {
|
|||||||
PURCHASE
|
PURCHASE
|
||||||
SALES
|
SALES
|
||||||
ADJUSTMENT
|
ADJUSTMENT
|
||||||
|
INVENTORY_TRANSFER
|
||||||
}
|
}
|
||||||
|
|
||||||
enum stock_cardex_type {
|
enum stock_cardex_type {
|
||||||
@@ -451,3 +473,12 @@ enum stock_movements_view_referenceType {
|
|||||||
SALES
|
SALES
|
||||||
ADJUSTMENT
|
ADJUSTMENT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model TriggerLog {
|
||||||
|
id Int @id @default(autoincrement())
|
||||||
|
name String @db.Text
|
||||||
|
message String @db.Text
|
||||||
|
createdAt DateTime @default(now()) @db.Timestamp(0)
|
||||||
|
|
||||||
|
@@map("Trigger_Logs")
|
||||||
|
}
|
||||||
|
|||||||
+60
-2
@@ -1,8 +1,7 @@
|
|||||||
import { prisma } from '../src/lib/prisma'
|
import { prisma } from '../src/lib/prisma'
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
console.log('first')
|
if ((await prisma.role.count()) === 0) {
|
||||||
|
|
||||||
await prisma.role.upsert({
|
await prisma.role.upsert({
|
||||||
where: { id: 0, name: 'Admin' },
|
where: { id: 0, name: 'Admin' },
|
||||||
update: {},
|
update: {},
|
||||||
@@ -11,6 +10,65 @@ async function main() {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((await prisma.inventory.count()) === 0) {
|
||||||
|
await prisma.inventory.createMany({
|
||||||
|
data: [
|
||||||
|
{ name: 'انبار مرکزی', location: 'تهران', isPointOfSale: false, isActive: true },
|
||||||
|
{
|
||||||
|
name: 'فروشگاه حضوری',
|
||||||
|
location: 'مرکز شهر',
|
||||||
|
isPointOfSale: true,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'فروشگاه اینترنتی',
|
||||||
|
location: 'مرکز شهر',
|
||||||
|
isPointOfSale: true,
|
||||||
|
isActive: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((await prisma.productCategory.count()) === 0) {
|
||||||
|
await prisma.productCategory.createMany({
|
||||||
|
data: [{ name: 'دستهی ۱' }, { name: 'دستهی ۲' }, { name: 'دستهی ۳' }],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((await prisma.productBrand.count()) === 0) {
|
||||||
|
await prisma.productBrand.createMany({
|
||||||
|
data: [{ name: 'برند ۱' }, { name: 'برند ۲' }, { name: 'برند ۳' }],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((await prisma.supplier.count()) === 0) {
|
||||||
|
await prisma.supplier.createMany({
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
firstName: 'تامین',
|
||||||
|
lastName: 'کننده ۱',
|
||||||
|
mobileNumber: '09120000001',
|
||||||
|
email: 'supplier1@example.com',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
firstName: 'تامین',
|
||||||
|
lastName: 'کننده ۲',
|
||||||
|
mobileNumber: '09120000002',
|
||||||
|
email: 'supplier2@example.com',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
firstName: 'تامین',
|
||||||
|
lastName: 'کننده 3',
|
||||||
|
mobileNumber: '09120000003',
|
||||||
|
email: 'supplier3@example.com',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await prisma.$disconnect()
|
await prisma.$disconnect()
|
||||||
|
|||||||
+130
-247
@@ -1,5 +1,5 @@
|
|||||||
-- AUTO-GENERATED MYSQL TRIGGER DUMP
|
-- AUTO-GENERATED MYSQL TRIGGER DUMP
|
||||||
-- Generated at: 2025-12-10T10:03:36.966Z
|
-- Generated at: 2025-12-13T15:37:15.132Z
|
||||||
|
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
-- Trigger: trg_transfer_item_after_insert
|
-- Trigger: trg_transfer_item_after_insert
|
||||||
@@ -9,23 +9,34 @@
|
|||||||
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;
|
||||||
|
DECLARE _avgCost DECIMAL(10,2);
|
||||||
|
DECLARE latestQuantityInOrigin DECIMAL(10,2);
|
||||||
|
DECLARE latestQuantityInDestination DECIMAL(10,2);
|
||||||
|
|
||||||
SELECT fromInventoryId, toInventoryId INTO fromInv, toInv
|
SELECT fromInventoryId, toInventoryId INTO fromInv, toInv
|
||||||
FROM Inventory_Transfers WHERE id = NEW.transferId;
|
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
|
-- OUT from source
|
||||||
INSERT INTO Stock_Movements
|
INSERT INTO Stock_Movements
|
||||||
(type, quantity, referenceType, referenceId, productId, inventoryId, createdAt)
|
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, createdAt, remainedInStock)
|
||||||
VALUES
|
VALUES
|
||||||
('OUT', NEW.count, 'InventoryTransfer', NEW.transferId, NEW.productId, fromInv, NOW());
|
('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, NOW(), latestQuantityInOrigin-NEW.count);
|
||||||
|
|
||||||
-- IN to destination
|
-- IN to destination
|
||||||
INSERT INTO Stock_Movements
|
INSERT INTO Stock_Movements
|
||||||
(type, quantity, referenceType, referenceId, productId, inventoryId, createdAt)
|
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, createdAt, remainedInStock)
|
||||||
VALUES
|
VALUES
|
||||||
('IN', NEW.count, 'InventoryTransfer', NEW.transferId, NEW.productId, toInv, NOW());
|
('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, NOW(), latestQuantityInOrigin-NEW.count);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
@@ -34,156 +45,138 @@ 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
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_insert` AFTER INSERT ON `Purchase_Receipt_Items` FOR EACH ROW BEGIN
|
||||||
INSERT INTO Stock_Movements
|
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,
|
type,
|
||||||
quantity,
|
quantity,
|
||||||
|
fee,
|
||||||
|
totalCost,
|
||||||
referenceType,
|
referenceType,
|
||||||
referenceId,
|
referenceId,
|
||||||
productId,
|
productId,
|
||||||
inventoryId,
|
inventoryId,
|
||||||
|
avgCost,
|
||||||
|
supplierId,
|
||||||
|
remainedInStock,
|
||||||
createdAt
|
createdAt
|
||||||
)
|
)
|
||||||
VALUES
|
VALUES (
|
||||||
(
|
|
||||||
'IN',
|
'IN',
|
||||||
NEW.count,
|
NEW.count,
|
||||||
|
NEW.fee,
|
||||||
|
NEW.total,
|
||||||
'PURCHASE',
|
'PURCHASE',
|
||||||
NEW.receiptId,
|
NEW.receiptId,
|
||||||
NEW.productId,
|
NEW.productId,
|
||||||
(SELECT inventoryId FROM Purchase_Receipts WHERE id = NEW.receiptId),
|
invId,
|
||||||
|
CASE
|
||||||
|
WHEN NEW.count = 0 THEN 0
|
||||||
|
ELSE NEW.total / NEW.count
|
||||||
|
END,
|
||||||
|
suppId,
|
||||||
|
latestQuantity + NEW.count,
|
||||||
NOW()
|
NOW()
|
||||||
);
|
);
|
||||||
end;
|
END;
|
||||||
|
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
-- Trigger: trg_purchase_receipt_item_after_update
|
-- Trigger: trg_stock_transfer
|
||||||
-- Event: UPDATE
|
|
||||||
-- Table: Purchase_Receipt_Items
|
|
||||||
-- ------------------------------------------
|
|
||||||
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_update`;
|
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_update` AFTER UPDATE ON `Purchase_Receipt_Items` FOR EACH ROW begin
|
|
||||||
DELETE FROM Stock_Movements
|
|
||||||
WHERE referenceType = 'PURCHASE'
|
|
||||||
AND referenceId = NEW.receiptId
|
|
||||||
AND productId = NEW.productId;
|
|
||||||
|
|
||||||
INSERT INTO Stock_Movements
|
|
||||||
(
|
|
||||||
type,
|
|
||||||
quantity,
|
|
||||||
referenceType,
|
|
||||||
referenceId,
|
|
||||||
productId,
|
|
||||||
inventoryId,
|
|
||||||
createdAt
|
|
||||||
)
|
|
||||||
VALUES
|
|
||||||
(
|
|
||||||
'IN',
|
|
||||||
NEW.count,
|
|
||||||
'SALES',
|
|
||||||
NEW.id,
|
|
||||||
NEW.productId,
|
|
||||||
(SELECT inventoryId FROM Stores LIMIT 1),
|
|
||||||
NOW()
|
|
||||||
);
|
|
||||||
end;
|
|
||||||
|
|
||||||
-- ------------------------------------------
|
|
||||||
-- Trigger: trg_purchase_receipt_item_after_delete
|
|
||||||
-- Event: DELETE
|
|
||||||
-- Table: Purchase_Receipt_Items
|
|
||||||
-- ------------------------------------------
|
|
||||||
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_delete`;
|
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_delete` AFTER DELETE ON `Purchase_Receipt_Items` FOR EACH ROW begin
|
|
||||||
DELETE FROM Stock_Movements
|
|
||||||
WHERE referenceType = 'PURCHASE'
|
|
||||||
AND referenceId = OLD.receiptId
|
|
||||||
AND productId = OLD.productId;
|
|
||||||
end;
|
|
||||||
|
|
||||||
-- ------------------------------------------
|
|
||||||
-- Trigger: trg_sales_invoice_items_before_insert
|
|
||||||
-- Event: INSERT
|
|
||||||
-- Table: Sales_Invoice_Items
|
|
||||||
-- ------------------------------------------
|
|
||||||
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_before_insert`;
|
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_before_insert` BEFORE INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin
|
|
||||||
DECLARE current_stock DECIMAL(10,2);
|
|
||||||
|
|
||||||
SELECT stock INTO current_stock
|
|
||||||
FROM stock_view
|
|
||||||
WHERE productId = NEW.productId
|
|
||||||
LIMIT 1;
|
|
||||||
|
|
||||||
IF current_stock IS NULL THEN
|
|
||||||
SET current_stock = 0;
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
IF NEW.count > current_stock THEN
|
|
||||||
SIGNAL SQLSTATE '45000'
|
|
||||||
SET MESSAGE_TEXT = 'Not enough stock to complete sale.';
|
|
||||||
END IF;
|
|
||||||
end;
|
|
||||||
|
|
||||||
-- ------------------------------------------
|
|
||||||
-- Trigger: trg_sales_invoice_items_after_insert
|
|
||||||
-- Event: INSERT
|
|
||||||
-- Table: Sales_Invoice_Items
|
|
||||||
-- ------------------------------------------
|
|
||||||
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_after_insert`;
|
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_after_insert` AFTER INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin
|
|
||||||
INSERT INTO Stock_Movements
|
|
||||||
(
|
|
||||||
type,
|
|
||||||
quantity,
|
|
||||||
referenceType,
|
|
||||||
referenceId,
|
|
||||||
productId,
|
|
||||||
inventoryId,
|
|
||||||
createdAt
|
|
||||||
)
|
|
||||||
VALUES
|
|
||||||
(
|
|
||||||
'IN',
|
|
||||||
NEW.count,
|
|
||||||
'PURCHASE',
|
|
||||||
NEW.id,
|
|
||||||
NEW.productId,
|
|
||||||
(SELECT inventoryId FROM Sales_Invoices WHERE id = NEW.id),
|
|
||||||
NOW()
|
|
||||||
);
|
|
||||||
end;
|
|
||||||
|
|
||||||
-- ------------------------------------------
|
|
||||||
-- Trigger: trg_stock_adjustment_after_insert
|
|
||||||
-- Event: INSERT
|
|
||||||
-- Table: Stock_Adjustments
|
|
||||||
-- ------------------------------------------
|
|
||||||
DROP TRIGGER IF EXISTS `trg_stock_adjustment_after_insert`;
|
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_adjustment_after_insert` AFTER INSERT ON `Stock_Adjustments` FOR EACH ROW begin
|
|
||||||
INSERT INTO Stock_Movements
|
|
||||||
(type, quantity, referenceType, referenceId, productId, inventoryId, createdAt)
|
|
||||||
VALUES
|
|
||||||
('ADJUST', NEW.adjustedQuantity, 'ADJUSTMENT', NEW.id, NEW.productId, NEW.inventoryId, NOW());
|
|
||||||
end;
|
|
||||||
|
|
||||||
-- ------------------------------------------
|
|
||||||
-- Trigger: trg_stock_sale_insert
|
|
||||||
-- Event: INSERT
|
-- Event: INSERT
|
||||||
-- Table: Stock_Movements
|
-- Table: Stock_Movements
|
||||||
-- ------------------------------------------
|
-- ------------------------------------------
|
||||||
DROP TRIGGER IF EXISTS `trg_stock_sale_insert`;
|
DROP TRIGGER IF EXISTS `trg_stock_transfer`;
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_transfer` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN
|
||||||
IF NEW.referenceType = 'SALES' THEN
|
|
||||||
|
|
||||||
UPDATE stock_balance
|
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
|
SET
|
||||||
quantity = quantity - NEW.quantity,
|
sb.quantity = sb.quantity - NEW.quantity,
|
||||||
totalCost = quantity * avgCost
|
sb.totalCost = sb.totalCost - (sb.avgCost * NEW.quantity),
|
||||||
WHERE productId = NEW.productId ;
|
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 IF;
|
||||||
END;
|
END;
|
||||||
@@ -197,12 +190,14 @@ 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
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN
|
||||||
IF NEW.referenceType = 'PURCHASE' THEN
|
IF NEW.referenceType = 'PURCHASE' THEN
|
||||||
|
|
||||||
INSERT INTO stock_balance (productId, quantity, avgCost, totalCost)
|
INSERT INTO Stock_Balance (productId, quantity, avgCost, totalCost, inventoryId, updatedAt)
|
||||||
VALUES (
|
VALUES (
|
||||||
NEW.productId,
|
NEW.productId,
|
||||||
NEW.quantity,
|
NEW.quantity,
|
||||||
NEW.fee,
|
NEW.fee,
|
||||||
NEW.totalCost
|
NEW.totalCost,
|
||||||
|
NEW.inventoryId,
|
||||||
|
NOW()
|
||||||
)
|
)
|
||||||
ON DUPLICATE KEY UPDATE
|
ON DUPLICATE KEY UPDATE
|
||||||
quantity = quantity + NEW.quantity,
|
quantity = quantity + NEW.quantity,
|
||||||
@@ -212,115 +207,3 @@ CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_insert` AFTER INSERT ON `St
|
|||||||
END IF;
|
END IF;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
-- ------------------------------------------
|
|
||||||
-- Trigger: trg_stock_movement_after_insert
|
|
||||||
-- Event: INSERT
|
|
||||||
-- Table: Stock_Movements
|
|
||||||
-- ------------------------------------------
|
|
||||||
DROP TRIGGER IF EXISTS `trg_stock_movement_after_insert`;
|
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_movement_after_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW begin
|
|
||||||
UPDATE Products pv
|
|
||||||
SET pv.quantity = (
|
|
||||||
SELECT COALESCE(SUM(
|
|
||||||
CASE
|
|
||||||
WHEN type = 'IN' THEN quantity
|
|
||||||
WHEN type = 'OUT' THEN -quantity
|
|
||||||
WHEN type = 'ADJUST' THEN quantity
|
|
||||||
END
|
|
||||||
), 0)
|
|
||||||
FROM Stock_Movements
|
|
||||||
WHERE productId = NEW.productId
|
|
||||||
)
|
|
||||||
WHERE pv.id = NEW.productId;
|
|
||||||
end;
|
|
||||||
|
|
||||||
-- ------------------------------------------
|
|
||||||
-- Trigger: trg_stock_sale_update
|
|
||||||
-- Event: UPDATE
|
|
||||||
-- Table: Stock_Movements
|
|
||||||
-- ------------------------------------------
|
|
||||||
DROP TRIGGER IF EXISTS `trg_stock_sale_update`;
|
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_update` AFTER UPDATE ON `Stock_Movements` FOR EACH ROW BEGIN
|
|
||||||
IF OLD.referenceType = 'SALES' THEN
|
|
||||||
UPDATE stock_balance
|
|
||||||
SET
|
|
||||||
quantity = quantity + OLD.quantity,
|
|
||||||
totalCost = (quantity + OLD.quantity) * avgCost
|
|
||||||
WHERE productId = OLD.productId;
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
IF NEW.referenceType = 'SALES' THEN
|
|
||||||
UPDATE stock_balance
|
|
||||||
SET
|
|
||||||
quantity = quantity - NEW.quantity,
|
|
||||||
totalCost = (quantity - NEW.quantity) * avgCost
|
|
||||||
WHERE productId = NEW.productId;
|
|
||||||
END IF;
|
|
||||||
END;
|
|
||||||
|
|
||||||
-- ------------------------------------------
|
|
||||||
-- Trigger: trg_stock_purchase_update
|
|
||||||
-- Event: UPDATE
|
|
||||||
-- Table: Stock_Movements
|
|
||||||
-- ------------------------------------------
|
|
||||||
DROP TRIGGER IF EXISTS `trg_stock_purchase_update`;
|
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_update` AFTER UPDATE ON `Stock_Movements` FOR EACH ROW BEGIN
|
|
||||||
IF OLD.referenceType = 'PURCHASE' THEN
|
|
||||||
UPDATE stock_balance
|
|
||||||
SET
|
|
||||||
quantity = quantity - OLD.quantity,
|
|
||||||
totalCost = totalCost - (OLD.quantity * OLD.fee)
|
|
||||||
WHERE productId = OLD.productId;
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
IF NEW.referenceType = 'PURCHASE' THEN
|
|
||||||
INSERT INTO stock_balance (productId, quantity, avgCost, totalCost)
|
|
||||||
VALUES (
|
|
||||||
NEW.productId,
|
|
||||||
NEW.quantity,
|
|
||||||
NEW.fee,
|
|
||||||
NEW.totalCost
|
|
||||||
)
|
|
||||||
ON DUPLICATE KEY UPDATE
|
|
||||||
quantity = quantity + NEW.quantity,
|
|
||||||
totalCost = totalCost + NEW.totalCost,
|
|
||||||
avgCost = totalCost / quantity;
|
|
||||||
END IF;
|
|
||||||
END;
|
|
||||||
|
|
||||||
-- ------------------------------------------
|
|
||||||
-- Trigger: trg_stock_sale_delete
|
|
||||||
-- Event: DELETE
|
|
||||||
-- Table: Stock_Movements
|
|
||||||
-- ------------------------------------------
|
|
||||||
DROP TRIGGER IF EXISTS `trg_stock_sale_delete`;
|
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_delete` AFTER DELETE ON `Stock_Movements` FOR EACH ROW BEGIN
|
|
||||||
IF OLD.ReferenceType = 'SALES' THEN
|
|
||||||
UPDATE stock_balance
|
|
||||||
SET
|
|
||||||
quantity = quantity + OLD.quantity,
|
|
||||||
totalCost = (quantity + OLD.quantity) * avgCost
|
|
||||||
WHERE productId = OLD.productId;
|
|
||||||
END IF;
|
|
||||||
END;
|
|
||||||
|
|
||||||
-- ------------------------------------------
|
|
||||||
-- Trigger: trg_stock_purchase_delete
|
|
||||||
-- Event: DELETE
|
|
||||||
-- Table: Stock_Movements
|
|
||||||
-- ------------------------------------------
|
|
||||||
DROP TRIGGER IF EXISTS `trg_stock_purchase_delete`;
|
|
||||||
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_delete` AFTER DELETE ON `Stock_Movements` FOR EACH ROW BEGIN
|
|
||||||
IF OLD.referenceType = 'PURCHASE' THEN
|
|
||||||
UPDATE stock_balance
|
|
||||||
SET
|
|
||||||
quantity = quantity - OLD.quantity,
|
|
||||||
totalCost = totalCost - (OLD.quantity * OLD.fee),
|
|
||||||
avgCost = CASE
|
|
||||||
WHEN quantity - OLD.quantity = 0 THEN 0
|
|
||||||
ELSE (totalCost - (OLD.quantity * OLD.fee)) / (quantity - OLD.quantity)
|
|
||||||
END
|
|
||||||
WHERE productId = OLD.productId;
|
|
||||||
END IF;
|
|
||||||
END;
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,476 @@
|
|||||||
|
-- AUTO-GENERATED MYSQL TRIGGER DUMP
|
||||||
|
-- Generated at: 2025-12-10T10:03:36.966Z
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_transfer_item_after_insert
|
||||||
|
-- Event: INSERT
|
||||||
|
-- Table: Inventory_Transfer_Items
|
||||||
|
-- Status: ACTIVE
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_transfer_item_after_insert`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_transfer_item_after_insert` AFTER INSERT ON `Inventory_Transfer_Items` FOR EACH ROW begin
|
||||||
|
|
||||||
|
|
||||||
|
DECLARE fromInv INT;
|
||||||
|
DECLARE toInv INT;
|
||||||
|
DECLARE _avgCost DECIMAL(10,2);
|
||||||
|
|
||||||
|
SELECT fromInventoryId, toInventoryId INTO fromInv, toInv
|
||||||
|
FROM Inventory_Transfers WHERE id = NEW.transferId;
|
||||||
|
|
||||||
|
SELECT COALESCE(avgCost, 0) INTO _avgCost FROM Stock_Balance
|
||||||
|
WHERE ProductId = NEW.productId AND inventoryId = fromInv LIMIT 1;
|
||||||
|
|
||||||
|
|
||||||
|
-- OUT from source
|
||||||
|
INSERT INTO Stock_Movements
|
||||||
|
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, createdAt)
|
||||||
|
VALUES
|
||||||
|
('OUT', NEW.count, _avgCost, _avgCost*NEW.count, _avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, fromInv, NOW());
|
||||||
|
|
||||||
|
-- IN to destination
|
||||||
|
INSERT INTO Stock_Movements
|
||||||
|
(type, quantity, fee, totalCost, avgCost, referenceType, referenceId, productId, inventoryId, createdAt)
|
||||||
|
VALUES
|
||||||
|
('IN', NEW.count,_avgCost, _avgCost*NEW.count,_avgCost, 'INVENTORY_TRANSFER', NEW.transferId, NEW.productId, toInv, NOW());
|
||||||
|
end;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_stock_purchase_insert
|
||||||
|
-- Event: INSERT
|
||||||
|
-- Table: Stock_Movements
|
||||||
|
-- Status: ACTIVE
|
||||||
|
-- ------------------------------------------
|
||||||
|
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)
|
||||||
|
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_transfer
|
||||||
|
-- Event: INSERT
|
||||||
|
-- Table: Stock_Movements
|
||||||
|
-- Status: ACTIVE
|
||||||
|
-- ------------------------------------------
|
||||||
|
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
|
||||||
|
|
||||||
|
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_purchase_receipt_item_after_insert
|
||||||
|
-- Event: INSERT
|
||||||
|
-- Table: Purchase_Receipt_Items
|
||||||
|
-- Status: ACTIVE
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_insert`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_insert` AFTER INSERT ON `Purchase_Receipt_Items` FOR EACH ROW begin
|
||||||
|
INSERT INTO Stock_Movements
|
||||||
|
(
|
||||||
|
type,
|
||||||
|
quantity,
|
||||||
|
fee,
|
||||||
|
totalCost,
|
||||||
|
referenceType,
|
||||||
|
referenceId,
|
||||||
|
productId,
|
||||||
|
inventoryId,
|
||||||
|
supplierId,
|
||||||
|
avgCost,
|
||||||
|
createdAt
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'IN',
|
||||||
|
NEW.count,
|
||||||
|
NEW.fee,
|
||||||
|
NEW.total,
|
||||||
|
'PURCHASE',
|
||||||
|
NEW.receiptId,
|
||||||
|
NEW.productId,
|
||||||
|
(SELECT inventoryId FROM Purchase_Receipts WHERE id = NEW.receiptId),
|
||||||
|
(SELECT supplierId FROM Purchase_Receipts WHERE id = NEW.receiptId),
|
||||||
|
NEW.total/NEW.count,
|
||||||
|
NOW()
|
||||||
|
);
|
||||||
|
end
|
||||||
|
|
||||||
|
-- NEW --
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_purchase_receipt_item_after_insert
|
||||||
|
-- Event: INSERT
|
||||||
|
-- Table: Purchase_Receipt_Items
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_insert`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_insert` AFTER INSERT ON `Purchase_Receipt_Items` FOR EACH ROW begin
|
||||||
|
INSERT INTO Stock_Movements
|
||||||
|
(
|
||||||
|
type,
|
||||||
|
quantity,
|
||||||
|
referenceType,
|
||||||
|
referenceId,
|
||||||
|
productId,
|
||||||
|
inventoryId,
|
||||||
|
createdAt
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'IN',
|
||||||
|
NEW.count,
|
||||||
|
'PURCHASE',
|
||||||
|
NEW.receiptId,
|
||||||
|
NEW.productId,
|
||||||
|
(SELECT inventoryId FROM Purchase_Receipts WHERE id = NEW.receiptId),
|
||||||
|
NOW()
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_purchase_receipt_item_after_update
|
||||||
|
-- Event: UPDATE
|
||||||
|
-- Table: Purchase_Receipt_Items
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_update`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_update` AFTER UPDATE ON `Purchase_Receipt_Items` FOR EACH ROW begin
|
||||||
|
DELETE FROM Stock_Movements
|
||||||
|
WHERE referenceType = 'PURCHASE'
|
||||||
|
AND referenceId = NEW.receiptId
|
||||||
|
AND productId = NEW.productId;
|
||||||
|
|
||||||
|
INSERT INTO Stock_Movements
|
||||||
|
(
|
||||||
|
type,
|
||||||
|
quantity,
|
||||||
|
referenceType,
|
||||||
|
referenceId,
|
||||||
|
productId,
|
||||||
|
inventoryId,
|
||||||
|
createdAt
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'IN',
|
||||||
|
NEW.count,
|
||||||
|
'SALES',
|
||||||
|
NEW.id,
|
||||||
|
NEW.productId,
|
||||||
|
(SELECT inventoryId FROM Stores LIMIT 1),
|
||||||
|
NOW()
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_purchase_receipt_item_after_delete
|
||||||
|
-- Event: DELETE
|
||||||
|
-- Table: Purchase_Receipt_Items
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_purchase_receipt_item_after_delete`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_purchase_receipt_item_after_delete` AFTER DELETE ON `Purchase_Receipt_Items` FOR EACH ROW begin
|
||||||
|
DELETE FROM Stock_Movements
|
||||||
|
WHERE referenceType = 'PURCHASE'
|
||||||
|
AND referenceId = OLD.receiptId
|
||||||
|
AND productId = OLD.productId;
|
||||||
|
end;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_sales_invoice_items_before_insert
|
||||||
|
-- Event: INSERT
|
||||||
|
-- Table: Sales_Invoice_Items
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_before_insert`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_before_insert` BEFORE INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin
|
||||||
|
DECLARE current_stock DECIMAL(10,2);
|
||||||
|
|
||||||
|
SELECT stock INTO current_stock
|
||||||
|
FROM stock_view
|
||||||
|
WHERE productId = NEW.productId
|
||||||
|
LIMIT 1;
|
||||||
|
|
||||||
|
IF current_stock IS NULL THEN
|
||||||
|
SET current_stock = 0;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF NEW.count > current_stock THEN
|
||||||
|
SIGNAL SQLSTATE '45000'
|
||||||
|
SET MESSAGE_TEXT = 'Not enough stock to complete sale.';
|
||||||
|
END IF;
|
||||||
|
end;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_sales_invoice_items_after_insert
|
||||||
|
-- Event: INSERT
|
||||||
|
-- Table: Sales_Invoice_Items
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_sales_invoice_items_after_insert`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_sales_invoice_items_after_insert` AFTER INSERT ON `Sales_Invoice_Items` FOR EACH ROW begin
|
||||||
|
INSERT INTO Stock_Movements
|
||||||
|
(
|
||||||
|
type,
|
||||||
|
quantity,
|
||||||
|
referenceType,
|
||||||
|
referenceId,
|
||||||
|
productId,
|
||||||
|
inventoryId,
|
||||||
|
createdAt
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
'IN',
|
||||||
|
NEW.count,
|
||||||
|
'PURCHASE',
|
||||||
|
NEW.id,
|
||||||
|
NEW.productId,
|
||||||
|
(SELECT inventoryId FROM Sales_Invoices WHERE id = NEW.id),
|
||||||
|
NOW()
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_stock_adjustment_after_insert
|
||||||
|
-- Event: INSERT
|
||||||
|
-- Table: Stock_Adjustments
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_stock_adjustment_after_insert`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_adjustment_after_insert` AFTER INSERT ON `Stock_Adjustments` FOR EACH ROW begin
|
||||||
|
INSERT INTO Stock_Movements
|
||||||
|
(type, quantity, referenceType, referenceId, productId, inventoryId, createdAt)
|
||||||
|
VALUES
|
||||||
|
('ADJUST', NEW.adjustedQuantity, 'ADJUSTMENT', NEW.id, NEW.productId, NEW.inventoryId, NOW());
|
||||||
|
end;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_stock_sale_insert
|
||||||
|
-- Event: INSERT
|
||||||
|
-- Table: Stock_Movements
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_stock_sale_insert`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW BEGIN
|
||||||
|
IF NEW.referenceType = 'SALES' THEN
|
||||||
|
|
||||||
|
UPDATE stock_balance
|
||||||
|
SET
|
||||||
|
quantity = quantity - NEW.quantity,
|
||||||
|
totalCost = quantity * avgCost
|
||||||
|
WHERE productId = NEW.productId ;
|
||||||
|
|
||||||
|
END IF;
|
||||||
|
END;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_stock_movement_after_insert
|
||||||
|
-- Event: INSERT
|
||||||
|
-- Table: Stock_Movements
|
||||||
|
-- Status: ARCHIVED
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_stock_movement_after_insert`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_movement_after_insert` AFTER INSERT ON `Stock_Movements` FOR EACH ROW begin
|
||||||
|
UPDATE Products pv
|
||||||
|
SET pv.quantity = (
|
||||||
|
SELECT COALESCE(SUM(
|
||||||
|
CASE
|
||||||
|
WHEN type = 'IN' THEN quantity
|
||||||
|
WHEN type = 'OUT' THEN -quantity
|
||||||
|
WHEN type = 'ADJUST' THEN quantity
|
||||||
|
END
|
||||||
|
), 0)
|
||||||
|
FROM Stock_Movements
|
||||||
|
WHERE productId = NEW.productId
|
||||||
|
)
|
||||||
|
WHERE pv.id = NEW.productId;
|
||||||
|
end;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_stock_sale_update
|
||||||
|
-- Event: UPDATE
|
||||||
|
-- Table: Stock_Movements
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_stock_sale_update`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_update` AFTER UPDATE ON `Stock_Movements` FOR EACH ROW BEGIN
|
||||||
|
IF OLD.referenceType = 'SALES' THEN
|
||||||
|
UPDATE stock_balance
|
||||||
|
SET
|
||||||
|
quantity = quantity + OLD.quantity,
|
||||||
|
totalCost = (quantity + OLD.quantity) * avgCost
|
||||||
|
WHERE productId = OLD.productId;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF NEW.referenceType = 'SALES' THEN
|
||||||
|
UPDATE stock_balance
|
||||||
|
SET
|
||||||
|
quantity = quantity - NEW.quantity,
|
||||||
|
totalCost = (quantity - NEW.quantity) * avgCost
|
||||||
|
WHERE productId = NEW.productId;
|
||||||
|
END IF;
|
||||||
|
END;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_stock_purchase_update
|
||||||
|
-- Event: UPDATE
|
||||||
|
-- Table: Stock_Movements
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_stock_purchase_update`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_update` AFTER UPDATE ON `Stock_Movements` FOR EACH ROW BEGIN
|
||||||
|
IF OLD.referenceType = 'PURCHASE' THEN
|
||||||
|
UPDATE stock_balance
|
||||||
|
SET
|
||||||
|
quantity = quantity - OLD.quantity,
|
||||||
|
totalCost = totalCost - (OLD.quantity * OLD.fee)
|
||||||
|
WHERE productId = OLD.productId;
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
IF NEW.referenceType = 'PURCHASE' THEN
|
||||||
|
INSERT INTO stock_balance (productId, quantity, avgCost, totalCost)
|
||||||
|
VALUES (
|
||||||
|
NEW.productId,
|
||||||
|
NEW.quantity,
|
||||||
|
NEW.fee,
|
||||||
|
NEW.totalCost
|
||||||
|
)
|
||||||
|
ON DUPLICATE KEY UPDATE
|
||||||
|
quantity = quantity + NEW.quantity,
|
||||||
|
totalCost = totalCost + NEW.totalCost,
|
||||||
|
avgCost = totalCost / quantity;
|
||||||
|
END IF;
|
||||||
|
END;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_stock_sale_delete
|
||||||
|
-- Event: DELETE
|
||||||
|
-- Table: Stock_Movements
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_stock_sale_delete`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_sale_delete` AFTER DELETE ON `Stock_Movements` FOR EACH ROW BEGIN
|
||||||
|
IF OLD.ReferenceType = 'SALES' THEN
|
||||||
|
UPDATE stock_balance
|
||||||
|
SET
|
||||||
|
quantity = quantity + OLD.quantity,
|
||||||
|
totalCost = (quantity + OLD.quantity) * avgCost
|
||||||
|
WHERE productId = OLD.productId;
|
||||||
|
END IF;
|
||||||
|
END;
|
||||||
|
|
||||||
|
-- ------------------------------------------
|
||||||
|
-- Trigger: trg_stock_purchase_delete
|
||||||
|
-- Event: DELETE
|
||||||
|
-- Table: Stock_Movements
|
||||||
|
-- ------------------------------------------
|
||||||
|
DROP TRIGGER IF EXISTS `trg_stock_purchase_delete`;
|
||||||
|
|
||||||
|
CREATE DEFINER=`pos`@`%` TRIGGER `trg_stock_purchase_delete` AFTER DELETE ON `Stock_Movements` FOR EACH ROW BEGIN
|
||||||
|
IF OLD.referenceType = 'PURCHASE' THEN
|
||||||
|
UPDATE stock_balance
|
||||||
|
SET
|
||||||
|
quantity = quantity - OLD.quantity,
|
||||||
|
totalCost = totalCost - (OLD.quantity * OLD.fee),
|
||||||
|
avgCost = CASE
|
||||||
|
WHEN quantity - OLD.quantity = 0 THEN 0
|
||||||
|
ELSE (totalCost - (OLD.quantity * OLD.fee)) / (quantity - OLD.quantity)
|
||||||
|
END
|
||||||
|
WHERE productId = OLD.productId;
|
||||||
|
END IF;
|
||||||
|
END;
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
SELECT avgCost FROM Stock_Balance
|
||||||
|
WHERE ProductId = 1 And inventoryId = 1;
|
||||||
@@ -122,6 +122,11 @@ export type InventoryTransferItem = Prisma.InventoryTransferItemModel
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export type StockAdjustment = Prisma.StockAdjustmentModel
|
export type StockAdjustment = Prisma.StockAdjustmentModel
|
||||||
|
/**
|
||||||
|
* Model TriggerLog
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export type TriggerLog = Prisma.TriggerLogModel
|
||||||
/**
|
/**
|
||||||
* Model inventory_overview
|
* Model inventory_overview
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -142,6 +142,11 @@ export type InventoryTransferItem = Prisma.InventoryTransferItemModel
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export type StockAdjustment = Prisma.StockAdjustmentModel
|
export type StockAdjustment = Prisma.StockAdjustmentModel
|
||||||
|
/**
|
||||||
|
* Model TriggerLog
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
export type TriggerLog = Prisma.TriggerLogModel
|
||||||
/**
|
/**
|
||||||
* Model inventory_overview
|
* Model inventory_overview
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -38,7 +38,8 @@ export type MovementType = (typeof MovementType)[keyof typeof MovementType]
|
|||||||
export const MovementReferenceType = {
|
export const MovementReferenceType = {
|
||||||
PURCHASE: 'PURCHASE',
|
PURCHASE: 'PURCHASE',
|
||||||
SALES: 'SALES',
|
SALES: 'SALES',
|
||||||
ADJUSTMENT: 'ADJUSTMENT'
|
ADJUSTMENT: 'ADJUSTMENT',
|
||||||
|
INVENTORY_TRANSFER: 'INVENTORY_TRANSFER'
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export type MovementReferenceType = (typeof MovementReferenceType)[keyof typeof MovementReferenceType]
|
export type MovementReferenceType = (typeof MovementReferenceType)[keyof typeof MovementReferenceType]
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -405,6 +405,7 @@ export const ModelName = {
|
|||||||
InventoryTransfer: 'InventoryTransfer',
|
InventoryTransfer: 'InventoryTransfer',
|
||||||
InventoryTransferItem: 'InventoryTransferItem',
|
InventoryTransferItem: 'InventoryTransferItem',
|
||||||
StockAdjustment: 'StockAdjustment',
|
StockAdjustment: 'StockAdjustment',
|
||||||
|
TriggerLog: 'TriggerLog',
|
||||||
inventory_overview: 'inventory_overview',
|
inventory_overview: 'inventory_overview',
|
||||||
stock_cardex: 'stock_cardex',
|
stock_cardex: 'stock_cardex',
|
||||||
stock_view: 'stock_view'
|
stock_view: 'stock_view'
|
||||||
@@ -423,7 +424,7 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
|||||||
omit: GlobalOmitOptions
|
omit: GlobalOmitOptions
|
||||||
}
|
}
|
||||||
meta: {
|
meta: {
|
||||||
modelProps: "user" | "role" | "productVariant" | "product" | "productBrand" | "productCategory" | "supplier" | "customer" | "inventory" | "store" | "productCharge" | "order" | "purchaseReceipt" | "purchaseReceiptItem" | "salesInvoice" | "salesInvoiceItem" | "stockMovement" | "stockBalance" | "inventoryTransfer" | "inventoryTransferItem" | "stockAdjustment" | "inventory_overview" | "stock_cardex" | "stock_view"
|
modelProps: "user" | "role" | "productVariant" | "product" | "productBrand" | "productCategory" | "supplier" | "customer" | "inventory" | "store" | "productCharge" | "order" | "purchaseReceipt" | "purchaseReceiptItem" | "salesInvoice" | "salesInvoiceItem" | "stockMovement" | "stockBalance" | "inventoryTransfer" | "inventoryTransferItem" | "stockAdjustment" | "triggerLog" | "inventory_overview" | "stock_cardex" | "stock_view"
|
||||||
txIsolationLevel: TransactionIsolationLevel
|
txIsolationLevel: TransactionIsolationLevel
|
||||||
}
|
}
|
||||||
model: {
|
model: {
|
||||||
@@ -1813,6 +1814,72 @@ export type TypeMap<ExtArgs extends runtime.Types.Extensions.InternalArgs = runt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
TriggerLog: {
|
||||||
|
payload: Prisma.$TriggerLogPayload<ExtArgs>
|
||||||
|
fields: Prisma.TriggerLogFieldRefs
|
||||||
|
operations: {
|
||||||
|
findUnique: {
|
||||||
|
args: Prisma.TriggerLogFindUniqueArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.PayloadToResult<Prisma.$TriggerLogPayload> | null
|
||||||
|
}
|
||||||
|
findUniqueOrThrow: {
|
||||||
|
args: Prisma.TriggerLogFindUniqueOrThrowArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.PayloadToResult<Prisma.$TriggerLogPayload>
|
||||||
|
}
|
||||||
|
findFirst: {
|
||||||
|
args: Prisma.TriggerLogFindFirstArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.PayloadToResult<Prisma.$TriggerLogPayload> | null
|
||||||
|
}
|
||||||
|
findFirstOrThrow: {
|
||||||
|
args: Prisma.TriggerLogFindFirstOrThrowArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.PayloadToResult<Prisma.$TriggerLogPayload>
|
||||||
|
}
|
||||||
|
findMany: {
|
||||||
|
args: Prisma.TriggerLogFindManyArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.PayloadToResult<Prisma.$TriggerLogPayload>[]
|
||||||
|
}
|
||||||
|
create: {
|
||||||
|
args: Prisma.TriggerLogCreateArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.PayloadToResult<Prisma.$TriggerLogPayload>
|
||||||
|
}
|
||||||
|
createMany: {
|
||||||
|
args: Prisma.TriggerLogCreateManyArgs<ExtArgs>
|
||||||
|
result: BatchPayload
|
||||||
|
}
|
||||||
|
delete: {
|
||||||
|
args: Prisma.TriggerLogDeleteArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.PayloadToResult<Prisma.$TriggerLogPayload>
|
||||||
|
}
|
||||||
|
update: {
|
||||||
|
args: Prisma.TriggerLogUpdateArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.PayloadToResult<Prisma.$TriggerLogPayload>
|
||||||
|
}
|
||||||
|
deleteMany: {
|
||||||
|
args: Prisma.TriggerLogDeleteManyArgs<ExtArgs>
|
||||||
|
result: BatchPayload
|
||||||
|
}
|
||||||
|
updateMany: {
|
||||||
|
args: Prisma.TriggerLogUpdateManyArgs<ExtArgs>
|
||||||
|
result: BatchPayload
|
||||||
|
}
|
||||||
|
upsert: {
|
||||||
|
args: Prisma.TriggerLogUpsertArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.PayloadToResult<Prisma.$TriggerLogPayload>
|
||||||
|
}
|
||||||
|
aggregate: {
|
||||||
|
args: Prisma.TriggerLogAggregateArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.Optional<Prisma.AggregateTriggerLog>
|
||||||
|
}
|
||||||
|
groupBy: {
|
||||||
|
args: Prisma.TriggerLogGroupByArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.Optional<Prisma.TriggerLogGroupByOutputType>[]
|
||||||
|
}
|
||||||
|
count: {
|
||||||
|
args: Prisma.TriggerLogCountArgs<ExtArgs>
|
||||||
|
result: runtime.Types.Utils.Optional<Prisma.TriggerLogCountAggregateOutputType> | number
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
inventory_overview: {
|
inventory_overview: {
|
||||||
payload: Prisma.$inventory_overviewPayload<ExtArgs>
|
payload: Prisma.$inventory_overviewPayload<ExtArgs>
|
||||||
fields: Prisma.inventory_overviewFieldRefs
|
fields: Prisma.inventory_overviewFieldRefs
|
||||||
@@ -2077,6 +2144,7 @@ export const InventoryScalarFieldEnum = {
|
|||||||
name: 'name',
|
name: 'name',
|
||||||
location: 'location',
|
location: 'location',
|
||||||
isActive: 'isActive',
|
isActive: 'isActive',
|
||||||
|
isPointOfSale: 'isPointOfSale',
|
||||||
createdAt: 'createdAt',
|
createdAt: 'createdAt',
|
||||||
updatedAt: 'updatedAt',
|
updatedAt: 'updatedAt',
|
||||||
deletedAt: 'deletedAt'
|
deletedAt: 'deletedAt'
|
||||||
@@ -2197,18 +2265,23 @@ export const StockMovementScalarFieldEnum = {
|
|||||||
createdAt: 'createdAt',
|
createdAt: 'createdAt',
|
||||||
productId: 'productId',
|
productId: 'productId',
|
||||||
inventoryId: 'inventoryId',
|
inventoryId: 'inventoryId',
|
||||||
avgCost: 'avgCost'
|
avgCost: 'avgCost',
|
||||||
|
remainedInStock: 'remainedInStock',
|
||||||
|
supplierId: 'supplierId'
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export type StockMovementScalarFieldEnum = (typeof StockMovementScalarFieldEnum)[keyof typeof StockMovementScalarFieldEnum]
|
export type StockMovementScalarFieldEnum = (typeof StockMovementScalarFieldEnum)[keyof typeof StockMovementScalarFieldEnum]
|
||||||
|
|
||||||
|
|
||||||
export const StockBalanceScalarFieldEnum = {
|
export const StockBalanceScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
productId: 'productId',
|
||||||
|
inventoryId: 'inventoryId',
|
||||||
quantity: 'quantity',
|
quantity: 'quantity',
|
||||||
|
avgCost: 'avgCost',
|
||||||
totalCost: 'totalCost',
|
totalCost: 'totalCost',
|
||||||
updatedAt: 'updatedAt',
|
createdAt: 'createdAt',
|
||||||
ProductId: 'ProductId',
|
updatedAt: 'updatedAt'
|
||||||
avgCost: 'avgCost'
|
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export type StockBalanceScalarFieldEnum = (typeof StockBalanceScalarFieldEnum)[keyof typeof StockBalanceScalarFieldEnum]
|
export type StockBalanceScalarFieldEnum = (typeof StockBalanceScalarFieldEnum)[keyof typeof StockBalanceScalarFieldEnum]
|
||||||
@@ -2247,6 +2320,16 @@ export const StockAdjustmentScalarFieldEnum = {
|
|||||||
export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldEnum)[keyof typeof StockAdjustmentScalarFieldEnum]
|
export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldEnum)[keyof typeof StockAdjustmentScalarFieldEnum]
|
||||||
|
|
||||||
|
|
||||||
|
export const TriggerLogScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
name: 'name',
|
||||||
|
message: 'message',
|
||||||
|
createdAt: 'createdAt'
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export type TriggerLogScalarFieldEnum = (typeof TriggerLogScalarFieldEnum)[keyof typeof TriggerLogScalarFieldEnum]
|
||||||
|
|
||||||
|
|
||||||
export const Inventory_overviewScalarFieldEnum = {
|
export const Inventory_overviewScalarFieldEnum = {
|
||||||
ProductId: 'ProductId',
|
ProductId: 'ProductId',
|
||||||
stock_quantity: 'stock_quantity',
|
stock_quantity: 'stock_quantity',
|
||||||
@@ -2476,6 +2559,14 @@ export const InventoryTransferOrderByRelevanceFieldEnum = {
|
|||||||
export type InventoryTransferOrderByRelevanceFieldEnum = (typeof InventoryTransferOrderByRelevanceFieldEnum)[keyof typeof InventoryTransferOrderByRelevanceFieldEnum]
|
export type InventoryTransferOrderByRelevanceFieldEnum = (typeof InventoryTransferOrderByRelevanceFieldEnum)[keyof typeof InventoryTransferOrderByRelevanceFieldEnum]
|
||||||
|
|
||||||
|
|
||||||
|
export const TriggerLogOrderByRelevanceFieldEnum = {
|
||||||
|
name: 'name',
|
||||||
|
message: 'message'
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export type TriggerLogOrderByRelevanceFieldEnum = (typeof TriggerLogOrderByRelevanceFieldEnum)[keyof typeof TriggerLogOrderByRelevanceFieldEnum]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Field references
|
* Field references
|
||||||
@@ -2688,6 +2779,7 @@ export type GlobalOmitConfig = {
|
|||||||
inventoryTransfer?: Prisma.InventoryTransferOmit
|
inventoryTransfer?: Prisma.InventoryTransferOmit
|
||||||
inventoryTransferItem?: Prisma.InventoryTransferItemOmit
|
inventoryTransferItem?: Prisma.InventoryTransferItemOmit
|
||||||
stockAdjustment?: Prisma.StockAdjustmentOmit
|
stockAdjustment?: Prisma.StockAdjustmentOmit
|
||||||
|
triggerLog?: Prisma.TriggerLogOmit
|
||||||
inventory_overview?: Prisma.inventory_overviewOmit
|
inventory_overview?: Prisma.inventory_overviewOmit
|
||||||
stock_cardex?: Prisma.stock_cardexOmit
|
stock_cardex?: Prisma.stock_cardexOmit
|
||||||
stock_view?: Prisma.stock_viewOmit
|
stock_view?: Prisma.stock_viewOmit
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ export const ModelName = {
|
|||||||
InventoryTransfer: 'InventoryTransfer',
|
InventoryTransfer: 'InventoryTransfer',
|
||||||
InventoryTransferItem: 'InventoryTransferItem',
|
InventoryTransferItem: 'InventoryTransferItem',
|
||||||
StockAdjustment: 'StockAdjustment',
|
StockAdjustment: 'StockAdjustment',
|
||||||
|
TriggerLog: 'TriggerLog',
|
||||||
inventory_overview: 'inventory_overview',
|
inventory_overview: 'inventory_overview',
|
||||||
stock_cardex: 'stock_cardex',
|
stock_cardex: 'stock_cardex',
|
||||||
stock_view: 'stock_view'
|
stock_view: 'stock_view'
|
||||||
@@ -228,6 +229,7 @@ export const InventoryScalarFieldEnum = {
|
|||||||
name: 'name',
|
name: 'name',
|
||||||
location: 'location',
|
location: 'location',
|
||||||
isActive: 'isActive',
|
isActive: 'isActive',
|
||||||
|
isPointOfSale: 'isPointOfSale',
|
||||||
createdAt: 'createdAt',
|
createdAt: 'createdAt',
|
||||||
updatedAt: 'updatedAt',
|
updatedAt: 'updatedAt',
|
||||||
deletedAt: 'deletedAt'
|
deletedAt: 'deletedAt'
|
||||||
@@ -348,18 +350,23 @@ export const StockMovementScalarFieldEnum = {
|
|||||||
createdAt: 'createdAt',
|
createdAt: 'createdAt',
|
||||||
productId: 'productId',
|
productId: 'productId',
|
||||||
inventoryId: 'inventoryId',
|
inventoryId: 'inventoryId',
|
||||||
avgCost: 'avgCost'
|
avgCost: 'avgCost',
|
||||||
|
remainedInStock: 'remainedInStock',
|
||||||
|
supplierId: 'supplierId'
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export type StockMovementScalarFieldEnum = (typeof StockMovementScalarFieldEnum)[keyof typeof StockMovementScalarFieldEnum]
|
export type StockMovementScalarFieldEnum = (typeof StockMovementScalarFieldEnum)[keyof typeof StockMovementScalarFieldEnum]
|
||||||
|
|
||||||
|
|
||||||
export const StockBalanceScalarFieldEnum = {
|
export const StockBalanceScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
productId: 'productId',
|
||||||
|
inventoryId: 'inventoryId',
|
||||||
quantity: 'quantity',
|
quantity: 'quantity',
|
||||||
|
avgCost: 'avgCost',
|
||||||
totalCost: 'totalCost',
|
totalCost: 'totalCost',
|
||||||
updatedAt: 'updatedAt',
|
createdAt: 'createdAt',
|
||||||
ProductId: 'ProductId',
|
updatedAt: 'updatedAt'
|
||||||
avgCost: 'avgCost'
|
|
||||||
} as const
|
} as const
|
||||||
|
|
||||||
export type StockBalanceScalarFieldEnum = (typeof StockBalanceScalarFieldEnum)[keyof typeof StockBalanceScalarFieldEnum]
|
export type StockBalanceScalarFieldEnum = (typeof StockBalanceScalarFieldEnum)[keyof typeof StockBalanceScalarFieldEnum]
|
||||||
@@ -398,6 +405,16 @@ export const StockAdjustmentScalarFieldEnum = {
|
|||||||
export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldEnum)[keyof typeof StockAdjustmentScalarFieldEnum]
|
export type StockAdjustmentScalarFieldEnum = (typeof StockAdjustmentScalarFieldEnum)[keyof typeof StockAdjustmentScalarFieldEnum]
|
||||||
|
|
||||||
|
|
||||||
|
export const TriggerLogScalarFieldEnum = {
|
||||||
|
id: 'id',
|
||||||
|
name: 'name',
|
||||||
|
message: 'message',
|
||||||
|
createdAt: 'createdAt'
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export type TriggerLogScalarFieldEnum = (typeof TriggerLogScalarFieldEnum)[keyof typeof TriggerLogScalarFieldEnum]
|
||||||
|
|
||||||
|
|
||||||
export const Inventory_overviewScalarFieldEnum = {
|
export const Inventory_overviewScalarFieldEnum = {
|
||||||
ProductId: 'ProductId',
|
ProductId: 'ProductId',
|
||||||
stock_quantity: 'stock_quantity',
|
stock_quantity: 'stock_quantity',
|
||||||
@@ -626,3 +643,11 @@ export const InventoryTransferOrderByRelevanceFieldEnum = {
|
|||||||
|
|
||||||
export type InventoryTransferOrderByRelevanceFieldEnum = (typeof InventoryTransferOrderByRelevanceFieldEnum)[keyof typeof InventoryTransferOrderByRelevanceFieldEnum]
|
export type InventoryTransferOrderByRelevanceFieldEnum = (typeof InventoryTransferOrderByRelevanceFieldEnum)[keyof typeof InventoryTransferOrderByRelevanceFieldEnum]
|
||||||
|
|
||||||
|
|
||||||
|
export const TriggerLogOrderByRelevanceFieldEnum = {
|
||||||
|
name: 'name',
|
||||||
|
message: 'message'
|
||||||
|
} as const
|
||||||
|
|
||||||
|
export type TriggerLogOrderByRelevanceFieldEnum = (typeof TriggerLogOrderByRelevanceFieldEnum)[keyof typeof TriggerLogOrderByRelevanceFieldEnum]
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export type * from './models/StockBalance.js'
|
|||||||
export type * from './models/InventoryTransfer.js'
|
export type * from './models/InventoryTransfer.js'
|
||||||
export type * from './models/InventoryTransferItem.js'
|
export type * from './models/InventoryTransferItem.js'
|
||||||
export type * from './models/StockAdjustment.js'
|
export type * from './models/StockAdjustment.js'
|
||||||
|
export type * from './models/TriggerLog.js'
|
||||||
export type * from './models/inventory_overview.js'
|
export type * from './models/inventory_overview.js'
|
||||||
export type * from './models/stock_cardex.js'
|
export type * from './models/stock_cardex.js'
|
||||||
export type * from './models/stock_view.js'
|
export type * from './models/stock_view.js'
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ export type InventoryMinAggregateOutputType = {
|
|||||||
name: string | null
|
name: string | null
|
||||||
location: string | null
|
location: string | null
|
||||||
isActive: boolean | null
|
isActive: boolean | null
|
||||||
|
isPointOfSale: boolean | null
|
||||||
createdAt: Date | null
|
createdAt: Date | null
|
||||||
updatedAt: Date | null
|
updatedAt: Date | null
|
||||||
deletedAt: Date | null
|
deletedAt: Date | null
|
||||||
@@ -49,6 +50,7 @@ export type InventoryMaxAggregateOutputType = {
|
|||||||
name: string | null
|
name: string | null
|
||||||
location: string | null
|
location: string | null
|
||||||
isActive: boolean | null
|
isActive: boolean | null
|
||||||
|
isPointOfSale: boolean | null
|
||||||
createdAt: Date | null
|
createdAt: Date | null
|
||||||
updatedAt: Date | null
|
updatedAt: Date | null
|
||||||
deletedAt: Date | null
|
deletedAt: Date | null
|
||||||
@@ -59,6 +61,7 @@ export type InventoryCountAggregateOutputType = {
|
|||||||
name: number
|
name: number
|
||||||
location: number
|
location: number
|
||||||
isActive: number
|
isActive: number
|
||||||
|
isPointOfSale: number
|
||||||
createdAt: number
|
createdAt: number
|
||||||
updatedAt: number
|
updatedAt: number
|
||||||
deletedAt: number
|
deletedAt: number
|
||||||
@@ -79,6 +82,7 @@ export type InventoryMinAggregateInputType = {
|
|||||||
name?: true
|
name?: true
|
||||||
location?: true
|
location?: true
|
||||||
isActive?: true
|
isActive?: true
|
||||||
|
isPointOfSale?: true
|
||||||
createdAt?: true
|
createdAt?: true
|
||||||
updatedAt?: true
|
updatedAt?: true
|
||||||
deletedAt?: true
|
deletedAt?: true
|
||||||
@@ -89,6 +93,7 @@ export type InventoryMaxAggregateInputType = {
|
|||||||
name?: true
|
name?: true
|
||||||
location?: true
|
location?: true
|
||||||
isActive?: true
|
isActive?: true
|
||||||
|
isPointOfSale?: true
|
||||||
createdAt?: true
|
createdAt?: true
|
||||||
updatedAt?: true
|
updatedAt?: true
|
||||||
deletedAt?: true
|
deletedAt?: true
|
||||||
@@ -99,6 +104,7 @@ export type InventoryCountAggregateInputType = {
|
|||||||
name?: true
|
name?: true
|
||||||
location?: true
|
location?: true
|
||||||
isActive?: true
|
isActive?: true
|
||||||
|
isPointOfSale?: true
|
||||||
createdAt?: true
|
createdAt?: true
|
||||||
updatedAt?: true
|
updatedAt?: true
|
||||||
deletedAt?: true
|
deletedAt?: true
|
||||||
@@ -196,6 +202,7 @@ export type InventoryGroupByOutputType = {
|
|||||||
name: string
|
name: string
|
||||||
location: string | null
|
location: string | null
|
||||||
isActive: boolean
|
isActive: boolean
|
||||||
|
isPointOfSale: boolean
|
||||||
createdAt: Date
|
createdAt: Date
|
||||||
updatedAt: Date
|
updatedAt: Date
|
||||||
deletedAt: Date | null
|
deletedAt: Date | null
|
||||||
@@ -229,6 +236,7 @@ export type InventoryWhereInput = {
|
|||||||
name?: Prisma.StringFilter<"Inventory"> | string
|
name?: Prisma.StringFilter<"Inventory"> | string
|
||||||
location?: Prisma.StringNullableFilter<"Inventory"> | string | null
|
location?: Prisma.StringNullableFilter<"Inventory"> | string | null
|
||||||
isActive?: Prisma.BoolFilter<"Inventory"> | boolean
|
isActive?: Prisma.BoolFilter<"Inventory"> | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFilter<"Inventory"> | boolean
|
||||||
createdAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string
|
createdAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string
|
updatedAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string
|
||||||
deletedAt?: Prisma.DateTimeNullableFilter<"Inventory"> | Date | string | null
|
deletedAt?: Prisma.DateTimeNullableFilter<"Inventory"> | Date | string | null
|
||||||
@@ -238,6 +246,7 @@ export type InventoryWhereInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter
|
purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter
|
||||||
stockAdjustments?: Prisma.StockAdjustmentListRelationFilter
|
stockAdjustments?: Prisma.StockAdjustmentListRelationFilter
|
||||||
stockMovements?: Prisma.StockMovementListRelationFilter
|
stockMovements?: Prisma.StockMovementListRelationFilter
|
||||||
|
stockBalances?: Prisma.StockBalanceListRelationFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryOrderByWithRelationInput = {
|
export type InventoryOrderByWithRelationInput = {
|
||||||
@@ -245,6 +254,7 @@ export type InventoryOrderByWithRelationInput = {
|
|||||||
name?: Prisma.SortOrder
|
name?: Prisma.SortOrder
|
||||||
location?: Prisma.SortOrderInput | Prisma.SortOrder
|
location?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||||
isActive?: Prisma.SortOrder
|
isActive?: Prisma.SortOrder
|
||||||
|
isPointOfSale?: Prisma.SortOrder
|
||||||
createdAt?: Prisma.SortOrder
|
createdAt?: Prisma.SortOrder
|
||||||
updatedAt?: Prisma.SortOrder
|
updatedAt?: Prisma.SortOrder
|
||||||
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||||
@@ -254,6 +264,7 @@ export type InventoryOrderByWithRelationInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput
|
purchaseReceipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentOrderByRelationAggregateInput
|
stockAdjustments?: Prisma.StockAdjustmentOrderByRelationAggregateInput
|
||||||
stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
|
stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
|
||||||
|
stockBalances?: Prisma.StockBalanceOrderByRelationAggregateInput
|
||||||
_relevance?: Prisma.InventoryOrderByRelevanceInput
|
_relevance?: Prisma.InventoryOrderByRelevanceInput
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,6 +276,7 @@ export type InventoryWhereUniqueInput = Prisma.AtLeast<{
|
|||||||
name?: Prisma.StringFilter<"Inventory"> | string
|
name?: Prisma.StringFilter<"Inventory"> | string
|
||||||
location?: Prisma.StringNullableFilter<"Inventory"> | string | null
|
location?: Prisma.StringNullableFilter<"Inventory"> | string | null
|
||||||
isActive?: Prisma.BoolFilter<"Inventory"> | boolean
|
isActive?: Prisma.BoolFilter<"Inventory"> | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFilter<"Inventory"> | boolean
|
||||||
createdAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string
|
createdAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string
|
updatedAt?: Prisma.DateTimeFilter<"Inventory"> | Date | string
|
||||||
deletedAt?: Prisma.DateTimeNullableFilter<"Inventory"> | Date | string | null
|
deletedAt?: Prisma.DateTimeNullableFilter<"Inventory"> | Date | string | null
|
||||||
@@ -274,6 +286,7 @@ export type InventoryWhereUniqueInput = Prisma.AtLeast<{
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter
|
purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter
|
||||||
stockAdjustments?: Prisma.StockAdjustmentListRelationFilter
|
stockAdjustments?: Prisma.StockAdjustmentListRelationFilter
|
||||||
stockMovements?: Prisma.StockMovementListRelationFilter
|
stockMovements?: Prisma.StockMovementListRelationFilter
|
||||||
|
stockBalances?: Prisma.StockBalanceListRelationFilter
|
||||||
}, "id">
|
}, "id">
|
||||||
|
|
||||||
export type InventoryOrderByWithAggregationInput = {
|
export type InventoryOrderByWithAggregationInput = {
|
||||||
@@ -281,6 +294,7 @@ export type InventoryOrderByWithAggregationInput = {
|
|||||||
name?: Prisma.SortOrder
|
name?: Prisma.SortOrder
|
||||||
location?: Prisma.SortOrderInput | Prisma.SortOrder
|
location?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||||
isActive?: Prisma.SortOrder
|
isActive?: Prisma.SortOrder
|
||||||
|
isPointOfSale?: Prisma.SortOrder
|
||||||
createdAt?: Prisma.SortOrder
|
createdAt?: Prisma.SortOrder
|
||||||
updatedAt?: Prisma.SortOrder
|
updatedAt?: Prisma.SortOrder
|
||||||
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||||
@@ -299,6 +313,7 @@ export type InventoryScalarWhereWithAggregatesInput = {
|
|||||||
name?: Prisma.StringWithAggregatesFilter<"Inventory"> | string
|
name?: Prisma.StringWithAggregatesFilter<"Inventory"> | string
|
||||||
location?: Prisma.StringNullableWithAggregatesFilter<"Inventory"> | string | null
|
location?: Prisma.StringNullableWithAggregatesFilter<"Inventory"> | string | null
|
||||||
isActive?: Prisma.BoolWithAggregatesFilter<"Inventory"> | boolean
|
isActive?: Prisma.BoolWithAggregatesFilter<"Inventory"> | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolWithAggregatesFilter<"Inventory"> | boolean
|
||||||
createdAt?: Prisma.DateTimeWithAggregatesFilter<"Inventory"> | Date | string
|
createdAt?: Prisma.DateTimeWithAggregatesFilter<"Inventory"> | Date | string
|
||||||
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Inventory"> | Date | string
|
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Inventory"> | Date | string
|
||||||
deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Inventory"> | Date | string | null
|
deletedAt?: Prisma.DateTimeNullableWithAggregatesFilter<"Inventory"> | Date | string | null
|
||||||
@@ -308,6 +323,7 @@ export type InventoryCreateInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -317,6 +333,7 @@ export type InventoryCreateInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedCreateInput = {
|
export type InventoryUncheckedCreateInput = {
|
||||||
@@ -324,6 +341,7 @@ export type InventoryUncheckedCreateInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -333,12 +351,14 @@ export type InventoryUncheckedCreateInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUpdateInput = {
|
export type InventoryUpdateInput = {
|
||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -348,6 +368,7 @@ export type InventoryUpdateInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedUpdateInput = {
|
export type InventoryUncheckedUpdateInput = {
|
||||||
@@ -355,6 +376,7 @@ export type InventoryUncheckedUpdateInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -364,6 +386,7 @@ export type InventoryUncheckedUpdateInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateManyInput = {
|
export type InventoryCreateManyInput = {
|
||||||
@@ -371,6 +394,7 @@ export type InventoryCreateManyInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -380,6 +404,7 @@ export type InventoryUpdateManyMutationInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -390,6 +415,7 @@ export type InventoryUncheckedUpdateManyInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -406,6 +432,7 @@ export type InventoryCountOrderByAggregateInput = {
|
|||||||
name?: Prisma.SortOrder
|
name?: Prisma.SortOrder
|
||||||
location?: Prisma.SortOrder
|
location?: Prisma.SortOrder
|
||||||
isActive?: Prisma.SortOrder
|
isActive?: Prisma.SortOrder
|
||||||
|
isPointOfSale?: Prisma.SortOrder
|
||||||
createdAt?: Prisma.SortOrder
|
createdAt?: Prisma.SortOrder
|
||||||
updatedAt?: Prisma.SortOrder
|
updatedAt?: Prisma.SortOrder
|
||||||
deletedAt?: Prisma.SortOrder
|
deletedAt?: Prisma.SortOrder
|
||||||
@@ -420,6 +447,7 @@ export type InventoryMaxOrderByAggregateInput = {
|
|||||||
name?: Prisma.SortOrder
|
name?: Prisma.SortOrder
|
||||||
location?: Prisma.SortOrder
|
location?: Prisma.SortOrder
|
||||||
isActive?: Prisma.SortOrder
|
isActive?: Prisma.SortOrder
|
||||||
|
isPointOfSale?: Prisma.SortOrder
|
||||||
createdAt?: Prisma.SortOrder
|
createdAt?: Prisma.SortOrder
|
||||||
updatedAt?: Prisma.SortOrder
|
updatedAt?: Prisma.SortOrder
|
||||||
deletedAt?: Prisma.SortOrder
|
deletedAt?: Prisma.SortOrder
|
||||||
@@ -430,6 +458,7 @@ export type InventoryMinOrderByAggregateInput = {
|
|||||||
name?: Prisma.SortOrder
|
name?: Prisma.SortOrder
|
||||||
location?: Prisma.SortOrder
|
location?: Prisma.SortOrder
|
||||||
isActive?: Prisma.SortOrder
|
isActive?: Prisma.SortOrder
|
||||||
|
isPointOfSale?: Prisma.SortOrder
|
||||||
createdAt?: Prisma.SortOrder
|
createdAt?: Prisma.SortOrder
|
||||||
updatedAt?: Prisma.SortOrder
|
updatedAt?: Prisma.SortOrder
|
||||||
deletedAt?: Prisma.SortOrder
|
deletedAt?: Prisma.SortOrder
|
||||||
@@ -486,6 +515,20 @@ 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 InventoryCreateNestedOneWithoutStockBalancesInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.InventoryCreateWithoutStockBalancesInput, Prisma.InventoryUncheckedCreateWithoutStockBalancesInput>
|
||||||
|
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockBalancesInput
|
||||||
|
connect?: Prisma.InventoryWhereUniqueInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type InventoryUpdateOneRequiredWithoutStockBalancesNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.InventoryCreateWithoutStockBalancesInput, Prisma.InventoryUncheckedCreateWithoutStockBalancesInput>
|
||||||
|
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutStockBalancesInput
|
||||||
|
upsert?: Prisma.InventoryUpsertWithoutStockBalancesInput
|
||||||
|
connect?: Prisma.InventoryWhereUniqueInput
|
||||||
|
update?: Prisma.XOR<Prisma.XOR<Prisma.InventoryUpdateToOneWithWhereWithoutStockBalancesInput, Prisma.InventoryUpdateWithoutStockBalancesInput>, Prisma.InventoryUncheckedUpdateWithoutStockBalancesInput>
|
||||||
|
}
|
||||||
|
|
||||||
export type InventoryCreateNestedOneWithoutInventoryTransfersFromInput = {
|
export type InventoryCreateNestedOneWithoutInventoryTransfersFromInput = {
|
||||||
create?: Prisma.XOR<Prisma.InventoryCreateWithoutInventoryTransfersFromInput, Prisma.InventoryUncheckedCreateWithoutInventoryTransfersFromInput>
|
create?: Prisma.XOR<Prisma.InventoryCreateWithoutInventoryTransfersFromInput, Prisma.InventoryUncheckedCreateWithoutInventoryTransfersFromInput>
|
||||||
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryTransfersFromInput
|
connectOrCreate?: Prisma.InventoryCreateOrConnectWithoutInventoryTransfersFromInput
|
||||||
@@ -532,6 +575,7 @@ export type InventoryCreateWithoutProductChargesInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -540,6 +584,7 @@ export type InventoryCreateWithoutProductChargesInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedCreateWithoutProductChargesInput = {
|
export type InventoryUncheckedCreateWithoutProductChargesInput = {
|
||||||
@@ -547,6 +592,7 @@ export type InventoryUncheckedCreateWithoutProductChargesInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -555,6 +601,7 @@ export type InventoryUncheckedCreateWithoutProductChargesInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateOrConnectWithoutProductChargesInput = {
|
export type InventoryCreateOrConnectWithoutProductChargesInput = {
|
||||||
@@ -577,6 +624,7 @@ export type InventoryUpdateWithoutProductChargesInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -585,6 +633,7 @@ export type InventoryUpdateWithoutProductChargesInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedUpdateWithoutProductChargesInput = {
|
export type InventoryUncheckedUpdateWithoutProductChargesInput = {
|
||||||
@@ -592,6 +641,7 @@ export type InventoryUncheckedUpdateWithoutProductChargesInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -600,12 +650,14 @@ export type InventoryUncheckedUpdateWithoutProductChargesInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateWithoutPurchaseReceiptsInput = {
|
export type InventoryCreateWithoutPurchaseReceiptsInput = {
|
||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -614,6 +666,7 @@ export type InventoryCreateWithoutPurchaseReceiptsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput
|
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = {
|
export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = {
|
||||||
@@ -621,6 +674,7 @@ export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -629,6 +683,7 @@ export type InventoryUncheckedCreateWithoutPurchaseReceiptsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput
|
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateOrConnectWithoutPurchaseReceiptsInput = {
|
export type InventoryCreateOrConnectWithoutPurchaseReceiptsInput = {
|
||||||
@@ -651,6 +706,7 @@ export type InventoryUpdateWithoutPurchaseReceiptsInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -659,6 +715,7 @@ export type InventoryUpdateWithoutPurchaseReceiptsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput
|
productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = {
|
export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = {
|
||||||
@@ -666,6 +723,7 @@ export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -674,12 +732,14 @@ export type InventoryUncheckedUpdateWithoutPurchaseReceiptsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput
|
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateWithoutStockMovementsInput = {
|
export type InventoryCreateWithoutStockMovementsInput = {
|
||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -688,6 +748,7 @@ export type InventoryCreateWithoutStockMovementsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput
|
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedCreateWithoutStockMovementsInput = {
|
export type InventoryUncheckedCreateWithoutStockMovementsInput = {
|
||||||
@@ -695,6 +756,7 @@ export type InventoryUncheckedCreateWithoutStockMovementsInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -703,6 +765,7 @@ export type InventoryUncheckedCreateWithoutStockMovementsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput
|
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateOrConnectWithoutStockMovementsInput = {
|
export type InventoryCreateOrConnectWithoutStockMovementsInput = {
|
||||||
@@ -725,6 +788,7 @@ export type InventoryUpdateWithoutStockMovementsInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -733,6 +797,7 @@ export type InventoryUpdateWithoutStockMovementsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput
|
productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedUpdateWithoutStockMovementsInput = {
|
export type InventoryUncheckedUpdateWithoutStockMovementsInput = {
|
||||||
@@ -740,6 +805,7 @@ export type InventoryUncheckedUpdateWithoutStockMovementsInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -748,12 +814,96 @@ export type InventoryUncheckedUpdateWithoutStockMovementsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput
|
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type InventoryCreateWithoutStockBalancesInput = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
export type InventoryUncheckedCreateWithoutStockBalancesInput = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
export type InventoryCreateOrConnectWithoutStockBalancesInput = {
|
||||||
|
where: Prisma.InventoryWhereUniqueInput
|
||||||
|
create: Prisma.XOR<Prisma.InventoryCreateWithoutStockBalancesInput, Prisma.InventoryUncheckedCreateWithoutStockBalancesInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type InventoryUpsertWithoutStockBalancesInput = {
|
||||||
|
update: Prisma.XOR<Prisma.InventoryUpdateWithoutStockBalancesInput, Prisma.InventoryUncheckedUpdateWithoutStockBalancesInput>
|
||||||
|
create: Prisma.XOR<Prisma.InventoryCreateWithoutStockBalancesInput, Prisma.InventoryUncheckedCreateWithoutStockBalancesInput>
|
||||||
|
where?: Prisma.InventoryWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type InventoryUpdateToOneWithWhereWithoutStockBalancesInput = {
|
||||||
|
where?: Prisma.InventoryWhereInput
|
||||||
|
data: Prisma.XOR<Prisma.InventoryUpdateWithoutStockBalancesInput, Prisma.InventoryUncheckedUpdateWithoutStockBalancesInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type InventoryUpdateWithoutStockBalancesInput = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
export type InventoryUncheckedUpdateWithoutStockBalancesInput = {
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateWithoutInventoryTransfersFromInput = {
|
export type InventoryCreateWithoutInventoryTransfersFromInput = {
|
||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -762,6 +912,7 @@ export type InventoryCreateWithoutInventoryTransfersFromInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = {
|
export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = {
|
||||||
@@ -769,6 +920,7 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -777,6 +929,7 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersFromInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateOrConnectWithoutInventoryTransfersFromInput = {
|
export type InventoryCreateOrConnectWithoutInventoryTransfersFromInput = {
|
||||||
@@ -788,6 +941,7 @@ export type InventoryCreateWithoutInventoryTransfersToInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -796,6 +950,7 @@ export type InventoryCreateWithoutInventoryTransfersToInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = {
|
export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = {
|
||||||
@@ -803,6 +958,7 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -811,6 +967,7 @@ export type InventoryUncheckedCreateWithoutInventoryTransfersToInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateOrConnectWithoutInventoryTransfersToInput = {
|
export type InventoryCreateOrConnectWithoutInventoryTransfersToInput = {
|
||||||
@@ -833,6 +990,7 @@ export type InventoryUpdateWithoutInventoryTransfersFromInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -841,6 +999,7 @@ export type InventoryUpdateWithoutInventoryTransfersFromInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = {
|
export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = {
|
||||||
@@ -848,6 +1007,7 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -856,6 +1016,7 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersFromInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUpsertWithoutInventoryTransfersToInput = {
|
export type InventoryUpsertWithoutInventoryTransfersToInput = {
|
||||||
@@ -873,6 +1034,7 @@ export type InventoryUpdateWithoutInventoryTransfersToInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -881,6 +1043,7 @@ export type InventoryUpdateWithoutInventoryTransfersToInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = {
|
export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = {
|
||||||
@@ -888,6 +1051,7 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -896,12 +1060,14 @@ export type InventoryUncheckedUpdateWithoutInventoryTransfersToInput = {
|
|||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateWithoutStockAdjustmentsInput = {
|
export type InventoryCreateWithoutStockAdjustmentsInput = {
|
||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -910,6 +1076,7 @@ export type InventoryCreateWithoutStockAdjustmentsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput
|
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutInventoryInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = {
|
export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = {
|
||||||
@@ -917,6 +1084,7 @@ export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = {
|
|||||||
name: string
|
name: string
|
||||||
location?: string | null
|
location?: string | null
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
@@ -925,6 +1093,7 @@ export type InventoryUncheckedCreateWithoutStockAdjustmentsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput
|
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutInventoryInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCreateOrConnectWithoutStockAdjustmentsInput = {
|
export type InventoryCreateOrConnectWithoutStockAdjustmentsInput = {
|
||||||
@@ -947,6 +1116,7 @@ export type InventoryUpdateWithoutStockAdjustmentsInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -955,6 +1125,7 @@ export type InventoryUpdateWithoutStockAdjustmentsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput
|
productCharges?: Prisma.ProductChargeUpdateManyWithoutInventoryNestedInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = {
|
export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = {
|
||||||
@@ -962,6 +1133,7 @@ export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = {
|
|||||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
location?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
isPointOfSale?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
@@ -970,6 +1142,7 @@ export type InventoryUncheckedUpdateWithoutStockAdjustmentsInput = {
|
|||||||
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput
|
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -984,6 +1157,7 @@ export type InventoryCountOutputType = {
|
|||||||
purchaseReceipts: number
|
purchaseReceipts: number
|
||||||
stockAdjustments: number
|
stockAdjustments: number
|
||||||
stockMovements: number
|
stockMovements: number
|
||||||
|
stockBalances: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
export type InventoryCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
@@ -993,6 +1167,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
|
||||||
|
stockBalances?: boolean | InventoryCountOutputTypeCountStockBalancesArgs
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1047,12 +1222,20 @@ export type InventoryCountOutputTypeCountStockMovementsArgs<ExtArgs extends runt
|
|||||||
where?: Prisma.StockMovementWhereInput
|
where?: Prisma.StockMovementWhereInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* InventoryCountOutputType without action
|
||||||
|
*/
|
||||||
|
export type InventoryCountOutputTypeCountStockBalancesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
where?: Prisma.StockBalanceWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export type InventorySelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
export type InventorySelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||||
id?: boolean
|
id?: boolean
|
||||||
name?: boolean
|
name?: boolean
|
||||||
location?: boolean
|
location?: boolean
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: boolean
|
createdAt?: boolean
|
||||||
updatedAt?: boolean
|
updatedAt?: boolean
|
||||||
deletedAt?: boolean
|
deletedAt?: boolean
|
||||||
@@ -1062,6 +1245,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>
|
||||||
|
stockBalances?: boolean | Prisma.Inventory$stockBalancesArgs<ExtArgs>
|
||||||
_count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs<ExtArgs>
|
_count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs<ExtArgs>
|
||||||
}, ExtArgs["result"]["inventory"]>
|
}, ExtArgs["result"]["inventory"]>
|
||||||
|
|
||||||
@@ -1072,12 +1256,13 @@ export type InventorySelectScalar = {
|
|||||||
name?: boolean
|
name?: boolean
|
||||||
location?: boolean
|
location?: boolean
|
||||||
isActive?: boolean
|
isActive?: boolean
|
||||||
|
isPointOfSale?: boolean
|
||||||
createdAt?: boolean
|
createdAt?: boolean
|
||||||
updatedAt?: boolean
|
updatedAt?: boolean
|
||||||
deletedAt?: boolean
|
deletedAt?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type InventoryOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "location" | "isActive" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["inventory"]>
|
export type InventoryOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "name" | "location" | "isActive" | "isPointOfSale" | "createdAt" | "updatedAt" | "deletedAt", ExtArgs["result"]["inventory"]>
|
||||||
export type InventoryInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
export type InventoryInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
inventoryTransfersFrom?: boolean | Prisma.Inventory$inventoryTransfersFromArgs<ExtArgs>
|
inventoryTransfersFrom?: boolean | Prisma.Inventory$inventoryTransfersFromArgs<ExtArgs>
|
||||||
inventoryTransfersTo?: boolean | Prisma.Inventory$inventoryTransfersToArgs<ExtArgs>
|
inventoryTransfersTo?: boolean | Prisma.Inventory$inventoryTransfersToArgs<ExtArgs>
|
||||||
@@ -1085,6 +1270,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>
|
||||||
|
stockBalances?: boolean | Prisma.Inventory$stockBalancesArgs<ExtArgs>
|
||||||
_count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs<ExtArgs>
|
_count?: boolean | Prisma.InventoryCountOutputTypeDefaultArgs<ExtArgs>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1097,12 +1283,14 @@ 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>[]
|
||||||
|
stockBalances: Prisma.$StockBalancePayload<ExtArgs>[]
|
||||||
}
|
}
|
||||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||||
id: number
|
id: number
|
||||||
name: string
|
name: string
|
||||||
location: string | null
|
location: string | null
|
||||||
isActive: boolean
|
isActive: boolean
|
||||||
|
isPointOfSale: boolean
|
||||||
createdAt: Date
|
createdAt: Date
|
||||||
updatedAt: Date
|
updatedAt: Date
|
||||||
deletedAt: Date | null
|
deletedAt: Date | null
|
||||||
@@ -1452,6 +1640,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>
|
||||||
|
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>
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
@@ -1485,6 +1674,7 @@ export interface InventoryFieldRefs {
|
|||||||
readonly name: Prisma.FieldRef<"Inventory", 'String'>
|
readonly name: Prisma.FieldRef<"Inventory", 'String'>
|
||||||
readonly location: Prisma.FieldRef<"Inventory", 'String'>
|
readonly location: Prisma.FieldRef<"Inventory", 'String'>
|
||||||
readonly isActive: Prisma.FieldRef<"Inventory", 'Boolean'>
|
readonly isActive: Prisma.FieldRef<"Inventory", 'Boolean'>
|
||||||
|
readonly isPointOfSale: Prisma.FieldRef<"Inventory", 'Boolean'>
|
||||||
readonly createdAt: Prisma.FieldRef<"Inventory", 'DateTime'>
|
readonly createdAt: Prisma.FieldRef<"Inventory", 'DateTime'>
|
||||||
readonly updatedAt: Prisma.FieldRef<"Inventory", 'DateTime'>
|
readonly updatedAt: Prisma.FieldRef<"Inventory", 'DateTime'>
|
||||||
readonly deletedAt: Prisma.FieldRef<"Inventory", 'DateTime'>
|
readonly deletedAt: Prisma.FieldRef<"Inventory", 'DateTime'>
|
||||||
@@ -1974,6 +2164,30 @@ export type Inventory$stockMovementsArgs<ExtArgs extends runtime.Types.Extension
|
|||||||
distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[]
|
distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inventory.stockBalances
|
||||||
|
*/
|
||||||
|
export type Inventory$stockBalancesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
/**
|
||||||
|
* Select specific fields to fetch from the StockBalance
|
||||||
|
*/
|
||||||
|
select?: Prisma.StockBalanceSelect<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Omit specific fields from the StockBalance
|
||||||
|
*/
|
||||||
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
|
where?: Prisma.StockBalanceWhereInput
|
||||||
|
orderBy?: Prisma.StockBalanceOrderByWithRelationInput | Prisma.StockBalanceOrderByWithRelationInput[]
|
||||||
|
cursor?: Prisma.StockBalanceWhereUniqueInput
|
||||||
|
take?: number
|
||||||
|
skip?: number
|
||||||
|
distinct?: Prisma.StockBalanceScalarFieldEnum | Prisma.StockBalanceScalarFieldEnum[]
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inventory without action
|
* Inventory without action
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -273,6 +273,7 @@ export type ProductWhereInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter
|
salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter
|
||||||
stockAdjustments?: Prisma.StockAdjustmentListRelationFilter
|
stockAdjustments?: Prisma.StockAdjustmentListRelationFilter
|
||||||
stockMovements?: Prisma.StockMovementListRelationFilter
|
stockMovements?: Prisma.StockMovementListRelationFilter
|
||||||
|
stockBalances?: Prisma.StockBalanceListRelationFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductOrderByWithRelationInput = {
|
export type ProductOrderByWithRelationInput = {
|
||||||
@@ -295,6 +296,7 @@ export type ProductOrderByWithRelationInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemOrderByRelationAggregateInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentOrderByRelationAggregateInput
|
stockAdjustments?: Prisma.StockAdjustmentOrderByRelationAggregateInput
|
||||||
stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
|
stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
|
||||||
|
stockBalances?: Prisma.StockBalanceOrderByRelationAggregateInput
|
||||||
_relevance?: Prisma.ProductOrderByRelevanceInput
|
_relevance?: Prisma.ProductOrderByRelevanceInput
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,6 +323,7 @@ export type ProductWhereUniqueInput = Prisma.AtLeast<{
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter
|
salesInvoiceItems?: Prisma.SalesInvoiceItemListRelationFilter
|
||||||
stockAdjustments?: Prisma.StockAdjustmentListRelationFilter
|
stockAdjustments?: Prisma.StockAdjustmentListRelationFilter
|
||||||
stockMovements?: Prisma.StockMovementListRelationFilter
|
stockMovements?: Prisma.StockMovementListRelationFilter
|
||||||
|
stockBalances?: Prisma.StockBalanceListRelationFilter
|
||||||
}, "id" | "sku" | "barcode">
|
}, "id" | "sku" | "barcode">
|
||||||
|
|
||||||
export type ProductOrderByWithAggregationInput = {
|
export type ProductOrderByWithAggregationInput = {
|
||||||
@@ -374,6 +377,7 @@ export type ProductCreateInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedCreateInput = {
|
export type ProductUncheckedCreateInput = {
|
||||||
@@ -394,6 +398,7 @@ export type ProductUncheckedCreateInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUpdateInput = {
|
export type ProductUpdateInput = {
|
||||||
@@ -413,6 +418,7 @@ export type ProductUpdateInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateInput = {
|
export type ProductUncheckedUpdateInput = {
|
||||||
@@ -433,6 +439,7 @@ export type ProductUncheckedUpdateInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateManyInput = {
|
export type ProductCreateManyInput = {
|
||||||
@@ -705,6 +712,20 @@ export type ProductUpdateOneRequiredWithoutStockMovementsNestedInput = {
|
|||||||
update?: Prisma.XOR<Prisma.XOR<Prisma.ProductUpdateToOneWithWhereWithoutStockMovementsInput, Prisma.ProductUpdateWithoutStockMovementsInput>, Prisma.ProductUncheckedUpdateWithoutStockMovementsInput>
|
update?: Prisma.XOR<Prisma.XOR<Prisma.ProductUpdateToOneWithWhereWithoutStockMovementsInput, Prisma.ProductUpdateWithoutStockMovementsInput>, Prisma.ProductUncheckedUpdateWithoutStockMovementsInput>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ProductCreateNestedOneWithoutStockBalancesInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.ProductCreateWithoutStockBalancesInput, Prisma.ProductUncheckedCreateWithoutStockBalancesInput>
|
||||||
|
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutStockBalancesInput
|
||||||
|
connect?: Prisma.ProductWhereUniqueInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ProductUpdateOneRequiredWithoutStockBalancesNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.ProductCreateWithoutStockBalancesInput, Prisma.ProductUncheckedCreateWithoutStockBalancesInput>
|
||||||
|
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutStockBalancesInput
|
||||||
|
upsert?: Prisma.ProductUpsertWithoutStockBalancesInput
|
||||||
|
connect?: Prisma.ProductWhereUniqueInput
|
||||||
|
update?: Prisma.XOR<Prisma.XOR<Prisma.ProductUpdateToOneWithWhereWithoutStockBalancesInput, Prisma.ProductUpdateWithoutStockBalancesInput>, Prisma.ProductUncheckedUpdateWithoutStockBalancesInput>
|
||||||
|
}
|
||||||
|
|
||||||
export type ProductCreateNestedOneWithoutInventoryTransferItemsInput = {
|
export type ProductCreateNestedOneWithoutInventoryTransferItemsInput = {
|
||||||
create?: Prisma.XOR<Prisma.ProductCreateWithoutInventoryTransferItemsInput, Prisma.ProductUncheckedCreateWithoutInventoryTransferItemsInput>
|
create?: Prisma.XOR<Prisma.ProductCreateWithoutInventoryTransferItemsInput, Prisma.ProductUncheckedCreateWithoutInventoryTransferItemsInput>
|
||||||
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutInventoryTransferItemsInput
|
connectOrCreate?: Prisma.ProductCreateOrConnectWithoutInventoryTransferItemsInput
|
||||||
@@ -749,6 +770,7 @@ export type ProductCreateWithoutVariantsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedCreateWithoutVariantsInput = {
|
export type ProductUncheckedCreateWithoutVariantsInput = {
|
||||||
@@ -768,6 +790,7 @@ export type ProductUncheckedCreateWithoutVariantsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateOrConnectWithoutVariantsInput = {
|
export type ProductCreateOrConnectWithoutVariantsInput = {
|
||||||
@@ -802,6 +825,7 @@ export type ProductUpdateWithoutVariantsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateWithoutVariantsInput = {
|
export type ProductUncheckedUpdateWithoutVariantsInput = {
|
||||||
@@ -821,6 +845,7 @@ export type ProductUncheckedUpdateWithoutVariantsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateWithoutBrandInput = {
|
export type ProductCreateWithoutBrandInput = {
|
||||||
@@ -839,6 +864,7 @@ export type ProductCreateWithoutBrandInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedCreateWithoutBrandInput = {
|
export type ProductUncheckedCreateWithoutBrandInput = {
|
||||||
@@ -858,6 +884,7 @@ export type ProductUncheckedCreateWithoutBrandInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateOrConnectWithoutBrandInput = {
|
export type ProductCreateOrConnectWithoutBrandInput = {
|
||||||
@@ -918,6 +945,7 @@ export type ProductCreateWithoutCategoryInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedCreateWithoutCategoryInput = {
|
export type ProductUncheckedCreateWithoutCategoryInput = {
|
||||||
@@ -937,6 +965,7 @@ export type ProductUncheckedCreateWithoutCategoryInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateOrConnectWithoutCategoryInput = {
|
export type ProductCreateOrConnectWithoutCategoryInput = {
|
||||||
@@ -981,6 +1010,7 @@ export type ProductCreateWithoutProductChargesInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedCreateWithoutProductChargesInput = {
|
export type ProductUncheckedCreateWithoutProductChargesInput = {
|
||||||
@@ -1000,6 +1030,7 @@ export type ProductUncheckedCreateWithoutProductChargesInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateOrConnectWithoutProductChargesInput = {
|
export type ProductCreateOrConnectWithoutProductChargesInput = {
|
||||||
@@ -1034,6 +1065,7 @@ export type ProductUpdateWithoutProductChargesInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateWithoutProductChargesInput = {
|
export type ProductUncheckedUpdateWithoutProductChargesInput = {
|
||||||
@@ -1053,6 +1085,7 @@ export type ProductUncheckedUpdateWithoutProductChargesInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateWithoutPurchaseReceiptItemsInput = {
|
export type ProductCreateWithoutPurchaseReceiptItemsInput = {
|
||||||
@@ -1071,6 +1104,7 @@ export type ProductCreateWithoutPurchaseReceiptItemsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedCreateWithoutPurchaseReceiptItemsInput = {
|
export type ProductUncheckedCreateWithoutPurchaseReceiptItemsInput = {
|
||||||
@@ -1090,6 +1124,7 @@ export type ProductUncheckedCreateWithoutPurchaseReceiptItemsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateOrConnectWithoutPurchaseReceiptItemsInput = {
|
export type ProductCreateOrConnectWithoutPurchaseReceiptItemsInput = {
|
||||||
@@ -1124,6 +1159,7 @@ export type ProductUpdateWithoutPurchaseReceiptItemsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateWithoutPurchaseReceiptItemsInput = {
|
export type ProductUncheckedUpdateWithoutPurchaseReceiptItemsInput = {
|
||||||
@@ -1143,6 +1179,7 @@ export type ProductUncheckedUpdateWithoutPurchaseReceiptItemsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateWithoutSalesInvoiceItemsInput = {
|
export type ProductCreateWithoutSalesInvoiceItemsInput = {
|
||||||
@@ -1161,6 +1198,7 @@ export type ProductCreateWithoutSalesInvoiceItemsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedCreateWithoutSalesInvoiceItemsInput = {
|
export type ProductUncheckedCreateWithoutSalesInvoiceItemsInput = {
|
||||||
@@ -1180,6 +1218,7 @@ export type ProductUncheckedCreateWithoutSalesInvoiceItemsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateOrConnectWithoutSalesInvoiceItemsInput = {
|
export type ProductCreateOrConnectWithoutSalesInvoiceItemsInput = {
|
||||||
@@ -1214,6 +1253,7 @@ export type ProductUpdateWithoutSalesInvoiceItemsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateWithoutSalesInvoiceItemsInput = {
|
export type ProductUncheckedUpdateWithoutSalesInvoiceItemsInput = {
|
||||||
@@ -1233,6 +1273,7 @@ export type ProductUncheckedUpdateWithoutSalesInvoiceItemsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateWithoutStockMovementsInput = {
|
export type ProductCreateWithoutStockMovementsInput = {
|
||||||
@@ -1251,6 +1292,7 @@ export type ProductCreateWithoutStockMovementsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput
|
||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedCreateWithoutStockMovementsInput = {
|
export type ProductUncheckedCreateWithoutStockMovementsInput = {
|
||||||
@@ -1270,6 +1312,7 @@ export type ProductUncheckedCreateWithoutStockMovementsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateOrConnectWithoutStockMovementsInput = {
|
export type ProductCreateOrConnectWithoutStockMovementsInput = {
|
||||||
@@ -1304,6 +1347,7 @@ export type ProductUpdateWithoutStockMovementsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput
|
||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateWithoutStockMovementsInput = {
|
export type ProductUncheckedUpdateWithoutStockMovementsInput = {
|
||||||
@@ -1323,6 +1367,101 @@ export type ProductUncheckedUpdateWithoutStockMovementsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ProductCreateWithoutStockBalancesInput = {
|
||||||
|
name: string
|
||||||
|
description?: string | null
|
||||||
|
sku?: string | null
|
||||||
|
barcode?: string | null
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
deletedAt?: Date | string | null
|
||||||
|
inventoryTransferItems?: Prisma.InventoryTransferItemCreateNestedManyWithoutProductInput
|
||||||
|
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutProductInput
|
||||||
|
variants?: Prisma.ProductVariantCreateNestedManyWithoutProductInput
|
||||||
|
brand?: Prisma.ProductBrandCreateNestedOneWithoutProductsInput
|
||||||
|
category?: Prisma.ProductCategoryCreateNestedOneWithoutProductsInput
|
||||||
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput
|
||||||
|
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
||||||
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
||||||
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ProductUncheckedCreateWithoutStockBalancesInput = {
|
||||||
|
id?: number
|
||||||
|
name: string
|
||||||
|
description?: string | null
|
||||||
|
sku?: string | null
|
||||||
|
barcode?: string | null
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
deletedAt?: Date | string | null
|
||||||
|
brandId?: number | null
|
||||||
|
categoryId?: number | null
|
||||||
|
inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
variants?: Prisma.ProductVariantUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ProductCreateOrConnectWithoutStockBalancesInput = {
|
||||||
|
where: Prisma.ProductWhereUniqueInput
|
||||||
|
create: Prisma.XOR<Prisma.ProductCreateWithoutStockBalancesInput, Prisma.ProductUncheckedCreateWithoutStockBalancesInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ProductUpsertWithoutStockBalancesInput = {
|
||||||
|
update: Prisma.XOR<Prisma.ProductUpdateWithoutStockBalancesInput, Prisma.ProductUncheckedUpdateWithoutStockBalancesInput>
|
||||||
|
create: Prisma.XOR<Prisma.ProductCreateWithoutStockBalancesInput, Prisma.ProductUncheckedCreateWithoutStockBalancesInput>
|
||||||
|
where?: Prisma.ProductWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ProductUpdateToOneWithWhereWithoutStockBalancesInput = {
|
||||||
|
where?: Prisma.ProductWhereInput
|
||||||
|
data: Prisma.XOR<Prisma.ProductUpdateWithoutStockBalancesInput, Prisma.ProductUncheckedUpdateWithoutStockBalancesInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ProductUpdateWithoutStockBalancesInput = {
|
||||||
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
|
inventoryTransferItems?: Prisma.InventoryTransferItemUpdateManyWithoutProductNestedInput
|
||||||
|
productCharges?: Prisma.ProductChargeUpdateManyWithoutProductNestedInput
|
||||||
|
variants?: Prisma.ProductVariantUpdateManyWithoutProductNestedInput
|
||||||
|
brand?: Prisma.ProductBrandUpdateOneWithoutProductsNestedInput
|
||||||
|
category?: Prisma.ProductCategoryUpdateOneWithoutProductsNestedInput
|
||||||
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput
|
||||||
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
||||||
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
||||||
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ProductUncheckedUpdateWithoutStockBalancesInput = {
|
||||||
|
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
description?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
sku?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
barcode?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
|
brandId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||||
|
categoryId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||||
|
inventoryTransferItems?: Prisma.InventoryTransferItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
variants?: Prisma.ProductVariantUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateWithoutInventoryTransferItemsInput = {
|
export type ProductCreateWithoutInventoryTransferItemsInput = {
|
||||||
@@ -1341,6 +1480,7 @@ export type ProductCreateWithoutInventoryTransferItemsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedCreateWithoutInventoryTransferItemsInput = {
|
export type ProductUncheckedCreateWithoutInventoryTransferItemsInput = {
|
||||||
@@ -1360,6 +1500,7 @@ export type ProductUncheckedCreateWithoutInventoryTransferItemsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateOrConnectWithoutInventoryTransferItemsInput = {
|
export type ProductCreateOrConnectWithoutInventoryTransferItemsInput = {
|
||||||
@@ -1394,6 +1535,7 @@ export type ProductUpdateWithoutInventoryTransferItemsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateWithoutInventoryTransferItemsInput = {
|
export type ProductUncheckedUpdateWithoutInventoryTransferItemsInput = {
|
||||||
@@ -1413,6 +1555,7 @@ export type ProductUncheckedUpdateWithoutInventoryTransferItemsInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateWithoutStockAdjustmentsInput = {
|
export type ProductCreateWithoutStockAdjustmentsInput = {
|
||||||
@@ -1431,6 +1574,7 @@ export type ProductCreateWithoutStockAdjustmentsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemCreateNestedManyWithoutProductInput
|
||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedCreateWithoutStockAdjustmentsInput = {
|
export type ProductUncheckedCreateWithoutStockAdjustmentsInput = {
|
||||||
@@ -1450,6 +1594,7 @@ export type ProductUncheckedCreateWithoutStockAdjustmentsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedCreateNestedManyWithoutProductInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutProductInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedCreateNestedManyWithoutProductInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateOrConnectWithoutStockAdjustmentsInput = {
|
export type ProductCreateOrConnectWithoutStockAdjustmentsInput = {
|
||||||
@@ -1484,6 +1629,7 @@ export type ProductUpdateWithoutStockAdjustmentsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUpdateManyWithoutProductNestedInput
|
||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateWithoutStockAdjustmentsInput = {
|
export type ProductUncheckedUpdateWithoutStockAdjustmentsInput = {
|
||||||
@@ -1503,6 +1649,7 @@ export type ProductUncheckedUpdateWithoutStockAdjustmentsInput = {
|
|||||||
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput
|
purchaseReceiptItems?: Prisma.PurchaseReceiptItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCreateManyBrandInput = {
|
export type ProductCreateManyBrandInput = {
|
||||||
@@ -1533,6 +1680,7 @@ export type ProductUpdateWithoutBrandInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateWithoutBrandInput = {
|
export type ProductUncheckedUpdateWithoutBrandInput = {
|
||||||
@@ -1552,6 +1700,7 @@ export type ProductUncheckedUpdateWithoutBrandInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateManyWithoutBrandInput = {
|
export type ProductUncheckedUpdateManyWithoutBrandInput = {
|
||||||
@@ -1594,6 +1743,7 @@ export type ProductUpdateWithoutCategoryInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateWithoutCategoryInput = {
|
export type ProductUncheckedUpdateWithoutCategoryInput = {
|
||||||
@@ -1613,6 +1763,7 @@ export type ProductUncheckedUpdateWithoutCategoryInput = {
|
|||||||
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
salesInvoiceItems?: Prisma.SalesInvoiceItemUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
stockAdjustments?: Prisma.StockAdjustmentUncheckedUpdateManyWithoutProductNestedInput
|
||||||
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutProductNestedInput
|
||||||
|
stockBalances?: Prisma.StockBalanceUncheckedUpdateManyWithoutProductNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductUncheckedUpdateManyWithoutCategoryInput = {
|
export type ProductUncheckedUpdateManyWithoutCategoryInput = {
|
||||||
@@ -1640,6 +1791,7 @@ export type ProductCountOutputType = {
|
|||||||
salesInvoiceItems: number
|
salesInvoiceItems: number
|
||||||
stockAdjustments: number
|
stockAdjustments: number
|
||||||
stockMovements: number
|
stockMovements: number
|
||||||
|
stockBalances: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProductCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
export type ProductCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
@@ -1650,6 +1802,7 @@ export type ProductCountOutputTypeSelect<ExtArgs extends runtime.Types.Extension
|
|||||||
salesInvoiceItems?: boolean | ProductCountOutputTypeCountSalesInvoiceItemsArgs
|
salesInvoiceItems?: boolean | ProductCountOutputTypeCountSalesInvoiceItemsArgs
|
||||||
stockAdjustments?: boolean | ProductCountOutputTypeCountStockAdjustmentsArgs
|
stockAdjustments?: boolean | ProductCountOutputTypeCountStockAdjustmentsArgs
|
||||||
stockMovements?: boolean | ProductCountOutputTypeCountStockMovementsArgs
|
stockMovements?: boolean | ProductCountOutputTypeCountStockMovementsArgs
|
||||||
|
stockBalances?: boolean | ProductCountOutputTypeCountStockBalancesArgs
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1711,6 +1864,13 @@ export type ProductCountOutputTypeCountStockMovementsArgs<ExtArgs extends runtim
|
|||||||
where?: Prisma.StockMovementWhereInput
|
where?: Prisma.StockMovementWhereInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ProductCountOutputType without action
|
||||||
|
*/
|
||||||
|
export type ProductCountOutputTypeCountStockBalancesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
where?: Prisma.StockBalanceWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export type ProductSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
export type ProductSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||||
id?: boolean
|
id?: boolean
|
||||||
@@ -1732,6 +1892,7 @@ export type ProductSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
|||||||
salesInvoiceItems?: boolean | Prisma.Product$salesInvoiceItemsArgs<ExtArgs>
|
salesInvoiceItems?: boolean | Prisma.Product$salesInvoiceItemsArgs<ExtArgs>
|
||||||
stockAdjustments?: boolean | Prisma.Product$stockAdjustmentsArgs<ExtArgs>
|
stockAdjustments?: boolean | Prisma.Product$stockAdjustmentsArgs<ExtArgs>
|
||||||
stockMovements?: boolean | Prisma.Product$stockMovementsArgs<ExtArgs>
|
stockMovements?: boolean | Prisma.Product$stockMovementsArgs<ExtArgs>
|
||||||
|
stockBalances?: boolean | Prisma.Product$stockBalancesArgs<ExtArgs>
|
||||||
_count?: boolean | Prisma.ProductCountOutputTypeDefaultArgs<ExtArgs>
|
_count?: boolean | Prisma.ProductCountOutputTypeDefaultArgs<ExtArgs>
|
||||||
}, ExtArgs["result"]["product"]>
|
}, ExtArgs["result"]["product"]>
|
||||||
|
|
||||||
@@ -1761,6 +1922,7 @@ export type ProductInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
|||||||
salesInvoiceItems?: boolean | Prisma.Product$salesInvoiceItemsArgs<ExtArgs>
|
salesInvoiceItems?: boolean | Prisma.Product$salesInvoiceItemsArgs<ExtArgs>
|
||||||
stockAdjustments?: boolean | Prisma.Product$stockAdjustmentsArgs<ExtArgs>
|
stockAdjustments?: boolean | Prisma.Product$stockAdjustmentsArgs<ExtArgs>
|
||||||
stockMovements?: boolean | Prisma.Product$stockMovementsArgs<ExtArgs>
|
stockMovements?: boolean | Prisma.Product$stockMovementsArgs<ExtArgs>
|
||||||
|
stockBalances?: boolean | Prisma.Product$stockBalancesArgs<ExtArgs>
|
||||||
_count?: boolean | Prisma.ProductCountOutputTypeDefaultArgs<ExtArgs>
|
_count?: boolean | Prisma.ProductCountOutputTypeDefaultArgs<ExtArgs>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1776,6 +1938,7 @@ export type $ProductPayload<ExtArgs extends runtime.Types.Extensions.InternalArg
|
|||||||
salesInvoiceItems: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
|
salesInvoiceItems: Prisma.$SalesInvoiceItemPayload<ExtArgs>[]
|
||||||
stockAdjustments: Prisma.$StockAdjustmentPayload<ExtArgs>[]
|
stockAdjustments: Prisma.$StockAdjustmentPayload<ExtArgs>[]
|
||||||
stockMovements: Prisma.$StockMovementPayload<ExtArgs>[]
|
stockMovements: Prisma.$StockMovementPayload<ExtArgs>[]
|
||||||
|
stockBalances: Prisma.$StockBalancePayload<ExtArgs>[]
|
||||||
}
|
}
|
||||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||||
id: number
|
id: number
|
||||||
@@ -2137,6 +2300,7 @@ export interface Prisma__ProductClient<T, Null = never, ExtArgs extends runtime.
|
|||||||
salesInvoiceItems<T extends Prisma.Product$salesInvoiceItemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$salesInvoiceItemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
salesInvoiceItems<T extends Prisma.Product$salesInvoiceItemsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$salesInvoiceItemsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$SalesInvoiceItemPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||||
stockAdjustments<T extends Prisma.Product$stockAdjustmentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$stockAdjustmentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockAdjustmentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
stockAdjustments<T extends Prisma.Product$stockAdjustmentsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$stockAdjustmentsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockAdjustmentPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||||
stockMovements<T extends Prisma.Product$stockMovementsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$stockMovementsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockMovementPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
stockMovements<T extends Prisma.Product$stockMovementsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$stockMovementsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockMovementPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||||
|
stockBalances<T extends Prisma.Product$stockBalancesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Product$stockBalancesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockBalancePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
@@ -2724,6 +2888,30 @@ export type Product$stockMovementsArgs<ExtArgs extends runtime.Types.Extensions.
|
|||||||
distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[]
|
distinct?: Prisma.StockMovementScalarFieldEnum | Prisma.StockMovementScalarFieldEnum[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Product.stockBalances
|
||||||
|
*/
|
||||||
|
export type Product$stockBalancesArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
/**
|
||||||
|
* Select specific fields to fetch from the StockBalance
|
||||||
|
*/
|
||||||
|
select?: Prisma.StockBalanceSelect<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Omit specific fields from the StockBalance
|
||||||
|
*/
|
||||||
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
|
where?: Prisma.StockBalanceWhereInput
|
||||||
|
orderBy?: Prisma.StockBalanceOrderByWithRelationInput | Prisma.StockBalanceOrderByWithRelationInput[]
|
||||||
|
cursor?: Prisma.StockBalanceWhereUniqueInput
|
||||||
|
take?: number
|
||||||
|
skip?: number
|
||||||
|
distinct?: Prisma.StockBalanceScalarFieldEnum | Prisma.StockBalanceScalarFieldEnum[]
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Product without action
|
* Product without action
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -27,81 +27,107 @@ export type AggregateStockBalance = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceAvgAggregateOutputType = {
|
export type StockBalanceAvgAggregateOutputType = {
|
||||||
|
id: number | null
|
||||||
|
productId: number | null
|
||||||
|
inventoryId: number | null
|
||||||
quantity: runtime.Decimal | null
|
quantity: runtime.Decimal | null
|
||||||
totalCost: runtime.Decimal | null
|
|
||||||
ProductId: number | null
|
|
||||||
avgCost: runtime.Decimal | null
|
avgCost: runtime.Decimal | null
|
||||||
|
totalCost: runtime.Decimal | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceSumAggregateOutputType = {
|
export type StockBalanceSumAggregateOutputType = {
|
||||||
|
id: number | null
|
||||||
|
productId: number | null
|
||||||
|
inventoryId: number | null
|
||||||
quantity: runtime.Decimal | null
|
quantity: runtime.Decimal | null
|
||||||
totalCost: runtime.Decimal | null
|
|
||||||
ProductId: number | null
|
|
||||||
avgCost: runtime.Decimal | null
|
avgCost: runtime.Decimal | null
|
||||||
|
totalCost: runtime.Decimal | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceMinAggregateOutputType = {
|
export type StockBalanceMinAggregateOutputType = {
|
||||||
|
id: number | null
|
||||||
|
productId: number | null
|
||||||
|
inventoryId: number | null
|
||||||
quantity: runtime.Decimal | null
|
quantity: runtime.Decimal | null
|
||||||
totalCost: runtime.Decimal | null
|
|
||||||
updatedAt: Date | null
|
|
||||||
ProductId: number | null
|
|
||||||
avgCost: runtime.Decimal | null
|
avgCost: runtime.Decimal | null
|
||||||
|
totalCost: runtime.Decimal | null
|
||||||
|
createdAt: Date | null
|
||||||
|
updatedAt: Date | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceMaxAggregateOutputType = {
|
export type StockBalanceMaxAggregateOutputType = {
|
||||||
|
id: number | null
|
||||||
|
productId: number | null
|
||||||
|
inventoryId: number | null
|
||||||
quantity: runtime.Decimal | null
|
quantity: runtime.Decimal | null
|
||||||
totalCost: runtime.Decimal | null
|
|
||||||
updatedAt: Date | null
|
|
||||||
ProductId: number | null
|
|
||||||
avgCost: runtime.Decimal | null
|
avgCost: runtime.Decimal | null
|
||||||
|
totalCost: runtime.Decimal | null
|
||||||
|
createdAt: Date | null
|
||||||
|
updatedAt: Date | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceCountAggregateOutputType = {
|
export type StockBalanceCountAggregateOutputType = {
|
||||||
|
id: number
|
||||||
|
productId: number
|
||||||
|
inventoryId: number
|
||||||
quantity: number
|
quantity: number
|
||||||
totalCost: number
|
|
||||||
updatedAt: number
|
|
||||||
ProductId: number
|
|
||||||
avgCost: number
|
avgCost: number
|
||||||
|
totalCost: number
|
||||||
|
createdAt: number
|
||||||
|
updatedAt: number
|
||||||
_all: number
|
_all: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export type StockBalanceAvgAggregateInputType = {
|
export type StockBalanceAvgAggregateInputType = {
|
||||||
|
id?: true
|
||||||
|
productId?: true
|
||||||
|
inventoryId?: true
|
||||||
quantity?: true
|
quantity?: true
|
||||||
totalCost?: true
|
|
||||||
ProductId?: true
|
|
||||||
avgCost?: true
|
avgCost?: true
|
||||||
|
totalCost?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceSumAggregateInputType = {
|
export type StockBalanceSumAggregateInputType = {
|
||||||
|
id?: true
|
||||||
|
productId?: true
|
||||||
|
inventoryId?: true
|
||||||
quantity?: true
|
quantity?: true
|
||||||
totalCost?: true
|
|
||||||
ProductId?: true
|
|
||||||
avgCost?: true
|
avgCost?: true
|
||||||
|
totalCost?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceMinAggregateInputType = {
|
export type StockBalanceMinAggregateInputType = {
|
||||||
|
id?: true
|
||||||
|
productId?: true
|
||||||
|
inventoryId?: true
|
||||||
quantity?: true
|
quantity?: true
|
||||||
totalCost?: true
|
|
||||||
updatedAt?: true
|
|
||||||
ProductId?: true
|
|
||||||
avgCost?: true
|
avgCost?: true
|
||||||
|
totalCost?: true
|
||||||
|
createdAt?: true
|
||||||
|
updatedAt?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceMaxAggregateInputType = {
|
export type StockBalanceMaxAggregateInputType = {
|
||||||
|
id?: true
|
||||||
|
productId?: true
|
||||||
|
inventoryId?: true
|
||||||
quantity?: true
|
quantity?: true
|
||||||
totalCost?: true
|
|
||||||
updatedAt?: true
|
|
||||||
ProductId?: true
|
|
||||||
avgCost?: true
|
avgCost?: true
|
||||||
|
totalCost?: true
|
||||||
|
createdAt?: true
|
||||||
|
updatedAt?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceCountAggregateInputType = {
|
export type StockBalanceCountAggregateInputType = {
|
||||||
|
id?: true
|
||||||
|
productId?: true
|
||||||
|
inventoryId?: true
|
||||||
quantity?: true
|
quantity?: true
|
||||||
totalCost?: true
|
|
||||||
updatedAt?: true
|
|
||||||
ProductId?: true
|
|
||||||
avgCost?: true
|
avgCost?: true
|
||||||
|
totalCost?: true
|
||||||
|
createdAt?: true
|
||||||
|
updatedAt?: true
|
||||||
_all?: true
|
_all?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,11 +218,14 @@ export type StockBalanceGroupByArgs<ExtArgs extends runtime.Types.Extensions.Int
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceGroupByOutputType = {
|
export type StockBalanceGroupByOutputType = {
|
||||||
|
id: number
|
||||||
|
productId: number
|
||||||
|
inventoryId: number
|
||||||
quantity: runtime.Decimal
|
quantity: runtime.Decimal
|
||||||
totalCost: runtime.Decimal
|
|
||||||
updatedAt: Date
|
|
||||||
ProductId: number
|
|
||||||
avgCost: runtime.Decimal
|
avgCost: runtime.Decimal
|
||||||
|
totalCost: runtime.Decimal
|
||||||
|
createdAt: Date
|
||||||
|
updatedAt: Date
|
||||||
_count: StockBalanceCountAggregateOutputType | null
|
_count: StockBalanceCountAggregateOutputType | null
|
||||||
_avg: StockBalanceAvgAggregateOutputType | null
|
_avg: StockBalanceAvgAggregateOutputType | null
|
||||||
_sum: StockBalanceSumAggregateOutputType | null
|
_sum: StockBalanceSumAggregateOutputType | null
|
||||||
@@ -223,38 +252,57 @@ export type StockBalanceWhereInput = {
|
|||||||
AND?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[]
|
AND?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[]
|
||||||
OR?: Prisma.StockBalanceWhereInput[]
|
OR?: Prisma.StockBalanceWhereInput[]
|
||||||
NOT?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[]
|
NOT?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[]
|
||||||
|
id?: Prisma.IntFilter<"StockBalance"> | number
|
||||||
|
productId?: Prisma.IntFilter<"StockBalance"> | number
|
||||||
|
inventoryId?: Prisma.IntFilter<"StockBalance"> | number
|
||||||
quantity?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
quantity?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
totalCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
|
||||||
updatedAt?: Prisma.DateTimeFilter<"StockBalance"> | Date | string
|
|
||||||
ProductId?: Prisma.IntFilter<"StockBalance"> | number
|
|
||||||
avgCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFilter<"StockBalance"> | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFilter<"StockBalance"> | Date | string
|
||||||
|
product?: Prisma.XOR<Prisma.ProductScalarRelationFilter, Prisma.ProductWhereInput>
|
||||||
|
inventory?: Prisma.XOR<Prisma.InventoryScalarRelationFilter, Prisma.InventoryWhereInput>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceOrderByWithRelationInput = {
|
export type StockBalanceOrderByWithRelationInput = {
|
||||||
|
id?: Prisma.SortOrder
|
||||||
|
productId?: Prisma.SortOrder
|
||||||
|
inventoryId?: Prisma.SortOrder
|
||||||
quantity?: Prisma.SortOrder
|
quantity?: Prisma.SortOrder
|
||||||
totalCost?: Prisma.SortOrder
|
|
||||||
updatedAt?: Prisma.SortOrder
|
|
||||||
ProductId?: Prisma.SortOrder
|
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
totalCost?: Prisma.SortOrder
|
||||||
|
createdAt?: Prisma.SortOrder
|
||||||
|
updatedAt?: Prisma.SortOrder
|
||||||
|
product?: Prisma.ProductOrderByWithRelationInput
|
||||||
|
inventory?: Prisma.InventoryOrderByWithRelationInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceWhereUniqueInput = Prisma.AtLeast<{
|
export type StockBalanceWhereUniqueInput = Prisma.AtLeast<{
|
||||||
ProductId?: number
|
id?: number
|
||||||
|
productId_inventoryId?: Prisma.StockBalanceProductIdInventoryIdCompoundUniqueInput
|
||||||
AND?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[]
|
AND?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[]
|
||||||
OR?: Prisma.StockBalanceWhereInput[]
|
OR?: Prisma.StockBalanceWhereInput[]
|
||||||
NOT?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[]
|
NOT?: Prisma.StockBalanceWhereInput | Prisma.StockBalanceWhereInput[]
|
||||||
|
productId?: Prisma.IntFilter<"StockBalance"> | number
|
||||||
|
inventoryId?: Prisma.IntFilter<"StockBalance"> | number
|
||||||
quantity?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
quantity?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
totalCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
|
||||||
updatedAt?: Prisma.DateTimeFilter<"StockBalance"> | Date | string
|
|
||||||
avgCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
}, "ProductId">
|
totalCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFilter<"StockBalance"> | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFilter<"StockBalance"> | Date | string
|
||||||
|
product?: Prisma.XOR<Prisma.ProductScalarRelationFilter, Prisma.ProductWhereInput>
|
||||||
|
inventory?: Prisma.XOR<Prisma.InventoryScalarRelationFilter, Prisma.InventoryWhereInput>
|
||||||
|
}, "id" | "productId_inventoryId">
|
||||||
|
|
||||||
export type StockBalanceOrderByWithAggregationInput = {
|
export type StockBalanceOrderByWithAggregationInput = {
|
||||||
|
id?: Prisma.SortOrder
|
||||||
|
productId?: Prisma.SortOrder
|
||||||
|
inventoryId?: Prisma.SortOrder
|
||||||
quantity?: Prisma.SortOrder
|
quantity?: Prisma.SortOrder
|
||||||
totalCost?: Prisma.SortOrder
|
|
||||||
updatedAt?: Prisma.SortOrder
|
|
||||||
ProductId?: Prisma.SortOrder
|
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
totalCost?: Prisma.SortOrder
|
||||||
|
createdAt?: Prisma.SortOrder
|
||||||
|
updatedAt?: Prisma.SortOrder
|
||||||
_count?: Prisma.StockBalanceCountOrderByAggregateInput
|
_count?: Prisma.StockBalanceCountOrderByAggregateInput
|
||||||
_avg?: Prisma.StockBalanceAvgOrderByAggregateInput
|
_avg?: Prisma.StockBalanceAvgOrderByAggregateInput
|
||||||
_max?: Prisma.StockBalanceMaxOrderByAggregateInput
|
_max?: Prisma.StockBalanceMaxOrderByAggregateInput
|
||||||
@@ -266,138 +314,469 @@ export type StockBalanceScalarWhereWithAggregatesInput = {
|
|||||||
AND?: Prisma.StockBalanceScalarWhereWithAggregatesInput | Prisma.StockBalanceScalarWhereWithAggregatesInput[]
|
AND?: Prisma.StockBalanceScalarWhereWithAggregatesInput | Prisma.StockBalanceScalarWhereWithAggregatesInput[]
|
||||||
OR?: Prisma.StockBalanceScalarWhereWithAggregatesInput[]
|
OR?: Prisma.StockBalanceScalarWhereWithAggregatesInput[]
|
||||||
NOT?: Prisma.StockBalanceScalarWhereWithAggregatesInput | Prisma.StockBalanceScalarWhereWithAggregatesInput[]
|
NOT?: Prisma.StockBalanceScalarWhereWithAggregatesInput | Prisma.StockBalanceScalarWhereWithAggregatesInput[]
|
||||||
|
id?: Prisma.IntWithAggregatesFilter<"StockBalance"> | number
|
||||||
|
productId?: Prisma.IntWithAggregatesFilter<"StockBalance"> | number
|
||||||
|
inventoryId?: Prisma.IntWithAggregatesFilter<"StockBalance"> | number
|
||||||
quantity?: Prisma.DecimalWithAggregatesFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
quantity?: Prisma.DecimalWithAggregatesFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
totalCost?: Prisma.DecimalWithAggregatesFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
|
||||||
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"StockBalance"> | Date | string
|
|
||||||
ProductId?: Prisma.IntWithAggregatesFilter<"StockBalance"> | number
|
|
||||||
avgCost?: Prisma.DecimalWithAggregatesFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost?: Prisma.DecimalWithAggregatesFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalWithAggregatesFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeWithAggregatesFilter<"StockBalance"> | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeWithAggregatesFilter<"StockBalance"> | Date | string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceCreateInput = {
|
export type StockBalanceCreateInput = {
|
||||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
quantity?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
ProductId: number
|
product: Prisma.ProductCreateNestedOneWithoutStockBalancesInput
|
||||||
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
inventory: Prisma.InventoryCreateNestedOneWithoutStockBalancesInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceUncheckedCreateInput = {
|
export type StockBalanceUncheckedCreateInput = {
|
||||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
id?: number
|
||||||
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
productId: number
|
||||||
|
inventoryId: number
|
||||||
|
quantity?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
ProductId: number
|
|
||||||
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceUpdateInput = {
|
export type StockBalanceUpdateInput = {
|
||||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
||||||
ProductId?: Prisma.IntFieldUpdateOperationsInput | number
|
|
||||||
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
product?: Prisma.ProductUpdateOneRequiredWithoutStockBalancesNestedInput
|
||||||
|
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockBalancesNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceUncheckedUpdateInput = {
|
export type StockBalanceUncheckedUpdateInput = {
|
||||||
|
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
productId?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
||||||
ProductId?: Prisma.IntFieldUpdateOperationsInput | number
|
|
||||||
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceCreateManyInput = {
|
export type StockBalanceCreateManyInput = {
|
||||||
quantity: runtime.Decimal | runtime.DecimalJsLike | number | string
|
id?: number
|
||||||
totalCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
productId: number
|
||||||
|
inventoryId: number
|
||||||
|
quantity?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Date | string
|
||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
ProductId: number
|
|
||||||
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceUpdateManyMutationInput = {
|
export type StockBalanceUpdateManyMutationInput = {
|
||||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
||||||
ProductId?: Prisma.IntFieldUpdateOperationsInput | number
|
|
||||||
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceUncheckedUpdateManyInput = {
|
export type StockBalanceUncheckedUpdateManyInput = {
|
||||||
|
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
productId?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
|
||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
|
||||||
ProductId?: Prisma.IntFieldUpdateOperationsInput | number
|
|
||||||
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceListRelationFilter = {
|
||||||
|
every?: Prisma.StockBalanceWhereInput
|
||||||
|
some?: Prisma.StockBalanceWhereInput
|
||||||
|
none?: Prisma.StockBalanceWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceOrderByRelationAggregateInput = {
|
||||||
|
_count?: Prisma.SortOrder
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceProductIdInventoryIdCompoundUniqueInput = {
|
||||||
|
productId: number
|
||||||
|
inventoryId: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceCountOrderByAggregateInput = {
|
export type StockBalanceCountOrderByAggregateInput = {
|
||||||
|
id?: Prisma.SortOrder
|
||||||
|
productId?: Prisma.SortOrder
|
||||||
|
inventoryId?: Prisma.SortOrder
|
||||||
quantity?: Prisma.SortOrder
|
quantity?: Prisma.SortOrder
|
||||||
totalCost?: Prisma.SortOrder
|
|
||||||
updatedAt?: Prisma.SortOrder
|
|
||||||
ProductId?: Prisma.SortOrder
|
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
totalCost?: Prisma.SortOrder
|
||||||
|
createdAt?: Prisma.SortOrder
|
||||||
|
updatedAt?: Prisma.SortOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceAvgOrderByAggregateInput = {
|
export type StockBalanceAvgOrderByAggregateInput = {
|
||||||
|
id?: Prisma.SortOrder
|
||||||
|
productId?: Prisma.SortOrder
|
||||||
|
inventoryId?: Prisma.SortOrder
|
||||||
quantity?: Prisma.SortOrder
|
quantity?: Prisma.SortOrder
|
||||||
totalCost?: Prisma.SortOrder
|
|
||||||
ProductId?: Prisma.SortOrder
|
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
totalCost?: Prisma.SortOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceMaxOrderByAggregateInput = {
|
export type StockBalanceMaxOrderByAggregateInput = {
|
||||||
|
id?: Prisma.SortOrder
|
||||||
|
productId?: Prisma.SortOrder
|
||||||
|
inventoryId?: Prisma.SortOrder
|
||||||
quantity?: Prisma.SortOrder
|
quantity?: Prisma.SortOrder
|
||||||
totalCost?: Prisma.SortOrder
|
|
||||||
updatedAt?: Prisma.SortOrder
|
|
||||||
ProductId?: Prisma.SortOrder
|
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
totalCost?: Prisma.SortOrder
|
||||||
|
createdAt?: Prisma.SortOrder
|
||||||
|
updatedAt?: Prisma.SortOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceMinOrderByAggregateInput = {
|
export type StockBalanceMinOrderByAggregateInput = {
|
||||||
|
id?: Prisma.SortOrder
|
||||||
|
productId?: Prisma.SortOrder
|
||||||
|
inventoryId?: Prisma.SortOrder
|
||||||
quantity?: Prisma.SortOrder
|
quantity?: Prisma.SortOrder
|
||||||
totalCost?: Prisma.SortOrder
|
|
||||||
updatedAt?: Prisma.SortOrder
|
|
||||||
ProductId?: Prisma.SortOrder
|
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
totalCost?: Prisma.SortOrder
|
||||||
|
createdAt?: Prisma.SortOrder
|
||||||
|
updatedAt?: Prisma.SortOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceSumOrderByAggregateInput = {
|
export type StockBalanceSumOrderByAggregateInput = {
|
||||||
|
id?: Prisma.SortOrder
|
||||||
|
productId?: Prisma.SortOrder
|
||||||
|
inventoryId?: Prisma.SortOrder
|
||||||
quantity?: Prisma.SortOrder
|
quantity?: Prisma.SortOrder
|
||||||
totalCost?: Prisma.SortOrder
|
|
||||||
ProductId?: Prisma.SortOrder
|
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
totalCost?: Prisma.SortOrder
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceCreateNestedManyWithoutProductInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockBalanceCreateWithoutProductInput, Prisma.StockBalanceUncheckedCreateWithoutProductInput> | Prisma.StockBalanceCreateWithoutProductInput[] | Prisma.StockBalanceUncheckedCreateWithoutProductInput[]
|
||||||
|
connectOrCreate?: Prisma.StockBalanceCreateOrConnectWithoutProductInput | Prisma.StockBalanceCreateOrConnectWithoutProductInput[]
|
||||||
|
createMany?: Prisma.StockBalanceCreateManyProductInputEnvelope
|
||||||
|
connect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUncheckedCreateNestedManyWithoutProductInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockBalanceCreateWithoutProductInput, Prisma.StockBalanceUncheckedCreateWithoutProductInput> | Prisma.StockBalanceCreateWithoutProductInput[] | Prisma.StockBalanceUncheckedCreateWithoutProductInput[]
|
||||||
|
connectOrCreate?: Prisma.StockBalanceCreateOrConnectWithoutProductInput | Prisma.StockBalanceCreateOrConnectWithoutProductInput[]
|
||||||
|
createMany?: Prisma.StockBalanceCreateManyProductInputEnvelope
|
||||||
|
connect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUpdateManyWithoutProductNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockBalanceCreateWithoutProductInput, Prisma.StockBalanceUncheckedCreateWithoutProductInput> | Prisma.StockBalanceCreateWithoutProductInput[] | Prisma.StockBalanceUncheckedCreateWithoutProductInput[]
|
||||||
|
connectOrCreate?: Prisma.StockBalanceCreateOrConnectWithoutProductInput | Prisma.StockBalanceCreateOrConnectWithoutProductInput[]
|
||||||
|
upsert?: Prisma.StockBalanceUpsertWithWhereUniqueWithoutProductInput | Prisma.StockBalanceUpsertWithWhereUniqueWithoutProductInput[]
|
||||||
|
createMany?: Prisma.StockBalanceCreateManyProductInputEnvelope
|
||||||
|
set?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
disconnect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
delete?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
connect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
update?: Prisma.StockBalanceUpdateWithWhereUniqueWithoutProductInput | Prisma.StockBalanceUpdateWithWhereUniqueWithoutProductInput[]
|
||||||
|
updateMany?: Prisma.StockBalanceUpdateManyWithWhereWithoutProductInput | Prisma.StockBalanceUpdateManyWithWhereWithoutProductInput[]
|
||||||
|
deleteMany?: Prisma.StockBalanceScalarWhereInput | Prisma.StockBalanceScalarWhereInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUncheckedUpdateManyWithoutProductNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockBalanceCreateWithoutProductInput, Prisma.StockBalanceUncheckedCreateWithoutProductInput> | Prisma.StockBalanceCreateWithoutProductInput[] | Prisma.StockBalanceUncheckedCreateWithoutProductInput[]
|
||||||
|
connectOrCreate?: Prisma.StockBalanceCreateOrConnectWithoutProductInput | Prisma.StockBalanceCreateOrConnectWithoutProductInput[]
|
||||||
|
upsert?: Prisma.StockBalanceUpsertWithWhereUniqueWithoutProductInput | Prisma.StockBalanceUpsertWithWhereUniqueWithoutProductInput[]
|
||||||
|
createMany?: Prisma.StockBalanceCreateManyProductInputEnvelope
|
||||||
|
set?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
disconnect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
delete?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
connect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
update?: Prisma.StockBalanceUpdateWithWhereUniqueWithoutProductInput | Prisma.StockBalanceUpdateWithWhereUniqueWithoutProductInput[]
|
||||||
|
updateMany?: Prisma.StockBalanceUpdateManyWithWhereWithoutProductInput | Prisma.StockBalanceUpdateManyWithWhereWithoutProductInput[]
|
||||||
|
deleteMany?: Prisma.StockBalanceScalarWhereInput | Prisma.StockBalanceScalarWhereInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceCreateNestedManyWithoutInventoryInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockBalanceCreateWithoutInventoryInput, Prisma.StockBalanceUncheckedCreateWithoutInventoryInput> | Prisma.StockBalanceCreateWithoutInventoryInput[] | Prisma.StockBalanceUncheckedCreateWithoutInventoryInput[]
|
||||||
|
connectOrCreate?: Prisma.StockBalanceCreateOrConnectWithoutInventoryInput | Prisma.StockBalanceCreateOrConnectWithoutInventoryInput[]
|
||||||
|
createMany?: Prisma.StockBalanceCreateManyInventoryInputEnvelope
|
||||||
|
connect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUncheckedCreateNestedManyWithoutInventoryInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockBalanceCreateWithoutInventoryInput, Prisma.StockBalanceUncheckedCreateWithoutInventoryInput> | Prisma.StockBalanceCreateWithoutInventoryInput[] | Prisma.StockBalanceUncheckedCreateWithoutInventoryInput[]
|
||||||
|
connectOrCreate?: Prisma.StockBalanceCreateOrConnectWithoutInventoryInput | Prisma.StockBalanceCreateOrConnectWithoutInventoryInput[]
|
||||||
|
createMany?: Prisma.StockBalanceCreateManyInventoryInputEnvelope
|
||||||
|
connect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUpdateManyWithoutInventoryNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockBalanceCreateWithoutInventoryInput, Prisma.StockBalanceUncheckedCreateWithoutInventoryInput> | Prisma.StockBalanceCreateWithoutInventoryInput[] | Prisma.StockBalanceUncheckedCreateWithoutInventoryInput[]
|
||||||
|
connectOrCreate?: Prisma.StockBalanceCreateOrConnectWithoutInventoryInput | Prisma.StockBalanceCreateOrConnectWithoutInventoryInput[]
|
||||||
|
upsert?: Prisma.StockBalanceUpsertWithWhereUniqueWithoutInventoryInput | Prisma.StockBalanceUpsertWithWhereUniqueWithoutInventoryInput[]
|
||||||
|
createMany?: Prisma.StockBalanceCreateManyInventoryInputEnvelope
|
||||||
|
set?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
disconnect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
delete?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
connect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
update?: Prisma.StockBalanceUpdateWithWhereUniqueWithoutInventoryInput | Prisma.StockBalanceUpdateWithWhereUniqueWithoutInventoryInput[]
|
||||||
|
updateMany?: Prisma.StockBalanceUpdateManyWithWhereWithoutInventoryInput | Prisma.StockBalanceUpdateManyWithWhereWithoutInventoryInput[]
|
||||||
|
deleteMany?: Prisma.StockBalanceScalarWhereInput | Prisma.StockBalanceScalarWhereInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUncheckedUpdateManyWithoutInventoryNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockBalanceCreateWithoutInventoryInput, Prisma.StockBalanceUncheckedCreateWithoutInventoryInput> | Prisma.StockBalanceCreateWithoutInventoryInput[] | Prisma.StockBalanceUncheckedCreateWithoutInventoryInput[]
|
||||||
|
connectOrCreate?: Prisma.StockBalanceCreateOrConnectWithoutInventoryInput | Prisma.StockBalanceCreateOrConnectWithoutInventoryInput[]
|
||||||
|
upsert?: Prisma.StockBalanceUpsertWithWhereUniqueWithoutInventoryInput | Prisma.StockBalanceUpsertWithWhereUniqueWithoutInventoryInput[]
|
||||||
|
createMany?: Prisma.StockBalanceCreateManyInventoryInputEnvelope
|
||||||
|
set?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
disconnect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
delete?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
connect?: Prisma.StockBalanceWhereUniqueInput | Prisma.StockBalanceWhereUniqueInput[]
|
||||||
|
update?: Prisma.StockBalanceUpdateWithWhereUniqueWithoutInventoryInput | Prisma.StockBalanceUpdateWithWhereUniqueWithoutInventoryInput[]
|
||||||
|
updateMany?: Prisma.StockBalanceUpdateManyWithWhereWithoutInventoryInput | Prisma.StockBalanceUpdateManyWithWhereWithoutInventoryInput[]
|
||||||
|
deleteMany?: Prisma.StockBalanceScalarWhereInput | Prisma.StockBalanceScalarWhereInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceCreateWithoutProductInput = {
|
||||||
|
quantity?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
inventory: Prisma.InventoryCreateNestedOneWithoutStockBalancesInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUncheckedCreateWithoutProductInput = {
|
||||||
|
id?: number
|
||||||
|
inventoryId: number
|
||||||
|
quantity?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceCreateOrConnectWithoutProductInput = {
|
||||||
|
where: Prisma.StockBalanceWhereUniqueInput
|
||||||
|
create: Prisma.XOR<Prisma.StockBalanceCreateWithoutProductInput, Prisma.StockBalanceUncheckedCreateWithoutProductInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceCreateManyProductInputEnvelope = {
|
||||||
|
data: Prisma.StockBalanceCreateManyProductInput | Prisma.StockBalanceCreateManyProductInput[]
|
||||||
|
skipDuplicates?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUpsertWithWhereUniqueWithoutProductInput = {
|
||||||
|
where: Prisma.StockBalanceWhereUniqueInput
|
||||||
|
update: Prisma.XOR<Prisma.StockBalanceUpdateWithoutProductInput, Prisma.StockBalanceUncheckedUpdateWithoutProductInput>
|
||||||
|
create: Prisma.XOR<Prisma.StockBalanceCreateWithoutProductInput, Prisma.StockBalanceUncheckedCreateWithoutProductInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUpdateWithWhereUniqueWithoutProductInput = {
|
||||||
|
where: Prisma.StockBalanceWhereUniqueInput
|
||||||
|
data: Prisma.XOR<Prisma.StockBalanceUpdateWithoutProductInput, Prisma.StockBalanceUncheckedUpdateWithoutProductInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUpdateManyWithWhereWithoutProductInput = {
|
||||||
|
where: Prisma.StockBalanceScalarWhereInput
|
||||||
|
data: Prisma.XOR<Prisma.StockBalanceUpdateManyMutationInput, Prisma.StockBalanceUncheckedUpdateManyWithoutProductInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceScalarWhereInput = {
|
||||||
|
AND?: Prisma.StockBalanceScalarWhereInput | Prisma.StockBalanceScalarWhereInput[]
|
||||||
|
OR?: Prisma.StockBalanceScalarWhereInput[]
|
||||||
|
NOT?: Prisma.StockBalanceScalarWhereInput | Prisma.StockBalanceScalarWhereInput[]
|
||||||
|
id?: Prisma.IntFilter<"StockBalance"> | number
|
||||||
|
productId?: Prisma.IntFilter<"StockBalance"> | number
|
||||||
|
inventoryId?: Prisma.IntFilter<"StockBalance"> | number
|
||||||
|
quantity?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFilter<"StockBalance"> | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFilter<"StockBalance"> | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFilter<"StockBalance"> | Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceCreateWithoutInventoryInput = {
|
||||||
|
quantity?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
product: Prisma.ProductCreateNestedOneWithoutStockBalancesInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUncheckedCreateWithoutInventoryInput = {
|
||||||
|
id?: number
|
||||||
|
productId: number
|
||||||
|
quantity?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceCreateOrConnectWithoutInventoryInput = {
|
||||||
|
where: Prisma.StockBalanceWhereUniqueInput
|
||||||
|
create: Prisma.XOR<Prisma.StockBalanceCreateWithoutInventoryInput, Prisma.StockBalanceUncheckedCreateWithoutInventoryInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceCreateManyInventoryInputEnvelope = {
|
||||||
|
data: Prisma.StockBalanceCreateManyInventoryInput | Prisma.StockBalanceCreateManyInventoryInput[]
|
||||||
|
skipDuplicates?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUpsertWithWhereUniqueWithoutInventoryInput = {
|
||||||
|
where: Prisma.StockBalanceWhereUniqueInput
|
||||||
|
update: Prisma.XOR<Prisma.StockBalanceUpdateWithoutInventoryInput, Prisma.StockBalanceUncheckedUpdateWithoutInventoryInput>
|
||||||
|
create: Prisma.XOR<Prisma.StockBalanceCreateWithoutInventoryInput, Prisma.StockBalanceUncheckedCreateWithoutInventoryInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUpdateWithWhereUniqueWithoutInventoryInput = {
|
||||||
|
where: Prisma.StockBalanceWhereUniqueInput
|
||||||
|
data: Prisma.XOR<Prisma.StockBalanceUpdateWithoutInventoryInput, Prisma.StockBalanceUncheckedUpdateWithoutInventoryInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUpdateManyWithWhereWithoutInventoryInput = {
|
||||||
|
where: Prisma.StockBalanceScalarWhereInput
|
||||||
|
data: Prisma.XOR<Prisma.StockBalanceUpdateManyMutationInput, Prisma.StockBalanceUncheckedUpdateManyWithoutInventoryInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceCreateManyProductInput = {
|
||||||
|
id?: number
|
||||||
|
inventoryId: number
|
||||||
|
quantity?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUpdateWithoutProductInput = {
|
||||||
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockBalancesNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUncheckedUpdateWithoutProductInput = {
|
||||||
|
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUncheckedUpdateManyWithoutProductInput = {
|
||||||
|
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
inventoryId?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceCreateManyInventoryInput = {
|
||||||
|
id?: number
|
||||||
|
productId: number
|
||||||
|
quantity?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUpdateWithoutInventoryInput = {
|
||||||
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
product?: Prisma.ProductUpdateOneRequiredWithoutStockBalancesNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUncheckedUpdateWithoutInventoryInput = {
|
||||||
|
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
productId?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockBalanceUncheckedUpdateManyWithoutInventoryInput = {
|
||||||
|
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
productId?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
avgCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
totalCost?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export type StockBalanceSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
export type StockBalanceSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||||
|
id?: boolean
|
||||||
|
productId?: boolean
|
||||||
|
inventoryId?: boolean
|
||||||
quantity?: boolean
|
quantity?: boolean
|
||||||
totalCost?: boolean
|
|
||||||
updatedAt?: boolean
|
|
||||||
ProductId?: boolean
|
|
||||||
avgCost?: boolean
|
avgCost?: boolean
|
||||||
|
totalCost?: boolean
|
||||||
|
createdAt?: boolean
|
||||||
|
updatedAt?: boolean
|
||||||
|
product?: boolean | Prisma.ProductDefaultArgs<ExtArgs>
|
||||||
|
inventory?: boolean | Prisma.InventoryDefaultArgs<ExtArgs>
|
||||||
}, ExtArgs["result"]["stockBalance"]>
|
}, ExtArgs["result"]["stockBalance"]>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export type StockBalanceSelectScalar = {
|
export type StockBalanceSelectScalar = {
|
||||||
|
id?: boolean
|
||||||
|
productId?: boolean
|
||||||
|
inventoryId?: boolean
|
||||||
quantity?: boolean
|
quantity?: boolean
|
||||||
totalCost?: boolean
|
|
||||||
updatedAt?: boolean
|
|
||||||
ProductId?: boolean
|
|
||||||
avgCost?: boolean
|
avgCost?: boolean
|
||||||
|
totalCost?: boolean
|
||||||
|
createdAt?: boolean
|
||||||
|
updatedAt?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockBalanceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"quantity" | "totalCost" | "updatedAt" | "ProductId" | "avgCost", ExtArgs["result"]["stockBalance"]>
|
export type StockBalanceOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetOmit<"id" | "productId" | "inventoryId" | "quantity" | "avgCost" | "totalCost" | "createdAt" | "updatedAt", ExtArgs["result"]["stockBalance"]>
|
||||||
|
export type StockBalanceInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
product?: boolean | Prisma.ProductDefaultArgs<ExtArgs>
|
||||||
|
inventory?: boolean | Prisma.InventoryDefaultArgs<ExtArgs>
|
||||||
|
}
|
||||||
|
|
||||||
export type $StockBalancePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
export type $StockBalancePayload<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
name: "StockBalance"
|
name: "StockBalance"
|
||||||
objects: {}
|
objects: {
|
||||||
|
product: Prisma.$ProductPayload<ExtArgs>
|
||||||
|
inventory: Prisma.$InventoryPayload<ExtArgs>
|
||||||
|
}
|
||||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||||
|
id: number
|
||||||
|
productId: number
|
||||||
|
inventoryId: number
|
||||||
quantity: runtime.Decimal
|
quantity: runtime.Decimal
|
||||||
totalCost: runtime.Decimal
|
|
||||||
updatedAt: Date
|
|
||||||
ProductId: number
|
|
||||||
avgCost: runtime.Decimal
|
avgCost: runtime.Decimal
|
||||||
|
totalCost: runtime.Decimal
|
||||||
|
createdAt: Date
|
||||||
|
updatedAt: Date
|
||||||
}, ExtArgs["result"]["stockBalance"]>
|
}, ExtArgs["result"]["stockBalance"]>
|
||||||
composites: {}
|
composites: {}
|
||||||
}
|
}
|
||||||
@@ -481,8 +860,8 @@ export interface StockBalanceDelegate<ExtArgs extends runtime.Types.Extensions.I
|
|||||||
* // Get first 10 StockBalances
|
* // Get first 10 StockBalances
|
||||||
* const stockBalances = await prisma.stockBalance.findMany({ take: 10 })
|
* const stockBalances = await prisma.stockBalance.findMany({ take: 10 })
|
||||||
*
|
*
|
||||||
* // Only select the `quantity`
|
* // Only select the `id`
|
||||||
* const stockBalanceWithQuantityOnly = await prisma.stockBalance.findMany({ select: { quantity: true } })
|
* const stockBalanceWithIdOnly = await prisma.stockBalance.findMany({ select: { id: true } })
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
findMany<T extends StockBalanceFindManyArgs>(args?: Prisma.SelectSubset<T, StockBalanceFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockBalancePayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>
|
findMany<T extends StockBalanceFindManyArgs>(args?: Prisma.SelectSubset<T, StockBalanceFindManyArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$StockBalancePayload<ExtArgs>, T, "findMany", GlobalOmitOptions>>
|
||||||
@@ -738,6 +1117,8 @@ readonly fields: StockBalanceFieldRefs;
|
|||||||
*/
|
*/
|
||||||
export interface Prisma__StockBalanceClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
export interface Prisma__StockBalanceClient<T, Null = never, ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs, GlobalOmitOptions = {}> extends Prisma.PrismaPromise<T> {
|
||||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||||
|
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>
|
||||||
|
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>
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
@@ -767,11 +1148,14 @@ export interface Prisma__StockBalanceClient<T, Null = never, ExtArgs extends run
|
|||||||
* Fields of the StockBalance model
|
* Fields of the StockBalance model
|
||||||
*/
|
*/
|
||||||
export interface StockBalanceFieldRefs {
|
export interface StockBalanceFieldRefs {
|
||||||
|
readonly id: Prisma.FieldRef<"StockBalance", 'Int'>
|
||||||
|
readonly productId: Prisma.FieldRef<"StockBalance", 'Int'>
|
||||||
|
readonly inventoryId: Prisma.FieldRef<"StockBalance", 'Int'>
|
||||||
readonly quantity: Prisma.FieldRef<"StockBalance", 'Decimal'>
|
readonly quantity: Prisma.FieldRef<"StockBalance", 'Decimal'>
|
||||||
readonly totalCost: Prisma.FieldRef<"StockBalance", 'Decimal'>
|
|
||||||
readonly updatedAt: Prisma.FieldRef<"StockBalance", 'DateTime'>
|
|
||||||
readonly ProductId: Prisma.FieldRef<"StockBalance", 'Int'>
|
|
||||||
readonly avgCost: Prisma.FieldRef<"StockBalance", 'Decimal'>
|
readonly avgCost: Prisma.FieldRef<"StockBalance", 'Decimal'>
|
||||||
|
readonly totalCost: Prisma.FieldRef<"StockBalance", 'Decimal'>
|
||||||
|
readonly createdAt: Prisma.FieldRef<"StockBalance", 'DateTime'>
|
||||||
|
readonly updatedAt: Prisma.FieldRef<"StockBalance", 'DateTime'>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -788,6 +1172,10 @@ export type StockBalanceFindUniqueArgs<ExtArgs extends runtime.Types.Extensions.
|
|||||||
* Omit specific fields from the StockBalance
|
* Omit specific fields from the StockBalance
|
||||||
*/
|
*/
|
||||||
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
/**
|
/**
|
||||||
* Filter, which StockBalance to fetch.
|
* Filter, which StockBalance to fetch.
|
||||||
*/
|
*/
|
||||||
@@ -806,6 +1194,10 @@ export type StockBalanceFindUniqueOrThrowArgs<ExtArgs extends runtime.Types.Exte
|
|||||||
* Omit specific fields from the StockBalance
|
* Omit specific fields from the StockBalance
|
||||||
*/
|
*/
|
||||||
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
/**
|
/**
|
||||||
* Filter, which StockBalance to fetch.
|
* Filter, which StockBalance to fetch.
|
||||||
*/
|
*/
|
||||||
@@ -824,6 +1216,10 @@ export type StockBalanceFindFirstArgs<ExtArgs extends runtime.Types.Extensions.I
|
|||||||
* Omit specific fields from the StockBalance
|
* Omit specific fields from the StockBalance
|
||||||
*/
|
*/
|
||||||
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
/**
|
/**
|
||||||
* Filter, which StockBalance to fetch.
|
* Filter, which StockBalance to fetch.
|
||||||
*/
|
*/
|
||||||
@@ -872,6 +1268,10 @@ export type StockBalanceFindFirstOrThrowArgs<ExtArgs extends runtime.Types.Exten
|
|||||||
* Omit specific fields from the StockBalance
|
* Omit specific fields from the StockBalance
|
||||||
*/
|
*/
|
||||||
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
/**
|
/**
|
||||||
* Filter, which StockBalance to fetch.
|
* Filter, which StockBalance to fetch.
|
||||||
*/
|
*/
|
||||||
@@ -920,6 +1320,10 @@ export type StockBalanceFindManyArgs<ExtArgs extends runtime.Types.Extensions.In
|
|||||||
* Omit specific fields from the StockBalance
|
* Omit specific fields from the StockBalance
|
||||||
*/
|
*/
|
||||||
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
/**
|
/**
|
||||||
* Filter, which StockBalances to fetch.
|
* Filter, which StockBalances to fetch.
|
||||||
*/
|
*/
|
||||||
@@ -963,6 +1367,10 @@ export type StockBalanceCreateArgs<ExtArgs extends runtime.Types.Extensions.Inte
|
|||||||
* Omit specific fields from the StockBalance
|
* Omit specific fields from the StockBalance
|
||||||
*/
|
*/
|
||||||
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
/**
|
/**
|
||||||
* The data needed to create a StockBalance.
|
* The data needed to create a StockBalance.
|
||||||
*/
|
*/
|
||||||
@@ -992,6 +1400,10 @@ export type StockBalanceUpdateArgs<ExtArgs extends runtime.Types.Extensions.Inte
|
|||||||
* Omit specific fields from the StockBalance
|
* Omit specific fields from the StockBalance
|
||||||
*/
|
*/
|
||||||
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
/**
|
/**
|
||||||
* The data needed to update a StockBalance.
|
* The data needed to update a StockBalance.
|
||||||
*/
|
*/
|
||||||
@@ -1032,6 +1444,10 @@ export type StockBalanceUpsertArgs<ExtArgs extends runtime.Types.Extensions.Inte
|
|||||||
* Omit specific fields from the StockBalance
|
* Omit specific fields from the StockBalance
|
||||||
*/
|
*/
|
||||||
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
/**
|
/**
|
||||||
* The filter to search for the StockBalance to update in case it exists.
|
* The filter to search for the StockBalance to update in case it exists.
|
||||||
*/
|
*/
|
||||||
@@ -1058,6 +1474,10 @@ export type StockBalanceDeleteArgs<ExtArgs extends runtime.Types.Extensions.Inte
|
|||||||
* Omit specific fields from the StockBalance
|
* Omit specific fields from the StockBalance
|
||||||
*/
|
*/
|
||||||
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
/**
|
/**
|
||||||
* Filter which StockBalance to delete.
|
* Filter which StockBalance to delete.
|
||||||
*/
|
*/
|
||||||
@@ -1090,4 +1510,8 @@ export type StockBalanceDefaultArgs<ExtArgs extends runtime.Types.Extensions.Int
|
|||||||
* Omit specific fields from the StockBalance
|
* Omit specific fields from the StockBalance
|
||||||
*/
|
*/
|
||||||
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
omit?: Prisma.StockBalanceOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.StockBalanceInclude<ExtArgs> | null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ export type StockMovementAvgAggregateOutputType = {
|
|||||||
productId: number | null
|
productId: number | null
|
||||||
inventoryId: number | null
|
inventoryId: number | null
|
||||||
avgCost: runtime.Decimal | null
|
avgCost: runtime.Decimal | null
|
||||||
|
remainedInStock: runtime.Decimal | null
|
||||||
|
supplierId: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementSumAggregateOutputType = {
|
export type StockMovementSumAggregateOutputType = {
|
||||||
@@ -44,6 +46,8 @@ export type StockMovementSumAggregateOutputType = {
|
|||||||
productId: number | null
|
productId: number | null
|
||||||
inventoryId: number | null
|
inventoryId: number | null
|
||||||
avgCost: runtime.Decimal | null
|
avgCost: runtime.Decimal | null
|
||||||
|
remainedInStock: runtime.Decimal | null
|
||||||
|
supplierId: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementMinAggregateOutputType = {
|
export type StockMovementMinAggregateOutputType = {
|
||||||
@@ -58,6 +62,8 @@ export type StockMovementMinAggregateOutputType = {
|
|||||||
productId: number | null
|
productId: number | null
|
||||||
inventoryId: number | null
|
inventoryId: number | null
|
||||||
avgCost: runtime.Decimal | null
|
avgCost: runtime.Decimal | null
|
||||||
|
remainedInStock: runtime.Decimal | null
|
||||||
|
supplierId: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementMaxAggregateOutputType = {
|
export type StockMovementMaxAggregateOutputType = {
|
||||||
@@ -72,6 +78,8 @@ export type StockMovementMaxAggregateOutputType = {
|
|||||||
productId: number | null
|
productId: number | null
|
||||||
inventoryId: number | null
|
inventoryId: number | null
|
||||||
avgCost: runtime.Decimal | null
|
avgCost: runtime.Decimal | null
|
||||||
|
remainedInStock: runtime.Decimal | null
|
||||||
|
supplierId: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementCountAggregateOutputType = {
|
export type StockMovementCountAggregateOutputType = {
|
||||||
@@ -86,6 +94,8 @@ export type StockMovementCountAggregateOutputType = {
|
|||||||
productId: number
|
productId: number
|
||||||
inventoryId: number
|
inventoryId: number
|
||||||
avgCost: number
|
avgCost: number
|
||||||
|
remainedInStock: number
|
||||||
|
supplierId: number
|
||||||
_all: number
|
_all: number
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,6 +108,8 @@ export type StockMovementAvgAggregateInputType = {
|
|||||||
productId?: true
|
productId?: true
|
||||||
inventoryId?: true
|
inventoryId?: true
|
||||||
avgCost?: true
|
avgCost?: true
|
||||||
|
remainedInStock?: true
|
||||||
|
supplierId?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementSumAggregateInputType = {
|
export type StockMovementSumAggregateInputType = {
|
||||||
@@ -108,6 +120,8 @@ export type StockMovementSumAggregateInputType = {
|
|||||||
productId?: true
|
productId?: true
|
||||||
inventoryId?: true
|
inventoryId?: true
|
||||||
avgCost?: true
|
avgCost?: true
|
||||||
|
remainedInStock?: true
|
||||||
|
supplierId?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementMinAggregateInputType = {
|
export type StockMovementMinAggregateInputType = {
|
||||||
@@ -122,6 +136,8 @@ export type StockMovementMinAggregateInputType = {
|
|||||||
productId?: true
|
productId?: true
|
||||||
inventoryId?: true
|
inventoryId?: true
|
||||||
avgCost?: true
|
avgCost?: true
|
||||||
|
remainedInStock?: true
|
||||||
|
supplierId?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementMaxAggregateInputType = {
|
export type StockMovementMaxAggregateInputType = {
|
||||||
@@ -136,6 +152,8 @@ export type StockMovementMaxAggregateInputType = {
|
|||||||
productId?: true
|
productId?: true
|
||||||
inventoryId?: true
|
inventoryId?: true
|
||||||
avgCost?: true
|
avgCost?: true
|
||||||
|
remainedInStock?: true
|
||||||
|
supplierId?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementCountAggregateInputType = {
|
export type StockMovementCountAggregateInputType = {
|
||||||
@@ -150,6 +168,8 @@ export type StockMovementCountAggregateInputType = {
|
|||||||
productId?: true
|
productId?: true
|
||||||
inventoryId?: true
|
inventoryId?: true
|
||||||
avgCost?: true
|
avgCost?: true
|
||||||
|
remainedInStock?: true
|
||||||
|
supplierId?: true
|
||||||
_all?: true
|
_all?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,6 +271,8 @@ export type StockMovementGroupByOutputType = {
|
|||||||
productId: number
|
productId: number
|
||||||
inventoryId: number
|
inventoryId: number
|
||||||
avgCost: runtime.Decimal
|
avgCost: runtime.Decimal
|
||||||
|
remainedInStock: runtime.Decimal
|
||||||
|
supplierId: number | null
|
||||||
_count: StockMovementCountAggregateOutputType | null
|
_count: StockMovementCountAggregateOutputType | null
|
||||||
_avg: StockMovementAvgAggregateOutputType | null
|
_avg: StockMovementAvgAggregateOutputType | null
|
||||||
_sum: StockMovementSumAggregateOutputType | null
|
_sum: StockMovementSumAggregateOutputType | null
|
||||||
@@ -288,8 +310,11 @@ export type StockMovementWhereInput = {
|
|||||||
productId?: Prisma.IntFilter<"StockMovement"> | number
|
productId?: Prisma.IntFilter<"StockMovement"> | number
|
||||||
inventoryId?: Prisma.IntFilter<"StockMovement"> | number
|
inventoryId?: Prisma.IntFilter<"StockMovement"> | number
|
||||||
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
|
||||||
|
supplierId?: 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
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementOrderByWithRelationInput = {
|
export type StockMovementOrderByWithRelationInput = {
|
||||||
@@ -304,8 +329,11 @@ export type StockMovementOrderByWithRelationInput = {
|
|||||||
productId?: Prisma.SortOrder
|
productId?: Prisma.SortOrder
|
||||||
inventoryId?: Prisma.SortOrder
|
inventoryId?: Prisma.SortOrder
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
remainedInStock?: Prisma.SortOrder
|
||||||
|
supplierId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||||
inventory?: Prisma.InventoryOrderByWithRelationInput
|
inventory?: Prisma.InventoryOrderByWithRelationInput
|
||||||
product?: Prisma.ProductOrderByWithRelationInput
|
product?: Prisma.ProductOrderByWithRelationInput
|
||||||
|
supplier?: Prisma.SupplierOrderByWithRelationInput
|
||||||
_relevance?: Prisma.StockMovementOrderByRelevanceInput
|
_relevance?: Prisma.StockMovementOrderByRelevanceInput
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,8 +352,11 @@ export type StockMovementWhereUniqueInput = Prisma.AtLeast<{
|
|||||||
productId?: Prisma.IntFilter<"StockMovement"> | number
|
productId?: Prisma.IntFilter<"StockMovement"> | number
|
||||||
inventoryId?: Prisma.IntFilter<"StockMovement"> | number
|
inventoryId?: Prisma.IntFilter<"StockMovement"> | number
|
||||||
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
|
||||||
|
supplierId?: 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
|
||||||
}, "id">
|
}, "id">
|
||||||
|
|
||||||
export type StockMovementOrderByWithAggregationInput = {
|
export type StockMovementOrderByWithAggregationInput = {
|
||||||
@@ -340,6 +371,8 @@ export type StockMovementOrderByWithAggregationInput = {
|
|||||||
productId?: Prisma.SortOrder
|
productId?: Prisma.SortOrder
|
||||||
inventoryId?: Prisma.SortOrder
|
inventoryId?: Prisma.SortOrder
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
remainedInStock?: Prisma.SortOrder
|
||||||
|
supplierId?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||||
_count?: Prisma.StockMovementCountOrderByAggregateInput
|
_count?: Prisma.StockMovementCountOrderByAggregateInput
|
||||||
_avg?: Prisma.StockMovementAvgOrderByAggregateInput
|
_avg?: Prisma.StockMovementAvgOrderByAggregateInput
|
||||||
_max?: Prisma.StockMovementMaxOrderByAggregateInput
|
_max?: Prisma.StockMovementMaxOrderByAggregateInput
|
||||||
@@ -362,6 +395,8 @@ export type StockMovementScalarWhereWithAggregatesInput = {
|
|||||||
productId?: Prisma.IntWithAggregatesFilter<"StockMovement"> | number
|
productId?: Prisma.IntWithAggregatesFilter<"StockMovement"> | number
|
||||||
inventoryId?: Prisma.IntWithAggregatesFilter<"StockMovement"> | number
|
inventoryId?: Prisma.IntWithAggregatesFilter<"StockMovement"> | number
|
||||||
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
|
||||||
|
supplierId?: Prisma.IntNullableWithAggregatesFilter<"StockMovement"> | number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementCreateInput = {
|
export type StockMovementCreateInput = {
|
||||||
@@ -373,8 +408,10 @@ export type StockMovementCreateInput = {
|
|||||||
referenceId: string
|
referenceId: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost: 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
|
||||||
|
supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUncheckedCreateInput = {
|
export type StockMovementUncheckedCreateInput = {
|
||||||
@@ -389,6 +426,8 @@ export type StockMovementUncheckedCreateInput = {
|
|||||||
productId: number
|
productId: number
|
||||||
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
|
||||||
|
supplierId?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUpdateInput = {
|
export type StockMovementUpdateInput = {
|
||||||
@@ -400,8 +439,10 @@ export type StockMovementUpdateInput = {
|
|||||||
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
|
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
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
|
||||||
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput
|
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput
|
||||||
product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput
|
product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput
|
||||||
|
supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUncheckedUpdateInput = {
|
export type StockMovementUncheckedUpdateInput = {
|
||||||
@@ -416,6 +457,8 @@ export type StockMovementUncheckedUpdateInput = {
|
|||||||
productId?: Prisma.IntFieldUpdateOperationsInput | number
|
productId?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
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
|
||||||
|
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementCreateManyInput = {
|
export type StockMovementCreateManyInput = {
|
||||||
@@ -430,6 +473,8 @@ export type StockMovementCreateManyInput = {
|
|||||||
productId: number
|
productId: number
|
||||||
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
|
||||||
|
supplierId?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUpdateManyMutationInput = {
|
export type StockMovementUpdateManyMutationInput = {
|
||||||
@@ -441,6 +486,7 @@ export type StockMovementUpdateManyMutationInput = {
|
|||||||
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
|
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUncheckedUpdateManyInput = {
|
export type StockMovementUncheckedUpdateManyInput = {
|
||||||
@@ -455,6 +501,8 @@ export type StockMovementUncheckedUpdateManyInput = {
|
|||||||
productId?: Prisma.IntFieldUpdateOperationsInput | number
|
productId?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
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
|
||||||
|
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementListRelationFilter = {
|
export type StockMovementListRelationFilter = {
|
||||||
@@ -485,6 +533,8 @@ export type StockMovementCountOrderByAggregateInput = {
|
|||||||
productId?: Prisma.SortOrder
|
productId?: Prisma.SortOrder
|
||||||
inventoryId?: Prisma.SortOrder
|
inventoryId?: Prisma.SortOrder
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
remainedInStock?: Prisma.SortOrder
|
||||||
|
supplierId?: Prisma.SortOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementAvgOrderByAggregateInput = {
|
export type StockMovementAvgOrderByAggregateInput = {
|
||||||
@@ -495,6 +545,8 @@ export type StockMovementAvgOrderByAggregateInput = {
|
|||||||
productId?: Prisma.SortOrder
|
productId?: Prisma.SortOrder
|
||||||
inventoryId?: Prisma.SortOrder
|
inventoryId?: Prisma.SortOrder
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
remainedInStock?: Prisma.SortOrder
|
||||||
|
supplierId?: Prisma.SortOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementMaxOrderByAggregateInput = {
|
export type StockMovementMaxOrderByAggregateInput = {
|
||||||
@@ -509,6 +561,8 @@ export type StockMovementMaxOrderByAggregateInput = {
|
|||||||
productId?: Prisma.SortOrder
|
productId?: Prisma.SortOrder
|
||||||
inventoryId?: Prisma.SortOrder
|
inventoryId?: Prisma.SortOrder
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
remainedInStock?: Prisma.SortOrder
|
||||||
|
supplierId?: Prisma.SortOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementMinOrderByAggregateInput = {
|
export type StockMovementMinOrderByAggregateInput = {
|
||||||
@@ -523,6 +577,8 @@ export type StockMovementMinOrderByAggregateInput = {
|
|||||||
productId?: Prisma.SortOrder
|
productId?: Prisma.SortOrder
|
||||||
inventoryId?: Prisma.SortOrder
|
inventoryId?: Prisma.SortOrder
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
remainedInStock?: Prisma.SortOrder
|
||||||
|
supplierId?: Prisma.SortOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementSumOrderByAggregateInput = {
|
export type StockMovementSumOrderByAggregateInput = {
|
||||||
@@ -533,6 +589,8 @@ export type StockMovementSumOrderByAggregateInput = {
|
|||||||
productId?: Prisma.SortOrder
|
productId?: Prisma.SortOrder
|
||||||
inventoryId?: Prisma.SortOrder
|
inventoryId?: Prisma.SortOrder
|
||||||
avgCost?: Prisma.SortOrder
|
avgCost?: Prisma.SortOrder
|
||||||
|
remainedInStock?: Prisma.SortOrder
|
||||||
|
supplierId?: Prisma.SortOrder
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementCreateNestedManyWithoutProductInput = {
|
export type StockMovementCreateNestedManyWithoutProductInput = {
|
||||||
@@ -577,6 +635,48 @@ export type StockMovementUncheckedUpdateManyWithoutProductNestedInput = {
|
|||||||
deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[]
|
deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type StockMovementCreateNestedManyWithoutSupplierInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutSupplierInput, Prisma.StockMovementUncheckedCreateWithoutSupplierInput> | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[]
|
||||||
|
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[]
|
||||||
|
createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope
|
||||||
|
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementUncheckedCreateNestedManyWithoutSupplierInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutSupplierInput, Prisma.StockMovementUncheckedCreateWithoutSupplierInput> | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[]
|
||||||
|
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[]
|
||||||
|
createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope
|
||||||
|
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementUpdateManyWithoutSupplierNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutSupplierInput, Prisma.StockMovementUncheckedCreateWithoutSupplierInput> | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[]
|
||||||
|
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[]
|
||||||
|
upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput[]
|
||||||
|
createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope
|
||||||
|
set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
|
||||||
|
disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
|
||||||
|
delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
|
||||||
|
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
|
||||||
|
update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput[]
|
||||||
|
updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput | Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput[]
|
||||||
|
deleteMany?: Prisma.StockMovementScalarWhereInput | Prisma.StockMovementScalarWhereInput[]
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementUncheckedUpdateManyWithoutSupplierNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.StockMovementCreateWithoutSupplierInput, Prisma.StockMovementUncheckedCreateWithoutSupplierInput> | Prisma.StockMovementCreateWithoutSupplierInput[] | Prisma.StockMovementUncheckedCreateWithoutSupplierInput[]
|
||||||
|
connectOrCreate?: Prisma.StockMovementCreateOrConnectWithoutSupplierInput | Prisma.StockMovementCreateOrConnectWithoutSupplierInput[]
|
||||||
|
upsert?: Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpsertWithWhereUniqueWithoutSupplierInput[]
|
||||||
|
createMany?: Prisma.StockMovementCreateManySupplierInputEnvelope
|
||||||
|
set?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
|
||||||
|
disconnect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
|
||||||
|
delete?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
|
||||||
|
connect?: Prisma.StockMovementWhereUniqueInput | Prisma.StockMovementWhereUniqueInput[]
|
||||||
|
update?: Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput | Prisma.StockMovementUpdateWithWhereUniqueWithoutSupplierInput[]
|
||||||
|
updateMany?: Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput | Prisma.StockMovementUpdateManyWithWhereWithoutSupplierInput[]
|
||||||
|
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[]
|
||||||
@@ -636,7 +736,9 @@ export type StockMovementCreateWithoutProductInput = {
|
|||||||
referenceId: string
|
referenceId: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput
|
inventory: Prisma.InventoryCreateNestedOneWithoutStockMovementsInput
|
||||||
|
supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUncheckedCreateWithoutProductInput = {
|
export type StockMovementUncheckedCreateWithoutProductInput = {
|
||||||
@@ -650,6 +752,8 @@ export type StockMovementUncheckedCreateWithoutProductInput = {
|
|||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
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
|
||||||
|
supplierId?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementCreateOrConnectWithoutProductInput = {
|
export type StockMovementCreateOrConnectWithoutProductInput = {
|
||||||
@@ -693,6 +797,63 @@ export type StockMovementScalarWhereInput = {
|
|||||||
productId?: Prisma.IntFilter<"StockMovement"> | number
|
productId?: Prisma.IntFilter<"StockMovement"> | number
|
||||||
inventoryId?: Prisma.IntFilter<"StockMovement"> | number
|
inventoryId?: Prisma.IntFilter<"StockMovement"> | number
|
||||||
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
|
||||||
|
supplierId?: Prisma.IntNullableFilter<"StockMovement"> | number | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementCreateWithoutSupplierInput = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementUncheckedCreateWithoutSupplierInput = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementCreateOrConnectWithoutSupplierInput = {
|
||||||
|
where: Prisma.StockMovementWhereUniqueInput
|
||||||
|
create: Prisma.XOR<Prisma.StockMovementCreateWithoutSupplierInput, Prisma.StockMovementUncheckedCreateWithoutSupplierInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementCreateManySupplierInputEnvelope = {
|
||||||
|
data: Prisma.StockMovementCreateManySupplierInput | Prisma.StockMovementCreateManySupplierInput[]
|
||||||
|
skipDuplicates?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementUpsertWithWhereUniqueWithoutSupplierInput = {
|
||||||
|
where: Prisma.StockMovementWhereUniqueInput
|
||||||
|
update: Prisma.XOR<Prisma.StockMovementUpdateWithoutSupplierInput, Prisma.StockMovementUncheckedUpdateWithoutSupplierInput>
|
||||||
|
create: Prisma.XOR<Prisma.StockMovementCreateWithoutSupplierInput, Prisma.StockMovementUncheckedCreateWithoutSupplierInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementUpdateWithWhereUniqueWithoutSupplierInput = {
|
||||||
|
where: Prisma.StockMovementWhereUniqueInput
|
||||||
|
data: Prisma.XOR<Prisma.StockMovementUpdateWithoutSupplierInput, Prisma.StockMovementUncheckedUpdateWithoutSupplierInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementUpdateManyWithWhereWithoutSupplierInput = {
|
||||||
|
where: Prisma.StockMovementScalarWhereInput
|
||||||
|
data: Prisma.XOR<Prisma.StockMovementUpdateManyMutationInput, Prisma.StockMovementUncheckedUpdateManyWithoutSupplierInput>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementCreateWithoutInventoryInput = {
|
export type StockMovementCreateWithoutInventoryInput = {
|
||||||
@@ -704,7 +865,9 @@ export type StockMovementCreateWithoutInventoryInput = {
|
|||||||
referenceId: string
|
referenceId: string
|
||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput
|
product: Prisma.ProductCreateNestedOneWithoutStockMovementsInput
|
||||||
|
supplier?: Prisma.SupplierCreateNestedOneWithoutStockMovementsInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUncheckedCreateWithoutInventoryInput = {
|
export type StockMovementUncheckedCreateWithoutInventoryInput = {
|
||||||
@@ -718,6 +881,8 @@ export type StockMovementUncheckedCreateWithoutInventoryInput = {
|
|||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
productId: number
|
productId: number
|
||||||
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
supplierId?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementCreateOrConnectWithoutInventoryInput = {
|
export type StockMovementCreateOrConnectWithoutInventoryInput = {
|
||||||
@@ -757,6 +922,8 @@ export type StockMovementCreateManyProductInput = {
|
|||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
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
|
||||||
|
supplierId?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUpdateWithoutProductInput = {
|
export type StockMovementUpdateWithoutProductInput = {
|
||||||
@@ -768,7 +935,9 @@ export type StockMovementUpdateWithoutProductInput = {
|
|||||||
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
|
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
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
|
||||||
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput
|
inventory?: Prisma.InventoryUpdateOneRequiredWithoutStockMovementsNestedInput
|
||||||
|
supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUncheckedUpdateWithoutProductInput = {
|
export type StockMovementUncheckedUpdateWithoutProductInput = {
|
||||||
@@ -782,6 +951,8 @@ export type StockMovementUncheckedUpdateWithoutProductInput = {
|
|||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
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
|
||||||
|
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUncheckedUpdateManyWithoutProductInput = {
|
export type StockMovementUncheckedUpdateManyWithoutProductInput = {
|
||||||
@@ -795,6 +966,67 @@ export type StockMovementUncheckedUpdateManyWithoutProductInput = {
|
|||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
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
|
||||||
|
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementCreateManySupplierInput = {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementUpdateWithoutSupplierInput = {
|
||||||
|
type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType
|
||||||
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementUncheckedUpdateWithoutSupplierInput = {
|
||||||
|
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType
|
||||||
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StockMovementUncheckedUpdateManyWithoutSupplierInput = {
|
||||||
|
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
type?: Prisma.EnumMovementTypeFieldUpdateOperationsInput | $Enums.MovementType
|
||||||
|
quantity?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
fee?: Prisma.DecimalFieldUpdateOperationsInput | runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementCreateManyInventoryInput = {
|
export type StockMovementCreateManyInventoryInput = {
|
||||||
@@ -808,6 +1040,8 @@ export type StockMovementCreateManyInventoryInput = {
|
|||||||
createdAt?: Date | string
|
createdAt?: Date | string
|
||||||
productId: number
|
productId: number
|
||||||
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
avgCost: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
remainedInStock?: runtime.Decimal | runtime.DecimalJsLike | number | string
|
||||||
|
supplierId?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUpdateWithoutInventoryInput = {
|
export type StockMovementUpdateWithoutInventoryInput = {
|
||||||
@@ -819,7 +1053,9 @@ export type StockMovementUpdateWithoutInventoryInput = {
|
|||||||
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
|
referenceId?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
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
|
||||||
product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput
|
product?: Prisma.ProductUpdateOneRequiredWithoutStockMovementsNestedInput
|
||||||
|
supplier?: Prisma.SupplierUpdateOneWithoutStockMovementsNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUncheckedUpdateWithoutInventoryInput = {
|
export type StockMovementUncheckedUpdateWithoutInventoryInput = {
|
||||||
@@ -833,6 +1069,8 @@ export type StockMovementUncheckedUpdateWithoutInventoryInput = {
|
|||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
productId?: Prisma.IntFieldUpdateOperationsInput | number
|
productId?: 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
|
||||||
|
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockMovementUncheckedUpdateManyWithoutInventoryInput = {
|
export type StockMovementUncheckedUpdateManyWithoutInventoryInput = {
|
||||||
@@ -846,6 +1084,8 @@ export type StockMovementUncheckedUpdateManyWithoutInventoryInput = {
|
|||||||
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
productId?: Prisma.IntFieldUpdateOperationsInput | number
|
productId?: 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
|
||||||
|
supplierId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -862,8 +1102,11 @@ export type StockMovementSelect<ExtArgs extends runtime.Types.Extensions.Interna
|
|||||||
productId?: boolean
|
productId?: boolean
|
||||||
inventoryId?: boolean
|
inventoryId?: boolean
|
||||||
avgCost?: boolean
|
avgCost?: boolean
|
||||||
|
remainedInStock?: boolean
|
||||||
|
supplierId?: 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>
|
||||||
}, ExtArgs["result"]["stockMovement"]>
|
}, ExtArgs["result"]["stockMovement"]>
|
||||||
|
|
||||||
|
|
||||||
@@ -880,12 +1123,15 @@ export type StockMovementSelectScalar = {
|
|||||||
productId?: boolean
|
productId?: boolean
|
||||||
inventoryId?: boolean
|
inventoryId?: boolean
|
||||||
avgCost?: boolean
|
avgCost?: boolean
|
||||||
|
remainedInStock?: boolean
|
||||||
|
supplierId?: 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", 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", 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>
|
||||||
}
|
}
|
||||||
|
|
||||||
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> = {
|
||||||
@@ -893,6 +1139,7 @@ export type $StockMovementPayload<ExtArgs extends runtime.Types.Extensions.Inter
|
|||||||
objects: {
|
objects: {
|
||||||
inventory: Prisma.$InventoryPayload<ExtArgs>
|
inventory: Prisma.$InventoryPayload<ExtArgs>
|
||||||
product: Prisma.$ProductPayload<ExtArgs>
|
product: Prisma.$ProductPayload<ExtArgs>
|
||||||
|
supplier: Prisma.$SupplierPayload<ExtArgs> | null
|
||||||
}
|
}
|
||||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||||
id: number
|
id: number
|
||||||
@@ -906,6 +1153,8 @@ export type $StockMovementPayload<ExtArgs extends runtime.Types.Extensions.Inter
|
|||||||
productId: number
|
productId: number
|
||||||
inventoryId: number
|
inventoryId: number
|
||||||
avgCost: runtime.Decimal
|
avgCost: runtime.Decimal
|
||||||
|
remainedInStock: runtime.Decimal
|
||||||
|
supplierId: number | null
|
||||||
}, ExtArgs["result"]["stockMovement"]>
|
}, ExtArgs["result"]["stockMovement"]>
|
||||||
composites: {}
|
composites: {}
|
||||||
}
|
}
|
||||||
@@ -1248,6 +1497,7 @@ export interface Prisma__StockMovementClient<T, Null = never, ExtArgs extends ru
|
|||||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||||
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>
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
@@ -1288,6 +1538,8 @@ export interface StockMovementFieldRefs {
|
|||||||
readonly productId: Prisma.FieldRef<"StockMovement", 'Int'>
|
readonly productId: Prisma.FieldRef<"StockMovement", 'Int'>
|
||||||
readonly inventoryId: Prisma.FieldRef<"StockMovement", 'Int'>
|
readonly inventoryId: Prisma.FieldRef<"StockMovement", 'Int'>
|
||||||
readonly avgCost: Prisma.FieldRef<"StockMovement", 'Decimal'>
|
readonly avgCost: Prisma.FieldRef<"StockMovement", 'Decimal'>
|
||||||
|
readonly remainedInStock: Prisma.FieldRef<"StockMovement", 'Decimal'>
|
||||||
|
readonly supplierId: Prisma.FieldRef<"StockMovement", 'Int'>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1630,6 +1882,25 @@ export type StockMovementDeleteManyArgs<ExtArgs extends runtime.Types.Extensions
|
|||||||
limit?: number
|
limit?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* StockMovement.supplier
|
||||||
|
*/
|
||||||
|
export type StockMovement$supplierArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
/**
|
||||||
|
* Select specific fields to fetch from the Supplier
|
||||||
|
*/
|
||||||
|
select?: Prisma.SupplierSelect<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Omit specific fields from the Supplier
|
||||||
|
*/
|
||||||
|
omit?: Prisma.SupplierOmit<ExtArgs> | null
|
||||||
|
/**
|
||||||
|
* Choose, which related nodes to fetch as well
|
||||||
|
*/
|
||||||
|
include?: Prisma.SupplierInclude<ExtArgs> | null
|
||||||
|
where?: Prisma.SupplierWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StockMovement without action
|
* StockMovement without action
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -282,6 +282,7 @@ export type SupplierWhereInput = {
|
|||||||
deletedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null
|
deletedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null
|
||||||
productCharges?: Prisma.ProductChargeListRelationFilter
|
productCharges?: Prisma.ProductChargeListRelationFilter
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter
|
purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter
|
||||||
|
stockMovements?: Prisma.StockMovementListRelationFilter
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierOrderByWithRelationInput = {
|
export type SupplierOrderByWithRelationInput = {
|
||||||
@@ -300,6 +301,7 @@ export type SupplierOrderByWithRelationInput = {
|
|||||||
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
deletedAt?: Prisma.SortOrderInput | Prisma.SortOrder
|
||||||
productCharges?: Prisma.ProductChargeOrderByRelationAggregateInput
|
productCharges?: Prisma.ProductChargeOrderByRelationAggregateInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput
|
purchaseReceipts?: Prisma.PurchaseReceiptOrderByRelationAggregateInput
|
||||||
|
stockMovements?: Prisma.StockMovementOrderByRelationAggregateInput
|
||||||
_relevance?: Prisma.SupplierOrderByRelevanceInput
|
_relevance?: Prisma.SupplierOrderByRelevanceInput
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,6 +324,7 @@ export type SupplierWhereUniqueInput = Prisma.AtLeast<{
|
|||||||
deletedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null
|
deletedAt?: Prisma.DateTimeNullableFilter<"Supplier"> | Date | string | null
|
||||||
productCharges?: Prisma.ProductChargeListRelationFilter
|
productCharges?: Prisma.ProductChargeListRelationFilter
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter
|
purchaseReceipts?: Prisma.PurchaseReceiptListRelationFilter
|
||||||
|
stockMovements?: Prisma.StockMovementListRelationFilter
|
||||||
}, "id" | "mobileNumber">
|
}, "id" | "mobileNumber">
|
||||||
|
|
||||||
export type SupplierOrderByWithAggregationInput = {
|
export type SupplierOrderByWithAggregationInput = {
|
||||||
@@ -379,6 +382,7 @@ export type SupplierCreateInput = {
|
|||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutSupplierInput
|
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutSupplierInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput
|
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput
|
||||||
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutSupplierInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierUncheckedCreateInput = {
|
export type SupplierUncheckedCreateInput = {
|
||||||
@@ -397,6 +401,7 @@ export type SupplierUncheckedCreateInput = {
|
|||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutSupplierInput
|
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutSupplierInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput
|
||||||
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutSupplierInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierUpdateInput = {
|
export type SupplierUpdateInput = {
|
||||||
@@ -414,6 +419,7 @@ export type SupplierUpdateInput = {
|
|||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
productCharges?: Prisma.ProductChargeUpdateManyWithoutSupplierNestedInput
|
productCharges?: Prisma.ProductChargeUpdateManyWithoutSupplierNestedInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput
|
||||||
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutSupplierNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierUncheckedUpdateInput = {
|
export type SupplierUncheckedUpdateInput = {
|
||||||
@@ -432,6 +438,7 @@ export type SupplierUncheckedUpdateInput = {
|
|||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutSupplierNestedInput
|
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutSupplierNestedInput
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput
|
||||||
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutSupplierNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierCreateManyInput = {
|
export type SupplierCreateManyInput = {
|
||||||
@@ -548,6 +555,11 @@ export type SupplierScalarRelationFilter = {
|
|||||||
isNot?: Prisma.SupplierWhereInput
|
isNot?: Prisma.SupplierWhereInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type SupplierNullableScalarRelationFilter = {
|
||||||
|
is?: Prisma.SupplierWhereInput | null
|
||||||
|
isNot?: Prisma.SupplierWhereInput | null
|
||||||
|
}
|
||||||
|
|
||||||
export type SupplierCreateNestedOneWithoutProductChargesInput = {
|
export type SupplierCreateNestedOneWithoutProductChargesInput = {
|
||||||
create?: Prisma.XOR<Prisma.SupplierCreateWithoutProductChargesInput, Prisma.SupplierUncheckedCreateWithoutProductChargesInput>
|
create?: Prisma.XOR<Prisma.SupplierCreateWithoutProductChargesInput, Prisma.SupplierUncheckedCreateWithoutProductChargesInput>
|
||||||
connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutProductChargesInput
|
connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutProductChargesInput
|
||||||
@@ -576,6 +588,22 @@ export type SupplierUpdateOneRequiredWithoutPurchaseReceiptsNestedInput = {
|
|||||||
update?: Prisma.XOR<Prisma.XOR<Prisma.SupplierUpdateToOneWithWhereWithoutPurchaseReceiptsInput, Prisma.SupplierUpdateWithoutPurchaseReceiptsInput>, Prisma.SupplierUncheckedUpdateWithoutPurchaseReceiptsInput>
|
update?: Prisma.XOR<Prisma.XOR<Prisma.SupplierUpdateToOneWithWhereWithoutPurchaseReceiptsInput, Prisma.SupplierUpdateWithoutPurchaseReceiptsInput>, Prisma.SupplierUncheckedUpdateWithoutPurchaseReceiptsInput>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type SupplierCreateNestedOneWithoutStockMovementsInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.SupplierCreateWithoutStockMovementsInput, Prisma.SupplierUncheckedCreateWithoutStockMovementsInput>
|
||||||
|
connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutStockMovementsInput
|
||||||
|
connect?: Prisma.SupplierWhereUniqueInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SupplierUpdateOneWithoutStockMovementsNestedInput = {
|
||||||
|
create?: Prisma.XOR<Prisma.SupplierCreateWithoutStockMovementsInput, Prisma.SupplierUncheckedCreateWithoutStockMovementsInput>
|
||||||
|
connectOrCreate?: Prisma.SupplierCreateOrConnectWithoutStockMovementsInput
|
||||||
|
upsert?: Prisma.SupplierUpsertWithoutStockMovementsInput
|
||||||
|
disconnect?: Prisma.SupplierWhereInput | boolean
|
||||||
|
delete?: Prisma.SupplierWhereInput | boolean
|
||||||
|
connect?: Prisma.SupplierWhereUniqueInput
|
||||||
|
update?: Prisma.XOR<Prisma.XOR<Prisma.SupplierUpdateToOneWithWhereWithoutStockMovementsInput, Prisma.SupplierUpdateWithoutStockMovementsInput>, Prisma.SupplierUncheckedUpdateWithoutStockMovementsInput>
|
||||||
|
}
|
||||||
|
|
||||||
export type SupplierCreateWithoutProductChargesInput = {
|
export type SupplierCreateWithoutProductChargesInput = {
|
||||||
firstName: string
|
firstName: string
|
||||||
lastName: string
|
lastName: string
|
||||||
@@ -590,6 +618,7 @@ export type SupplierCreateWithoutProductChargesInput = {
|
|||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput
|
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput
|
||||||
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutSupplierInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierUncheckedCreateWithoutProductChargesInput = {
|
export type SupplierUncheckedCreateWithoutProductChargesInput = {
|
||||||
@@ -607,6 +636,7 @@ export type SupplierUncheckedCreateWithoutProductChargesInput = {
|
|||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput
|
||||||
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutSupplierInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierCreateOrConnectWithoutProductChargesInput = {
|
export type SupplierCreateOrConnectWithoutProductChargesInput = {
|
||||||
@@ -639,6 +669,7 @@ export type SupplierUpdateWithoutProductChargesInput = {
|
|||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput
|
||||||
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutSupplierNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierUncheckedUpdateWithoutProductChargesInput = {
|
export type SupplierUncheckedUpdateWithoutProductChargesInput = {
|
||||||
@@ -656,6 +687,7 @@ export type SupplierUncheckedUpdateWithoutProductChargesInput = {
|
|||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput
|
||||||
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutSupplierNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierCreateWithoutPurchaseReceiptsInput = {
|
export type SupplierCreateWithoutPurchaseReceiptsInput = {
|
||||||
@@ -672,6 +704,7 @@ export type SupplierCreateWithoutPurchaseReceiptsInput = {
|
|||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutSupplierInput
|
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutSupplierInput
|
||||||
|
stockMovements?: Prisma.StockMovementCreateNestedManyWithoutSupplierInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierUncheckedCreateWithoutPurchaseReceiptsInput = {
|
export type SupplierUncheckedCreateWithoutPurchaseReceiptsInput = {
|
||||||
@@ -689,6 +722,7 @@ export type SupplierUncheckedCreateWithoutPurchaseReceiptsInput = {
|
|||||||
updatedAt?: Date | string
|
updatedAt?: Date | string
|
||||||
deletedAt?: Date | string | null
|
deletedAt?: Date | string | null
|
||||||
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutSupplierInput
|
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutSupplierInput
|
||||||
|
stockMovements?: Prisma.StockMovementUncheckedCreateNestedManyWithoutSupplierInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierCreateOrConnectWithoutPurchaseReceiptsInput = {
|
export type SupplierCreateOrConnectWithoutPurchaseReceiptsInput = {
|
||||||
@@ -721,6 +755,7 @@ export type SupplierUpdateWithoutPurchaseReceiptsInput = {
|
|||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
productCharges?: Prisma.ProductChargeUpdateManyWithoutSupplierNestedInput
|
productCharges?: Prisma.ProductChargeUpdateManyWithoutSupplierNestedInput
|
||||||
|
stockMovements?: Prisma.StockMovementUpdateManyWithoutSupplierNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierUncheckedUpdateWithoutPurchaseReceiptsInput = {
|
export type SupplierUncheckedUpdateWithoutPurchaseReceiptsInput = {
|
||||||
@@ -738,6 +773,93 @@ export type SupplierUncheckedUpdateWithoutPurchaseReceiptsInput = {
|
|||||||
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutSupplierNestedInput
|
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutSupplierNestedInput
|
||||||
|
stockMovements?: Prisma.StockMovementUncheckedUpdateManyWithoutSupplierNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SupplierCreateWithoutStockMovementsInput = {
|
||||||
|
firstName: string
|
||||||
|
lastName: string
|
||||||
|
email?: string | null
|
||||||
|
mobileNumber: string
|
||||||
|
address?: string | null
|
||||||
|
city?: string | null
|
||||||
|
state?: string | null
|
||||||
|
country?: string | null
|
||||||
|
isActive?: boolean
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
deletedAt?: Date | string | null
|
||||||
|
productCharges?: Prisma.ProductChargeCreateNestedManyWithoutSupplierInput
|
||||||
|
purchaseReceipts?: Prisma.PurchaseReceiptCreateNestedManyWithoutSupplierInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SupplierUncheckedCreateWithoutStockMovementsInput = {
|
||||||
|
id?: number
|
||||||
|
firstName: string
|
||||||
|
lastName: string
|
||||||
|
email?: string | null
|
||||||
|
mobileNumber: string
|
||||||
|
address?: string | null
|
||||||
|
city?: string | null
|
||||||
|
state?: string | null
|
||||||
|
country?: string | null
|
||||||
|
isActive?: boolean
|
||||||
|
createdAt?: Date | string
|
||||||
|
updatedAt?: Date | string
|
||||||
|
deletedAt?: Date | string | null
|
||||||
|
productCharges?: Prisma.ProductChargeUncheckedCreateNestedManyWithoutSupplierInput
|
||||||
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedCreateNestedManyWithoutSupplierInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SupplierCreateOrConnectWithoutStockMovementsInput = {
|
||||||
|
where: Prisma.SupplierWhereUniqueInput
|
||||||
|
create: Prisma.XOR<Prisma.SupplierCreateWithoutStockMovementsInput, Prisma.SupplierUncheckedCreateWithoutStockMovementsInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SupplierUpsertWithoutStockMovementsInput = {
|
||||||
|
update: Prisma.XOR<Prisma.SupplierUpdateWithoutStockMovementsInput, Prisma.SupplierUncheckedUpdateWithoutStockMovementsInput>
|
||||||
|
create: Prisma.XOR<Prisma.SupplierCreateWithoutStockMovementsInput, Prisma.SupplierUncheckedCreateWithoutStockMovementsInput>
|
||||||
|
where?: Prisma.SupplierWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SupplierUpdateToOneWithWhereWithoutStockMovementsInput = {
|
||||||
|
where?: Prisma.SupplierWhereInput
|
||||||
|
data: Prisma.XOR<Prisma.SupplierUpdateWithoutStockMovementsInput, Prisma.SupplierUncheckedUpdateWithoutStockMovementsInput>
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SupplierUpdateWithoutStockMovementsInput = {
|
||||||
|
firstName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
lastName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
|
productCharges?: Prisma.ProductChargeUpdateManyWithoutSupplierNestedInput
|
||||||
|
purchaseReceipts?: Prisma.PurchaseReceiptUpdateManyWithoutSupplierNestedInput
|
||||||
|
}
|
||||||
|
|
||||||
|
export type SupplierUncheckedUpdateWithoutStockMovementsInput = {
|
||||||
|
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||||
|
firstName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
lastName?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
email?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
mobileNumber?: Prisma.StringFieldUpdateOperationsInput | string
|
||||||
|
address?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
city?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
state?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
country?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||||
|
isActive?: Prisma.BoolFieldUpdateOperationsInput | boolean
|
||||||
|
createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string
|
||||||
|
deletedAt?: Prisma.NullableDateTimeFieldUpdateOperationsInput | Date | string | null
|
||||||
|
productCharges?: Prisma.ProductChargeUncheckedUpdateManyWithoutSupplierNestedInput
|
||||||
|
purchaseReceipts?: Prisma.PurchaseReceiptUncheckedUpdateManyWithoutSupplierNestedInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -748,11 +870,13 @@ export type SupplierUncheckedUpdateWithoutPurchaseReceiptsInput = {
|
|||||||
export type SupplierCountOutputType = {
|
export type SupplierCountOutputType = {
|
||||||
productCharges: number
|
productCharges: number
|
||||||
purchaseReceipts: number
|
purchaseReceipts: number
|
||||||
|
stockMovements: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupplierCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
export type SupplierCountOutputTypeSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
productCharges?: boolean | SupplierCountOutputTypeCountProductChargesArgs
|
productCharges?: boolean | SupplierCountOutputTypeCountProductChargesArgs
|
||||||
purchaseReceipts?: boolean | SupplierCountOutputTypeCountPurchaseReceiptsArgs
|
purchaseReceipts?: boolean | SupplierCountOutputTypeCountPurchaseReceiptsArgs
|
||||||
|
stockMovements?: boolean | SupplierCountOutputTypeCountStockMovementsArgs
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -779,6 +903,13 @@ export type SupplierCountOutputTypeCountPurchaseReceiptsArgs<ExtArgs extends run
|
|||||||
where?: Prisma.PurchaseReceiptWhereInput
|
where?: Prisma.PurchaseReceiptWhereInput
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SupplierCountOutputType without action
|
||||||
|
*/
|
||||||
|
export type SupplierCountOutputTypeCountStockMovementsArgs<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
|
where?: Prisma.StockMovementWhereInput
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export type SupplierSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
export type SupplierSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||||
id?: boolean
|
id?: boolean
|
||||||
@@ -796,6 +927,7 @@ export type SupplierSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
|||||||
deletedAt?: boolean
|
deletedAt?: boolean
|
||||||
productCharges?: boolean | Prisma.Supplier$productChargesArgs<ExtArgs>
|
productCharges?: boolean | Prisma.Supplier$productChargesArgs<ExtArgs>
|
||||||
purchaseReceipts?: boolean | Prisma.Supplier$purchaseReceiptsArgs<ExtArgs>
|
purchaseReceipts?: boolean | Prisma.Supplier$purchaseReceiptsArgs<ExtArgs>
|
||||||
|
stockMovements?: boolean | Prisma.Supplier$stockMovementsArgs<ExtArgs>
|
||||||
_count?: boolean | Prisma.SupplierCountOutputTypeDefaultArgs<ExtArgs>
|
_count?: boolean | Prisma.SupplierCountOutputTypeDefaultArgs<ExtArgs>
|
||||||
}, ExtArgs["result"]["supplier"]>
|
}, ExtArgs["result"]["supplier"]>
|
||||||
|
|
||||||
@@ -821,6 +953,7 @@ export type SupplierOmit<ExtArgs extends runtime.Types.Extensions.InternalArgs =
|
|||||||
export type SupplierInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
export type SupplierInclude<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = {
|
||||||
productCharges?: boolean | Prisma.Supplier$productChargesArgs<ExtArgs>
|
productCharges?: boolean | Prisma.Supplier$productChargesArgs<ExtArgs>
|
||||||
purchaseReceipts?: boolean | Prisma.Supplier$purchaseReceiptsArgs<ExtArgs>
|
purchaseReceipts?: boolean | Prisma.Supplier$purchaseReceiptsArgs<ExtArgs>
|
||||||
|
stockMovements?: boolean | Prisma.Supplier$stockMovementsArgs<ExtArgs>
|
||||||
_count?: boolean | Prisma.SupplierCountOutputTypeDefaultArgs<ExtArgs>
|
_count?: boolean | Prisma.SupplierCountOutputTypeDefaultArgs<ExtArgs>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -829,6 +962,7 @@ export type $SupplierPayload<ExtArgs extends runtime.Types.Extensions.InternalAr
|
|||||||
objects: {
|
objects: {
|
||||||
productCharges: Prisma.$ProductChargePayload<ExtArgs>[]
|
productCharges: Prisma.$ProductChargePayload<ExtArgs>[]
|
||||||
purchaseReceipts: Prisma.$PurchaseReceiptPayload<ExtArgs>[]
|
purchaseReceipts: Prisma.$PurchaseReceiptPayload<ExtArgs>[]
|
||||||
|
stockMovements: Prisma.$StockMovementPayload<ExtArgs>[]
|
||||||
}
|
}
|
||||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||||
id: number
|
id: number
|
||||||
@@ -1186,6 +1320,7 @@ export interface Prisma__SupplierClient<T, Null = never, ExtArgs extends runtime
|
|||||||
readonly [Symbol.toStringTag]: "PrismaPromise"
|
readonly [Symbol.toStringTag]: "PrismaPromise"
|
||||||
productCharges<T extends Prisma.Supplier$productChargesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Supplier$productChargesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ProductChargePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
productCharges<T extends Prisma.Supplier$productChargesArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Supplier$productChargesArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$ProductChargePayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||||
purchaseReceipts<T extends Prisma.Supplier$purchaseReceiptsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Supplier$purchaseReceiptsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PurchaseReceiptPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
purchaseReceipts<T extends Prisma.Supplier$purchaseReceiptsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Supplier$purchaseReceiptsArgs<ExtArgs>>): Prisma.PrismaPromise<runtime.Types.Result.GetResult<Prisma.$PurchaseReceiptPayload<ExtArgs>, T, "findMany", GlobalOmitOptions> | Null>
|
||||||
|
stockMovements<T extends Prisma.Supplier$stockMovementsArgs<ExtArgs> = {}>(args?: Prisma.Subset<T, Prisma.Supplier$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.
|
||||||
@@ -1618,6 +1753,30 @@ export type Supplier$purchaseReceiptsArgs<ExtArgs extends runtime.Types.Extensio
|
|||||||
distinct?: Prisma.PurchaseReceiptScalarFieldEnum | Prisma.PurchaseReceiptScalarFieldEnum[]
|
distinct?: Prisma.PurchaseReceiptScalarFieldEnum | Prisma.PurchaseReceiptScalarFieldEnum[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Supplier.stockMovements
|
||||||
|
*/
|
||||||
|
export type Supplier$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[]
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Supplier without action
|
* Supplier without action
|
||||||
*/
|
*/
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,12 @@
|
|||||||
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'
|
||||||
import { IsOptional, IsString } from 'class-validator'
|
import { IsOptional, IsString } from 'class-validator'
|
||||||
|
|
||||||
export class CreateInventoryDto {
|
export class CreateInventoryDto {
|
||||||
|
@ApiProperty()
|
||||||
@IsString()
|
@IsString()
|
||||||
name: string
|
name: string
|
||||||
|
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
location?: string
|
location?: string
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
|
import { ApiPropertyOptional } from '@nestjs/swagger'
|
||||||
import { Type } from 'class-transformer'
|
import { Type } from 'class-transformer'
|
||||||
import { IsBoolean, IsOptional, IsString } from 'class-validator'
|
import { IsBoolean, IsOptional, IsString } from 'class-validator'
|
||||||
|
|
||||||
export class UpdateInventoryDto {
|
export class UpdateInventoryDto {
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
name?: string
|
name?: string
|
||||||
|
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
location?: string
|
location?: string
|
||||||
|
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@Type(() => Boolean)
|
@Type(() => Boolean)
|
||||||
@IsBoolean()
|
@IsBoolean()
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common'
|
import { Body, Controller, Delete, Get, Param, Patch, Post, Query } from '@nestjs/common'
|
||||||
|
import { ApiQuery } from '@nestjs/swagger'
|
||||||
|
import { MovementType } from '../generated/prisma/enums'
|
||||||
import { CreateInventoryDto } from './dto/create-inventory.dto'
|
import { CreateInventoryDto } from './dto/create-inventory.dto'
|
||||||
import { UpdateInventoryDto } from './dto/update-inventory.dto'
|
import { UpdateInventoryDto } from './dto/update-inventory.dto'
|
||||||
import { InventoriesService } from './inventories.service'
|
import { InventoriesService } from './inventories.service'
|
||||||
@@ -13,8 +15,9 @@ export class InventoriesController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get()
|
@Get()
|
||||||
findAll() {
|
@ApiQuery({ name: 'isPointOfSale', required: false, type: Boolean })
|
||||||
return this.inventoriesService.findAll()
|
findAll(@Query('isPointOfSale') isPointOfSale?: boolean) {
|
||||||
|
return this.inventoriesService.findAll(isPointOfSale)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get(':id')
|
@Get(':id')
|
||||||
@@ -32,8 +35,20 @@ export class InventoriesController {
|
|||||||
return this.inventoriesService.remove(Number(id))
|
return this.inventoriesService.remove(Number(id))
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get(':id/stock-movements')
|
@Get(':id/movements')
|
||||||
findStockMovements(@Param('id') id: string) {
|
@ApiQuery({ name: 'type', required: false, enum: MovementType })
|
||||||
return this.inventoriesService.findStockMovements(Number(id))
|
findInventoryMovements(@Param('id') id: string, @Query('type') type?: MovementType) {
|
||||||
|
return this.inventoriesService.findInventoryMovements(Number(id), type ?? undefined)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get(':id/stock')
|
||||||
|
@ApiQuery({ name: 'isAvailable', required: false, type: Boolean })
|
||||||
|
getStock(@Param('id') id: string, @Query('isAvailable') isAvailable?: boolean) {
|
||||||
|
return this.inventoriesService.getStock(Number(id), isAvailable ?? undefined)
|
||||||
|
}
|
||||||
|
|
||||||
|
@Get(':id/products/:productId/cardex')
|
||||||
|
getProductCardex(@Param('id') id: string, @Param('productId') productId: string) {
|
||||||
|
return this.inventoriesService.getProductCardex(Number(id), Number(productId))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Injectable } from '@nestjs/common'
|
import { Injectable } from '@nestjs/common'
|
||||||
import { ResponseMapper } from '../common/response/response-mapper'
|
import { ResponseMapper } from '../common/response/response-mapper'
|
||||||
|
import { MovementType } from '../generated/prisma/enums'
|
||||||
import { PrismaService } from '../prisma/prisma.service'
|
import { PrismaService } from '../prisma/prisma.service'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@@ -10,8 +11,10 @@ export class InventoriesService {
|
|||||||
return ResponseMapper.create(item)
|
return ResponseMapper.create(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
async findAll() {
|
async findAll(isPointOfSale?: boolean) {
|
||||||
const items = await this.prisma.inventory.findMany()
|
const items = await this.prisma.inventory.findMany({
|
||||||
|
where: isPointOfSale !== undefined ? { isPointOfSale } : undefined,
|
||||||
|
})
|
||||||
|
|
||||||
return ResponseMapper.list(items)
|
return ResponseMapper.list(items)
|
||||||
}
|
}
|
||||||
@@ -19,10 +22,28 @@ export class InventoriesService {
|
|||||||
async findOne(id: number) {
|
async findOne(id: number) {
|
||||||
const item = await this.prisma.inventory.findUnique({
|
const item = await this.prisma.inventory.findUnique({
|
||||||
where: { id },
|
where: { id },
|
||||||
include: { purchaseReceipts: true },
|
include: {
|
||||||
|
stockBalances: {
|
||||||
|
where: { quantity: { gt: 0 } },
|
||||||
|
select: { quantity: true, totalCost: true },
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
if (!item) return null
|
if (!item) return null
|
||||||
return ResponseMapper.single(item)
|
|
||||||
|
const { stockBalances, ...rest } = item
|
||||||
|
return ResponseMapper.single({
|
||||||
|
...rest,
|
||||||
|
availableProductTypes: stockBalances.length,
|
||||||
|
availableProductCount: stockBalances.reduce(
|
||||||
|
(acc, sb) => acc + Number(sb.quantity),
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
availableProductsCost: stockBalances.reduce(
|
||||||
|
(acc, sb) => acc + Number(sb.totalCost),
|
||||||
|
0,
|
||||||
|
),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async update(id: number, data: any) {
|
async update(id: number, data: any) {
|
||||||
@@ -35,20 +56,133 @@ export class InventoriesService {
|
|||||||
return ResponseMapper.single(item)
|
return ResponseMapper.single(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
async findStockMovements(inventoryId: number) {
|
async findInventoryMovements(
|
||||||
// Return a flat list of stock movements, each including its product info
|
inventoryId: number,
|
||||||
|
type?: MovementType,
|
||||||
|
page = 1,
|
||||||
|
pageSize = 10,
|
||||||
|
) {
|
||||||
|
const groups = await this.prisma.stockMovement.groupBy({
|
||||||
|
by: ['referenceId'],
|
||||||
|
where: { inventoryId, type },
|
||||||
|
_count: { id: true },
|
||||||
|
orderBy: { referenceId: 'desc' },
|
||||||
|
skip: (page - 1) * pageSize,
|
||||||
|
take: pageSize,
|
||||||
|
})
|
||||||
|
|
||||||
|
const result = await Promise.all(
|
||||||
|
groups.map(async group => {
|
||||||
const movements = await this.prisma.stockMovement.findMany({
|
const movements = await this.prisma.stockMovement.findMany({
|
||||||
where: { inventoryId },
|
where: { inventoryId, referenceId: group.referenceId },
|
||||||
include: { product: true },
|
include: { product: true },
|
||||||
})
|
})
|
||||||
// Map each movement to have a 'products' array (even if only one product)
|
let info = null as any
|
||||||
const mapped = movements.map(movement => {
|
const mapped = movements.map(movement => {
|
||||||
const { product, ...rest } = movement
|
const { id, quantity, fee, totalCost, avgCost, product } = movement
|
||||||
|
if (info === null) {
|
||||||
|
info = {
|
||||||
|
date: movement.createdAt,
|
||||||
|
type: movement.type,
|
||||||
|
quantity: Number(movement.quantity),
|
||||||
|
fee: Number(movement.fee),
|
||||||
|
totalCost: Number(movement.totalCost),
|
||||||
|
referenceType: movement.referenceType,
|
||||||
|
referenceId: movement.referenceId,
|
||||||
|
createdAt: movement.createdAt,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
info.quantity += Number(movement.quantity)
|
||||||
|
info.fee += Number(movement.fee)
|
||||||
|
info.totalCost += Number(movement.totalCost)
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
...rest,
|
id,
|
||||||
products: product ? [product] : [],
|
quantity: Number(quantity),
|
||||||
|
fee: Number(fee),
|
||||||
|
totalCost: Number(totalCost),
|
||||||
|
avgCost: Number(avgCost),
|
||||||
|
product,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
return {
|
||||||
|
receiptId: group.referenceId,
|
||||||
|
count: group._count.id,
|
||||||
|
info,
|
||||||
|
movements: mapped,
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
return ResponseMapper.list(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
async getStock(inventoryId: number, isAvailable?: boolean, page = 1, pageSize = 10) {
|
||||||
|
console.log(isAvailable)
|
||||||
|
|
||||||
|
const items = await this.prisma.stockBalance.findMany({
|
||||||
|
where: {
|
||||||
|
inventoryId,
|
||||||
|
quantity:
|
||||||
|
isAvailable === true
|
||||||
|
? { gt: 0 }
|
||||||
|
: isAvailable === false
|
||||||
|
? { lte: 0 }
|
||||||
|
: undefined,
|
||||||
|
},
|
||||||
|
include: {
|
||||||
|
product: true,
|
||||||
|
},
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: 'desc',
|
||||||
|
},
|
||||||
|
skip: (page - 1) * pageSize,
|
||||||
|
take: pageSize,
|
||||||
|
})
|
||||||
|
|
||||||
|
const mapped = items.map(item => ({
|
||||||
|
id: item.id,
|
||||||
|
quantity: Number(item.quantity),
|
||||||
|
avgCost: Number(item.avgCost),
|
||||||
|
product: item.product,
|
||||||
|
}))
|
||||||
|
|
||||||
|
return ResponseMapper.list(mapped)
|
||||||
|
}
|
||||||
|
|
||||||
|
async getProductCardex(inventoryId: number, productId: number) {
|
||||||
|
console.log(productId, inventoryId)
|
||||||
|
|
||||||
|
const movements = await this.prisma.stockMovement.findMany({
|
||||||
|
where: { productId, inventoryId },
|
||||||
|
orderBy: { createdAt: 'asc' },
|
||||||
|
include: { inventory: true, supplier: true },
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(movements[0]?.inventoryId)
|
||||||
|
|
||||||
|
const mapped = movements.map(movement => ({
|
||||||
|
id: movement.id,
|
||||||
|
type: movement.type,
|
||||||
|
quantity: Number(movement.quantity),
|
||||||
|
fee: Number(movement.fee),
|
||||||
|
totalCost: Number(movement.totalCost),
|
||||||
|
avgCost: Number(movement.avgCost),
|
||||||
|
referenceType: movement.referenceType,
|
||||||
|
referenceId: movement.referenceId,
|
||||||
|
createdAt: movement.createdAt,
|
||||||
|
remainedInStock: movement.remainedInStock,
|
||||||
|
inventory: {
|
||||||
|
id: movement.inventory.id,
|
||||||
|
name: movement.inventory.name,
|
||||||
|
},
|
||||||
|
supplier: movement.supplier
|
||||||
|
? {
|
||||||
|
id: movement.supplier.id,
|
||||||
|
name: movement.supplier.firstName + ' ' + movement.supplier.lastName,
|
||||||
|
}
|
||||||
|
: null,
|
||||||
|
}))
|
||||||
|
|
||||||
return ResponseMapper.list(mapped)
|
return ResponseMapper.list(mapped)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
|
import { ApiProperty } from '@nestjs/swagger'
|
||||||
import { Type } from 'class-transformer'
|
import { Type } from 'class-transformer'
|
||||||
import { IsInt, IsNumber } from 'class-validator'
|
import { IsInt, IsNumber } from 'class-validator'
|
||||||
|
|
||||||
export class CreateInventoryTransferItemDto {
|
export class CreateInventoryTransferItemDto {
|
||||||
|
@ApiProperty()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@IsNumber()
|
@IsNumber()
|
||||||
count: number
|
count: number
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@IsInt()
|
@IsInt()
|
||||||
productId: number
|
productId: number
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@IsInt()
|
@IsInt()
|
||||||
transferId: number
|
transferId: number
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
|
import { ApiPropertyOptional } from '@nestjs/swagger'
|
||||||
import { Type } from 'class-transformer'
|
import { Type } from 'class-transformer'
|
||||||
import { IsInt, IsNumber, IsOptional } from 'class-validator'
|
import { IsInt, IsNumber, IsOptional } from 'class-validator'
|
||||||
|
|
||||||
export class UpdateInventoryTransferItemDto {
|
export class UpdateInventoryTransferItemDto {
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@IsNumber()
|
@IsNumber()
|
||||||
count?: number
|
count?: number
|
||||||
|
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@IsInt()
|
@IsInt()
|
||||||
productId?: number
|
productId?: number
|
||||||
|
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@IsInt()
|
@IsInt()
|
||||||
|
|||||||
@@ -1,19 +1,30 @@
|
|||||||
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'
|
||||||
import { Type } from 'class-transformer'
|
import { Type } from 'class-transformer'
|
||||||
import { IsInt, IsOptional, IsString } from 'class-validator'
|
import { ArrayMinSize, IsInt, IsOptional, IsString } from 'class-validator'
|
||||||
|
import { CreateInventoryTransferItemDto } from '../../inventory-transfer-items/dto/create-inventory-transfer-item.dto'
|
||||||
|
|
||||||
export class CreateInventoryTransferDto {
|
export class CreateInventoryTransferDto {
|
||||||
|
@ApiProperty()
|
||||||
@IsString()
|
@IsString()
|
||||||
code: string
|
code: string
|
||||||
|
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
description?: string
|
description?: string
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@IsInt()
|
@IsInt()
|
||||||
fromInventoryId: number
|
fromInventoryId: number
|
||||||
|
|
||||||
|
@ApiProperty()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@IsInt()
|
@IsInt()
|
||||||
toInventoryId: number
|
toInventoryId: number
|
||||||
|
|
||||||
|
@ApiProperty({ type: [CreateInventoryTransferItemDto] })
|
||||||
|
@Type(() => Array)
|
||||||
|
@ArrayMinSize(1)
|
||||||
|
items: Array<Omit<CreateInventoryTransferItemDto, 'transferId'>>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,25 @@
|
|||||||
|
import { ApiPropertyOptional } from '@nestjs/swagger'
|
||||||
import { Type } from 'class-transformer'
|
import { Type } from 'class-transformer'
|
||||||
import { IsInt, IsOptional, IsString } from 'class-validator'
|
import { IsInt, IsOptional, IsString } from 'class-validator'
|
||||||
|
|
||||||
export class UpdateInventoryTransferDto {
|
export class UpdateInventoryTransferDto {
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
code?: string
|
code?: string
|
||||||
|
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsString()
|
@IsString()
|
||||||
description?: string
|
description?: string
|
||||||
|
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@IsInt()
|
@IsInt()
|
||||||
fromInventoryId?: number | null
|
fromInventoryId?: number | null
|
||||||
|
|
||||||
|
@ApiPropertyOptional()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@Type(() => Number)
|
@Type(() => Number)
|
||||||
@IsInt()
|
@IsInt()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { CreateInventoryTransferDto } from './dto/create-inventory-transfer.dto'
|
|||||||
import { UpdateInventoryTransferDto } from './dto/update-inventory-transfer.dto'
|
import { UpdateInventoryTransferDto } from './dto/update-inventory-transfer.dto'
|
||||||
import { InventoryTransfersService } from './inventory-transfers.service'
|
import { InventoryTransfersService } from './inventory-transfers.service'
|
||||||
|
|
||||||
@Controller('inventory-transfers')
|
@Controller('inventories/transfers')
|
||||||
export class InventoryTransfersController {
|
export class InventoryTransfersController {
|
||||||
constructor(private readonly service: InventoryTransfersService) {}
|
constructor(private readonly service: InventoryTransfersService) {}
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,15 @@ export class InventoryTransfersService {
|
|||||||
delete payload.toInventoryId
|
delete payload.toInventoryId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Object.prototype.hasOwnProperty.call(payload, 'items')) {
|
||||||
|
payload.items = {
|
||||||
|
create: payload.items.map((item: any) => ({
|
||||||
|
product: { connect: { id: Number(item.productId) } },
|
||||||
|
count: item.count,
|
||||||
|
})),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const item = await this.prisma.inventoryTransfer.create({ data: payload })
|
const item = await this.prisma.inventoryTransfer.create({ data: payload })
|
||||||
return ResponseMapper.create(item)
|
return ResponseMapper.create(item)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,8 +30,9 @@ export class ProductsService {
|
|||||||
|
|
||||||
async findAll() {
|
async findAll() {
|
||||||
const items = await this.prisma.product.findMany({
|
const items = await this.prisma.product.findMany({
|
||||||
include: { brand: true, category: true },
|
include: { brand: true, category: true, stockBalances: true },
|
||||||
})
|
})
|
||||||
|
|
||||||
const mapped = items.map(p => {
|
const mapped = items.map(p => {
|
||||||
const { brandId, categoryId, ...rest } = p as any
|
const { brandId, categoryId, ...rest } = p as any
|
||||||
const brand: ShortEntity | null = p.brand
|
const brand: ShortEntity | null = p.brand
|
||||||
@@ -40,7 +41,12 @@ export class ProductsService {
|
|||||||
const category: ShortEntity | null = p.category
|
const category: ShortEntity | null = p.category
|
||||||
? { id: p.category.id, name: p.category.name }
|
? { id: p.category.id, name: p.category.name }
|
||||||
: null
|
: null
|
||||||
return { ...rest, brand, category }
|
const stock =
|
||||||
|
p.stockBalances && p.stockBalances.length > 0
|
||||||
|
? p.stockBalances.reduce((acc, sb) => acc + Number(sb.quantity), 0)
|
||||||
|
: 0
|
||||||
|
|
||||||
|
return { ...rest, brand, category, stock }
|
||||||
})
|
})
|
||||||
return ResponseMapper.list(mapped)
|
return ResponseMapper.list(mapped)
|
||||||
}
|
}
|
||||||
@@ -48,7 +54,7 @@ export class ProductsService {
|
|||||||
async findOne(id: number) {
|
async findOne(id: number) {
|
||||||
const p = await this.prisma.product.findUnique({
|
const p = await this.prisma.product.findUnique({
|
||||||
where: { id },
|
where: { id },
|
||||||
include: { brand: true, category: true, productCharges: true },
|
include: { brand: true, category: true, stockBalances: true },
|
||||||
})
|
})
|
||||||
if (!p) return null
|
if (!p) return null
|
||||||
|
|
||||||
@@ -63,7 +69,15 @@ export class ProductsService {
|
|||||||
...rest,
|
...rest,
|
||||||
brand,
|
brand,
|
||||||
category,
|
category,
|
||||||
count: p.productCharges.reduce((acc, charge) => acc + Number(charge.count), 0.0),
|
stock:
|
||||||
|
p.stockBalances && p.stockBalances.length > 0
|
||||||
|
? p.stockBalances.reduce((acc, sb) => acc + Number(sb.quantity), 0)
|
||||||
|
: 0,
|
||||||
|
avgCost:
|
||||||
|
p.stockBalances && p.stockBalances.length > 0
|
||||||
|
? p.stockBalances.reduce((acc, sb) => acc + Number(sb.avgCost), 0) /
|
||||||
|
p.stockBalances.length
|
||||||
|
: 0,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export class PurchaseReceiptsService {
|
|||||||
description: item.description ?? null,
|
description: item.description ?? null,
|
||||||
product: { connect: { id: item.productId } },
|
product: { connect: { id: item.productId } },
|
||||||
}
|
}
|
||||||
console.log(`[create] Step 3: Mapped item ${idx}:`, mapped)
|
|
||||||
return mapped
|
return mapped
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Controller, Get, Param } from '@nestjs/common'
|
import { Controller, Get } from '@nestjs/common'
|
||||||
import { StockBalanceService } from './stock-balance.service'
|
import { StockBalanceService } from './stock-balance.service'
|
||||||
|
|
||||||
@Controller('stock-balance')
|
@Controller('stock-balance')
|
||||||
@@ -10,8 +10,8 @@ export class StockBalanceController {
|
|||||||
return this.service.findAll()
|
return this.service.findAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Get(':itemId')
|
// @Get(':itemId')
|
||||||
findOne(@Param('itemId') itemId: string) {
|
// findOne(@Param('itemId') itemId: string) {
|
||||||
return this.service.findOne(Number(itemId))
|
// return this.service.findOne(Number(itemId))
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ export class StockBalanceService {
|
|||||||
return ResponseMapper.list(items)
|
return ResponseMapper.list(items)
|
||||||
}
|
}
|
||||||
|
|
||||||
async findOne(ProductId: number) {
|
// async findOne(productId: number) {
|
||||||
const item = await this.prisma.stockBalance.findUnique({ where: { ProductId } })
|
// const item = await this.prisma.stockBalance.findUnique({ where: { productId: productId } })
|
||||||
if (!item) return null
|
// if (!item) return null
|
||||||
return ResponseMapper.single(item)
|
// return ResponseMapper.single(item)
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user