Skip to content

Implement filter engine for invoice queries — status, date, amount range #851

Description

@Kingsman-99

Overview

Add a rich filter and query engine to the SDK for listing invoices. Callers can filter by status, creator, date range, amount range, and tags — all composed into a single typed query object.

Requirements

  • client.queryInvoices(filter: InvoiceFilter): Promise<Page>
  • InvoiceFilter { creator?, status?: InvoiceStatus[], minAmount?, maxAmount?, fromDate?, toDate?, tags?: string[], limit?, cursor? }
  • Filters applied client-side against getCreatorInvoices + tag index results
  • Page { items, nextCursor?, total } type
  • Sorting: sort?: 'newest' | 'oldest' | 'highest' | 'lowest'
  • Tests: each filter type independently, combined filters, pagination, empty results

Acceptance Criteria

  • queryInvoices method with all filter types
  • Pagination with cursor works
  • Sorting works for all 4 options
  • Empty results handled correctly
  • npm test passes with zero failures
  • TypeScript compiles with zero errors
  • ESLint passes with zero errors

Definition of Done

All CI checks must pass before the PR is reviewed.

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions