|
The insufficient balance on savings error is incorrectly triggering in some occasions. We have seen this happen in cases whereby deposits into savings were reversed after other transactions were posted. This will then briefly bring an account into a negative balance state (even if transactions posted on same day!), as shown in attached screenshot.
Because the system ID's of the transactions (on same date) are out of order this situation is created whereby the balance hits a negative at that day, while it should not be that case.
Because internally the methods for withdrawal are also called by other parts of the system this is causing issues in more areas such as:
-
Disbursing loans with charges paid from savings (the charge payment is done as an account transfer)
-
Account transfers withdrawing from savings.
Further analysing this issue in the code, I think the method used to validate if the savings balance becomes negative as a result of a transaction, is insufficiently covering the use cases normally occurring in the system.
The code looks at all transactions that are in the savings account at the time of making the withdrawal (whether directly or via transfer/loan disbursement), and whenever the balance hits negative at any point in time it will throw an error. Even if this event occurred in the past and the actual balance at the time of the withdrawal is positive.
|