- router: 채팅 라우터/프로토콜을 negotiation/ 에서 chat/ 으로 분리(git mv, URL 유지). chat_protocol.py → chat/protocol.py (폴더당 protocol.py convention 복원), router 등록·import 갱신. - chat_service: 순수 헬퍼/매퍼를 모듈 함수 → 클래스 @staticmethod 로 이동하고 클래스 상단에 집약. - protocol: Req 모델 + 코드/enum 필드에 Field(description=...) 추가(Swagger 노출), Req 문자열 필드에 max_length(DB 컬럼 정합) 추가 → 초과 입력이 DB 오류 대신 422. - models: updated_at 에 onupdate 추가 → UPDATE 시 자동 갱신(negodata convention 일치). - tests: negotiation reject e2e 6케이스 + chat 순수 헬퍼 단위 4케이스 추가(45→55 passed). - enums: 장황한 주석/docstring 축약(코드값 변경 없음). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
36 lines
1.3 KiB
Python
36 lines
1.3 KiB
Python
from pydantic import Field
|
|
|
|
from common.models.gmodel import Res_WebPacketProtocol, WebPacketProtocol
|
|
|
|
|
|
# 협상 세션 목록 행. status/qt_type 은 정수 코드로 내려가고 라벨 매핑은 프론트가 한다.
|
|
class ListItem(WebPacketProtocol):
|
|
session_id: str = ""
|
|
session_status: int = Field(0, description="세션 상태 코드 (SessionStatus: 1=생성 2=진행중 3=완료 4=미참여 5=거부)")
|
|
qt_type: int = Field(0, description="견적 종류 코드 (1=재협상, 2=재견적)")
|
|
qt_number: str = ""
|
|
qt_end_time: str = Field("", description="견적 마감 시각 (ISO 8601)")
|
|
item_code: str = ""
|
|
item_name: str = ""
|
|
model_name: str = ""
|
|
maker_name: str = ""
|
|
|
|
|
|
class Res_SessionList(Res_WebPacketProtocol):
|
|
items: list[ListItem] = []
|
|
total: int = 0
|
|
page: int = 0
|
|
page_size: int = 0
|
|
|
|
|
|
class Res_Participate(Res_WebPacketProtocol):
|
|
session_id: str = Field("", description="참여 성공한 세션 uuid (채팅 진입용)")
|
|
|
|
|
|
class Req_Reject(WebPacketProtocol):
|
|
reject_reason: str = Field("", max_length=255, description="거부 사유 (단종/품절 프리셋 라벨 또는 직접 입력)")
|
|
|
|
|
|
class Res_Reject(Res_WebPacketProtocol):
|
|
session_id: str = Field("", description="거부 처리된 세션 uuid")
|