refactor(859-2 ㉮-1): B09 내역 점검 [단가 갱신] · 미리 보기 창 · [재생성] 걷음 — 프로젝트 단가는 지정한 때 그대로
- 화면: 「내역 점검」 카드 [단가 갱신] 단추 · 점 배지 · 호버 · 미리 보기 창([재생성] · [적용]) 걷음 · 연결 점검 목록 그대로 - 서버: POST …/estimation/prices · …/prices/preview 걷음(openapi 469 → 467) · GET 답 `book` · `stale` 칸(매 GET 단가 책 견줌) 걷음 - B09_Estimation_Refresh · B09_Estimation_Copy_Prices 지움(사본 단가 읽기 = 단가.json 바로) · Bill_Library 서고 다시 굳힘(changed · refresh_copy) 걷음 - 단가 책: 첫 굳힘 `make_book`(옛 refresh_book 의 단가 갱신 몫 · book_stale · book_diff · labor_editions 걷음) - 시험: 죽은 길만 보던 test_296 · test_703_3 지움 · 203_1 배지 · 795_4 ⑤ ⑥ · 719_2 서고 업데이트 지움 · 144 길 = 없음 확인 - test_253_3: B9-4 화면 꼴 뒤 낡은 단언(엑셀 꼴 식 글)을 작업량 값 줄로 고침 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,9 +7,7 @@
|
||||
precombo 사전조합 = `일위대가.json` {줄: {담은로직: [{참조, 수량: {손: 1}}]}, 참조사본} ·
|
||||
`단가.json`(`M02_Item_Source.price_bundle` — 사본 단가 묶음 한 벌)
|
||||
sangeun 단가산출(SK · 내 자료집 · 719-2) = precombo 와 한 꼴(SK = 수식 사본 · B9-5)
|
||||
[업데이트](719-2) = 원본판이 다른 사본만 같은 폴더에 다시 굳힘(`changed` · `refresh_copy` ·
|
||||
값 그대로 · 원본판 없는 옛 사본 = 그대로).
|
||||
사본 = 원본이 바뀌거나 지워져도 그대로(굳힘) ·
|
||||
사본 = 원본이 바뀌거나 지워져도 그대로(굳힘 · 859-2 프로젝트 안 다시 굳힘 없음) ·
|
||||
대가 블록 = `Labor_Source.daega_inputs`(`libs` {폴더: 블록 id}) ·
|
||||
단가 수요 = `Linked.linked_resource_keys` · 줄 연결 = {tab: dg, key: 블록 id, lib: 폴더} ·
|
||||
[저장] 때 줄이 안 쓰는 사본은 지움(`prune`) · 층 읽기 권한 = 부르는 쪽(`M02_Layer_Access.grant`).
|
||||
@@ -104,7 +102,7 @@ def _precombo_files(layer: str, owner: str | None, key: str, kind: str = "precom
|
||||
|
||||
def source_version(files: dict[str, Any]) -> str:
|
||||
"""서고 사본 원본판(719-1) = 일위대가.json + 수식 문서(로직 몫 · 855-F B9-6) 지문 — 굳힌 SC · SK
|
||||
문서(SK = 수식 사본) · 단가는 뺌(단가 바뀜은 [단가 갱신] 몫) · 값 덮기 전에 셈."""
|
||||
문서(SK = 수식 사본) · 단가는 뺌 · 값 덮기 전에 셈."""
|
||||
return version_of([files.get(LABOR_FILE), (files.get(doc_b09.FILE) or {}).get("문서")])
|
||||
|
||||
|
||||
@@ -121,39 +119,6 @@ def _build(kind: str, layer: str, owner: str | None, key: str) -> tuple[dict, di
|
||||
return files, files.pop("_원본")
|
||||
|
||||
|
||||
def _source_of(manifest: dict[str, Any]) -> tuple[str, str, str | None, str]:
|
||||
"""manifest → (종류, 층, 주인, 키)."""
|
||||
kind, origin = str(manifest.get("종류")), manifest.get("원본") or {}
|
||||
if kind == "combo":
|
||||
return kind, origin.get("layer"), origin.get("owner"), origin.get("key")
|
||||
ref = origin.get("참조") or {}
|
||||
return kind, ref.get("층"), ref.get("주인"), ref.get("키")
|
||||
|
||||
|
||||
def changed(project_root: str | Path) -> list[tuple[Path, dict[str, Any], dict, dict]]:
|
||||
"""원본판이 지금 원본과 다른 사본 `(폴더, manifest, 새 파일들, 새 원본 표지)` — 원본판 없는 옛
|
||||
사본 · 원본 없음 = 뺌(그대로)."""
|
||||
out = []
|
||||
for folder, manifest in copies(project_root):
|
||||
if not manifest.get("원본판"):
|
||||
continue
|
||||
try:
|
||||
files, origin = _build(*_source_of(manifest))
|
||||
except (LookupError, ValueError, KeyError):
|
||||
continue
|
||||
if source_version(files) != manifest["원본판"]:
|
||||
out.append((folder, manifest, files, origin))
|
||||
return out
|
||||
|
||||
|
||||
def refresh_copy(project_root: str | Path, one: tuple) -> None:
|
||||
"""`changed` 한 줄 → 같은 폴더에 다시 굳힘(값 · 가져온이 그대로 · 원본판 새로)."""
|
||||
folder, manifest, files, origin = one
|
||||
keep = {k: v for k, v in manifest.items() if k not in ("값", "원값")}
|
||||
fresh = {**keep, "원본": origin, "원본판": source_version(files), "가져온날": now_text()}
|
||||
_write(project_root, folder.name, files, fresh, manifest.get("값") or {})
|
||||
|
||||
|
||||
# ── 운반 값 사본(263-2) ────────────────────────────────────────────────
|
||||
def _logic(code: str) -> dict[str, Any]:
|
||||
"""M01 기초 이름 · 입력 꼴 — 지금 수식 문서(855-F B9-6) · 없는 기초 = 입력 없음."""
|
||||
|
||||
Reference in New Issue
Block a user