private Integer createLoanProductWithInterestRecalculation(final String repaymentStrategy,
final String interestRecalculationCompoundingMethod, final String rescheduleStrategyMethod,
final String recalculationRestFrequencyType, final String recalculationRestFrequencyInterval,
final String recalculationRestFrequencyDate, final Account[] accounts, final String chargeId) {
System.out.println("------------------------------CREATING NEW LOAN PRODUCT ---------------------------------------");
LoanProductTestBuilder builder = new LoanProductTestBuilder()
.withPrincipal("10000000.00")
.withNumberOfRepayments("24")
.withRepaymentAfterEvery("1")
.withRepaymentTypeAsWeek()
.withinterestRatePerPeriod("2")
.withInterestRateFrequencyTypeAsMonths()
.withRepaymentStrategy(repaymentStrategy)
.withAmortizationTypeAsEqualPrincipalPayment()
.withInterestTypeAsDecliningBalance()
.withInterestRecalculationDetails(interestRecalculationCompoundingMethod, rescheduleStrategyMethod)
.withInterestRecalculationRestFrequencyDetails(recalculationRestFrequencyType, recalculationRestFrequencyInterval,
recalculationRestFrequencyDate);
if (accounts != null) {
builder = builder.withAccountingRulePeriodicAccrual(accounts);
}
final String loanProductJSON = builder.build(chargeId);
return this.loanTransactionHelper.getLoanProductId(loanProductJSON);
}