From e371b431654f7763e41646299c877177e5f1ff27 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Tue, 17 Nov 2026 16:31:55 +0900 Subject: [PATCH] =?UTF-8?q?chore(853-3):=20853-1=20=C2=B7=20853-2=20?= =?UTF-8?q?=EA=B0=80=20=EB=84=98=EA=B8=B4=20=EA=B2=83=20=EA=B1=B7=EC=9D=8C?= =?UTF-8?q?=20=E2=80=94=20=EB=AC=B6=EC=9D=8C=20=E2=91=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 껍데기 M01_MasterData_UI_Logic_Money.ts 지움 — M02 네 파일(Labor_Diagram · LogicMats · MatTable · Rows) import 를 공용 common_util_money 로 - M01 Parts.of_machine(비시험 0) · Equation.links(비시험 0 · Doc.candidates 와 같은 함수) 지움 · 시험 813-2 해당 줄 뺌 · 800-2 = Doc.candidates 로 - 공용 사전 죽은 M01_ 키 13(locale_m1 11 · locale_machine 2 — 저장소 전체 낱말 0 · 조립 키 0) 지움 - 길 POST /layers/{층}/my-machines/draft(화면 0) + 몸 칸 키 · 표지 지움 · 서버 길 481 → 480 · 시험 827-1 남의 층 403 = 만들기 길로 봄 - 남김: Equation.export_row — 비시험 0 이나 시험 796-1 · 800-2 의 수식 모델(옛 엔진 · edit_row 왕복) 바탕 → 옛 엔진 은퇴(걸음 2)와 같이 · MyMachine_Draft.check — 시험 827-1 이 미리 셈 · 저장 셈과 맞대는 기준값 - typecheck 0 Co-Authored-By: Claude Opus 5.5 --- M01_MasterData/M01_MasterData_Equation.py | 8 +------- M01_MasterData/M01_MasterData_Parts.py | 13 ------------- M01_MasterData/M01_MasterData_UI_Logic_Money.ts | 11 ----------- .../M02_MasterTemplete_Labor_Diagram.ts | 2 +- .../M02_MasterTemplete_Labor_LogicMats.ts | 2 +- .../M02_MasterTemplete_Labor_MatTable.ts | 2 +- .../M02_MasterTemplete_Labor_Rows.ts | 2 +- M02_MasterTemplete/M02_MyMachine_Router.py | 15 +-------------- resources/tester/test_800_2_equation_layout.py | 7 ++++--- resources/tester/test_813_2_parts.py | 4 ---- resources/tester/test_827_1_machine_window.py | 2 +- ui_template/ui_template_locale_m1.ts | 11 ----------- ui_template/ui_template_locale_machine.ts | 2 -- 13 files changed, 11 insertions(+), 70 deletions(-) delete mode 100644 M01_MasterData/M01_MasterData_UI_Logic_Money.ts diff --git a/M01_MasterData/M01_MasterData_Equation.py b/M01_MasterData/M01_MasterData_Equation.py index 53906fd4a..2e67c9895 100644 --- a/M01_MasterData/M01_MasterData_Equation.py +++ b/M01_MasterData/M01_MasterData_Equation.py @@ -3,7 +3,7 @@ 모델 = `scripts/master_equation.py`(나무 · 변수 표) · `master_equation_edit.py`(고침 · 검사) · 키보드 글 번역 · 상한 = M02 단가산출 식 칸과 한 벌(`M02_Sangeun_Formula` 불러 씀 · 고치지 않음) · 셈 = 엔진 한 벌(③ 서버 단독 · 브라우저 값 받아 적지 않음) · 저장 = 기존 M01 `/save`(개정확인) · -M02 사본(795-1)은 `export_row` · `edit_row` 를 사본 줄로 부름 · 시험 `test_796_1_formula_model.py`. +M02 사본(795-1)은 `edit_row` 를 사본 줄로 부름 · `export_row` 는 시험(796-1 · 800-2)의 수식 모델 바탕(옛 엔진 은퇴 때 같이). """ from __future__ import annotations @@ -15,7 +15,6 @@ from M01_MasterData import M01_MasterData_Store as store _ERR = (store.cm.mf.FormulaError, ArithmeticError, KeyError, TypeError, ValueError) import master_equation as meq # noqa: E402 — `store` 가 scripts 를 길에 둔 뒤 -import master_equation_link as link # noqa: E402 import master_equation_edit as me # noqa: E402 @@ -56,8 +55,3 @@ def edit_row(whole, row: dict, edits: list) -> tuple[dict, list[str]]: """고침 → (새 줄, 까닭) — 까닭 있으면 저장 안 됨(M01 · M02 사본 같은 함수).""" new, why, _ = me.apply(whole, row, edits, words) return new, why - - -def links(ask: dict) -> dict: - """새 기호 연결 후보(800-3) — {갈래: 표 | 요소 | 로직, 검색, 분류?} → {후보, 더있음} · 읽기만.""" - return link.candidates(store.loaded()[1], ask) diff --git a/M01_MasterData/M01_MasterData_Parts.py b/M01_MasterData/M01_MasterData_Parts.py index d3267715c..451fba9c8 100644 --- a/M01_MasterData/M01_MasterData_Parts.py +++ b/M01_MasterData/M01_MasterData_Parts.py @@ -5,7 +5,6 @@ 틀 = `_수식문서_틀.md` 9 장. - 단가산출 기초 목록 · 찾아 넣기 「다른 단가산출」 목록에서 뺌(`strip`) — 키로 열기 · 셈 · 부르기는 그대로 - 기종 → 그 기종 기계가 쓰는 기계경비식 · 작업량 틀(`of_kind` · M01 「기계」 화면) -- 기계 원문번호 → 그 기종 작업량 틀 문서(`of_machine` · 줄 쌓기 기계 넣기) 쓰기 없음 · 로그인 사용자 모두(마스터 읽기). """ @@ -75,15 +74,3 @@ def of_kind(group: str, detail: str = "") -> dict[str, list]: used[str(got["키"])] = used.get(str(got["키"]), 0) + 1 rule = [{**_brief(k, docs[k]), "기계수": n} for k, n in used.items() if k in docs] return {"기계경비식": rule, "작업량 틀": [_brief(k, d) for k, d in _templates(detail)]} - - -def of_machine(no: str) -> dict[str, Any]: - """줄 쌓기 기계 넣기 — 기계 원문번호 → {기계 {이름 · 규격 · 상세구분}, 틀 [{… 문서}]}.""" - row = next((m for m in _machines() if str(m.get("원문번호")) == str(no)), None) - if not row: - raise store.StoreError(404, f"없는 기계 「{no}」") - kind = str(row.get("상세구분") or "") - return { - "기계": {"이름": row.get("이름"), "규격": row.get("규격") or "", "상세구분": kind}, - "틀": [{**_brief(k, d), "문서": d} for k, d in _templates(kind)], - } diff --git a/M01_MasterData/M01_MasterData_UI_Logic_Money.ts b/M01_MasterData/M01_MasterData_UI_Logic_Money.ts deleted file mode 100644 index a5e53dc8f..000000000 --- a/M01_MasterData/M01_MasterData_UI_Logic_Money.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* ============================================================================= - * M01_MasterData_UI_Logic_Money.ts - * 돈 모양 — 공용 꼴 한 벌(`common_util/common_util_money.ts`)을 다시 내보냄. 부르는 쪽은 그대로. - * ========================================================================== */ - -export { - formatLineMoney, - formatMoney, - formatNumber, - formatPrice, -} from "../common_util/common_util_money"; diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_Diagram.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_Diagram.ts index d0eedf3a9..0e508bc0c 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_Diagram.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_Diagram.ts @@ -10,7 +10,7 @@ import { currentLanguageIndex } from "@ui/ui_template_locale"; import { wheelZoomsIn } from "../A00_Common/touch_bridge"; import { guardMenuAfterDrag, isAuxPanButton } from "../A00_Common/input_prefs"; import { createButton, el } from "@ui/ui_template_elements"; -import { formatMoney } from "../M01_MasterData/M01_MasterData_UI_Logic_Money"; +import { formatMoney } from "../common_util/common_util_money"; import "./M02_MasterTemplete_Labor_Diagram.css"; import { createEmpty } from "@ui/ui_template_empty"; diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_LogicMats.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_LogicMats.ts index 4c9548b3e..4b9d04872 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_LogicMats.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_LogicMats.ts @@ -9,7 +9,7 @@ * ========================================================================== */ import { createButton, el } from "@ui/ui_template_elements"; -import { formatMoney } from "../M01_MasterData/M01_MasterData_UI_Logic_Money"; +import { formatMoney } from "../common_util/common_util_money"; import { openPickTable } from "../M01_MasterData/M01_MasterData_UI_Logic_PickTable"; import { headWord } from "../M01_MasterData/M01_MasterData_UI_LogicLab_Modal"; import type { LaborCalc, LaborRow, MatMarkKey } from "./M02_MasterTemplete_Labor_Api"; diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_MatTable.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_MatTable.ts index 7c6be0e7d..73bd86f45 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_MatTable.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_MatTable.ts @@ -6,7 +6,7 @@ * ========================================================================== */ import { createButton, el } from "@ui/ui_template_elements"; -import { formatMoney } from "../M01_MasterData/M01_MasterData_UI_Logic_Money"; +import { formatMoney } from "../common_util/common_util_money"; import type { LaborCalc, LaborCalcLine, diff --git a/M02_MasterTemplete/M02_MasterTemplete_Labor_Rows.ts b/M02_MasterTemplete/M02_MasterTemplete_Labor_Rows.ts index 2865c41dd..293af59e2 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Labor_Rows.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Labor_Rows.ts @@ -15,7 +15,7 @@ import { createButton, createSelectField, el } from "@ui/ui_template_elements"; import { HOPYO_TAG } from "@ui/ui_template_hopyo_grid"; import { pctView } from "../M01_MasterData/M01_MasterData_UI_Logic_Api"; -import { formatLineMoney, formatMoney } from "../M01_MasterData/M01_MasterData_UI_Logic_Money"; +import { formatLineMoney, formatMoney } from "../common_util/common_util_money"; import type { ItemLogic } from "./M02_MasterTemplete_Api_Fetch"; import type { LaborCalc, diff --git a/M02_MasterTemplete/M02_MyMachine_Router.py b/M02_MasterTemplete/M02_MyMachine_Router.py index 31ee23219..ceb71b437 100644 --- a/M02_MasterTemplete/M02_MyMachine_Router.py +++ b/M02_MasterTemplete/M02_MyMachine_Router.py @@ -3,7 +3,7 @@ GET 목록(줄마다 시간당 · 쓰는곳수) · GET `/{키}` 하나(+시간당 · 쓰는곳 · 같은이름) · POST 만들기 몸 {줄?, 본뜬?: M01 · 내 기계 키(「비슷한 기계에서 시작」)} · 만들기 · 고치기 = M01 과 같은 이름 · 규격 409(840-2) · PUT `/{키}` 몸 {줄} · POST `/{키}/impact` 몸 {줄} = 저장 전 영향(848-5 · 쓰기 없음) · DELETE `/{키}`(답 = 쓰는곳 — 그 단가산출은 사본의 마지막 값 그대로) · -POST `/draft` 몸 {줄, 키?, 본뜬?} = 단가산출 기계 창 [확인](827-1 · 쓰기 없음 · 층 쓰기 권한) → {줄, 셈값, 시간당}. +옛 POST `/draft`(기계 창 [확인] · 화면 0)은 853-3 에서 지움 — 확인 셈 `M02_MyMachine_Draft.check` 는 시험 827-1 기준값으로 남김. 권한 = 층 권한 한 벌(`Router_Items._root` — 본인 개인 층 · 맡은 회사 관리자) · 개인 층만(그 밖 404). ⚠ 등록은 `main.py`(로그인만). """ @@ -17,7 +17,6 @@ from pydantic import BaseModel from common_util.common_util_auth import verify_session from M02_MasterTemplete import M02_MyMachine as mym -from M02_MasterTemplete import M02_MyMachine_Draft as draft from M02_MasterTemplete import M02_MyMachine_Impact as impact from M02_MasterTemplete.M02_MasterTemplete_Router_Items import Session, _call, _root @@ -28,8 +27,6 @@ PATH = "/layers/{layer}/my-machines" class MachineBody(BaseModel): 줄: dict[str, Any] | None = None 본뜬: str | None = None - 키: str | None = None # 초안 확인(827-1) — 고칠 내 기계 - 표지: str | None = None # 초안 확인(827-1) — 화면이 정한 표지(셈 기록 열쇠) def _folder(session: Session, layer: str, owner: str | None, write: bool = False): @@ -43,16 +40,6 @@ def my_machines(layer: str, owner: str | None = None, session: Session = Depends return _call(_folder(session, layer, owner), mym.listing) -@router.post(PATH + "/draft") -def my_machine_draft( - layer: str, - body: MachineBody, - owner: str | None = None, - session: Session = Depends(verify_session), -): - return _call(_folder(session, layer, owner, True), draft.check, body.model_dump()) - - @router.get(PATH + "/{key}") def my_machine( layer: str, key: str, owner: str | None = None, session: Session = Depends(verify_session) diff --git a/resources/tester/test_800_2_equation_layout.py b/resources/tester/test_800_2_equation_layout.py index 65fb20dff..079c35b7e 100644 --- a/resources/tester/test_800_2_equation_layout.py +++ b/resources/tester/test_800_2_equation_layout.py @@ -9,6 +9,7 @@ from pathlib import Path ROOT = Path(__file__).resolve().parents[2] sys.path[:0] = [str(ROOT), str(ROOT / "resources/master_data/scripts")] +from M01_MasterData import M01_MasterData_Doc as doc # noqa: E402 from M01_MasterData import M01_MasterData_Equation as eq # noqa: E402 from M01_MasterData import M01_MasterData_Store as store # noqa: E402 @@ -117,10 +118,10 @@ def test_drop_guard_and_unused_input(): def test_candidates(): whole = store.loaded()[1] - got = eq.links({"갈래": "표", "검색": "합판거푸집 폼타이", "분류": ""}) + got = doc.candidates({"갈래": "표", "검색": "합판거푸집 폼타이", "분류": ""}) assert got["후보"] and "조건" in got["후보"][0] - assert eq.links({"갈래": "요소", "검색": "형틀목공", "분류": "인력"})["후보"] - assert eq.links({"갈래": "로직", "검색": "합판거푸집", "분류": ""})["후보"] + assert doc.candidates({"갈래": "요소", "검색": "형틀목공", "분류": "인력"})["후보"] + assert doc.candidates({"갈래": "로직", "검색": "합판거푸집", "분류": ""})["후보"] assert whole is not None diff --git a/resources/tester/test_813_2_parts.py b/resources/tester/test_813_2_parts.py index bb8997c32..017bf00dc 100644 --- a/resources/tester/test_813_2_parts.py +++ b/resources/tester/test_813_2_parts.py @@ -95,10 +95,6 @@ def test_기계_부품(): assert {"GC001147", "GF000088"} <= tpl and len(tpl) == 15 coef = m01_router.get_parts("계수식")["계수식"] assert {x["키"] for x in coef} == {"GC001143", "GC001191", "GC001192", "GC001193"} - one = parts.of_machine("0201-0070") - assert one["기계"] == {"이름": "굴착기(무한궤도)", "규격": "0.7㎥", "상세구분": "굴착기"} - by = {t["키"]: t for t in one["틀"]} - assert by["GC001147"]["규격"] == "버킷용량" and by["GF000088"]["문서"]["결과"] == "Q" def test_변환기가_표지를_옮김(): diff --git a/resources/tester/test_827_1_machine_window.py b/resources/tester/test_827_1_machine_window.py index a3259c05d..4532bd602 100644 --- a/resources/tester/test_827_1_machine_window.py +++ b/resources/tester/test_827_1_machine_window.py @@ -201,7 +201,7 @@ def test_company_and_other_refused(world): _at(world["company"], path.preview, sk, {"문서": doc}) assert e.value.status == 404 with pytest.raises(HTTPException) as e: - route.my_machine_draft("personal", route.MachineBody(줄=_body()), "7/43", USER) + route.my_machine_create("personal", route.MachineBody(줄=_body()), "7/43", USER) assert e.value.status_code == 403 with pytest.raises(HTTPException) as e: doc_route.save_doc("personal", sk, doc_route.DocBody(문서=doc, 판=""), "7/43", USER) diff --git a/ui_template/ui_template_locale_m1.ts b/ui_template/ui_template_locale_m1.ts index 5b0f36726..36fc7bbe3 100644 --- a/ui_template/ui_template_locale_m1.ts +++ b/ui_template/ui_template_locale_m1.ts @@ -5,7 +5,6 @@ export const ui_locales_m1 = { B01_Dashboard_MasterElements: ["마스터 데이터", "Master Data"], - M01_LogicTab: ["로직", "Logic"], M01_Title: ["마스터 요소", "Master Elements"], M01_AdminOnly: ["시스템 관리자만 볼 수 있음", "System administrators only"], M01_LoadFailed: ["마스터 요소를 못 읽음", "Failed to load master elements"], @@ -44,15 +43,7 @@ export const ui_locales_m1 = { M01_ProcureSearch: ["이름·규격 검색", "Find by name or spec"], M01_ProcureCut: ["연결 끊기", "Unlink"], M01_ProcureClose: ["닫기", "Close"], - M01_PriceFind: ["가격 연결", "Link price"], - M01_PriceTitle: ["가격 연결 고르기", "Pick price source"], - M01_PriceCol: ["가격 연결", "Price link"], - M01_PriceCond: ["조건 연결 (지역은 입력)", "Link by condition (region as input)"], - M01_PriceCondName: ["이름", "Name"], - M01_PriceCondSpec: ["규격", "Spec"], - M01_PriceCondUsed: ["후보 조건", "Condition"], M01_Govt: ["관급", "Govt"], - M01_OnlyUnlinked: ["미연결만", "Unlinked only"], M01_JobFind: ["직종 선택", "Pick job"], M01_JobTitle: ["준용 직종 고르기", "Pick substitute job"], M01_JobCol: ["준용", "Substitute"], @@ -66,7 +57,6 @@ export const ui_locales_m1 = { M01_MachineDetail: ["상세구분", "Detail"], M01_UsageTarget: ["대상", "Target"], M01_TableUsage: ["용도", "Usage"], - M01_TableUsageLogicCount: ["로직 {value}개", "{value} logic rules"], M01_OpenLogic: ["눌러 로직 탭으로", "Click to jump to the Logic tab"], M01_GroupLabor: ["인력", "Labor"], M01_GroupMaterial: ["재료", "Materials"], @@ -75,7 +65,6 @@ export const ui_locales_m1 = { M01_GroupFactor: ["계수", "Factors"], M01_GroupExchange: ["환율", "Exchange rates"], M01_GroupRate: ["요율", "Rates"], - M01_GroupLogic: ["단가산출 기초", "Unit-price logic"], B01_CalcSites_Title: ["계산 자리", "Calc sites"], B01_CalcSites_Desc: ["조작 중 계산 = 브라우저 · 서버 고름", "Browser or server while editing"], B01_CalcSites_ServerCount: ["지금 서버 {value} 줄", "{value} rows on server now"], diff --git a/ui_template/ui_template_locale_machine.ts b/ui_template/ui_template_locale_machine.ts index 4bf5609e8..625811d26 100644 --- a/ui_template/ui_template_locale_machine.ts +++ b/ui_template/ui_template_locale_machine.ts @@ -51,7 +51,6 @@ export const ui_locales_machine = { M01_MachineHourly: ["시간당 경비", "Hourly cost"], M01_MachineUse: ["사용", "Active"], M01_MachineShowOff: ["비활성 같이 보기", "Show inactive"], - M01_MachineMeta: ["원문 · 구분", "Source · group"], M01_MachineUses: ["쓰는 곳", "Used by"], M01_MachineNoUses: ["쓰는 곳 없음", "Not used"], M01_MachineFormula: ["쓰는 계산식", "Hourly formula"], @@ -76,7 +75,6 @@ export const ui_locales_machine = { "Unsaved edits. Leave? (edits stay in the draft)", ], M01_MachineNotFound: ["그 기계가 없음", "Machine not found"], - M01_MachineReadOnly: ["읽기만 — 시스템 관리자만 고침", "Read only — system admins edit"], M01_MachineErrors: ["고칠 칸이 있음", "Fix the marked fields"], M01_MachineDetailGroup: ["상세구분", "Sub-group"], M01_MachineSourceNo: ["원문번호", "Source no."],