feat(tradein): per-source listing price history — schema + daily snapshot (#570) #646
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#646
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/570-per-source-history"
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
Closes #570. Per-source listing price history —
listing_sourcesonly kept the latest snapshot, no history; scrapers are dormant so organic accumulation cant wait.Migration 079:
listing_source_snapshots(daily per-source, plain table — partitioning deferred, ~540k rows/mo is fine unpartitioned) +listing_source_events(change-log) +offer_price_history.listing_source_idbacklink +v_listing_source_price_on_dateview. Idempotent.snapshot_listing_sources()(app/tasks): daily snapshot of the existing 18,355 listing_sources + set-based CTE diff of todays price vs prior snapshot →price_changeevents. Wired into the in-app scheduler (listing_source_snapshot, enabled=true — pure internal DB, no external calls/anti-bot, window 01:00-02:00 UTC). History accumulates from tonight, independent of dormant scrapers.code-reviewer ✅ no blockers (FK cascades sound; event-diff guards correct; same-day double-fire impossible via
_claim_run+has_running_run→ no dup events; psycopg-v3 clean).Test plan
Closes #570