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


##########
consumer/src/main/java/org/apache/fineract/consumer/transfers/command/exception/TransferLoanOverpaymentException.java:
##########
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fineract.consumer.transfers.command.exception;
+
+import 
org.apache.fineract.consumer.infrastructure.exception.AbstractConsumerException;
+import org.springframework.http.HttpStatus;
+
+public class TransferLoanOverpaymentException extends 
AbstractConsumerException {
+
+    public static final String CODE = 
"error.msg.consumer.transfers.command.loan.overpayment";
+
+    public TransferLoanOverpaymentException() {
+        super(HttpStatus.UNPROCESSABLE_ENTITY, CODE, "Amount exceeds the 
loan's outstanding balance.");

Review Comment:
   Nit: the cap is now the `prepayLoan` payoff amount, not the outstanding 
balance, so "Amount exceeds the loan's payoff amount." would match the 
behaviour; the `en.json` copy has the same wording. Same idea for the 
`requireWithinOutstanding` method name (`requireWithinPayoff`) and its 
`outstanding` local in `TransfersCommandServiceImpl`.



##########
consumer/src/main/java/org/apache/fineract/consumer/transfers/command/service/TransfersCommandServiceImpl.java:
##########
@@ -213,6 +210,20 @@ private void requireDestinationAllowed(Jwt jwt, Long 
userId, Long toAccountId, b
         }
     }
 
+    private void requireWithinOutstanding(Long loanId, BigDecimal amount) {

Review Comment:
   Nit on the commit, not the code: the squashed message has no blank line 
after the first line, so git treats the whole 500-character block as the 
subject (`git log --oneline` shows all of it). Please put a blank line after 
`feat(transfers): validate loan overpayment and active status on repayments 
(#114)` when you rebase onto `main` after #211 merges.



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