50 lines
1.4 KiB
Python
50 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 QuotationSettingProtocol(WebPacketProtocol):
|
|
pass
|
|
|
|
|
|
# 세팅은 목표 마진율·카드수만. 낙찰 정책(mid/over/regen)은 견적 단위 이관, 앵커링은 칸 rate(v1.2)로 대체 → 컬럼 제거됨.
|
|
class Req_CreateQuotationSetting(QuotationSettingProtocol):
|
|
target_margin_rate: float
|
|
card_count: int = 3
|
|
done_ceiling_rate: int = 50 # 협상 완료 상한율(‰). 완료 상한=목표가×(1+값/1000)
|
|
|
|
|
|
class Req_UpdateQuotationSetting(QuotationSettingProtocol):
|
|
target_margin_rate: Optional[float] = None
|
|
card_count: Optional[int] = None
|
|
done_ceiling_rate: Optional[int] = None
|
|
|
|
|
|
class QuotationSettingData(WebPacketProtocol):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
qt_setting_id: uuid.UUID
|
|
user_id: Optional[uuid.UUID] = None
|
|
target_margin_rate: float
|
|
card_count: int
|
|
done_ceiling_rate: int
|
|
created_at: Optional[datetime] = None
|
|
updated_at: Optional[datetime] = None
|
|
|
|
|
|
class Res_QuotationSetting(Res_WebPacketProtocol):
|
|
setting: Optional[QuotationSettingData] = None
|
|
|
|
|
|
class Res_QuotationSettingList(Res_WebPacketProtocol):
|
|
settings: list[QuotationSettingData] = []
|
|
total: int = 0
|
|
|
|
|
|
class Res_DeleteQuotationSetting(Res_WebPacketProtocol):
|
|
pass
|