fix(sf-legacy): velocity=0 → '—' в MarketTab (consistency со «Срок продаж») #362

Merged
lekss361 merged 1 commit from fix/legacy-market-velocity-zero-as-null into main 2026-05-18 04:16:51 +00:00

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);