Skip to content

feat: add filtered invoice CSV export - #446

Open
Eyanus wants to merge 4 commits into
ZyntariHQ:mainfrom
Eyanus:feat/invoice-csv-export
Open

feat: add filtered invoice CSV export#446
Eyanus wants to merge 4 commits into
ZyntariHQ:mainfrom
Eyanus:feat/invoice-csv-export

Conversation

@Eyanus

@Eyanus Eyanus commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Adds CSV export for the current filtered invoice working set.

Merchants can now export the invoices currently represented by their selected filters for spreadsheet use, finance review, and downstream reporting.

closes #361

Type of Change

  • Feature
  • Fix
  • Refactor
  • Documentation
  • Chore

Description

This PR adds end-to-end CSV export support to the invoice list.

Backend

  • Added GET /invoices/export.
  • Reuses the invoice list filtering state for:
    • Status
    • Asset
    • Due date
    • Search query
  • Preserves merchant scoping through the existing merchant-scope mechanism.
  • Exports the following invoice fields:
    • Invoice Number
    • Customer
    • Amount
    • Asset
    • Status
    • Due Date
  • Limits exports to 10,000 invoices to prevent excessively large exports.
  • Escapes CSV values correctly, including embedded quotes and special characters.
  • Protects exported values against spreadsheet formula injection.
  • Returns appropriate CSV response headers and exported-row metadata.

Frontend

  • Added an Export CSV action to the invoice list.
  • The export request uses the currently selected invoice filters.
  • Downloads the generated CSV using a date-based filename.
  • Displays an export-in-progress state.
  • Displays an error message when the export fails.

Tests

  • Added coverage for successful CSV export.
  • Added coverage for unsupported due-date filters.
  • Added coverage for the export row limit.
  • Existing merchant-isolation and invoice-service tests continue to pass.

Testing Evidence

Backend

Command:

npm test

Result:

  • 23/23 test suites passed
  • 167/167 tests passed

The invoice service test suite also passes independently.

Frontend

Commands:

npm run lint

Result:

  • Passed

npm run build

Result:

  • Production build completed successfully.
  • All application routes generated successfully.

Screenshots

Not included. The UI change is limited to the invoice-list Export CSV action and its loading/error states.

Checklist

  • Code builds successfully
  • Tests added/updated where applicable
  • Documentation updated if needed
  • Linked issue referenced
  • Ready for review

@Cedarich

Copy link
Copy Markdown
Contributor

Kindly resolve conflicts

@Cedarich

Copy link
Copy Markdown
Contributor

@Eyanus

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.

Add CSV export for filtered invoice lists in the web dashboard

2 participants