Fix API field name mismatches across all pages #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-mcd-tracker→ Phase 7 (SvelteKit frontend)Repo
forgejo_admin/mcd-tracker-appUser Story
As a user navigating the app
I want pages to actually load data from the API correctly
So that I see real information instead of blank fields or errors
Context
The SvelteKit pages were built from playground HTML with made-up field names that don't match the actual API response schemas. Every page that renders API data has mismatches. This is a wiring-only fix — no design changes, no playground needed.
Known mismatches:
history/+page.svelte—c.code→c.bogo_code,r.scanned_at→r.captured_at, expiry detection using wrong fieldhistory/[id]/+page.svelte—event.code→event.bogo_codelocations/[id]/+page.svelte—code.code→code.bogo_code,slots.used→slots.active_codes,slots.total→slots.total_slots, API returns flat array but template expectscodes.active/codes.redeemedgrouping, date fields need formattinghome/+page.svelte— leftover debug panel and console.logs from GPS debugging sessionFile Targets
Files to modify:
src/routes/history/+page.svelte— field name fixes inbuildTimeline()src/routes/history/[id]/+page.svelte—event.code→event.bogo_codesrc/routes/locations/[id]/+page.svelte— field names, client-side code grouping, date formatting, overlay refactorsrc/routes/home/+page.svelte— remove debug panel and debug console.logsFiles NOT to touch:
src/routes/scan/+page.svelte— redesign handled by separate ticketsrc/routes/+page.svelte— landing page, no API datasrc/app.css— no style changesAcceptance Criteria
Test Expectations
npm run test)npm run testConstraints
CodeResponse,SlotAvailability,ReceiptResponseChecklist
Related
plan-mcd-tracker→ Phase 7mcd-tracker-api/src/mcd_tracker_api/schemas.py