- New POP inventory move page and API (popInventoryMoveController, popInventoryMove client) deployed across COMPANY_7/8/9/10/16/29/30 - Updates to shared POP components (PopShell, AcceptProcessModal, ProcessWork) and inout-manage/inventory pages - COMPANY_7 POP.md updated with new scope notes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
74 lines
2.0 KiB
TypeScript
74 lines
2.0 KiB
TypeScript
/**
|
|
* popInventoryMove API client
|
|
* 신 POP 재고이동 (frontend/app/(main)/COMPANY_X/pop/inventory/move/)
|
|
*/
|
|
|
|
import { apiClient } from "./client";
|
|
|
|
export interface MoveStockItem {
|
|
id: string; // inventory_stock.id
|
|
item_code: string;
|
|
item_name: string;
|
|
item_number: string;
|
|
spec: string;
|
|
unit: string;
|
|
warehouse_code: string;
|
|
warehouse_name: string;
|
|
location_code: string;
|
|
current_qty: string; // text 컬럼 (numeric 변환은 클라이언트가)
|
|
}
|
|
|
|
export interface MoveStockListParams {
|
|
warehouse_code?: string; // 'all' or 창고코드
|
|
keyword?: string;
|
|
}
|
|
|
|
export interface MoveCommitItem {
|
|
stock_id: string;
|
|
qty: number;
|
|
}
|
|
|
|
export interface MoveCommitParams {
|
|
items: MoveCommitItem[];
|
|
to_warehouse_code: string;
|
|
to_location_code?: string;
|
|
}
|
|
|
|
export interface MoveCommitResult {
|
|
stock_id: string;
|
|
status: "ok" | "not_found" | "invalid_qty" | "exceeds_stock" | "same_position" | "no_rack";
|
|
reason?: string;
|
|
}
|
|
|
|
export interface MoveCommitData {
|
|
moveCount: number;
|
|
results: MoveCommitResult[];
|
|
}
|
|
|
|
export interface TempLoadRow {
|
|
id: string;
|
|
row_data: string; // JSON 직렬화된 큐 row (서버는 그대로 저장한 string)
|
|
row_key: string;
|
|
created_date: string;
|
|
}
|
|
|
|
export async function getMoveStockList(params?: MoveStockListParams) {
|
|
const res = await apiClient.get("/pop/inventory/move/stock-list", { params: params || {} });
|
|
return res.data as { success: boolean; data: MoveStockItem[] };
|
|
}
|
|
|
|
export async function commitMove(body: MoveCommitParams) {
|
|
const res = await apiClient.post("/pop/inventory/move/commit", body);
|
|
return res.data as { success: boolean; message?: string; data?: MoveCommitData };
|
|
}
|
|
|
|
export async function loadTempMove() {
|
|
const res = await apiClient.get("/pop/inventory/move/temp-load");
|
|
return res.data as { success: boolean; data: TempLoadRow[] };
|
|
}
|
|
|
|
export async function saveTempMove(items: unknown[]) {
|
|
const res = await apiClient.post("/pop/inventory/move/temp-save", { items });
|
|
return res.data as { success: boolean; message?: string };
|
|
}
|