gendesign/backend/app/services
Light1YT c336f91182
All checks were successful
CI / changes (pull_request) Successful in 6s
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Successful in 1m50s
CI / backend-tests (pull_request) Successful in 11m17s
fix(site-finder): align competitor flats_sold to objective_lots.contract_date (#1926)
Audit #1871/#1926: competitor block computed flats_sold from
domrf_kn_flats.status (LIKE '%прод%'/'sold'), populated in only ~0.2% of
rows (99.8% NULL) -> massive undercount (~1600 units in reported case) and
divergence from MarketMetrics, which counts sold via objective_lots.contract_date
(100% populated for sold lots).

Fix: new _SOLD_COUNT_SQL counts sold lots from objective_lots.contract_date
IS NOT NULL, bridged domrf obj_id -> objective_complex_mapping.domrf_obj_id ->
objective_complex_mapping.objective_complex_name == objective_lots.project_name
(same 1:1 mapping pattern as _OBJECTIVE_PRICE_FALLBACK_SQL primary_price CTE).
This is the exact source MarketMetrics._STOCK_SQL uses, so the two paths agree.
Dropped the domrf_kn_flats.status count from _AVG_PRICE_SQL (price-only now).

No schema/Pydantic field change (flats_sold/sold_pct already existed) ->
codegen not needed. psycopg v3 CAST style preserved.

Tests: updated mock DB ordering (+ sold-count execute), added
test_competitors_flats_sold_from_contract_date (120/200 -> 60% sold) and
phantom-column EXPLAIN check for _SOLD_COUNT_SQL.
2026-06-26 23:03:13 +05:00
..
analysis_runs fix(week-review): backend-аудит v2 — 82 фиксов (#1660) 2026-06-17 17:13:38 +00:00
analytics fix(week-review): backend-аудит v2 — 82 фиксов (#1660) 2026-06-17 17:13:38 +00:00
cadastre fix(cadastre): cad_territorial_zones MULTIPOLYGON typmod + ST_Multi coercion (#1344) 2026-06-17 20:23:56 +03:00
chat fix(admin-scrape): ge=1 on count param + enforce LLM finish_reason (#review-followup) 2026-06-17 21:23:13 +03:00
etl feat(etl): housing-class normalization fallback via yandex_realty trigram match (#38) (#1911) 2026-06-26 07:44:25 +00:00
exporters fix(forecasting): honest scenarios collapse when β rate-sensitivity gate fails (audit #1871 P1) 2026-06-22 19:06:22 +05:00
forecasting fix(forecasting): honest scenarios collapse when β rate-sensitivity gate fails (audit #1871 P1) 2026-06-22 19:06:22 +05:00
generative feat(financial/dcf): dormant separate-index inflation capability (default OFF) 2026-06-25 12:12:02 +00:00
llm fix(llm): word-boundary INN match, tighten edge cases (#1640 follow-up) 2026-06-17 21:24:59 +03:00
photos merge: resolve conflicts with main (#1660) into week-review-finish 2026-06-17 20:21:06 +03:00
scrapers fix(scrapers): named BrowserSession concurrency const, fix Semaphore(3) doc drift (#1347) (#1913) 2026-06-26 07:44:29 +00:00
site_finder fix(site-finder): align competitor flats_sold to objective_lots.contract_date (#1926) 2026-06-26 23:03:13 +05:00
__init__.py init 2026-04-25 13:45:19 +03:00
analytics_queries.py feat(etl): housing-class normalization fallback via yandex_realty trigram match (#38) (#1911) 2026-06-26 07:44:25 +00:00
analytics_refresh.py fix(scrape): SQLAlchemy text() парсил ':00:' regex как named-param 2026-04-30 23:16:11 +03:00
forecast_request_cache.py perf(forecast): per-request memoization cache for §22 cold build (#1129) 2026-06-08 05:26:27 +00:00
insights.py feat(insights): manual-entry Insight entity CRUD + §19 audit (#948 part A) 2026-06-08 12:41:39 +05:00
job_settings.py fix(admin-jobs): UPSERT в PUT /admin/jobs/settings — не терять изменения (#1223) 2026-06-13 08:36:23 +00:00
objective_etl.py fix(week-review): backend-аудит v2 — 82 фиксов (#1660) 2026-06-17 17:13:38 +00:00
objective_sync_config.py fix(objective-sync): log seed failure вместо bare except pass (#1226) 2026-06-13 15:03:34 +05:00
own_projects.py feat(site-finder): own-portfolio data source for §25.3 cannibalization (#1169 PR1) 2026-06-08 16:21:53 +05:00
weather_cache.py fix(weather): wind_d returns None when no valid samples, not fabricated 0.0° (#weather-cache) 2026-06-17 21:22:31 +03:00