Merge remote-tracking branch 'origin/sub_laptop_6' into sub_laptop_5

This commit is contained in:
2026-10-31 16:18:26 +09:00
27 changed files with 2097 additions and 27 deletions
+32 -2
View File
@@ -72,6 +72,7 @@ from B08_Quantity.B08_Quantity_Router_Material import material_sheets
from B08_Quantity.B08_Quantity_Router_Milestone import read_data as read_milestone
from B08_Quantity.B08_Quantity_Router_Milestone import site_info
from B09_Estimation import B09_Estimation_Bill_Library as library
from B09_Estimation import B09_Estimation_Daega_Paste as daega_paste
from B09_Estimation import B09_Estimation_Daega_Personal as personal
from B09_Estimation import B09_Estimation_Past as past
from B09_Estimation import B09_Estimation_Prices as prices
@@ -81,7 +82,7 @@ from B09_Estimation import B09_Estimation_Store as store
from B09_Estimation.B09_Estimation_Bill_Items import bill_items, hopyo_prices
from B09_Estimation.B09_Estimation_Calc_Base import compute_base
from B09_Estimation.B09_Estimation_Calc_Bill import compute_estimation
from B09_Estimation.B09_Estimation_Calc_Labor import compute_labor, daega_price
from B09_Estimation.B09_Estimation_Calc_Labor import added_keys, compute_labor, daega_price
from B09_Estimation.B09_Estimation_Calc_Total import compute_total
from B09_Estimation.B09_Estimation_Labor_Source import daega_inputs
from B09_Estimation.B09_Estimation_Linked import linked_resource_keys
@@ -211,7 +212,8 @@ async def _demand(root: Path, draft: dict[str, Any] | None = None) -> list[str]:
keep = None if draft is None else library.used_folders(user)
keys = await asyncio.to_thread(linked_resource_keys, root, keep)
hand = await asyncio.to_thread(sangeun.hand_resource_keys, user)
return [*keys, *(k for k in hand if k not in keys)]
hand = [*hand, *added_keys(user.get("daega_cover"))] # 705-2 붙인 줄 이음
return [*keys, *dict.fromkeys(k for k in hand if k not in keys)]
async def payload(
@@ -499,6 +501,34 @@ async def save_personal(
}
class DaegaPasteBody(BaseModel):
"""705-2 — `cover` = 펼친 호표 덮개 자리 · `글` = 붙인 글 그대로 · `열` = 기억한 열 짝 · `user` = 화면 캐시."""
cover: str = Field(min_length=1, max_length=200)
글: str = Field(max_length=400_000)
열: dict[str, int] | None = None
user: dict[str, Any] | None = None
@router.post("/{project_id}/estimation/daega/paste")
async def daega_paste_run(
project_id: UUID, body: DaegaPasteBody, session: dict[str, Any] = Depends(verify_session)
) -> dict[str, Any]:
"""[Ctrl+V] 펼친 일위대가 — 지금 호표 끝에 고정 줄(저장 안 함) · 답 = 새 사용자 값 + 그 값으로 셈한 원가
자료(붙인 줄 이음 키가 단가 책 수요에 듦) · 물음 = 열 짝."""
root = await _project_root(project_id)
raw = (
body.user if isinstance(body.user, dict) else await asyncio.to_thread(store.read_user, root)
)
try:
got = await asyncio.to_thread(daega_paste.paste, raw, body.cover, body.글, body.열)
except ValueError as error:
raise HTTPException(status_code=400, detail=str(error)) from error
if got["갈래"] == "줄":
got["payload"] = await payload(project_id, root, got["user"])
return got
def _past_rows(projects: list[dict[str, Any]], here: str) -> list[dict[str, Any]]:
out = []
for other in projects: