From 40126051dc8f3149697c67d3f1bfb220f35de3b0 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 18 Nov 2026 22:09:35 +0900 Subject: [PATCH] =?UTF-8?q?refactor(859-5=20=E2=91=A2=E2=91=A3):=20?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=EB=AC=BC=20=EC=A0=95=EC=9D=98=20=EC=9E=90?= =?UTF-8?q?=EB=A3=8C=20master=5Ftemplate=20=E2=86=92=20master=5Fdata/?= =?UTF-8?q?=EA=B5=AC=EC=A1=B0=EB=AC=BC=EC=A0=95=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 구조물정의.json → resources/master_data/구조물정의/구조물정의.json(git mv · 내용 그대로) - 구조물정의_이력/판_1 ~ 22 → resources/master_data/구조물정의/이력/(git mv · 내용 그대로) - 읽는 자리 = B05 Structures_Schema DEFINITION_PATH · HISTORY_DIRNAME · M01_SO_Definition HISTORY - M01 요소 로더 · check_master 는 첫 층 *.json 만 읽음 — 새 폴더는 요소로 안 읽힘(수식문서/ 와 같은 대접) - 시험 · 도우미 · ui_checks 경로 글 고침(파일 이름 그대로) - resources/master_template 에 구조물 정의 자료 남지 않음 Co-Authored-By: Claude Opus 5.5 --- B05_Profile/B05_Profile_Structures_Schema.py | 9 +++++---- B05_Profile/logic/B05_Profile_UI_Structures_Define.ts | 2 +- M01_MasterData/StructOptions/M01_SO_Api.ts | 2 +- M01_MasterData/StructOptions/M01_SO_Definition.py | 6 +++--- .../구조물정의}/구조물정의.json | 0 .../구조물정의/이력}/판_1.json | 0 .../구조물정의/이력}/판_10.json | 0 .../구조물정의/이력}/판_11.json | 0 .../구조물정의/이력}/판_12.json | 0 .../구조물정의/이력}/판_13.json | 0 .../구조물정의/이력}/판_14.json | 0 .../구조물정의/이력}/판_15.json | 0 .../구조물정의/이력}/판_16.json | 0 .../구조물정의/이력}/판_17.json | 0 .../구조물정의/이력}/판_18.json | 0 .../구조물정의/이력}/판_19.json | 0 .../구조물정의/이력}/판_2.json | 0 .../구조물정의/이력}/판_20.json | 0 .../구조물정의/이력}/판_21.json | 0 .../구조물정의/이력}/판_22.json | 0 .../구조물정의/이력}/판_3.json | 0 .../구조물정의/이력}/판_4.json | 0 .../구조물정의/이력}/판_5.json | 0 .../구조물정의/이력}/판_6.json | 0 .../구조물정의/이력}/판_7.json | 0 .../구조물정의/이력}/판_8.json | 0 .../구조물정의/이력}/판_9.json | 0 resources/tester/helper_116_right_click_add.cjs | 5 ++++- resources/tester/helper_126_ford_fill.cjs | 5 ++++- resources/tester/helper_271_facility_lane.cjs | 5 ++++- resources/tester/helper_280_3_draft_frame.cjs | 2 +- resources/tester/helper_319_kind_swap.cjs | 5 ++++- resources/tester/helper_322_3_flow.cjs | 5 ++++- resources/tester/helper_322_catalog_module.cjs | 2 +- resources/tester/helper_323_7_new_type.cjs | 5 ++++- resources/tester/helper_384_3_planted.mjs | 2 +- resources/tester/helper_457_draft_card.cjs | 2 +- resources/tester/helper_458_swap_attach.cjs | 2 +- resources/tester/helper_473_lane_ready.cjs | 5 ++++- resources/tester/helper_b05_structures_define.cjs | 7 +++++-- resources/tester/helper_b06_draft_pipe_replay.cjs | 5 ++++- resources/tester/helper_m02_so_def_spec.cjs | 5 ++++- resources/tester/test_106_span_highlight_wording.py | 2 +- resources/tester/test_194_1_berm_depth.py | 2 +- resources/tester/test_323_7_new_type.py | 2 +- resources/tester/test_52_10_structure_spec_road.py | 2 +- .../tester/test_52_3_structure_spec_ford_pavement.py | 2 +- resources/tester/test_52_4_structure_spec_ford.py | 3 ++- resources/tester/test_52_structure_spec_box.py | 3 ++- resources/tester/test_52_structure_spec_pipe.py | 3 ++- resources/tester/test_b06_box_thickness_registry.py | 4 +++- resources/tester/test_b06_pipe_form_keys.py | 4 +++- resources/tester/test_m02_precombo_class.py | 4 +++- resources/tester/test_m02_structure_definition.py | 8 ++++---- resources/tester/ui_checks/48-1_구조물정의_읽기.js | 2 +- 55 files changed, 81 insertions(+), 41 deletions(-) rename resources/{master_template => master_data/구조물정의}/구조물정의.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_1.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_10.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_11.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_12.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_13.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_14.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_15.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_16.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_17.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_18.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_19.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_2.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_20.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_21.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_22.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_3.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_4.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_5.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_6.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_7.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_8.json (100%) rename resources/{master_template/구조물정의_이력 => master_data/구조물정의/이력}/판_9.json (100%) diff --git a/B05_Profile/B05_Profile_Structures_Schema.py b/B05_Profile/B05_Profile_Structures_Schema.py index cf1ca6107..9d813e978 100644 --- a/B05_Profile/B05_Profile_Structures_Schema.py +++ b/B05_Profile/B05_Profile_Structures_Schema.py @@ -1,6 +1,6 @@ """B05 구조물 타입 레지스트리·인스턴스 검증 모델. -구조물 타입 정의는 코드가 아니라 데이터(M02 마스터 `resources/master_template/구조물정의.json` +구조물 타입 정의는 코드가 아니라 데이터(M01 마스터 `resources/master_data/구조물정의/구조물정의.json` `types` · PLAN 48-1)다. 리스트가 바뀌어도 코드를 고치지 않도록 분리했고, 프론트는 `GET /structure-types`로 같은 정본을 받는다. 정의 틀 = `docs/raw/M02_구조물옵션정의/정의_틀.md`. @@ -27,7 +27,8 @@ STRUCTURE_SIDES = ("left", "right", "center", "cross") DEFINITION_PATH = os.path.join( os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "resources", - "master_template", + "master_data", + "구조물정의", "구조물정의.json", ) @@ -159,8 +160,8 @@ def is_station_planting_type(item: StructureType) -> bool: return row is not None and row["station"] != "none" -#: 지난 판 정의(`판_N.json`) 폴더 — 정본 옆(M02 `M01_SO_Definition.HISTORY` 와 같은 이름) -HISTORY_DIRNAME = "구조물정의_이력" +#: 지난 판 정의(`판_N.json`) 폴더 — 정본 옆(M01 `M01_SO_Definition.HISTORY` 와 같은 이름) +HISTORY_DIRNAME = "이력" def registry_schema_version() -> int: diff --git a/B05_Profile/logic/B05_Profile_UI_Structures_Define.ts b/B05_Profile/logic/B05_Profile_UI_Structures_Define.ts index 752627e1b..47e6c2573 100644 --- a/B05_Profile/logic/B05_Profile_UI_Structures_Define.ts +++ b/B05_Profile/logic/B05_Profile_UI_Structures_Define.ts @@ -2,7 +2,7 @@ * B05_Profile_UI_Structures_Define.ts * 구조물 정의 → 「구조물 배치」 칸 모양 (PLAN 48-3 · 48-4) — 화면 요소 없는 순수 규칙. * - * 정의(`resources/master_template/구조물정의.json` · GET /structure-types 가 실어 줌)를 읽어 + * 정의(`resources/master_data/구조물정의/구조물정의.json` · GET /structure-types 가 실어 줌)를 읽어 * 칸 차례 · 격자 · 안 씀 · 규칙(상위 값 → 하위 선택지 · 보이기 · 기본값)을 낸다. 틀 = * `docs/raw/M02_구조물옵션정의/정의_틀.md`. 선택지를 줄이면(숨김) 옛 값은 그 값만 남겨 보임. * 그리기는 `_Structures_Panel_Options`(레지스트리 칸) · `_Structures_Define_Form`(시설 폼 칸). diff --git a/M01_MasterData/StructOptions/M01_SO_Api.ts b/M01_MasterData/StructOptions/M01_SO_Api.ts index f9597bacd..6df598c1a 100644 --- a/M01_MasterData/StructOptions/M01_SO_Api.ts +++ b/M01_MasterData/StructOptions/M01_SO_Api.ts @@ -25,7 +25,7 @@ export const fetchStructureDef = (): Promise => call("/structure-defi export const saveStructureDef = (판: number, 정의: StructDef): Promise => call("/structure-definition", { method: "PUT", body: JSON.stringify({ 판, 정의 }) }); -/** 지난 판 목록(`구조물정의_이력/판_N.json`) */ +/** 지난 판 목록(`구조물정의/이력/판_N.json`) */ export const fetchStructureDefHistory = (): Promise => call("/structure-definition/history"); diff --git a/M01_MasterData/StructOptions/M01_SO_Definition.py b/M01_MasterData/StructOptions/M01_SO_Definition.py index bcae25fd8..083561b55 100644 --- a/M01_MasterData/StructOptions/M01_SO_Definition.py +++ b/M01_MasterData/StructOptions/M01_SO_Definition.py @@ -1,7 +1,7 @@ -"""M02 구조물 정의 한 벌(PLAN 48-1) — 정본 `resources/master_template/구조물정의.json`. +"""M01 구조물 정의 한 벌(PLAN 48-1) — 정본 `resources/master_data/구조물정의/구조물정의.json`. 틀 = `docs/raw/M02_구조물옵션정의/정의_틀.md`. 읽기 = 로그인 누구나 · 쓰기 = 시스템 관리자만. -판 = 정수 · 저장마다 +1 · 앞 판은 `구조물정의_이력/판_N.json` 으로 남김(지난 정의 값 읽기용). +판 = 정수 · 저장마다 +1 · 앞 판은 `구조물정의/이력/판_N.json` 으로 남김(지난 정의 값 읽기용). 검사 = 칸 꼴 · 키 겹침 · 표시 · 그룹 · 배치 · 규칙 대상 있음 — 틀리면 422 · 낡은 판 409. """ @@ -21,7 +21,7 @@ from M01_MasterData.StructOptions.M01_SO_Check import catalog_errors from M02_MasterTemplete import M02_MasterTemplete_Store as store FILE = "구조물정의.json" -HISTORY = "구조물정의_이력" +HISTORY = "이력" # 반영 · 부품 = 구조물 표 칸(322-2 · 없으면 처음값 · 검사 = `M01_SO_Check`) TOP = {"판", "schema_version", "comment", "구조물군", "동작", "types", "반영", "부품"} SECTIONS = {"종류": dict, "표시": dict, "그룹": dict, "배치": dict, "규칙": list} diff --git a/resources/master_template/구조물정의.json b/resources/master_data/구조물정의/구조물정의.json similarity index 100% rename from resources/master_template/구조물정의.json rename to resources/master_data/구조물정의/구조물정의.json diff --git a/resources/master_template/구조물정의_이력/판_1.json b/resources/master_data/구조물정의/이력/판_1.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_1.json rename to resources/master_data/구조물정의/이력/판_1.json diff --git a/resources/master_template/구조물정의_이력/판_10.json b/resources/master_data/구조물정의/이력/판_10.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_10.json rename to resources/master_data/구조물정의/이력/판_10.json diff --git a/resources/master_template/구조물정의_이력/판_11.json b/resources/master_data/구조물정의/이력/판_11.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_11.json rename to resources/master_data/구조물정의/이력/판_11.json diff --git a/resources/master_template/구조물정의_이력/판_12.json b/resources/master_data/구조물정의/이력/판_12.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_12.json rename to resources/master_data/구조물정의/이력/판_12.json diff --git a/resources/master_template/구조물정의_이력/판_13.json b/resources/master_data/구조물정의/이력/판_13.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_13.json rename to resources/master_data/구조물정의/이력/판_13.json diff --git a/resources/master_template/구조물정의_이력/판_14.json b/resources/master_data/구조물정의/이력/판_14.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_14.json rename to resources/master_data/구조물정의/이력/판_14.json diff --git a/resources/master_template/구조물정의_이력/판_15.json b/resources/master_data/구조물정의/이력/판_15.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_15.json rename to resources/master_data/구조물정의/이력/판_15.json diff --git a/resources/master_template/구조물정의_이력/판_16.json b/resources/master_data/구조물정의/이력/판_16.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_16.json rename to resources/master_data/구조물정의/이력/판_16.json diff --git a/resources/master_template/구조물정의_이력/판_17.json b/resources/master_data/구조물정의/이력/판_17.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_17.json rename to resources/master_data/구조물정의/이력/판_17.json diff --git a/resources/master_template/구조물정의_이력/판_18.json b/resources/master_data/구조물정의/이력/판_18.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_18.json rename to resources/master_data/구조물정의/이력/판_18.json diff --git a/resources/master_template/구조물정의_이력/판_19.json b/resources/master_data/구조물정의/이력/판_19.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_19.json rename to resources/master_data/구조물정의/이력/판_19.json diff --git a/resources/master_template/구조물정의_이력/판_2.json b/resources/master_data/구조물정의/이력/판_2.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_2.json rename to resources/master_data/구조물정의/이력/판_2.json diff --git a/resources/master_template/구조물정의_이력/판_20.json b/resources/master_data/구조물정의/이력/판_20.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_20.json rename to resources/master_data/구조물정의/이력/판_20.json diff --git a/resources/master_template/구조물정의_이력/판_21.json b/resources/master_data/구조물정의/이력/판_21.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_21.json rename to resources/master_data/구조물정의/이력/판_21.json diff --git a/resources/master_template/구조물정의_이력/판_22.json b/resources/master_data/구조물정의/이력/판_22.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_22.json rename to resources/master_data/구조물정의/이력/판_22.json diff --git a/resources/master_template/구조물정의_이력/판_3.json b/resources/master_data/구조물정의/이력/판_3.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_3.json rename to resources/master_data/구조물정의/이력/판_3.json diff --git a/resources/master_template/구조물정의_이력/판_4.json b/resources/master_data/구조물정의/이력/판_4.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_4.json rename to resources/master_data/구조물정의/이력/판_4.json diff --git a/resources/master_template/구조물정의_이력/판_5.json b/resources/master_data/구조물정의/이력/판_5.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_5.json rename to resources/master_data/구조물정의/이력/판_5.json diff --git a/resources/master_template/구조물정의_이력/판_6.json b/resources/master_data/구조물정의/이력/판_6.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_6.json rename to resources/master_data/구조물정의/이력/판_6.json diff --git a/resources/master_template/구조물정의_이력/판_7.json b/resources/master_data/구조물정의/이력/판_7.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_7.json rename to resources/master_data/구조물정의/이력/판_7.json diff --git a/resources/master_template/구조물정의_이력/판_8.json b/resources/master_data/구조물정의/이력/판_8.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_8.json rename to resources/master_data/구조물정의/이력/판_8.json diff --git a/resources/master_template/구조물정의_이력/판_9.json b/resources/master_data/구조물정의/이력/판_9.json similarity index 100% rename from resources/master_template/구조물정의_이력/판_9.json rename to resources/master_data/구조물정의/이력/판_9.json diff --git a/resources/tester/helper_116_right_click_add.cjs b/resources/tester/helper_116_right_click_add.cjs index f757b5973..d59a9bae7 100644 --- a/resources/tester/helper_116_right_click_add.cjs +++ b/resources/tester/helper_116_right_click_add.cjs @@ -41,7 +41,10 @@ const { loadForm } = loadTs(path.join(B05, "B05_Profile_UI_Structures_Panel_Comm const entry = (required, value) => ({ required, isEmpty: () => value === "" }); // 동작 = 정의 종류 덧칸(앱의 `withDefinition` 과 같음 · 323-7 종류 키 대신 동작 이름) const DEFINED = JSON.parse( - fs.readFileSync(path.join(ROOT, "resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync( + path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + "utf8", + ), ); const behaviors = (typeId) => DEFINED.종류?.[typeId]?.동작 ?? []; const type = (type_id, managed_by = null) => ({ diff --git a/resources/tester/helper_126_ford_fill.cjs b/resources/tester/helper_126_ford_fill.cjs index f4e3f5d37..867968b0d 100644 --- a/resources/tester/helper_126_ford_fill.cjs +++ b/resources/tester/helper_126_ford_fill.cjs @@ -35,7 +35,10 @@ const { fordHeightM } = loadTs( // 동작 = 정의 종류 덧칸(앱의 `withDefinition` 과 같음 · 323-7 종류 키 대신 동작 이름) const DEFINED = JSON.parse( - fs.readFileSync(path.join(ROOT, "resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync( + path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + "utf8", + ), ); const type = (type_id) => ({ type_id, diff --git a/resources/tester/helper_271_facility_lane.cjs b/resources/tester/helper_271_facility_lane.cjs index cb78f3a2b..29d55a7e6 100644 --- a/resources/tester/helper_271_facility_lane.cjs +++ b/resources/tester/helper_271_facility_lane.cjs @@ -63,7 +63,10 @@ const ids = loadTs(path.join(design, "design_pipe_ids.ts")); const { useDesignStore } = loadTs(path.join(design, "design_store.ts")); const { readState } = loadTs(path.join(ROOT, "A00_Common", "b_page_state.ts")); const TYPES = JSON.parse( - fs.readFileSync(path.join(ROOT, "resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync( + path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + "utf8", + ), ).types; /** 가짜 종단도 — 받은 것 · 편집 옮김 기록. */ diff --git a/resources/tester/helper_280_3_draft_frame.cjs b/resources/tester/helper_280_3_draft_frame.cjs index b1e5fa8d3..3e53490a2 100644 --- a/resources/tester/helper_280_3_draft_frame.cjs +++ b/resources/tester/helper_280_3_draft_frame.cjs @@ -60,7 +60,7 @@ function load(full) { const P = (...a) => path.join(ROOT, ...a); const D = load(P("B06_Section", "B06_Section_Section_Drafts.ts")); const def = JSON.parse( - fs.readFileSync(P("resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync(P("resources", "master_data", "구조물정의", "구조물정의.json"), "utf8"), ); S.types = def.types.map((t) => ({ type_id: t.type_id, diff --git a/resources/tester/helper_319_kind_swap.cjs b/resources/tester/helper_319_kind_swap.cjs index cbe3683a4..9a416b1a9 100644 --- a/resources/tester/helper_319_kind_swap.cjs +++ b/resources/tester/helper_319_kind_swap.cjs @@ -12,7 +12,10 @@ const ROOT = path.join(__dirname, "..", ".."); const B05 = (name) => path.join(ROOT, "B05_Profile", `${name}.ts`); const B06 = (name) => path.join(ROOT, "B06_Section", `${name}.ts`); const TYPES = JSON.parse( - fs.readFileSync(path.join(ROOT, "resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync( + path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + "utf8", + ), ).types; class FakeStorage { diff --git a/resources/tester/helper_322_3_flow.cjs b/resources/tester/helper_322_3_flow.cjs index 6124da24d..ecd867afa 100644 --- a/resources/tester/helper_322_3_flow.cjs +++ b/resources/tester/helper_322_3_flow.cjs @@ -8,7 +8,10 @@ const path = require("path"); const ROOT = path.join(__dirname, "..", ".."); const ts = require(path.join(ROOT, "config", "node_modules", "typescript")); const DEF = JSON.parse( - fs.readFileSync(path.join(ROOT, "resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync( + path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + "utf8", + ), ); const TYPES = DEF.types.map((t) => ({ managed_by: null, enabled: true, ...t })); diff --git a/resources/tester/helper_322_catalog_module.cjs b/resources/tester/helper_322_catalog_module.cjs index f06833065..9c86a8662 100644 --- a/resources/tester/helper_322_catalog_module.cjs +++ b/resources/tester/helper_322_catalog_module.cjs @@ -16,7 +16,7 @@ const box = { exports: {} }; new Function("exports", "module", "require", js)(box.exports, box, () => read("common_util", "common_util_structure_parts.json"), ); -box.exports.useCatalogDefinition(read("resources", "master_template", "구조물정의.json")); +box.exports.useCatalogDefinition(read("resources", "master_data", "구조물정의", "구조물정의.json")); /** 로더 요청이 구조물 표 모듈인가. */ box.exports.isCatalogRequest = (request) => /common_util_structure_catalog(\.js)?$/.test(request); diff --git a/resources/tester/helper_323_7_new_type.cjs b/resources/tester/helper_323_7_new_type.cjs index c846c0527..d857d8940 100644 --- a/resources/tester/helper_323_7_new_type.cjs +++ b/resources/tester/helper_323_7_new_type.cjs @@ -37,7 +37,10 @@ function load(file) { const C = (name) => path.join(ROOT, "common_util", `${name}.ts`); const M = (name) => path.join(ROOT, "M01_MasterData", "StructOptions", `${name}.ts`); const master = JSON.parse( - fs.readFileSync(path.join(ROOT, "resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync( + path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + "utf8", + ), ); const def = JSON.parse(JSON.stringify(master)); const add = load(M("M01_SO_Def_Add")); diff --git a/resources/tester/helper_384_3_planted.mjs b/resources/tester/helper_384_3_planted.mjs index 7e1d546be..1bdc1b56e 100644 --- a/resources/tester/helper_384_3_planted.mjs +++ b/resources/tester/helper_384_3_planted.mjs @@ -66,7 +66,7 @@ const detail = { }; // 구조물 표 = 실제 정의(마스터 읽기만) · 측점을 심는 구조물 — 켜진 점형 하나 · 꺼진 것 하나(보기와 같이 둘 다 심음) const definition = JSON.parse( - readFileSync(new URL("../master_template/구조물정의.json", import.meta.url), "utf8"), + readFileSync(new URL("../master_data/구조물정의/구조물정의.json", import.meta.url), "utf8"), ); m.useCatalogDefinition(definition); const planting = (item) => { diff --git a/resources/tester/helper_457_draft_card.cjs b/resources/tester/helper_457_draft_card.cjs index a8c8697f0..0bcaf72b7 100644 --- a/resources/tester/helper_457_draft_card.cjs +++ b/resources/tester/helper_457_draft_card.cjs @@ -52,7 +52,7 @@ const PD = load(P("B05_Profile", "logic", "B05_Profile_Pipeline_Detail.ts")); const CR = load(P("A00_Common", "design", "design_pipeline_cross.ts")); const def = JSON.parse( - fs.readFileSync(P("resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync(P("resources", "master_data", "구조물정의", "구조물정의.json"), "utf8"), ); const types = def.types .filter((t) => t.enabled !== false) diff --git a/resources/tester/helper_458_swap_attach.cjs b/resources/tester/helper_458_swap_attach.cjs index 887902e35..a1152b8d8 100644 --- a/resources/tester/helper_458_swap_attach.cjs +++ b/resources/tester/helper_458_swap_attach.cjs @@ -42,7 +42,7 @@ const SS = load(P("B05_Profile", "logic", "B05_Profile_Sections_Stations.ts")); const SW = load(P("B06_Section", "logic", "B06_Section_Station_Swap.ts")); const AT = load(P("common_util", "common_util_structure_attach.ts")); const def = JSON.parse( - fs.readFileSync(P("resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync(P("resources", "master_data", "구조물정의", "구조물정의.json"), "utf8"), ); const types = def.types .filter((t) => t.enabled !== false) diff --git a/resources/tester/helper_473_lane_ready.cjs b/resources/tester/helper_473_lane_ready.cjs index 088c8701b..392619399 100644 --- a/resources/tester/helper_473_lane_ready.cjs +++ b/resources/tester/helper_473_lane_ready.cjs @@ -62,7 +62,10 @@ const { createFacilityLane } = loadTs(path.join(design, "design_facility_lane.ts const ids = loadTs(path.join(design, "design_pipe_ids.ts")); const { listedBase } = loadTs(path.join(design, "design_profile_base.ts")); const TYPES = JSON.parse( - fs.readFileSync(path.join(ROOT, "resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync( + path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + "utf8", + ), ).types; /** 가짜 종단도 — 측점을 받은 차례 기록. */ diff --git a/resources/tester/helper_b05_structures_define.cjs b/resources/tester/helper_b05_structures_define.cjs index c9c102dc7..f2a1b2bae 100644 --- a/resources/tester/helper_b05_structures_define.cjs +++ b/resources/tester/helper_b05_structures_define.cjs @@ -1,6 +1,6 @@ /* 구조물 정의 → 칸 모양 단위검증 헬퍼(PLAN 48-3 · 48-4) — `B05_Profile_UI_Structures_Define.ts` 를 * 그 자리에서 트랜스파일해 Node 로 돌림(import 없는 파일). 결과는 표준출력에 JSON 한 벌. - * 판 1 정의(`resources/master_template/구조물정의.json`)도 읽어 지금 화면과 같은지(차례 · 2열) 봄. + * 판 1 정의(`resources/master_data/구조물정의/구조물정의.json`)도 읽어 지금 화면과 같은지(차례 · 2열) 봄. */ const fs = require("fs"); const path = require("path"); @@ -48,7 +48,10 @@ const type = { const plain = (states) => Object.fromEntries([...states].map(([k, v]) => [k, v])); const def = JSON.parse( - fs.readFileSync(path.join(ROOT, "resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync( + path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + "utf8", + ), ); const merged = d.withDefinition( def.types.map((t) => ({ ...t, groups: (def.그룹[t.type_id] ?? []).map((g) => ({ id: g.id })) })), diff --git a/resources/tester/helper_b06_draft_pipe_replay.cjs b/resources/tester/helper_b06_draft_pipe_replay.cjs index 2d6d86544..731e1eb7a 100644 --- a/resources/tester/helper_b06_draft_pipe_replay.cjs +++ b/resources/tester/helper_b06_draft_pipe_replay.cjs @@ -39,7 +39,10 @@ const { loadTs } = makeLoader({ }); const DEF = JSON.parse( - fs.readFileSync(path.join(ROOT, "resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync( + path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + "utf8", + ), ); const TYPES = DEF.types.map((t) => ({ managed_by: null, enabled: true, ...t })); const attach = loadTs(path.join(ROOT, "common_util", "common_util_structure_attach.ts")); diff --git a/resources/tester/helper_m02_so_def_spec.cjs b/resources/tester/helper_m02_so_def_spec.cjs index 7f44bcf97..092c42a37 100644 --- a/resources/tester/helper_m02_so_def_spec.cjs +++ b/resources/tester/helper_m02_so_def_spec.cjs @@ -29,7 +29,10 @@ const m = load("M01_MasterData", "StructOptions", "M01_SO_Def_Spec_Model.ts"); const { PIPE_SPEC } = load("A00_Common", "design", "logic", "design_structure_pipe.ts"); const real = () => JSON.parse( - fs.readFileSync(path.join(ROOT, "resources", "master_template", "구조물정의.json"), "utf8"), + fs.readFileSync( + path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + "utf8", + ), ); const out = {}; diff --git a/resources/tester/test_106_span_highlight_wording.py b/resources/tester/test_106_span_highlight_wording.py index c3275bb7a..9f9b03708 100644 --- a/resources/tester/test_106_span_highlight_wording.py +++ b/resources/tester/test_106_span_highlight_wording.py @@ -68,7 +68,7 @@ def test_로케일에_기슭막이는_독립_한_곳뿐(): def test_정의_label은_흙막이_choices_값은_그대로(): - definition = json.loads(_read("resources", "master_template", "구조물정의.json")) + definition = json.loads(_read("resources", "master_data", "구조물정의", "구조물정의.json")) labels, choices = [], [] def walk(node): diff --git a/resources/tester/test_194_1_berm_depth.py b/resources/tester/test_194_1_berm_depth.py index 95e726918..f4ff322a5 100644 --- a/resources/tester/test_194_1_berm_depth.py +++ b/resources/tester/test_194_1_berm_depth.py @@ -32,7 +32,7 @@ from config.config_system import STANDARD_CROSS_SECTION ROOT = Path(__file__).resolve().parents[2] TSC = ROOT / "config" / "node_modules" / "typescript" / "bin" / "tsc" HELPER = Path(__file__).parent / "helper_194_1_berm_pick.cjs" -DEF = ROOT / "resources" / "master_template" / "구조물정의.json" +DEF = ROOT / "resources" / "master_data" / "구조물정의" / "구조물정의.json" node_only = pytest.mark.skipif(not TSC.is_file(), reason="프론트엔드 의존성 미설치") diff --git a/resources/tester/test_323_7_new_type.py b/resources/tester/test_323_7_new_type.py index 3f8bf5d6c..352b97c5b 100644 --- a/resources/tester/test_323_7_new_type.py +++ b/resources/tester/test_323_7_new_type.py @@ -75,7 +75,7 @@ def test_check_screen_equals_server(ts: dict, copied: dict) -> None: master = json.loads(Path(definition.schema.DEFINITION_PATH).read_text(encoding="utf-8")) assert ts["problems"] == [] real = json.loads( - (ROOT / "resources" / "master_template" / "구조물정의.json").read_text("utf-8") + (ROOT / "resources" / "master_data" / "구조물정의" / "구조물정의.json").read_text("utf-8") ) assert definition.check(copied, real) == [] assert ts["badBase"] is True and ts["chain"] is True diff --git a/resources/tester/test_52_10_structure_spec_road.py b/resources/tester/test_52_10_structure_spec_road.py index 5d1424837..ed99601f8 100644 --- a/resources/tester/test_52_10_structure_spec_road.py +++ b/resources/tester/test_52_10_structure_spec_road.py @@ -13,7 +13,7 @@ import pytest HERE = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.dirname(os.path.dirname(HERE)) -DEFINITION = os.path.join(ROOT, "resources", "master_template", "구조물정의.json") +DEFINITION = os.path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json") @pytest.fixture(scope="module") diff --git a/resources/tester/test_52_3_structure_spec_ford_pavement.py b/resources/tester/test_52_3_structure_spec_ford_pavement.py index 3508d61f6..7f01391da 100644 --- a/resources/tester/test_52_3_structure_spec_ford_pavement.py +++ b/resources/tester/test_52_3_structure_spec_ford_pavement.py @@ -131,7 +131,7 @@ def test_집계표_짝_명세와_같음(): def test_정의_그룹_경사각도(): with open( - os.path.join(ROOT, "resources/master_template/구조물정의.json"), encoding="utf-8" + os.path.join(ROOT, "resources/master_data/구조물정의/구조물정의.json"), encoding="utf-8" ) as f: groups = json.load(f)["그룹"]["ford_pavement"] assert [(g["id"], g["이름"]) for g in groups] == [("gfordpaveslope", "경사각도")] diff --git a/resources/tester/test_52_4_structure_spec_ford.py b/resources/tester/test_52_4_structure_spec_ford.py index a7a4dd1ca..be66994c3 100644 --- a/resources/tester/test_52_4_structure_spec_ford.py +++ b/resources/tester/test_52_4_structure_spec_ford.py @@ -110,7 +110,8 @@ def test_월류_높이는_폭과_연동_필요_수심_올림(out): def test_정의_파일에_세월교_이름_표가_올라_있음(): names = _node("names") with open( - os.path.join(ROOT, "resources", "master_template", "구조물정의.json"), encoding="utf-8" + os.path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + encoding="utf-8", ) as f: doc = json.load(f) # 그림 전용 길이 칸(294-4)은 마스터 정의 이름 표에 안 올림(마스터 손대지 않음) — 대조 밖 diff --git a/resources/tester/test_52_structure_spec_box.py b/resources/tester/test_52_structure_spec_box.py index 5bc8c469d..fa5d6f42a 100644 --- a/resources/tester/test_52_structure_spec_box.py +++ b/resources/tester/test_52_structure_spec_box.py @@ -99,7 +99,8 @@ def test_사용자_입력_빈_칸은_다시_열어도_사용자_입력(out): def test_정의_파일에_이름_표_그룹_선택지가_올라_있음(): names = _node("names") with open( - os.path.join(ROOT, "resources", "master_template", "구조물정의.json"), encoding="utf-8" + os.path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + encoding="utf-8", ) as f: doc = json.load(f) # 그림 전용 길이 칸(294-4)은 마스터 정의 이름 표에 안 올림(마스터 손대지 않음) — 대조 밖 diff --git a/resources/tester/test_52_structure_spec_pipe.py b/resources/tester/test_52_structure_spec_pipe.py index 64b33b570..32801eade 100644 --- a/resources/tester/test_52_structure_spec_pipe.py +++ b/resources/tester/test_52_structure_spec_pipe.py @@ -103,7 +103,8 @@ def test_잇기_키와_이름_바꿈(out): def test_정의_파일에_이름_표가_올라_있음(): names = _node("names") with open( - os.path.join(ROOT, "resources", "master_template", "구조물정의.json"), encoding="utf-8" + os.path.join(ROOT, "resources", "master_data", "구조물정의", "구조물정의.json"), + encoding="utf-8", ) as f: doc = json.load(f) on_file = doc["종류"]["pipe"]["이름"] diff --git a/resources/tester/test_b06_box_thickness_registry.py b/resources/tester/test_b06_box_thickness_registry.py index 198b6682a..f1ea7f120 100644 --- a/resources/tester/test_b06_box_thickness_registry.py +++ b/resources/tester/test_b06_box_thickness_registry.py @@ -18,7 +18,9 @@ ROOT = Path(__file__).resolve().parents[2] def _box_options() -> dict[str, dict]: registry = json.loads( - (ROOT / "resources" / "master_template" / "구조물정의.json").read_text(encoding="utf-8") + (ROOT / "resources" / "master_data" / "구조물정의" / "구조물정의.json").read_text( + encoding="utf-8" + ) ) types = registry if isinstance(registry, list) else registry.get("types") or [] box = next(t for t in types if t["type_id"] == "box_culvert") diff --git a/resources/tester/test_b06_pipe_form_keys.py b/resources/tester/test_b06_pipe_form_keys.py index 059016c5a..943a2a733 100644 --- a/resources/tester/test_b06_pipe_form_keys.py +++ b/resources/tester/test_b06_pipe_form_keys.py @@ -32,7 +32,9 @@ QUANTITY_ONLY = { def _pipe_option_keys() -> list[str]: payload = json.loads( - (ROOT / "resources" / "master_template" / "구조물정의.json").read_text(encoding="utf-8") + (ROOT / "resources" / "master_data" / "구조물정의" / "구조물정의.json").read_text( + encoding="utf-8" + ) ) types = payload if isinstance(payload, list) else payload["types"] pipe = next(item for item in types if item["type_id"] == "pipe") diff --git a/resources/tester/test_m02_precombo_class.py b/resources/tester/test_m02_precombo_class.py index 9208ab004..24a261c5c 100644 --- a/resources/tester/test_m02_precombo_class.py +++ b/resources/tester/test_m02_precombo_class.py @@ -15,7 +15,9 @@ M02 = ROOT / "M02_MasterTemplete" def test_분류는_구조물군_종류_공통(): - defn = json.loads((ROOT / "resources/master_template/구조물정의.json").read_text("utf-8")) + defn = json.loads( + (ROOT / "resources/master_data/구조물정의/구조물정의.json").read_text("utf-8") + ) proc = subprocess.run( ["node", os.path.join(HERE, "helper_m02_precombo_scope.cjs")], input=json.dumps({"rows": [], "def": defn}, ensure_ascii=False), diff --git a/resources/tester/test_m02_structure_definition.py b/resources/tester/test_m02_structure_definition.py index e41e9247b..cde60f342 100644 --- a/resources/tester/test_m02_structure_definition.py +++ b/resources/tester/test_m02_structure_definition.py @@ -3,7 +3,7 @@ 못박는 것 - 판 1 = 옛 레지스트리 그대로 옮김(37종 · 옵션 235 · 키 그대로) · 검사 통과. - 읽기 = 로그인 누구나 · 쓰기 = 시스템 관리자만(403). - - 저장마다 판 +1(지금 판에서) · 앞 판은 `구조물정의_이력/판_N.json` · 낡은 판 409 · 틀린 정의 422(안 씀). + - 저장마다 판 +1(지금 판에서) · 앞 판은 `구조물정의/이력/판_N.json` · 낡은 판 409 · 틀린 정의 422(안 씀). - 검사 = 키 겹침 · 꼴 · 규칙 대상 있음 · 그룹 형상. - 저장한 정의를 `/structure-types` 가 바로 읽음 · 프로젝트 저장에 정의 판 · 없는 키 값 보존. """ @@ -81,13 +81,13 @@ def test_저장마다_판_더하기_1_앞_판은_이력_structure_types_가_바 res = admin.put(URL, json={"판": v, "정의": doc}) assert res.status_code == 200, res.text assert res.json()["판"] == v + 1 - old = json.loads((copy.parent / "구조물정의_이력" / f"판_{v}.json").read_text("utf-8")) + old = json.loads((copy.parent / "이력" / f"판_{v}.json").read_text("utf-8")) assert old["판"] == v and old["types"][0]["name"] != "이름 바꿈" seen = {t["type_id"]: t for t in admin.get(TYPES).json()["types"]} assert seen[tid]["name"] == "이름 바꿈" and len(seen) == len(doc["types"]) assert admin.put(URL, json={"판": v, "정의": doc}).status_code == 409 # 낡은 판 assert admin.put(URL, json={"판": v + 1, "정의": res.json()}).json()["판"] == v + 2 - assert (copy.parent / "구조물정의_이력" / f"판_{v + 1}.json").is_file() + assert (copy.parent / "이력" / f"판_{v + 1}.json").is_file() def _rule(doc: dict) -> tuple[str, dict, dict]: @@ -143,7 +143,7 @@ def test_검사_키_겹침_꼴_규칙_대상_형상(copy) -> None: res = admin.put(URL, json={"판": v, "정의": doc}) assert res.status_code == 422, (i, res.text) assert json.loads(copy.read_text("utf-8"))["판"] == v # 거절되면 안 씀 - assert not (copy.parent / "구조물정의_이력").exists() + assert not (copy.parent / "이력").exists() shaped = bad(종류={tid: {"기준측점": False}}) shaped["그룹"]["pipe"][0]["형상"] = {"길이": {"받기": True, "뜻": "관 길이"}} assert admin.put(URL, json={"판": v, "정의": shaped}).status_code == 200 diff --git a/resources/tester/ui_checks/48-1_구조물정의_읽기.js b/resources/tester/ui_checks/48-1_구조물정의_읽기.js index b66fdfe35..9494ce4e2 100644 --- a/resources/tester/ui_checks/48-1_구조물정의_읽기.js +++ b/resources/tester/ui_checks/48-1_구조물정의_읽기.js @@ -1,4 +1,4 @@ -/* 48-1 — 구조물 정의 한 벌(resources/master_template/구조물정의.json)로 옮긴 뒤 화면 변화 0 +/* 48-1 — 구조물 정의 한 벌(resources/master_data/구조물정의/구조물정의.json)로 옮긴 뒤 화면 변화 0 * 시작 화면: M02 마스터 템플릿 · 마스터 층(#/m02-master-template?root=master) · 시스템 관리자 · 저장 안 함 * 부르는 법: orca eval --expression "$(cat 이 파일)" (async 식 · JSON 글을 돌려줌) * 기대 수치: