adamsaghy commented on code in PR #2569:
URL: https://github.com/apache/fineract/pull/2569#discussion_r963787263
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/delinquency/service/DelinquencyWritePlatformServiceImpl.java:
##########
@@ -148,7 +148,7 @@ public CommandProcessingResult deleteDelinquencyBucket(Long
delinquencyBucketId,
public CommandProcessingResult applyDelinquencyTagToLoan(Long loanId,
JsonCommand command) {
Map<String, Object> changes = new HashMap<>();
- final Loan loan =
this.loanRepository.findOneWithNotFoundDetection(loanId);
Review Comment:
As the loan is not used as a reference, rather doing actions on it, we
should use the "this.loanRepository.findOneWithNotFoundDetection"
Using the "getReferenceById" is only useful if we dont need to fetch the
loan entirely (fields and associations), but only we need the reference of it.
Example:
`new LoanTransaction(loan, transactionDate,....)`
In the example we dont need to fetch the loan, only the reference which can
be used to associate the loan entity with the loan transaction entity.
--
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]