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,6 +1,7 @@
import {
inventoryItemStatuses,
inventoryItemTypes,
inventoryTransactionTypes,
inventoryUnitsOfMeasure,
type InventoryBomLineInput,
type InventoryItemInput,
@@ -8,6 +9,8 @@ import {
type WarehouseLocationInput,
type InventoryItemStatus,
type InventoryItemType,
type InventoryTransactionInput,
type InventoryTransactionType,
type InventoryUnitOfMeasure,
} from "@mrp/shared/dist/inventory/types.js";
@@ -33,6 +36,15 @@ export const emptyInventoryItemInput: InventoryItemInput = {
bomLines: [],
};
export const emptyInventoryTransactionInput: InventoryTransactionInput = {
transactionType: "RECEIPT",
quantity: 1,
warehouseId: "",
locationId: "",
reference: "",
notes: "",
};
export const emptyWarehouseLocationInput: WarehouseLocationInput = {
code: "",
name: "",
@@ -87,4 +99,18 @@ export const inventoryTypePalette: Record<InventoryItemType, string> = {
SERVICE: "border border-violet-400/30 bg-violet-500/12 text-violet-700 dark:text-violet-300",
};
export { inventoryItemStatuses, inventoryItemTypes, inventoryUnitsOfMeasure };
export const inventoryTransactionOptions: Array<{ value: InventoryTransactionType; label: string }> = [
{ value: "RECEIPT", label: "Receipt" },
{ value: "ISSUE", label: "Issue" },
{ value: "ADJUSTMENT_IN", label: "Adjustment In" },
{ value: "ADJUSTMENT_OUT", label: "Adjustment Out" },
];
export const inventoryTransactionPalette: Record<InventoryTransactionType, string> = {
RECEIPT: "border border-emerald-400/30 bg-emerald-500/12 text-emerald-700 dark:text-emerald-300",
ISSUE: "border border-rose-400/30 bg-rose-500/12 text-rose-700 dark:text-rose-300",
ADJUSTMENT_IN: "border border-sky-400/30 bg-sky-500/12 text-sky-700 dark:text-sky-300",
ADJUSTMENT_OUT: "border border-amber-400/30 bg-amber-500/12 text-amber-700 dark:text-amber-300",
};
export { inventoryItemStatuses, inventoryItemTypes, inventoryTransactionTypes, inventoryUnitsOfMeasure };