Some checks failed
CI / Lint (pull_request) Has been cancelled
CI / Schema map up to date (pull_request) Has been cancelled
CI / Forbidden patterns (9 checks) (pull_request) Has been cancelled
CI / Migrations apply (node-pg-migrate) (pull_request) Has been cancelled
Visual diff / Should run? (pull_request) Has been cancelled
CI / Unit tests (vitest) (pull_request) Has been cancelled
Convoy metrics gate / Require role-event telemetry on convoy PRs (pull_request) Has been cancelled
PR Health rollup / Aggregate gate status (pull_request) Has been cancelled
Preview smoke / Should run? (pull_request) Has been cancelled
Preview smoke / Playwright smoke (pull_request) Has been cancelled
Visual diff / Screenshot diff (pull_request) Has been cancelled
Add pricing schema, free API integrations (MTG bulk, TCGdex, Foolio), valuation and sort-by-price, card detail pricing UI, and nearby store discovery via home zip and OSM geo clients. Co-authored-by: Cursor <cursoragent@cursor.com>
1.7 KiB
1.7 KiB
| convoy | brief_number | depends_on | recommended_model | model_tier | files | cross_brief_commitments | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| pricing-online-local | 3 |
|
composer-2.5 | standard |
|
|
Brief 3: MTG bulk sync + snapshots
Goal (1 sentence)
Update Scryfall bulk sync to stamp prices_updated_at and record daily price history snapshots.
Files in scope (do not edit anything else)
lib/card-import/bulk-sync.jstest/lib/card-import/bulk-sync.test.js
Conventions to follow
- Keep existing
mapCard()mapping:usd→current_price,usd_foil→market_price. - Add
prices_updated_atto INSERT/UPDATE columns (set when either price is non-null). - After each successful
upsertBatch, callrecordPriceSnapshotsfor rows with prices (source: 'scryfall',priceType: 'market'for nonfoil amount, optionally second snapshot for foil if present). - Export
mapCardfor unit tests (or test via named export already present). - Preserve Scryfall User-Agent header.
Acceptance criteria
upsertBatchwritesprices_updated_at- Price snapshots recorded per card per sync day
mapCardunit tests cover price parsing- Existing
runBulkMtgSyncreturn shape unchanged (add optionalsnapshotsWrittencount) - Tests pass
- No scope expansion
Rationale (≤3 sentences)
MTG already has price data from Scryfall; this brief wires timestamps and history without changing upstream source. Fixes the data pipeline for Phase 1 pricing API reads.