feat(analyze): competitor + pipeline lat/lon для слоёв карты (#999 Step 1) #1074
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#1074
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/analyze-market-coords-999"
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?
Что (#999 Step 1/2 — backend)
Добавляет nullable
lat/lon(EPSG:4326, 6 dp) в/analyze→competitors[]иpipeline_24mo.top_objects[], чтобы фронт мог рисовать рыночные слои на Leaflet-карте (#999, 958-B4).Относится к #999 (НЕ закрывает — слои карты на фронте = Step 2, отдельный PR).
Почему так
Координаты УЖЕ есть в источнике (
domrf_kn_objects.latitude/longitude— та же geom, из которой считаетсяdistance_m), но в ответ /analyze не попадали. Прод-проба подтвердила:competitors[].lat/lon = None. Это вскрылось при разборе #999 — он оказался не frontend-only.Изменения (
backend/app/api/v1/parcels.py, +44/-1)o.latitude AS lat, o.longitude AS lon(o=latest_obj)._competitor_with_coords(spreaddict(row)+ округление lat/lon),_coord_round(Decimal/None-safe).top_objectsdict: +lat/lon.Безопасность
Чисто аддитивно — ни одно существующее поле/форма не изменены (
distance_m,geom_geojson, все остальные — как были). Объект без координат → None (без 500). Downstream-консьюмеры (_compute_confidence,market_pulse,top_sellers) читают только именованные ключи → инертны к новым полям.Качество
code-reviewer: ✅ APPROVE (аддитивность, SQL-валидностьo-алиаса в обоих запросах, Decimal/null-safe, downstream инертны).ruffclean,pytest tests/api/v1/96 passed. Без новых bind-параметров (psycopg v3 CAST — не требуется).Тест-план (post-deploy)
POST /analyzeна66:41:0702048:27→competitors[0].lat/lonне null;pipeline_24mo.top_objects[0].lat/lonприсутствуют.