Abed Ahmed created FINERACT-2614:
------------------------------------

             Summary: Refactor SavingsAccount balance validation methods : 
correct semantic naming and extract shared validation logic
                 Key: FINERACT-2614
                 URL: https://issues.apache.org/jira/browse/FINERACT-2614
             Project: Apache Fineract
          Issue Type: Bug
          Components: Savings
            Reporter: Abed Ahmed


3 methods in the SavingsAccount implement account balance validation logic with 
significant overlap and inconsistent naming semantic.

Current implementations include:
 * validateAccountBalanceDoesNotBecomeNegative ( 2 overloaded methods )
 * validateAccountBalanceDoesNotBecomeNegativeMinimal

Although these methods suggest a strict non negative balance invariant, the 
actual business logic allows controlled exceptions (force withdrawal scenario 
based on configuration).

This creates a semantic mismatch between method names and actual behavior, 
which may lead to incorrect assumptions during maintenance or future 
development.

*Proposed direction :* 
 * Improve method naming to reflect constraints ( i suggest  
validateAccountBalanceConstraints instead of 
validateAccountBalanceDoesNotBecomeNegative )
 * Extract common validation logic



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to