feat(etl): track/album price history tables and writes (parity 2B)#243
Open
raymondjacobson wants to merge 1 commit intoetl/parity-2a-playlist-tracksfrom
Open
feat(etl): track/album price history tables and writes (parity 2B)#243raymondjacobson wants to merge 1 commit intoetl/parity-2a-playlist-tracksfrom
raymondjacobson wants to merge 1 commit intoetl/parity-2a-playlist-tracksfrom
Conversation
Stack 2B. Adds the gating-price audit trail tables apps maintains and
wires writes into entity_manager handlers.
Migration 0022:
- usdc_purchase_access_type enum ('stream', 'download').
- track_price_history (track_id, splits, total_price_cents, blocknumber,
block_timestamp, access). PK (track_id, block_timestamp).
- album_price_history (playlist_id, splits, total_price_cents, blocknumber,
block_timestamp). PK (playlist_id, block_timestamp).
Combined from apps#0017_track_price_history, #0051_usdc_purchase_access,
and #0058_album_price_history.
price_history.go provides updateTrackPriceHistory + updateAlbumPriceHistory
mirroring apps' Python helpers in track.py / playlist.py:
- access = 'stream' if is_stream_gated, else 'download' if is_download_gated.
- Skip insert when latest row matches new (price, splits, access).
- Wire into track_create / track_update / playlist_create / playlist_update.
Three DB-backed tests cover gated track writes a row, free track does not,
gated playlist writes an album_price_history row.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stack 2B. Adds the gating-price audit trail tables and wires writes into entity_manager handlers.
Migration 0022:
Combined from apps#0017_track_price_history, #0051_usdc_purchase_access, #0058_album_price_history.
price_history.go provides `updateTrackPriceHistory` + `updateAlbumPriceHistory` mirroring apps' Python helpers:
Stack context
Stacked on #242 (2A — playlist_tracks).
Test plan
🤖 Generated with Claude Code