Skip to content

feat(ledger): add paginated transaction listing endpoint - #118

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

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

Conversation

@tiana-code

Copy link
Copy Markdown
Owner

What

Adds GET /v1/transactions?page=&size= returning a generic PageResponse<TransactionResponse>, the Sandbox Transaction Explorer (Screen 3) feed. Mirrors the merged GET /v1/accounts (PR #110) one-to-one.

How

  • Read-only global listing over ledger.transactions only (no entry join, no money on the wire). @Transactional(readOnly = true).
  • New application read-model TransactionSummary (id/reference/status/postedAt) + TransactionPage; the JPA entity does not cross the application boundary.
  • status added to the shared TransactionResponse and to PostedTransaction, read from the domain Transaction.status (not hardcoded). Additive: the POST response now also carries status: "POSTED", otherwise unchanged.
  • Ordering posted_at desc, id desc (ULID tiebreaker), deterministic across pages.
  • Thin controller: page >= 0, size in 1..100, out-of-range -> 400 via the existing handler; JWT-secured. No schema change.

Tests

  • TransactionControllerTest: list 200 (tx_-prefixed ids + status), empty page, 400 on size=0|101 and page=-1 (service not invoked), 401 unauthenticated, POST returns status: "POSTED".
  • TransactionServiceImplTest: list maps entity -> summary and requests sort postedAt desc, id desc.
  • TransactionListingIT (Testcontainers): newest-first ordering and disjoint successive pages.

Closes #117

add GET /v1/transactions returning a generic PageResponse<TransactionResponse>,
mirroring GET /v1/accounts. read-only over the transactions table, ordered
posted_at desc then id desc, page>=0 default 0, size 1..100 default 20.

extend the shared TransactionResponse and PostedTransaction with status
(read from the domain transaction, additive to the POST response).

Closes #117
@tiana-code
tiana-code merged commit 4092554 into main Jun 14, 2026
6 checks passed
@tiana-code
tiana-code deleted the feat/E-01-transaction-listing branch June 14, 2026 20:53
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.

Paginated transaction listing endpoint (GET /v1/transactions)

1 participant