gendesign/tradein-mvp/backend/app
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
..
api fix(tradein): восстановленная оценка показывает этаж/площадь, не 0/0 2026-05-22 15:50:19 +05:00
core fix(tradein): security hotfix — C-3 config default + C-4 empty estimate persist + C-6 PDF URL allowlist (#435) 2026-05-23 09:38:23 +00:00
schemas fix(tradein): восстановленная оценка показывает этаж/площадь, не 0/0 2026-05-22 15:50:19 +05:00
services feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests) 2026-05-23 15:10:32 +03:00
__init__.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
main.py feat(tradein): мониторинг ошибок через GlitchTip (#396) 2026-05-22 11:18:26 +05:00