feat(site-finder): own-portfolio data source for §25.3 cannibalization (#1169 PR1) #1170
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#1170
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/own-portfolio-cannibalization-952"
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?
Summary
PR 1 (Foundation) of #1169 — the "own portfolio" data source that the §25.3 true cannibalization overlap engine (PR 2) will consume. (§25.3 today is only a proxy = same-class competitor density, #986.)
Two origins, normalized to a common
OwnProjectshape (the 4 §25.3 axes: class / release-month / price ₽/м² / unit-mix + geo):domrf_kn_objectsfiltered bysettings.own_developer_ids(matched against the numeric prefix of the composite TEXTdev_id=companyGroup; empty →[]with no DB hit, no hardcoded id);own_planned_project(migration 148) for the private pipeline domrf can't see.get_own_portfolio(db)returnscurrent + future; per-sourcetry/exceptso one origin failing can't break the other; missing fields →None(never fabricated 0) → PR 2 can degrade honestly (§26).Pieces
OWN_DEVELOPER_IDS(comma-sep →list[int], default[]).148_own_planned_project.sql— range + unit_mix CHECKs (JSONB validated via IMMUTABLE helper, since PG bans subqueries in CHECK), generatedgeom. Validated against ephemeral PostGIS: idempotent, constraints reject bad input./api/v1/own-projectsCRUD — mirror of the insight entity;created_byfromX-Authenticated-User(unspoofable, not in Create/Update schemas).services/site_finder/own_portfolio.py—OwnProject(frozen) +get_own_portfolio.Test plan
uv run pytest -k "own_project or own_portfolio or own_developer"→ 44 passedruff check+mypy(new files) → clean::, empty-ids-skips-DB, per-source failure isolation, None-not-0, config-parse matrixOWN_DEVELOPER_IDSis set, confirmprice_per_m2_min/maxfill-rate + that the configured ids are companyGroup-prefix ints (data/config check, not code).Notes
[](dormant) until the real domrfcompanyGroupid is resolved from a prod query. No id hardcoded.special_indices.py(PR 2) orparcels.py.obj_classcase/language on both sides (reusecompetitors._normalize_class).Refs #1169