adamsaghy commented on code in PR #2897:
URL: https://github.com/apache/fineract/pull/2897#discussion_r1073541622
##########
fineract-provider/src/main/java/org/apache/fineract/cob/loan/StayedLockedLoansTasklet.java:
##########
@@ -35,14 +40,24 @@ public class StayedLockedLoansTasklet implements Tasklet {
private final LoanAccountLockRepository loanAccountLockRepository;
private final BusinessEventNotifierService businessEventNotifierService;
+ private final LoanRepository loanRepository;
@Override
public RepeatStatus execute(StepContribution contribution, ChunkContext
chunkContext) throws Exception {
List<LoanAccountLock> loanAccountLocks =
loanAccountLockRepository.findAll();
if (!loanAccountLocks.isEmpty()) {
List<Long> loanIds =
loanAccountLocks.stream().map(LoanAccountLock::getLoanId).toList();
- businessEventNotifierService.notifyPostBusinessEvent(new
LoanAccountsStayedLockedBusinessEvent(loanIds));
+ businessEventNotifierService.notifyPostBusinessEvent(new
LoanAccountsStayedLockedBusinessEvent(buildLoanAccountData(loanIds)));
}
return RepeatStatus.FINISHED;
}
+
+ private LoanAccountsStayedLockedBusinessEvent.Data
buildLoanAccountData(List<Long> loanIds) {
+ List<LoanIdAndExternalIdAndAccountNo> stayedLockedLoanAccounts =
loanRepository.findAllStayedLockedByLoanIds(loanIds);
Review Comment:
Please make sure the loanIds array is not too big / request. Postgres has
some restrictions on the parameter size.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]