inventory

This commit is contained in:
2026-03-14 22:37:09 -05:00
parent 6589581908
commit 10b47da724
14 changed files with 651 additions and 43 deletions

View File

@@ -1,10 +1,12 @@
export const inventoryItemTypes = ["PURCHASED", "MANUFACTURED", "ASSEMBLY", "SERVICE"] as const;
export const inventoryItemStatuses = ["DRAFT", "ACTIVE", "OBSOLETE"] as const;
export const inventoryUnitsOfMeasure = ["EA", "FT", "IN", "LB", "KG", "SET"] as const;
export const inventoryTransactionTypes = ["RECEIPT", "ISSUE", "ADJUSTMENT_IN", "ADJUSTMENT_OUT"] as const;
export type InventoryItemType = (typeof inventoryItemTypes)[number];
export type InventoryItemStatus = (typeof inventoryItemStatuses)[number];
export type InventoryUnitOfMeasure = (typeof inventoryUnitsOfMeasure)[number];
export type InventoryTransactionType = (typeof inventoryTransactionTypes)[number];
export interface InventoryBomLineDto {
id: string;
@@ -31,6 +33,15 @@ export interface InventoryItemOptionDto {
name: string;
}
export interface WarehouseLocationOptionDto {
warehouseId: string;
warehouseCode: string;
warehouseName: string;
locationId: string;
locationCode: string;
locationName: string;
}
export interface WarehouseLocationDto {
id: string;
code: string;
@@ -78,12 +89,51 @@ export interface InventoryItemSummaryDto {
updatedAt: string;
}
export interface InventoryStockBalanceDto {
warehouseId: string;
warehouseCode: string;
warehouseName: string;
locationId: string;
locationCode: string;
locationName: string;
quantityOnHand: number;
}
export interface InventoryTransactionDto {
id: string;
transactionType: InventoryTransactionType;
quantity: number;
signedQuantity: number;
notes: string;
reference: string;
createdAt: string;
warehouseId: string;
warehouseCode: string;
warehouseName: string;
locationId: string;
locationCode: string;
locationName: string;
createdByName: string;
}
export interface InventoryTransactionInput {
transactionType: InventoryTransactionType;
quantity: number;
warehouseId: string;
locationId: string;
reference: string;
notes: string;
}
export interface InventoryItemDetailDto extends InventoryItemSummaryDto {
description: string;
defaultCost: number | null;
notes: string;
createdAt: string;
bomLines: InventoryBomLineDto[];
onHandQuantity: number;
stockBalances: InventoryStockBalanceDto[];
recentTransactions: InventoryTransactionDto[];
}
export interface InventoryItemInput {