remove interestRateFrequencyType from supported parameters
This commit is contained in:
+5
-2
@@ -74,13 +74,16 @@ public class LoanScheduleAssembler {
|
|||||||
|
|
||||||
final BigDecimal principal = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("principal", element);
|
final BigDecimal principal = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("principal", element);
|
||||||
final BigDecimal interestRatePerPeriod = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("interestRatePerPeriod", element);
|
final BigDecimal interestRatePerPeriod = fromApiJsonHelper.extractBigDecimalWithLocaleNamed("interestRatePerPeriod", element);
|
||||||
final Integer interestRateFrequencyType = fromApiJsonHelper.extractIntegerWithLocaleNamed("interestRateFrequencyType", element);
|
//final Integer interestRateFrequencyType = fromApiJsonHelper.extractIntegerWithLocaleNamed("interestRateFrequencyType", element);
|
||||||
final Integer interestType = fromApiJsonHelper.extractIntegerWithLocaleNamed("interestType", element);
|
final Integer interestType = fromApiJsonHelper.extractIntegerWithLocaleNamed("interestType", element);
|
||||||
final Integer interestCalculationPeriodType = fromApiJsonHelper.extractIntegerWithLocaleNamed("interestCalculationPeriodType",
|
final Integer interestCalculationPeriodType = fromApiJsonHelper.extractIntegerWithLocaleNamed("interestCalculationPeriodType",
|
||||||
element);
|
element);
|
||||||
|
|
||||||
final InterestMethod interestMethod = InterestMethod.fromInt(interestType);
|
final InterestMethod interestMethod = InterestMethod.fromInt(interestType);
|
||||||
final PeriodFrequencyType interestRatePeriodFrequencyType = PeriodFrequencyType.fromInt(interestRateFrequencyType);
|
//final PeriodFrequencyType interestRatePeriodFrequencyType = PeriodFrequencyType.fromInt(interestRateFrequencyType);
|
||||||
|
|
||||||
|
// PeriodFrequencyType is copied from Loan Product
|
||||||
|
final PeriodFrequencyType interestRatePeriodFrequencyType = loanProduct.loanProductRelatedDetail().getInterestPeriodFrequencyType();
|
||||||
final InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod
|
final InterestCalculationPeriodMethod interestCalculationPeriodMethod = InterestCalculationPeriodMethod
|
||||||
.fromInt(interestCalculationPeriodType);
|
.fromInt(interestCalculationPeriodType);
|
||||||
|
|
||||||
|
|||||||
+1
-16
@@ -40,7 +40,7 @@ public final class LoanApplicationCommandFromApiJsonHelper {
|
|||||||
*/
|
*/
|
||||||
final Set<String> supportedParameters = new HashSet<String>(Arrays.asList("dateFormat", "locale", "id", "clientId", "groupId",
|
final Set<String> supportedParameters = new HashSet<String>(Arrays.asList("dateFormat", "locale", "id", "clientId", "groupId",
|
||||||
"productId", "principal", "loanTermFrequency", "loanTermFrequencyType", "numberOfRepayments", "repaymentEvery",
|
"productId", "principal", "loanTermFrequency", "loanTermFrequencyType", "numberOfRepayments", "repaymentEvery",
|
||||||
"repaymentFrequencyType", "interestRatePerPeriod", "interestRateFrequencyType", "amortizationType", "interestType",
|
"repaymentFrequencyType", "interestRatePerPeriod", "amortizationType", "interestType",
|
||||||
"interestCalculationPeriodType", "expectedDisbursementDate", "repaymentsStartingFromDate", "interestChargedFromDate",
|
"interestCalculationPeriodType", "expectedDisbursementDate", "repaymentsStartingFromDate", "interestChargedFromDate",
|
||||||
"submittedOnDate", "submittedOnNote", //
|
"submittedOnDate", "submittedOnNote", //
|
||||||
"accountNo", "externalId", "fundId", "loanOfficerId", // optional
|
"accountNo", "externalId", "fundId", "loanOfficerId", // optional
|
||||||
@@ -146,12 +146,6 @@ public final class LoanApplicationCommandFromApiJsonHelper {
|
|||||||
element);
|
element);
|
||||||
baseDataValidator.reset().parameter(interestRatePerPeriodParameterName).value(interestRatePerPeriod).notNull().positiveAmount();
|
baseDataValidator.reset().parameter(interestRatePerPeriodParameterName).value(interestRatePerPeriod).notNull().positiveAmount();
|
||||||
|
|
||||||
final String interestRateFrequencyTypeParameterName = "interestRateFrequencyType";
|
|
||||||
final Integer interestRateFrequencyType = fromApiJsonHelper.extractIntegerSansLocaleNamed(interestRateFrequencyTypeParameterName,
|
|
||||||
element);
|
|
||||||
baseDataValidator.reset().parameter(interestRateFrequencyTypeParameterName).value(interestRateFrequencyType).notNull()
|
|
||||||
.inMinMaxRange(0, 3);
|
|
||||||
|
|
||||||
final String interestTypeParameterName = "interestType";
|
final String interestTypeParameterName = "interestType";
|
||||||
final Integer interestType = fromApiJsonHelper.extractIntegerSansLocaleNamed(interestTypeParameterName, element);
|
final Integer interestType = fromApiJsonHelper.extractIntegerSansLocaleNamed(interestTypeParameterName, element);
|
||||||
baseDataValidator.reset().parameter(interestTypeParameterName).value(interestType).notNull().inMinMaxRange(0, 1);
|
baseDataValidator.reset().parameter(interestTypeParameterName).value(interestType).notNull().inMinMaxRange(0, 1);
|
||||||
@@ -420,15 +414,6 @@ public final class LoanApplicationCommandFromApiJsonHelper {
|
|||||||
baseDataValidator.reset().parameter(interestRatePerPeriodParameterName).value(interestRatePerPeriod).notNull().positiveAmount();
|
baseDataValidator.reset().parameter(interestRatePerPeriodParameterName).value(interestRatePerPeriod).notNull().positiveAmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
final String interestRateFrequencyTypeParameterName = "interestRateFrequencyType";
|
|
||||||
if (fromApiJsonHelper.parameterExists(interestRateFrequencyTypeParameterName, element)) {
|
|
||||||
atLeastOneParameterPassedForUpdate = true;
|
|
||||||
final Integer interestRateFrequencyType = fromApiJsonHelper.extractIntegerWithLocaleNamed(
|
|
||||||
interestRateFrequencyTypeParameterName, element);
|
|
||||||
baseDataValidator.reset().parameter(interestRateFrequencyTypeParameterName).value(interestRateFrequencyType).notNull()
|
|
||||||
.inMinMaxRange(0, 3);
|
|
||||||
}
|
|
||||||
|
|
||||||
final String interestTypeParameterName = "interestType";
|
final String interestTypeParameterName = "interestType";
|
||||||
if (fromApiJsonHelper.parameterExists(interestTypeParameterName, element)) {
|
if (fromApiJsonHelper.parameterExists(interestTypeParameterName, element)) {
|
||||||
atLeastOneParameterPassedForUpdate = true;
|
atLeastOneParameterPassedForUpdate = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user