Skip to content

feat: add CSV export + invoice save validation (closes #53, #48)#57

Open
PragyaTripathi990 wants to merge 2 commits into
seetadev:mainfrom
PragyaTripathi990:feat/csv-export-action-sheet
Open

feat: add CSV export + invoice save validation (closes #53, #48)#57
PragyaTripathi990 wants to merge 2 commits into
seetadev:mainfrom
PragyaTripathi990:feat/csv-export-action-sheet

Conversation

@PragyaTripathi990
Copy link
Copy Markdown

Summary

  • Adds Export as CSV option to the invoice action sheet (Menu.tsx). On Android/iOS it attaches the CSV via capacitor-email-composer; on web it triggers a direct Blob download.
  • Introduces a new InvoiceValidator service (src/services/InvoiceValidator.ts) that guards both Save and Save As against empty filenames, placeholder names (default, Untitled), and invoices with no actual SocialCalc cell data.
  • Toast feedback duration extended (500ms → 2500ms) so users can actually read validation messages.
  • Save As dialog only re-opens after toast dismissal for filename-specific errors, not content errors.

Related Issues

Closes #53
Closes #48

Test plan

  • Open action sheet → "Export as CSV" appears
  • On web: clicking Export as CSV downloads a .csv file named after the current invoice
  • On hybrid (Android/iOS): clicking Export as CSV opens email composer with CSV attached
  • Save with empty spreadsheet → toast shows "Invoice appears empty..."
  • Save As with filename default → toast shows "Please save with a meaningful filename..."
  • Save As with a valid filename on a filled invoice → saves successfully

🤖 Generated with Claude Code

PragyaTripathi990 and others added 2 commits May 10, 2026 17:06
Adds 'Export as CSV' option to the invoice action sheet. On hybrid (Android/iOS),
attaches the CSV via EmailComposer. On web, triggers a direct Blob download.
Uses the existing getCSVContent() from the SocialCalc index.

Closes seetadev#53

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a validateInvoice() helper that blocks saving empty invoices or invoices
with no SocialCalc cell data. Both doSave() and doSaveAs() in Menu.tsx now
call this validator and show a descriptive toast on failure. The Save As dialog
only reopens for filename-specific errors, not content errors.

Part of seetadev#48

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jineshkumar134
Copy link
Copy Markdown

@PragyaTripathi990 , Please see that I have already opened the PR that solves this issue.
So, you dont require to open another pr for the same issue(#53)....

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.

Feature: Add CSV Export functionality for Invoices Add invoice validation before save to prevent empty/incomplete invoices

2 participants