Merge remote-tracking branch 'origin/dev' into main_desktop_1

# Conflicts:
#	M01_MasterData/M01_MasterData_Router.py
#	resources/master_data/_화면_계약.md
This commit is contained in:
2026-09-21 20:22:00 +09:00
8 changed files with 949 additions and 5 deletions
+14
View File
@@ -73,6 +73,14 @@ class FormulaLogic(BaseModel):
본뜬키: str = ""
class DraftLogic(BaseModel):
text: str # 줄로 적은 식 — 줄마다 「이름 = 식」
decided: dict[str, Any] = {} # 변수마다 정한 것 {이름: {무엇, 단위, 비목, 요소·찾기·값}}
head: dict[str, Any] | None = None # 로직 머리(이름 · 결과단위 …) — 주면 로직 줄까지
save: bool = False
owner: str = make.OWNERS[0]
def _num(v):
"""Decimal → JSON 수(그냥 두면 글자로 나감)."""
if isinstance(v, Decimal):
@@ -236,3 +244,9 @@ def get_logic_formula(key: str) -> dict:
def post_logic_formula_save(body: FormulaLogic) -> dict:
"""고친 식 묶음을 자체 로직(`GX`)으로 — 별칭은 원문으로 되돌려 저장."""
return _call(make.logic_from_formula, body.로직, body.별칭, body.owner, body.이름, body.본뜬키)
@router.post("/logic/draft")
def post_logic_draft(body: DraftLogic) -> dict:
"""식으로 새 로직 만들기 — 변수 뽑기 · 검사 · 로직 줄로 옮기기(`save` 면 저장까지)."""
return _call(make.logic_draft, body.text, body.decided, body.head, body.save, body.owner)