feat(z01): 뒤처진 자료 띠(서버 source.outdated 만 · 「이 자료는 ○ 판 · 최신은 ○ 공표 · 받는 자리」) · 고친 것 모아 보기는 서버 쪽 나눔 그대로(page·size · 검색 칸 숨김 · 값에 unit) · 부동소수 끝자리 떠돌이 자름(손료계수 0.0001811) · 실제 API 로 노임 한 칸 고치고 되돌림 확인(브레인)

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-15 22:08:08 +09:00
co-authored by Claude Opus 5
parent 4dd41590da
commit 43cb7c90d0
6 changed files with 110 additions and 19 deletions
+37 -2
View File
@@ -25,9 +25,25 @@ _RUNNER = """
import { writeFileSync } from "node:fs";
import {
cellInfo, cellText, clampPage, columnTitle, latestOnly, pageCount, parseCellInput, rowCells,
shownColumns, valueWithUnit,
outdatedBanner, shownColumns, valueWithUnit,
} from "./Z01_MasterData_UI_Cells.js";
// 뒤처짐 띠 — 판정은 서버 outdated 만(화면이 날짜를 안 견줌) · 받는 자리를 띠에 적음(2026-09-15 브레인)
const laborSource = {
publisher: "대한건설협회",
where: "cak.or.kr [지원·사업]>[건설적산기준]>[건설임금]",
cycle: "반년",
latest_published: "2026-09-01",
our_edition: "2026-01-01",
checked_at: "2026-09-15",
outdated: true,
};
const banners = [
outdatedBanner(laborSource),
outdatedBanner({ ...laborSource, outdated: false }),
outdatedBanner(undefined),
];
// 기준일 — 한 표에 시기가 다른 판이 섞이니 줄마다 보임 · 없으면 「판 모름」(2026-09-15 브레인 ①)
const dated = [
{ key: "occupation_name", label: "직종명", unit: null, hidden: false },
@@ -91,6 +107,8 @@ writeFileSync(process.argv[2], JSON.stringify({
cellText({ a: 1 }, null),
cellText(true, null),
cellText("보통인부", null),
// 소수 끝 떠돌이 자리(부동소수) — 기계 손료계수 0.0001811 이 0.00018109999999999998 로 보이던 것
cellText(0.00018109999999999998, null),
],
pages: [pageCount(0, 50), pageCount(6999, 50), pageCount(50, 50)],
row: rowCells({ extra: "x", daily_wage_krw: 250000, occupation_name: null }, columns),
@@ -122,6 +140,7 @@ writeFileSync(process.argv[2], JSON.stringify({
valueWithUnit(null, "원"),
valueWithUnit("5억 미만", ""),
],
banners,
}));
"""
@@ -160,7 +179,16 @@ def test_칸_글자와_숨김_열(tmp_path: Path) -> None:
assert got["shown"] == ["occupation_name", "daily_wage_krw"]
assert got["shownAll"] == ["id", "occupation_name", "daily_wage_krw"]
assert got["titles"] == ["id", "직종명", "일 노임 (원)"]
assert got["cells"] == ["", "250,000", "1.23456", "2026", '{"a":1}', "예", "보통인부"]
assert got["cells"] == [
"",
"250,000",
"1.23456",
"2026",
'{"a":1}',
"예",
"보통인부",
"0.0001811",
]
assert got["pages"] == [1, 140, 1]
# columns 차례 · id 는 줄에 없어 「—」 · null 은 빈칸 · extra 는 안 그림
assert got["row"] == ["—", "", "250,000"]
@@ -197,3 +225,10 @@ def test_칸_글자와_숨김_열(tmp_path: Path) -> None:
assert [row[1] for row in got["editions"]] == ["2026-01-01", "판 모름", "판 모름"]
# 단추 글자·칸 설명의 값 — 쉼표 + 단위(이름표) · 단위 없으면 수만
assert got["withUnit"] == ["17 원", "41,500,000 원", "0.17", "12,345.678", "", "5억 미만"]
# 날짜가 뒤처져 보여도 서버가 outdated=false 면 띠 없음 · 출처가 안 오면 띠 없음
assert got["banners"] == [
"이 자료는 2026-01-01 판 · 최신은 2026-09-01 공표 · "
"대한건설협회 cak.or.kr [지원·사업]>[건설적산기준]>[건설임금]",
None,
None,
]