gendesign/tradein-mvp/backend
lekss361 879f761214 feat(tradein): avito_houses.py — Houses Catalog parser (state + reviews + history + recs)
Stage 2c of AvitoScraper_v2.

- fetch_house_catalog(house_url) — async HTTP via curl_cffi (chrome120)
- parse_houses_state(state, house_url) — pure parser (testable без сети)
- 10-widget JSON state structure (housePage, reviews, miniSerp, housePlacementHistory, recommendations)
- Dataclasses:
  * HouseInfo (28 fields: identity, geo, expandParams flatten, developer, rating, map_pins, raw_characteristics)
  * HouseReview (textSections split: main/pros/cons; ru date parse)
  * PlacementHistoryItem (removed_date ALWAYS None — widget не отдаёт; точная дата только в IMV API)
  * SellerInfo (ext_seller_id из URL last segment, без logos)
  * MiniSerpListing (active listings в доме + metro + seller)
  * RecommendationItem (lightweight: title/price_text/address/url/image)
  * HouseCatalogEnrichment (orchestrator dataclass)
- Save flow (5 ops):
  * _upsert_house_with_url → houses (UNIQUE source='avito', ext_house_id) + raw_characteristics jsonb
  * save_house_reviews → house_reviews (UNIQUE source, ext_review_id), без images
  * save_sellers → sellers (UNIQUE source, ext_seller_id), без logos
  * link_listings_to_seller → UPDATE listings.seller_id_fk by source_id match
  * save_placement_history → source='avito_widget', removed_date=NULL
- pytest offline smoke: 18 tests, 5 widget types, 25+ field assertions
- Recommendations save skipped — Stage 3 решит
2026-05-23 15:27:22 +03:00
..
app feat(tradein): avito_houses.py — Houses Catalog parser (state + reviews + history + recs) 2026-05-23 15:27:22 +03:00
data/sql feat(tradein): SQL migrations 019-028 — Cian schema + matching + cookies 2026-05-23 15:14:49 +03:00
tests feat(tradein): avito_houses.py — Houses Catalog parser (state + reviews + history + recs) 2026-05-23 15:27:22 +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