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

saifulhuq commented on FINERACT-2471:
-------------------------------------

Hi Ashhar,

Thanks for the interest! I apologize for the confusion—I created this ticket 
specifically to track the implementation I am currently building based on the 
recent 'Negative Balance' architectural discussion on the mailing list.

*I am actively writing the code for this right now.* (I currently lack the JIRA 
permission to assign this ticket to myself, but consider it 'In Progress').

Once this Core PR is merged, there will be a *Phase 2* (integrating this with 
Standing Instructions) that will likely need contributors. I will ping you on a 
new ticket when that is ready!

Best, Mohammed

> Implement 'Force Debit' functionality for Savings Accounts with Configurable 
> Limits
> -----------------------------------------------------------------------------------
>
>                 Key: FINERACT-2471
>                 URL: https://issues.apache.org/jira/browse/FINERACT-2471
>             Project: Apache Fineract
>          Issue Type: New Feature
>            Reporter: saifulhuq
>            Priority: Major
>
> *Background:* Currently, Fineract rejects savings account withdrawals if the 
> balance is insufficient. Regulatory requirements (e.g., tax levies, 
> maintenance fees) often require a "Force Post" capability where the bank must 
> debit the account regardless of the balance, up to a certain risk limit.
> *Functional Specification:*
>  # *Global Configurations:*
>  * 
>  ** {{allow-force-debit-on-savings-account}} (Boolean): Global switch to 
> enable the feature.
>  * 
>  ** {{force-debit-on-savings-account-limit}} (Decimal): The maximum negative 
> balance allowed (e.g., -5000).
>  # *Permissions:*
>  * 
>  ** Introduce {{WITHDRAW_SAVINGSACCOUNT_FORCE_DEBIT}} and 
> {{{}WITHDRAW_SAVINGSACCOUNT_FORCE_DEBIT_CHECKER{}}}.
>  * 
>  ** Only users with this specific permission can trigger the force debit API.
>  # *API Implementation:*
>  * 
>  ** New Command: {{force-withdrawal}}
>  * 
>  ** Endpoint: {{POST 
> /savingsaccounts/\{accountId}/transactions?command=force-withdrawal}}
>  # *Validation Logic (Command Layer):*
>  * 
>  ** If {{allow-force-debit}} is FALSE -> Fail if insufficient funds (Standard 
> behavior).
>  * 
>  ** If {{allow-force-debit}} is TRUE:
>  * 
>  ** 
>  *** Check: {{{}Current Balance - Transaction Amount >= force-debit-limit{}}}.
>  * 
>  ** 
>  *** If limit is breached -> Throw 
> {{{}InsufficientAccountBalanceException{}}}.
>  * 
>  ** 
>  *** If within limit -> Process transaction and allow negative balance.
> *Technical Implementation Plan:*
>  * Modify {{GlobalConfigurationPropertyData}} to include new keys.
>  * Update {{SavingsAccountWritePlatformServiceJpaRepositoryImpl}} to handle 
> the new command.
>  * Implement validation logic ensuring GL consistency.
>  * Add Unit Tests covering:
>  * 
>  ** Limit breached (Fail).
>  * 
>  ** Limit respected (Pass).
>  * 
>  ** Permission denied (Fail).



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

Reply via email to