Trader payouts
modules/dashboard/pages/{traderPayout, traderPayoutAll, traderPayoutDayOne, traderPayoutPending, payoutOperations} — real-money reconciliation, the highest-stakes workflow in the app.
Trader Payouts — shared engine — Live
Powers: /dashboard/trader-payout/all, /active-payouts, /pending
One headless engine (useTraderPayout) + component kit rendering the 13-stage review pipeline: new_request → trading_review → security_review → pre_approved/pre_denied → ready_to_process → awaiting_rise_kyc/rise_kyc_failed → sent_to_rise → processing_batch → processed/denied, plus a cross-stage failed_checks pseudo-tab. 3s polling while any row's check state is pending/running.
Sub-modules (17 files)
- PayoutStatsCards — 10 clickable KPI cards that double as stage-tab navigation
- PayoutFilters / PayoutFilterChips / PayoutFilterModal — Search, payout-window dropdown + custom range, advanced filter modal (plan/account type/funded/account status/payout status), removable chips
- PayoutBreachTabs — Breach-reason sub-tabs, shown only on Pre-Denied/Denied stages
- PayoutTable — Sortable grid: bulk checkboxes, side-effect status icons, running/failed check-state badges, row click → detail panel, eye icon → quick actions
- PayoutDetailPanel — 6 sub-tabs: Overview, Account, Rules, Risk Analysis, History, Notes; stage-advance button; Deny dialog w/ email preview
- PayoutBulkActionBar — Deny Selected, Re-invite to Rise, Retry Deductions/All/Email/Certificate/Payment, Advance (stage-specific)
- PayoutQuickActions — Drill-down drawer: Achievement, Security Flags, Hedging/Exposure/Copy-Trading detail, Microscalping report, EOD reports
- PayoutRuleDetailModal / PayoutRiskReportModal — Deep rule-specific detail; full risk report grouped by section
- PayoutSummaryCard / PayoutFlowDiagram / PayoutWindowCountdown — Read-only summary, pipeline visualization, live countdown to 2 PM PST cutoff
Actions available (20)
| Action | Effect | Hook | Stage(s) |
|---|---|---|---|
| Stat card / stage tab click | Filters listing by review_stage (or checks_state=failed) | usePayoutStageCounts, TraderPayoutHistory | all |
| Search, payout-window, filters, sort | Standard list filtering | TraderPayoutHistory | all |
| Row select / bulk select | Shows PayoutBulkActionBar | — | all |
| Export CSV | Downloads current lane/view | GET payout_listing?export=csv | Active Payouts only |
| Advance — Move to Review / Run Security Check | Dispatches worker task, flips check state to pending/running | useRunTradingReviewMutation/useRunSecurityCheckMutation | new_request, trading_review |
| Advance — Approve/Move stage | Simple stage transition (server auto-branches Rise sub-lane) | useTransitionPayoutMutation | security_review→ready_to_process, pre_approved→ready_to_process, etc. |
| Deny Payout | Dialog: reason, note, extra IP sessions, email mode, evidence upload, live preview → Confirm | useTransitionPayoutMutation("denied"), useUploadDenialEvidence | any non-terminal |
| Rules tab: Refresh / click a rule | Re-runs evaluator / opens rule detail | useReEvaluatePayoutMutation | any |
| Risk Analysis: View Full Risk Report | All checks by section | usePayoutRiskSummary | any |
| Notes: Save | Persists reviewer note | useUpdatePayoutNotesMutation | any |
| Quick Actions drawer | Achievement/Security/Hedging/Exposure/Copy-Trading/Microscalping/EOD drill-down | multiple query hooks | any |
| Bulk: Deny Selected | Per-payout compose drawer → fan-out (allSettled) | useTransitionPayoutMutation ×N | non-denied/processed |
| Bulk: Advance | Fans out review-task calls or bulk-transitions depending on stage | useRunTradingReviewMutation/useBulkTransitionPayoutsMutation | matches per-row map |
| Bulk: Re-invite to Rise | Re-sends Rise KYC invite | useBulkRiseReinviteMutation | rise_kyc_failed |
| Bulk: Retry Deductions/All/Email/Certificate/Payment | Retries specific side effect(s) | useBulkRetryDeductionMutation, useRetrySideEffectsMutation | failed_checks |
| Bulk approve drawer: Confirm Approve | Previews approval email + open flags, then bulk-transitions | useBulkTransitionPayoutsMutation | pre_approved → ready_to_process |
All Payouts — Live
Route: /dashboard/trader-payout/all
Shared engine with showAllStages: true — unscoped by default (every review_stage); no window scoping, breach tabs, Export, or quick-actions drawer.
Active Payouts — Live
Route: /dashboard/trader-payout/active-payouts
Scoped to the currently-accumulating window (currentWindow: true, default stage new_request) — the only trader-payout page with Export, breach sub-tabs, and the PayoutQuickActions drawer.
| Control | Effect |
|---|---|
| Export → pick lane / current view | CSV download scoped to window + filters |
| Breach tabs | Filters within the window by breach_reason (Pre-Denied/Denied only) |
| Eye icon → Quick Actions | Opens drawer at root |
| Rules tab → click rule → drawer | Opens the same drawer pre-drilled into that rule |
Pending — Live
Route: /dashboard/trader-payout/pending
Flat cross-lane list of every payout with legacy payout_status=pending, regardless of review_stage. No Export, breach tabs, or quick-actions drawer; payoutStatus filter always wins over the modal's own Payout Status selector.
Payout Operations — Live, read/verify-only
Route: /dashboard/payout-operations
Separate, simplified operator view collapsed into 3 statuses (awaiting_onboarding/ready_for_payment/paid), scoped to rolling 24h windows (2 PM PT cutoff) or a custom range, with a live read-only "Verify with Rise" check. No transition/deny/re-invite/retry mutations exist on this page — it's reconciliation tooling, not a review workflow. If the backend feature is off, shows a disabled-state message instead of the table.
Sub-modules
- WindowHeader — Window selector: OPEN/CLOSED badge, live cutoff countdown, prev/next arrows, rolling dropdown, custom-range toggle
- WindowSummaryCards — 7 read-only KPIs: Total Requests/Requested, Paid, Remaining, Awaiting Onboarding
- OperatorSearchFilters — Exact-username match, free text, status, safeguard-flag multi-select, amount min/max
- OperatorPayoutTable / SafeguardFlags / StatusHistory — Sticky-column grid; per-flag warning badges; expandable status-change timeline
- VerifyRiseButton — Read-only live check against Rise for the whole window
Actions available (14)
| Action | Effect | Hook |
|---|---|---|
| Window mode toggle / prev-next / rolling dropdown / custom range | Steps or jumps the reconciliation window | usePayoutOperationsWindow |
| Exact-username / free-text search | Filters (exact match avoids paying the wrong trader) | TraderPayoutHistory |
| Status / safeguard-flag / amount filters | Standard filtering; flag filter matches live-corrected flags once verified | TraderPayoutHistory |
| Row checkbox / select all visible | Drives Selection Totals bar (count, $, paid/unpaid split) | local state |
| Copy-username | Clipboard copy, no network call | — |
| History icon | Expands full transition log for a row | usePayoutActivityLog |
| Verify window with Rise | Read-only live check against Rise for every relevant payout in the window; toasts confirmed/unconfirmed/no-record counts; overlays per-row verdicts (recomputed safeguard flags incl. paid_without_confirmation, amount_mismatch, wrong_payout_window, payee_mismatch) client-side, persisted to localStorage (last 10 windows). Nothing is written server-side — no cache invalidation. Disabled for multi-day custom ranges. | useVerifyRiseStatusMutation |