gendesign/tradein-mvp/backend
lekss361 375f785100 feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests)
Stage 2d of AvitoScraper_v2.

- evaluate_via_imv(address, rooms, area, floor, ...) — async 2-request flow:
  1) GET /web/1/coords/by_address → geoHash + geo IDs
  2) POST /web/1/realty-imv/get-data → price + placementHistory + suggestions
- IMVEvaluation dataclass: cache_key (sha256), geo, price (recommended/lower/higher/market_count),
  placement_history with removed_date, suggestions
- compute_imv_cache_key(...) — deterministic hash for 24h cache lookup
- save_imv_evaluation(db, e) — UPSERT в avito_imv_evaluations ON CONFLICT(cache_key)
- save_imv_placement_history(db, items) — INSERT с source='avito_imv' и removed_date NOT NULL
  (отличие от Stage 2c widget save flow)
- IMVAddressNotFoundError / IMVCityMismatchError exceptions
- pytest offline smoke (cache_key determinism + unix→date + dataclass construct)

Note: suggestions saving в listings skipped — Stage 3 решит when integrating.
Note: house_placement_history использует scraped_at (не fetched_at) — по DDL 017.
      avito_imv_evaluations сохраняет geo_hash в отдельную колонку — по DDL 018.
2026-05-23 15:10:32 +03:00
..
app feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests) 2026-05-23 15:10:32 +03:00
data/sql feat(tradein): SQL migrations 009-018 — houses + listings extension + IMV cache (#440) 2026-05-23 11:41:44 +00:00
tests feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests) 2026-05-23 15:10:32 +03:00
.dockerignore feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
Dockerfile feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
pyproject.toml feat(tradein): мониторинг ошибок через GlitchTip (#396) 2026-05-22 11:18:26 +05:00