gendesign/tradein-mvp/backend/app/services
Light1YT bdb9f3dd09 fix(tradein): Yandex listing_date extraction — keyword + absolute-no-year
Production: Yandex Realty имеет 60% listings с listing_date=NULL (2234/3704).
Audit показал parse_listing_date() ловил только absolute с годом
(«9 мая 2026») и relative numeric («5 дней назад»), но Yandex SERP
для свежих cards чаще использует:
- Keyword: «сегодня в 12:30», «вчера», «позавчера», «только что»
- Absolute без года: «18 мая» (год inferred)

Changes:
- yandex_helpers.py:
  * RE_RU_DATE_NO_YEAR — regex для absolute без \d{4}
  * _RU_MONTH_PREFIXES dict для day+month → date
  * parse_listing_date(): 4 fallback tiers
    1) keyword shortcuts
    2) absolute с годом (existing)
    3) absolute без года → infer current year, rollback на prev если future >30d
    4) relative numeric (existing)
- tests: 3 new test groups (keyword/absolute-no-year/relative-still-works),
  41/41 pass

Impact: linkage rate в /sales-vs-listings (PR K) для Yandex pairs
повысится с 40% → ~90% после next sweep. Existing 2234 NULL — будут
re-extracted при periodic scrape (URL остался).

Mirrors PR N (Avito same fix). Pattern теперь consistent между scrapers.

Refs #564.
2026-05-27 18:11:01 +05:00
..
exporters feat(tradein): этаж/этажность optional + best test presets по deal count (#558) 2026-05-24 21:44:44 +00:00
matching fix(tradein-matching): pg_advisory_xact_lock to prevent duplicate house INSERTs (#501) 2026-05-24 10:52:10 +00:00
scrapers fix(tradein): Yandex listing_date extraction — keyword + absolute-no-year 2026-05-27 18:11:01 +05:00
__init__.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
brand.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
cache.py feat(tradein): Phase 3.2 — /api/v1/search endpoint + Redis cache (#479) 2026-05-23 14:44:22 +00:00
cian_session.py fix(tradein): CIAN_REQUIRED_COOKIES — add real auth cookies (DMIR_AUTH + Cian session) (#480) 2026-05-23 14:52:24 +00:00
estimator.py feat(tradein): estimator deals tier (PR M, #564 Phase 3) (#600) 2026-05-27 12:40:09 +00:00
geocoder.py feat(tradein): MapPicker snap marker — Phase 5 of #582 (#594) 2026-05-27 09:30:17 +00:00
house_metadata.py feat(tradein): postgres_fdw live read of gendesign.cad_buildings (replaces snapshot) (#493) 2026-05-24 08:57:30 +00:00
image_sanitizer.py fix(tradein-photos): sanitize uploaded images via Pillow re-encode (#511) 2026-05-24 11:32:04 +00:00
scheduler.py feat(tradein): in-app scheduler — UI-managed schedule (replaces SSH crontab) (#482) 2026-05-23 14:54:25 +00:00
scrape_pipeline.py fix(tradein/avito): anti-bot hardening — sleep + abort + shared session (#487) 2026-05-23 20:08:40 +00:00
scrape_runs.py fix(tradein/avito): anti-bot hardening — sleep + abort + shared session (#487) 2026-05-23 20:08:40 +00:00
scraper_settings.py feat(tradein): global scraper delay setting (applies across all scrapers) (#485) 2026-05-23 15:43:28 +00:00
search_query.py feat(tradein): Phase 3.2 — /api/v1/search endpoint + Redis cache (#479) 2026-05-23 14:44:22 +00:00