feat(domrf): persist domrf_kn_objects.free_flats (#950 PR A) #1002
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#1002
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/950a-domrf-free-flats"
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?
Site Finder v2 / EPIC 6 (3-layer склад) — #950 Step 1 / PR A. Детерминированный, без LLM. Часть #944.
Парсит
freeFlatsInfo.numberFlats(кол-во квартир ЖК в текущей продаже) → новая nullabledomrf_kn_objects.free_flats INT, siblingprice_min_rub. Миграция 124 добавляет колонку + бэкфиллит историю из сохранённого raw-payload (domrf_raw_endpoints, тот жеjsonb_array_elements-паттерн, что уже на проде в миграции 121) — без ре-скрейпа. Digit-cap{1,9}/{1,18}гарантирует, что CAST не переполнит int4/bigint на deploy-gate.Разблокирует object-level Layer2:
hidden = flat_count (всего по ПД) − free_flats (выставлено).code-reviewer opus ✅ (deploy-gate safety: shape прод-доказана мигр.121, overflow закрыт digit-cap, idempotent, non-destructive). _to_int: bool→None, 0 сохраняется, overflow-safe. Refs #950
Parse freeFlatsInfo.numberFlats (currently-listed flat count) from the kn-API payload into a new nullable free_flats INT, mirroring price_min_rub (extraction via _to_int, UPSERT column/bind, ON CONFLICT overwrite). _to_int rejects bool, preserves 0, truncates float, and is overflow-safe. Migration 124 adds the column + COMMENT and backfills historical rows deterministically from the stored raw payload (domrf_raw_endpoints, section kn_api) without re-scraping — same jsonb_array_elements pattern already proven on prod in migration 121, plus a {1,9}/{1,18} digit-cap so a stray numeric string can never overflow int4/bigint at the deploy gate. Unblocks object-level Layer2 (Site Finder v2 EPIC 6): hidden = flat_count (total PD) − free_flats (listed now).