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.8 KiB
1.8 KiB
| convoy | brief_number | depends_on | recommended_model | model_tier | files | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| pricing-online-local | 4 |
|
composer-2.5 | standard |
|
Brief 4: TCGdex Pokémon pricing ingest
Goal (1 sentence)
Ingest USD TCGPlayer prices from TCGdex during Pokémon bulk sync instead of writing null prices.
Files in scope (do not edit anything else)
lib/pricing/tcgdex-client.jslib/card-import/pokemon-bulk.jstest/lib/pricing/tcgdex-client.test.jstest/lib/card-import/pokemon-bulk.test.js
Conventions to follow
- Base URL from
process.env.TCGDEX_BASE_URL ?? 'https://api.tcgdex.net/v2/en'. - Client:
fetchSetCards(setId)with 100ms delay between set requests; parsepricing.tcgplayer(USD market/low) andpricing.cardmarket(EUR — store inmarket_priceonly when USD missing, document in code comment). - Match TCGdex cards to DB rows by
set_code+card_number(normalize leading zeros); fallback name match within set. mapPokemonBulkRow/buildUpsertQuery: populatecurrent_price(low or market NM),market_price(market),prices_updated_at.- Call
recordPriceSnapshotswithsource: 'tcgdex'. - Log
unmatchedCountin sync summary JSON.
Acceptance criteria
- Pokémon bulk no longer writes
nullprices when TCGdex has data - Gentleness: 100ms sleep between set fetches
- Unit tests with mocked fetch fixtures
runBulkPokemonSyncsummary includespricesMatched/unmatchedCount- Tests pass
- No scope expansion
Rationale (≤3 sentences)
Pokémon catalog sync currently nulls prices. TCGdex is the convoy's free USD source. Set-batched fetch keeps within polite limits.