public String updateLoanRescheduleRequest(@PathParam("requestId") final Long requestId, @QueryParam("command") final String command,
final String apiRequestBodyAsJson) {
CommandWrapper commandWrapper = null;
if (compareIgnoreCase(command, "approve")) {
commandWrapper = new CommandWrapperBuilder().approveLoanRescheduleRequest(RescheduleLoansApiConstants.ENTITY_NAME, requestId)
.withJson(apiRequestBodyAsJson).build();
}
else if (compareIgnoreCase(command, "reject")) {
commandWrapper = new CommandWrapperBuilder().rejectLoanRescheduleRequest(RescheduleLoansApiConstants.ENTITY_NAME, requestId)
.withJson(apiRequestBodyAsJson).build();
}
else {
throw new UnrecognizedQueryParamException("command", command, new Object[] { "approve", "reject" });