gendesign/backend/app/services
Light1YT 57214f7c49 fix(tradein): backfill kn price_per_m2 (#573)
756 977 NULL-status rows in domrf_kn_flats imported from historical
DOM.RF snapshots carry total_area but no price_rub, so the scraper's
price_rub/total_area derivation never fires for them. This left 5/8 EKB
districts at 0% price_per_m2 coverage and blocked the
Limit_District_Median_Partial analytics limitation.

Migration 100 adds a three-pass idempotent backfill:
  1. price_rub / total_area (sanity net; 0 rows in practice)
  2. domrf_kn_sale_graph.price_avg (type='apartments', latest snapshot)
     via obj_id join — fills 453 606 rows
  3. peer median from free/sold/booked flats in the same obj_id — fills
     620 more rows

After backfill: 61.5% overall coverage (up from 3.7%), all 8 EKB
districts get a non-NULL median (7/8 districts reach ≥ 60%).

Also tightens the UPSERT: price_per_m2 now uses COALESCE so re-scraping
NULL-status flats no longer overwrites a previously backfilled value.
2026-05-28 18:31:50 +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 (#573) 2026-05-28 18:31:50 +05: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(22k): quartirography — use f.flat_type not f.type (column doesn't exist) (#312) 2026-05-17 16:09:00 +00: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