Dashboard Wiring Map
Generated: 2025-11-XXPurpose: Document all page → endpoint → params mappings for Nov 2025 validation
1. /ceo (Executive Dashboard)
File: dashboard/src/pages/ceo/index.tsx
Endpoints Called:
| Endpoint | Method | Params | Period Format | Notes |
|---|---|---|---|---|
/api/v1/ceo-metrics | GET | period_label, period_type? (ytd/qtd) | YYYY-MM-01 | Main CEO metrics with breakdowns |
/api/v1/audit-checks | GET | period_label | YYYY-MM-01 | Audit check data |
/api/v1/commissions | GET | period_label, limit, offset | YYYY-MM-01 | Paginated commissions |
/api/v1/growth-loss | GET | period_label | YYYY-MM-01 | Growth/loss summary |
/api/v1/agents/performance | GET | period_label | YYYY-MM-01 | Agent performance rankings |
/api/v1/business-health | GET | period_label | YYYY-MM-01 | Business health metrics |
/api/v1/growth-loss-details | GET | period_label, limit | YYYY-MM-01 | Detailed growth/loss |
/api/v1/new-lost-businesses | GET | period_label | YYYY-MM-01 | Via renderCard() factory |
/api/v1/top-businesses | GET | period_label, limit=10 | YYYY-MM-01 | Via renderCard() factory |
/api/v1/top-agents | GET | period_label, limit=10 | YYYY-MM-01 | Via renderCard() factory |
- Uses
CEO_PERIOD_OPTIONSconstant (hardcoded array) - Converts
YYYY-MMformat toYYYY-MM-01for API calls - Supports
period_typetoggle (MTD/YTD/QTD) for CEO metrics
- All endpoints return HTTP 200 with correct shape
- Non-empty arrays/counts for Nov 2025 data
- KPI cards update when period changes
- Charts/tables reflect selected period
2. /agent (Agent Overview Tab)
File: dashboard/src/pages/agent/index.tsx
Endpoints Called:
| Endpoint | Method | Params | Period Format | Notes |
|---|---|---|---|---|
/api/v1/leaderboard | GET | period_label, limit=10 | YYYY-MM-01 | Top agents leaderboard |
/api/v1/agents/{agentName}/kpi-metrics | GET | agentName, period_label, period_type? | YYYY-MM-01 | Agent KPI metrics |
/api/v1/agents/{agentName}/commissions | GET | agentName, period_label, limit, period_type? | YYYY-MM-01 | Agent commissions |
/api/v1/agents/{agentName}/business-health | GET | agentName, period_label | YYYY-MM-01 | Business health for agent |
/api/v1/agents/{agentName}/trends | GET | agentName, months | Date range | Multi-month trend data |
- Uses
AGENT_PERIOD_OPTIONSconstant (hardcoded array) - Converts
YYYY-MMformat toYYYY-MM-01for API calls - Supports
period_typetoggle (MTD/YTD/QTD) for some endpoints
- All endpoints return HTTP 200 with correct shape
- KPI cards show agent-specific metrics for selected period
- Leaderboard reflects selected period
- Trend charts include Nov 2025 in range
3. /agent?tab=detailed (Agent Detailed Reporting Tab)
File: dashboard/src/pages/agent/index.tsx (same file, different tab)Component:
<AgentDetail agentName={agentName} />
Endpoints Called:
| Endpoint | Method | Params | Period Format | Notes |
|---|---|---|---|---|
(Check AgentDetail.tsx for exact endpoints) | Likely uses date range queries |
- Same as Overview tab (uses
AGENT_PERIOD_OPTIONS) - May use date range queries (2025-01 to 2025-12) that automatically include Nov
- Detailed reports include Nov 2025 data
- Aggregates reflect Nov in range
- Charts update when period changes
4. /agent/insights (Agent Insights)
File: dashboard/src/pages/agent/insights/index.tsx
Endpoints Called:
| Endpoint | Method | Params | Period Format | Notes |
|---|---|---|---|---|
/api/v1/top-businesses | GET | period_label, period_type?, limit=10 | YYYY-MM-01 | Top businesses by revenue |
/api/v1/top-agents | GET | period_label, period_type?, limit=10 | YYYY-MM-01 | Top agents by commission |
- Hardcoded dropdown options (JSX
<option>elements) - Converts
YYYY-MMformat toYYYY-MM-01for API calls - Supports
period_typetoggle (MTD/YTD/QTD)
- Both endpoints return HTTP 200 with correct shape
- Tables update when period changes
- Nov 2025 selectable in dropdown
- Header always shows “Welcome back, Team”
Common Patterns
Period Format Conversion
- Frontend:
YYYY-MM(e.g.,2025-11) - API:
YYYY-MM-01(e.g.,2025-11-01) - Conversion:
${selectedPeriod}-01in API calls
Period Type Support
- MTD (Month-to-Date): Default, no
period_typeparam - YTD (Year-to-Date):
period_type=ytd - QTD (Quarter-to-Date):
period_type=qtd
Success Response Shape
- Valid Empty: HTTP 200 + correct shape (arrays/summary keys present, even if empty)
- Invalid: 4xx/5xx status codes or shape mismatch
Error Handling
- Loading states show placeholders
- Error states show error messages
- Headers never show email (contract enforced)
Validation Checklist
Pre-Pipeline (Part 2B)
- All endpoints return HTTP 200 for
period_label=2025-11-01 - Response shapes match expected structure
- Empty states are valid (correct shape, empty arrays)
Post-Pipeline (Part 5)
- All endpoints return non-empty data for
period_label=2025-11-01 - Counts/arrays populated correctly
- Sample JSON responses saved for evidence
UI Validation (Part 6)
- CEO dashboard shows Nov 2025 data
- Agent Overview shows Nov 2025 data
- Agent Detailed includes Nov 2025 in trends
- Agent Insights shows Nov 2025 data
- All period selectors include Nov 2025 option