feat(497-0 [초기화] 서버): B07 · B08 · B09 reset 창구 셋 — 그 페이지 사용자 값 · 설정 지움 · 올린 파일 남김 · 단계 = 저장
- B07 POST /design-drawings/reset — 저장본 확정 풂(번호 · json 남김) · B07 이 올린 측점 확정 → 잠정 · 축척 · 횡단 배치 · 평면도 종류 · 표식 파일 지움 · 새 _Router_Reset.py(main.py 물림) - B08 POST /quantity/reset — quantity 설정 구획 기본 · hydro_inputs 지움 · milestone 기본(사용자 그림 붙은 거래처 경로 줄만 남김 · to = 시점) · 1본 길이 · 그림 남김 - B09 POST /estimation/reset — 사용자 값 · 단가 책 · estimation 설정 구획 지움 · 안 쓰는 서고 사본 정리 · 견적서 남김 · 답 = GET 꼴 - 공용 reset_section(구획 하나 기본으로) · 새 시험 test_298_2_page_reset Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
[저장] — 사용자 값 · 책에 없는 새 단가 줄만 굳힘 → 서버가 정본으로 다시 셈
|
||||
POST /api/projects/{id}/estimation/complete
|
||||
[>] — 단계 6 완료 · 프로젝트 DONE(요구 300 B1 · 본문 없음)
|
||||
POST /api/projects/{id}/estimation/reset
|
||||
[초기화](요구 298-2 C1 · C3 · C4 · C5 · 301 · 본문 없음) — 사용자 값 전부(내역 · 자재 ·
|
||||
원가 · 공기) · 단가 책 · `estimation` 설정 구획 지움 · 서고 사본 정리 · 견적서 파일 남김 →
|
||||
답 = GET 꼴(기준 = 지금 B08 저장본 + 지금 M01 단가) · 단계 = [저장]과 같음
|
||||
POST /api/projects/{id}/estimation/prices {user?}
|
||||
[단가 갱신] — 수요 단가 전부를 지금 M01 값으로 새로 굳힘 · user = 화면 캐시(296 ·
|
||||
지운 줄 · 그 사본은 수요에서 뺌 · 저장은 안 함) · M01 원본이 지워진 줄 = 굳힌 값 그대로
|
||||
@@ -63,6 +67,7 @@ from B09_Estimation.B09_Estimation_Rates import rate_candidates, rate_table
|
||||
from B09_Estimation.B09_Estimation_Router_Quotes import router as quotes_router
|
||||
from B09_Estimation.B09_Estimation_Summary import compute_summary, hopyo_lines, used_materials
|
||||
from common_util.common_util_auth import verify_session
|
||||
from common_util.common_util_project_settings import reset_section
|
||||
from common_util.common_util_workflow_state import mark_stage
|
||||
from M02_MasterTemplete import M02_Layer_Access as access
|
||||
from M02_MasterTemplete.M02_Item_Snapshot import importer
|
||||
@@ -231,6 +236,22 @@ async def estimation_complete(project_id: UUID) -> dict[str, Any]:
|
||||
return {"status": "success", "project_id": str(project_id)}
|
||||
|
||||
|
||||
def reset_files(root: Path) -> None:
|
||||
"""[초기화] 파일 몫 — 사용자 값 · 단가 책 지움 · 운반 연결(B08 몫)이 안 잇는 서고 사본 지움."""
|
||||
(store.folder(root) / store.USER).unlink(missing_ok=True)
|
||||
(store.folder(root) / store.BOOK).unlink(missing_ok=True)
|
||||
library.prune(root, calc_user(root))
|
||||
reset_section(root, "estimation")
|
||||
|
||||
|
||||
@router.post("/{project_id}/estimation/reset")
|
||||
async def estimation_reset(project_id: UUID) -> dict[str, Any]:
|
||||
root = await _project_root(project_id)
|
||||
await asyncio.to_thread(reset_files, root)
|
||||
await mark_stage(str(project_id), 6, "save") # [초기화] = 작업본 바꿈 = [저장]과 같음
|
||||
return await payload(project_id, root)
|
||||
|
||||
|
||||
@router.post("/{project_id}/estimation/prices")
|
||||
async def refresh_prices(
|
||||
project_id: UUID, body: dict[str, Any] | None = Body(None)
|
||||
|
||||
Reference in New Issue
Block a user