adamsaghy commented on code in PR #5019:
URL: https://github.com/apache/fineract/pull/5019#discussion_r2387918092
##########
fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanTransactionRelationReadService.java:
##########
@@ -76,4 +81,41 @@ public List<LoanTransactionRelation>
fetchLoanTransactionRelationFrom(final List
return queryToExecute.getResultList();
}
+ /**
+ * Determines if a transaction relation should be included in the API
response.
+ *
+ * Filters out REPLAYED relations that are created during internal
processing (e.g., accrual activities) but
+ * includes REPLAYED relations that are part of legitimate business
operations (e.g., reverse-replay scenarios from
+ * backdated transactions).
+ *
+ * @param relation
+ * the transaction relation to evaluate
+ * @return true if the relation should be included, false otherwise
+ */
+ private boolean shouldIncludeRelation(LoanTransactionRelation relation) {
+ LoanTransactionRelationTypeEnum relationType =
relation.getRelationType();
+
+ // Always include non-REPLAYED relations
+ if (relationType != LoanTransactionRelationTypeEnum.REPLAYED) {
+ return true;
+ }
+
+ // For REPLAYED relations, include only those that are part of
legitimate business operations
Review Comment:
why do we need this? i am not fully understand the reasoning behind. Having
external id or not has nothing to do with reverse-replay scenarios...
--
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]