You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Abed Ahmed (Jira)" <ji...@apache.org> on 2026/05/21 19:01:00 UTC

[jira] [Commented] (FINERACT-2614) Refactor SavingsAccount balance validation methods : correct semantic naming and extract shared validation logic

    [ https://issues.apache.org/jira/browse/FINERACT-2614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18082669#comment-18082669 ] 

Abed Ahmed commented on FINERACT-2614:
--------------------------------------

Hello, l would like to take this issue.

> 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
>            Priority: Minor
>
> 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)