feat(axis): 품셈 판 pum_edition 칸 — 자원·공종 쪽, 판이 다르면 값을 안 씀
공종 마스터·자원 축 줄·B08 인계 줄마다 공종 코드가 본 판을 실음(명세 17장 규칙 3). 판이 다른 인계 줄은 내역서에서 「확인 대기」로 빠지고, 코드에 박힌 절 번호(합산 단계·표 형태 판정·가드 목록)는 마스터 판과 다르면 마스터 빌드·단가 조립을 멈춤(규칙 4). 판 기준은 common_util_pum_edition 한 곳. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schema_version": "1.0",
|
||||
"dataset_id": "data_work_item_master_manifest",
|
||||
"generated_at": "2026-09-13T21:50:44+09:00",
|
||||
"generated_at": "2026-09-13T22:33:42+09:00",
|
||||
"built_by": "B08_Quantity/B08_Quantity_Build_WorkItemMaster.py",
|
||||
"source": {
|
||||
"dataset_id": "pum_forest",
|
||||
@@ -12,8 +12,8 @@
|
||||
"files": [
|
||||
{
|
||||
"file": "work_item_master_2026-01-01.json",
|
||||
"sha256": "9da259311e5b24c92c8423b423d2b0f4b0b2bb3e7fc2a4eb41aec9cae25b6dc0",
|
||||
"size_bytes": 862856
|
||||
"sha256": "4e7790cd9d288e6026e7ccd81ce0c81320b395c84575655ff2dce443f44d65a4",
|
||||
"size_bytes": 862887
|
||||
},
|
||||
{
|
||||
"file": "form_undetermined_2026-01-01.json",
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"schema_version": "1.0",
|
||||
"dataset_id": "work_item_master_forest",
|
||||
"effective_date": "2026-01-01",
|
||||
"generated_at": "2026-09-13T21:50:44+09:00",
|
||||
"pum_edition": "2026-01-01",
|
||||
"generated_at": "2026-09-13T22:33:42+09:00",
|
||||
"dataset_version": {
|
||||
"dataset_id": "pum_forest",
|
||||
"effective_date": "2026-01-01",
|
||||
|
||||
@@ -51,6 +51,8 @@ WORK_ITEM_KEYS = {
|
||||
"in_bill",
|
||||
"in_bill_reason",
|
||||
"origin",
|
||||
# 공종 코드가 본 품셈 판 — B09 가 마스터 판과 다르면 값을 안 씀(명세 17장 · 2026-09-13 추가).
|
||||
"pum_edition",
|
||||
}
|
||||
|
||||
#: **자재 줄**이 내보내는 칸. ⚠ 여기에 `work_item_code` 가 들어가면 안 된다(축이 다르다).
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
"""품셈 판 `pum_edition` — 자원·공종 쪽 (명세 17장 규칙 3·4 · 2026-09-13).
|
||||
|
||||
지키는 것
|
||||
① 공종 마스터·자원 축 줄·인계 줄이 모두 자기가 본 판을 싣는다
|
||||
② 판이 다른 인계 줄은 내역서에서 값을 안 쓰고 「확인 대기」로 선다
|
||||
③ 코드에 박힌 절 번호의 판과 마스터 판이 다르면 조립을 멈춘다
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from B08_Quantity.B08_Quantity_Engine_Handoff import build_handoff
|
||||
from B09_Estimation.B09_Estimation_BillOfQuantities import build_bill
|
||||
from B09_Estimation.B09_Estimation_ResourceAxis import build_resource_axis, load_work_item_master
|
||||
from B09_Estimation.B09_Estimation_ResourceAxis_Sources import load_combined_catalog
|
||||
from common_util.common_util_pum_edition import (
|
||||
CODE_PUM_EDITION,
|
||||
PumEditionError,
|
||||
require_code_edition,
|
||||
)
|
||||
|
||||
|
||||
def test_마스터_자원_인계가_모두_판을_싣는다() -> None:
|
||||
master = load_work_item_master()
|
||||
assert master["pum_edition"] == master["effective_date"] == CODE_PUM_EDITION
|
||||
axis = build_resource_axis(master, load_combined_catalog())
|
||||
assert axis.rows and {row.as_dict()["pum_edition"] for row in axis.rows} == {CODE_PUM_EDITION}
|
||||
handoff = build_handoff(
|
||||
summary_table={"rows": [{"group": "흙깎기", "item": "토사", "unit": "㎥", "amount": 5.0}]}
|
||||
)
|
||||
assert handoff["pum_edition"] == CODE_PUM_EDITION
|
||||
assert all(row["pum_edition"] == CODE_PUM_EDITION for row in handoff["work_items"])
|
||||
|
||||
|
||||
def test_판이_다른_인계_줄은_값을_안_쓰고_확인_대기() -> None:
|
||||
handoff = build_handoff(
|
||||
summary_table={"rows": [{"group": "흙깎기", "item": "토사", "unit": "㎥", "amount": 5.0}]}
|
||||
)
|
||||
same = build_bill(handoff)
|
||||
assert any(row.code and row.amount_krw for row in same.rows if not row.is_group)
|
||||
for row in handoff["work_items"]:
|
||||
row["pum_edition"] = "2027-01-01"
|
||||
moved = build_bill(handoff)
|
||||
assert not [row for row in moved.rows if not row.is_group]
|
||||
assert any(m.get("blocked_kind") == "edition_waiting" for m in moved.missing)
|
||||
|
||||
|
||||
def test_코드에_박힌_절_번호는_판이_다르면_멈춘다() -> None:
|
||||
require_code_edition(CODE_PUM_EDITION, "시험")
|
||||
with pytest.raises(PumEditionError):
|
||||
require_code_edition("2027-01-01", "시험")
|
||||
Reference in New Issue
Block a user