- 견적유형 4종: QuotationType 에 신규협상(3)·신규견적(4) 추가(1·2 재 고정)
- 목표가 산정: items(매입가·판매가·인터넷최저가) + quotations.md_price +
quotation_settings.internet_average_fee 로 _calc_target_price(KTC 이식, 신규/재 분리),
세션 target_price·target_anchoring_price 저장
- 협력사유형: quotations.supplier_type(SupplierType) + 직전유형 조회 API(/supplier/{id}/last-type)
- 협상카드 용도: nego_cards/wild_cards.usage_type(CardUsageType: 공통/신규견적전용/재견적전용)
- 스키마(01-schema.sql)·ORM·protocol·service·crud·프론트(생성타입/폼) 일괄, /backend enums·models 미러
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
52 lines
1.4 KiB
Python
52 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
|
|
|
|
|
|
class Req_CreateQuotationSetting(QuotationSettingProtocol):
|
|
target_margin_rate: float
|
|
anchoring_value: float = 0.01
|
|
internet_average_fee: float = 0.078 # 인터넷 평균 수수료율(목표가 인터넷가 차감)
|
|
card_count: int = 3
|
|
|
|
|
|
class Req_UpdateQuotationSetting(QuotationSettingProtocol):
|
|
target_margin_rate: Optional[float] = None
|
|
anchoring_value: Optional[float] = None
|
|
internet_average_fee: Optional[float] = None # 인터넷 평균 수수료율
|
|
card_count: 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
|
|
anchoring_value: float
|
|
internet_average_fee: float = 0.078 # 인터넷 평균 수수료율
|
|
card_count: 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
|