fix(B05·B06): 집계 항목 지정이 폼 검증에 막혀 초안에 안 들어가던 흠 · 저장 전 B05→B06→B05 에서 관 지정이 옛값으로 돌아가던 흠(21-10 흠 2·3)

- 흠 2 고치는 구조물의 집계 항목 지정 · 해제는 필수 옵션 · 측점 검증을 거치지 않고 기록에 바로 반영(commitSummaryOnly) · 관 · 새 항목은 종전 흐름
- 흠 3 배수유역 화면이 들어올 때 세션 초안 관 목록이 있으면 그것으로 세움(초안이 없으면 종전대로 정본)
- 시험 2개 추가(집계 항목 전용 반영 · 초안 우선 진입)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TULoa94ZFL26KU6ZqVpjkF
This commit is contained in:
2026-09-29 13:44:39 +09:00
co-authored by Claude Sonnet 5.5
parent 5cb65dff16
commit 5f43ef8541
5 changed files with 206 additions and 26 deletions
@@ -190,6 +190,22 @@ export function emit(ctx: StructuresCommitContext): void {
ctx.callbacks.onChange([...ctx.structures]);
}
/** 집계 항목만 바뀐 때 — 폼 검증(필수 옵션 · 측점)에 걸려 조용히 버려지지 않게, 고치는 중인
* 구조물 기록에 곧바로 반영한다(PLAN 21-10 흠 2). 반영했으면 true — 관 · 새 항목은 false 라
* 종전 흐름(`commit(true)` · [추가])을 따른다. */
export function commitSummaryOnly(ctx: StructuresCommitContext): boolean {
const id = ctx.editingId();
const index = id ? ctx.structures.findIndex((entry) => entry.structure_id === id) : -1;
if (index < 0 || ctx.tempPipeChainage() !== null) return false;
const next: StructureInstance = { ...ctx.structures[index] };
const summary = ctx.summary();
if (summary) next.summary_item = summary;
else delete next.summary_item;
ctx.structures[index] = next;
emit(ctx);
return true;
}
export async function commit(ctx: StructuresCommitContext, live = false): Promise<void> {
const type = ctx.currentType();
if (!type) return;