FINERACT-2081: Fix WholeTerm loan frequency saved on account level
This commit is contained in:
committed by
Adam Saghy
parent
51b6dfa08e
commit
474623b6e3
+4
@@ -1253,6 +1253,8 @@ final class LoansApiResourceSwagger {
|
||||
public Integer fixedLength;
|
||||
@Schema(example = "2")
|
||||
public BigDecimal interestRatePerPeriod;
|
||||
@Schema(example = "3")
|
||||
public Integer interestRateFrequencyType;
|
||||
@Schema(example = "1")
|
||||
public Integer amortizationType;
|
||||
@Schema(example = "5.5")
|
||||
@@ -1414,6 +1416,8 @@ final class LoansApiResourceSwagger {
|
||||
public Integer fixedLength;
|
||||
@Schema(example = "2")
|
||||
public BigDecimal interestRatePerPeriod;
|
||||
@Schema(example = "3")
|
||||
public Integer interestRateFrequencyType;
|
||||
@Schema(example = "0")
|
||||
public Integer interestType;
|
||||
@Schema(example = "0")
|
||||
|
||||
+13
-2
@@ -225,7 +225,12 @@ public class LoanScheduleAssembler {
|
||||
}
|
||||
|
||||
final BigDecimal interestRatePerPeriod = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed("interestRatePerPeriod", element);
|
||||
final PeriodFrequencyType interestRatePeriodFrequencyType = loanProduct.getInterestPeriodFrequencyType();
|
||||
PeriodFrequencyType interestRatePeriodFrequencyType = loanProduct.getInterestPeriodFrequencyType();
|
||||
if (this.fromApiJsonHelper.parameterExists(LoanApiConstants.interestRateFrequencyTypeParameterName, element)) {
|
||||
final Integer interestRateFrequencyType = this.fromApiJsonHelper
|
||||
.extractIntegerWithLocaleNamed(LoanApiConstants.interestRateFrequencyTypeParameterName, element);
|
||||
interestRatePeriodFrequencyType = PeriodFrequencyType.fromInt(interestRateFrequencyType);
|
||||
}
|
||||
|
||||
BigDecimal annualNominalInterestRate = BigDecimal.ZERO;
|
||||
if (interestRatePerPeriod != null) {
|
||||
@@ -647,7 +652,13 @@ public class LoanScheduleAssembler {
|
||||
|
||||
public LoanProductRelatedDetail assembleLoanProductRelatedDetail(final JsonElement element, final LoanProduct loanProduct) {
|
||||
final LoanApplicationTerms loanApplicationTerms = assembleLoanApplicationTermsFrom(element, loanProduct);
|
||||
return loanApplicationTerms.toLoanProductRelatedDetail();
|
||||
LoanProductRelatedDetail loanProductRelatedDetail = loanApplicationTerms.toLoanProductRelatedDetail();
|
||||
final String interestRateFrequencyTypeParamName = "interestRateFrequencyType";
|
||||
if (this.fromApiJsonHelper.parameterExists(interestRateFrequencyTypeParamName, element)) {
|
||||
final Integer newValue = this.fromApiJsonHelper.extractIntegerSansLocaleNamed(interestRateFrequencyTypeParamName, element);
|
||||
loanProductRelatedDetail.setInterestPeriodFrequencyType(PeriodFrequencyType.fromInt(newValue));
|
||||
}
|
||||
return loanProductRelatedDetail;
|
||||
}
|
||||
|
||||
public LoanScheduleModel assembleLoanScheduleFrom(final JsonElement element) {
|
||||
|
||||
Reference in New Issue
Block a user