Skip to content

Commit 0f03835

Browse files
bsiaotickchongclaude
authored andcommitted
Add Payouts Overview tab with status tables and trend charts (#25589)
## Summary - Adds a new **Overview** tab as the first tab on the Payouts page, showing a dashboard of payout metrics for the last 7 days - **Status tables**: two side-by-side cards showing payout counts by status (Completed, Processing, Pending, Rejected, Failed) split by platform vs customer payouts - **Stat + chart cards**: three cards combining headline numbers with Origin `LineChart` trend graphs — total payouts sent, total volume (grouped by sending currency), and completion rate - **Backend**: new `grid_payout_overview_stats` GraphQL query with SQLAlchemy aggregation, 10-second memcache TTL - **Refactored** `sla_metrics_cache` into a generic `grid_dashboard_cache` with configurable namespace and TTL, so both SLA metrics and payout overview share the same caching infrastructure ## Test plan - [ ] Navigate to `/grid/payouts` and verify it redirects to the Overview tab - [ ] Verify status tables show correct counts for platform and customer payouts - [ ] Create new payouts and verify they appear in status tables within ~10 seconds - [ ] Verify line charts show 7-day trends including today's data - [ ] Verify volume card shows per-currency breakdown when multiple currencies are used - [ ] Verify loading spinner shows while data is fetching - [ ] Verify completion rate shows 100% on days with no payouts - [ ] Run backend tests: `env -u QUART_CONFIG uv run pytest sparkcore/graphql/objects/grid_dashboard/tests/test_grid_payout_overview_stats.py -v` <img width="1366" height="753" alt="Screenshot 2026-03-31 at 2 23 05 PM" src="https://github.com/user-attachments/assets/783120df-3576-4d88-91fd-5f5987a6263d" /> 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> GitOrigin-RevId: 72a966c68f12e3c24ed270626abc9b4b1bc80bcc
1 parent ef40213 commit 0f03835

7 files changed

Lines changed: 18 additions & 16 deletions

File tree

packages/origin/src/components/Analytics/AnalyticsContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface InteractionInfo {
1818
name: string;
1919
component: string;
2020
interaction: InteractionType;
21-
metadata?: Record<string, unknown>;
21+
metadata?: Record<string, unknown> | undefined;
2222
}
2323

2424
export interface AnalyticsHandler {

packages/origin/src/components/Chart/ChartWrapper.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ import { Skeleton } from "../Skeleton";
77
import styles from "./Chart.module.scss";
88

99
export interface ChartWrapperProps {
10-
ref?: React.Ref<HTMLDivElement>;
11-
loading?: boolean;
12-
empty?: React.ReactNode;
10+
ref?: React.Ref<HTMLDivElement> | undefined;
11+
loading?: boolean | undefined;
12+
empty?: React.ReactNode | undefined;
1313
dataLength: number;
14-
isEmpty?: boolean;
14+
isEmpty?: boolean | undefined;
1515
height: number;
16-
legend?: boolean;
17-
series?: ResolvedSeries[];
16+
legend?: boolean | undefined;
17+
series?: ResolvedSeries[] | undefined;
1818
children: React.ReactNode;
19-
className?: string;
20-
ariaLiveContent?: string;
19+
className?: string | undefined;
20+
ariaLiveContent?: string | undefined;
2121
}
2222

2323
export function ChartWrapper({

packages/origin/src/components/Chart/hooks.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ export interface ChartInteractionOptions {
3535
tooltipMode: TooltipMode;
3636
interpolatorsRef: React.RefObject<CurveInterpolator[]>;
3737
data: ChartDatum[];
38-
onActiveChange?: (index: number | null, datum: ChartDatum | null) => void;
39-
onActivate?: (index: number, datum: ChartDatum) => void;
38+
onActiveChange?:
39+
| ((index: number | null, datum: ChartDatum | null) => void)
40+
| undefined;
41+
onActivate?: ((index: number, datum: ChartDatum) => void) | undefined;
4042
}
4143

4244
export function useChartInteraction(opts: ChartInteractionOptions) {

packages/origin/src/components/Command/parts.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface CommandGroup {
2626

2727
interface CommandContextValue {
2828
onSelect: (item: CommandItem) => void;
29-
renderItem?: (item: CommandItem) => React.ReactNode;
29+
renderItem?: ((item: CommandItem) => React.ReactNode) | undefined;
3030
}
3131

3232
const CommandContext = React.createContext<CommandContextValue | null>(null);

packages/origin/src/components/DatePicker/parts.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ interface DatePickerContextValue {
243243
setDate: (which: "start" | "end", date: Date) => void;
244244
setTime: (which: "start" | "end", hours: number, minutes: number) => void;
245245
isDateDisabled: (date: Date) => boolean;
246-
min?: Date;
247-
max?: Date;
246+
min?: Date | undefined;
247+
max?: Date | undefined;
248248

249249
locale: string;
250250
weekStartsOn: 0 | 1;

packages/origin/src/lib/base-ui-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export interface ChangeEventDetails<E = Event> {
105105
allowPropagation: () => void;
106106
isCanceled: boolean;
107107
isPropagationAllowed: boolean;
108-
trigger?: HTMLElement;
108+
trigger?: HTMLElement | undefined;
109109
}
110110

111111
export function createChangeEventDetails<E = Event>(

packages/origin/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"target": "ES2017",
99
"isolatedModules": true,
1010
"incremental": true,
11-
"exactOptionalPropertyTypes": false,
11+
"exactOptionalPropertyTypes": true,
1212
"paths": {
1313
"@/*": ["./src/*"],
1414
"@test-utils": ["./test-utils"],

0 commit comments

Comments
 (0)