add validation for repayment strategy for loan application flows, add data update patch for heavensfamily data.

This commit is contained in:
Keith Woodlock
2012-09-12 11:40:56 +01:00
parent ae2279fce0
commit 99b53995ea
2 changed files with 15 additions and 0 deletions
@@ -3,6 +3,7 @@ package org.mifosng.platform.loan.service;
import java.util.ArrayList;
import java.util.List;
import org.mifosng.platform.DataValidatorBuilder;
import org.mifosng.platform.api.commands.CalculateLoanScheduleCommand;
import org.mifosng.platform.api.commands.LoanChargeCommand;
import org.mifosng.platform.api.commands.LoanApplicationCommand;
@@ -39,6 +40,11 @@ public class LoanApplicationCommandValidator {
}
}
if (command.getTransactionProcessingStrategyId() == null) {
DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors).resource("loan");
baseDataValidator.reset().parameter("transactionProcessingStrategyId").value(command.getTransactionProcessingStrategyId()).notNull().inMinMaxRange(2, 2);
}
try {
// reuse calculate loan schedule validator for now
CalculateLoanScheduleCommand calculateLoanScheduleCommand = this.command.toCalculateLoanScheduleCommand();