feat(tradein): admin backfill endpoints — cian price-history (T8a) + yandex address (T10) + house IMV (T7) #856

Merged
bot-reviewer merged 1 commit from feat/tradein-scrapers-wave2-backfills into main 2026-05-31 06:37:11 +00:00

1 commit

Author SHA1 Message Date
e51722b3f1 feat(tradein): admin backfill endpoints — cian price-history (T8a) + yandex address (T10) + house IMV (T7)
T8a: POST /scrape/cian-price-history — fetches Cian detail pages (curl_cffi),
extracts priceChanges from _cianConfig defaultState, upserts offer_price_history.
Wraps existing cian_detail.fetch_detail + save_detail_enrichment.

T10: POST /scrape/yandex-address-backfill — enriches yandex listings.address
with house number from detail-page <title> regex; resets geocode_tried_at for
re-geocoding. Targets active EKB listings without a house number in address.

T7: POST /scrape/house-imv-backfill — bulk Avito IMV evaluation per house.
Picks median lot-params from linked listings, calls evaluate_via_imv, persists
house_imv_evaluations + house_placement_history + house_suggestions. Resumable
via imv_status markers. Runs in foreground (BackgroundTasks for long batches
can be added later if needed).

All three: NOT wired to scheduler (anti-rate-limit, intentional manual trigger).
All three: idempotent / graceful per-item error handling + counters response.
27 unit tests added in tests/test_backfill_wave2.py (all passing).
2026-05-31 09:34:41 +03:00