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

@@ -26,9 +26,11 @@ import type {
InventoryItemOptionDto,
InventoryItemStatus,
InventoryItemSummaryDto,
InventoryTransactionInput,
InventoryItemType,
WarehouseDetailDto,
WarehouseInput,
WarehouseLocationOptionDto,
WarehouseSummaryDto,
} from "@mrp/shared/dist/inventory/types.js";
@@ -298,6 +300,9 @@ export const api = {
getInventoryItemOptions(token: string) {
return request<InventoryItemOptionDto[]>("/api/v1/inventory/items/options", undefined, token);
},
getWarehouseLocationOptions(token: string) {
return request<WarehouseLocationOptionDto[]>("/api/v1/inventory/locations/options", undefined, token);
},
createInventoryItem(token: string, payload: InventoryItemInput) {
return request<InventoryItemDetailDto>(
"/api/v1/inventory/items",
@@ -318,6 +323,16 @@ export const api = {
token
);
},
createInventoryTransaction(token: string, itemId: string, payload: InventoryTransactionInput) {
return request<InventoryItemDetailDto>(
`/api/v1/inventory/items/${itemId}/transactions`,
{
method: "POST",
body: JSON.stringify(payload),
},
token
);
},
getWarehouses(token: string) {
return request<WarehouseSummaryDto[]>("/api/v1/inventory/warehouses", undefined, token);
},