feat(B09): 원가 단가 수요 = 연결된 사본이 부른 자원(143-1 원천 · 144)
- B09_Estimation_Linked = linked_snapshots 사본마다 담은 로직을 사본 단가 묶음 · 입력값 · 고른자재로 돌려 부른 LB · EQ · MT · MO 줄만 모음(묶음 통째 · 고르기 후보 안 씀 · 쓰기 없음) - 자리만이던 수요 함수를 바꿈 · 입력 빈 사본은 부른 줄 없음(빈 입력 자동값은 142-1 몫) - 시험 = test_144_b09_skeleton 더함(기계경비 로직 → EQ000004 · MO000002 · LB000048) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015KYZ2HWWdUwZWYnn3tQz7X
This commit is contained in:
@@ -22,6 +22,7 @@ from B08_Quantity.B08_Quantity_Router_Hydro import _project_root
|
||||
from B08_Quantity.B08_Quantity_Router_Material import material_sheets
|
||||
from B09_Estimation import B09_Estimation_Prices as prices
|
||||
from B09_Estimation import B09_Estimation_Store as store
|
||||
from B09_Estimation.B09_Estimation_Linked import linked_resource_keys
|
||||
from B09_Estimation.B09_Estimation_Calc_Base import compute_base
|
||||
|
||||
router = APIRouter(prefix="/api/projects", tags=["B09 Estimation"])
|
||||
@@ -41,7 +42,7 @@ async def _b08(project_id: UUID, notes: list[str]) -> dict[str, Any]:
|
||||
async def payload(project_id: UUID, root: Path) -> dict[str, Any]:
|
||||
notes: list[str] = []
|
||||
b08 = await _b08(project_id, notes)
|
||||
keys = prices.linked_resource_keys(root)
|
||||
keys = await asyncio.to_thread(linked_resource_keys, root)
|
||||
if not keys:
|
||||
notes.append(
|
||||
"연결된 구조물 조합 사본 없음 — 노무 · 경비 · 중기 단가 줄은 사본이 연결되면 생김"
|
||||
@@ -68,7 +69,7 @@ async def estimation(project_id: UUID) -> dict[str, Any]:
|
||||
async def save_estimation(project_id: UUID, body: dict[str, Any] = Body(...)) -> dict[str, Any]:
|
||||
root = await _project_root(project_id)
|
||||
await asyncio.to_thread(store.write_user, root, body.get("user"))
|
||||
keys = prices.linked_resource_keys(root)
|
||||
keys = await asyncio.to_thread(linked_resource_keys, root)
|
||||
book = await asyncio.to_thread(store.read_book, root)
|
||||
book = await asyncio.to_thread(prices.extend_book, book, keys)
|
||||
await asyncio.to_thread(store.write_book, root, book)
|
||||
@@ -78,7 +79,7 @@ async def save_estimation(project_id: UUID, body: dict[str, Any] = Body(...)) ->
|
||||
@router.post("/{project_id}/estimation/prices")
|
||||
async def refresh_prices(project_id: UUID) -> dict[str, Any]:
|
||||
root = await _project_root(project_id)
|
||||
keys = prices.linked_resource_keys(root)
|
||||
keys = await asyncio.to_thread(linked_resource_keys, root)
|
||||
book = await asyncio.to_thread(prices.refresh_book, keys)
|
||||
await asyncio.to_thread(store.write_book, root, book)
|
||||
return await payload(project_id, root)
|
||||
|
||||
Reference in New Issue
Block a user