gendesign/backend/tests/api/v1
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
..
__init__.py feat(cadastre): bulk_harvest worker + grid-walker + admin API (#168 PR3/5) (#171) 2026-05-15 13:31:32 +03:00
conftest.py test(analyze): авто-стаб geoportal зон-резолвера в api/v1 тестах (CI desync fix) 2026-06-24 04:33:17 +05:00
test_admin_cadastre.py test(suite): re-align drifted tests with current code (CI-rehab 2/3) 2026-06-03 19:05:43 +05:00
test_admin_ekburg_permits.py test(suite): re-align drifted tests with current code (CI-rehab 2/3) 2026-06-03 19:05:43 +05:00
test_admin_jobs_settings.py fix(admin-jobs): UPSERT в PUT /admin/jobs/settings — не терять изменения (#1223) 2026-06-13 08:36:23 +00:00
test_admin_scrape_freshness.py fix(freshness): repoint nspd source to live nspd_quarter_dumps (data-table mode) 2026-06-26 06:51:00 +00:00
test_analyze_competitors_status.py perf(site-finder): pushdown obj_pricing CTE to nearby competitors (#70/#307) (#1335) 2026-06-14 16:58:43 +00:00
test_analyze_inline_weights.py perf(site-finder): air-quality TTL-кэш + neighbors_summary 2→1 SQL (#1130 Phase B) 2026-06-12 22:42:32 +05:00
test_analyze_market_price.py perf(site-finder): air-quality TTL-кэш + neighbors_summary 2→1 SQL (#1130 Phase B) 2026-06-12 22:42:32 +05:00
test_analyze_parcel_meta.py perf(site-finder): air-quality TTL-кэш + neighbors_summary 2→1 SQL (#1130 Phase B) 2026-06-12 22:42:32 +05:00
test_analyze_recent_permits.py perf(site-finder): air-quality TTL-кэш + neighbors_summary 2→1 SQL (#1130 Phase B) 2026-06-12 22:42:32 +05:00
test_analyze_zoning_regulation.py fix(gate): main_vri-authoritative детекция МКД (убрать Ж-1/Ж-2 ИЖС false-positive, включить Ц-2) 2026-06-24 03:59:31 +05:00
test_chat.py fix(backend): экранировать Excel formula-injection (#1244) + увести chat-чтение с event loop (#1245) 2026-06-13 18:10:21 +05:00
test_custom_pois.py perf(site-finder): air-quality TTL-кэш + neighbors_summary 2→1 SQL (#1130 Phase B) 2026-06-12 22:42:32 +05:00
test_insights.py feat(insights): manual-entry Insight entity CRUD + §19 audit (#948 part A) 2026-06-08 12:41:39 +05:00
test_locations.py feat(location): district-level Location entity + indices (#948 part B) 2026-06-08 13:28:19 +05:00
test_own_projects.py feat(site-finder): own-portfolio data source for §25.3 cannibalization (#1169 PR1) 2026-06-08 16:21:53 +05:00
test_parcel_best_layouts.py test(suite): re-align drifted tests with current code (CI-rehab 2/3) 2026-06-03 19:05:43 +05:00
test_parcel_by_bbox.py fix(analyze): district KeyError 500 in #994 persist + revive by-bbox tests 2026-06-03 18:04:37 +05:00
test_parcel_competitors.py fix(site-finder): align competitor flats_sold to objective_lots.contract_date (#1926) 2026-06-26 23:03:13 +05:00
test_parcel_connection_points.py feat(parcels): connection-points endpoint (Forgejo #115 Phase 1 backend) (#190) 2026-05-16 05:58:27 +00:00
test_parcel_snapshot_exclude_dev.py feat(site-finder): snapshot.pdf exclude_dev param — hide competitor by developer name 2026-06-18 15:23:28 +03:00
test_parcels_forecast.py fix(site-finder): 5 дефектов из боевого фидбека analyze (#1736 #1737 #1738 #1739 #1740) 2026-06-18 11:47:21 +05:00
test_run_history_and_response_contract.py perf(site-finder): air-quality TTL-кэш + neighbors_summary 2→1 SQL (#1130 Phase B) 2026-06-12 22:42:32 +05:00