feat(z01): 상자 이름을 서버 group_label 로 — 안 오면 group 키 그대로(화면에 한글 이름 안 박음)

- 지금 서버가 갈래 키(base_price·pumsem_basis)만 줘 상자 제목이 영문으로 뜨던 자리
- 공종 축(work_item) 상자는 코드 추가 없이 섬 — 가짜 응답으로 확인(산림 358 · 건설 가짜 2,199 · 찾기·끝 쪽)
- 시험: 갈래 이름이 오면 그 이름 · 안 오면 키가 드러남

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016VBGFXB9AbJBwXP19z75Qq
This commit is contained in:
2026-09-17 10:54:44 +09:00
co-authored by Claude Opus 5
parent 459033786b
commit 7cb15af1e7
3 changed files with 21 additions and 14 deletions
+7 -3
View File
@@ -88,18 +88,22 @@ export function outdatedBanner(sources?: TableSource[]): string[] {
/** 서버가 주는 표 한 벌 — 갈래·kind·한글 이름·줄 수. 화면은 제 목록을 안 가짐(늘면 저절로 섬). */
export interface ServedKind {
group: string;
/** 갈래 한글 이름(이름표 `base_price_groups`) — 안 오면 group 키가 그대로 떠 빠진 것이 드러남 */
group_label?: string;
kind: string;
label: string;
rows: number;
}
type KindBox = { group: string; label: string; items: ServedKind[] };
/** 받은 차례 그대로 갈래별로 묶음 — 갈래 차례도 서버가 낸 순서를 따름. */
export function groupKinds(kinds: ServedKind[]): { group: string; items: ServedKind[] }[] {
const boxes: { group: string; items: ServedKind[] }[] = [];
export function groupKinds(kinds: ServedKind[]): KindBox[] {
const boxes: KindBox[] = [];
for (const kind of kinds) {
const box = boxes.find((each) => each.group === kind.group);
if (box) box.items.push(kind);
else boxes.push({ group: kind.group, items: [kind] });
else boxes.push({ group: kind.group, label: kind.group_label ?? kind.group, items: [kind] });
}
return boxes;
}