Files
vexplor/frontend/lib/api/popInOutDetail.ts
kmh 854366453c Bundle pending POP work: production / inventory inout / inbound
진행 중이던 POP 관련 변경사항을 한 번에 묶어 커밋.

- backend
  - popProductionController: 생산공정 처리/접수 로직 대폭 갱신 (+663)
  - receivingController, popInventoryRoutes, adminService 보강
  - popInOutDetailController / popInOutHistoryController 신규
- frontend (POP)
  - 생산 화면 (DefectTypeModal / ProcessWork / WorkOrderList / main page)
    COMPANY_7/8/9/10/16/29/30 동기화
  - 입출고 이력·디테일 화면 신규 (inventory/page, inventory/inout-manage,
    InOutDetailModal) 7개사
  - COMPANY_7 입고 화면 (InboundCartPage / ProductionInbound /
    inbound/production/page) 보강
  - COMPANY_7 재고조정 화면 (inventory/adjust) UI 골격 신규
- frontend lib
  - popInOutDetail / popInOutHistory API 클라이언트 신규

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 18:54:54 +09:00

120 lines
3.2 KiB
TypeScript

import { apiClient } from "./client";
// ===== 타입 정의 =====
//
// 모달 표시에 필요한 핵심 필드만 명시. 나머지 컬럼은 응답에 포함되더라도
// 모달에서 사용하지 않으므로 타입에는 노출하지 않는다.
export interface InboundHeader {
id: string;
inbound_number: string | null;
inbound_type: string | null;
inbound_date: string | null;
inbound_status: string | null;
warehouse_code: string | null;
warehouse_name: string | null;
location_code: string | null;
memo: string | null;
writer: string | null;
writer_name: string | null;
created_date: string | null;
}
export interface InboundDetailRow {
id: string;
inbound_id: string | null;
item_number: string | null;
item_name: string | null;
unit: string | null;
inbound_qty: string | number | null;
lot_number: string | null;
reference_number: string | null;
supplier_code: string | null;
supplier_name: string | null;
memo: string | null;
}
export interface OutboundRow {
id: string;
outbound_number: string | null;
outbound_type: string | null;
outbound_date: string | null;
outbound_status: string | null;
warehouse_code: string | null;
warehouse_name: string | null;
location_code: string | null;
item_code: string | null;
item_name: string | null;
unit: string | null;
outbound_qty: string | number | null;
lot_number: string | null;
customer_code: string | null;
customer_name: string | null;
reference_number: string | null;
memo: string | null;
writer: string | null;
writer_name: string | null;
created_date: string | null;
}
export interface HistoryRow {
id: string;
transaction_type: string | null;
transaction_date: string | null;
warehouse_code: string | null;
warehouse_name: string | null;
location_code: string | null;
item_code: string | null;
joined_item_name: string | null;
joined_unit: string | null;
quantity: string | number | null;
balance_qty: string | number | null;
remark: string | null;
writer: string | null;
manager_name: string | null;
created_date: string | null;
}
// ===== 응답 타입 =====
export interface InboundDetailResponse {
success: boolean;
data: { header: InboundHeader; detail: InboundDetailRow | null };
}
export interface OutboundDetailResponse {
success: boolean;
data: { row: OutboundRow };
}
export interface HistoryDetailResponse {
success: boolean;
data: { row: HistoryRow };
}
// ===== API 호출 =====
export async function getInboundDetail(
id: string,
detailId?: string | null,
): Promise<InboundDetailResponse> {
const res = await apiClient.get(`/pop/inventory/inout-detail/inbound/${id}`, {
params: detailId ? { detail_id: detailId } : undefined,
});
return res.data as InboundDetailResponse;
}
export async function getOutboundDetail(
id: string,
): Promise<OutboundDetailResponse> {
const res = await apiClient.get(`/pop/inventory/inout-detail/outbound/${id}`);
return res.data as OutboundDetailResponse;
}
export async function getHistoryDetail(
id: string,
): Promise<HistoryDetailResponse> {
const res = await apiClient.get(`/pop/inventory/inout-detail/history/${id}`);
return res.data as HistoryDetailResponse;
}