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.6 KiB
1.6 KiB
| convoy | brief_number | depends_on | recommended_model | model_tier | files | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| pricing-online-local | 7 |
|
composer-2.5 | standard |
|
Brief 7: Sort by price wiring
Goal (1 sentence)
Wire “Sort by Price” through owned-cards and list APIs into collection and My Collection UIs.
Files in scope (do not edit anything else)
pages/api/cards/owned.jspages/api/collections/[identifier]/cards.jslib/use-collection-view.jscomponents/CollectionPageView.jspages/my-cards.jstest/api/cards-owned-sort.test.js
Conventions to follow
- Query params:
sort=name|price|rarity|date,order=asc|desc(defaultname/asc). - Price sort uses
listUnitPriceExprorCOALESCE(c.current_price, c.market_price); NULLs last. CollectionPageViewselect options must use stable values (name,price, etc.) not display strings.- Server-side sort required for paginated My Collection.
Acceptance criteria
/api/cards/owned?sort=price&order=descorders by effective price- Collection cards API supports same params
- UI sort dropdown changes card order
- API test asserts ORDER BY clause or result ordering
- Tests pass
- No scope expansion
Rationale (≤3 sentences)
Sort UI exists but is inert. Server-side sort avoids loading entire collections client-side. Depends on valuation helpers for consistent price column.