FINERACT-1783: Customizeable LoanRepaymentScheduleTransactionProcessor

This commit is contained in:
Aleksandar Vidakovic
2022-11-01 14:08:02 +01:00
committed by Aleksandar Vidakovic
parent f2756b25bb
commit fc895fce05
99 changed files with 2015 additions and 2547 deletions
@@ -6299,7 +6299,7 @@ public class ClientLoanIntegrationTest {
private void validateIfValuesAreNotOverridden(Integer loanID, Integer loanProductID) {
String loanProductDetails = this.loanTransactionHelper.getLoanProductDetails(this.requestSpec, this.responseSpec, loanProductID);
String loanDetails = this.loanTransactionHelper.getLoanDetails(this.requestSpec, this.responseSpec, loanID);
List<String> comparisonAttributes = Arrays.asList("amortizationType", "interestType", "transactionProcessingStrategyId",
List<String> comparisonAttributes = Arrays.asList("amortizationType", "interestType", "transactionProcessingStrategyCode",
"interestCalculationPeriodType", "repaymentFrequencyType", "graceOnPrincipalPayment", "graceOnInterestPayment",
"inArrearsTolerance", "graceOnArrearsAgeing");
@@ -6313,7 +6313,7 @@ public class ClientLoanIntegrationTest {
private JsonObject createLoanProductConfigurationDetail(JsonObject loanProductConfiguration, Boolean bool) {
loanProductConfiguration.addProperty("amortizationType", bool);
loanProductConfiguration.addProperty("interestType", bool);
loanProductConfiguration.addProperty("transactionProcessingStrategyId", bool);
loanProductConfiguration.addProperty("transactionProcessingStrategyCode", bool);
loanProductConfiguration.addProperty("interestCalculationPeriodType", bool);
loanProductConfiguration.addProperty("inArrearsTolerance", bool);
loanProductConfiguration.addProperty("repaymentEvery", bool);
@@ -275,7 +275,8 @@ public final class BatchHelper {
+ "\"loanTermFrequencyType\": 2, \"loanType\": \"individual\", \"numberOfRepayments\": 10,"
+ "\"repaymentEvery\": 1, \"repaymentFrequencyType\": 2, \"interestRatePerPeriod\": 10,"
+ "\"amortizationType\": 1, \"interestType\": 0, \"interestCalculationPeriodType\": 1,"
+ "\"transactionProcessingStrategyId\": 1, \"expectedDisbursementDate\": \"" + dateString + "\",";
+ "\"transactionProcessingStrategyCode\": \"mifos-standard-strategy\", \"expectedDisbursementDate\": \"" + dateString
+ "\",";
if (clientCollateralId != null) {
body = body + "\"collateral\": [{\"clientCollateralId\": \"" + clientCollateralId + "\", \"quantity\": \"1\"}],";
@@ -313,7 +314,7 @@ public final class BatchHelper {
+ "\"loanTermFrequencyType\": 2, \"loanType\": \"individual\", \"numberOfRepayments\": 10,"
+ "\"repaymentEvery\": 1, \"repaymentFrequencyType\": 2, \"interestRatePerPeriod\": 10,"
+ "\"amortizationType\": 1, \"interestType\": 0, \"interestCalculationPeriodType\": 1,"
+ "\"transactionProcessingStrategyId\": 1, \"expectedDisbursementDate\": \"10 Jun 2013\","
+ "\"transactionProcessingStrategyCode\": \"mifos-standard-strategy\", \"expectedDisbursementDate\": \"10 Jun 2013\","
+ "\"submittedOnDate\": \"10 Jun 2013\"}", clientId, productId);
br.setBody(body);
@@ -39,9 +39,9 @@ public class LoanApplicationTestBuilder {
private static final String EQUAL_INSTALLMENTS = "1";
private static final String CALCULATION_PERIOD_SAME_AS_REPAYMENT_PERIOD = "1";
private static final String LOCALE = "en_GB";
public static final String DEFAULT_STRATEGY = "1";
public static final String RBI_INDIA_STRATEGY = "4";
public static final String INTEREST_PRINCIPAL_PENALTIES_FEES_ORDER_STRATEGY = "6";
public static final String DEFAULT_STRATEGY = "mifos-standard-strategy";
public static final String RBI_INDIA_STRATEGY = "rbi-india-strategy";
public static final String INTEREST_PRINCIPAL_PENALTIES_FEES_ORDER_STRATEGY = "interest-principal-penalties-fees-order-strategy";
private String externalId = null;
private String principal = "10,000";
@@ -56,7 +56,7 @@ public class LoanApplicationTestBuilder {
private String interestType = FLAT_BALANCE;
private String amortizationType = EQUAL_PRINCIPAL_PAYMENTS;
private String interestCalculationPeriodType = CALCULATION_PERIOD_SAME_AS_REPAYMENT_PERIOD;
private String transactionProcessingID = DEFAULT_STRATEGY;
private String transactionProcessingCode = DEFAULT_STRATEGY;
private String expectedDisbursmentDate = "";
private String submittedOnDate = "";
private String loanType = "individual";
@@ -147,7 +147,7 @@ public class LoanApplicationTestBuilder {
map.put("fixedPrincipalPercentagePerInstallment", fixedPrincipalPercentagePerInstallment);
map.put("interestType", this.interestType);
map.put("interestCalculationPeriodType", this.interestCalculationPeriodType);
map.put("transactionProcessingStrategyId", this.transactionProcessingID);
map.put("transactionProcessingStrategyCode", this.transactionProcessingCode);
map.put("expectedDisbursementDate", this.expectedDisbursmentDate);
map.put("submittedOnDate", this.submittedOnDate);
map.put("loanType", this.loanType);
@@ -335,8 +335,8 @@ public class LoanApplicationTestBuilder {
return this;
}
public LoanApplicationTestBuilder withRepaymentStrategy(final String transactionProcessingStrategy) {
this.transactionProcessingID = transactionProcessingStrategy;
public LoanApplicationTestBuilder withRepaymentStrategy(final String transactionProcessingStrategyCode) {
this.transactionProcessingCode = transactionProcessingStrategyCode;
return this;
}
@@ -40,11 +40,11 @@ public class LoanProductTestBuilder {
private static final String EQUAL_INSTALLMENTS = "1";
private static final String DECLINING_BALANCE = "0";
private static final String FLAT_BALANCE = "1";
public static final String DEFAULT_STRATEGY = "1";
public static final String INTEREST_PRINCIPAL_PENALTIES_FEES_ORDER_STRATEGY = "6";
// private static final String HEAVENS_FAMILY_STRATEGY ="2";
// private static final String CREO_CORE_STRATEGY ="3";
public static final String RBI_INDIA_STRATEGY = "4";
public static final String DEFAULT_STRATEGY = "mifos-standard-strategy";
public static final String INTEREST_PRINCIPAL_PENALTIES_FEES_ORDER_STRATEGY = "interest-principal-penalties-fees-order-strategy";
// private static final String HEAVENS_FAMILY_STRATEGY ="heavensfamily-strategy";
// private static final String CREO_CORE_STRATEGY ="creocore-strategy";
public static final String RBI_INDIA_STRATEGY = "rbi-india-strategy";
public static final String RECALCULATION_FREQUENCY_TYPE_SAME_AS_REPAYMENT_PERIOD = "1";
public static final String RECALCULATION_FREQUENCY_TYPE_DAILY = "2";
@@ -83,7 +83,7 @@ public class LoanProductTestBuilder {
private String overdueDaysForNPA = "5";
private String interestCalculationPeriodType = CALCULATION_PERIOD_SAME_AS_REPAYMENT_PERIOD;
private String inArrearsTolerance = "0";
private String transactionProcessingStrategy = DEFAULT_STRATEGY;
private String transactionProcessingStrategyCode = DEFAULT_STRATEGY;
private String accountingRule = NONE;
private final String currencyCode = USD;
private String amortizationType = EQUAL_INSTALLMENTS;
@@ -166,7 +166,7 @@ public class LoanProductTestBuilder {
map.put("interestType", this.interestType);
map.put("interestCalculationPeriodType", this.interestCalculationPeriodType);
map.put("inArrearsTolerance", this.inArrearsTolerance);
map.put("transactionProcessingStrategyId", this.transactionProcessingStrategy);
map.put("transactionProcessingStrategyCode", this.transactionProcessingStrategyCode);
map.put("accountingRule", this.accountingRule);
map.put("minPrincipal", this.minPrincipal);
map.put("maxPrincipal", this.maxPrincipal);
@@ -488,7 +488,7 @@ public class LoanProductTestBuilder {
}
public LoanProductTestBuilder withRepaymentStrategy(final String transactionProcessingStrategy) {
this.transactionProcessingStrategy = transactionProcessingStrategy;
this.transactionProcessingStrategyCode = transactionProcessingStrategy;
return this;
}
@@ -22,8 +22,8 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import com.linecorp.armeria.internal.shaded.guava.reflect.TypeToken;
import io.restassured.specification.RequestSpecification;
import io.restassured.specification.ResponseSpecification;
import java.io.ByteArrayInputStream;
@@ -850,7 +850,7 @@ public class LoanTransactionHelper {
map.put("interestType", "0");
map.put("interestCalculationPeriodType", "1");
map.put("expectedDisbursementDate", "20 September 2011");
map.put("transactionProcessingStrategyId", "1");
map.put("transactionProcessingStrategyCode", "mifos-standard-strategy");
return new Gson().toJson(map);
}