From ba91e9e63dc8bd5a0fabf4398628105359db52ec Mon Sep 17 00:00:00 2001 From: umsangdon Date: Mon, 28 Sep 2026 12:11:49 +0900 Subject: [PATCH] =?UTF-8?q?feat(M01):=20fetchComboInputs=20=C2=B7=20search?= =?UTF-8?q?Materials=20=EC=95=8C=EC=95=BD=20=EC=9E=90=EB=A3=8C=20=ED=95=A8?= =?UTF-8?q?=EC=88=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fetchComboInputs(조합 코드) → {키, 이름, 물량: [{키, 이름, 단위, 로직, 배?}], 조건} - searchMaterials(글) = /pick?kind=price 감쌈 → [{코드, 이름, 규격, 단위}] Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01TULoa94ZFL26KU6ZqVpjkF --- M01_MasterData/M01_MasterData_Api_Fetch.ts | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/M01_MasterData/M01_MasterData_Api_Fetch.ts b/M01_MasterData/M01_MasterData_Api_Fetch.ts index 156930c0..d7b4eb05 100644 --- a/M01_MasterData/M01_MasterData_Api_Fetch.ts +++ b/M01_MasterData/M01_MasterData_Api_Fetch.ts @@ -175,3 +175,28 @@ export const fetchPick = ( kind: PickKind, q: string, ): Promise<{ total: number; items: PickItem[] }> => get("/pick", { kind, q, limit: 50 }); + +/** 조합 알약 물량 하나 — 담은 로직 결과단위 분모(같은 이름 · 단위는 합침) · `배` = 원/10㎡ 의 10 */ +export interface ComboQuantity { + 키: string; + 이름: string; + 단위: string; + 로직: string[]; + 배?: number; +} + +export const fetchComboInputs = ( + combo: string, +): Promise<{ 키: string; 이름: string; 물량: ComboQuantity[]; 조건: unknown[] }> => + get(`/combo/${encodeURIComponent(combo)}/inputs`, {}); + +/** 자재 찾기 — `/pick?kind=price` 감쌈 · 이름·규격 낱말이 모두 든 줄 */ +export const searchMaterials = async ( + q: string, +): Promise<{ 코드: string; 이름: string; 규격: string; 단위: string }[]> => + (await fetchPick("price", q)).items.map((m) => ({ + 코드: m.ref, + 이름: m.이름, + 규격: m.규격, + 단위: m.단위, + }));