Skip to content

Add invoice validation before save to prevent empty/incomplete invoices #48

@Prachi01Yadav

Description

@Prachi01Yadav

Problem

Currently there is zero validation before an invoice is saved -
locally or to Firebase. A user can save a completely empty invoice
with no name, no vendor, no amount. This causes silent data quality
issues and corrupted invoice records.

Proposed Fix

Add a client-side validation service that runs before any save
operation and checks:

  • Invoice has a meaningful name (not empty or "default")
  • Invoice content is not empty
  • Warns if key fields appear unfilled

Files to change

  • New file: src/services/InvoiceValidator.ts
  • Edit: src/components/Menu/Menu.tsx (call validator before save)

Related

Part of the Co-Pilot validation work in Issue #37

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions