fix: audit follow-up мелочи — индекс domrf_kn_flats + max_height_m coercion + hide empty reg-date (#1953) #2031

Merged
bot-backend merged 1 commit from fix/audit-followups-1953 into main 2026-06-27 22:37:14 +00:00
Collaborator

Мелкие хвосты аудита (эпик #1953). code-reviewer APPROVE.

  • perf — миграция 174_domrf_kn_flats_obj_snapshot_idx.sql: CREATE INDEX IF NOT EXISTS idx_kn_flats_obj_snap ON domrf_kn_flats (obj_id, snapshot_date DESC) — обслуживает #1956 flats_latest CTE (DISTINCT ON+self-join). Прод: 789k строк, индекс ~5.7МБ, dry-run instant. Идемпотентно, BEGIN/COMMIT.
  • frontendmax_height_m string-баг (тот же класс что #1962 max_far): NUMERIC→строка на wire, читался сырым в ptica-adapt.ts (420/964/1667/2005) → прокинут через coerceFloat; тип string|number|null (nspd.ts) + исправлены устаревшие «real number» комменты.
  • frontend — пустая «Дата регистрации» (null у ~41k/42k участков) больше не рендерит строку «—» в ЕГРН-таблице (EgrnPropertyTable.buildRows); CSV-экспорт колонки не тронут.

Качество

  • ruff ; tsc clean; next lint clean; prettier 3.9.0 clean; 13 фронт + 49 backend (best_layouts) тестов. Без OpenAPI-изменений → api-types не тронут.

Refs #1953.

Мелкие хвосты аудита (эпик #1953). code-reviewer ✅ APPROVE. - **perf** — миграция `174_domrf_kn_flats_obj_snapshot_idx.sql`: `CREATE INDEX IF NOT EXISTS idx_kn_flats_obj_snap ON domrf_kn_flats (obj_id, snapshot_date DESC)` — обслуживает #1956 `flats_latest` CTE (DISTINCT ON+self-join). Прод: 789k строк, индекс ~5.7МБ, dry-run instant. Идемпотентно, BEGIN/COMMIT. - **frontend** — `max_height_m` string-баг (тот же класс что #1962 max_far): NUMERIC→строка на wire, читался сырым в `ptica-adapt.ts` (420/964/1667/2005) → прокинут через `coerceFloat`; тип `string|number|null` (nspd.ts) + исправлены устаревшие «real number» комменты. - **frontend** — пустая «Дата регистрации» (null у ~41k/42k участков) больше не рендерит строку «—» в ЕГРН-таблице (`EgrnPropertyTable.buildRows`); CSV-экспорт колонки не тронут. ## Качество - ruff ✅; tsc clean; next lint clean; prettier 3.9.0 clean; 13 фронт + 49 backend (best_layouts) тестов. Без OpenAPI-изменений → api-types не тронут. Refs #1953.
bot-backend added 1 commit 2026-06-27 22:22:28 +00:00
fix(audit): index for flats_latest, coerce max_height_m, hide empty reg-date (#1953)
All checks were successful
CI / changes (pull_request) Successful in 8s
CI / frontend-tests (pull_request) Successful in 1m2s
CI / openapi-codegen-check (pull_request) Successful in 1m56s
CI / backend-tests (pull_request) Successful in 14m7s
8aec625134
Three #1953 audit follow-ups:

- perf: add migration 174 — composite index idx_kn_flats_obj_snap on
  domrf_kn_flats (obj_id, snapshot_date DESC). Serves the #1956 flats_latest
  CTE in best_layouts.py (DISTINCT ON (obj_id) ORDER BY obj_id, snapshot_date
  DESC + self-join on (obj_id, snapshot_date)); previously only (obj_id)
  existed so Postgres sorted per object. Prod: 789 569 rows, idx ~5.7 MB,
  dry-run instant. Idempotent, self-wrapped BEGIN/COMMIT.

- frontend: route every max_height_m read through coerceFloat (same string-bug
  class as max_far #1962). max_height_m is NUMERIC → arrives as a string on the
  wire; ptica-adapt.ts read it raw at 4 sites and relied on formatInt/Math.round
  coercion. Widen the type in nspd.ts and fix the stale "real number" comment in
  nspd-regulation.ts.

- frontend: hide the «Дата регистрации» EGRN row entirely when
  registration_date is null (~97% of parcels) instead of rendering a bare «—».
bot-backend merged commit 91edef1524 into main 2026-06-27 22:37:14 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lekss361/gendesign#2031
No description provided.