wip: dashboard wiring (real backend) + Docker compose for production

This commit is contained in:
Nora
2026-06-22 14:07:31 -06:00
parent 4a382c0b16
commit 0677e4fd65
18 changed files with 1879 additions and 155 deletions
+49
View File
@@ -105,6 +105,55 @@ export interface Activity {
amount?: number;
}
// ---------------------------------------------------------------------------
// Dashboard summary surface (SP10)
//
// Aggregated view of the whole clearinghouse, returned by
// `GET /api/dashboard/summary`. The shape is server-stable; the same
// shape is synthesized by `useDashboardSummary` when no backend is
// configured (see `sampleClaims` / `sampleProviders`).
// ---------------------------------------------------------------------------
export interface DashboardKpis {
claimCount: number;
billedTotal: number;
receivedTotal: number;
outstandingAr: number;
deniedCount: number;
pendingCount: number;
/** Percentage 0100. */
denialRate: number;
}
export interface MonthlyBucket {
/** YYYY-MM (UTC). */
month: string;
/** English short label, e.g. "Jan". */
label: string;
count: number;
billed: number;
received: number;
denied: number;
/** Cumulative billed cumulative received, clamped at 0. */
ar: number;
/** Percentage 0100; 0 when count is 0. */
denialRate: number;
}
export interface DashboardSummary {
kpis: DashboardKpis;
/** Oldest → newest, sized to the requested `months` window. */
monthly: MonthlyBucket[];
/** Top N by claim count (descending). */
topProviders: Provider[];
/** Latest N denied claims, newest first. */
recentDenials: Claim[];
/** Distinct provider count across the whole store — independent of topProviders cap. */
providerCount: number;
/** UTC ISO timestamp the aggregation was computed at. */
asOf: string;
}
// ---------------------------------------------------------------------------
// Backend-aligned types (snake_case to match FastAPI JSON output 1:1).
// These mirror the Pydantic models in