gendesign/tradein-mvp/backend/app/tasks
Light1YT 1e44ef09f4 feat(tradein): per-source listing price history — schema + daily snapshot (#570)
Migration 079 adds listing_source_snapshots (daily per-source snapshot, plain
table — partitioning deferred), listing_source_events (change-log), an
offer_price_history.listing_source_id backlink, and v_listing_source_price_on_date.

snapshot_listing_sources() (app/tasks) writes a daily snapshot of the existing
18,355 listing_sources rows and diffs today's price vs the prior snapshot into
price_change events — both set-based SQL (CTE), no row loop. Wired into the
in-app scheduler (source='listing_source_snapshot', enabled=true: pure internal
DB, no external calls, window 01:00-02:00 UTC before the backfill jobs). History
accumulates immediately, independent of the dormant scrapers.

Prod dry-run (rollback): migration applies clean; snapshot inserts 18,355 rows.
Same-day double-fire impossible (_claim_run advances next_run_at + has_running_run
guard) so no duplicate price_change events.

Closes #570
2026-05-29 17:14:22 +05:00
..
__init__.py feat(tradein): search matview + indexes (Phase 3.1) (#469) 2026-05-23 14:01:18 +00:00
cian_history_backfill.py feat(tradein): houses.cian_zhk_url column + backfill (#568) (#627) 2026-05-28 13:57:43 +00:00
geocode_missing.py feat(tradein): persistent infra для backfill scripts (PR F) (#592) 2026-05-27 06:59:54 +00:00
listing_source_snapshot.py feat(tradein): per-source listing price history — schema + daily snapshot (#570) 2026-05-29 17:14:22 +05:00
refresh_search_matview.py feat(tradein): search matview + indexes (Phase 3.1) (#469) 2026-05-23 14:01:18 +00:00