gendesign/tradein-mvp/backend/app/services
Light1YT 8591efc42f feat(tradein): estimator deals tier classification (PR M / #564 Phase 3)
Remove stale NOTE 2026-05-24 + add tier field на AnalogLot.

- schemas/trade_in.py: AnalogLot добавлено поле `tier: str | None`
  ('T0_per_house' / 'T1_per_street' — для rosreestr deals)
- services/estimator.py:
  * _deal_to_analog: compute tier via kadastr_num heuristic
    ('66:41:0204016:10' → T0; '66:41:...:0' OR NULL → T1)
  * estimate_quality docstring: replaced устаревший NOTE с corrected
    explanation что importer (PR-A 2026-05-24) уже фильтрует doc_type='ДКП'
    и deals идут в actual_deals output
  * _fetch_deals SQL: include kadastr_num в SELECT (для tier classify)

Observation: open dataset Росреестра (current state) имеет
kadastr_num=NULL для всех 49,791 ДКП-сделок → все классифицируются
как T1_per_street. Поле зарезервировано на случай будущего ЕГРН
direct feed.

Tests: ruff clean, services/ pytest 19/19 pass.

Closes #564 Phase 3.
2026-05-27 17:36:46 +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 feat(tradein): hook matching в save_listings — fill listing_sources (PR I) (#595) 2026-05-27 10:02:37 +00: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 classification (PR M / #564 Phase 3) 2026-05-27 17:36:46 +05: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