gendesign/backend/app/services
bot-backend 76baf8011d feat(db): quarter_price_index FDW foreign table + monthly refresh (Refs #762)
#647-2 (P0, инфра — клиентскую цену НЕ меняет). Делает mv_quarter_price_index
(#760) читаемым estimator'ом за O(1) + периодический refresh.

- tradein 085_quarter_price_index_fdw.sql: FOREIGN TABLE quarter_price_index
  над main public.mv_quarter_price_index через существующий server
  gendesign_remote (паттерн 060_postgres_fdw_extension.sql, per-table). Колонки
  1:1 с MV (varchar(30)/float8/bigint/text/timestamptz). DROP IF EXISTS идемпот.
- main 99b_grant_quarter_price_index_fdw.sql: GRANT SELECT на MV роли
  tradein_fdw_reader (иначе foreign table падает; зеркало 122_grant_rosreestr).
- main refresh: Celery beat (pg_cron нет). quarter_price_index_refresh.py —
  chained REFRESH mv_quarter_price_per_m2 → mv_quarter_price_index CONCURRENTLY;
  task refresh_quarter_price_index.py; beat-entry 'refresh-quarter-price-index'
  cron '0 2 5 * *' (05:00 MSK 5-го, после ekb-districts-medians).

Lookup-индекс: MV уже несёт UNIQUE mv_quarter_price_index_uq (O(1) remote);
foreign table не нуждается в локальном. Валидация (postgres-gendesign): MV
1972 строки, 0 NULL, UNIQUE indisunique=true, REFRESH CONCURRENTLY валиден.

Разблокирует #647-3 (estimator integration, за гейтом #763).
2026-05-30 20:13:02 +03: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 obj_class (parser + 3-pass) (#572) (#628) 2026-05-28 15:04:32 +00:00
site_finder feat(db): quarter_price_index FDW foreign table + monthly refresh (Refs #762) 2026-05-30 20:13:02 +03:00
__init__.py init 2026-04-25 13:45:19 +03:00
analytics_queries.py fix(tradein): per-bucket velocity formula + realistic срок продажи (#574) (#631) 2026-05-28 15:35:16 +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