rrpawar96 commented on code in PR #2436:
URL: https://github.com/apache/fineract/pull/2436#discussion_r940096982


##########
fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/domain/SavingsAccount.java:
##########
@@ -1573,21 +1576,36 @@ public void 
validateAccountBalanceDoesNotBecomeNegative(final String transaction
                         throw new 
PlatformApiDataValidationException(dataValidationErrors);
                     }
                 }
-
             }
             lastSavingsDate = transaction.transactionLocalDate();
-
         }
 
-        BigDecimal withdrawalFee = null;
-        BigDecimal transactionAmount = null;
         if (isOverdraft()) {
             if (runningBalance.minus(minRequiredBalance).isLessThanZero()) {
-                throw new 
InsufficientAccountBalanceException("transactionAmount", getAccountBalance(), 
withdrawalFee, transactionAmount);
+                overdraftLimitExceededException("transactionAmount", 
getAccountBalance(), transactionAmount);
+            }
+        }
+    }
+
+    public void validateAccountBalanceDoesNotViolateOverdraft(final 
List<SavingsAccountTransaction> savingsAccountTransaction,
+            final BigDecimal amountPaid) {
+        if (savingsAccountTransaction != null) {
+            SavingsAccountTransaction savingsAccountTransactionFirst = 
savingsAccountTransaction.get(0);

Review Comment:
   @adamsaghy, The account balance history on the basis of the past dates is 
saved in only one table i.e. "m_savings_account_transaction 
(SavingsAccountTransaction)" in the "running account balance" field and there 
is no field as "account balance" in SavingsAccountTransaction 
(m_savings_account_transaction table). Although the "account balance" field is 
in another table "m_savings_account" that keeps the update of the latest 
balance of the account and not of the past date (history)



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