galovics commented on code in PR #3158:
URL: https://github.com/apache/fineract/pull/3158#discussion_r1196048871


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/api/SavingsAccountTransactionsApiResource.java:
##########
@@ -114,6 +121,53 @@ public String retrieveTemplate(@PathParam("savingsId") 
final Long savingsId,
                 
SavingsApiSetConstants.SAVINGS_TRANSACTION_RESPONSE_DATA_PARAMETERS);
     }
 
+    @GET
+    @Consumes({ MediaType.APPLICATION_JSON })
+    @Produces({ MediaType.APPLICATION_JSON })
+    @Operation(summary = "List Savings Account Transactions", description = 
"The list capability of savings account transactions can support pagination, 
sorting and filtering.\n\n"
+            + "Example Requests:\n" + "\n" + 
"savingsaccounts/{savingsId}/transactions\n" + "\n"
+            + "savingsaccounts/{savingsId}/transactions?offset=10&limit=50\n" 
+ "\n"
+            + 
"savingsaccounts/{savingsId}/transactions?orderBy=displayName&sortOrder=DESC\n" 
+ "\n"
+            + 
"savingsaccounts/{savingsId}/transactions?dateFormat=yyyy-MM-dd&locale=en&fromDate=2013-01-01&toDate=2013-12-01\n"
 + "\n"
+            + 
"savingsaccounts/{savingsId}/transactions?fromAmount=500&toAmount=1000\n" + "\n"
+            + 
"savingsaccounts/{savingsId}/transactions?transactionType=deposit")
+    @ApiResponses({
+            @ApiResponse(responseCode = "200", description = "OK", content = 
@Content(schema = @Schema(implementation = 
SavingsAccountTransactionsApiResourceSwagger.GetSavingsAccountTransactionsResponse.class)))
 })
+    public String retrieveAll(@Context final UriInfo uriInfo,
+            @PathParam("savingsId") @Parameter(description = "savingsId") 
final Long savingsId,
+            @QueryParam("externalId") @Parameter(description = "externalId") 
final String externalId,
+            @QueryParam("offset") @Parameter(description = "offset") final 
Integer offset,
+            @QueryParam("limit") @Parameter(description = "limit") final 
Integer limit,
+            @QueryParam("orderBy") @Parameter(description = "orderBy") final 
String orderBy,
+            @QueryParam("sortOrder") @Parameter(description = "sortOrder") 
final String sortOrder,
+            @QueryParam("dateFormat") @Parameter(description = "dateFormat") 
final String dateFormat,
+            @QueryParam("fromDate") @Parameter(description = "fromDate") final 
DateParam fromDateParam,
+            @QueryParam("toDate") @Parameter(description = "toDate") final 
DateParam toDateParam,
+            @QueryParam("fromAmount") @Parameter(description = "fromAmount") 
@DecimalMin(value = "0", message = "must be greater than or equal to 0") final 
BigDecimal fromAmount,
+            @QueryParam("toAmount") @Parameter(description = "toAmount") 
@DecimalMin(value = "0", message = "must be greater than or equal to 0") final 
BigDecimal toAmount,
+            @QueryParam("locale") @Parameter(description = "locale") final 
String locale,
+            @QueryParam("transactionType") @Parameter(description = 
"transcationType") final String transactionType) {
+
+        
this.context.authenticatedUser().validateHasReadPermission(SavingsApiConstants.SAVINGS_ACCOUNT_RESOURCE_NAME);
+        final SearchParameters searchParameters = 
SearchParameters.forPagination(offset, limit, orderBy, sortOrder);
+
+        LocalDate fromDate = null;

Review Comment:
   That's right, it should be a jersey parameter converter.
   It's possible to access other attributes like this:
   - 
https://stackoverflow.com/questions/27584161/read-another-parameter-within-jerseys-paramconverter
   - 
https://stackoverflow.com/questions/53657358/paramconverter-based-on-http-header-value
   
   Anyhow, let's postpone this and keep the legacy version.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to