feat(448 B05 페이지 설정): [저장] · [확정] 영구저장 — 세션 초안 · settings 차례 · 경고 기준 갈아 끼움

- 세션 칸 pagesettings(설계속도 · 지형 · 기준값 · 최소고 강제 · 시작 측점) · 열 때 최신 응답 위에 얹음
- 저장 차례 settings = 노선 뒤 · 관 앞(기본 창구 · 노선 바꾼 [저장]에도 돎)
- PUT /route/page-settings — stage 2 params 에 사용자 값만 병합(상태 · STALE 그대로) · 종단 정책 · criteria 갱신 뒤 위반 · 요약 다시 셈(기하 그대로)
- 시 · 종점 계획고 조정 = 첫 · 끝 측점 계획고 편집(끝점 ▲▼ 와 같은 길) · 샘플 간격 두 칸 읽기 전용
- E1 재설계 요청이 설계속도 · 최소고 강제 · 시작 측점 옮김 · E2 B06 재생성 지형 기본 특수 · E3 초기값 스냅샷 stage 2 params 뜸 · 되돌림
- 노선 추천 · 평면 R 설정 읽기가 params.options 를 봄(옛 맨 위 칸 폴백)
- 시험 test_442_2_page_settings · test_442_2_grade_limit_mirror · design_store_save 차례 갱신

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-18 21:37:54 +09:00
co-authored by Claude Opus 5.5
parent d0779af302
commit e5dcb695e6
24 changed files with 1237 additions and 31 deletions
@@ -218,6 +218,8 @@ async def save_initial_snapshot(
dump: dict[str, Any] = {"routes": _json_safe([dict(route)])}
for table in _CHILD_TABLES:
dump[table] = _json_safe(await _dump_rows(connection, table, route_id))
# stage 2 params(제어점 · 페이지 설정)도 — [초기화]가 함께 되돌림(448 E3)
dump["stage2_params"] = await _stage2_params(connection, str(route["project_id"]))
(target / _DB_DUMP_NAME).write_text(json.dumps(dump, ensure_ascii=False), encoding="utf-8")
@@ -322,9 +324,40 @@ async def restore_initial_snapshot(
if "project_id" in child:
child["project_id"] = project_id
await _insert_row(connection, table, child)
await _restore_stage2_params(connection, project_id, dump)
return new_id
async def _stage2_params(connection: aiomysql.Connection, project_id: str) -> Any:
async with connection.cursor() as cursor:
await cursor.execute(
"SELECT params FROM project_workflow_stages WHERE project_id = %s AND stage_no = 2",
(project_id,),
)
row = await cursor.fetchone()
raw = row[0] if row else None
return json.loads(raw) if isinstance(raw, str) else raw
async def _restore_stage2_params(
connection: aiomysql.Connection, project_id: str, dump: dict[str, Any]
) -> None:
"""뜬 stage 2 params 로 되씀 — 안 뜬 옛 스냅샷은 페이지 설정 칸만 걷어 기본값(448 E3)."""
from B05_Profile.B05_Profile_PageSettings import strip_page_settings
if "stage2_params" in dump:
params = dump["stage2_params"]
else:
params = strip_page_settings(await _stage2_params(connection, project_id))
if params is None:
return
async with connection.cursor() as cursor:
await cursor.execute(
"UPDATE project_workflow_stages SET params = %s WHERE project_id = %s AND stage_no = 2",
(json.dumps(params, ensure_ascii=False), project_id),
)
async def _insert_row(connection: aiomysql.Connection, table: str, row: dict[str, Any]) -> int:
columns = list(row.keys())
placeholders = ", ".join(["%s"] * len(columns))