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.3 KiB
1.3 KiB
| convoy | brief_number | depends_on | recommended_model | model_tier | files | ||||
|---|---|---|---|---|---|---|---|---|---|
| pricing-online-local | 11 |
|
composer-2.5 | standard |
|
Brief 11: Stores nearby API
Goal (1 sentence)
Ship GET /api/stores/nearby with geocode + Overpass lookup, caching, and per-user refresh rate limit.
Files in scope (do not edit anything else)
pages/api/stores/nearby.jslib/rate-limit.jstest/api/stores-nearby.test.js
Conventions to follow
- Auth required (
getUserFromRequest→ 401). Zip from user's savedhome_ziponly — ignore arbitraryzipquery param (security planning decision A). - Add
storeslimiter: 1/hour/user; IP backstop for burst abuse. - Respect
PRICING_LOCAL_ENABLED— return 503 whenfalse. - Overpass fixed-template query only (see Brief 10).
Acceptance criteria
- Endpoint returns store list for authenticated user with saved zip
- 401 without Bearer token
- Second call within 7 days serves from
geo_stores_cache - Rate limit returns 429 with
Retry-After - Tests pass
- No scope expansion
Rationale (≤3 sentences)
Phase 2 API surface from convoy spec. Auth-gated zip prevents geocode relay abuse. Rate limiting protects Overpass.