Skip to content

Add searchByMemo full-text search to search.ts #614

Description

@Kingsman-99

Description

src/search.ts searches invoices by fields like status and recipient but has no memo-content search. Payment memo text is a common way users tag invoices (e.g. "split:INV-001") and cannot currently be searched across a local invoice array.

Acceptance Criteria

  • searchByMemo(invoices: Invoice[], query: string, opts?: { caseSensitive?: boolean }): Invoice[] exported from src/search.ts
  • Returns invoices where invoice.memo contains query as a substring; case-insensitive by default
  • Empty query returns all invoices unchanged
  • Invoices with memo of undefined or null are skipped without error
  • opts.caseSensitive = true enables exact-case matching
  • Exported from src/index.ts
  • Unit tests: substring match, case-insensitive default, case-sensitive override, empty query returns all, null memo skipped

Context

  • Target files: src/search.ts, src/index.ts
  • Invoice.memo is a string field in src/types.ts — may be optional

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions