Skip to content

csvInvoiceSchema: Return structured validation errors with row, column, and message #700

Description

@Kingsman-99

Description

csvInvoiceSchema validates imported CSV rows but returns only a generic error string. Contributors should replace generic errors with structured error objects that include row, column, value, and message fields, so import UIs can highlight exactly which cells contain invalid data.

Acceptance Criteria

  • Validation errors are returned as Array<{row: number, column: string, value: string, message: string}>
  • Each error message is human-readable and actionable (e.g. "Amount must be a positive number")
  • The validator continues to short-circuit after 20 errors to avoid flooding the UI on malformed files
  • Existing tests continue to pass

Context

  • Target file: src/lib/csvInvoiceSchema.ts
  • Used by: src/components/CsvRecipientImport.tsx

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions