feat(tradein): daily asking→sold ratio refresh (#648 S4) #663

Merged
Light1YT merged 1 commit from feat/648-s4-ratio-refresh into main 2026-05-29 13:49:37 +00:00
Owner

Stage 4 of #648. Daily scheduled recompute_asking_to_sold_ratios — TRUE-MIRROR refresh (DELETE WHERE district= + re-run 080 derivation in one tx) so the ratio stays fresh + drops sub-threshold stale rows. Migration 082 seeds the schedule enabled=true, window 06:00-07:00 UTC (after rosreestr import). code-reviewer (byte-for-byte derivation parity with 080 proven; atomic; trigger mirrors #570). 26 tests; 082 dry-run prod OK. Backend of #648 now complete (S1-S4); S5 frontend pending UI decision. Refs #648.

Stage 4 of #648. Daily scheduled `recompute_asking_to_sold_ratios` — TRUE-MIRROR refresh (DELETE WHERE district= + re-run 080 derivation in one tx) so the ratio stays fresh + drops sub-threshold stale rows. Migration 082 seeds the schedule enabled=true, window 06:00-07:00 UTC (after rosreestr import). code-reviewer ✅ (byte-for-byte derivation parity with 080 proven; atomic; trigger mirrors #570). 26 tests; 082 dry-run prod OK. Backend of #648 now complete (S1-S4); S5 frontend pending UI decision. Refs #648.
Light1YT added 1 commit 2026-05-29 13:49:35 +00:00
Scheduled job recompute_asking_to_sold_ratios re-derives asking_to_sold_ratios
daily so the estimator's asking→sold correction doesn't go stale as nightly
ДКП deals import. TRUE-MIRROR refresh: DELETE WHERE district='' + re-run the
080 derivation INSERT...SELECT in one transaction (atomic, single commit) —
drops stale per-rooms rows that fall below the 30/30 threshold, which the 080
ON CONFLICT DO UPDATE seed would have left behind.

- app/tasks/asking_to_sold_ratio.py: sync task (run_in_executor); derivation
  byte-identical to migration 080; returns/logs counters; rollback+mark_failed
  +re-raise on error.
- scheduler.py: trigger_asking_to_sold_ratio_run + dispatch (mirrors #570 snapshot).
- migration 082: seed scrape_schedules enabled=true, window 06:00-07:00 UTC
  (after rosreestr import), ON CONFLICT DO NOTHING.
- 26 tests.
Light1YT merged commit a060651328 into main 2026-05-29 13:49:37 +00:00
Light1YT deleted branch feat/648-s4-ratio-refresh 2026-05-29 13:49:37 +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#663
No description provided.