StabilityNexus / StabilityNexus/Chainvoice

[FEATURE]: Bulk Export Multiple Invoices (CSV / JSON / PDF) with Single File & Separate Files Option

Open
#162 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

good first issue
Dominant language
JavaScript
Stars
10
Forks
47
Avg merge
17h 47m
Merged PRs (30d)
4

Description

Problem

Currently, Chainvoice supports exporting a single invoice at a time (CSV/JSON/PDF from the invoice detail drawer), implemented in #136 and shipped in PR #138. There is no way to bulk export multiple invoices at once from the main invoices list page.

Businesses using Chainvoice need bulk export capabilities for:

  • Exporting monthly/quarterly invoice batches for accounting software (QuickBooks, Xero, Wave)
  • Tax filing and audits requiring all invoices in a period
  • Data reconciliation across multiple transactions
  • Bookkeeping automation pipelines

Exporting invoices one by one when dealing with dozens or hundreds of records is impractical and defeats the purpose of a decentralized, automated invoicing platform.

Discord thread: https://discord.com/channels/995968619034984528/1328282666335993856/1480964370069717063

The first PR (#138) has since been merged, and this issue is the agreed follow-up for part 2.

Proposed Solution

Add bulk export support on the Sent Invoices and Received Invoices list pages, allowing users to select multiple invoices and export them in CSV, JSON, or PDF format.

Export Formats
Format Description
CSV All selected invoices in a single .csv file, one row per invoice
JSON Array of invoice objects exported as a single .json file
PDF Selected invoices as a multi-page .pdf (one invoice per page)
User Choice: Single File vs. Separate Files

Users should be able to decide how their invoices are packaged on export:

Option A — All in One File (default)
  • CSV: single file, one row per invoice
  • JSON: single file, array of all selected invoice objects
  • PDF: single multi-page PDF, one invoice per page
Option B — Separate Files per Invoice
  • Each selected invoice is exported as its own individual file
  • Files are bundled and downloaded as a .zip archive
  • Naming convention: invoice-<id>-<date>.csv / .json / .pdf

A simple toggle or radio group in the export modal (e.g. "Export as: Single file / Separate files (ZIP)") can handle this UX cleanly.

Implementation Approach
  • Add checkboxes to each invoice row on the list page for selection
  • Add a toolbar that appears when invoices are selected, with an Export Selected button (matching the pattern already introduced in PR #138)
  • Extend existing utilities from PR #138:
    • frontend/src/utils/generateInvoiceCSV.js — accept array of invoices
    • frontend/src/utils/generateInvoiceJSON.js — accept array of invoices
    • frontend/src/utils/generateInvoicePDF.js — batch multi-page PDF generation
    • frontend/src/utils/invoiceExportHelpers.js — add ZIP bundling helper for separate-file option
  • Use Blob + URL.createObjectURL() for client-side downloads (no backend needed)
  • Use a lightweight ZIP library (e.g. jszip) for the separate-files option
  • Only already-decrypted (visible) invoice data is exported — no additional Lit Protocol calls needed
  • Show success/error toasts consistent with the export UX introduced in PR #138

Why This Matters

  • Natural follow-up to single invoice export (#136 / PR #138) — completes the full export experience
  • No smart contract changes required — purely frontend
  • Essential for businesses handling multiple invoices per period
  • Low risk, high user value

Additional Context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading frontend/src/utils/generateInvoiceCSV.js, generateInvoiceJSON.js, generateInvoicePDF.js, invoiceExportHelpers.js, and the invoice list pages frontend/src/page/SentInvoice.jsx and frontend/src/page/ReceivedInvoice.jsx. Trace the existing single-invoice export flow from PR #138, then define selection and packaging behavior for CSV, JSON, PDF, and separate-file ZIP exports; done means both list pages support the requested formats and packaging options with consistent success/error toasts.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.