feat(M01): 사람이 읽는 식 줄 API — 비목 묶음마다 「단가 * 수량식 = 금액」 과 소계

- 엔진 `resources/master_data/scripts/master_text.py` — 식 마디를 그 자리에서 나온 수로 풀어 한 줄 글로(찾기·로직·만약·중간 값·요소는 글자로 안 나감 · 「… / 100」 은 「… %」 · 수는 화면과 같은 자릿수)
- `POST /text` — 몸은 `/calc` 와 같음 · 답 `{ok, groups: [{비목, 줄, 소계, 끝수}], 계}` · 멈추면 까닭 한 줄
- 중간 값·끝수는 따로 줄로 안 보임(끝수는 소계 옆 한 마디) · 덧줄은 그 비목의 한 줄 · 하위 로직 줄은 비목마다 한 줄
- 단가 0 이거나 안 쓰는 줄은 까닭 한 마디
- 시험 `resources/tester/test_m01_text.py` 6 통과(13-4-1 · 12-4 · 12-17-1 · 계가 `/calc` 와 같음) · M01 시험 41 통과 · typecheck 통과 · 일괄 시험 계산 1,291 그대로

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JgUhN55Z3BCYhUJTjwTNfj
This commit is contained in:
2026-09-21 19:37:55 +09:00
co-authored by Claude Opus 5
parent f062e51e0d
commit d12f471c93
5 changed files with 323 additions and 0 deletions
+6
View File
@@ -185,6 +185,12 @@ def post_calc(body: CalcBody) -> dict:
return _call(store.calc, body.key, body.inputs, body.row, body.file)
@router.post("/text")
def post_text(body: CalcBody) -> dict:
"""읽는 식 줄 — 몸은 `/calc` 와 같음."""
return _call(store.text, body.key, body.inputs, body.row, body.file)
@router.post("/save")
def post_save(body: SaveBody) -> dict:
return {"files": _call(store.save, [f.model_dump() for f in body.files])}