inventory control

This commit is contained in:
2026-03-15 14:00:12 -05:00
parent 16582d3cea
commit 1fcb0c5480
14 changed files with 986 additions and 205 deletions

View File

@@ -2,11 +2,13 @@ export const inventoryItemTypes = ["PURCHASED", "MANUFACTURED", "ASSEMBLY", "SER
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 const inventoryReservationStatuses = ["ACTIVE", "RELEASED", "CONSUMED"] 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 type InventoryReservationStatus = (typeof inventoryReservationStatuses)[number];
export interface InventoryBomLineDto {
id: string;
@@ -121,6 +123,8 @@ export interface InventoryStockBalanceDto {
locationCode: string;
locationName: string;
quantityOnHand: number;
quantityReserved: number;
quantityAvailable: number;
}
export interface InventoryTransactionDto {
@@ -149,6 +153,59 @@ export interface InventoryTransactionInput {
notes: string;
}
export interface InventoryTransferDto {
id: string;
quantity: number;
notes: string;
createdAt: string;
createdByName: string;
fromWarehouseId: string;
fromWarehouseCode: string;
fromWarehouseName: string;
fromLocationId: string;
fromLocationCode: string;
fromLocationName: string;
toWarehouseId: string;
toWarehouseCode: string;
toWarehouseName: string;
toLocationId: string;
toLocationCode: string;
toLocationName: string;
}
export interface InventoryTransferInput {
quantity: number;
fromWarehouseId: string;
fromLocationId: string;
toWarehouseId: string;
toLocationId: string;
notes: string;
}
export interface InventoryReservationDto {
id: string;
quantity: number;
status: InventoryReservationStatus;
sourceType: string;
sourceId: string | null;
sourceLabel: string | null;
notes: string;
createdAt: string;
warehouseId: string | null;
warehouseCode: string | null;
warehouseName: string | null;
locationId: string | null;
locationCode: string | null;
locationName: string | null;
}
export interface InventoryReservationInput {
quantity: number;
warehouseId: string | null;
locationId: string | null;
notes: string;
}
export interface InventoryItemDetailDto extends InventoryItemSummaryDto {
description: string;
defaultCost: number | null;
@@ -158,8 +215,12 @@ export interface InventoryItemDetailDto extends InventoryItemSummaryDto {
bomLines: InventoryBomLineDto[];
operations: InventoryItemOperationDto[];
onHandQuantity: number;
reservedQuantity: number;
availableQuantity: number;
stockBalances: InventoryStockBalanceDto[];
recentTransactions: InventoryTransactionDto[];
transfers: InventoryTransferDto[];
reservations: InventoryReservationDto[];
}
export interface InventoryItemInput {