fix(site-finder): align competitor flats_sold to objective_lots.contract_date (#1926) #1927
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1927
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/1926-units-sold-align"
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?
Root (audit #1871/#1926): competitor-блок считал
flats_soldчерезdomrf_kn_flats.status(LIKE '%прод%'/sold) — заполнен ~0.2% (99.8% NULL) → недосчёт ~1600 юнитов и расхождение с MarketMetrics, который считает черезobjective_lots.contract_date(100% для проданных).Fix: новый
_SOLD_COUNT_SQLсчитает sold черезobjective_lots.contract_date IS NOT NULL, мостdomrf obj_id → objective_complex_mapping.domrf_obj_id → objective_complex_name == objective_lots.project_name(тот же 1:1 паттерн, что в_OBJECTIVE_PRICE_FALLBACK_SQL). Та же логика, что уMarketMetrics._STOCK_SQL→ пути теперь согласованы._AVG_PRICE_SQLстал price-only. psycopg v3 CAST. Без schema/codegen-изменений (flats_sold/sold_pct— существующие поля).Tests: 217 passed / 4 skipped (DB-gated); +
test_competitors_flats_sold_from_contract_date(120/200 → 60%); broader suite 1349 passed 0 failed. ruff clean.Refs #1926, #1871