feat(M02): 프로젝트 복사본 일위대가 문서 — 스냅샷 · 입력값 첫 값 · 자재 단가 · 수량 반영 계산 (39-1c)
- Item_Source: 층 labor/<열>.json 이 있으면 일위대가.json = {줄: 문서, 로직, 빠진로직, 알약} · 없으면 옛 UA 조합 줄 · 단가 묶음에 자재 MT
- Item_Snapshot: 입력값.json 첫 값 = 문서 입력값 {로직: {입력: {값, 확인: false}}}
- Item_Prices: collect 가 자재 MT 도 · calc 가 줄마다 수량 · 반영 + 자재 · 기준합 · 반영합(M02_Labor_Doc.settle 한 벌 · 면적 알약 칸 값)
- Item_Copy · Project_Items_Router: 일위대가 종류 읽기만(쓰면 400) · 재적용은 새 첫 값 위에 프로젝트 값 · calc 에 면적
- 시험 test_m02_item_labor.py
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UoSr2sqvYtBf1dtQdus88s
This commit is contained in:
@@ -55,6 +55,7 @@ KINDS = {
|
||||
"입력연결": LINK_FILE,
|
||||
"입력값": VALUES_FILE,
|
||||
"고른자재": PICKS_FILE,
|
||||
"일위대가": LABOR_FILE, # 읽기만 — 일위대가는 원본 층에서 고침(39-1c)
|
||||
}
|
||||
#: 뼈대 검사에 쓰는 층 양식 종류(도면 · 면적산출 · 재료산출)
|
||||
SKELETON = {"도면": "structure", "면적": "area", "재료": "material"}
|
||||
@@ -171,6 +172,8 @@ def _check_links(content: Any) -> None:
|
||||
|
||||
|
||||
def check(kind: str, content: Any) -> None:
|
||||
if kind == "일위대가":
|
||||
raise ValueError("일위대가는 원본(마스터 · 회사 · 개인) 층에서 고침 — 프로젝트는 넣을 값만")
|
||||
if kind == "입력값":
|
||||
_check_values(content)
|
||||
elif kind == "고른자재":
|
||||
@@ -253,7 +256,10 @@ def reapply(project_root: str | Path, folder: str) -> dict[str, Any]:
|
||||
before = {name: read_json(target / file) for name, file in KINDS.items()}
|
||||
files = build_snapshot(manifest["원본"])
|
||||
labor = files.get(LABOR_FILE) or {}
|
||||
files[VALUES_FILE] = _kept_values(values, labor)
|
||||
seeded = files[VALUES_FILE] # 새 원본의 첫 값 — 프로젝트에서 넣은 값이 같은 키면 이김
|
||||
kept_values = _kept_values(values, labor)
|
||||
for logic, inputs in kept_values.items():
|
||||
seeded[logic] = {**seeded.get(logic, {}), **inputs}
|
||||
files[PICKS_FILE] = _kept_picks(picks, labor)
|
||||
for old in target.glob("*.json"): # 원본에서 빠진 파일(도면 없앰 등)은 지움
|
||||
if old.name != MANIFEST_NAME and old.name not in files:
|
||||
@@ -268,7 +274,7 @@ def reapply(project_root: str | Path, folder: str) -> dict[str, Any]:
|
||||
source = version_of(source_files(files))
|
||||
stamp = now_text()
|
||||
# 원본을 다시 가져왔으니 시트 고침은 없음 — 살린 입력값 · 고른 자재는 `값있음` 으로 따로 알림
|
||||
kept = bool(files[VALUES_FILE] or files[PICKS_FILE])
|
||||
kept = bool(kept_values or files[PICKS_FILE])
|
||||
fresh = {**manifest, "판": source, "원본판": source, "가져온날": stamp, "고침": False}
|
||||
fresh["값있음"] = kept
|
||||
fresh.pop("고친날", None)
|
||||
@@ -343,4 +349,5 @@ def calc(project_root: str | Path, folder: str) -> dict[str, Any]:
|
||||
read_json(target / PRICE_FILE) or {},
|
||||
read_json(target / VALUES_FILE) or {},
|
||||
read_json(target / PICKS_FILE) or {},
|
||||
read_json(target / KINDS["면적"]),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user