gendesign/tradein-mvp/backend/app/api/v1
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
..
__init__.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
admin.py feat(tradein): houses.cian_zhk_url column + backfill (#568) (#627) 2026-05-28 13:57:43 +00:00
brand.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
geocode.py feat(tradein): MapPicker snap marker — Phase 5 of #582 (#594) 2026-05-27 09:30:17 +00:00
me.py feat(rbac): role-based access control via X-Authenticated-User middleware (#585) 2026-05-26 06:18:40 +00:00
search.py feat(tradein): Phase 3.2 — /api/v1/search endpoint + Redis cache (#479) 2026-05-23 14:44:22 +00:00
trade_in.py feat(tradein): estimator computes additive expected_sold price (#648 S3) 2026-05-29 18:37:05 +05:00