Files
Aislo/A00_Common/design/logic/design_calc_node_carry.ts
T
eomsangdonandClaude Opus 5.5 4b6800e387 feat(472-6 6-B 노선 바뀐 [저장] 한 본문): 노선 저장 · 관 · 구조물 다시 얹기 · 횡단 고침 넘김을 서버 한 창구로 — 전부 아니면 없음
- POST /design/save 에 route(노선 초안) · carry(옛 노선 세션 칸) 칸 · 서버 = 노선 저장 → Node facility.rebase(rebasePipeDraft · rebaseStructureDraft) → 6-A 차례(새 노선) → Node stations.carry(routeCarryPatches) → 횡단 저장
- 되돌림 범위 = 노선 행 · 자식 표 · 단계 · 배수 폴더 · 노선 파일 · 지표면 확정(설계 지형 바꿈)
- 손 상단측은 안 넘김(요구 274) · 노선 바뀐 [확정] = [저장](새 노선 본 뒤 다시)
- 브라우저 = 노선 초안 + 사용자 칸만 한 본문 · 옛 차례 길(saveRouteDraft 뒤 flush · carryAfterRouteSave · keepDraftsOnNewRoute) · 부름 0 된 flush 창구 여섯 · saveCachedCrossPatches 걷음
- 등록부 R9 stations.carry · F10 facility.rebase · 옛 차례 단언 시험 한 본문 꼴로 · test_472_6_route_save(옛 길 = 새 길 · 실패 되돌림)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 12:07:12 +09:00

49 lines
2.1 KiB
TypeScript

/* =============================================================================
* A00_Common/design/logic/design_calc_node_carry.ts
* 계산 Node 입구(`design_calc_node.ts`)의 노선 바뀐 [저장] 다시 얹기 몫(PLAN 472-6 6-B) — 브라우저가 쓰던 같은 TS.
*
* facility.rebase 입력 rebase { pipes?: { draft · before · after } · structures?: { draft · before · after } } →
* { pipes · structures }(세션 초안을 서버가 따라 옮긴 정본 위에 · `rebasePipeDraft` ·
* `rebaseStructureDraft` · 없는 몫 null)
* stations.carry 입력 carry(`RouteCarryInput` — 새 노선 상세 · 옛 노선 세션 칸 · 옛 열쇠 목록 · 측점 주인 ·
* 관 세션 장부 · 저장 관 앞뒤) → { patches · outside }(`routeCarryPatches`)
* ========================================================================== */
import {
rebasePipeDraft,
rebaseStructureDraft,
type FollowingPoint,
type FollowingStructure,
} from "@util/common_util_route_follow";
import {
routeCarryPatches,
type RouteCarryInput,
} from "../../../B06_Section/B06_Section_Route_Carry_Patch";
type Pipe = FollowingPoint & { id?: string | null };
type Structure = FollowingStructure & { structure_id?: string | null };
type Rebase<T> = { draft: T[]; before: T[]; after: T[] };
export interface CarryInputs {
rebase?: { pipes?: Rebase<Pipe> | null; structures?: Rebase<Structure> | null };
carry?: RouteCarryInput;
}
/** id → 셈(입구 `RUNNERS` 에 얹음). */
export function carryRunners(inputs: CarryInputs): Record<string, () => unknown> {
return {
"facility.rebase": () => {
const rebase = inputs.rebase;
if (!rebase) return null;
const { pipes, structures } = rebase;
return {
pipes: pipes ? rebasePipeDraft(pipes.draft, pipes.before, pipes.after) : null,
structures: structures
? rebaseStructureDraft(structures.draft, structures.before, structures.after)
: null,
};
},
"stations.carry": () => (inputs.carry ? routeCarryPatches(inputs.carry) : null),
};
}