Skip to content

feat(frontend): add invoice dashboard with status filtering and reminders (Closes #602) - #941

Open
waterWang wants to merge 1 commit into
FinChippay:mainfrom
waterWang:feat/invoice-dashboard
Open

feat(frontend): add invoice dashboard with status filtering and reminders (Closes #602)#941
waterWang wants to merge 1 commit into
FinChippay:mainfrom
waterWang:feat/invoice-dashboard

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Summary

Builds the invoice dashboard (issue #602) on top of the existing invoice components
(InvoiceCard / InvoiceDetail / InvoiceModal), which previously had no list page, no
persistence, and no reminders:

  • lib/invoices.ts — full localStorage-backed invoice store (same pattern as lib/paymentLinks.ts):
    • loadInvoices() / saveInvoices() with SSR guard + corrupt-data fallback
    • createInvoice() — generates id, sequential INV-00001 numbering, default draft status
    • updateInvoiceStatus() / deleteInvoice() — persisted mutations
    • sendInvoiceReminder()mailto: hand-off (works with any mail client, no server infra) + records lastReminderAt
    • summarizeInvoices() — per-status + grand totals, with an "outstanding" (sent + overdue) figure
    • generateInvoicePDF() — jsPDF invoice PDF (same stack as existing receipts)
  • pages/invoices.tsx — the /invoices dashboard (previously a "coming soon" placeholder):
    • Status filter tabs (All / Draft / Sent / Paid / Overdue) with per-status counts
    • Summary cards for Outstanding / Paid / Total
    • "New Invoice" → InvoiceModal; "View Details" → InvoiceDetail overlay
    • Deep-link support via ?invoice=<id> (shareable detail URLs)
    • Reminder action per invoice via mailto: + toast confirmation
  • components/Navbar.tsx — adds the Invoices nav link
  • i18ninvoices.* keys + nav.invoices added to all 7 locale files (en/es/fr/pt/ja/ar/he)
  • Tests — 11 unit tests for the store (invoices-lib.test.ts) + 7 component tests for the page
    (InvoicesPage.test.tsx): empty state, list + summary, status filtering, deep-link detail,
    open-detail-on-click, reminder flow, filtered empty state
  • StorybookInvoicesPage.stories.tsx (default populated list, empty state)

Verification

  • NODE_ENV=test npx jest __tests__/invoices-lib.test.ts __tests__/InvoicesPage.test.tsx18/18 pass
  • tsc --noEmit — only pre-existing lib/sdk-instance.ts errors (TS1127/TS1160, introduced by
    PR#918 on main, unrelated to this change)

Closes #602

Signed-off-by: waterWang water.wang@users.noreply.github.com

…ders

Closes FinChippay#602

Signed-off-by: waterWang <water.wang@users.noreply.github.com>
@Topmatrixmor2014

Copy link
Copy Markdown
Contributor

PLEASE FIX CONFLICTS

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.

Issue #42 — Invoice Dashboard & Reminders

2 participants