Skip to content

feat(payee): add CSV export for payee lock history (closes #76) - #89

Open
phatloi0010 wants to merge 1 commit into
Kinlock-Org:mainfrom
phatloi0010:feat/payee-csv-export-76
Open

phatloi0010 wants to merge 1 commit into
Kinlock-Org:mainfrom
phatloi0010:feat/payee-csv-export-76

Conversation

@phatloi0010

Copy link
Copy Markdown

Summary

Fulfills roadmap row X-05 (PAY-6) by implementing a client-side CSV export button on the /payee dashboard, enabling schools and landlords to export their received locks and release history for internal accounting and reconciliation.

Closes #76

Changes

  1. lib/csv.ts:
    • Added formatLocksToCSV helper formatting locks to RFC-4180 compliant CSV.
    • Enforces the exact 7-column schema: lock_id,sender_address,total_usdc,released_usdc,unlock_date,status,created_at.
    • Formats amounts using SDK fromBaseUnits from BigInt base units.
    • Formats dates in ISO 8601 UTC.
    • Added escapeCSVCell for commas, double quotes, and newlines.
    • Added downloadCSV using client-side Blob URL.
  2. components/payee/ExportCSVButton.tsx:
    • Client component rendering the export button with externalized i18n label.
    • Disabled when no locks are loaded or present.
  3. app/payee/PayeeView.tsx:
    • Integrated ExportCSVButton in /payee dashboard action bar, passing filtered locks list.
  4. messages/en.json:
    • Added externalized exportCsv message key.
  5. ROADMAP.md:
    • Updated X-05 status from TODO to DONE.
    • Updated Last updated header and added Changelog entry for feat/payee-csv-export-76.
  6. Tests:
    • lib/csv.test.ts: 20 unit tests covering CSV formatting, headers, numeric conversions, escaping, dates, and empty state.
    • components/payee/ExportCSVButton.test.ts: 4 unit tests verifying rendering, click actions, and disabled states.

Verification

  • pnpm lint: PASS (Biome clean, 96 files)
  • pnpm typecheck: PASS (tsc clean, 0 errors)
  • pnpm test: PASS (18 test files / 214 tests passing)
  • pnpm build: PASS (Turbopack production build successful)

@phatloi0010
phatloi0010 requested a review from a team as a code owner November 2, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(app): CSV export for payee lock history in /payee dashboard

1 participant