- GET /v1/negotiation/sessions: 로그인 공급사의 세션 목록(필터/정렬/페이지네이션)
· qt_end_time 은 견적(quotation.end_time) 기준, sessions⨝items⨝quotations 조인
· status/qt_type 은 정수 코드로 응답(라벨 매핑은 프론트)
- POST /v1/negotiation/sessions/{session_id}/participate: 협상 참여
· 검증: 소유(공급사 대조)→세션상태→견적마감→마감시간, 에러코드 1300~1304
· 협상생성→협상중, 견적→견적진행중 (협상중/완료는 무변경 진입)
· 마감초과 시 협상생성 세션만 미참여로 정리
- DBType.NEGOTIATION/QUOTATION, items/sessions/quotations 모델
- QtType/SessionStatus/QuotationStatus enum, AuthService.authenticate 공통화
- 협상 e2e 테스트(test_negotiation.py)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
26 lines
814 B
Python
26 lines
814 B
Python
from common.models.gmodel import Res_WebPacketProtocol, WebPacketProtocol
|
|
|
|
|
|
# 협상 세션 목록 행. status/qt_type 은 정수 코드로 내려가고 라벨 매핑은 프론트가 한다.
|
|
class ListItem(WebPacketProtocol):
|
|
session_id: str = ""
|
|
session_status: int = 0 # SessionStatus 코드
|
|
qt_type: int = 0 # QtType 코드 (1=재협상, 2=재견적)
|
|
qt_number: str = ""
|
|
qt_end_time: str = "" # 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 = "" # 참여 성공한 세션 (채팅 진입용)
|