From e4b9b3e5a32fb6cf822c5e3cb6dedb47d8a369a6 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Wed, 18 Nov 2026 21:42:33 +0900 Subject: [PATCH] =?UTF-8?q?refactor(859-5=20=E2=91=A1):=20=EA=B5=AC?= =?UTF-8?q?=EC=A1=B0=EB=AC=BC=20=EC=A0=95=EC=9D=98=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?M02=20StructOptions=20=E2=86=92=20M01=5FMasterData/StructOption?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 파일 23 개 git mv · 이름 M02_SO_* → M01_SO_* · 내용 · 동작 · 화면 글 그대로 - 서버 주소 /api/m02 → /api/m01(이름만 · 10 길 · 수 469 그대로) · main.py 등록 이름 m01_so_* - 화면 부름 = common_util_m02_call 의 call 에 base 인자(기본 /m02 · 구조물 정의만 /m01) - import 고침 = B05 · B07 · B08 · M01 · M02 · main · 시험 · 도우미 - 소스 글자만 보던 시험 셋 지움(구조물 정의 옮김에 걸림 · 결과를 안 봄): test_m02_structure_options 좌측 줄 · test_m02_structure_option_groups 좌측 정의 줄 · test_136_3 M02 미리보기 단추 CSS - test_553_5 부품 훑기 폴더 = 옮긴 자리 Co-Authored-By: Claude Opus 5.5 --- .../B05_Profile_Engine_Sections_Node.py | 2 +- .../B05_Profile_Structures_Repository.py | 2 +- B05_Profile/B05_Profile_Structures_Router.py | 2 +- B05_Profile/B05_Profile_Structures_Schema.py | 2 +- ...B07_DesignDetail_Engine_Cad_CulvertNote.py | 2 +- B08_Quantity/B08_Quantity_Router_Summary.py | 4 +- M01_MasterData/M01_MasterData_UI_Page.ts | 2 +- M01_MasterData/M01_MasterData_UI_Side.ts | 7 +--- .../StructOptions/M01_SO_Api.ts | 12 ++++-- .../StructOptions/M01_SO_Check.py | 4 +- .../StructOptions/M01_SO_Def.ts | 38 +++++++++---------- .../StructOptions/M01_SO_Def_Add.ts | 4 +- .../StructOptions/M01_SO_Def_Check.ts | 6 +-- .../StructOptions/M01_SO_Def_Layout.ts | 8 ++-- .../StructOptions/M01_SO_Def_Model.ts | 4 +- .../StructOptions/M01_SO_Def_Options.ts | 12 +++--- .../StructOptions/M01_SO_Def_Parts.ts | 10 ++--- .../StructOptions/M01_SO_Def_Reflect.ts | 6 +-- .../StructOptions/M01_SO_Def_Rules.ts | 8 ++-- .../StructOptions/M01_SO_Def_Spec.ts | 12 +++--- .../StructOptions/M01_SO_Def_Spec_Model.ts | 4 +- .../StructOptions/M01_SO_Def_Table.ts | 12 +++--- .../StructOptions/M01_SO_Def_Ui.ts | 6 +-- .../StructOptions/M01_SO_Definition.py | 8 ++-- .../StructOptions/M01_SO_Groups.py | 6 +-- .../StructOptions/M01_SO_Groups.ts | 12 +++--- .../StructOptions/M01_SO_Options.py | 10 ++--- .../StructOptions/M01_SO_Options.ts | 10 ++--- .../StructOptions/M01_SO_Router.py | 12 +++--- .../StructOptions/M01_SO_Style.css | 0 .../StructOptions/M01_SO_Text.ts | 2 +- M02_MasterTemplete/M02_Item_Snapshot.py | 2 +- .../M02_MasterTemplete_Labor_LibMeta.ts | 2 +- .../M02_MasterTemplete_Labor_Pick.ts | 2 +- .../M02_MasterTemplete_UI_Side_Precombo.ts | 2 +- M02_MasterTemplete/M02_Table_Fill.py | 2 +- common_util/common_util_m02_call.ts | 6 +-- common_util/common_util_summary_item.py | 2 +- main.py | 10 ++--- resources/tester/helper_322_2_check.cjs | 8 ++-- resources/tester/helper_323_7_new_type.cjs | 8 ++-- resources/tester/helper_m02_so_def_model.cjs | 4 +- resources/tester/helper_m02_so_def_spec.cjs | 4 +- .../tester/test_120_b08_drain_summary.py | 2 +- .../tester/test_129_menu_equals_panel.py | 4 +- resources/tester/test_131_b08_material_fix.py | 2 +- resources/tester/test_136_3_remove_button.py | 7 ---- .../tester/test_143_1_b08_linked_snapshots.py | 2 +- .../tester/test_143_2_b08_blank_values.py | 2 +- .../tester/test_154_2_b08_direct_link.py | 2 +- resources/tester/test_156_1_b08_unlink.py | 2 +- resources/tester/test_166_1_note_options.py | 2 +- .../tester/test_211_1_inlet_revet_height.py | 2 +- resources/tester/test_322_0_golden.py | 2 +- resources/tester/test_322_0_version.py | 8 ++-- resources/tester/test_322_2_check_mirror.py | 6 +-- resources/tester/test_322_3_plan_mirror.py | 2 +- resources/tester/test_323_4_attach_mirror.py | 2 +- resources/tester/test_323_7_new_type.py | 2 +- .../tester/test_52_6_cross_underdrain.py | 2 +- resources/tester/test_52_7_safety.py | 2 +- resources/tester/test_52_9_spoil_borrow.py | 8 ++-- resources/tester/test_54_26_slope_table09.py | 10 ++--- resources/tester/test_54_6_slope_container.py | 8 ++-- resources/tester/test_553_5_m01_m02.py | 8 +++- .../tester/test_701_1_b08_wall_summary.py | 2 +- resources/tester/test_98_b08_pipe_summary.py | 2 +- resources/tester/test_m02_empty_master.py | 4 +- resources/tester/test_m02_so_def_model.py | 4 +- resources/tester/test_m02_so_def_spec.py | 2 +- .../tester/test_m02_structure_def_screen.py | 6 +-- .../tester/test_m02_structure_definition.py | 8 ++-- .../test_m02_structure_option_groups.py | 15 ++------ .../tester/test_m02_structure_options.py | 22 ++--------- resources/tester/test_m02_system_read.py | 4 +- .../tester/test_structure_group_items.py | 2 +- .../test_structures_summary_snapshot.py | 2 +- 77 files changed, 207 insertions(+), 234 deletions(-) rename M02_MasterTemplete/StructOptions/M02_SO_Api.ts => M01_MasterData/StructOptions/M01_SO_Api.ts (77%) rename M02_MasterTemplete/StructOptions/M02_SO_Check.py => M01_MasterData/StructOptions/M01_SO_Check.py (98%) rename M02_MasterTemplete/StructOptions/M02_SO_Def.ts => M01_MasterData/StructOptions/M01_SO_Def.ts (93%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Add.ts => M01_MasterData/StructOptions/M01_SO_Def_Add.ts (96%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Check.ts => M01_MasterData/StructOptions/M01_SO_Def_Check.ts (98%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Layout.ts => M01_MasterData/StructOptions/M01_SO_Def_Layout.ts (96%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Model.ts => M01_MasterData/StructOptions/M01_SO_Def_Model.ts (99%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Options.ts => M01_MasterData/StructOptions/M01_SO_Def_Options.ts (97%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Parts.ts => M01_MasterData/StructOptions/M01_SO_Def_Parts.ts (95%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Reflect.ts => M01_MasterData/StructOptions/M01_SO_Def_Reflect.ts (98%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Rules.ts => M01_MasterData/StructOptions/M01_SO_Def_Rules.ts (98%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Spec.ts => M01_MasterData/StructOptions/M01_SO_Def_Spec.ts (95%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Spec_Model.ts => M01_MasterData/StructOptions/M01_SO_Def_Spec_Model.ts (98%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Table.ts => M01_MasterData/StructOptions/M01_SO_Def_Table.ts (97%) rename M02_MasterTemplete/StructOptions/M02_SO_Def_Ui.ts => M01_MasterData/StructOptions/M01_SO_Def_Ui.ts (97%) rename M02_MasterTemplete/StructOptions/M02_SO_Definition.py => M01_MasterData/StructOptions/M01_SO_Definition.py (97%) rename M02_MasterTemplete/StructOptions/M02_SO_Groups.py => M01_MasterData/StructOptions/M01_SO_Groups.py (96%) rename M02_MasterTemplete/StructOptions/M02_SO_Groups.ts => M01_MasterData/StructOptions/M01_SO_Groups.ts (96%) rename M02_MasterTemplete/StructOptions/M02_SO_Options.py => M01_MasterData/StructOptions/M01_SO_Options.py (94%) rename M02_MasterTemplete/StructOptions/M02_SO_Options.ts => M01_MasterData/StructOptions/M01_SO_Options.ts (91%) rename M02_MasterTemplete/StructOptions/M02_SO_Router.py => M01_MasterData/StructOptions/M01_SO_Router.py (91%) rename M02_MasterTemplete/StructOptions/M02_SO_Style.css => M01_MasterData/StructOptions/M01_SO_Style.css (100%) rename M02_MasterTemplete/StructOptions/M02_SO_Text.ts => M01_MasterData/StructOptions/M01_SO_Text.ts (99%) diff --git a/B05_Profile/B05_Profile_Engine_Sections_Node.py b/B05_Profile/B05_Profile_Engine_Sections_Node.py index 58052d8f0..e8e826693 100644 --- a/B05_Profile/B05_Profile_Engine_Sections_Node.py +++ b/B05_Profile/B05_Profile_Engine_Sections_Node.py @@ -47,7 +47,7 @@ def plan_structure(item: Any) -> dict[str, Any]: def structure_table() -> tuple[list[dict[str, Any]], dict[str, Any]]: """구조물 종류(`/projects/structure-types` 꼴) · 정의(화면 `useCatalogDefinition` 꼴).""" from B05_Profile.B05_Profile_Structures_Schema import _read_definition, _stamp - from M02_MasterTemplete.StructOptions.M02_SO_Options import with_visible + from M01_MasterData.StructOptions.M01_SO_Options import with_visible types = [item.model_dump(mode="json") for item in with_visible().types] return types, {"types": types, **_read_definition(*_stamp())} diff --git a/B05_Profile/B05_Profile_Structures_Repository.py b/B05_Profile/B05_Profile_Structures_Repository.py index 7629a36a4..37c49f8e0 100644 --- a/B05_Profile/B05_Profile_Structures_Repository.py +++ b/B05_Profile/B05_Profile_Structures_Repository.py @@ -18,7 +18,7 @@ from B05_Profile.B05_Profile_Structures_Schema import ( structure_type_map, ) from common_util.common_util_json import atomic_write_json -from M02_MasterTemplete.StructOptions.M02_SO_Options import hidden_keys +from M01_MasterData.StructOptions.M01_SO_Options import hidden_keys STRUCTURES_FILE_NAME = "structures.json" _STAGE_DIR = os.path.join("B05_Profile", "route") diff --git a/B05_Profile/B05_Profile_Structures_Router.py b/B05_Profile/B05_Profile_Structures_Router.py index 7a99051da..ca252531d 100644 --- a/B05_Profile/B05_Profile_Structures_Router.py +++ b/B05_Profile/B05_Profile_Structures_Router.py @@ -51,7 +51,7 @@ from common_util.common_util_route_follow import ( from common_util.common_util_storage import resolve_stored_project_path from common_util.common_util_structure_station import SAME_STATION_M, plan_stations from config.config_db import get_db_pool -from M02_MasterTemplete.StructOptions.M02_SO_Options import TypesWithVisible, with_visible +from M01_MasterData.StructOptions.M01_SO_Options import TypesWithVisible, with_visible logger = logging.getLogger(__name__) diff --git a/B05_Profile/B05_Profile_Structures_Schema.py b/B05_Profile/B05_Profile_Structures_Schema.py index 0a2f51fea..cf1ca6107 100644 --- a/B05_Profile/B05_Profile_Structures_Schema.py +++ b/B05_Profile/B05_Profile_Structures_Schema.py @@ -159,7 +159,7 @@ def is_station_planting_type(item: StructureType) -> bool: return row is not None and row["station"] != "none" -#: 지난 판 정의(`판_N.json`) 폴더 — 정본 옆(M02 `M02_SO_Definition.HISTORY` 와 같은 이름) +#: 지난 판 정의(`판_N.json`) 폴더 — 정본 옆(M02 `M01_SO_Definition.HISTORY` 와 같은 이름) HISTORY_DIRNAME = "구조물정의_이력" diff --git a/B07_DesignDetail/B07_DesignDetail_Engine_Cad_CulvertNote.py b/B07_DesignDetail/B07_DesignDetail_Engine_Cad_CulvertNote.py index 26e85673f..ffd2baa45 100644 --- a/B07_DesignDetail/B07_DesignDetail_Engine_Cad_CulvertNote.py +++ b/B07_DesignDetail/B07_DesignDetail_Engine_Cad_CulvertNote.py @@ -243,7 +243,7 @@ def with_option_lines(things: list[Thing]) -> list[Thing]: return things try: # 지연 import — M02 정의 저장소가 B07 엔진 import 차례에 끼지 않게 - from M02_MasterTemplete.StructOptions.M02_SO_Options import with_visible + from M01_MasterData.StructOptions.M01_SO_Options import with_visible payload = { "things": [ diff --git a/B08_Quantity/B08_Quantity_Router_Summary.py b/B08_Quantity/B08_Quantity_Router_Summary.py index 2e0051722..011bfb44d 100644 --- a/B08_Quantity/B08_Quantity_Router_Summary.py +++ b/B08_Quantity/B08_Quantity_Router_Summary.py @@ -52,15 +52,15 @@ from B06_Section.B06_Section_Repository import ( ) from B08_Quantity.B08_Quantity_Router_Hydro import _project_root from B08_Quantity.B08_Quantity_Summary_Sheet import _linked, _Sheet, unlinked_facilities -from common_util.common_util_structure_catalog import type_ids_with from common_util.common_util_drainage_pipes import pipe_points_path_in, read_pipe_points_file +from common_util.common_util_structure_catalog import type_ids_with from common_util.common_util_summary_item import GROUP_JOIN from config.config_db import get_db_pool +from M01_MasterData.StructOptions import M01_SO_Definition as definition from M02_MasterTemplete import M02_Item_Snapshot as snapshots from M02_MasterTemplete import M02_Table_Fill as fill from M02_MasterTemplete import M02_Template_Layers as layers from M02_MasterTemplete.M02_Table_Fill_Spec import soil_tiers_from_designs -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition router = APIRouter(prefix="/api/projects", tags=["B08 Summary"]) diff --git a/M01_MasterData/M01_MasterData_UI_Page.ts b/M01_MasterData/M01_MasterData_UI_Page.ts index b25f37b62..72981087e 100644 --- a/M01_MasterData/M01_MasterData_UI_Page.ts +++ b/M01_MasterData/M01_MasterData_UI_Page.ts @@ -1,7 +1,7 @@ /* ============================================================================= * M01_MasterData_UI_Page.ts * 마스터 요소 화면 — 좌측 도킹 패널(컨테이너: 인력·재료·기계·소요량·계수·환율·요율·단가산출 로직) - * · 일위대가 조합은 M02 마스터 템플릿(PLAN 27-2b) · 구조물 옵션 정의(716-1 · 화면은 M02 `StructOptions/`) + * · 일위대가 조합은 M02 마스터 템플릿(PLAN 27-2b) · 구조물 옵션 정의(716-1 · 859-5 화면 · 서버 = `StructOptions/`) * / 우측 요소 표 · 표 목록 · 로직 편집 · 옵션 정의 · 별칭 모아 보기(815-2) · * 주소 `?open=로직|옵션|별칭` = 그 칸을 고른 채 열림(716-2) * diff --git a/M01_MasterData/M01_MasterData_UI_Side.ts b/M01_MasterData/M01_MasterData_UI_Side.ts index ab5a94c1a..c12cce4e6 100644 --- a/M01_MasterData/M01_MasterData_UI_Side.ts +++ b/M01_MasterData/M01_MasterData_UI_Side.ts @@ -2,7 +2,7 @@ * M01_MasterData_UI_Side.ts * 왼쪽 패널 — 공용 접기 컨테이너(`ui-collapsible ui-sidebar-section`) * 인력 · 재료 · 기계 · 소요량 · 계수 · 환율 · 요율 · 단가산출 로직(일위대가 조합은 M02 · PLAN 27-2b) - * ─ 구분선 ─ 구조물 옵션 정의(716-1 · 화면 코드는 M02 `StructOptions/` 그대로 · 입구만 여기) + * ─ 구분선 ─ 구조물 옵션 정의(716-1 · 화면 코드 = `StructOptions/`(859-5) · 입구만 여기) * · 별칭 모아 보기(815-2 · 누르면 본 칸에 별칭이 적힌 줄 · 승인 대기 · `M01_MasterData_UI_Alias`) * 펼치면 하위 목록(거름 · 파일) · 환율/요율은 누르면 바로 표 · 로직은 안에 로직 목록 * ========================================================================== */ @@ -11,10 +11,7 @@ import { createSelectField, el, showToast } from "@ui/ui_template_elements"; import { attachCollapsible } from "@ui/ui_template_collapsible"; import { createDivider } from "@ui/ui_template_divider"; import { currentLanguageIndex, t as L } from "@ui/ui_template_locale"; -import { - buildOptionsSection, - type OptionsSectionOptions, -} from "../M02_MasterTemplete/StructOptions/M02_SO_Options"; +import { buildOptionsSection, type OptionsSectionOptions } from "./StructOptions/M01_SO_Options"; import { ALIAS_TITLE, buildAliasBoard, type AliasRow } from "./M01_MasterData_UI_Alias"; import { fetchFiles, fetchSubsAll, type FileInfo, type SubInfo } from "./M01_MasterData_Api_Fetch"; import { tx } from "./M01_MasterData_UI_Logic_Text"; diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Api.ts b/M01_MasterData/StructOptions/M01_SO_Api.ts similarity index 77% rename from M02_MasterTemplete/StructOptions/M02_SO_Api.ts rename to M01_MasterData/StructOptions/M01_SO_Api.ts index a91a2578f..f9597bacd 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Api.ts +++ b/M01_MasterData/StructOptions/M01_SO_Api.ts @@ -1,10 +1,14 @@ /* ============================================================================= - * M02_SO_Api.ts - * 구조물 정의 서버 호출 — 서버 = `M02_SO_Router.py`(마스터 템플릿 `구조물정의.json` 한 벌 · PLAN 48) + * M01_SO_Api.ts + * 구조물 정의 서버 호출 — 서버 = `M01_SO_Router.py`(마스터 템플릿 `구조물정의.json` 한 벌 · PLAN 48) * ========================================================================== */ -import { call } from "../M02_MasterTemplete_Api_Fetch"; -import type { StructDef } from "./M02_SO_Def_Model"; +import { call as callApi } from "../../common_util/common_util_m02_call"; +import type { StructDef } from "./M01_SO_Def_Model"; + +/** `/api/m01` 아래 길 부름 */ +const call = (path: string, init: RequestInit = {}): Promise => + callApi(path, init, "/m01"); /* --- 구조물 정의(PLAN 48 · 마스터 템플릿 `구조물정의.json` · 판 번호 · 이력) --- */ diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Check.py b/M01_MasterData/StructOptions/M01_SO_Check.py similarity index 98% rename from M02_MasterTemplete/StructOptions/M02_SO_Check.py rename to M01_MasterData/StructOptions/M01_SO_Check.py index 90cde5083..22daaf562 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Check.py +++ b/M01_MasterData/StructOptions/M01_SO_Check.py @@ -7,7 +7,7 @@ 그림이 늘 기본값을 씀 · 앞 판에서 이미 숨긴 칸은 그대로 둠) - 앞 판이 없으면(옛 판 읽기) 꼴만 검사 - 앞 판과 비교 — 종류 지우기 없음 · 자리꼴 · 정본 · 군 글자 고정 · 선택지 값 고정(이름은 이름 표로) -화면 짝 = `M02_SO_Def_Check.ts`(같은 글) +화면 짝 = `M01_SO_Def_Check.ts`(같은 글) 거울 시험 = `resources/tester/test_322_2_check_mirror.py`. """ @@ -19,7 +19,7 @@ from typing import Any from common_util.common_util_structure_catalog import load_parts, resolve_catalog BRANCHES = ("횡단도", "카드이름", "형상", "3D") -# 화면 글(322-2 다듬기 · TS `M02_SO_Def_Reflect` 짝) — 자리꼴 · 정본 한국어 · 부품 짧은 이름 +# 화면 글(322-2 다듬기 · TS `M01_SO_Def_Reflect` 짝) — 자리꼴 · 정본 한국어 · 부품 짧은 이름 PLACE_KO = {"point": "점", "interval": "구간", "site": "터"} OWNER_KO = {"pipe_points": "관 지점", "structures": "구조물"} diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def.ts b/M01_MasterData/StructOptions/M01_SO_Def.ts similarity index 93% rename from M02_MasterTemplete/StructOptions/M02_SO_Def.ts rename to M01_MasterData/StructOptions/M01_SO_Def.ts index ac10f3f04..49926f30b 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def.ts @@ -1,23 +1,23 @@ /* ============================================================================= - * M02_SO_Def.ts + * M01_SO_Def.ts * 구조물 정의 편집 화면(PLAN 48-2 · 메인 칸) — 탭 셋(322-2): 「한눈 표」(종류마다 반영 한 줄 · - * `M02_SO_Def_Table`) · 「종류별」(왼쪽 구조물군 · 종류 목록 · 오른쪽 고른 종류 이름 · 반영 · 명세 이름 나무 · - * 줄마다 보임 · 미리보기) · 「부품」(`M02_SO_Def_Parts`) · - * 아래 검사(화면 = 서버 짝 `M02_SO_Def_Check`) · [저장](판 +1 · 목록 + enabled 함께 · 시스템 관리자만) · + * `M01_SO_Def_Table`) · 「종류별」(왼쪽 구조물군 · 종류 목록 · 오른쪽 고른 종류 이름 · 반영 · 명세 이름 나무 · + * 줄마다 보임 · 미리보기) · 「부품」(`M01_SO_Def_Parts`) · + * 아래 검사(화면 = 서버 짝 `M01_SO_Def_Check`) · [저장](판 +1 · 목록 + enabled 함께 · 시스템 관리자만) · * 지난 판 목록(누르면 그 판을 읽기만으로 봄). * 다른 역할은 읽기만. 고칠 사본은 저장 전까지 서버에 안 감 · 정본 = `구조물정의.json`(48-1). * ========================================================================== */ import { createButton, createTag, el, showToast } from "@ui/ui_template_elements"; -import { StaleError } from "../M02_MasterTemplete_Api_Fetch"; +import { StaleError } from "../../common_util/common_util_m02_call"; import { fetchStructureDef, fetchStructureDefAt, fetchStructureDefHistory, saveStructureDef, type DefVersion, -} from "./M02_SO_Api"; -import { buildLayoutBlock } from "./M02_SO_Def_Layout"; +} from "./M01_SO_Api"; +import { buildLayoutBlock } from "./M01_SO_Def_Layout"; import { baseShown, clone, @@ -25,19 +25,19 @@ import { stepFamily, stepType, type StructDef, -} from "./M02_SO_Def_Model"; -import { buildOptionsBlock } from "./M02_SO_Def_Options"; -import { buildRulesBlock } from "./M02_SO_Def_Rules"; -import { buildSpecBlock } from "./M02_SO_Def_Spec"; +} from "./M01_SO_Def_Model"; +import { buildOptionsBlock } from "./M01_SO_Def_Options"; +import { buildRulesBlock } from "./M01_SO_Def_Rules"; +import { buildSpecBlock } from "./M01_SO_Def_Spec"; import { specFor } from "../../A00_Common/design/logic/design_structure_pipe"; -import { catalogProblems, type CheckDef } from "./M02_SO_Def_Check"; -import { buildParts } from "./M02_SO_Def_Parts"; -import { differs, setReflect, tidy } from "./M02_SO_Def_Reflect"; -import { buildReflectBlock, buildTable } from "./M02_SO_Def_Table"; -import { checkBox, pickBox, textBox } from "./M02_SO_Def_Ui"; -import { addFromTemplate, templates } from "./M02_SO_Def_Add"; -import { buildGroupBlock } from "./M02_SO_Groups"; -import { to } from "./M02_SO_Text"; +import { catalogProblems, type CheckDef } from "./M01_SO_Def_Check"; +import { buildParts } from "./M01_SO_Def_Parts"; +import { differs, setReflect, tidy } from "./M01_SO_Def_Reflect"; +import { buildReflectBlock, buildTable } from "./M01_SO_Def_Table"; +import { checkBox, pickBox, textBox } from "./M01_SO_Def_Ui"; +import { addFromTemplate, templates } from "./M01_SO_Def_Add"; +import { buildGroupBlock } from "./M01_SO_Groups"; +import { to } from "./M01_SO_Text"; import { createText } from "@ui/ui_template_text"; import { createEmpty } from "@ui/ui_template_empty"; import { createTabs } from "@ui/ui_template_tabs"; diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Add.ts b/M01_MasterData/StructOptions/M01_SO_Def_Add.ts similarity index 96% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Add.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Add.ts index ab0621376..df0bfcd71 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Add.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Add.ts @@ -1,5 +1,5 @@ /* ============================================================================= - * M02_SO_Def_Add.ts + * M01_SO_Def_Add.ts * 종류 더하기(PLAN 323-7) — 본보기(구조물 정본 원본 종류)를 그대로 복사한 새 종류. * * 키 자동(`{본보기}_xxxxxx` · 만든 뒤 안 바뀜) · 이름 「{본보기} 2」(겹치면 3 …) · 군 · 자리꼴 · 옵션 · 표시 · 그룹 · @@ -8,7 +8,7 @@ * 명세도 본보기 키로 고름(`baseType`). 관 지점 정본 종류는 본보기에서 뺌(관 시설 폼 · 정본 목록이 따로). * ========================================================================== */ -import { clone, newKey, type StructDef } from "./M02_SO_Def_Model"; +import { clone, newKey, type StructDef } from "./M01_SO_Def_Model"; /** 본보기로 고를 수 있는 종류 — 구조물 정본 · 원본(본보기 아님) · [키, 이름] (정의 차례). */ export const templates = (def: StructDef): Array<[string, string]> => diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Check.ts b/M01_MasterData/StructOptions/M01_SO_Def_Check.ts similarity index 98% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Check.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Check.ts index afbc38e80..8143b35af 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Check.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Check.ts @@ -1,5 +1,5 @@ /* ============================================================================= - * M02_SO_Def_Check.ts + * M01_SO_Def_Check.ts * 구조물 표 검사(PLAN 322-2 · 1-3 규칙) — 정의 `반영` · `부품` 꼴 · 표 줄과 부품이 맞음 · 만든 뒤 고정. * * · 반영 = `{종류: {목록 · 횡단도 · 카드이름 · 형상 · 형상칸 · 3D}}` · 값 = 부품 상자에 있는 것 @@ -9,7 +9,7 @@ * 그림이 늘 기본값을 씀 · 앞 판에서 이미 숨긴 칸은 그대로 둠) * · 앞 판이 없으면(옛 판 읽기) 꼴만 검사 * · 앞 판과 비교 — 종류 지우기 없음 · 자리꼴 · 정본 · 군 글자 고정 · 선택지 값 고정(이름은 이름 표로) - * 서버 짝 = `M02_SO_Check.py`(같은 글) · 거울 시험 = `resources/tester/test_322_2_check_mirror.py`. + * 서버 짝 = `M01_SO_Check.py`(같은 글) · 거울 시험 = `resources/tester/test_322_2_check_mirror.py`. * ========================================================================== */ import PARTS from "../../common_util/common_util_structure_parts.json" with { type: "json" }; @@ -17,7 +17,7 @@ import { resolveCatalog, type CatalogDefinition, } from "../../common_util/common_util_structure_catalog"; -import { OWNER_KO, PLACE_KO, shortName } from "./M02_SO_Def_Reflect"; +import { OWNER_KO, PLACE_KO, shortName } from "./M01_SO_Def_Reflect"; type Branch = "횡단도" | "카드이름" | "형상" | "3D"; interface Part { diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Layout.ts b/M01_MasterData/StructOptions/M01_SO_Def_Layout.ts similarity index 96% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Layout.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Layout.ts index d6e4338e0..bb735fbfe 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Layout.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Layout.ts @@ -1,5 +1,5 @@ /* ============================================================================= - * M02_SO_Def_Layout.ts + * M01_SO_Def_Layout.ts * 구조물 정의 편집 화면(PLAN 48-2) — 고른 종류의 **배치 격자**(B05 · B06 좌측 구조물 칸 = 두 칸) * 옵션마다 줄 · 칸 · 너비 + 미리보기(기준 측점은 맨 위 한 줄 · 겹치면 빨강). * 자리를 안 정한 옵션은 차례대로 빈 칸을 채움 · 숫자를 고치면 그 옵션 자리만 정의 `배치` 에 남음. @@ -15,9 +15,9 @@ import { type Spot, type StructDef, type TypeDef, -} from "./M02_SO_Def_Model"; -import { head, numberBox } from "./M02_SO_Def_Ui"; -import { to } from "./M02_SO_Text"; +} from "./M01_SO_Def_Model"; +import { head, numberBox } from "./M01_SO_Def_Ui"; +import { to } from "./M01_SO_Text"; export interface LayoutBlockOptions { def: StructDef; diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Model.ts b/M01_MasterData/StructOptions/M01_SO_Def_Model.ts similarity index 99% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Model.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Model.ts index b1bee5190..514d3efb6 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Model.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Model.ts @@ -1,5 +1,5 @@ /* ============================================================================= - * M02_SO_Def_Model.ts + * M01_SO_Def_Model.ts * 구조물 정의 편집 화면(PLAN 48-2)의 자료 꼴 · 순수 손질 함수 — 화면 그리기 없음. * 정본 = 마스터 템플릿 `구조물정의.json`(48-1 · 틀 `docs/raw/M02_구조물옵션정의/정의_틀.md`). * 키는 만들 때 자동 · 안 바뀜 · 이름 자유 · 지움 = 「안 씀」(`enabled: false`). @@ -226,7 +226,7 @@ export function overlaps(cells: Map): string[] { return [...bad]; } -/** 규칙 한 줄이 틀렸나 — 서버 검사(`M02_SO_Definition._rule_errors`)와 같은 뜻 */ +/** 규칙 한 줄이 틀렸나 — 서버 검사(`M01_SO_Definition._rule_errors`)와 같은 뜻 */ export function ruleBad(def: StructDef, r: RuleDef): boolean { const t = def.types.find((x) => x.type_id === r.종류); const src = t?.options.find((o) => o.key === r.만약.옵션); diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Options.ts b/M01_MasterData/StructOptions/M01_SO_Def_Options.ts similarity index 97% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Options.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Options.ts index d517a3bc6..a8dbbcc64 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Options.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Options.ts @@ -1,10 +1,10 @@ /* ============================================================================= - * M02_SO_Def_Options.ts + * M01_SO_Def_Options.ts * 구조물 정의 편집 화면(PLAN 48-2) — 고른 종류의 **옵션 목록** * (이름 · 꼴 · 단위 · 기본값 · 보이기 · 들어갈 자리 · 안 씀 · 순서 · [옵션 더함]) + * 고르기 꼴의 **선택지 목록**(이름 바꿈 · 빼기 · 순서 · [선택지 더함]). * 옵션 키는 더할 때 자동 · 안 바뀜 · 선택지는 글이 곧 값(이름 바꿈 = 기본값 · 규칙도 같이) · - * 저장은 화면 [저장](`M02_SO_Def.ts`). + * 저장은 화면 [저장](`M01_SO_Def.ts`). * ========================================================================== */ import { createButton, createTag, el, showConfirmDialog } from "@ui/ui_template_elements"; @@ -16,10 +16,10 @@ import { type OptionForm, type StructDef, type TypeDef, -} from "./M02_SO_Def_Model"; -import { checkBox, head, moveButtons, pickBox, textBox } from "./M02_SO_Def_Ui"; -import { buildPlaceSelect } from "./M02_SO_Groups"; -import { to } from "./M02_SO_Text"; +} from "./M01_SO_Def_Model"; +import { checkBox, head, moveButtons, pickBox, textBox } from "./M01_SO_Def_Ui"; +import { buildPlaceSelect } from "./M01_SO_Groups"; +import { to } from "./M01_SO_Text"; import { createText } from "@ui/ui_template_text"; import { createEmpty } from "@ui/ui_template_empty"; diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Parts.ts b/M01_MasterData/StructOptions/M01_SO_Def_Parts.ts similarity index 95% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Parts.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Parts.ts index 97cfc12b7..1877483b6 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Parts.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Parts.ts @@ -1,12 +1,12 @@ /* ============================================================================= - * M02_SO_Def_Parts.ts + * M01_SO_Def_Parts.ts * 구조물 정의 「부품」 탭(PLAN 322-2) — 코드가 그리는 방법(부품 상자 `common_util_structure_parts.json`). * 갈래마다 부품 · 이름 · 읽는 칸 · 맞는 자리꼴 · 정본 · 쓰는 종류 · 켬/끔(정의 `부품` = 끈 것만). * 끈 부품을 쓰는 종류는 그 갈래가 없음(카드 이름은 종류 이름)으로 — 표 줄(`resolveCatalog`)이 따름. * ========================================================================== */ import { el } from "@ui/ui_template_elements"; -import type { StructDef } from "./M02_SO_Def_Model"; +import type { StructDef } from "./M01_SO_Def_Model"; import { OWNER_KO, PART_BOX, @@ -15,9 +15,9 @@ import { setPartOn, shortName, usersOf, -} from "./M02_SO_Def_Reflect"; -import { checkBox, head } from "./M02_SO_Def_Ui"; -import { to } from "./M02_SO_Text"; +} from "./M01_SO_Def_Reflect"; +import { checkBox, head } from "./M01_SO_Def_Ui"; +import { to } from "./M01_SO_Text"; import { createText } from "@ui/ui_template_text"; type Branch = keyof typeof PART_BOX; diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Reflect.ts b/M01_MasterData/StructOptions/M01_SO_Def_Reflect.ts similarity index 98% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Reflect.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Reflect.ts index 295f569df..a57f2c7e6 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Reflect.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Reflect.ts @@ -1,5 +1,5 @@ /* ============================================================================= - * M02_SO_Def_Reflect.ts + * M01_SO_Def_Reflect.ts * 구조물 표 편집(PLAN 322-2)의 순수 손질 — 정의 사본의 `반영` · `부품` · 목록 + enabled · 형상칸. * * · 지금 값 = 구조물 표 한 줄(`resolveCatalog` · 정의 반영 ⊕ 처음값 ⊕ 부품 끔) @@ -14,7 +14,7 @@ import { type CatalogDefinition, type CatalogRow, } from "../../common_util/common_util_structure_catalog"; -import { clone, type StructDef } from "./M02_SO_Def_Model"; +import { clone, type StructDef } from "./M01_SO_Def_Model"; export type ReflectField = "목록" | "횡단도" | "카드이름" | "형상" | "3D"; type Reflect = Partial> & { 형상칸?: Record }; @@ -126,7 +126,7 @@ export function setPartOn(def: StructDef, key: string, on: boolean): void { } /** 못 숨김 칸 — 종류가 지금 쓰는 부품들이 읽는 칸 중 기본값도 비워 두는 뜻도 없는 옵션 - * (숨기면 그림이 받을 값이 없음 · 검사 짝 `M02_SO_Def_Check`). */ + * (숨기면 그림이 받을 값이 없음 · 검사 짝 `M01_SO_Def_Check`). */ export function readKeys(def: StructDef, typeId: string): Set { const row = rowsOf(def).get(typeId); if (!row) return new Set(); diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Rules.ts b/M01_MasterData/StructOptions/M01_SO_Def_Rules.ts similarity index 98% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Rules.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Rules.ts index 72d9786b1..d190da496 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Rules.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Rules.ts @@ -1,5 +1,5 @@ /* ============================================================================= - * M02_SO_Def_Rules.ts + * M01_SO_Def_Rules.ts * 구조물 정의 편집 화면(PLAN 48-2) — 고른 종류의 **규칙 표**(정의 `규칙` 중 그 종류 것만) * 「만약 상위 옵션 = 값들 중 하나 → 하위 옵션의 선택지 · 보이기 · 기본값」 한 줄씩 · [규칙 더함] · 지우기. * 「그대로」 칸은 정의에 안 남김 · 셋 다 그대로면 틀린 줄(빨강) · 적용은 B05 · B06(48-4). @@ -13,9 +13,9 @@ import { type RuleDef, type StructDef, type TypeDef, -} from "./M02_SO_Def_Model"; -import { head, pickBox } from "./M02_SO_Def_Ui"; -import { to } from "./M02_SO_Text"; +} from "./M01_SO_Def_Model"; +import { head, pickBox } from "./M01_SO_Def_Ui"; +import { to } from "./M01_SO_Text"; import { createEmpty } from "@ui/ui_template_empty"; import { createCheckbox } from "@ui/ui_template_checkbox"; diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Spec.ts b/M01_MasterData/StructOptions/M01_SO_Def_Spec.ts similarity index 95% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Spec.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Spec.ts index 656484957..7c8a6ecde 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Spec.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Spec.ts @@ -1,5 +1,5 @@ /* ============================================================================= - * M02_SO_Def_Spec.ts + * M01_SO_Def_Spec.ts * 구조물 명세가 있는 종류(PLAN 52 · `STRUCTURE_SPECS`)의 이름 고치기 칸(52-11) — 나무 꼴 * 컨테이너 제목 › 항목 이름 › 값 이름 · 이름만 고침 · 키 · 필수/선택 · 꼴은 읽기만 · * 아래 미리보기 = B05 · B06 이 그리는 같은 명세 폼(`createSpecForm`)에 고친 이름을 얹음. @@ -18,16 +18,16 @@ import { } from "../../A00_Common/design/logic/design_structure_spec"; import { group } from "../../B05_Profile/B05_Profile_UI_Drainage_Facility_Fields"; import { field, optionControl } from "../../B05_Profile/B05_Profile_UI_Structures_Fields"; -import type { StructDef, TypeDef } from "./M02_SO_Def_Model"; +import type { StructDef, TypeDef } from "./M01_SO_Def_Model"; import { groupNameRows, setSpecName, specNameRows, type SpecNameRow, -} from "./M02_SO_Def_Spec_Model"; -import { hiddenKeys, readKeys, setShown } from "./M02_SO_Def_Reflect"; -import { checkBox, head, textBox } from "./M02_SO_Def_Ui"; -import { to, type OptionsTextKey } from "./M02_SO_Text"; +} from "./M01_SO_Def_Spec_Model"; +import { hiddenKeys, readKeys, setShown } from "./M01_SO_Def_Reflect"; +import { checkBox, head, textBox } from "./M01_SO_Def_Ui"; +import { to, type OptionsTextKey } from "./M01_SO_Text"; import { createEmpty } from "@ui/ui_template_empty"; const TAG: Record, OptionsTextKey> = { diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Spec_Model.ts b/M01_MasterData/StructOptions/M01_SO_Def_Spec_Model.ts similarity index 98% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Spec_Model.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Spec_Model.ts index 3178030f3..b7bab4f35 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Spec_Model.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Spec_Model.ts @@ -1,5 +1,5 @@ /* ============================================================================= - * M02_SO_Def_Spec_Model.ts + * M01_SO_Def_Spec_Model.ts * 구조물 명세(PLAN 52 · `design_structure_spec`) 이름 고치기(52-11)의 자료 손질 — 화면 그리기 없음. * * · 명세 = 구조 정본(키 · 컨테이너 · 필수/선택 · 꼴) — 여기서는 **이름만** 고침 @@ -12,7 +12,7 @@ * ========================================================================== */ import type { StructureSpec } from "../../A00_Common/design/logic/design_structure_spec"; -import type { StructDef, TypeDef } from "./M02_SO_Def_Model"; +import type { StructDef, TypeDef } from "./M01_SO_Def_Model"; export interface SpecNameRow { /** 0 = 컨테이너 · 1 = 항목 · 2 = 값 */ diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Table.ts b/M01_MasterData/StructOptions/M01_SO_Def_Table.ts similarity index 97% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Table.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Table.ts index d6145c6e4..e01e68eee 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Table.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Table.ts @@ -1,14 +1,14 @@ /* ============================================================================= - * M02_SO_Def_Table.ts + * M01_SO_Def_Table.ts * 구조물 정의 「한눈 표」 탭(PLAN 322-2) — 종류마다 B05 · B06 반영 한 줄. * 군 · 종류(▲▼) · 이름 · 목록 · 자리꼴 · 정본(읽기만 「고정」) · 횡단도 · 카드 이름 · 형상(+ 형상칸) · * 알약 색 · 3D · 검사. 흐린 칸 = 처음 값(「기본」) · 진한 칸 = 바꾼 값 · [처음 값으로] = 그 종류 반영 지움. - * 칸 손질 = `M02_SO_Def_Reflect` · 검사 글 = `M02_SO_Def_Check`(서버 짝) · 「종류별」 탭이 같은 칸(`reflectCells`)을 씀. + * 칸 손질 = `M01_SO_Def_Reflect` · 검사 글 = `M01_SO_Def_Check`(서버 짝) · 「종류별」 탭이 같은 칸(`reflectCells`)을 씀. * ========================================================================== */ import { createButton, createTag, el } from "@ui/ui_template_elements"; import type { CatalogRow } from "../../common_util/common_util_structure_catalog"; -import { stepFamily, stepType, type StructDef, type TypeDef } from "./M02_SO_Def_Model"; +import { stepFamily, stepType, type StructDef, type TypeDef } from "./M01_SO_Def_Model"; import { REVET_FORMS } from "../../B06_Section/logic/B06_Section_UI_Cross_Culvert_Const"; import { isSet, @@ -22,9 +22,9 @@ import { setShapeOpt, valueOf, type ReflectField, -} from "./M02_SO_Def_Reflect"; -import { checkBox, pickBox, textBox } from "./M02_SO_Def_Ui"; -import { to } from "./M02_SO_Text"; +} from "./M01_SO_Def_Reflect"; +import { checkBox, pickBox, textBox } from "./M01_SO_Def_Ui"; +import { to } from "./M01_SO_Text"; import { createText } from "@ui/ui_template_text"; type Pairs = ReadonlyArray; diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Def_Ui.ts b/M01_MasterData/StructOptions/M01_SO_Def_Ui.ts similarity index 97% rename from M02_MasterTemplete/StructOptions/M02_SO_Def_Ui.ts rename to M01_MasterData/StructOptions/M01_SO_Def_Ui.ts index 879d6ca7c..e3d5587e1 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Def_Ui.ts +++ b/M01_MasterData/StructOptions/M01_SO_Def_Ui.ts @@ -1,12 +1,12 @@ /* ============================================================================= - * M02_SO_Def_Ui.ts + * M01_SO_Def_Ui.ts * 구조물 정의 편집 화면(PLAN 48-2)의 작은 입력 부품 — 글 · 숫자 · 체크 · 고르기 · 위아래 단추. * 값은 받은 손잡이로 사본만 고침 · 글은 칸을 떠날 때(`change`) 다시 그림(초점 안 끊김). * ========================================================================== */ import { createButton, el } from "@ui/ui_template_elements"; -import { step } from "./M02_SO_Def_Model"; -import { to } from "./M02_SO_Text"; +import { step } from "./M01_SO_Def_Model"; +import { to } from "./M01_SO_Text"; import { createText } from "@ui/ui_template_text"; import { createCheckbox } from "@ui/ui_template_checkbox"; diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Definition.py b/M01_MasterData/StructOptions/M01_SO_Definition.py similarity index 97% rename from M02_MasterTemplete/StructOptions/M02_SO_Definition.py rename to M01_MasterData/StructOptions/M01_SO_Definition.py index 925aa90d2..bcae25fd8 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Definition.py +++ b/M01_MasterData/StructOptions/M01_SO_Definition.py @@ -17,12 +17,12 @@ from pydantic import ValidationError from B05_Profile import B05_Profile_Structures_Schema as schema from common_util.common_util_json import atomic_write_json from common_util.common_util_time import utc_from_timestamp +from M01_MasterData.StructOptions.M01_SO_Check import catalog_errors from M02_MasterTemplete import M02_MasterTemplete_Store as store -from M02_MasterTemplete.StructOptions.M02_SO_Check import catalog_errors FILE = "구조물정의.json" HISTORY = "구조물정의_이력" -# 반영 · 부품 = 구조물 표 칸(322-2 · 없으면 처음값 · 검사 = `M02_SO_Check`) +# 반영 · 부품 = 구조물 표 칸(322-2 · 없으면 처음값 · 검사 = `M01_SO_Check`) TOP = {"판", "schema_version", "comment", "구조물군", "동작", "types", "반영", "부품"} SECTIONS = {"종류": dict, "표시": dict, "그룹": dict, "배치": dict, "규칙": list} SPOT = ("줄", "칸", "너비") @@ -180,8 +180,8 @@ def _rule_errors(doc: dict[str, Any], keys: dict[str, dict[str, Any]]) -> list[s def check(doc: Any, before: dict[str, Any] | None = None) -> list[str]: """정의 한 벌 검사 — 틀린 것 목록(빈 목록 = 통과). `before` = 지금 판(만든 뒤 고정 · 322-2).""" - from M02_MasterTemplete.StructOptions import M02_SO_Groups as groups - from M02_MasterTemplete.StructOptions import M02_SO_Options as options + from M01_MasterData.StructOptions import M01_SO_Groups as groups + from M01_MasterData.StructOptions import M01_SO_Options as options if not isinstance(doc, dict): return ["정의는 묶음이어야 함"] diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Groups.py b/M01_MasterData/StructOptions/M01_SO_Groups.py similarity index 96% rename from M02_MasterTemplete/StructOptions/M02_SO_Groups.py rename to M01_MasterData/StructOptions/M01_SO_Groups.py index f103f8edc..20d31631b 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Groups.py +++ b/M01_MasterData/StructOptions/M01_SO_Groups.py @@ -1,6 +1,6 @@ """M02 구조물 옵션 그룹 — 구조물 종류 안에 이름 붙은 묶음(PLAN 46-2). -정본 = 구조물 정의 한 벌(`M02_SO_Definition` · PLAN 48-1)의 「그룹」 칸 = +정본 = 구조물 정의 한 벌(`M01_SO_Definition` · PLAN 48-1)의 「그룹」 칸 = `{type_id: [{"id": "g1a2b3c", "이름": "유입구 기슭막이", "옵션": [...], "형상"?: {...}}]}` — 없는 종류 = 그룹 없음 · 빈 그룹(옵션 0)도 그룹 · 형상 = 길이 · 높이 · 전 · 후 받기 + 뜻. @@ -26,7 +26,7 @@ logger = logging.getLogger(__name__) def _load() -> tuple[dict[str, Any], str]: - """(그룹 표 · 판) — 정의 한 벌(`M02_SO_Definition`)의 「그룹」 칸 · 판 = 정의 판 글.""" + """(그룹 표 · 판) — 정의 한 벌(`M01_SO_Definition`)의 「그룹」 칸 · 판 = 정의 판 글.""" doc = load_definition() return doc.get("그룹") or {}, str(doc.get("판", 1)) @@ -144,7 +144,7 @@ def _clean(groups: Any, keys: dict[str, set[str]] | None = None) -> dict[str, li def save(groups: Any, version: str) -> dict[str, Any]: """고쳐 씀 — 판이 같을 때만. 돌려주는 것 = 새 `listing()`.""" - from M02_MasterTemplete.StructOptions.M02_SO_Definition import save_sections + from M01_MasterData.StructOptions.M01_SO_Definition import save_sections save_sections({"그룹": _clean(groups)}, version) return listing() diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Groups.ts b/M01_MasterData/StructOptions/M01_SO_Groups.ts similarity index 96% rename from M02_MasterTemplete/StructOptions/M02_SO_Groups.ts rename to M01_MasterData/StructOptions/M01_SO_Groups.ts index 8a3083d47..b8736b85b 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Groups.ts +++ b/M01_MasterData/StructOptions/M01_SO_Groups.ts @@ -1,16 +1,16 @@ /* ============================================================================= - * M02_SO_Groups.ts + * M01_SO_Groups.ts * 구조물 정의 화면의 **옵션 그룹** 부품(PLAN 46-2 · 48-2) — 고른 종류의 그룹 목록 * (이름 · 위로 · 아래로 · 지우기 · 형상 칸 길이 · 높이 · 전 · 후 받기 켬끔과 뜻 · [그룹 추가]) · * 옵션 줄마다 「들어갈 자리」 고르기(본체 · 그룹). - * 값은 화면이 쥔 고칠 사본에만 — 저장은 화면 [저장](`M02_SO_Def.ts`). - * 그룹 하나 = 프로젝트 B05 · B06 폼의 보조 컨테이너 하나 · 옵션이 없어도 됨(서버 `M02_SO_Groups.py`). + * 값은 화면이 쥔 고칠 사본에만 — 저장은 화면 [저장](`M01_SO_Def.ts`). + * 그룹 하나 = 프로젝트 B05 · B06 폼의 보조 컨테이너 하나 · 옵션이 없어도 됨(서버 `M01_SO_Groups.py`). * ========================================================================== */ import { createButton, el, showConfirmDialog } from "@ui/ui_template_elements"; -import { SHAPE_KEYS, type GroupDef } from "./M02_SO_Def_Model"; -import { checkBox, textBox } from "./M02_SO_Def_Ui"; -import { to } from "./M02_SO_Text"; +import { SHAPE_KEYS, type GroupDef } from "./M01_SO_Def_Model"; +import { checkBox, textBox } from "./M01_SO_Def_Ui"; +import { to } from "./M01_SO_Text"; import { createText } from "@ui/ui_template_text"; import { createEmpty } from "@ui/ui_template_empty"; diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Options.py b/M01_MasterData/StructOptions/M01_SO_Options.py similarity index 94% rename from M02_MasterTemplete/StructOptions/M02_SO_Options.py rename to M01_MasterData/StructOptions/M01_SO_Options.py index c059859e1..5e15371f8 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Options.py +++ b/M01_MasterData/StructOptions/M01_SO_Options.py @@ -1,6 +1,6 @@ """M02 구조물 옵션 보이기 — 구조물 종류마다 B05/B06 폼에 보일 옵션을 사용자가 체크. -정본 = 구조물 정의(`M02_SO_Definition` · PLAN 48-1) 「표시」 칸 = `{type_id: {option_key: false}}` +정본 = 구조물 정의(`M01_SO_Definition` · PLAN 48-1) 「표시」 칸 = `{type_id: {option_key: false}}` — 없는 종류 · 키는 보임. 저장은 **숨김(false)만** 남김 — 「모두 보임」 = `{}`. 옵션 정의 · 옛 값은 그대로 — 폼이 그리는 것만 갈림(`GET /api/projects/structure-types` `visible`). @@ -22,8 +22,8 @@ from B05_Profile.B05_Profile_Structures_Schema import ( load_structure_types, registry_schema_version, ) +from M01_MasterData.StructOptions.M01_SO_Groups import groups_of from M02_MasterTemplete import M02_MasterTemplete_Store as store -from M02_MasterTemplete.StructOptions.M02_SO_Groups import groups_of logger = logging.getLogger(__name__) @@ -35,7 +35,7 @@ class OptionWithVisible(StructureOptionField): class OptionGroup(BaseModel): - """옵션 그룹 한 개(PLAN 46-2 · `M02_SO_Groups`) — 폼의 보조 컨테이너 하나 · 빈 옵션도 됨.""" + """옵션 그룹 한 개(PLAN 46-2 · `M01_SO_Groups`) — 폼의 보조 컨테이너 하나 · 빈 옵션도 됨.""" id: str name: str @@ -54,7 +54,7 @@ class TypesWithVisible(StructureTypesResponse): def _load() -> tuple[dict[str, Any], str]: - """(표시 표 · 판) — 정의 한 벌(`M02_SO_Definition`)의 「표시」 칸 · 판 = 정의 판 글.""" + """(표시 표 · 판) — 정의 한 벌(`M01_SO_Definition`)의 「표시」 칸 · 판 = 정의 판 글.""" doc = load_definition() return doc.get("표시") or {}, str(doc.get("판", 1)) @@ -155,7 +155,7 @@ def _clean(shown: Any, keys: dict[str, set[str]] | None = None) -> dict[str, dic def save(shown: Any, version: str) -> dict[str, Any]: """고쳐 씀 — 판이 같을 때만. 돌려주는 것 = 새 `listing()`.""" - from M02_MasterTemplete.StructOptions.M02_SO_Definition import save_sections + from M01_MasterData.StructOptions.M01_SO_Definition import save_sections save_sections({"표시": _clean(shown)}, version) return listing() diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Options.ts b/M01_MasterData/StructOptions/M01_SO_Options.ts similarity index 91% rename from M02_MasterTemplete/StructOptions/M02_SO_Options.ts rename to M01_MasterData/StructOptions/M01_SO_Options.ts index 3136b9a76..b8be7235c 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Options.ts +++ b/M01_MasterData/StructOptions/M01_SO_Options.ts @@ -1,15 +1,15 @@ /* ============================================================================= - * M02_SO_Options.ts + * M01_SO_Options.ts * 좌측 「구조물 옵션 정의」 줄(구조물 집계 양식 아래 별도 · 시스템 층) — 누르면 메인 칸에 - * 정의 편집 화면(PLAN 48-2 · `M02_SO_Def.ts`) · 고쳐 씀은 시스템 관리자만 · 다른 역할은 읽기만. + * 정의 편집 화면(PLAN 48-2 · `M01_SO_Def.ts`) · 고쳐 씀은 시스템 관리자만 · 다른 역할은 읽기만. * 옛 「보이기 · 그룹」 화면(46장)은 정의 화면의 옵션 줄 「보이기」 · 그룹 칸으로 들어감. * ========================================================================== */ import { el } from "@ui/ui_template_elements"; -import { openDefScreen } from "./M02_SO_Def"; +import { openDefScreen } from "./M01_SO_Def"; import "@ui/ui_template_card.css"; -import "./M02_SO_Style.css"; -import { to } from "./M02_SO_Text"; +import "./M01_SO_Style.css"; +import { to } from "./M01_SO_Text"; export interface OptionsSectionOptions { isAdmin: boolean; diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Router.py b/M01_MasterData/StructOptions/M01_SO_Router.py similarity index 91% rename from M02_MasterTemplete/StructOptions/M02_SO_Router.py rename to M01_MasterData/StructOptions/M01_SO_Router.py index 448e0e4cc..153e3819a 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Router.py +++ b/M01_MasterData/StructOptions/M01_SO_Router.py @@ -1,4 +1,4 @@ -"""M02 구조물 옵션 보이기 · 그룹 · 정의 길 — 정본 `M02_SO_Definition.py`(PLAN 48-1) 한 벌. +"""M02 구조물 옵션 보이기 · 그룹 · 정의 길 — 정본 `M01_SO_Definition.py`(PLAN 48-1) 한 벌. `router` = 고쳐 씀 · 관리 읽기(`main.py` 가 `system_admin_only` 로 붙임) · `read_router` = 읽기만(로그인 누구나 · `main.py` 가 `protected` 로 붙임) · 정의 쓰기는 여기서 @@ -14,14 +14,14 @@ from pydantic import BaseModel from B05_Profile.B05_Profile_Structures_Schema import definition_version from common_util.common_util_auth import verify_session +from M01_MasterData.StructOptions import M01_SO_Definition as definition +from M01_MasterData.StructOptions import M01_SO_Groups as groups +from M01_MasterData.StructOptions import M01_SO_Options as options from M02_MasterTemplete import M02_Layer_Access as access from M02_MasterTemplete import M02_MasterTemplete_Store as store -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition -from M02_MasterTemplete.StructOptions import M02_SO_Groups as groups -from M02_MasterTemplete.StructOptions import M02_SO_Options as options -router = APIRouter(prefix="/api/m02", tags=["M02 MasterTemplete"]) -read_router = APIRouter(prefix="/api/m02", tags=["M02 MasterTemplete"]) +router = APIRouter(prefix="/api/m01", tags=["M01 MasterData"]) +read_router = APIRouter(prefix="/api/m01", tags=["M01 MasterData"]) class OptionsBody(BaseModel): diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Style.css b/M01_MasterData/StructOptions/M01_SO_Style.css similarity index 100% rename from M02_MasterTemplete/StructOptions/M02_SO_Style.css rename to M01_MasterData/StructOptions/M01_SO_Style.css diff --git a/M02_MasterTemplete/StructOptions/M02_SO_Text.ts b/M01_MasterData/StructOptions/M01_SO_Text.ts similarity index 99% rename from M02_MasterTemplete/StructOptions/M02_SO_Text.ts rename to M01_MasterData/StructOptions/M01_SO_Text.ts index ff1db8eec..84229c910 100644 --- a/M02_MasterTemplete/StructOptions/M02_SO_Text.ts +++ b/M01_MasterData/StructOptions/M01_SO_Text.ts @@ -1,5 +1,5 @@ /* ============================================================================= - * M02_SO_Text.ts + * M01_SO_Text.ts * 좌측 「구조물 옵션 보이기」 줄 · 상세 화면(보이기 · 그룹) 글자 — [한국어, 영어] * ========================================================================== */ diff --git a/M02_MasterTemplete/M02_Item_Snapshot.py b/M02_MasterTemplete/M02_Item_Snapshot.py index efe468cbc..afbfcb312 100644 --- a/M02_MasterTemplete/M02_Item_Snapshot.py +++ b/M02_MasterTemplete/M02_Item_Snapshot.py @@ -233,7 +233,7 @@ def rename_moved(base: Path, wanted: dict[str, tuple[str, dict[str, Any]]]) -> l def group_names() -> dict[str, str]: """옵션 그룹 id → 이름(지금 정의) — 복사본 manifest `그룹` 으로 굳힘(142-2).""" - from M02_MasterTemplete.StructOptions.M02_SO_Groups import groups_of + from M01_MasterData.StructOptions.M01_SO_Groups import groups_of return {g["id"]: g["name"] for rows in groups_of().values() for g in rows} diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_LibMeta.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_LibMeta.ts index d65966386..7d59aa40b 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_LibMeta.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_LibMeta.ts @@ -5,7 +5,7 @@ * ========================================================================== */ import { createSelectField } from "@ui/ui_template_elements"; -import { fetchStructureDef } from "./StructOptions/M02_SO_Api"; +import { fetchStructureDef } from "../M01_MasterData/StructOptions/M01_SO_Api"; import { precomboClasses } from "./M02_MasterTemplete_UI_Side_Precombo"; import { tc } from "./M02_MasterTemplete_Labor_Text"; diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_Pick.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_Pick.ts index 3a4199dec..547ae1cd9 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_Pick.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_Pick.ts @@ -33,7 +33,7 @@ import { openStandardSheet } from "./M02_MasterTemplete_Labor_Sheet"; import type { LaborFixed, LaborRef } from "./M02_MasterTemplete_Labor_Calc"; import { tc } from "./M02_MasterTemplete_Labor_Text"; import { precomboClasses } from "./M02_MasterTemplete_UI_Side_Precombo"; -import { fetchStructureDef } from "./StructOptions/M02_SO_Api"; +import { fetchStructureDef } from "../M01_MasterData/StructOptions/M01_SO_Api"; import "../M01_MasterData/M01_MasterData_UI_Logic_Style.css"; // 창 겉틀 import "./M02_MasterTemplete_Labor.css"; import { openModal } from "@ui/ui_template_modal"; diff --git a/M02_MasterTemplete/M02_MasterTemplete_UI_Side_Precombo.ts b/M02_MasterTemplete/M02_MasterTemplete_UI_Side_Precombo.ts index c97bf1697..677c8d229 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_UI_Side_Precombo.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_UI_Side_Precombo.ts @@ -9,7 +9,7 @@ import type { TreeMenuItem } from "@ui/ui_template_tree"; import type { Kind } from "./M02_MasterTemplete_Api_Fetch"; -import type { StructDef } from "./StructOptions/M02_SO_Def_Model"; +import type { StructDef } from "../M01_MasterData/StructOptions/M01_SO_Def_Model"; import { tc } from "./M02_MasterTemplete_Labor_Text"; import type { Selection } from "./M02_MasterTemplete_UI_Main"; import { diff --git a/M02_MasterTemplete/M02_Table_Fill.py b/M02_MasterTemplete/M02_Table_Fill.py index fb34caad1..10c29e301 100644 --- a/M02_MasterTemplete/M02_Table_Fill.py +++ b/M02_MasterTemplete/M02_Table_Fill.py @@ -150,9 +150,9 @@ def _with_group_items(items: list[dict[str, Any]], project_root=None) -> list[di 복사본 `{구조물 id}__{그룹 id}`. 그룹 = 지금 정의 + 복사본에 굳힌 정의(142-2 · 이름 · 사라진 그룹도) · 미지정 그룹 = 「미지정」 알림에 셈.""" from common_util.common_util_summary_item import GROUP_JOIN + from M01_MasterData.StructOptions.M01_SO_Groups import groups_of from M02_MasterTemplete.M02_Item_Snapshot import copied_groups from M02_MasterTemplete.M02_Table_Fill_Spec import container_rows - from M02_MasterTemplete.StructOptions.M02_SO_Groups import groups_of defined = groups_of() out: list[dict[str, Any]] = [] diff --git a/common_util/common_util_m02_call.ts b/common_util/common_util_m02_call.ts index 04053dbd4..17768ff5a 100644 --- a/common_util/common_util_m02_call.ts +++ b/common_util/common_util_m02_call.ts @@ -20,9 +20,9 @@ export class StaleError extends Error { } } -/** `/api/m02` 아래 길 부름 — 409 = StaleError · 그 밖 실패 = 서버 까닭 글(하위 폴더도 씀) */ -export async function call(path: string, init: RequestInit = {}): Promise { - const response = await fetch(`${API_BASE_URL}/m02${path}`, { +/** `/api/m02` 아래 길 부름(`base` = 다른 묶음 · M01 구조물 정의 `/m01`) — 409 = StaleError · 그 밖 실패 = 서버 까닭 글(하위 폴더도 씀) */ +export async function call(path: string, init: RequestInit = {}, base = "/m02"): Promise { + const response = await fetch(`${API_BASE_URL}${base}${path}`, { credentials: "include", headers: { "Content-Type": "application/json" }, ...init, diff --git a/common_util/common_util_summary_item.py b/common_util/common_util_summary_item.py index 4aa4068bf..1c3a7db90 100644 --- a/common_util/common_util_summary_item.py +++ b/common_util/common_util_summary_item.py @@ -71,7 +71,7 @@ def parse_summary_item(value: Any) -> dict[str, Any] | None: return {**out, "spec": spec.strip()} if spec is not None else out -#: 옵션 그룹 id(PLAN 46 · `M02_SO_Groups.GROUP_ID` 와 같은 규칙) +#: 옵션 그룹 id(PLAN 46 · `M01_SO_Groups.GROUP_ID` 와 같은 규칙) _GROUP_ID = re.compile(r"^g[0-9a-z]{1,16}$") #: 그룹 복사본 이름 잇개 — `{구조물 id}__{그룹 id}`(구조물 id 는 hex · 관은 `pipe@측점`) GROUP_JOIN = "__" diff --git a/main.py b/main.py index 944c49de9..a6470e356 100644 --- a/main.py +++ b/main.py @@ -105,8 +105,8 @@ from M02_MasterTemplete.M02_MasterTemplete_Router_Drawing import router as m02_d from M02_MasterTemplete.M02_MasterTemplete_Router_Items import router as m02_items_router from M02_MasterTemplete.M02_MasterTemplete_Router_Layers import router as m02_layers_router from M02_MasterTemplete.M02_Project_Items_Router import router as m02_project_items_router -from M02_MasterTemplete.StructOptions.M02_SO_Router import read_router as m02_so_read_router -from M02_MasterTemplete.StructOptions.M02_SO_Router import router as m02_so_router +from M01_MasterData.StructOptions.M01_SO_Router import read_router as m01_so_read_router +from M01_MasterData.StructOptions.M01_SO_Router import router as m01_so_router from common_util.common_util_audit import note_api_call, record_call_burst from common_util.common_util_auth import ( require_company, @@ -557,9 +557,9 @@ app.include_router( dependencies=protected, ) # 마스터 템플릿 층(시스템·회사·개인·프로젝트)·도면 길은 로그인만(권한은 길 안에서) · 옛 시스템 전용 길은 걷음(894). -# 구조물 옵션 보이기 · 그룹(PLAN 46) — 고쳐 씀은 시스템 관리자 · 읽기는 로그인만 -app.include_router(m02_so_router, dependencies=system_admin_only) -app.include_router(m02_so_read_router, dependencies=protected) +# M01 구조물 정의 · 옵션 보이기 · 그룹(PLAN 46 · 859-5) — 고쳐 씀은 시스템 관리자 · 읽기는 로그인만 +app.include_router(m01_so_router, dependencies=system_admin_only) +app.include_router(m01_so_read_router, dependencies=protected) app.include_router(m02_layers_router, dependencies=protected) app.include_router(m02_items_router, dependencies=protected) app.include_router(m02_combos_router, dependencies=protected) diff --git a/resources/tester/helper_322_2_check.cjs b/resources/tester/helper_322_2_check.cjs index 5d2b7c70f..d353121c6 100644 --- a/resources/tester/helper_322_2_check.cjs +++ b/resources/tester/helper_322_2_check.cjs @@ -1,4 +1,4 @@ -/* PLAN 322-2 구조물 표 검사 · 편집 헬퍼 — 진짜 `M02_SO_Def_Check.ts` · `M02_SO_Def_Reflect.ts` · +/* PLAN 322-2 구조물 표 검사 · 편집 헬퍼 — 진짜 `M01_SO_Def_Check.ts` · `M01_SO_Def_Reflect.ts` · * `design_structure_spec.ts` 를 그 자리에서 트랜스파일해 Node 로 돌림 · 결과 = 표준출력 JSON 한 벌. * 입력 = argv[2] JSON `{cases: {이름: [정의, 앞 판|null]}, definition}`. 짝 = `test_322_2_check_mirror.py`. */ @@ -33,9 +33,9 @@ function load(file) { return box.exports; } -const SO = (name) => path.join(ROOT, "M02_MasterTemplete", "StructOptions", `${name}.ts`); -const check = load(SO("M02_SO_Def_Check")); -const reflect = load(SO("M02_SO_Def_Reflect")); +const SO = (name) => path.join(ROOT, "M01_MasterData", "StructOptions", `${name}.ts`); +const check = load(SO("M01_SO_Def_Check")); +const reflect = load(SO("M01_SO_Def_Reflect")); const spec = load(path.join(ROOT, "A00_Common", "design", "logic", "design_structure_spec.ts")); const { STRUCTURE_SPECS } = load( path.join(ROOT, "A00_Common", "design", "logic", "design_structure_pipe.ts"), diff --git a/resources/tester/helper_323_7_new_type.cjs b/resources/tester/helper_323_7_new_type.cjs index 9395dceff..c846c0527 100644 --- a/resources/tester/helper_323_7_new_type.cjs +++ b/resources/tester/helper_323_7_new_type.cjs @@ -1,4 +1,4 @@ -/* PLAN 323-7 종류 더하기 헬퍼 — 진짜 `M02_SO_Def_Add.ts`(본보기 복사) · 구조물 표 · 측점 계획 · 형상 얹기 · 벽 단 · +/* PLAN 323-7 종류 더하기 헬퍼 — 진짜 `M01_SO_Def_Add.ts`(본보기 복사) · 구조물 표 · 측점 계획 · 형상 얹기 · 벽 단 · * 명세 고르기 · M02 검사를 그 자리에서 트랜스파일해 Node 로 돌림(마스터는 읽기만 · 사본에서 더함) · 결과 = JSON. * 짝 = `test_323_7_new_type.py`(파이썬 검사 · 표 · 벽 제원이 같은 사본을 읽음). */ @@ -35,12 +35,12 @@ function load(file) { } const C = (name) => path.join(ROOT, "common_util", `${name}.ts`); -const M = (name) => path.join(ROOT, "M02_MasterTemplete", "StructOptions", `${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"), ); const def = JSON.parse(JSON.stringify(master)); -const add = load(M("M02_SO_Def_Add")); +const add = load(M("M01_SO_Def_Add")); const catalog = load(C("common_util_structure_catalog")); const station = load(C("common_util_structure_station")); const attach = load(C("common_util_structure_attach")); @@ -48,7 +48,7 @@ const walls = load(C("common_util_structure_walls")); const pipeSpecs = load( path.join(ROOT, "A00_Common", "design", "logic", "design_structure_pipe.ts"), ); -const check = load(M("M02_SO_Def_Check")); +const check = load(M("M01_SO_Def_Check")); const out = {}; out.templates = add.templates(def).map(([key]) => key); diff --git a/resources/tester/helper_m02_so_def_model.cjs b/resources/tester/helper_m02_so_def_model.cjs index 92969f79c..f4525535f 100644 --- a/resources/tester/helper_m02_so_def_model.cjs +++ b/resources/tester/helper_m02_so_def_model.cjs @@ -1,11 +1,11 @@ -/* M02 구조물 정의 편집 화면 자료 손질(`M02_SO_Def_Model.ts` · PLAN 48-2) 단위검증 헬퍼 — +/* M02 구조물 정의 편집 화면 자료 손질(`M01_SO_Def_Model.ts` · PLAN 48-2) 단위검증 헬퍼 — * TS 를 그 자리에서 트랜스파일해 Node 로 돌리고 결과를 JSON 으로 냄(pytest 가 판정). */ const fs = require("fs"); const path = require("path"); const ts = require(path.join(__dirname, "..", "..", "config", "node_modules", "typescript")); const source = fs.readFileSync( - path.join(__dirname, "..", "..", "M02_MasterTemplete", "StructOptions", "M02_SO_Def_Model.ts"), + path.join(__dirname, "..", "..", "M01_MasterData", "StructOptions", "M01_SO_Def_Model.ts"), "utf8", ); const js = ts.transpileModule(source, { diff --git a/resources/tester/helper_m02_so_def_spec.cjs b/resources/tester/helper_m02_so_def_spec.cjs index d1fe96643..7f44bcf97 100644 --- a/resources/tester/helper_m02_so_def_spec.cjs +++ b/resources/tester/helper_m02_so_def_spec.cjs @@ -1,4 +1,4 @@ -/* M02 구조물 명세 이름 고치기(`M02_SO_Def_Spec_Model.ts` · PLAN 52-11) 단위검증 헬퍼 — +/* M02 구조물 명세 이름 고치기(`M01_SO_Def_Spec_Model.ts` · PLAN 52-11) 단위검증 헬퍼 — * TS 를 그 자리에서 트랜스파일해 Node 로 돌리고 결과를 JSON 으로 냄(pytest 가 판정). * 정의는 진짜 `구조물정의.json` 을 읽어 메모리 사본만 고침(파일 쓰기 없음). */ const fs = require("fs"); @@ -25,7 +25,7 @@ const load = (...parts) => { new Function("exports", "module", "require", js)(box.exports, box, near); return box.exports; }; -const m = load("M02_MasterTemplete", "StructOptions", "M02_SO_Def_Spec_Model.ts"); +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( diff --git a/resources/tester/test_120_b08_drain_summary.py b/resources/tester/test_120_b08_drain_summary.py index a3effb254..8fbe6bff0 100644 --- a/resources/tester/test_120_b08_drain_summary.py +++ b/resources/tester/test_120_b08_drain_summary.py @@ -24,8 +24,8 @@ import pytest from B06_Section.B06_Section_Schema import CrossSectionPatch from B08_Quantity import B08_Quantity_Router_Summary as summary +from M01_MasterData.StructOptions import M01_SO_Definition as definition from M02_MasterTemplete import M02_Item_Snapshot as snapshots -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition ROOT = Path(__file__).resolve().parents[2] FIXTURES = Path(__file__).parent / "fixtures" diff --git a/resources/tester/test_129_menu_equals_panel.py b/resources/tester/test_129_menu_equals_panel.py index 34ce1ff11..d72319d71 100644 --- a/resources/tester/test_129_menu_equals_panel.py +++ b/resources/tester/test_129_menu_equals_panel.py @@ -15,8 +15,8 @@ import subprocess import pytest -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition -from M02_MasterTemplete.StructOptions.M02_SO_Options import with_visible +from M01_MasterData.StructOptions import M01_SO_Definition as definition +from M01_MasterData.StructOptions.M01_SO_Options import with_visible HERE = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.abspath(os.path.join(HERE, "..", "..")) diff --git a/resources/tester/test_131_b08_material_fix.py b/resources/tester/test_131_b08_material_fix.py index 1ebbf4871..8e683ef01 100644 --- a/resources/tester/test_131_b08_material_fix.py +++ b/resources/tester/test_131_b08_material_fix.py @@ -20,8 +20,8 @@ from test_121_b08_material_sheets import SUMMARY, UNITS, _run_ts from B08_Quantity import B08_Quantity_Router_Material as router_mod from B08_Quantity import B08_Quantity_Router_Summary as summary_mod from B08_Quantity.B08_Quantity_Material_Calc import clean_overrides, compute, finish +from M01_MasterData.StructOptions import M01_SO_Definition as definition from M02_MasterTemplete import M02_Item_Snapshot as snapshots -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition ROOT = Path(__file__).resolve().parents[2] FIXTURES = Path(__file__).parent / "fixtures" diff --git a/resources/tester/test_136_3_remove_button.py b/resources/tester/test_136_3_remove_button.py index 2ca13237f..457972857 100644 --- a/resources/tester/test_136_3_remove_button.py +++ b/resources/tester/test_136_3_remove_button.py @@ -42,10 +42,3 @@ def test_이름표_단추는_작은_단추_틀_흐림은_글에만(): assert "height: var(--b05-control-h)" in small and "padding-block: 0" in small legend = _rule(".b05-structure__group > legend {") assert "opacity" not in legend and "currentColor 80%" in legend - - -def test_M02_미리보기_이름표_단추도_작은_단추_틀(): - css = (ROOT / "M02_MasterTemplete" / "StructOptions" / "M02_SO_Style.css").read_text("utf-8") - at = css.index(".m02-sod__block .b05-structure__group > legend > button") - rule = css[at : css.index("}", at)] - assert "height: 26px" in rule and "padding-block: 0" in rule diff --git a/resources/tester/test_143_1_b08_linked_snapshots.py b/resources/tester/test_143_1_b08_linked_snapshots.py index 07b794fff..6926072b0 100644 --- a/resources/tester/test_143_1_b08_linked_snapshots.py +++ b/resources/tester/test_143_1_b08_linked_snapshots.py @@ -19,8 +19,8 @@ from pathlib import Path import pytest from B08_Quantity import B08_Quantity_Router_Summary as summary +from M01_MasterData.StructOptions import M01_SO_Definition as definition from M02_MasterTemplete import M02_Item_Snapshot as snapshots -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition ROOT = Path(__file__).resolve().parents[2] diff --git a/resources/tester/test_143_2_b08_blank_values.py b/resources/tester/test_143_2_b08_blank_values.py index 31fcd2f31..5f84904ee 100644 --- a/resources/tester/test_143_2_b08_blank_values.py +++ b/resources/tester/test_143_2_b08_blank_values.py @@ -10,8 +10,8 @@ import json from pathlib import Path from B08_Quantity import B08_Quantity_Router_Summary as summary +from M01_MasterData.StructOptions import M01_SO_Definition as definition from M02_MasterTemplete import M02_Item_Snapshot as snapshots -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition ITEM = {"layer": "system", "owner": None, "key": "SS000001", "name": "견본"} POINTS = [ diff --git a/resources/tester/test_154_2_b08_direct_link.py b/resources/tester/test_154_2_b08_direct_link.py index 8b9e34f65..f00dd6e1f 100644 --- a/resources/tester/test_154_2_b08_direct_link.py +++ b/resources/tester/test_154_2_b08_direct_link.py @@ -18,10 +18,10 @@ import pytest from B08_Quantity import B08_Quantity_Router_Summary as summary from config import config_system +from M01_MasterData.StructOptions import M01_SO_Definition as definition from M02_MasterTemplete import M02_Item_Copy as copies from M02_MasterTemplete import M02_Item_Snapshot as snap from M02_MasterTemplete import M02_Template_Layers as layers -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition from resources.tester.helper_m02_master_sample import SAMPLE ROOT = Path(__file__).resolve().parents[2] diff --git a/resources/tester/test_156_1_b08_unlink.py b/resources/tester/test_156_1_b08_unlink.py index f37eaf7f7..e4c20277e 100644 --- a/resources/tester/test_156_1_b08_unlink.py +++ b/resources/tester/test_156_1_b08_unlink.py @@ -13,9 +13,9 @@ import asyncio from pathlib import Path from B08_Quantity import B08_Quantity_Router_Summary as summary +from M01_MasterData.StructOptions import M01_SO_Definition as definition from M02_MasterTemplete import M02_Item_Snapshot as snap from M02_MasterTemplete import M02_Project_Items_Router as items_router -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition from resources.tester.test_154_2_b08_direct_link import ( # noqa: F401 — 시험 저장소 MS, PIPE, diff --git a/resources/tester/test_166_1_note_options.py b/resources/tester/test_166_1_note_options.py index ee1341e67..d2417ade5 100644 --- a/resources/tester/test_166_1_note_options.py +++ b/resources/tester/test_166_1_note_options.py @@ -26,7 +26,7 @@ from B07_DesignDetail.B07_DesignDetail_Engine_Cad_CulvertNote import ( # noqa: structure_note_lines, with_option_lines, ) -from M02_MasterTemplete.StructOptions.M02_SO_Options import with_visible # noqa: E402 +from M01_MasterData.StructOptions.M01_SO_Options import with_visible # noqa: E402 pytestmark = pytest.mark.skipif( not (ROOT / "config" / "node_modules").is_dir(), reason="프론트엔드 의존성 미설치" diff --git a/resources/tester/test_211_1_inlet_revet_height.py b/resources/tester/test_211_1_inlet_revet_height.py index 572b9008e..6d08ea549 100644 --- a/resources/tester/test_211_1_inlet_revet_height.py +++ b/resources/tester/test_211_1_inlet_revet_height.py @@ -19,8 +19,8 @@ from B05_Profile.B05_Profile_Structures_Schema import structure_type_map from B06_Section import B06_Section_Engine_Culvert as culvert from B08_Quantity import B08_Quantity_Router_Summary as summary from common_util.common_util_drainage_pipes import PipePoint +from M01_MasterData.StructOptions import M01_SO_Definition as definition from M02_MasterTemplete import M02_Item_Snapshot as snapshots -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition ROOT = Path(__file__).resolve().parents[2] TSC = ROOT / "config" / "node_modules" / "typescript" / "bin" / "tsc" diff --git a/resources/tester/test_322_0_golden.py b/resources/tester/test_322_0_golden.py index 425dd7f99..7e1b69f71 100644 --- a/resources/tester/test_322_0_golden.py +++ b/resources/tester/test_322_0_golden.py @@ -30,7 +30,7 @@ from B06_Section.B06_Section_Engine_Structures_Wall import attach_wall_specs, wa from B06_Section.B06_Section_Engine_Tilt import attach_underdrain_specs, load_underdrains from common_util.common_util_drainage_pipes import parse_pipe_points from common_util.common_util_structure_pavement import attach_pavement_structures -from M02_MasterTemplete.StructOptions.M02_SO_Options import with_visible +from M01_MasterData.StructOptions.M01_SO_Options import with_visible HERE = Path(__file__).parent ROOT = HERE.parent.parent diff --git a/resources/tester/test_322_0_version.py b/resources/tester/test_322_0_version.py index 2d87b92e8..c02e86f87 100644 --- a/resources/tester/test_322_0_version.py +++ b/resources/tester/test_322_0_version.py @@ -1,7 +1,7 @@ """PLAN 322-0 ③ — 판 확인: 서버 관 기본값 · 판 읽기 길이 정의 사본을 바로 따름(서버 다시 켜기 없음). - `_registry_defaults` = 정의 파일이 바뀌면 다음 부름부터 새 기본값(옛 lru = 서버 다시 켤 때까지 옛 값). -- `GET /api/m02/structure-definition/version` = 지금 판 `{판}` 만(화면 종류 캐시가 판을 볼 때 · 한 벌 안 받음). +- `GET /api/m01/structure-definition/version` = 지금 판 `{판}` 만(화면 종류 캐시가 판을 볼 때 · 한 벌 안 받음). 화면 캐시 쪽은 `test_322_0_golden.py::test_type_cache_follows_definition_version`. """ @@ -17,7 +17,7 @@ from fastapi.testclient import TestClient from B05_Profile import B05_Profile_Structures_Schema as schema from B06_Section.B06_Section_Engine_Culvert import _registry_defaults from common_util.common_util_auth import verify_session -from M02_MasterTemplete.StructOptions.M02_SO_Router import read_router +from M01_MasterData.StructOptions.M01_SO_Router import read_router @pytest.fixture @@ -53,6 +53,6 @@ def test_version_endpoint_reads_current_version(copy: Path) -> None: app.dependency_overrides[verify_session] = lambda: {"role": "USER", "user_id": 2} client = TestClient(app) now = json.loads(copy.read_text("utf-8"))["판"] - assert client.get("/api/m02/structure-definition/version").json() == {"판": now} + assert client.get("/api/m01/structure-definition/version").json() == {"판": now} _rewrite(copy, lambda doc: doc.update(판=now + 3)) - assert client.get("/api/m02/structure-definition/version").json() == {"판": now + 3} + assert client.get("/api/m01/structure-definition/version").json() == {"판": now + 3} diff --git a/resources/tester/test_322_2_check_mirror.py b/resources/tester/test_322_2_check_mirror.py index 518b48d31..48e907dbf 100644 --- a/resources/tester/test_322_2_check_mirror.py +++ b/resources/tester/test_322_2_check_mirror.py @@ -24,12 +24,12 @@ from fastapi.testclient import TestClient from B05_Profile import B05_Profile_Structures_Schema as schema from common_util.common_util_auth import verify_session from common_util.common_util_structure_catalog import catalog -from M02_MasterTemplete.StructOptions.M02_SO_Check import catalog_errors -from M02_MasterTemplete.StructOptions.M02_SO_Router import read_router +from M01_MasterData.StructOptions.M01_SO_Check import catalog_errors +from M01_MasterData.StructOptions.M01_SO_Router import read_router HERE = Path(__file__).parent ROOT = HERE.parent.parent -URL = "/api/m02/structure-definition" +URL = "/api/m01/structure-definition" ADMIN = {"role": "SYSTEM_ADMIN", "user_id": 1} pytestmark = pytest.mark.skipif( diff --git a/resources/tester/test_322_3_plan_mirror.py b/resources/tester/test_322_3_plan_mirror.py index 6854ae3ea..c661ae543 100644 --- a/resources/tester/test_322_3_plan_mirror.py +++ b/resources/tester/test_322_3_plan_mirror.py @@ -20,7 +20,7 @@ from B05_Profile.B05_Profile_Engine_Sections import resolve_extra_stations from B05_Profile.B05_Profile_Structures_Schema import StructureInstance, load_definition from common_util.common_util_drainage_pipes import parse_pipe_points from common_util.common_util_structure_station import plan_stations -from M02_MasterTemplete.StructOptions.M02_SO_Options import with_visible +from M01_MasterData.StructOptions.M01_SO_Options import with_visible HERE = Path(__file__).parent ROOT = HERE.parent.parent diff --git a/resources/tester/test_323_4_attach_mirror.py b/resources/tester/test_323_4_attach_mirror.py index 3aea2d98d..2ddbbf693 100644 --- a/resources/tester/test_323_4_attach_mirror.py +++ b/resources/tester/test_323_4_attach_mirror.py @@ -21,7 +21,7 @@ from B05_Profile.B05_Profile_Structures_Schema import StructureInstance, load_de from B06_Section.B06_Section_Engine_Attach import attach_shapes from common_util.common_util_drainage_pipes import parse_pipe_points from common_util.common_util_structure_catalog import catalog -from M02_MasterTemplete.StructOptions.M02_SO_Options import with_visible +from M01_MasterData.StructOptions.M01_SO_Options import with_visible HERE = Path(__file__).parent ROOT = HERE.parent.parent diff --git a/resources/tester/test_323_7_new_type.py b/resources/tester/test_323_7_new_type.py index 3e01fb740..3f8bf5d6c 100644 --- a/resources/tester/test_323_7_new_type.py +++ b/resources/tester/test_323_7_new_type.py @@ -17,7 +17,7 @@ from B05_Profile import B05_Profile_Structures_Schema as schema from B05_Profile.B05_Profile_Structures_Schema import StructureInstance from B06_Section.B06_Section_Engine_Structures_Wall import wall_specs_from from common_util import common_util_structure_catalog as catalog -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition +from M01_MasterData.StructOptions import M01_SO_Definition as definition HERE = Path(__file__).parent ROOT = HERE.parent.parent diff --git a/resources/tester/test_52_6_cross_underdrain.py b/resources/tester/test_52_6_cross_underdrain.py index 6e5a15584..88107ac90 100644 --- a/resources/tester/test_52_6_cross_underdrain.py +++ b/resources/tester/test_52_6_cross_underdrain.py @@ -46,7 +46,7 @@ def test_컨테이너_맹암거_높이_경사_손_입력(): def test_정의_검사_통과(): - from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition + from M01_MasterData.StructOptions import M01_SO_Definition as definition assert definition.check(load_definition()) == [] diff --git a/resources/tester/test_52_7_safety.py b/resources/tester/test_52_7_safety.py index 020ea13b6..3c64435fa 100644 --- a/resources/tester/test_52_7_safety.py +++ b/resources/tester/test_52_7_safety.py @@ -11,7 +11,7 @@ import subprocess from B05_Profile.B05_Profile_Structures_Schema import structure_type_map from common_util.common_util_structure_catalog import load_parts -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition +from M01_MasterData.StructOptions import M01_SO_Definition as definition HERE = os.path.dirname(os.path.abspath(__file__)) ROOT = os.path.dirname(os.path.dirname(HERE)) diff --git a/resources/tester/test_52_9_spoil_borrow.py b/resources/tester/test_52_9_spoil_borrow.py index 272ddc58d..9cc495482 100644 --- a/resources/tester/test_52_9_spoil_borrow.py +++ b/resources/tester/test_52_9_spoil_borrow.py @@ -11,9 +11,9 @@ from pathlib import Path from B05_Profile.B05_Profile_Structures_Schema import DEFINITION_PATH, load_structure_types from common_util.common_util_structure_catalog import catalog_row +from M01_MasterData.StructOptions import M01_SO_Definition +from M01_MasterData.StructOptions.M01_SO_Groups import groups_of from M02_MasterTemplete.M02_Table_Fill import _with_group_items -from M02_MasterTemplete.StructOptions import M02_SO_Definition -from M02_MasterTemplete.StructOptions.M02_SO_Groups import groups_of KINDS = { "spoil_bank": ("유용토운반작업장(사토장)", "사토장 부피", "gspoildetail"), @@ -40,8 +40,8 @@ def test_컨테이너_상세_내용_하나_부피를_담음(): def test_정의_검사_통과_판_이력(): doc = json.loads(Path(DEFINITION_PATH).read_text("utf-8")) - assert M02_SO_Definition.check(doc) == [] - assert M02_SO_Definition.history_path(doc["판"] - 1).is_file() + assert M01_SO_Definition.check(doc) == [] + assert M01_SO_Definition.history_path(doc["판"] - 1).is_file() def test_잇기는_그룹마다_집계_한_줄(): diff --git a/resources/tester/test_54_26_slope_table09.py b/resources/tester/test_54_26_slope_table09.py index c848eb74d..1d27e73c3 100644 --- a/resources/tester/test_54_26_slope_table09.py +++ b/resources/tester/test_54_26_slope_table09.py @@ -13,9 +13,9 @@ from B05_Profile.B05_Profile_Structures_Schema import ( StructureInstance, load_structure_types, ) -from M02_MasterTemplete.StructOptions import M02_SO_Definition -from M02_MasterTemplete.StructOptions.M02_SO_Groups import groups_of -from M02_MasterTemplete.StructOptions.M02_SO_Options import hidden_keys +from M01_MasterData.StructOptions import M01_SO_Definition +from M01_MasterData.StructOptions.M01_SO_Groups import groups_of +from M01_MasterData.StructOptions.M01_SO_Options import hidden_keys TABLE = { "soil_guard": ( @@ -87,5 +87,5 @@ def test_옛_값_저장_막지_않음(): def test_정의_검사_통과_판_이력(): doc = json.loads(Path(DEFINITION_PATH).read_text("utf-8")) - assert M02_SO_Definition.check(doc) == [] - assert M02_SO_Definition.history_path(doc["판"] - 1).is_file() + assert M01_SO_Definition.check(doc) == [] + assert M01_SO_Definition.history_path(doc["판"] - 1).is_file() diff --git a/resources/tester/test_54_6_slope_container.py b/resources/tester/test_54_6_slope_container.py index 981ddcade..4f8a0f456 100644 --- a/resources/tester/test_54_6_slope_container.py +++ b/resources/tester/test_54_6_slope_container.py @@ -8,9 +8,9 @@ import json from pathlib import Path from B05_Profile.B05_Profile_Structures_Schema import DEFINITION_PATH, load_structure_types +from M01_MasterData.StructOptions import M01_SO_Definition +from M01_MasterData.StructOptions.M01_SO_Groups import groups_of from M02_MasterTemplete.M02_Table_Fill import _with_group_items -from M02_MasterTemplete.StructOptions import M02_SO_Definition -from M02_MasterTemplete.StructOptions.M02_SO_Groups import groups_of KINDS = { "retaining_wall": "gretaindetail", @@ -41,8 +41,8 @@ def test_C군_종류마다_컨테이너_하나_옵션_전부(): def test_정의_검사_통과_판_이력(): doc = json.loads(Path(DEFINITION_PATH).read_text("utf-8")) - assert M02_SO_Definition.check(doc) == [] - assert M02_SO_Definition.history_path(doc["판"] - 1).is_file() + assert M01_SO_Definition.check(doc) == [] + assert M01_SO_Definition.history_path(doc["판"] - 1).is_file() def test_잇기는_컨테이너마다_집계_한_줄(): diff --git a/resources/tester/test_553_5_m01_m02.py b/resources/tester/test_553_5_m01_m02.py index d2903c4ec..4772ec67c 100644 --- a/resources/tester/test_553_5_m01_m02.py +++ b/resources/tester/test_553_5_m01_m02.py @@ -71,8 +71,12 @@ def test_m02_borrowed_m01_classes_follow_parts(): def _m02_src(suffix: str) -> dict[str, str]: out = {} - for sub in ("", "DataFlow", "StructOptions"): - out.update(_src(f"M02_MasterTemplete/{sub}".rstrip("/"), suffix)) + for folder in ( + "M02_MasterTemplete", + "M02_MasterTemplete/DataFlow", + "M01_MasterData/StructOptions", + ): + out.update(_src(folder, suffix)) return out diff --git a/resources/tester/test_701_1_b08_wall_summary.py b/resources/tester/test_701_1_b08_wall_summary.py index f651ca569..d766028a6 100644 --- a/resources/tester/test_701_1_b08_wall_summary.py +++ b/resources/tester/test_701_1_b08_wall_summary.py @@ -14,7 +14,7 @@ import pytest from B08_Quantity import B08_Quantity_Router_Summary as summary from B09_Estimation.B09_Estimation_Bill_Items import structure_items -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition +from M01_MasterData.StructOptions import M01_SO_Definition as definition def _item(key: str) -> dict: diff --git a/resources/tester/test_98_b08_pipe_summary.py b/resources/tester/test_98_b08_pipe_summary.py index ecc2964a4..71f7ce573 100644 --- a/resources/tester/test_98_b08_pipe_summary.py +++ b/resources/tester/test_98_b08_pipe_summary.py @@ -19,9 +19,9 @@ from pathlib import Path import pytest from B08_Quantity import B08_Quantity_Router_Summary as summary +from M01_MasterData.StructOptions import M01_SO_Definition as definition from M02_MasterTemplete import M02_Item_Snapshot as snapshots from M02_MasterTemplete import M02_Template_Layers as layers -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition COMBO = {"layer": "system", "owner": None, "key": "SS000011", "name": "횡단배수 배관"} OUT = {"layer": "company", "owner": "3", "key": "SC3-000001", "name": "기슭막이 메쌓기"} diff --git a/resources/tester/test_m02_empty_master.py b/resources/tester/test_m02_empty_master.py index 1cd51349d..b6a99dd7e 100644 --- a/resources/tester/test_m02_empty_master.py +++ b/resources/tester/test_m02_empty_master.py @@ -18,13 +18,13 @@ from fastapi.testclient import TestClient from common_util.common_util_auth import verify_session from config import config_system +from M01_MasterData.StructOptions import M01_SO_Router as so_router from M02_MasterTemplete import M02_Item_Copy as copies from M02_MasterTemplete import M02_MasterTemplete_Router_Items as items_router from M02_MasterTemplete import M02_MasterTemplete_Router_Layers as layers_router from M02_MasterTemplete import M02_MasterTemplete_Store as store from M02_MasterTemplete import M02_MasterTemplete_Tree as tree from M02_MasterTemplete import M02_Template_Layers as layers -from M02_MasterTemplete.StructOptions import M02_SO_Router as so_router from resources.tester.helper_m02_master_sample import copy_master_sample from resources.tester.test_item_copy_complete import ( # noqa: F401 — 복사본 world 고정물 FOLDER, @@ -93,7 +93,7 @@ def test_빈_마스터에서_첫_화면_나무_새_항목_지우기(empty): r["이름"] for r in client.get("/api/m02/layers/system/templates").json()["양식"] ] assert client.get("/api/m02/layers/system/structures/numbers").json() == {} - assert client.get("/api/m02/structure-options").status_code == 200 + assert client.get("/api/m01/structure-options").status_code == 200 assert client.get("/api/m02/items").json() == [] groups = client.get("/api/m02/items?all=1").json() # 고르기 모달 — 마스터 0 assert groups[0]["layer"] == "system" and groups[0]["items"] == [] diff --git a/resources/tester/test_m02_so_def_model.py b/resources/tester/test_m02_so_def_model.py index 6670f0937..f08359439 100644 --- a/resources/tester/test_m02_so_def_model.py +++ b/resources/tester/test_m02_so_def_model.py @@ -1,4 +1,4 @@ -"""M02 구조물 정의 편집 화면 자료 손질(`M02_SO_Def_Model.ts` · PLAN 48-2) 단위검증. +"""M02 구조물 정의 편집 화면 자료 손질(`M01_SO_Def_Model.ts` · PLAN 48-2) 단위검증. 프론트에 JS 테스트 러너가 없어 Node 헬퍼(`helper_m02_so_def_model.cjs`)가 TS 를 트랜스파일해 돌리고 pytest 는 그 결과(JSON)를 판정. @@ -6,7 +6,7 @@ pytest 는 그 결과(JSON)를 판정. 못박는 것 - 배치 격자: 안 정한 옵션은 차례대로 · 정한 자리 먼저 · 너비 ≤ 칸 수 · 안 씀 빠짐 · 겹침 찾음. - 규칙: 없는 값 · 자기 자신 · 없는 하위 선택지 · 그러면 비었음 · 좁힌 선택지 밖 기본값은 틀린 줄 - (서버 `M02_SO_Definition._rule_errors` 와 같은 뜻) · 고르기 아닌 상위는 값 검사 안 함. + (서버 `M01_SO_Definition._rule_errors` 와 같은 뜻) · 고르기 아닌 상위는 값 검사 안 함. - 저장 전 검사: 깨끗한 정의 = 빈 목록 · 이름 겹침 · 배치 겹침 · 빈 선택지 = 까닭 글. - 선택지 이름 바꿈 · 뺌은 그 옵션 기본값 · 같은 종류 규칙도 같이 고침. - 순서: 구조물군 = 키 차례 · 종류 = 같은 군 안에서만. diff --git a/resources/tester/test_m02_so_def_spec.py b/resources/tester/test_m02_so_def_spec.py index e575dad1a..4cc0f91a0 100644 --- a/resources/tester/test_m02_so_def_spec.py +++ b/resources/tester/test_m02_so_def_spec.py @@ -1,4 +1,4 @@ -"""M02 구조물 명세 이름 고치기(`M02_SO_Def_Spec_Model.ts` · PLAN 52-11) 단위검증. +"""M02 구조물 명세 이름 고치기(`M01_SO_Def_Spec_Model.ts` · PLAN 52-11) 단위검증. Node 헬퍼(`helper_m02_so_def_spec.cjs`)가 TS 를 트랜스파일해 진짜 정의 사본(메모리)으로 돌리고 pytest 는 그 결과(JSON)를 판정. diff --git a/resources/tester/test_m02_structure_def_screen.py b/resources/tester/test_m02_structure_def_screen.py index 6caec3093..0d246abcd 100644 --- a/resources/tester/test_m02_structure_def_screen.py +++ b/resources/tester/test_m02_structure_def_screen.py @@ -20,9 +20,9 @@ from fastapi.testclient import TestClient from B05_Profile import B05_Profile_Structures_Schema as schema from common_util.common_util_auth import verify_session -from M02_MasterTemplete.StructOptions.M02_SO_Router import read_router +from M01_MasterData.StructOptions.M01_SO_Router import read_router -URL = "/api/m02/structure-definition" +URL = "/api/m01/structure-definition" ADMIN = {"role": "SYSTEM_ADMIN", "user_id": 1} USER = {"role": "USER", "user_id": 2, "company_id": 1} @@ -43,7 +43,7 @@ def _client(session: dict) -> TestClient: def _screen_edit(doc: dict) -> dict: - """화면이 하는 고침 한 벌 — `M02_SO_Def*.ts` 가 만드는 꼴 그대로.""" + """화면이 하는 고침 한 벌 — `M01_SO_Def*.ts` 가 만드는 꼴 그대로.""" pipe = next(t for t in doc["types"] if t["type_id"] == "pipe") pipe["name"] = "배수관(고침)" kind = next(o for o in pipe["options"] if o["key"] == "pipe_kind") diff --git a/resources/tester/test_m02_structure_definition.py b/resources/tester/test_m02_structure_definition.py index 675dd2af3..e41e9247b 100644 --- a/resources/tester/test_m02_structure_definition.py +++ b/resources/tester/test_m02_structure_definition.py @@ -1,4 +1,4 @@ -"""M02 구조물 정의 한 벌(`/api/m02/structure-definition` · PLAN 48-1). +"""M02 구조물 정의 한 벌(`/api/m01/structure-definition` · PLAN 48-1). 못박는 것 - 판 1 = 옛 레지스트리 그대로 옮김(37종 · 옵션 235 · 키 그대로) · 검사 통과. @@ -22,10 +22,10 @@ from B05_Profile.B05_Profile_Structures_Repository import load_structures, save_ from B05_Profile.B05_Profile_Structures_Router import router as b05_router from B05_Profile.B05_Profile_Structures_Schema import StructureInstance, load_structure_types from common_util.common_util_auth import verify_session -from M02_MasterTemplete.StructOptions import M02_SO_Definition as definition -from M02_MasterTemplete.StructOptions.M02_SO_Router import read_router +from M01_MasterData.StructOptions import M01_SO_Definition as definition +from M01_MasterData.StructOptions.M01_SO_Router import read_router -URL = "/api/m02/structure-definition" +URL = "/api/m01/structure-definition" TYPES = "/api/projects/structure-types" ADMIN = {"role": "SYSTEM_ADMIN", "user_id": 1} USER = {"role": "USER", "user_id": 2, "company_id": 1} diff --git a/resources/tester/test_m02_structure_option_groups.py b/resources/tester/test_m02_structure_option_groups.py index ff0022b8f..9ebda935d 100644 --- a/resources/tester/test_m02_structure_option_groups.py +++ b/resources/tester/test_m02_structure_option_groups.py @@ -1,4 +1,4 @@ -"""M02 구조물 옵션 그룹(`/api/m02/structure-option-groups` · 정의 「그룹」 칸 · PLAN 46-2). +"""M02 구조물 옵션 그룹(`/api/m01/structure-option-groups` · 정의 「그룹」 칸 · PLAN 46-2). 못박는 것 - 「그룹」 이 `{}` 면 그룹 없음 · `/structure-types` 종류마다 `groups: []`. @@ -21,11 +21,11 @@ from fastapi.testclient import TestClient from B05_Profile import B05_Profile_Structures_Schema as schema from B05_Profile.B05_Profile_Structures_Router import router as b05_router from B05_Profile.B05_Profile_Structures_Schema import load_structure_types +from M01_MasterData.StructOptions.M01_SO_Router import router as m02_router from M02_MasterTemplete import M02_MasterTemplete_Store as store -from M02_MasterTemplete.StructOptions.M02_SO_Router import router as m02_router ROOT = Path(__file__).resolve().parents[2] -URL = "/api/m02/structure-option-groups" +URL = "/api/m01/structure-option-groups" TYPES = "/api/projects/structure-types" @@ -100,12 +100,3 @@ def test_틀린_그룹은_422_낡은_판은_409(client) -> None: assert client.put(URL, json={"판": "낡음", "그룹": {}}).status_code == 409 res = client.put(URL, json={"판": v1, "그룹": {}}) assert res.status_code == 200 and res.json()["그룹"] == {} - - -def test_좌측_정의_줄은_시스템_층에_늘_고쳐_씀은_시스템_관리자만() -> None: - """PLAN 48-2 — 다른 역할은 읽기만(화면이 칸을 잠금 · 서버 PUT 403).""" - side = (ROOT / "M02_MasterTemplete/M02_MasterTemplete_UI_Side.ts").read_text("utf-8") - assert "section(options.title" not in side # 716-3 — 옵션 줄은 M01 로 옮겨 좌측 칸에서 뺌 - folder = ROOT / "M02_MasterTemplete/StructOptions" - assert "buildGroupBlock(" in (folder / "M02_SO_Def.ts").read_text("utf-8") - assert "buildPlaceSelect(" in (folder / "M02_SO_Def_Options.ts").read_text("utf-8") diff --git a/resources/tester/test_m02_structure_options.py b/resources/tester/test_m02_structure_options.py index 39b7902b6..be88bed23 100644 --- a/resources/tester/test_m02_structure_options.py +++ b/resources/tester/test_m02_structure_options.py @@ -1,4 +1,4 @@ -"""M02 구조물 옵션 보이기(`/api/m02/structure-options` · 정의 「표시」 칸 · PLAN 48-1). +"""M02 구조물 옵션 보이기(`/api/m01/structure-options` · 정의 「표시」 칸 · PLAN 48-1). 못박는 것 - 「표시」 가 `{}` 면 `GET /api/projects/structure-types` 옵션이 모두 visible. @@ -18,11 +18,11 @@ from fastapi.testclient import TestClient from B05_Profile import B05_Profile_Structures_Schema as schema from B05_Profile.B05_Profile_Structures_Router import router as b05_router from B05_Profile.B05_Profile_Structures_Schema import load_structure_types +from M01_MasterData.StructOptions.M01_SO_Router import router as m02_router from M02_MasterTemplete import M02_MasterTemplete_Store as store -from M02_MasterTemplete.StructOptions.M02_SO_Router import router as m02_router ROOT = Path(__file__).resolve().parents[2] -URL = "/api/m02/structure-options" +URL = "/api/m01/structure-options" TYPES = "/api/projects/structure-types" @@ -107,22 +107,6 @@ def test_없는_종류_키_참거짓_아님은_422_낡은_판은_409(client) -> assert client.get(URL).json()["판"] == v1 -def test_좌측_줄은_구조물_집계_양식_아래_한_줄_같은_한_곳에서_지움() -> None: - side = (ROOT / "M02_MasterTemplete/M02_MasterTemplete_UI_Side.ts").read_text("utf-8") - # 716-3 — 옵션 줄은 M01 로 옮겨 좌측 칸에서 뺌(차례 = 일위대가 → 구조물 조합 → 도면 양식) - assert "options.title" not in side and "options.clear" not in side - order = side.split('className: "m02-side__lists ui-sidebar-panel",')[1].split("});")[0] - assert order.index("summary") < order.index("drawing,") - # 실무문서 칸은 걷음(732-1) - assert "practice" not in side - assert "matset" not in side - # 화면은 정의 한 벌로 읽고 씀(PLAN 48-2) · 보이기 체크는 정의 화면 옵션 줄 - api = (ROOT / "M02_MasterTemplete/StructOptions/M02_SO_Api.ts").read_text("utf-8") - assert 'call("/structure-definition")' in api - ui = (ROOT / "M02_MasterTemplete/StructOptions/M02_SO_Def_Options.ts").read_text("utf-8") - assert 'o.phase === "detail"' in ui # B06 전용 표시 - - def test_숨긴_옵션은_필수_아님_저장이_안_막힘(client, tmp_path, monkeypatch) -> None: """B05 필수(기본값 없음) 옵션 — 보이면 막고 숨기면 저장됨(다른 필수는 그대로).""" from B05_Profile import B05_Profile_Structures_Repository as repo diff --git a/resources/tester/test_m02_system_read.py b/resources/tester/test_m02_system_read.py index 5af19a703..1ba79c94c 100644 --- a/resources/tester/test_m02_system_read.py +++ b/resources/tester/test_m02_system_read.py @@ -14,11 +14,11 @@ from fastapi.testclient import TestClient from common_util.common_util_auth import verify_session from config import config_system +from M01_MasterData.StructOptions import M01_SO_Router as so_router from M02_MasterTemplete import M02_MasterTemplete_Router_Items as items_router from M02_MasterTemplete import M02_MasterTemplete_Router_Layers as layers_router from M02_MasterTemplete import M02_MasterTemplete_Store as store from M02_MasterTemplete import M02_Template_Layers as layers -from M02_MasterTemplete.StructOptions import M02_SO_Router as so_router from resources.tester.test_m02_structure import write_sample_table SYS = "/api/m02/layers/system" @@ -57,7 +57,7 @@ def test_세_계정_모두_마스터_층_읽기_200(world, role): f"{SYS}/templates/area/rv", f"{SYS}/structures/numbers", f"{SYS}/structure-combos", - f"{SYS}/structure-options", + "/api/m01/layers/system/structure-options", ): assert client.get(url).status_code == 200, url rows = client.get(f"{SYS}/templates").json()["양식"] diff --git a/resources/tester/test_structure_group_items.py b/resources/tester/test_structure_group_items.py index 2aca980a7..92d88e18b 100644 --- a/resources/tester/test_structure_group_items.py +++ b/resources/tester/test_structure_group_items.py @@ -18,10 +18,10 @@ import pytest from B05_Profile.B05_Profile_Structures_Schema import StructureInstance from common_util.common_util_drainage_pipes import parse_pipe_points from common_util.common_util_summary_item import parse_group_items +from M01_MasterData.StructOptions import M01_SO_Groups as groups from M02_MasterTemplete import M02_Item_Snapshot as snap from M02_MasterTemplete import M02_MasterTemplete_Store as store from M02_MasterTemplete import M02_Table_Fill as fill -from M02_MasterTemplete.StructOptions import M02_SO_Groups as groups from resources.tester.test_structures_summary_snapshot import ( # noqa: F401 — world 고정물 MS, PIPE, diff --git a/resources/tester/test_structures_summary_snapshot.py b/resources/tester/test_structures_summary_snapshot.py index ed8b3c2c4..783b454eb 100644 --- a/resources/tester/test_structures_summary_snapshot.py +++ b/resources/tester/test_structures_summary_snapshot.py @@ -21,10 +21,10 @@ from common_util import common_util_initial_snapshot as initial from common_util.common_util_drainage_pipes import PipePoint, parse_pipe_points from common_util.common_util_summary_item import parse_summary_item from config import config_system +from M01_MasterData.StructOptions import M01_SO_Groups as groups from M02_MasterTemplete import M02_Item_Snapshot as snap from M02_MasterTemplete import M02_Table_Fill as fill from M02_MasterTemplete import M02_Template_Layers as layers -from M02_MasterTemplete.StructOptions import M02_SO_Groups as groups from resources.tester.helper_m02_master_sample import SAMPLE REAL = SAMPLE # 시험 안 견본(PLAN 26-5a) — 실제 마스터 안 읽음