Skip to content

Retailer admin

The retailer admin portal renders under /demo/admin. It is read-only by design: the retailer reviews evidence rather than editing quotes. Three pages: dashboard, list, detail.

Top header with retailer short name plus one-line description. Below that:

  • Four KPI tiles: quotes this week, acknowledgement rate, average quote value, top rep this month.
  • Sparkline: quotes per day for the last 14 days, rendered by components/admin/sparkline.tsx.
  • Recent quotes preview: top 5 of getQuotesForSkin(skinId), with a “See all quotes” link to the list view.

KPIs are computed by computeKpis(skinId) from lib/fixtures.ts:

const { quotesThisWeek, ackRate, avgValue, topRep, sparkline, total }
= computeKpis(skinId);

Filterable table of all quotes for the active skin. Columns: date, rep, customer, value, status, picked option. Filters: rep (dropdown), status (multi-select chip), date range, value range. CSV export button (downloads a static fixture in v1).

Status badge colours:

  • sent: slate
  • opened: sky
  • option-picked: amber
  • acknowledged: emerald
  • expired: rose

Quote header (id, customer, rep, date, value, status badge), the picked option’s full computed quote, the styled PDF preview, and the full audit timeline.

The audit timeline (components/admin/activity-timeline.tsx) renders events newest-first. Each event shows the actor (rep, customer, system), description, timestamp, and any structured detail.

For each quote, the fixture seed produces a status with this distribution:

StatusProbabilityEvents
acknowledged35%quote-created, quote-sent, magic-link-clicked, option-picked, acknowledgements-confirmed
option-picked25%quote-created, quote-sent, magic-link-clicked, option-picked
opened20%quote-created, quote-sent, magic-link-clicked
sent15%quote-created, quote-sent
expired5%quote-created, quote-sent, quote-expired

See AuditEvent and AdminQuote shapes in Reference, Data shapes.

  • Switch skin via the top-corner skin switcher. Dashboard, list, and detail re-render against the new skin’s quotes.
  • Filter the list by rep, status, date, value.
  • Click a row in the list. Routes to /demo/admin/quote/[id].
  • Click “Download PDF” or “CSV export”. Both download static fixtures in v1.
DirectionSource / sink
IngetQuotesForSkin(skinId) from lib/fixtures.ts
IngetQuoteById(skinId, id) for the detail page
IncomputeKpis(skinId) for dashboard tiles
Out (planned)CSV export hits POST /admin/csv-export
Out (planned)List filters hit GET /admin/quotes?rep=&status=&dateFrom=&dateTo=

In v1 there is no real auth on the admin portal. In production it sits behind retailer SSO with an RBAC matrix (admin, auditor, read-only). See Implementation, For retailers, Adoption path.

stateDiagram-v2
[*] --> Dashboard
Dashboard --> List : click "See all quotes"
Dashboard --> Detail : click recent quote row
List --> Detail : click quote row
List --> List : filter change, sort change
List --> CsvExport : click Export
CsvExport --> List : download triggers, page state preserved
Detail --> List : click breadcrumb
Detail --> Dashboard : click brand
Detail --> PdfDownload : click "Download PDF"
PdfDownload --> Detail
  • components/admin/admin-dashboard.tsx
  • components/admin/admin-list.tsx
  • components/admin/admin-quote-detail.tsx
  • components/admin/kpi-tile.tsx
  • components/admin/quote-table.tsx
  • components/admin/quote-status-badge.tsx
  • components/admin/sparkline.tsx
  • components/admin/activity-timeline.tsx
  • admin-dashboard-solaris.png: Solaris KPIs and sparkline
  • admin-list-filtered.png: list filtered to status=acknowledged
  • admin-detail-acknowledged.png: full timeline including all five events
  • admin-detail-expired.png: short timeline showing the expiry path