feat(tradein): insufficient_data flag on AggregatedEstimate (#697) #734

Merged
bot-reviewer merged 1 commit from fix/697-insufficient-data into main 2026-05-30 14:40:05 +00:00

1 commit

Author SHA1 Message Date
01cc7057cd feat(tradein): insufficient_data flag on AggregatedEstimate (#697)
When no comps/anchor are found the estimate returns median=0/range 0-0, and
the frontend can render a literal «0 ₽». Add a computed boolean
insufficient_data (= median_price_rub <= 0) so the UI shows an explicit
«недостаточно данных» state instead.

Implemented as a Pydantic @computed_field derived from median_price_rub —
correct automatically across all four AggregatedEstimate construction sites
(main estimate, _empty_estimate, and both GET-rehydration paths), no DB column,
no risk of per-site drift. Additive/serialized; existing fields untouched.

Refs #697
2026-05-30 17:38:52 +03:00