wip: dashboard wiring (real backend) + Docker compose for production
This commit is contained in:
@@ -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 0–100. */
|
||||
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 0–100; 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
|
||||
|
||||
Reference in New Issue
Block a user