gendesign/tradein-mvp/backend/app
lekss361 21356b00c5 fix(tradein): surface same-building comps as analogs when anchor fires (#694)
При сработавшем same-building anchor headline строится из комплов того же дома,
а analogs[] показывали РАДИУСНЫЕ листинги (дешевле/другие) или пусто — премиум-
итог выглядел неподкреплённым (Олимп 13: 207М, analogs 41–46М; Ткачёва 13:
38М при пустом analogs[], хотя якорь на 27 комплах дома).

_fetch_anchor_comps теперь тянет display-поля (address/source/source_url/
price_rub/listing_date/days_on_market/photo_urls/lat/lon) в обоих тирах (A/C),
дедуп через _anchor_comp_from_row. При anchor_tier!=None analogs[] строится из
anchor_comps_used через _anchor_comp_to_analog (robust к отсутствующим полям:
price_rub = price_per_m2×area при отсутствии). Радиусный путь без якоря —
без изменений.

Тесты: analogs отражают anchor-комплы (ppm² 399k/472k/684k, не радиус 200–220k),
price_rub=round(ppm²×area); без якоря — радиусные; pass-through display-полей.
44 passed.

Closes #694
2026-05-30 12:05:27 +03:00
..
api fix(tradein): scope GET /estimate/{id} + /pdf to owner, close IDOR (#690) (#702) 2026-05-30 08:56:51 +00:00
core feat(tradein): brand-by-account + result IA redesign (distinct asking/sale prices) (#683) 2026-05-30 06:45:14 +00:00
observability feat(tradein): enrich GlitchTip SDK init — integrations + PII scrub (#396) (#643) 2026-05-29 09:23:17 +00:00
schemas feat(tradein): enrich /estimate response for web map, distribution, exposure & trend (#685) 2026-05-30 07:32:40 +00:00
services fix(tradein): surface same-building comps as analogs when anchor fires (#694) 2026-05-30 12:05:27 +03:00
tasks feat(tradein): daily asking→sold ratio refresh (#648 S4) (#663) 2026-05-29 13:49:36 +00:00
__init__.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
main.py feat(tradein): enrich GlitchTip SDK init — integrations + PII scrub (#396) (#643) 2026-05-29 09:23:17 +00:00