[feat] negodata: 타결 상한(done_ceiling) — 세팅 기본율%·견적 override·세션 박제, 견적생성 3단계 타결/낙찰 섹션 분리·재생성 상속

This commit is contained in:
minaChoi committed 2026-08-04 08:56:03 +09:00
1 parent 2bf91d64f5
commit 91b8dc77a0
37 files changed
+962 -131

No files matched your search

+6 -4
View File
@@ -450,21 +450,23 @@ class QuotationCRUD(IQuotationCRUD):
return ErrorType.DB_RUN_FAILED, {}
async def get_setting_rates(self, cdb: AsyncSession, qt_setting_id) -> Tuple[ErrorType, dict]:
"""견적 세팅의 목표 마진율: {margin}. 목표가 산정 입력(인터넷 수수료는 상수).
"""견적 세팅의 목표 마진율·협상 완료 상한율: {margin, done_ceiling_rate}.
margin·수수료는 목표가 산정 입력, done_ceiling_rate(‰)는 완료 상한 = 목표가×(1+값/1000).
(낙찰 정책은 견적 단위 이관, 앵커링은 칸 rate v1.2 → 세팅 컬럼 제거됨.)"""
try:
query = select(
quotation_settings.target_margin_rate,
quotation_settings.done_ceiling_rate,
).where(quotation_settings.qt_setting_id == qt_setting_id).limit(1)
err_type, rows = await DB_SESSION_MNG.execute(cdb, query)
if err_type != ErrorType.SUCCESS:
return err_type, {}
if not rows:
return ErrorType.SUCCESS, {}
# 단일 컬럼 select → execute 가 스칼라 리스트를 돌려준다(Row 아님).
margin = rows[0]
row = rows[0]
return ErrorType.SUCCESS, {
"margin": float(margin) if margin is not None else None,
"margin": float(row.target_margin_rate) if row.target_margin_rate is not None else None,
"done_ceiling_rate": int(row.done_ceiling_rate) if row.done_ceiling_rate is not None else None,
}
except Exception as ex:
LOG.e_no_callstack(ex)