[feat] negodata/backend: 상품·협력사·견적 도메인 CRUD + delivery_type 코드화 + 공용 /v1/enums
- item/supplier/quotation/quotation_setting CRUD·service·router 추가 - item protocol delivery_type str→int (ERD/스키마 SMALLINT 일치) - DeliveryType enum + 한글 라벨, 공용 GET /v1/enums (도메인 코드 메타데이터) - CompanyBrief → CompanyData 로 *Data 네이밍 통일 - CORS: WebServerConfig.client_url(단일) 도입 (config_models/router) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
7e2d5e5978
commit
1f778ab975
33 files changed
+2255
-85
No files matched your search
@@ -0,0 +1,21 @@
|
||||
from fastapi import APIRouter
|
||||
|
||||
from common.enums import DOMAIN_ENUMS, ENUM_LABELS
|
||||
from router.v1.validator.dependencies import RemoveNoneResponse
|
||||
from .protocol import EnumOption, Res_Enums
|
||||
|
||||
# 도메인 코드 enum 메타데이터(공용). 프론트가 페이지 진입 시 드롭다운을 이걸로 채운다.
|
||||
router = APIRouter(prefix="/v1", tags=["Enums"], responses={404: {"description": "Not found"}})
|
||||
|
||||
|
||||
@router.get(path="/enums", response_model=Res_Enums, summary="도메인 코드 enum 전체")
|
||||
async def list_enums():
|
||||
res = Res_Enums()
|
||||
res.enums = {
|
||||
key: [
|
||||
EnumOption(value=member.value, name=member.name, label=ENUM_LABELS.get(member, member.name))
|
||||
for member in enum_cls
|
||||
]
|
||||
for key, enum_cls in DOMAIN_ENUMS.items()
|
||||
}
|
||||
return RemoveNoneResponse(res)
|
||||
Reference in new issue
Block a user