gendesign/tradein-mvp/backend/app/services
Light1YT a85e6d8e77 feat(tradein): estimator computes additive expected_sold price (#648 S3)
Estimator ADDITIVELY derives expected_sold from asking-median × per-rooms
asking_to_sold_ratio (table from #648 S2 / migration 080). Headline asking
median, ranges, confidence and actual_deals are UNCHANGED. Graceful: missing/
empty ratio table → expected_sold fields None, estimate still returns 200
(ratio lookup rolls back the shared session on error so the subsequent INSERT
isn't poisoned — mirrors sibling cache helpers).

- estimator: _get_asking_sold_ratio(db, rooms) cached lookup (per-rooms →
  global -1 fallback → None, try/except+rollback), applied after repair-coef.
- schema: 6 optional expected_sold_* / ratio fields on AggregatedEstimate.
- api: rehydrate the new columns in GET /estimate/{id} + /pdf reopen SELECTs
  and both constructors (the documented reopen-path bug).
- migration 081: ADD COLUMN IF NOT EXISTS for the persisted subset.
- tests: 10 new (lookup/apply/graceful) + fix pre-existing test_estimator_
  source_quota 2→3 tuple unpack of _fetch_analogs (was RED on main).
2026-05-29 18:37:05 +05:00
..
exporters feat(tradein): этаж/этажность optional + best test presets по deal count (#558) 2026-05-24 21:44:44 +00:00
matching feat(tradein): same-building матчинг аналогов по house_id (#6) 2026-05-28 13:55:51 +05:00
scrapers feat(tradein): infer repair_state from listing description text (#622) (#632) 2026-05-28 15:37:34 +00:00
__init__.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
account_quota.py feat(tradein): аккаунт praktika + лимит 15 оценок/мес, чистка PRINZIP в UI (#635) 2026-05-28 22:04:58 +00: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
dadata.py feat(tradein): DaData /suggest tier в /suggest endpoint (PR Q2) 2026-05-27 19:08:58 +05:00
estimator.py feat(tradein): estimator computes additive expected_sold price (#648 S3) 2026-05-29 18:37:05 +05:00
geocoder.py feat(tradein): DaData /suggest tier в /suggest endpoint (PR Q2) 2026-05-27 19:08:58 +05: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): per-source listing price history — schema + daily snapshot (#570) (#646) 2026-05-29 12:18:04 +00:00
scrape_pipeline.py feat(scheduler): dormant Yandex Realty city-sweep (#561) (#642) 2026-05-29 08:50:10 +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