gendesign/tradein-mvp/backend/app
Light1YT fa5e5d83f1
All checks were successful
CI / changes (pull_request) Successful in 6s
CI / backend-tests (pull_request) Has been skipped
CI / frontend-tests (pull_request) Has been skipped
CI / openapi-codegen-check (pull_request) Has been skipped
feat(tradein): recurring house-dedup merge (schedule dormant) (#1772)
Reuses migration 108's proven collision-safe pattern
(cluster → canonical keeper → re-point children with UNIQUE-collision
handling → delete losers → backfill sources/aliases) as a RECURRING,
idempotent scheduled job — dups recur because the matching pipeline keeps
creating them, so a one-time migration cannot fix the steady-state inflow.

- Service app/services/house_dedup_merge.py: merge_duplicate_houses(db, *,
  dry_run=False). Clusters houses by EXACT address (cadastral 100% NULL →
  address is the real key). Keeper: geom NOT NULL → most listings →
  most-populated → min(id). Handles ALL 11 FK children incl. live 6-col
  houses_price_dynamics UNIQUE (migration 029 replaced 108's stale 3-col).
  One transaction; dry_run computes counts then ROLLBACK; idempotent
  (clean table → empty mapping → 0-row no-op). Audit-logs every merge.
- Scheduler: trigger_house_dedup_merge_run (run_in_executor, sync DB-only) +
  dispatch branch + run_house_dedup_merge lifecycle wrapper.
- Migration 135: seeds scrape_schedules house_dedup_merge enabled=FALSE
  (DORMANT — deploy neutral; enable deliberately after dry-run + manual run),
  weekly window, ON CONFLICT DO NOTHING.
- Tests: static SQL-shape (every FK child + collision handling, migration-133
  guard), fake-db dry_run/idempotent, scheduler wiring, optional real-DB
  end-to-end merge test (self-skips without a DB).
2026-06-27 02:23:22 +05:00
..
api feat(scrapers): live pacing-регулятор (GET/PUT /scraper/pacing) + data-quality coverage endpoint 2026-06-20 12:47:03 +03:00
core Merge pull request 'fix(scrapers): avito_full_load краш (source_id-reconcile) + cian/yandex ban-ротация' (#1921) from fix/scraper-resilience-upsert-rotation into main 2026-06-26 16:19:06 +00:00
observability feat(tradein): enrich GlitchTip SDK init — integrations + PII scrub (#396) (#643) 2026-05-29 09:23:17 +00:00
schemas fix(estimator): data-age guards — sber staleness + IMV thin-market (#audit-5) 2026-06-20 15:03:19 +03:00
services feat(tradein): recurring house-dedup merge (schedule dormant) (#1772) 2026-06-27 02:23:22 +05:00
tasks feat(tradein): бэкфилл координат листингов из ekb_geoportal_buildings (street+house match) 2026-06-20 17:08:46 +03:00
__init__.py feat: add tradein-mvp subproject (Trade-In Estimator под /trade-in) 2026-05-21 00:25:39 +03:00
main.py feat(tradein): systemd timer scheduler — trigger script + units + SCHEDULER_ENABLE flag (#581) 2026-05-31 16:53:38 +00:00
scheduler_main.py feat(tradein): отдельный scraper-контейнер — scheduler вне API-процесса (#1182) 2026-06-12 10:50:50 +03:00