Dashboard Endpoints → BigQuery Data Sources
Summary (3–6 bullets)
- Maps key dashboard endpoints to their underlying BigQuery tables/views.
- Clarifies that dashboards read downstream processed/analytics objects, not intake raw bridge tables.
- Highlights source boundaries for CEO metrics, top entities, growth/loss, and commissions.
- Provides a quick drift-risk perspective for dashboard data dependencies.
When to use this (3–6 bullets)
- When debugging dashboard metric mismatches or stale values.
- Before changing query functions or underlying BigQuery views/tables.
- During onboarding to understand endpoint-to-data lineage quickly.
- When validating whether intake pipeline changes can affect dashboards directly.
What you’ll walk away with (2–5 bullets)
- A concise source map for major dashboard APIs.
- Confidence on where dashboard data is and is not sourced from.
- A fast reference for impact analysis before backend/data changes.
1. CEO Metrics (/api/v1/ceo-metrics)
Function: get_ceo_metrics() / get_ceo_metrics_range() / get_ceo_snapshot_from_view()
Source Tables/Views:
payroll-bi-gauntlet.payroll_analytics.ceo_snapshot(view) - Financial metrics (gross_payout, chargebacks, net_payout)payroll-bi-gauntlet.payroll_raw.stage1_snapshots(table) - Distinct counts (total_businesses_ytd, total_employees_ytd)payroll-bi-gauntlet.payroll_processed.stage3_snapshots(table) - Agent commissions for owner commission calculation
stage1_snapshots (downstream view) and ceo_snapshot (analytics view)
Uses transaction_events_raw? No - reads from processed/analytics views
2. Agent History (/api/v1/agent-history/{agent_id})
Function: get_agent_history()
Source Tables/Views:
payroll-bi-gauntlet.payroll_processed.stage3_snapshots(table)
stage3_snapshots (downstream processed table)
Uses transaction_events_raw? No - reads from processed table
3. Agent Focus Accounts (/api/v1/agent/focus-accounts)
Function: get_focus_accounts()
Source Tables/Views:
payroll-bi-gauntlet.payroll_analytics.agent_churn_metrics_v(view) - Lost businessespayroll-bi-gauntlet.payroll_analytics.agent_report_v5(view) - Impact metrics (lost commission, lost employees)
agent_churn_metrics_v, agent_report_v5)
Uses transaction_events_raw? No - reads from analytics views
4. Commissions (/api/v1/commissions)
Function: get_commissions()
Source Tables/Views:
payroll-bi-gauntlet.payroll_processed.stage3_snapshots(table)
stage3_snapshots (downstream processed table)
Uses transaction_events_raw? No - reads from processed table
Summary
Dashboard endpoints do NOT directly read from:transaction_events_raw(intake pipeline raw table)stage1_bridge_rows(intake pipeline bridge table)
stage3_snapshots(processed table - downstream from stage1)ceo_snapshot(analytics view - aggregated from processed data)agent_report_v5(analytics view - aggregated from processed data)agent_churn_metrics_v(analytics view - aggregated from processed data)stage1_snapshots(raw table - but only for distinct counts in CEO metrics)
transaction_events_raw → stage1_bridge_rows) feeds into downstream processing that populates these views.