Skip to content

feat(ledger): add paginated account listing endpoint - #110

Merged
tiana-code merged 1 commit into
mainfrom
feat/E-01-account-listing
Jun 14, 2026
Merged

feat(ledger): add paginated account listing endpoint#110
tiana-code merged 1 commit into
mainfrom
feat/E-01-account-listing

Conversation

@tiana-code

Copy link
Copy Markdown
Owner

What

GET /v1/accounts paginated, unblocking the Sandbox UI Account Browser (Screen 1) on the real API.

  • PageResponse<AccountResponse> = items + page/size/totalElements/totalPages.
  • Offset pagination via Spring Pageable; ordered created_at desc then id desc (stable).
  • Query params page (>=0, default 0) and size (1..100, default 20); out-of-range -> 400.
  • AccountService.list returns a domain AccountPage (no Spring Page past the impl); thin JWT-secured controller; reuses the existing AccountResponse + hand mapper.

Tests

  • @WebMvcTest: list happy path (acc_ ids + page metadata), size>100 -> 400 (service not called), page<0 -> 400, unauthenticated -> 401.
  • AccountListingIT (CI-only, Testcontainers): inserts 3 accounts with increasing created_at, asserts they come back newest-first across the page.

Out of scope (follow-ups): filters (status/type/currency), cursor pagination, transaction listing.

Closes #109

GET /v1/accounts returns a PageResponse<AccountResponse> ordered created_at
desc then id desc. Offset pagination via Spring Pageable, size capped at 100,
JWT-secured, thin controller delegating to AccountService.list which returns a
domain AccountPage. Unblocks the sandbox account browser on the real API.

Closes #109
@tiana-code
tiana-code merged commit fd2977a into main Jun 14, 2026
6 checks passed
@tiana-code
tiana-code deleted the feat/E-01-account-listing branch June 14, 2026 01:43
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.

Add paginated account listing endpoint (GET /v1/accounts)

1 participant