gendesign/tradein-mvp/backend/app/services
Light1YT cad3b77171 fix(tradein): Avito scraper now extracts listing_date для всех форматов
Real production state: **0/9302 (100%)** Avito listings имели NULL
listing_date. Audit показал regex matched только relative numeric
("5 дней назад") — Avito SERP сейчас использует:
- Keyword shortcuts «сегодня в 12:30», «вчера в 18:45», «позавчера», «только что»
- Absolute «18 мая», «5 июня в 12:30» (year inferred — current, или
  rollback к прошлому году если month в будущем больше чем на 30d)

Changes:
- Expand _parse_relative_date():
  * keyword check first (без \d+ regex match)
  * relative numeric (existing) — без изменений
  * absolute date regex с _RU_MONTHS dict + roll-back на prev year heuristic

Tests: 10/10 pass (4 existing + 6 new). Ruff clean.

Impact: 9302 Avito listings + new daily scrapes теперь будут иметь
listing_date. Это **прямо повысит linkage rate в /sales-vs-listings**
(PR K) с current ~5% до 30%+ (теоретически до 80% при listing_date
плотности).

Existing 9302 NULL — будут пересобраны при следующем full sweep после
deploy. Backfill detail page для each — отдельный operation скрипт
(out of scope, можно через docker exec ad-hoc).

Refs #564 (linkage rate improvement).
2026-05-27 17:55: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): Avito scraper now extracts listing_date для всех форматов 2026-05-27 17:55: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