budaidev commented on code in PR #6585:
URL: https://github.com/apache/fineract/pull/6585#discussion_r4323272371
##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/contracttermination/LoanContractTerminationServiceImpl.java:
##########
@@ -128,39 +160,33 @@ public CommandProcessingResult
applyContractTermination(final JsonCommand comman
.build();
}
- public CommandProcessingResult undoContractTermination(final JsonCommand
command) {
+ private CommandProcessingResult undoTermination(final JsonCommand command,
final TerminationKind kind) {
final Long loanId = command.getLoanId();
-
- loanTransactionValidator.validateContractTerminationUndo(command,
loanId);
-
final Loan loan = loanAssembler.assembleFrom(loanId);
- final LoanTransaction contractTerminationTransaction =
loan.findContractTerminationTransaction();
+ final LoanTransaction termination = loan.getLoanTransaction(t ->
t.isNotReversed() && kind.transactionType().equals(t.getTypeOf()));
Review Comment:
Done. TerminationKind now carries the finder
(Loan::findContractTerminationTransaction /
Loan::findLoanWithdrawalTransaction), so apply, undo and validation look the
transaction up the same way.
--
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]