inventory1
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
67
shared/src/inventory/types.ts
Normal file
67
shared/src/inventory/types.ts
Normal 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[];
|
||||
}
|
||||
Reference in New Issue
Block a user