Skip to content

Implement GET /api/v1/requests with filters and pagination #6

Description

@iexwr

Context

src/index.ts only has /requests/:id and /accounts/:address/received. There is no list endpoint, so the dashboard cannot show a user's requests.

Acceptance criteria

  • GET /api/v1/requests supports query params: payee, payer (optional), status, asset, limit (default 20, max 100), cursor.
  • Returns { data: PaymentRequest[], meta: { total, limit, cursor } }.
  • cursor is the id of the last item; subsequent calls pass it to continue.

Technical notes

  • Build a Prisma where from present filters; order by id desc.
  • Use skip/take for pagination keyed on cursor.
  • See src/types.ts for the PaymentRequest shape.

Testing

  • Add a vitest route test covering filter + pagination.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveStellar Wave for StackPayenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions