[fix] negodata: 직접 낙찰 낙찰가가 계약가 대신 거부가로 표시되던 문제

세션 목록 API(queries.py)가 SessionData 를 필드별로 수동 조립하는데 contract_price 를
빠뜨려, 담당자가 입력한 계약가가 응답에 안 실렸다(항상 null). 그 결과 프론트가 계약가를
못 읽고 제출가(거부가/투찰가)로 폴백해, 14,000,000 으로 직접 낙찰해도 낙찰가에 거부가가
떴다. 프로토콜·ORM·컬럼은 이미 있었으나 이 직렬화 한 줄이 누락돼 있었다.

- queries.py: SessionData 조립에 contract_price=r.contract_price 추가
- ResultSummaryBand: 스펙트럼 낙찰점도 제출가(awardPrice)가 아니라 계약가(contractPrice)로 찍어
  레일 낙찰가와 일치시킴

검증: 세션 API 응답에 contract_price 실제 내려오는 것 확인(화면 아닌 응답 직접). negodata 테스트 통과.
This commit is contained in:
Mina Choi 2026-08-12 11:02:10 +09:00
parent d33648327c
commit 1a859b198c
2 changed files with 7 additions and 3 deletions

View File

@ -188,6 +188,7 @@ class QueriesMixin:
end_time=r.end_time,
reject_reason=r.reject_reason,
reject_price=r.reject_price,
contract_price=r.contract_price,
reject_delivery_type=r.reject_delivery_type,
email_sent_at=r.email_sent_at,
custom=r.custom,

View File

@ -9,6 +9,7 @@ import {
awardPrice,
buildQuotationResult,
ceilingPriceOf,
contractPrice,
is1v1,
sessionStatusLabel,
CHAIN_ROUND_STATE_LABEL,
@ -47,11 +48,13 @@ export function ResultSummaryBand({
const showManualBadge = quotation.award_type === AwardType.MANUAL;
const reason = awardMeta(quotation)?.reason ?? '';
// 가격을 제출한 협력사만 점으로. 낙찰자는 강조.
// 가격을 제출한 협력사만 점으로. 낙찰자는 강조하고, 낙찰자 값은 확정 계약가(직접 낙찰이면 계약가)를 쓴다
// — 제출가(거부가 등)로 찍으면 레일 낙찰가와 어긋난다.
const bids: SpectrumBid[] = sessionViews.flatMap((s) => {
const value = awardPrice(s);
const isWinner = winnerId != null && s.supplier_id === winnerId;
const value = isWinner ? contractPrice(s) : awardPrice(s);
if (value == null) return [];
return [{ name: s.supplier_name, value, isWinner: winnerId != null && s.supplier_id === winnerId }];
return [{ name: s.supplier_name, value, isWinner }];
});
return (