feat(payments): add a paged list endpoint for payments - #293
Merged
Conversation
Add GET /v1/payments returning a page of payments, newest first, so the sandbox dashboard can browse them. It mirrors the ledger accounts list: a read-only service method over a sorted PageRequest, a generic PageResponse, and a thin controller that bounds the page index and size before delegating. Reuses the existing payments:read scope; no security change. Part of #289
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
E-08 #289a (F-08.7a) - the backend half of the payments UI slice. The PaymentController had no list endpoint (only POST initiate, GET /{id}, POST /{id}/cancel), so the payments dashboard screen (#289b) needs one.
What
GET /v1/payments?page=&size=returningPageResponse<PaymentResponse>newest-first, mirroring the merged ledger accounts list:PaymentService.list(page, size): PaymentPage+@Transactional(readOnly = true)impl usingPageRequest.of(page, size, Sort desc createdAt, desc id)+findAll+adapter::toDomain.PageResponse<T>DTO +PaymentPageapplication wrapper +PaymentApiMapper.toPageResponse.page >= 0andsize in 1..100(MAX_PAGE_SIZE) -> 400 via the existing IllegalArgumentException handler, then delegates.GET /v1/payments/** -> payments:readrule (covers the collection); no SecurityConfig change.Gate chain
Local gates green: test/detekt/detektTest/spotlessCheck/assemble/compileIntegrationTestKotlin.
Part of #289 (the payments UI #289b follows on this endpoint).