Why
After PR #144 ships, clicking a link in the list goes nowhere. Detail page is where merchants see the QR code, get the shareable URL, watch conversion stats, and deactivate. Standard CRUD completion.
Depends on: #144 (PR 8 — the list page that links here).
Scope
One page at `apps/dashboard/src/app/(dashboard)/links/[id]/page.tsx`.
API endpoints (already shipped)
| Verb |
Path |
Returns |
| GET |
`/v1/payment-links/:id` |
The full `PaymentLink` object |
| GET |
`/v1/payment-links/:id/stats` |
`{ linkId, totalViews, totalPayments, conversionRate, totalRevenue, currency }` |
| DELETE |
`/v1/payment-links/:id` |
Deactivates (sets `active=false`) |
What to build
Three vertical sections + a sidebar.
Hero card
- Big mono `lnk_…` ID
- Status badge (reuse `LinkStatusBadge`)
- Big amount + currency, or "Open amount"
- Description below
- Two CTAs side-by-side: "Copy URL" (with toast), "Download QR" (the qrCodeUrl is a data:url — trigger a download)
Stats strip (calls /stats)
- Three tiles: Views · Payments · Conversion rate
- Conversion rate gets a sparkline if we add a /stats/timeseries endpoint later (out of scope for this PR — show flat number)
- Total revenue card with the link's currency
Recent payments table (calls /v1/payments?linkId=…)
- Last 10 payments routed through this link
- Columns: created, payer (or "—" if anonymous), amount, method (card/bank/crypto), status badge
- Click a row → /payments/[id] (existing page)
- "View all payments" link at the bottom filtering /payments by this link
Right sidebar
- Created at, updated at (relative time + tooltip with full ISO)
- Single-use vs multi-use chip
- Expiry: "Never" or "Expires Aug 4" with a tooltip showing the full datetime
- Hairline rule, then a destructive "Deactivate link" button (only when status === "active") with a confirm dialog
Files to read first
- `apps/dashboard/src/app/(dashboard)/payments/[id]/page.tsx` — sibling detail page, mirror the layout
- `apps/dashboard/src/components/links/LinkCard.tsx` — already renders much of the same data
- `apps/dashboard/src/components/links/LinkStatusBadge.tsx` — reuse as-is
Acceptance criteria
Estimated effort
~0.5 day if PR 8's components are in place.
Why
After PR #144 ships, clicking a link in the list goes nowhere. Detail page is where merchants see the QR code, get the shareable URL, watch conversion stats, and deactivate. Standard CRUD completion.
Depends on: #144 (PR 8 — the list page that links here).
Scope
One page at `apps/dashboard/src/app/(dashboard)/links/[id]/page.tsx`.
API endpoints (already shipped)
What to build
Three vertical sections + a sidebar.
Hero card
Stats strip (calls /stats)
Recent payments table (calls /v1/payments?linkId=…)
Right sidebar
Files to read first
Acceptance criteria
Estimated effort
~0.5 day if PR 8's components are in place.