adamsaghy commented on code in PR #4700:
URL: https://github.com/apache/fineract/pull/4700#discussion_r2109757410
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/mapper/LoanAccountingBridgeMapper.java:
##########
@@ -73,7 +76,9 @@ public List<AccountingBridgeDataDTO>
deriveAccountingBridgeDataForChargeOff(fina
public AccountingBridgeDataDTO deriveAccountingBridgeData(final String
currencyCode, final List<Long> existingTransactionIds,
final List<Long> existingReversedTransactionIds, final boolean
isAccountTransfer, final Loan loan) {
final List<AccountingBridgeLoanTransactionDTO> newLoanTransactions =
new ArrayList<>();
- for (final LoanTransaction transaction : loan.getLoanTransactions()) {
+
+ // TODO Probably we should not fetch all transactions here
+ for (final LoanTransaction transaction :
loanTransactionRepository.findByLoan(loan)) {
Review Comment:
The plan was to avoid fetching all the loan transactions but here this
happens anyway... can we rework this and make sure we only fetch the loan
transactions that are absolutely necessary? Also we dont need loan transaction
entities, rather `AccountingBridgeLoanTransactionDTO`, we can use the
repository to fetch transaction data into such DTOs (see Projections!)
You can see below the conditions that can be used to filter!
--
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]