adamsaghy commented on code in PR #4783:
URL: https://github.com/apache/fineract/pull/4783#discussion_r2155232385
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/account/api/AccountTransfersApiResource.java:
##########
@@ -131,6 +133,28 @@ public AccountTransferData
retrieveOne(@PathParam("transferId") @Parameter(descr
return accountTransfersReadPlatformService.retrieveOne(transferId);
}
+ @POST
+ @Path("{transferId}")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ @Operation(summary = "Update account transfer", description = "Update
account transfer\n\n" + "Example Requests :\n\n" + "\n\n"
+ + "accounttransfers/1")
+ @ApiResponses({
+ @ApiResponse(responseCode = "200", description = "OK", content =
@Content(schema = @Schema(implementation =
AccountTransfersApiResourceSwagger.GetAccountTransfersResponse.GetAccountTransfersPageItems.class)))
})
+ public String adjustAccountTransfer(@PathParam("transferId")
@Parameter(description = "transferId") final Long transferId,
+ @Context final UriInfo uriInfo, @Parameter(hidden = true) final
String apiRequestBodyAsJson,
+ @QueryParam("command") @Parameter(description = "command") final
String commandParam) {
+
+
this.context.authenticatedUser().validateHasReadPermission(AccountTransfersApiConstants.ACCOUNT_TRANSFER_RESOURCE_NAME);
+
+ final CommandWrapper commandRequest = new
CommandWrapperBuilder().adjustAccountTransfer(transferId).withJson(apiRequestBodyAsJson)
+ .build();
+
+ final CommandProcessingResult result =
this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
+
+ return this.toApiJsonSerializer.serialize(result);
Review Comment:
No need explicit serialization. Return the CommandProcessingResult directly!
--
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]