- partner.supplier_items 매핑테이블 신설: supply_type(0없음/1유통/2제조/3총판), 부분 유니크 인덱스(soft-delete 인지). quotations.supplier_type와 의미단위 달라 컬럼명 supply_type. - 백엔드: supplier_item CRUD/service/router(/v1/supplier-item, by-supplier·by-item·create·bulk·update·delete). 소유권 company 스코프. ErrorType.SUPPLIER_ITEM_NOT_FOUND 추가. - DDL: 01-schema/04-alter(날짜접미 리네임) + dev DB 반영. - 프론트(feature): 협력사 엑셀 '취급상품' 컬럼(콤마 상품명→일괄매핑, 이름 미매칭 스킵+리포트, 유형 안받고 없음), 협력사 상세 취급상품 관리(추가/삭제/유형변경 즉시반영), 견적모달 협력사 리스트에 선택상품 공급유형 배지. - 재사용 서버검색 Combobox 신설 → 취급상품·견적상품·협력사초청·협상카드 픽리스트에 적용(size 100 캡 해소, 검색은 서버 ILIKE). 견적 선택상품 파생값은 useGetItem 단건조회로 안정화. - orval 재생성(supplier-item 클라이언트/모델). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
61 lines
1.4 KiB
Python
61 lines
1.4 KiB
Python
import uuid
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import ConfigDict
|
|
|
|
from common.models.gmodel import Res_WebPacketProtocol, WebPacketProtocol
|
|
|
|
|
|
class SupplierItemProtocol(WebPacketProtocol):
|
|
pass
|
|
|
|
|
|
class Req_CreateSupplierItem(SupplierItemProtocol):
|
|
supplier_id: uuid.UUID
|
|
item_id: uuid.UUID
|
|
supply_type: int = 0
|
|
|
|
|
|
class Req_UpdateSupplyType(SupplierItemProtocol):
|
|
supply_type: int
|
|
|
|
|
|
class Req_BulkMapByNames(SupplierItemProtocol):
|
|
names: list[str] = []
|
|
|
|
|
|
class SupplierItemData(WebPacketProtocol):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
supplier_item_id: uuid.UUID
|
|
item_id: uuid.UUID
|
|
item_name: str
|
|
item_code: Optional[str] = None
|
|
supply_type: int
|
|
created_at: Optional[datetime] = None
|
|
updated_at: Optional[datetime] = None
|
|
|
|
|
|
class ItemSupplyType(WebPacketProtocol):
|
|
supplier_id: uuid.UUID
|
|
supply_type: int
|
|
|
|
|
|
class Res_SupplierItem(Res_WebPacketProtocol):
|
|
supplier_item: Optional[SupplierItemData] = None
|
|
|
|
|
|
class Res_SupplierItemList(Res_WebPacketProtocol):
|
|
supplier_items: list[SupplierItemData] = []
|
|
|
|
|
|
class Res_ItemSupplyTypeList(Res_WebPacketProtocol):
|
|
suppliers: list[ItemSupplyType] = []
|
|
|
|
|
|
class Res_BulkMapByNames(Res_WebPacketProtocol):
|
|
created_count: int = 0
|
|
skipped_count: int = 0 # 이미 매핑돼 있어 건너뛴 상품 수
|
|
unmatched: list[str] = [] # 회사 상품 목록에 이름이 없어 매핑 못한 입력명들
|