inventory1

This commit is contained in:
2026-03-14 21:10:35 -05:00
parent df3f1412f6
commit d21e2e3c0b
21 changed files with 1492 additions and 7 deletions

View File

@@ -4,6 +4,8 @@ export const permissions = {
companyWrite: "company.write",
crmRead: "crm.read",
crmWrite: "crm.write",
inventoryRead: "inventory.read",
inventoryWrite: "inventory.write",
filesRead: "files.read",
filesWrite: "files.write",
ganttRead: "gantt.read",
@@ -14,4 +16,3 @@ export const permissions = {
export type PermissionKey = (typeof permissions)[keyof typeof permissions];
export const defaultAdminPermissions: PermissionKey[] = Object.values(permissions);

View File

@@ -5,3 +5,4 @@ export * from "./company/types.js";
export * from "./crm/types.js";
export * from "./files/types.js";
export * from "./gantt/types.js";
export * from "./inventory/types.js";

View File

@@ -0,0 +1,67 @@
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 type InventoryItemType = (typeof inventoryItemTypes)[number];
export type InventoryItemStatus = (typeof inventoryItemStatuses)[number];
export type InventoryUnitOfMeasure = (typeof inventoryUnitsOfMeasure)[number];
export interface InventoryBomLineDto {
id: string;
componentItemId: string;
componentSku: string;
componentName: string;
quantity: number;
unitOfMeasure: InventoryUnitOfMeasure;
notes: string;
position: number;
}
export interface InventoryBomLineInput {
componentItemId: string;
quantity: number;
unitOfMeasure: InventoryUnitOfMeasure;
notes: string;
position: number;
}
export interface InventoryItemOptionDto {
id: string;
sku: string;
name: string;
}
export interface InventoryItemSummaryDto {
id: string;
sku: string;
name: string;
type: InventoryItemType;
status: InventoryItemStatus;
unitOfMeasure: InventoryUnitOfMeasure;
isSellable: boolean;
isPurchasable: boolean;
bomLineCount: number;
updatedAt: string;
}
export interface InventoryItemDetailDto extends InventoryItemSummaryDto {
description: string;
defaultCost: number | null;
notes: string;
createdAt: string;
bomLines: InventoryBomLineDto[];
}
export interface InventoryItemInput {
sku: string;
name: string;
description: string;
type: InventoryItemType;
status: InventoryItemStatus;
unitOfMeasure: InventoryUnitOfMeasure;
isSellable: boolean;
isPurchasable: boolean;
defaultCost: number | null;
notes: string;
bomLines: InventoryBomLineInput[];
}