Skip to content

Recipient Payout History Cross-Invoice Totals #409

Description

@Kingsman-99

Description

When auditing disbursements, finance teams need to see how much a specific recipient has received across all invoices over any date range, but currently data is siloed per invoice page. This issue adds a recipient payout history view that aggregates all confirmed payouts to a given Stellar address across every invoice on the platform, displays a sortable/filterable table with per-invoice breakdowns, and surfaces cross-invoice lifetime totals per asset.

Technical Context

Create app/dashboard/recipient/[address]/page.tsx as a server component that calls app/api/recipients/[address]/history/route.ts. The API route queries the invoice database for all recipient entries matching the address (owned by or shared with the requesting user), joins with confirmed payment records, and returns an array of RecipientPayoutRecord. Build components/dashboard/RecipientHistoryTable.tsx with @tanstack/react-table v8 for column sorting, per-column filtering, and pagination. Lifetime total cards per asset (XLM, USDC, custom) sit above the table and update reactively when filters change. The address should resolve to a federation name if available (reuse hooks/useAddressLabel.ts from issue 9). Export the filtered table data as CSV using the papaparse library.

Acceptance Criteria

  • The recipient history page loads all confirmed payouts for the given address and displays them in the table sorted by date descending by default
  • Sorting and filtering columns update the displayed rows without additional network requests (client-side)
  • Lifetime total cards reflect only the rows currently shown after filtering is applied
  • CSV export downloads a file containing all currently-filtered rows with headers matching the visible columns
  • Navigating to the page for an address with no payout history shows an empty state with a contextual message rather than a blank page
  • All CI checks (npm test, npm run build, ESLint/TypeScript) pass and the branch has no merge conflicts

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions