feat(b09): 준공 단계 — 계약금액 | 준공금액(기성 마지막 회차 누계를 옮기기만)

- 준공 별도 계산 규칙 미확인(35번 §3) — 규칙을 짓지 않고 기성 누계를 옮김 · 기성 한 장 불변
- 기성 회차가 없으면 준공금액 비움(0 원으로 안 채움)
- 기성 계산 조각(progress_for)을 떼어 준공이 같은 길로 받음
- 기성 간접재료비 확인 대기 닫음 — 예정가격작성기준 제17조·제39조② 근거(브레인 판정)
- 준공 탭 파일 · 사전 키(등록은 서브) · 시험 2건 · 전체 1730 통과

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BW6Jdsh18WPtYUR6THZJqn
This commit is contained in:
2026-09-14 07:01:46 +09:00
co-authored by Claude Opus 5
parent 7d3b062c3e
commit a7a1b246b6
5 changed files with 280 additions and 7 deletions
@@ -19,6 +19,7 @@ from B09_Estimation.B09_Estimation_Progress import (
SETTINGS_KEY,
VAT_CHOICES,
clean_settings,
completion_sheet,
progress_sheet,
)
from B09_Estimation.B09_Estimation_Rates import RateLookupError
@@ -34,9 +35,10 @@ def _cut_options(first: str) -> list[dict[str, str]]:
]
@router.get("/{project_id}/estimation/progress")
async def get_progress(project_id: UUID, round: int | None = None) -> JSONResponse:
"""기성 한 장 — `round` 회차(1부터)를 금회로 · 없으면 마지막 회차."""
async def progress_for(
project_id: UUID, round: int | None
) -> tuple[dict[str, Any], dict[str, Any]] | JSONResponse:
"""(기성 저장값, 기성 한 장) — 못 서면 그 까닭 응답. 준공도 이 길로 기성본을 받음."""
from B09_Estimation.B09_Estimation_Router_Contract import contract_for
from B09_Estimation.B09_Estimation_Router_CostSheet import cost_from_bill
from common_util.common_util_project_settings import estimation_settings
@@ -52,7 +54,34 @@ async def get_progress(project_id: UUID, round: int | None = None) -> JSONRespon
except RateLookupError as error:
return JSONResponse(status_code=422, content={"status": "error", "message": str(error)})
stored, _ = clean_settings(dict(estimation_settings(root).get(SETTINGS_KEY) or {}))
sheet = progress_sheet(contract["rows"], cost_data, cost_result, stored, round)
return stored, progress_sheet(contract["rows"], cost_data, cost_result, stored, round)
@router.get("/{project_id}/estimation/completion")
async def get_completion(project_id: UUID) -> JSONResponse:
"""준공 한 장 — 계약금액 | 준공금액(기성 마지막 회차 누계를 옮김)."""
found = await progress_for(project_id, None)
if isinstance(found, JSONResponse):
return found
return JSONResponse(
content={
"status": "success",
**completion_sheet(found[1]),
"limit_note": (
"준공 별도 계산 규칙 미확인(35번 §3) — 기성 마지막 회차 누계를 옮기기만 함 · "
"준공 표본 0건"
),
}
)
@router.get("/{project_id}/estimation/progress")
async def get_progress(project_id: UUID, round: int | None = None) -> JSONResponse:
"""기성 한 장 — `round` 회차(1부터)를 금회로 · 없으면 마지막 회차."""
found = await progress_for(project_id, round)
if isinstance(found, JSONResponse):
return found
stored, sheet = found
return JSONResponse(
content={
"status": "success",