feat(tradein): location-coef MVP через FDW-мост к OSM POI Птицы (#2045 PR-B) #2314
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#2314
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/tradein-location-coef-poi"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Финальный PR для #2045 (первый — view на gendesign, уже смёржен/задеплоен). Backend-only, cross-DB через postgres_fdw:
168_fdw_osm_poi_ekb.sql— foreign table поверхv_tradein_osm_poi_ekb(тот жеSERVER gendesign_remote, без новых ролей/mapping).169_osm_poi_ekb_local.sql— локальное зеркало с GIST-индексом.170_scrape_schedules_seed_osm_poi_ekb_refresh.sql+app/tasks/osm_poi_ekb_refresh.py— daily bulk TRUNCATE+INSERT рефреш (без per-row FDW-запросов, атомарно в одной транзакции), отдельное расписание отcadastral_geo_match.app/services/location_coef.py— порт straight-line POI-скоринга из Site Finder (CATEGORY_WEIGHTSas-is, радиус 1200м для квартир вместо 2000м участков, конфигурируем query-параметром 500-3000м); score→coef — явно помеченная heuristic v1 (0.95-1.05), НЕ откалиброванная на реальных ценовых дельтах.GET /api/v1/trade-in/location-coef?estimate_id=&radius_m=— тот же IDOR-guard что у соседних роутов; graceful fallback (coef=1.0, factors=[], geo_source="unavailable") если локальное зеркало пусто — никогда 500, никогда фабрикация.cadastral_geo_match.Вне scope: frontend wiring (
mappers.ts/LocationDrawer.tsx) — отдельная задача после проверки эндпоинта в проде.code-reviewer: ✅ APPROVE (12 мин, включая независимый прогон ruff+pytest).
uv run pytest→ 3147 passed/6 skipped. Полное покрытие: happy path, empty-mirror fallback, IDOR-матрица, radius-clamp.