Saifulhuq01 opened a new pull request, #5465:
URL: https://github.com/apache/fineract/pull/5465
## Description
This PR implements **Phase 1** of the "Force Debit" functionality for
Savings Accounts, allowing financial institutions to enforce withdrawals even
if the account has insufficient funds, up to a globally configurable limit.
This implementation aligns with the community consensus (mailing list
discussion Feb 5-6) to use a dedicated command force-withdrawal rather than
overloading the standard withdrawal API.
## Changes Implemented
1. **New API Command:** Introduced ?command=force-withdrawal for Savings
Accounts.
2. **Global Configuration:** Added two new configurations:
* allow-force-withdrawal-on-savings-account (Boolean)
* force-withdrawal-on-savings-account-limit (Long/Monetary limit)
3. **Permissioning:** Added granular permission
FORCE_WITHDRAWAL_SAVINGSACCOUNT.
* *Note:* Defaulted to Super User (Role 1) via Liquibase migration.
4. **Database Migration:** Added Liquibase changelog
0220_force_withdrawal_configs.xml (using safe sequencing to avoid ID
collisions).
5. **Integration Testing:** Added SavingsAccountForceWithdrawalTest.java
with robust teardown logic to prevent test pollution in the CI environment.
## Validation
- [x] **CI/CD:** All Integration Tests (MariaDB, PostgreSQL, MySQL) are
passing.
- [x] **Functional:** Verified that standard withdrawals fail on low
balance, while force withdrawals succeed (within the configured limit).
- [x] **Clean Up:** Verified that global configs are reset after tests to
maintain environment stability.
## Next Steps (Phase 2)
As discussed, @Ayush will pick up Phase 2 to handle:
- Reason Codes
- Notification triggers
- UI integration
## JIRA
https://issues.apache.org/jira/browse/FINERACT-2471
--
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]