Files
vexplor/frontend/lib/api/itemInspection.ts
kjs 9f9be20e34 Enhance Item Inspection and Outbound Functionality
- Added `apply_process_name` to the item inspection controller, allowing for better clarity in process identification by joining with the `process_mng` table.
- Updated the outbound controller to include additional delivery details, such as `delivery_destination_name` and `customer_name`, with fallback logic for improved data accuracy.
- Enhanced the query logic to ensure proper handling of delivery addresses and customer information, improving the overall data retrieval process.

(TASK: ERP-XXX)
2026-05-22 09:59:20 +09:00

65 lines
1.8 KiB
TypeScript

/**
* 품목검사정보 API 클라이언트
* - 좌측 품목 패널 그룹 페이징 조회
*/
import { apiClient } from "./client";
export interface InspectionRowApi {
id: string;
item_code: string;
item_name: string;
inspection_type: string | null;
inspection_standard: string | null;
inspection_standard_id: string | null;
inspection_item_name: string | null;
inspection_method: string | null;
apply_process: string | null;
apply_process_name?: string | null;
classification: string | null;
pass_criteria: string | null;
upper_limit?: string | number | null;
lower_limit?: string | number | null;
is_required: string | null;
is_active: string | null;
manager_id: string | null;
memo: string | null;
sort_order: string | null;
change_record?: string | null;
created_date?: string | null;
updated_date?: string | null;
// 프론트가 추가로 참조하는 필드(있을 수도, 없을 수도)
[key: string]: any;
}
export interface InspectionGroupApi {
item_code: string;
item_name: string;
is_active: string;
rows: InspectionRowApi[];
}
export interface InspectionGroupedResponse {
success: boolean;
groups: InspectionGroupApi[];
total: number;
page: number;
size: number;
totalPages: number;
message?: string;
}
export async function getInspectionGrouped(params: {
page?: number;
size?: number;
search?: string;
}): Promise<InspectionGroupedResponse> {
const qp = new URLSearchParams();
if (params.page) qp.set("page", String(params.page));
if (params.size) qp.set("size", String(params.size));
if (params.search && params.search.trim()) qp.set("search", params.search.trim());
const qs = qp.toString();
const res = await apiClient.get(`/item-inspection/grouped${qs ? `?${qs}` : ""}`);
return res.data;
}