Ralph Hopman created FINERACT-2836:
--------------------------------------
Summary: Isolate Due Savings Charge Failures
Key: FINERACT-2836
URL: https://issues.apache.org/jira/browse/FINERACT-2836
Project: Apache Fineract
Issue Type: Bug
Components: Charges, Job Scheduler, Savings
Affects Versions: 1.15.0, 1.14.0
Reporter: Ralph Hopman
Assignee: Ralph Hopman
Fix For: 1.16.0
*As a* financial institution operator,
*I want* the Pay Due Savings Charges job to process each due savings charge
independently,
*so that* a charge that cannot be collected does not prevent valid charges on
other savings accounts from being collected.
h2. Background
The Pay Due Savings Charges job processes all due savings-account charges in a
single job execution.
When a charge cannot be collected, for example because its savings account has
insufficient funds, the job records the error and continues processing the
remaining charges. However, the job ultimately fails and rolls back the shared
transaction. As a result, charge payments that otherwise succeed during the
same execution are not retained.
This causes funded accounts to remain overdue because unrelated accounts cannot
pay their charges. Repeated executions continue encountering the same failing
accounts and may prevent all due savings charges from being collected.
h2. Acceptance Criteria
* Each due savings charge is processed in an independent transaction.
* A failure while processing one savings charge does not roll back charge
payments that succeed for other savings accounts.
* The job continues processing all eligible due charges after an individual
charge fails.
* A successfully collected charge creates the expected savings-account charge
payment transaction.
* A successfully collected charge reduces the savings account balance by the
collected amount.
* A successfully collected recurring charge advances to its next due date.
* A failed charge remains outstanding and does not advance to its next due date.
* An account with insufficient funds continues to receive the existing
insufficient-balance result.
* The job does not allow an account to exceed its configured overdraft rules as
part of this change.
* When one or more charges fail, the job history reports the execution as
failed or partially failed while preserving all independently committed
successful collections.
* The job error details identify each charge or savings account that fails and
include the corresponding failure reason.
* Re-running the job does not collect an installment that was already committed
successfully by an earlier execution.
* Automated tests cover an execution containing at least one funded account and
one account with insufficient funds.
* The automated test verifies that the funded account's charge remains paid
after the job reports the insufficient-funds failure for the other account.
* Existing all-success behavior remains unchanged.
h2. Notes
* Allowing scheduled charges to create or increase an overdraft is outside the
scope of this story.
* The atomic boundary is one due savings-charge record. Processing one record
must either commit completely or leave that record unchanged.
* Existing recurring-charge catch-up behavior remains unchanged by this story.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)