gendesign/backend/app/services
Light1YT c5d1069e2c fix(tradein): per-bucket velocity uses district+class competitors (#574)
Deep-review BLOCK: prior fix divided market velocity by region-wide active
ЖК count (~442) → срок продажи 379-1180 мес (нереалистично).

FIX: divide by district+class competitor count (competitors_weighted from
_active_competitors_count cascade, ~5-15 ЖК) in BOTH fallback sites —
aggregate and per-bucket. Срок now lands ~12-24 мес.

- Delete unused _n_active_zhk_region helper + lazy _n_active_cache closure.
- n_comp = max(round(competitors_weighted), 1) — district+class, not region-wide.
- Rename scope["n_active_region"] → scope["n_competitors"] (new field this
  branch, nothing else reads it; frontend confirmed clean).
- Keep static-mix fix: per-bucket velocities stay keyed off MARKET
  bucket_deal_counts (independent of user share_pct slider).
- Tests: drop TestNActiveZhkRegion (helper removed); retarget n_active_region
  → n_competitors via _competitors_two_dim mock; replace misleading "≈404 мес"
  comment with assertion 12<=срок<=24 across n_comp 5-15.
2026-05-28 20:33:38 +05:00
..
cadastre fix(#265 review): CRS 3857→4326 + stable zone_id hash + rename 102 + tx comment 2026-05-17 10:45:52 +03:00
etl feat(etl): fuzzy matcher v2 — pruned threshold 0.85→0.80 for objective mapping coverage 2026-05-17 16:28:20 +03:00
exporters feat(sf-b7): GET /parcels/{cad}/snapshot.pdf — 1-page WeasyPrint export (#334) 2026-05-17 21:11:03 +00:00
generative deploy.yml: sync compose+Caddyfile from git, reload caddy after up 2026-04-26 13:31:26 +03:00
photos fix ui lag 2026-04-27 20:26:55 +03:00
scrapers fix(tradein): backfill kn price_per_m2 via sale_graph + peer median (#573) (#625) 2026-05-28 13:50:45 +00:00
site_finder feat(sf-b6): GET /parcels/{cad}/poi-score — weighted top-7 (#333) 2026-05-17 21:11:25 +00:00
__init__.py init 2026-04-25 13:45:19 +03:00
analytics_queries.py fix(tradein): per-bucket velocity uses district+class competitors (#574) 2026-05-28 20:33:38 +05:00
analytics_refresh.py fix(scrape): SQLAlchemy text() парсил ':00:' regex как named-param 2026-04-30 23:16:11 +03:00
job_settings.py fix(cadastre,nspd_sync): SQL syntax bugs surfaced by ekb_full v2 (#186) 2026-05-15 19:18:43 +03:00
objective_etl.py fix(worker): port objective_etl from psycopg2 → psycopg v3 2026-05-11 12:07:57 +03:00
objective_sync_config.py feat(objective): full sync pipeline + dynamic admin config 2026-05-10 19:54:15 +03:00