Merge pull request 'fix(sf-legacy): velocity=0 → '—' в MarketTab (consistency со «Срок продаж»)' (#362) from fix/legacy-market-velocity-zero-as-null into main
All checks were successful
Deploy / deploy (push) Successful in 39s
Deploy / changes (push) Successful in 4s
Deploy / build-backend (push) Has been skipped
Deploy / build-worker (push) Has been skipped
Deploy / build-frontend (push) Successful in 2m39s

Reviewed-on: #362
This commit is contained in:
lekss361 2026-05-18 04:16:51 +00:00
commit f6ea27c4f5

View file

@ -60,7 +60,12 @@ export function MarketTab({ data }: Props) {
// competitors count as proxy for active (строящихся) count for now.
const activeCount = data.competitors.length;
const radiusKm = getRadiusKm(data);
const velocityPerMonth = data.velocity?.monthly_velocity_sqm ?? null;
// Treat zero velocity as "no data" — backend returns 0 when competitors
// are unmapped to Objective ground truth (OBJ-3). Showing "0.0 м²/мес"
// is misleading; "—" makes it clear data is unavailable.
const velocityRaw = data.velocity?.monthly_velocity_sqm;
const velocityPerMonth =
velocityRaw != null && velocityRaw > 0 ? velocityRaw : null;
const maxMixPct = getMaxMixPct(data);
const salesPeriodMonths = getSalesPeriodMonths(data);