adamsaghy commented on code in PR #4266:
URL: https://github.com/apache/fineract/pull/4266#discussion_r1922010891
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/interestpauses/handler/UpdateInterestPauseCommandHandler.java:
##########
@@ -34,12 +36,20 @@ public class UpdateInterestPauseCommandHandler implements
NewCommandSourceHandle
@Override
public CommandProcessingResult processCommand(final JsonCommand command) {
final Long loanId = command.getLoanId();
+ final ExternalId loanExternalId = command.getLoanExternalId();
final Long termVariationId = command.getResourceId();
final String startDate =
command.stringValueOfParameterNamed("startDate");
final String endDate = command.stringValueOfParameterNamed("endDate");
final String dateFormat =
command.stringValueOfParameterNamed("dateFormat");
final String locale = command.stringValueOfParameterNamed("locale");
- return interestPauseService.updateInterestPause(loanId,
termVariationId, startDate, endDate, dateFormat, locale);
+ if (loanId != null) {
+ return interestPauseService.updateInterestPause(loanId,
termVariationId, startDate, endDate, dateFormat, locale);
+ } else if (loanExternalId != null) {
+ return interestPauseService.updateInterestPause(loanExternalId,
termVariationId, startDate, endDate, dateFormat, locale);
+ } else {
+ throw new
PlatformApiDataValidationException("validation.msg.missing.loan.id.or.external.id",
Review Comment:
It would be nicer to catch and throw the relevant error in the service. This
logic does not really belong to the command handler...
--
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]