Skip to content

feat: add cursor pagination to list_programs and list_payouts (Closes #19) - #63

Open
ZacLou wants to merge 1 commit into
StellarRoute:mainfrom
ZacLou:feat/issue-19-cursor-pagination
Open

feat: add cursor pagination to list_programs and list_payouts (Closes #19)#63
ZacLou wants to merge 1 commit into
StellarRoute:mainfrom
ZacLou:feat/issue-19-cursor-pagination

Conversation

@ZacLou

@ZacLou ZacLou commented Aug 27, 2026

Copy link
Copy Markdown

Closes #19

Changes

Adds cursor-based pagination to list_programs and list_payouts endpoints:

  • Query parameters: ?cursor=<ISO 8601 timestamp>&limit=<n> (default limit: 20, max: 100)
  • Response format: { "items": [...], "next_cursor": "<timestamp>", "has_more": bool }
  • Pagination logic: Keyset pagination on created_at, ordered DESC
    • When cursor is provided, filters WHERE created_at < cursor
    • next_cursor is the created_at of the last item in the page
    • has_more: true when a full page was returned (meaning more items exist)

Types added

  • PaginationParams — query deserialization struct
  • ListResponse<T> — generic paginated response wrapper

Endpoints updated

  • GET /api/v1/programs?limit=20&cursor=2026-01-01T00:00:00Z
  • GET /api/v1/programs/:id/payouts?limit=20&cursor=...

Backward compatible: omitting query params returns first page of 20 items (same as before).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[api] Add cursor pagination to list_programs and list_payouts

1 participant