gendesign/tradein-mvp/backend/tests
lekss361 a425f4eef0 feat(tradein): Stage 4a — API endpoints for Avito enrichment + IMV benchmark UI
3 NEW admin endpoints (debug + manual triggers):
- POST /api/v1/admin/scrape/avito-house?house_url=... — Houses Catalog enrichment (Stage 2c)
- POST /api/v1/admin/scrape/avito-detail?item_url=... — listing detail enrichment (Stage 2b)
- POST /api/v1/admin/scrape/avito-imv?address=...&rooms=... — IMV debug (Stage 2d, no cache)

2 NEW trade-in endpoints (UI):
- GET /api/v1/trade-in/estimate/{id}/houses — top-5 ближайших houses к target (Stage 2c data)
- GET /api/v1/trade-in/estimate/{id}/imv-benchmark — Avito IMV для UI badge (Stage 3 cache
  lookup + fallback to address-match within 24h; includes our_median_price + diff_pct vs IMV)

2 NEW Pydantic schemas: HouseInfoForEstimate, IMVBenchmarkResponse
5 pytest offline tests (FastAPI TestClient + mocked DB + weasyprint stub)

Refs: AvitoScraper_v2_Implementation_Plan Stage 4a.
2026-05-23 16:32:11 +03:00
..
__init__.py feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests) (#444) 2026-05-23 12:16:47 +00:00
test_api_avito_stage4a.py feat(tradein): Stage 4a — API endpoints for Avito enrichment + IMV benchmark UI 2026-05-23 16:32:11 +03:00
test_avito_detail_parse.py feat(tradein): avito_detail.py — detail page parser (30+ fields incl. domoteka) (#443) 2026-05-23 12:17:15 +00:00
test_avito_houses_parse.py feat(tradein): avito_houses.py — Houses Catalog parser (state + reviews + history + recs) (#449) 2026-05-23 12:37:24 +00:00
test_avito_imv_parse.py feat(tradein): avito_imv.py — Avito IMV evaluation API client (2 requests) (#444) 2026-05-23 12:16:47 +00:00
test_base_save_listings.py feat(tradein): extend base.py save_listings to persist Cian-specific columns (PR #450 follow-up) (#455) 2026-05-23 13:05:20 +00:00
test_cian_detail.py feat(tradein): cian_session cookies management + admin endpoints (Wave 4 Worker A) (#457) 2026-05-23 13:22:00 +00:00
test_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
test_cian_serp_scraper.py feat(tradein): cian.py SERP refactor — state-based extraction (137 fields, no jitter) (#450) 2026-05-23 12:52:04 +00:00
test_cian_session.py feat(tradein): cian_session cookies management + admin endpoints (Wave 4 Worker A) (#457) 2026-05-23 13:22:00 +00:00
test_cian_state_parser.py feat(tradein): cian_state_parser shared utility + ScrapedLot Cian fields (#447) 2026-05-23 12:35:01 +00:00
test_estimator_imv_integration.py feat(tradein): integrate Avito IMV as 5th evaluation source (on-demand cached) (#452) 2026-05-23 13:08:22 +00:00
test_scrape_pipeline.py feat(tradein): scrape_pipeline.py — Avito full orchestrator (search → houses → detail) (#451) 2026-05-23 12:55:13 +00:00
test_yandex_helpers.py feat(tradein): yandex_helpers.py — JSON-LD + regex + date + NLP + money helpers (#456) 2026-05-23 13:14:11 +00:00