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

1 commit

Author SHA1 Message Date
lekss361
237b391dfe fix(sf-legacy): treat velocity=0 as 'no data' in MarketTab
User reports on /legacy/site-finder/[cad]:
  Велосити 0.0 м²/мес · Срок продаж —
which is contradictory — if velocity were truly zero, sales period
would be infinity. Root cause: backend returns 0 (not null) when
competitors are unmapped to Objective ground truth (OBJ-3). The
condition for 'unavailable' must catch both null and zero.

Fix: getSalesPeriodMonths already treats velocitySqm <= 0 as null
(line 41), but the HeadlineBar + KPI card read raw velocity and
display '0.0 м²/мес' for zero. Same coercion applied at the source:
velocityPerMonth = (raw != null && raw > 0) ? raw : null.

Both HeadlineBar and KPI card now show '—' for zero velocity,
matching the '—' shown for Срок продаж.
2026-05-18 07:14:22 +03:00