공종 마스터·자원 축 줄·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
53 lines
2.3 KiB
Python
53 lines
2.3 KiB
Python
"""품셈 판 `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", "시험")
|