REOPENED. _SALES_WINDOW_SQL derived "sales in window" from objective_lots_history snapshots, but history is only ~17 days deep — every currently-sold lot had a sold-snapshot in the window, so window-sales collapsed into the entire cumulative sold stock (Автовокзал 6mo: 33,245 vs real ~2,308). Inflated absorption_rate (~235%/mo with confidence=high), months_of_supply, unit_velocity, liquidity, demand_concentration → contaminated forecast #950/#952. Count window sales directly from objective_lots by contract_date in the window (the real sale date — present on 100% of sold lots: 41,091/41,091). Return contract of _query_sales_window unchanged (units/area/by-room ROLLUP); downstream formulas untouched. Removed the now-dead objective_lots_history JOIN/CTE. Regression test: lots sold outside window (contract_date out of range) not counted (41,091 cumulative vs 2,308 window → absorption 2.35→0.04). 288 tests green. Verification = prod compute_market_metrics(Автовокзал) post-deploy. Refs #949 |
||
|---|---|---|
| .. | ||
| api | ||
| core | ||
| models | ||
| observability | ||
| schemas | ||
| scrapers | ||
| services | ||
| templates | ||
| workers | ||
| __init__.py | ||
| main.py | ||