deckhearth/.convoys/pricing-online-local/brief-5-foilio-lorcana-pricing.md
Randall Stillwell d0468015eb
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
feat(pricing): convoy for online prices and local stores
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>
2026-09-08 22:47:46 -05:00

43 lines
1.6 KiB
Markdown

---
convoy: pricing-online-local
brief_number: 5
depends_on: [2]
recommended_model: composer-2.5
model_tier: standard
files:
- lib/pricing/foilio-client.js
- lib/card-import/lorcana-bulk.js
- test/lib/pricing/foilio-client.test.js
- test/lib/card-import/lorcana-bulk.test.js
---
# Brief 5: Foilio Lorcana pricing ingest
## Goal (1 sentence)
Enrich Lorcana bulk sync with hourly Foilio feed prices keyed by card id and name+set.
## Files in scope (do not edit anything else)
- `lib/pricing/foilio-client.js`
- `lib/card-import/lorcana-bulk.js`
- `test/lib/pricing/foilio-client.test.js`
- `test/lib/card-import/lorcana-bulk.test.js`
## Conventions to follow
- Feed URL: `process.env.FOILIO_PRICES_FEED_URL ?? 'https://foilio.net/api/prices/feed?game=lorcana'`.
- Client fetches once per sync run; build `Map` by `card_id` and composite `normalize(name)|set`.
- Extend `buildUpsertQuery` / `mapLorcanaCard` to include `current_price`, `market_price`, `prices_updated_at`.
- Prefer USD fields when present; otherwise EUR with `currency` noted in snapshot.
- `recordPriceSnapshots` with `source: 'foilio'`.
- Preserve existing `scryfall_id = Unique_ID` keying.
## Acceptance criteria
- [ ] Lorcana cards receive prices when feed contains a match
- [ ] Single feed fetch per `runBulkLorcanaSync` invocation
- [ ] Summary includes `pricesMatched` / `unmatchedCount`
- [ ] Tests pass with fixture JSON
- [ ] No scope expansion
## Rationale (≤3 sentences)
Lorcana bulk currently omits price columns entirely. Foilio provides a free hourly JSON feed. One fetch per sync aligns with their 1h cache.