FINERACT-2418: add originator during the loan application
This commit is contained in:
+8
@@ -129,6 +129,7 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
||||
private final LoanAccrualsProcessingService loanAccrualsProcessingService;
|
||||
private final LoanDownPaymentTransactionValidator loanDownPaymentTransactionValidator;
|
||||
private final LoanScheduleService loanScheduleService;
|
||||
private final LoanOriginatorLinkingService loanOriginatorLinkingService;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
@@ -166,6 +167,13 @@ public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements Loa
|
||||
// Check mandatory datatable entries were created
|
||||
this.entityDatatableChecksWritePlatformService.runTheCheckForProduct(loan.getId(), EntityTables.LOAN.getName(),
|
||||
StatusEnum.CREATE.getValue(), EntityTables.LOAN.getForeignKeyColumnNameOnDatatable(), loan.productId());
|
||||
// Process originators if provided
|
||||
if (command.parameterExists(LoanApiConstants.ORIGINATORS_PARAM)) {
|
||||
final JsonArray originatorsArray = command.arrayOfParameterNamed(LoanApiConstants.ORIGINATORS_PARAM);
|
||||
if (originatorsArray != null && !originatorsArray.isEmpty()) {
|
||||
this.loanOriginatorLinkingService.processOriginatorsForLoanApplication(loan.getId(), originatorsArray);
|
||||
}
|
||||
}
|
||||
// Trigger business event
|
||||
businessEventNotifierService.notifyPostBusinessEvent(new LoanCreatedBusinessEvent(loan));
|
||||
// Building response
|
||||
|
||||
+4
-2
@@ -150,6 +150,7 @@ import org.apache.fineract.portfolio.loanaccount.service.LoanDownPaymentHandlerS
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanJournalEntryPoster;
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanMaximumAmountCalculator;
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanOfficerService;
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanOriginatorLinkingService;
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformService;
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanReadPlatformServiceImpl;
|
||||
import org.apache.fineract.portfolio.loanaccount.service.LoanRefundService;
|
||||
@@ -230,13 +231,14 @@ public class LoanAccountConfiguration {
|
||||
EntityDatatableChecksWritePlatformService entityDatatableChecksWritePlatformService, GLIMAccountInfoRepository glimRepository,
|
||||
LoanRepository loanRepository, GSIMReadPlatformService gsimReadPlatformService,
|
||||
LoanLifecycleStateMachine loanLifecycleStateMachine, LoanAccrualsProcessingService loanAccrualsProcessingService,
|
||||
LoanDownPaymentTransactionValidator loanDownPaymentTransactionValidator, LoanScheduleService loanScheduleService) {
|
||||
LoanDownPaymentTransactionValidator loanDownPaymentTransactionValidator, LoanScheduleService loanScheduleService,
|
||||
LoanOriginatorLinkingService loanOriginatorLinkingService) {
|
||||
return new LoanApplicationWritePlatformServiceJpaRepositoryImpl(context, loanApplicationTransitionValidator,
|
||||
loanApplicationValidator, loanRepositoryWrapper, noteRepository, loanAssembler, calendarRepository,
|
||||
calendarInstanceRepository, savingsAccountRepository, accountAssociationsRepository, businessEventNotifierService,
|
||||
loanScheduleAssembler, loanUtilService, calendarReadPlatformService, entityDatatableChecksWritePlatformService,
|
||||
glimRepository, loanRepository, gsimReadPlatformService, loanLifecycleStateMachine, loanAccrualsProcessingService,
|
||||
loanDownPaymentTransactionValidator, loanScheduleService);
|
||||
loanDownPaymentTransactionValidator, loanScheduleService, loanOriginatorLinkingService);
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
Reference in New Issue
Block a user