ayushcodes27 commented on code in PR #204:
URL: 
https://github.com/apache/fineract-consumer-facing/pull/204#discussion_r4294573803


##########
consumer/src/main/java/org/apache/fineract/consumer/transfers/command/service/TransfersCommandServiceImpl.java:
##########
@@ -213,6 +219,20 @@ private void requireDestinationAllowed(Jwt jwt, Long 
userId, Long toAccountId, b
         }
     }
 
+    private void requireWithinOutstanding(Jwt jwt, Long loanId, BigDecimal 
amount) {
+        LoanAccountQueryData loan = loansQueryService.getLoan(jwt, loanId);
+        if (loan == null || !loan.isActive()) {
+            throw new TransferLoanNotActiveException();
+        }
+        BigDecimal outstanding = loan.getTotalOutstanding();
+        if (outstanding == null || outstanding.signum() <= 0) {
+            throw new TransferLoanNotActiveException();
+        }
+        if (amount.compareTo(outstanding) > 0) {

Review Comment:
   Resolved: switched the cap from totalOutstanding to Fineract's prepayLoan 
template payoff amount via TransferFineractClient.getLoanPayoff, with unit test 
coverage for boundary equality and overpayment rejection



-- 
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]

Reply via email to