FINERACT-1822: Fix Undo waive loan charge API response inconsistency
This commit is contained in:
+1
-1
@@ -350,7 +350,7 @@ final class LoanTransactionsApiResourceSwagger {
|
||||
@Schema(example = "95174ff9-1a75-4d72-a413-6f9b1cb988b7")
|
||||
public String externalId;
|
||||
@Schema(example = "28 June 2022")
|
||||
public String date;
|
||||
public LocalDate date;
|
||||
|
||||
}
|
||||
|
||||
|
||||
+12
@@ -479,6 +479,18 @@ public class LoanTransaction extends AbstractAuditableWithUTCDateTimeCustom {
|
||||
return this.principalPortion;
|
||||
}
|
||||
|
||||
public BigDecimal getInterestPortion() {
|
||||
return this.interestPortion;
|
||||
}
|
||||
|
||||
public BigDecimal getPenaltyChargesPortion() {
|
||||
return this.penaltyChargesPortion;
|
||||
}
|
||||
|
||||
public BigDecimal getFeeChargesPortion() {
|
||||
return this.feeChargesPortion;
|
||||
}
|
||||
|
||||
public Money getInterestPortion(final MonetaryCurrency currency) {
|
||||
return Money.of(currency, this.interestPortion);
|
||||
}
|
||||
|
||||
+3
-4
@@ -364,11 +364,10 @@ public class LoanChargeWritePlatformServiceImpl implements LoanChargeWritePlatfo
|
||||
|
||||
businessEventNotifierService.notifyPostBusinessEvent(new LoanWaiveChargeUndoBusinessEvent(loanCharge));
|
||||
|
||||
// TODO: this needs to be fixed in the future! Principal portion is bigdecimal, interest portion is money, ...
|
||||
changes.put("principalPortion", loanTransaction.getPrincipalPortion());
|
||||
changes.put("interestPortion", loanTransaction.getInterestPortion(loan.getCurrency()));
|
||||
changes.put("feeChargesPortion", loanTransaction.getFeeChargesPortion(loan.getCurrency()));
|
||||
changes.put("penaltyChargesPortion", loanTransaction.getPenaltyChargesPortion(loan.getCurrency()));
|
||||
changes.put("interestPortion", loanTransaction.getInterestPortion());
|
||||
changes.put("feeChargesPortion", loanTransaction.getFeeChargesPortion());
|
||||
changes.put("penaltyChargesPortion", loanTransaction.getPenaltyChargesPortion());
|
||||
changes.put("outstandingLoanBalance", loanTransaction.getOutstandingLoanBalance());
|
||||
changes.put("id", loanTransaction.getId());
|
||||
changes.put("externalId", loanTransaction.getExternalId());
|
||||
|
||||
Reference in New Issue
Block a user