feat(tradein): premium_houses MV + premium_building flag (#2002) #2006

Merged
lekss361 merged 2 commits from feat/tradein-premium-flag into main 2026-06-27 16:40:39 +00:00

2 commits

Author SHA1 Message Date
09f9dc131f feat(tradein/estimator): premium_building flag from premium_houses MV (#2002)
All checks were successful
CI / changes (pull_request) Successful in 7s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
Read-only _is_premium_building(db, house_id) looks up target_house_id in the
premium_houses MV (data/sql/139) and surfaces premium_building +
premium_building_median_ppm2 on AggregatedEstimate. Metadata only for
manual-review routing (#4) — does NOT touch _price_from_inputs / expected_sold /
median / ranges, so the backtest regression gate is unaffected.

MV-missing / SQL errors degrade to (False, None) with a rollback so an estimate
never breaks where the MV does not yet exist.
2026-06-27 19:37:39 +03:00
8c1b96ecb5 feat(tradein/db): premium_houses materialized view from listing concentration (#2002) 2026-06-27 19:31:42 +03:00