gendesign/tradein-mvp/backend/app/services/scrapers
Light1YT b16935e679 fix(tradein): реализовать writers listings_snapshots/offer_price_history (#567)
listings_snapshots не имел ни одного writer'а — таблица оставалась пустой.
offer_price_history уже писался в save_detail_enrichment, но ON CONFLICT DO NOTHING
не указывал имя constraint'а (добавлено в 047_cian_history_sanitize.sql), что делало
де-дупликацию неэффективной.

Добавлено:
- snapshot_writer.py: upsert_listing_snapshot() — атомарный INSERT ... ON CONFLICT
  DO UPDATE на (listing_id, snapshot_date), без commit (commit у caller'а).
- base.py save_listings(): вызывает upsert_listing_snapshot после каждого INSERT/UPDATE
  listings; принимает опциональный run_id; ошибка snapshot не прерывает батч.
- cian_detail.py save_detail_enrichment(): SELECT price_rub/price_per_m2 из listings,
  затем upsert_listing_snapshot; ON CONFLICT для offer_price_history теперь ссылается
  на offer_price_history_listing_change_uq (именованный constraint из мигр. 047).
- test_snapshot_writer.py: 17 unit-тестов покрывают SQL-форму, params, идемпотентность,
  интеграцию с save_listings и save_detail_enrichment, fault-tolerance.
2026-05-28 18:26:52 +05:00
..
__init__.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
avito.py fix(tradein): Avito listing_date extraction (3 формата) (#601) 2026-05-27 12:55:27 +00:00
avito_detail.py fix(tradein-avito): strip Emotion CSS from listings.address (#502) 2026-05-24 10:52:50 +00:00
avito_exceptions.py fix(tradein/avito): anti-bot hardening — sleep + abort + shared session (#487) 2026-05-23 20:08:40 +00:00
avito_houses.py fix(tradein): decode Avito houses URL-encoded __preloadedState__ (#566) 2026-05-28 15:58:19 +05:00
avito_imv.py fix(tradein-imv): harden Avito IMV anti-bot path + offline contract tests (#565) 2026-05-28 16:29:05 +05:00
base.py fix(tradein): реализовать writers listings_snapshots/offer_price_history (#567) 2026-05-28 18:26:52 +05:00
cian.py feat(tradein): global scraper delay setting (applies across all scrapers) (#485) 2026-05-23 15:43:28 +00:00
cian_detail.py fix(tradein): реализовать writers listings_snapshots/offer_price_history (#567) 2026-05-28 18:26:52 +05:00
cian_newbuilding.py feat(tradein): cian_newbuilding.py — ЖК catalog scraper (chart + reliability + offers, Wave 4 Worker C) (#459) 2026-05-23 13:23:11 +00:00
cian_state_parser.py feat(tradein): cian_state_parser shared utility + ScrapedLot Cian fields (#447) 2026-05-23 12:35:01 +00:00
cian_valuation.py fix(tradein/cian): sanitize valuation cache writes (047 UNIQUE + 026/044 cols) (#523) 2026-05-24 13:44:39 +00:00
n1.py feat(tradein): global scraper delay setting (applies across all scrapers) (#485) 2026-05-23 15:43:28 +00:00
snapshot_writer.py fix(tradein): реализовать writers listings_snapshots/offer_price_history (#567) 2026-05-28 18:26:52 +05:00
yandex_detail.py feat(tradein): scraper_settings live-config + Yandex admin trigger endpoints (#484) 2026-05-23 15:28:34 +00:00
yandex_helpers.py fix(tradein): Yandex listing_date — keyword + absolute-no-year (#602) 2026-05-27 13:11:22 +00:00
yandex_newbuilding.py feat(tradein): scraper_settings live-config + Yandex admin trigger endpoints (#484) 2026-05-23 15:28:34 +00:00
yandex_realty.py fix(tradein): yandex_realty captures house number + parse_rub strips NBSP (#593) 2026-05-27 07:23:36 +00:00
yandex_valuation.py fix(yandex-valuation): off-by-one cell index in _parse_row_cells (#552) 2026-05-24 19:57:17 +00:00