refactor(M02): 자재 조합(UM) 지움 — 좌측 컨테이너 · 재료산출 옆 판 · 길(material-combos · 갈라 내기 · 키 적기 자재조합) · 저장소 · 틀 검사 · 복사 길의 UM 줄 · 시스템 층 표 · fixture · 시험
- 자재 고르기 창은 M02_Material_Pick.ts 로 옮겨 남김 - storage 층(회사 · 개인 · 프로젝트) 자재조합.json 은 지우지 않음(읽기만 끊음) - check_master 틀 검사 · _틀.md 11장 · _화면_계약.md 자재 조합 절 정리 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPJGtfXo6GMbcpiboQC4uK
This commit is contained in:
@@ -11,7 +11,6 @@ from fastapi import APIRouter, HTTPException, Query
|
||||
from pydantic import BaseModel
|
||||
|
||||
from M02_MasterTemplete import M02_MasterTemplete_Branch as branch
|
||||
from M02_MasterTemplete import M02_MasterTemplete_Matset as matset
|
||||
from M02_MasterTemplete import M02_MasterTemplete_Options as options
|
||||
from M02_MasterTemplete import M02_MasterTemplete_Store as store
|
||||
|
||||
@@ -30,18 +29,6 @@ class BranchBody(BaseModel):
|
||||
판: str = "" # 집계표 판 — 주면 어긋날 때 409
|
||||
|
||||
|
||||
class MaterialBranchBody(BaseModel):
|
||||
본뜬키: str = "" # 빈 글 = 이 열의 첫 자재 조합
|
||||
담은자재: list[dict[str, Any]]
|
||||
이름: str = ""
|
||||
판: str = ""
|
||||
|
||||
|
||||
class MatsetBody(BaseModel):
|
||||
판: str = "" # 자재 조합 표 판 — 어긋나면 409
|
||||
줄: dict[str, Any]
|
||||
|
||||
|
||||
class OptionsBody(BaseModel):
|
||||
판: str = "" # 옵션 표시 표 판 — 어긋나면 409
|
||||
표시: dict[str, Any] # {종류: {옵션 키: 참 · 거짓}} — 거짓만 남김
|
||||
@@ -82,58 +69,18 @@ def post_structure_combo(column: str, body: BranchBody) -> dict:
|
||||
return _call(branch.branch_combo, column, body.본뜬키, body.담은로직, body.이름, body.판)
|
||||
|
||||
|
||||
@router.post("/structures/{column}/material-combo")
|
||||
def post_structure_material_combo(column: str, body: MaterialBranchBody) -> dict:
|
||||
"""자재 조합 갈라 내기 — 같은 규칙(같은 자재 집합이면 있는 키 · 아니면 새 UM)."""
|
||||
return _call(
|
||||
branch.branch_material_combo, column, body.본뜬키, body.담은자재, body.이름, body.판
|
||||
)
|
||||
|
||||
|
||||
class UseComboBody(BaseModel):
|
||||
종류: str # 일위대가 · 자재조합
|
||||
종류: str # 일위대가
|
||||
키: str
|
||||
판: str = "" # 집계표 판 — 주면 어긋날 때 409
|
||||
|
||||
|
||||
@router.post("/structures/{column}/use-combo")
|
||||
def post_structure_use_combo(column: str, body: UseComboBody) -> dict:
|
||||
"""있는 조합을 이 열에 씀 — 집계표 그 열 일위대가 · 자재조합 키만 바꿈(조합은 그대로)."""
|
||||
"""있는 조합을 이 열에 씀 — 집계표 그 열 일위대가 키만 바꿈(조합은 그대로)."""
|
||||
return _call(branch.use_combo, column, body.종류, body.키, body.판)
|
||||
|
||||
|
||||
# 자재 조합 표(마스터 템플릿 `자재조합.json` · 키 UM) — 좌측 「자재 조합」 컨테이너
|
||||
@router.get("/material-combos")
|
||||
def get_material_combos() -> dict:
|
||||
"""표 통째 — `{판, 줄}`(줄마다 담은 자재 포함)."""
|
||||
return _call(matset.listing)
|
||||
|
||||
|
||||
@router.get("/material-combos/{key}")
|
||||
def get_material_combo(key: str) -> dict:
|
||||
"""자재 조합 한 줄(키 UM) — 키 · 이름 · 담은자재 · 본뜬키 · 소유 · 비고."""
|
||||
return _call(branch.material_combo, key)
|
||||
|
||||
|
||||
@router.post("/material-combos")
|
||||
def post_material_combo(body: MatsetBody) -> dict:
|
||||
"""새로 · 본떠 만들기(`줄.본뜬키`) — 키는 표 「다음」 번호 · `{키, 판, 줄}`."""
|
||||
return _call(matset.create, body.줄, body.판)
|
||||
|
||||
|
||||
@router.put("/material-combos/{key}")
|
||||
def put_material_combo(key: str, body: MatsetBody) -> dict:
|
||||
"""고치기 — 이름 · 비고 · 담은자재(본뜬키 · 소유는 있던 것)."""
|
||||
return _call(matset.edit, key, body.줄, body.판)
|
||||
|
||||
|
||||
@router.delete("/material-combos/{key}")
|
||||
def delete_material_combo(key: str, 판: str = "") -> dict:
|
||||
"""지우기 — 구조물 열이 쓰면 409 `{errors, users}`."""
|
||||
return _call(matset.delete, key, 판)
|
||||
|
||||
|
||||
# 구조물 옵션 보이기 — B05/B06 폼에 보일 옵션(마스터 템플릿 `구조물옵션표시.json`)
|
||||
@router.get("/structure-options")
|
||||
def get_structure_options() -> dict:
|
||||
"""`{판, 표시, 종류}` — 표시 = 숨긴 것만 · 종류 = 옵션 있는 종류와 그 옵션."""
|
||||
|
||||
Reference in New Issue
Block a user