adamsaghy commented on code in PR #3301:
URL: https://github.com/apache/fineract/pull/3301#discussion_r1258374249
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientTransactionsApiResource.java:
##########
@@ -116,6 +114,94 @@ public String undoClientTransaction(@PathParam("clientId")
@Parameter(descriptio
@QueryParam("command") @Parameter(description = "command") final
String commandParam,
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
+ return undoTransaction(clientId, transactionId, commandParam,
apiRequestBodyAsJson);
+ }
+
+ @GET
+ @Path("external-id/{clientExternalId}/transactions")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "List Client Transactions", description = "The list
capability of client transaction can support pagination."
+ + "\n\n" + "Example Requests:\n\n" +
"clients/189/transactions\n\n" + "clients/189/transactions?offset=10&limit=50")
+ @ApiResponses({
+ @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation =
ClientTransactionsApiResourceSwagger.GetClientsClientIdTransactionsResponse.class)))
})
+ public String retrieveAllClientTransactions(
+ @PathParam("clientExternalId") @Parameter(description =
"clientExternalId") final String clientExternalId,
+ @Context final UriInfo uriInfo, @QueryParam("offset")
@Parameter(description = "offset") final Integer offset,
+ @QueryParam("limit") @Parameter(description = "limit") final
Integer limit) {
+
context.authenticatedUser().validateHasReadPermission(ClientApiConstants.CLIENT_CHARGES_RESOURCE_NAME);
+
+ Long clientId = resolveClientId(clientExternalId);
+ if (Objects.isNull(clientId)) {
+ throw new ClientNotFoundException();
+ }
+
+ return getAllClientTransactions(clientId, uriInfo, offset, limit);
+ }
+
+ @GET
+ @Path("external-id{clientExternalId}/transactions/{transactionId}")
Review Comment:
Wrong path.
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientTransactionsApiResource.java:
##########
@@ -116,6 +114,94 @@ public String undoClientTransaction(@PathParam("clientId")
@Parameter(descriptio
@QueryParam("command") @Parameter(description = "command") final
String commandParam,
@Parameter(hidden = true) final String apiRequestBodyAsJson) {
+ return undoTransaction(clientId, transactionId, commandParam,
apiRequestBodyAsJson);
+ }
+
+ @GET
+ @Path("external-id/{clientExternalId}/transactions")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "List Client Transactions", description = "The list
capability of client transaction can support pagination."
+ + "\n\n" + "Example Requests:\n\n" +
"clients/189/transactions\n\n" + "clients/189/transactions?offset=10&limit=50")
+ @ApiResponses({
+ @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation =
ClientTransactionsApiResourceSwagger.GetClientsClientIdTransactionsResponse.class)))
})
+ public String retrieveAllClientTransactions(
+ @PathParam("clientExternalId") @Parameter(description =
"clientExternalId") final String clientExternalId,
+ @Context final UriInfo uriInfo, @QueryParam("offset")
@Parameter(description = "offset") final Integer offset,
+ @QueryParam("limit") @Parameter(description = "limit") final
Integer limit) {
+
context.authenticatedUser().validateHasReadPermission(ClientApiConstants.CLIENT_CHARGES_RESOURCE_NAME);
+
+ Long clientId = resolveClientId(clientExternalId);
+ if (Objects.isNull(clientId)) {
+ throw new ClientNotFoundException();
+ }
+
+ return getAllClientTransactions(clientId, uriInfo, offset, limit);
+ }
+
+ @GET
+ @Path("external-id{clientExternalId}/transactions/{transactionId}")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Retrieve a Client Transaction", description =
"Example Requests:\n" + "clients/1/transactions/1\n" + "\n" + "\n"
+ + "clients/1/transactions/1?fields=id,officeName")
+ @ApiResponses({
+ @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation =
ClientTransactionsApiResourceSwagger.GetClientsClientIdTransactionsTransactionIdResponse.class)))
})
+ public String retrieveClientTransaction(
+ @PathParam("clientExternalId") @Parameter(description =
"clientExternalId") final String clientExternalId,
+ @PathParam("transactionId") @Parameter(description =
"transactionId") final Long transactionId,
+ @Context final UriInfo uriInfo) {
+
+
context.authenticatedUser().validateHasReadPermission(ClientApiConstants.CLIENT_CHARGES_RESOURCE_NAME);
+
+ Long clientId = resolveClientId(clientExternalId);
+
+ if (Objects.isNull(clientId)) {
+ throw new ClientNotFoundException();
+ }
+
+ return getClientTransaction(clientId, transactionId, uriInfo);
+ }
+
+ @POST
+ @Path("external-id{clientExternalId}/transactions/{transactionId}")
Review Comment:
Wrong path.
--
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]