MIFOSX-1727
This commit is contained in:
@@ -13353,6 +13353,7 @@ Request Body:
|
|||||||
<li><b>allow-transactions-on-holiday</b> - defaults to false - if true allows transactions on <a href="#holidays">holidays</a></li>
|
<li><b>allow-transactions-on-holiday</b> - defaults to false - if true allows transactions on <a href="#holidays">holidays</a></li>
|
||||||
<li><b>savings-interest-posting-current-period-end</b> - Set it at the database level before any savings interest is posted. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted.</li>
|
<li><b>savings-interest-posting-current-period-end</b> - Set it at the database level before any savings interest is posted. When set as false(default), interest will be posted on the first date of next period. If set as true, interest will be posted on last date of current period. There is no difference in the interest amount posted.</li>
|
||||||
<li><b>financial-year-beginning-month</b> - Set it at the database level before any savings interest is posted. Allowed values 1 - 12 (January - December). Interest posting periods are evaluated based on this configuration.</li>
|
<li><b>financial-year-beginning-month</b> - Set it at the database level before any savings interest is posted. Allowed values 1 - 12 (January - December). Interest posting periods are evaluated based on this configuration.</li>
|
||||||
|
<li><b>meetings-mandatory-for-jlg-loans</b> - if set to true, enforces all JLG loans to follow a meeting schedule belonging to either the parent group or Center.</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
@@ -43,4 +43,6 @@ public interface ConfigurationDomainService {
|
|||||||
|
|
||||||
public Integer retrieveMaxAllowedClientsInGroup();
|
public Integer retrieveMaxAllowedClientsInGroup();
|
||||||
|
|
||||||
|
boolean isMeetingMandatoryForJLGLoans();
|
||||||
|
|
||||||
}
|
}
|
||||||
+7
@@ -166,4 +166,11 @@ public class ConfigurationDomainServiceJpa implements ConfigurationDomainService
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isMeetingMandatoryForJLGLoans() {
|
||||||
|
final String propertyName = "meetings-mandatory-for-jlg-loans";
|
||||||
|
final GlobalConfigurationProperty property = this.globalConfigurationRepository.findOneByNameWithNotFoundDetection(propertyName);
|
||||||
|
return property.isEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
+37
-38
@@ -19,11 +19,11 @@ import org.mifosplatform.organisation.monetary.domain.ApplicationCurrency;
|
|||||||
import org.mifosplatform.organisation.monetary.domain.MonetaryCurrency;
|
import org.mifosplatform.organisation.monetary.domain.MonetaryCurrency;
|
||||||
import org.mifosplatform.organisation.monetary.domain.Money;
|
import org.mifosplatform.organisation.monetary.domain.Money;
|
||||||
import org.mifosplatform.portfolio.calendar.domain.CalendarInstance;
|
import org.mifosplatform.portfolio.calendar.domain.CalendarInstance;
|
||||||
|
import org.mifosplatform.portfolio.common.domain.DayOfWeekType;
|
||||||
import org.mifosplatform.portfolio.common.domain.DaysInMonthType;
|
import org.mifosplatform.portfolio.common.domain.DaysInMonthType;
|
||||||
import org.mifosplatform.portfolio.common.domain.DaysInYearType;
|
import org.mifosplatform.portfolio.common.domain.DaysInYearType;
|
||||||
import org.mifosplatform.portfolio.common.domain.NthDayType;
|
import org.mifosplatform.portfolio.common.domain.NthDayType;
|
||||||
import org.mifosplatform.portfolio.common.domain.PeriodFrequencyType;
|
import org.mifosplatform.portfolio.common.domain.PeriodFrequencyType;
|
||||||
import org.mifosplatform.portfolio.common.domain.DayOfWeekType;
|
|
||||||
import org.mifosplatform.portfolio.loanaccount.data.DisbursementData;
|
import org.mifosplatform.portfolio.loanaccount.data.DisbursementData;
|
||||||
import org.mifosplatform.portfolio.loanaccount.data.LoanTermVariationsData;
|
import org.mifosplatform.portfolio.loanaccount.data.LoanTermVariationsData;
|
||||||
import org.mifosplatform.portfolio.loanaccount.domain.LoanInterestRecalculationDetails;
|
import org.mifosplatform.portfolio.loanaccount.domain.LoanInterestRecalculationDetails;
|
||||||
@@ -45,7 +45,7 @@ public final class LoanApplicationTerms {
|
|||||||
private final PeriodFrequencyType repaymentPeriodFrequencyType;
|
private final PeriodFrequencyType repaymentPeriodFrequencyType;
|
||||||
private final Integer nthDay;
|
private final Integer nthDay;
|
||||||
|
|
||||||
private final DayOfWeekType weekDayType;
|
private final DayOfWeekType weekDayType;
|
||||||
private final AmortizationMethod amortizationMethod;
|
private final AmortizationMethod amortizationMethod;
|
||||||
|
|
||||||
private final InterestMethod interestMethod;
|
private final InterestMethod interestMethod;
|
||||||
@@ -106,15 +106,15 @@ public final class LoanApplicationTerms {
|
|||||||
// added
|
// added
|
||||||
private LocalDate loanEndDate;
|
private LocalDate loanEndDate;
|
||||||
|
|
||||||
private List<DisbursementData> disbursementDatas;
|
private final List<DisbursementData> disbursementDatas;
|
||||||
|
|
||||||
private boolean multiDisburseLoan;
|
private final boolean multiDisburseLoan;
|
||||||
|
|
||||||
private BigDecimal fixedEmiAmount;
|
private BigDecimal fixedEmiAmount;
|
||||||
|
|
||||||
private BigDecimal maxOutstandingBalance;
|
private final BigDecimal maxOutstandingBalance;
|
||||||
|
|
||||||
private List<LoanTermVariationsData> emiAmountVariations;
|
private final List<LoanTermVariationsData> emiAmountVariations;
|
||||||
|
|
||||||
private Money totalInterestDue;
|
private Money totalInterestDue;
|
||||||
|
|
||||||
@@ -134,38 +134,39 @@ public final class LoanApplicationTerms {
|
|||||||
|
|
||||||
public static LoanApplicationTerms assembleFrom(final ApplicationCurrency currency, final Integer loanTermFrequency,
|
public static LoanApplicationTerms assembleFrom(final ApplicationCurrency currency, final Integer loanTermFrequency,
|
||||||
final PeriodFrequencyType loanTermPeriodFrequencyType, final Integer numberOfRepayments, final Integer repaymentEvery,
|
final PeriodFrequencyType loanTermPeriodFrequencyType, final Integer numberOfRepayments, final Integer repaymentEvery,
|
||||||
final PeriodFrequencyType repaymentPeriodFrequencyType, Integer nthDay,
|
final PeriodFrequencyType repaymentPeriodFrequencyType, Integer nthDay, DayOfWeekType weekDayType,
|
||||||
DayOfWeekType weekDayType, final AmortizationMethod amortizationMethod,
|
final AmortizationMethod amortizationMethod, final InterestMethod interestMethod, final BigDecimal interestRatePerPeriod,
|
||||||
final InterestMethod interestMethod, final BigDecimal interestRatePerPeriod,
|
|
||||||
final PeriodFrequencyType interestRatePeriodFrequencyType, final BigDecimal annualNominalInterestRate,
|
final PeriodFrequencyType interestRatePeriodFrequencyType, final BigDecimal annualNominalInterestRate,
|
||||||
final InterestCalculationPeriodMethod interestCalculationPeriodMethod, final Money principalMoney,
|
final InterestCalculationPeriodMethod interestCalculationPeriodMethod, final Money principalMoney,
|
||||||
final LocalDate expectedDisbursementDate, final LocalDate repaymentsStartingFromDate,
|
final LocalDate expectedDisbursementDate, final LocalDate repaymentsStartingFromDate,
|
||||||
final LocalDate calculatedRepaymentsStartingFromDate, final Integer graceOnPrincipalPayment, final Integer graceOnInterestPayment,
|
final LocalDate calculatedRepaymentsStartingFromDate, final Integer graceOnPrincipalPayment,
|
||||||
final Integer graceOnInterestCharged, final LocalDate interestChargedFromDate, final Money inArrearsTolerance,
|
final Integer graceOnInterestPayment, final Integer graceOnInterestCharged, final LocalDate interestChargedFromDate,
|
||||||
final boolean multiDisburseLoan, final BigDecimal emiAmount,
|
final Money inArrearsTolerance, final boolean multiDisburseLoan, final BigDecimal emiAmount,
|
||||||
final List<DisbursementData> disbursementDatas, final BigDecimal maxOutstandingBalance,
|
final List<DisbursementData> disbursementDatas, final BigDecimal maxOutstandingBalance,
|
||||||
final List<LoanTermVariationsData> emiAmountVariations, final Integer graceOnArrearsAgeing, final DaysInMonthType daysInMonthType, final DaysInYearType daysInYearType, final boolean isInterestRecalculationEnabled) {
|
final List<LoanTermVariationsData> emiAmountVariations, final Integer graceOnArrearsAgeing,
|
||||||
|
final DaysInMonthType daysInMonthType, final DaysInYearType daysInYearType, final boolean isInterestRecalculationEnabled) {
|
||||||
|
|
||||||
final LoanRescheduleStrategyMethod rescheduleStrategyMethod = null;
|
final LoanRescheduleStrategyMethod rescheduleStrategyMethod = null;
|
||||||
final InterestRecalculationCompoundingMethod interestRecalculationCompoundingMethod = null;
|
final InterestRecalculationCompoundingMethod interestRecalculationCompoundingMethod = null;
|
||||||
final CalendarInstance restCalendarInstance = null;
|
final CalendarInstance restCalendarInstance = null;
|
||||||
final RecalculationFrequencyType recalculationFrequencyType = null;
|
final RecalculationFrequencyType recalculationFrequencyType = null;
|
||||||
return new LoanApplicationTerms(currency, loanTermFrequency, loanTermPeriodFrequencyType, numberOfRepayments, repaymentEvery,
|
return new LoanApplicationTerms(currency, loanTermFrequency, loanTermPeriodFrequencyType, numberOfRepayments, repaymentEvery,
|
||||||
repaymentPeriodFrequencyType,nthDay, weekDayType, amortizationMethod, interestMethod, interestRatePerPeriod, interestRatePeriodFrequencyType,
|
repaymentPeriodFrequencyType, nthDay, weekDayType, amortizationMethod, interestMethod, interestRatePerPeriod,
|
||||||
annualNominalInterestRate, interestCalculationPeriodMethod, principalMoney, expectedDisbursementDate,
|
interestRatePeriodFrequencyType, annualNominalInterestRate, interestCalculationPeriodMethod, principalMoney,
|
||||||
repaymentsStartingFromDate, calculatedRepaymentsStartingFromDate, graceOnPrincipalPayment, graceOnInterestPayment,
|
expectedDisbursementDate, repaymentsStartingFromDate, calculatedRepaymentsStartingFromDate, graceOnPrincipalPayment,
|
||||||
graceOnInterestCharged, interestChargedFromDate, inArrearsTolerance, multiDisburseLoan, emiAmount, disbursementDatas,
|
graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, inArrearsTolerance, multiDisburseLoan, emiAmount,
|
||||||
maxOutstandingBalance, emiAmountVariations, graceOnArrearsAgeing, daysInMonthType, daysInYearType,
|
disbursementDatas, maxOutstandingBalance, emiAmountVariations, graceOnArrearsAgeing, daysInMonthType, daysInYearType,
|
||||||
isInterestRecalculationEnabled, rescheduleStrategyMethod, interestRecalculationCompoundingMethod, restCalendarInstance,
|
isInterestRecalculationEnabled, rescheduleStrategyMethod, interestRecalculationCompoundingMethod, restCalendarInstance,
|
||||||
recalculationFrequencyType);
|
recalculationFrequencyType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LoanApplicationTerms assembleFrom(final ApplicationCurrency applicationCurrency, final Integer loanTermFrequency,
|
public static LoanApplicationTerms assembleFrom(final ApplicationCurrency applicationCurrency, final Integer loanTermFrequency,
|
||||||
final PeriodFrequencyType loanTermPeriodFrequencyType, NthDayType nthDay,
|
final PeriodFrequencyType loanTermPeriodFrequencyType, NthDayType nthDay, DayOfWeekType dayOfWeek,
|
||||||
DayOfWeekType dayOfWeek, final LocalDate expectedDisbursementDate,
|
final LocalDate expectedDisbursementDate, final LocalDate repaymentsStartingFromDate,
|
||||||
final LocalDate repaymentsStartingFromDate, final LocalDate calculatedRepaymentsStartingFromDate, final Money inArrearsTolerance,
|
final LocalDate calculatedRepaymentsStartingFromDate, final Money inArrearsTolerance,
|
||||||
final LoanProductRelatedDetail loanProductRelatedDetail, final boolean multiDisburseLoan, final BigDecimal emiAmount,
|
final LoanProductRelatedDetail loanProductRelatedDetail, final boolean multiDisburseLoan, final BigDecimal emiAmount,
|
||||||
final List<DisbursementData> disbursementDatas, final BigDecimal maxOutstandingBalance, final List<LoanTermVariationsData> emiAmountVariations, final LocalDate interestChargedFromDate) {
|
final List<DisbursementData> disbursementDatas, final BigDecimal maxOutstandingBalance,
|
||||||
|
final List<LoanTermVariationsData> emiAmountVariations, final LocalDate interestChargedFromDate) {
|
||||||
|
|
||||||
final Integer numberOfRepayments = loanProductRelatedDetail.getNumberOfRepayments();
|
final Integer numberOfRepayments = loanProductRelatedDetail.getNumberOfRepayments();
|
||||||
final Integer repaymentEvery = loanProductRelatedDetail.getRepayEvery();
|
final Integer repaymentEvery = loanProductRelatedDetail.getRepayEvery();
|
||||||
@@ -194,13 +195,13 @@ public final class LoanApplicationTerms {
|
|||||||
final RecalculationFrequencyType recalculationFrequencyType = null;
|
final RecalculationFrequencyType recalculationFrequencyType = null;
|
||||||
|
|
||||||
return new LoanApplicationTerms(applicationCurrency, loanTermFrequency, loanTermPeriodFrequencyType, numberOfRepayments,
|
return new LoanApplicationTerms(applicationCurrency, loanTermFrequency, loanTermPeriodFrequencyType, numberOfRepayments,
|
||||||
repaymentEvery, repaymentPeriodFrequencyType, nthDay.getValue(), dayOfWeek, amortizationMethod, interestMethod, interestRatePerPeriod,
|
repaymentEvery, repaymentPeriodFrequencyType, nthDay.getValue(), dayOfWeek, amortizationMethod, interestMethod,
|
||||||
interestRatePeriodFrequencyType, annualNominalInterestRate, interestCalculationPeriodMethod, principalMoney,
|
interestRatePerPeriod, interestRatePeriodFrequencyType, annualNominalInterestRate, interestCalculationPeriodMethod,
|
||||||
expectedDisbursementDate, repaymentsStartingFromDate, calculatedRepaymentsStartingFromDate, graceOnPrincipalPayment,
|
principalMoney, expectedDisbursementDate, repaymentsStartingFromDate, calculatedRepaymentsStartingFromDate,
|
||||||
graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, inArrearsTolerance, multiDisburseLoan, emiAmount,
|
graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, inArrearsTolerance,
|
||||||
disbursementDatas, maxOutstandingBalance, emiAmountVariations, loanProductRelatedDetail.getGraceOnDueDate(),
|
multiDisburseLoan, emiAmount, disbursementDatas, maxOutstandingBalance, emiAmountVariations,
|
||||||
daysInMonthType, daysInYearType, isInterestRecalculationEnabled, rescheduleStrategyMethod,
|
loanProductRelatedDetail.getGraceOnDueDate(), daysInMonthType, daysInYearType, isInterestRecalculationEnabled,
|
||||||
interestRecalculationCompoundingMethod, restCalendarInstance, recalculationFrequencyType);
|
rescheduleStrategyMethod, interestRecalculationCompoundingMethod, restCalendarInstance, recalculationFrequencyType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LoanApplicationTerms assembleFrom(final ApplicationCurrency applicationCurrency, final Integer loanTermFrequency,
|
public static LoanApplicationTerms assembleFrom(final ApplicationCurrency applicationCurrency, final Integer loanTermFrequency,
|
||||||
@@ -270,9 +271,8 @@ public final class LoanApplicationTerms {
|
|||||||
|
|
||||||
private LoanApplicationTerms(final ApplicationCurrency currency, final Integer loanTermFrequency,
|
private LoanApplicationTerms(final ApplicationCurrency currency, final Integer loanTermFrequency,
|
||||||
final PeriodFrequencyType loanTermPeriodFrequencyType, final Integer numberOfRepayments, final Integer repaymentEvery,
|
final PeriodFrequencyType loanTermPeriodFrequencyType, final Integer numberOfRepayments, final Integer repaymentEvery,
|
||||||
final PeriodFrequencyType repaymentPeriodFrequencyType, final Integer nthDay,
|
final PeriodFrequencyType repaymentPeriodFrequencyType, final Integer nthDay, final DayOfWeekType weekDayType,
|
||||||
final DayOfWeekType weekDayType, final AmortizationMethod amortizationMethod,
|
final AmortizationMethod amortizationMethod, final InterestMethod interestMethod, final BigDecimal interestRatePerPeriod,
|
||||||
final InterestMethod interestMethod, final BigDecimal interestRatePerPeriod,
|
|
||||||
final PeriodFrequencyType interestRatePeriodFrequencyType, final BigDecimal annualNominalInterestRate,
|
final PeriodFrequencyType interestRatePeriodFrequencyType, final BigDecimal annualNominalInterestRate,
|
||||||
final InterestCalculationPeriodMethod interestCalculationPeriodMethod, final Money principal,
|
final InterestCalculationPeriodMethod interestCalculationPeriodMethod, final Money principal,
|
||||||
final LocalDate expectedDisbursementDate, final LocalDate repaymentsStartingFromDate,
|
final LocalDate expectedDisbursementDate, final LocalDate repaymentsStartingFromDate,
|
||||||
@@ -992,13 +992,12 @@ public final class LoanApplicationTerms {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Integer getNthDay() {
|
public Integer getNthDay() {
|
||||||
return this.nthDay;
|
return this.nthDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DayOfWeekType getWeekDayType() {
|
|
||||||
return this.weekDayType;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public DayOfWeekType getWeekDayType() {
|
||||||
|
return this.weekDayType;
|
||||||
|
}
|
||||||
|
|
||||||
public void setFixedEmiAmountForPeriod(LocalDate periodDate) {
|
public void setFixedEmiAmountForPeriod(LocalDate periodDate) {
|
||||||
LocalDate startDate = expectedDisbursementDate;
|
LocalDate startDate = expectedDisbursementDate;
|
||||||
|
|||||||
+27
-61
@@ -164,7 +164,7 @@ public class LoanScheduleAssembler {
|
|||||||
|
|
||||||
final LocalDate expectedDisbursementDate = this.fromApiJsonHelper.extractLocalDateNamed("expectedDisbursementDate", element);
|
final LocalDate expectedDisbursementDate = this.fromApiJsonHelper.extractLocalDateNamed("expectedDisbursementDate", element);
|
||||||
final LocalDate repaymentsStartingFromDate = this.fromApiJsonHelper.extractLocalDateNamed("repaymentsStartingFromDate", element);
|
final LocalDate repaymentsStartingFromDate = this.fromApiJsonHelper.extractLocalDateNamed("repaymentsStartingFromDate", element);
|
||||||
LocalDate calculatedRepaymentsStartingFromDate = null;
|
LocalDate calculatedRepaymentsStartingFromDate = repaymentsStartingFromDate;
|
||||||
|
|
||||||
final Boolean synchDisbursement = this.fromApiJsonHelper.extractBooleanNamed("syncDisbursementWithMeeting", element);
|
final Boolean synchDisbursement = this.fromApiJsonHelper.extractBooleanNamed("syncDisbursementWithMeeting", element);
|
||||||
final Long calendarId = this.fromApiJsonHelper.extractLongNamed("calendarId", element);
|
final Long calendarId = this.fromApiJsonHelper.extractLongNamed("calendarId", element);
|
||||||
@@ -190,67 +190,31 @@ public class LoanScheduleAssembler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If user has not passed the first repayments date then only system
|
* If user has not passed the first repayments date then then derive the
|
||||||
* will derive it based on loan is individual/group loan or JLG loan.
|
* same based on loan type.
|
||||||
*/
|
*/
|
||||||
Boolean isRepaymentsStartingFromDateDerived = false;
|
if (calculatedRepaymentsStartingFromDate == null) {
|
||||||
if (repaymentsStartingFromDate == null) {
|
|
||||||
calculatedRepaymentsStartingFromDate = deriveFirstRepaymentDate(loanType, repaymentEvery, expectedDisbursementDate,
|
calculatedRepaymentsStartingFromDate = deriveFirstRepaymentDate(loanType, repaymentEvery, expectedDisbursementDate,
|
||||||
repaymentPeriodFrequencyType, loanProduct.getMinimumDaysBetweenDisbursalAndFirstRepayment(), calendar);
|
repaymentPeriodFrequencyType, loanProduct.getMinimumDaysBetweenDisbursalAndFirstRepayment(), calendar);
|
||||||
isRepaymentsStartingFromDateDerived = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If it is JLG loan, then make sure first repayment falls on meeting
|
* If it is JLG loan synched with a meeting, then make sure first
|
||||||
* date
|
* repayment falls on meeting date
|
||||||
*/
|
*/
|
||||||
if (loanType.isJLGAccount()) {
|
if (loanType.isJLGAccount() && calendar != null) {
|
||||||
if (isRepaymentsStartingFromDateDerived) {
|
validateRepaymentsStartDateWithMeetingDates(calculatedRepaymentsStartingFromDate, calendar);
|
||||||
validateRepaymentsStartDateWithMeetingDates(calculatedRepaymentsStartingFromDate, calendar);
|
/*
|
||||||
} else {
|
* If disbursement is synced on meeting, make sure disbursement date
|
||||||
validateRepaymentsStartDateWithMeetingDates(repaymentsStartingFromDate, calendar);
|
* is on a meeting date
|
||||||
}
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If it is JLG loan and disbursement is synced on meeting, make sure
|
|
||||||
* disbursement date on meeting date
|
|
||||||
*/
|
|
||||||
if (loanType.isJLGAccount()) {
|
|
||||||
if (synchDisbursement != null && synchDisbursement.booleanValue()) {
|
if (synchDisbursement != null && synchDisbursement.booleanValue()) {
|
||||||
validateDisbursementDateWithMeetingDates(expectedDisbursementDate, calendar);
|
validateDisbursementDateWithMeetingDates(expectedDisbursementDate, calendar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
validateMinimumDaysBetweenDisbursalAndFirstRepayment(expectedDisbursementDate, calculatedRepaymentsStartingFromDate,
|
||||||
* If minimum days between disbursal and first repayment is set, then
|
loanProduct.getMinimumDaysBetweenDisbursalAndFirstRepayment());
|
||||||
* validate the rule
|
|
||||||
*/
|
|
||||||
if (isRepaymentsStartingFromDateDerived) {
|
|
||||||
validateMinimumDaysBetweenDisbursalAndFirstRepayment(expectedDisbursementDate, calculatedRepaymentsStartingFromDate,
|
|
||||||
loanProduct.getMinimumDaysBetweenDisbursalAndFirstRepayment());
|
|
||||||
} else {
|
|
||||||
validateMinimumDaysBetweenDisbursalAndFirstRepayment(expectedDisbursementDate, repaymentsStartingFromDate,
|
|
||||||
loanProduct.getMinimumDaysBetweenDisbursalAndFirstRepayment());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If first repayment is not derived and instead directly taken from
|
|
||||||
* input then copy the value of repaymentsStartingFromDate to
|
|
||||||
* calculatedRepaymentsStartingFromDate
|
|
||||||
*
|
|
||||||
* TODO: The reason for this bad code is,
|
|
||||||
* LoanApplicationTerms.assembleFrom takes both
|
|
||||||
* repaymentsStartingFromDate and calculatedRepaymentsStartingFromDate
|
|
||||||
* and derived data has precedence over input date,
|
|
||||||
*
|
|
||||||
* FIXME:LoanApplicationTerms.assembleFrom should take only one
|
|
||||||
* "first repayment date" than taking two dates with same purpose.
|
|
||||||
*/
|
|
||||||
if (!isRepaymentsStartingFromDateDerived) {
|
|
||||||
calculatedRepaymentsStartingFromDate = repaymentsStartingFromDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
// grace details
|
// grace details
|
||||||
final Integer graceOnPrincipalPayment = this.fromApiJsonHelper.extractIntegerWithLocaleNamed("graceOnPrincipalPayment", element);
|
final Integer graceOnPrincipalPayment = this.fromApiJsonHelper.extractIntegerWithLocaleNamed("graceOnPrincipalPayment", element);
|
||||||
@@ -469,17 +433,25 @@ public class LoanScheduleAssembler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("null")
|
|
||||||
private LocalDate deriveFirstRepaymentDate(final AccountType loanType, final Integer repaymentEvery,
|
private LocalDate deriveFirstRepaymentDate(final AccountType loanType, final Integer repaymentEvery,
|
||||||
final LocalDate expectedDisbursementDate, final PeriodFrequencyType repaymentPeriodFrequencyType,
|
final LocalDate expectedDisbursementDate, final PeriodFrequencyType repaymentPeriodFrequencyType,
|
||||||
final Integer minimumDaysBetweenDisbursalAndFirstRepayment, final Calendar calendar) {
|
final Integer minimumDaysBetweenDisbursalAndFirstRepayment, final Calendar calendar) {
|
||||||
|
|
||||||
LocalDate derivedFirstRepayment = null;
|
LocalDate derivedFirstRepayment = null;
|
||||||
LocalDate dateBasedOnRepaymentFrequency = null;
|
|
||||||
final LocalDate dateBasedOnMinimumDaysBetweenDisbursalAndFirstRepayment = expectedDisbursementDate
|
final LocalDate dateBasedOnMinimumDaysBetweenDisbursalAndFirstRepayment = expectedDisbursementDate
|
||||||
.plusDays(minimumDaysBetweenDisbursalAndFirstRepayment);
|
.plusDays(minimumDaysBetweenDisbursalAndFirstRepayment);
|
||||||
|
|
||||||
if (loanType.isIndividualAccount() || loanType.isGroupAccount()) {
|
if (loanType.isJLGAccount() && calendar != null) {
|
||||||
|
|
||||||
|
final LocalDate refernceDateForCalculatingFirstRepaymentDate = expectedDisbursementDate;
|
||||||
|
derivedFirstRepayment = deriveFirstRepaymentDateForJLGLoans(repaymentEvery, expectedDisbursementDate,
|
||||||
|
refernceDateForCalculatingFirstRepaymentDate, repaymentPeriodFrequencyType,
|
||||||
|
minimumDaysBetweenDisbursalAndFirstRepayment, calendar);
|
||||||
|
|
||||||
|
}/*** Individual or group account, or JLG not linked to a meeting ***/
|
||||||
|
else {
|
||||||
|
LocalDate dateBasedOnRepaymentFrequency;
|
||||||
// Derive the first repayment date as greater date among
|
// Derive the first repayment date as greater date among
|
||||||
// (disbursement date + plus frequency) or
|
// (disbursement date + plus frequency) or
|
||||||
// (disbursement date + minimum between disbursal and first
|
// (disbursement date + minimum between disbursal and first
|
||||||
@@ -490,18 +462,12 @@ public class LoanScheduleAssembler {
|
|||||||
dateBasedOnRepaymentFrequency = expectedDisbursementDate.plusWeeks(repaymentEvery);
|
dateBasedOnRepaymentFrequency = expectedDisbursementDate.plusWeeks(repaymentEvery);
|
||||||
} else if (repaymentPeriodFrequencyType.isMonthly()) {
|
} else if (repaymentPeriodFrequencyType.isMonthly()) {
|
||||||
dateBasedOnRepaymentFrequency = expectedDisbursementDate.plusMonths(repaymentEvery);
|
dateBasedOnRepaymentFrequency = expectedDisbursementDate.plusMonths(repaymentEvery);
|
||||||
} else if (repaymentPeriodFrequencyType.isYearly()) {
|
}/** yearly loan **/
|
||||||
|
else {
|
||||||
dateBasedOnRepaymentFrequency = expectedDisbursementDate.plusYears(repaymentEvery);
|
dateBasedOnRepaymentFrequency = expectedDisbursementDate.plusYears(repaymentEvery);
|
||||||
}
|
}
|
||||||
derivedFirstRepayment = dateBasedOnRepaymentFrequency.isAfter(dateBasedOnMinimumDaysBetweenDisbursalAndFirstRepayment) ? dateBasedOnRepaymentFrequency
|
derivedFirstRepayment = dateBasedOnRepaymentFrequency.isAfter(dateBasedOnMinimumDaysBetweenDisbursalAndFirstRepayment) ? dateBasedOnRepaymentFrequency
|
||||||
: dateBasedOnMinimumDaysBetweenDisbursalAndFirstRepayment;
|
: dateBasedOnMinimumDaysBetweenDisbursalAndFirstRepayment;
|
||||||
} else if (loanType.isJLGAccount()) {
|
|
||||||
|
|
||||||
final LocalDate refernceDateForCalculatingFirstRepaymentDate = expectedDisbursementDate;
|
|
||||||
derivedFirstRepayment = deriveFirstRepaymentDateForJLGLoans(repaymentEvery, expectedDisbursementDate,
|
|
||||||
refernceDateForCalculatingFirstRepaymentDate, repaymentPeriodFrequencyType,
|
|
||||||
minimumDaysBetweenDisbursalAndFirstRepayment, calendar);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return derivedFirstRepayment;
|
return derivedFirstRepayment;
|
||||||
|
|||||||
+12
-3
@@ -11,6 +11,7 @@ import java.util.Collection;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.joda.time.LocalDate;
|
import org.joda.time.LocalDate;
|
||||||
|
import org.mifosplatform.infrastructure.configuration.domain.ConfigurationDomainService;
|
||||||
import org.mifosplatform.infrastructure.core.api.JsonQuery;
|
import org.mifosplatform.infrastructure.core.api.JsonQuery;
|
||||||
import org.mifosplatform.infrastructure.core.data.ApiParameterError;
|
import org.mifosplatform.infrastructure.core.data.ApiParameterError;
|
||||||
import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder;
|
import org.mifosplatform.infrastructure.core.data.DataValidatorBuilder;
|
||||||
@@ -61,6 +62,7 @@ public class LoanScheduleCalculationPlatformServiceImpl implements LoanScheduleC
|
|||||||
private final LoanAccountDomainService accountDomainService;
|
private final LoanAccountDomainService accountDomainService;
|
||||||
private final CalendarInstanceRepository calendarInstanceRepository;
|
private final CalendarInstanceRepository calendarInstanceRepository;
|
||||||
private final LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory;
|
private final LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory;
|
||||||
|
private final ConfigurationDomainService configurationDomainService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public LoanScheduleCalculationPlatformServiceImpl(final CalculateLoanScheduleQueryFromApiJsonHelper fromApiJsonDeserializer,
|
public LoanScheduleCalculationPlatformServiceImpl(final CalculateLoanScheduleQueryFromApiJsonHelper fromApiJsonDeserializer,
|
||||||
@@ -69,7 +71,8 @@ public class LoanScheduleCalculationPlatformServiceImpl implements LoanScheduleC
|
|||||||
final LoanReadPlatformService loanReadPlatformService, final LoanApplicationCommandFromApiJsonHelper loanApiJsonDeserializer,
|
final LoanReadPlatformService loanReadPlatformService, final LoanApplicationCommandFromApiJsonHelper loanApiJsonDeserializer,
|
||||||
final LoanAssembler loanAssembler, final ApplicationCurrencyRepositoryWrapper applicationCurrencyRepository,
|
final LoanAssembler loanAssembler, final ApplicationCurrencyRepositoryWrapper applicationCurrencyRepository,
|
||||||
final LoanAccountDomainService accountDomainService, final CalendarInstanceRepository calendarInstanceRepository,
|
final LoanAccountDomainService accountDomainService, final CalendarInstanceRepository calendarInstanceRepository,
|
||||||
final LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory) {
|
final LoanRepaymentScheduleTransactionProcessorFactory loanRepaymentScheduleTransactionProcessorFactory,
|
||||||
|
final ConfigurationDomainService configurationDomainService) {
|
||||||
this.fromApiJsonDeserializer = fromApiJsonDeserializer;
|
this.fromApiJsonDeserializer = fromApiJsonDeserializer;
|
||||||
this.loanScheduleAssembler = loanScheduleAssembler;
|
this.loanScheduleAssembler = loanScheduleAssembler;
|
||||||
this.fromJsonHelper = fromJsonHelper;
|
this.fromJsonHelper = fromJsonHelper;
|
||||||
@@ -82,13 +85,19 @@ public class LoanScheduleCalculationPlatformServiceImpl implements LoanScheduleC
|
|||||||
this.accountDomainService = accountDomainService;
|
this.accountDomainService = accountDomainService;
|
||||||
this.calendarInstanceRepository = calendarInstanceRepository;
|
this.calendarInstanceRepository = calendarInstanceRepository;
|
||||||
this.loanRepaymentScheduleTransactionProcessorFactory = loanRepaymentScheduleTransactionProcessorFactory;
|
this.loanRepaymentScheduleTransactionProcessorFactory = loanRepaymentScheduleTransactionProcessorFactory;
|
||||||
|
this.configurationDomainService = configurationDomainService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LoanScheduleModel calculateLoanSchedule(final JsonQuery query, Boolean validateParams) {
|
public LoanScheduleModel calculateLoanSchedule(final JsonQuery query, Boolean validateParams) {
|
||||||
|
|
||||||
|
/***
|
||||||
|
* TODO: Vishwas, this is probably not required, test and remove the
|
||||||
|
* same
|
||||||
|
**/
|
||||||
if (validateParams) {
|
if (validateParams) {
|
||||||
this.loanApiJsonDeserializer.validateForCreate(query.json());
|
boolean isMeetingMandatoryForJLGLoans = configurationDomainService.isMeetingMandatoryForJLGLoans();
|
||||||
|
this.loanApiJsonDeserializer.validateForCreate(query.json(), isMeetingMandatoryForJLGLoans);
|
||||||
}
|
}
|
||||||
this.fromApiJsonDeserializer.validate(query.json());
|
this.fromApiJsonDeserializer.validate(query.json());
|
||||||
|
|
||||||
@@ -171,7 +180,7 @@ public class LoanScheduleCalculationPlatformServiceImpl implements LoanScheduleC
|
|||||||
}
|
}
|
||||||
if (isNewPaymentRequired) {
|
if (isNewPaymentRequired) {
|
||||||
LoanTransaction ondayPaymentTransaction = LoanTransaction.repayment(null, totalAmount, null, LocalDate.now(), null,
|
LoanTransaction ondayPaymentTransaction = LoanTransaction.repayment(null, totalAmount, null, LocalDate.now(), null,
|
||||||
DateUtils.getLocalDateTimeOfTenant(), null);
|
DateUtils.getLocalDateTimeOfTenant(), null);
|
||||||
modifiedTransactions.add(ondayPaymentTransaction);
|
modifiedTransactions.add(ondayPaymentTransaction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+25
-33
@@ -46,9 +46,9 @@ public final class LoanApplicationCommandFromApiJsonHelper {
|
|||||||
*/
|
*/
|
||||||
final Set<String> supportedParameters = new HashSet<>(Arrays.asList("dateFormat", "locale", "id", "clientId", "groupId", "loanType",
|
final Set<String> supportedParameters = new HashSet<>(Arrays.asList("dateFormat", "locale", "id", "clientId", "groupId", "loanType",
|
||||||
"productId", "principal", "loanTermFrequency", "loanTermFrequencyType", "numberOfRepayments", "repaymentEvery",
|
"productId", "principal", "loanTermFrequency", "loanTermFrequencyType", "numberOfRepayments", "repaymentEvery",
|
||||||
"repaymentFrequencyType","repaymentFrequencyNthDayType", "repaymentFrequencyDayOfWeekType", "interestRatePerPeriod", "amortizationType", "interestType", "interestCalculationPeriodType",
|
"repaymentFrequencyType", "repaymentFrequencyNthDayType", "repaymentFrequencyDayOfWeekType", "interestRatePerPeriod",
|
||||||
"expectedDisbursementDate", "repaymentsStartingFromDate", "graceOnPrincipalPayment",
|
"amortizationType", "interestType", "interestCalculationPeriodType", "expectedDisbursementDate", "repaymentsStartingFromDate",
|
||||||
"graceOnInterestPayment",
|
"graceOnPrincipalPayment", "graceOnInterestPayment",
|
||||||
"graceOnInterestCharged",
|
"graceOnInterestCharged",
|
||||||
"interestChargedFromDate", //
|
"interestChargedFromDate", //
|
||||||
"submittedOnDate",
|
"submittedOnDate",
|
||||||
@@ -78,7 +78,7 @@ public final class LoanApplicationCommandFromApiJsonHelper {
|
|||||||
this.apiJsonHelper = apiJsonHelper;
|
this.apiJsonHelper = apiJsonHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void validateForCreate(final String json) {
|
public void validateForCreate(final String json, final boolean isMeetingMandatoryForJLGLoans) {
|
||||||
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
if (StringUtils.isBlank(json)) { throw new InvalidJsonException(); }
|
||||||
|
|
||||||
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
final Type typeOfMap = new TypeToken<Map<String, Object>>() {}.getType();
|
||||||
@@ -112,32 +112,24 @@ public final class LoanApplicationCommandFromApiJsonHelper {
|
|||||||
if (loanType.isJLGAccount()) {
|
if (loanType.isJLGAccount()) {
|
||||||
baseDataValidator.reset().parameter("clientId").value(clientId).notNull().integerGreaterThanZero();
|
baseDataValidator.reset().parameter("clientId").value(clientId).notNull().integerGreaterThanZero();
|
||||||
baseDataValidator.reset().parameter("groupId").value(groupId).notNull().longGreaterThanZero();
|
baseDataValidator.reset().parameter("groupId").value(groupId).notNull().longGreaterThanZero();
|
||||||
/**
|
|
||||||
* these validations should be carried out based on Global
|
|
||||||
* configurations, commenting them for now
|
|
||||||
**/
|
|
||||||
|
|
||||||
/**
|
// if it is JLG loan that must have meeting details
|
||||||
* // if it is JLG loan then must have a meeting details
|
if (isMeetingMandatoryForJLGLoans) {
|
||||||
* (calendar) final String calendarIdParameterName =
|
final String calendarIdParameterName = "calendarId";
|
||||||
* "calendarId"; final Long calendarId =
|
final Long calendarId = this.fromApiJsonHelper.extractLongNamed(calendarIdParameterName, element);
|
||||||
* this.fromApiJsonHelper.extractLongNamed
|
baseDataValidator.reset().parameter(calendarIdParameterName).value(calendarId).notNull().integerGreaterThanZero();
|
||||||
* (calendarIdParameterName, element);
|
|
||||||
* baseDataValidator.reset().
|
// if it is JLG loan then must have a value for
|
||||||
* parameter(calendarIdParameterName).value
|
// syncDisbursement passed in
|
||||||
* (calendarId).notNull().integerGreaterThanZero();
|
String syncDisbursementParameterName = "syncDisbursementWithMeeting";
|
||||||
*
|
final Boolean syncDisbursement = this.fromApiJsonHelper.extractBooleanNamed(syncDisbursementParameterName, element);
|
||||||
* // if it is JLG loan then must have a syncDisbursement final
|
|
||||||
* String syncDisbursementParameterName =
|
if (syncDisbursement == null) {
|
||||||
* "syncDisbursementWithMeeting"; final Boolean syncDisbursement
|
baseDataValidator.reset().parameter(syncDisbursementParameterName).value(syncDisbursement)
|
||||||
* = this.fromApiJsonHelper.extractBooleanNamed(
|
.trueOrFalseRequired(false);
|
||||||
* syncDisbursementParameterName, element);
|
}
|
||||||
*
|
}
|
||||||
* if (syncDisbursement == null) {
|
|
||||||
* baseDataValidator.reset().parameter
|
|
||||||
* (syncDisbursementParameterName
|
|
||||||
* ).value(syncDisbursement).trueOrFalseRequired(false); }
|
|
||||||
**/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -291,12 +283,12 @@ public final class LoanApplicationCommandFromApiJsonHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final String createSiAtDisbursementParameterName = "createStandingInstructionAtDisbursement";
|
final String createSiAtDisbursementParameterName = "createStandingInstructionAtDisbursement";
|
||||||
if(this.fromApiJsonHelper.parameterExists(createSiAtDisbursementParameterName, element)) {
|
if (this.fromApiJsonHelper.parameterExists(createSiAtDisbursementParameterName, element)) {
|
||||||
final Boolean createStandingInstructionAtDisbursement = this.fromApiJsonHelper
|
final Boolean createStandingInstructionAtDisbursement = this.fromApiJsonHelper.extractBooleanNamed(
|
||||||
.extractBooleanNamed(createSiAtDisbursementParameterName, element);
|
createSiAtDisbursementParameterName, element);
|
||||||
final Long linkAccountId = this.fromApiJsonHelper.extractLongNamed(linkAccountIdParameterName, element);
|
final Long linkAccountId = this.fromApiJsonHelper.extractLongNamed(linkAccountIdParameterName, element);
|
||||||
|
|
||||||
if(createStandingInstructionAtDisbursement) {
|
if (createStandingInstructionAtDisbursement) {
|
||||||
baseDataValidator.reset().parameter(linkAccountIdParameterName).value(linkAccountId).notNull().longGreaterThanZero();
|
baseDataValidator.reset().parameter(linkAccountIdParameterName).value(linkAccountId).notNull().longGreaterThanZero();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-2
@@ -18,6 +18,7 @@ import org.mifosplatform.infrastructure.accountnumberformat.domain.AccountNumber
|
|||||||
import org.mifosplatform.infrastructure.accountnumberformat.domain.AccountNumberFormatRepositoryWrapper;
|
import org.mifosplatform.infrastructure.accountnumberformat.domain.AccountNumberFormatRepositoryWrapper;
|
||||||
import org.mifosplatform.infrastructure.accountnumberformat.domain.EntityAccountType;
|
import org.mifosplatform.infrastructure.accountnumberformat.domain.EntityAccountType;
|
||||||
import org.mifosplatform.infrastructure.codes.domain.CodeValue;
|
import org.mifosplatform.infrastructure.codes.domain.CodeValue;
|
||||||
|
import org.mifosplatform.infrastructure.configuration.domain.ConfigurationDomainService;
|
||||||
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
import org.mifosplatform.infrastructure.core.api.JsonCommand;
|
||||||
import org.mifosplatform.infrastructure.core.api.JsonQuery;
|
import org.mifosplatform.infrastructure.core.api.JsonQuery;
|
||||||
import org.mifosplatform.infrastructure.core.data.ApiParameterError;
|
import org.mifosplatform.infrastructure.core.data.ApiParameterError;
|
||||||
@@ -131,6 +132,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
private final LoanAccountDomainService loanAccountDomainService;
|
private final LoanAccountDomainService loanAccountDomainService;
|
||||||
private final AccountNumberFormatRepositoryWrapper accountNumberFormatRepository;
|
private final AccountNumberFormatRepositoryWrapper accountNumberFormatRepository;
|
||||||
private final BusinessEventNotifierService businessEventNotifierService;
|
private final BusinessEventNotifierService businessEventNotifierService;
|
||||||
|
private final ConfigurationDomainService configurationDomainService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public LoanApplicationWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityContext context, final FromJsonHelper fromJsonHelper,
|
public LoanApplicationWritePlatformServiceJpaRepositoryImpl(final PlatformSecurityContext context, final FromJsonHelper fromJsonHelper,
|
||||||
@@ -148,7 +150,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
final LoanRepaymentScheduleInstallmentRepository repaymentScheduleInstallmentRepository,
|
final LoanRepaymentScheduleInstallmentRepository repaymentScheduleInstallmentRepository,
|
||||||
final LoanReadPlatformService loanReadPlatformService, final LoanAccountDomainService loanAccountDomainService,
|
final LoanReadPlatformService loanReadPlatformService, final LoanAccountDomainService loanAccountDomainService,
|
||||||
final AccountNumberFormatRepositoryWrapper accountNumberFormatRepository,
|
final AccountNumberFormatRepositoryWrapper accountNumberFormatRepository,
|
||||||
final BusinessEventNotifierService businessEventNotifierService) {
|
final BusinessEventNotifierService businessEventNotifierService, final ConfigurationDomainService configurationDomainService) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.fromJsonHelper = fromJsonHelper;
|
this.fromJsonHelper = fromJsonHelper;
|
||||||
this.loanApplicationTransitionApiJsonValidator = loanApplicationTransitionApiJsonValidator;
|
this.loanApplicationTransitionApiJsonValidator = loanApplicationTransitionApiJsonValidator;
|
||||||
@@ -176,6 +178,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
this.loanAccountDomainService = loanAccountDomainService;
|
this.loanAccountDomainService = loanAccountDomainService;
|
||||||
this.accountNumberFormatRepository = accountNumberFormatRepository;
|
this.accountNumberFormatRepository = accountNumberFormatRepository;
|
||||||
this.businessEventNotifierService = businessEventNotifierService;
|
this.businessEventNotifierService = businessEventNotifierService;
|
||||||
|
this.configurationDomainService = configurationDomainService;
|
||||||
}
|
}
|
||||||
|
|
||||||
private LoanLifecycleStateMachine defaultLoanLifecycleStateMachine() {
|
private LoanLifecycleStateMachine defaultLoanLifecycleStateMachine() {
|
||||||
@@ -189,8 +192,9 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
final AppUser currentUser = getAppUserIfPresent();
|
final AppUser currentUser = getAppUserIfPresent();
|
||||||
|
boolean isMeetingMandatoryForJLGLoans = configurationDomainService.isMeetingMandatoryForJLGLoans();
|
||||||
|
|
||||||
this.fromApiJsonDeserializer.validateForCreate(command.json());
|
this.fromApiJsonDeserializer.validateForCreate(command.json(), isMeetingMandatoryForJLGLoans);
|
||||||
|
|
||||||
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
final List<ApiParameterError> dataValidationErrors = new ArrayList<>();
|
||||||
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loan");
|
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loan");
|
||||||
|
|||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
INSERT INTO c_configuration (`name`, `description`) VALUES ('meetings-mandatory-for-jlg-loans', 'Enforces all JLG loans to follow a meeting schedule belonging to parent group or Center');
|
||||||
Reference in New Issue
Block a user