Analytics Dashboard, API Gateway Tiers, AGNTCY Compliance — 62 tasks across 8 groups. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1.8 KiB
1.8 KiB
ADDED Requirements
Requirement: Portal includes an Analytics page
The portal SHALL include a new page at /analytics accessible to authenticated tenant admins. The page SHALL render: a line chart (token issuance trend, last 30 days), an activity heatmap (agent activity by day/hour), and a per-agent usage table for the current month. All chart components SHALL be lazy-loaded via next/dynamic.
Scenario: Analytics page is accessible to tenant admins
- WHEN an authenticated tenant admin navigates to
/analytics - THEN the page SHALL render without error and display the token trend chart
Scenario: Analytics page redirects unauthenticated users
- WHEN an unauthenticated user navigates to
/analytics - THEN the portal SHALL redirect to the login page
Requirement: Portal includes a Tier & Billing page
The portal SHALL include a new page at /settings/tier accessible to authenticated tenant admins showing: current tier name, daily limits (agents, API calls, token issuances), current usage vs. limit, and an "Upgrade" button that initiates a Stripe checkout session for tenants not on the enterprise tier.
Scenario: Free tier tenant sees upgrade prompt
- WHEN a
freetier tenant admin navigates to/settings/tier - THEN the page SHALL display current limits, current usage, and an enabled "Upgrade to Pro" button
Scenario: Enterprise tier tenant sees no upgrade prompt
- WHEN an
enterprisetier tenant admin navigates to/settings/tier - THEN the page SHALL display "Enterprise — Unlimited" and SHALL NOT display an upgrade button
Scenario: Upgrade button initiates Stripe checkout
- WHEN a tenant admin clicks "Upgrade to Pro" on the tier page
- THEN the portal SHALL call
POST /api/tiers/upgradeand redirect to the returned Stripe checkout URL