Drop deductions of deleted intervention #322
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status quo
If an intervention is marked as deleted and therefore hidden for the user, its deductions are still substracted from the related ecoaccount's rest surface.
Solution
At the very moment an intervention is being deleted, it's deductions should be dropped completely from the database. In the end, the recalculation of the ecoaccount's
deductable_restshould be performed.Could we not simply keep the 'removed' deductions and recalculate without them?
No - if the deleted intervention would be recovered, the recalculation of
deductable_restshould be run again. At this moment, the ecoaccount balance could suddenly overflow into a negative area, since it already might be at 0 fordeductable_rest.If a once deleted intervention should be recovered, the old deductions should be gone to avoid conflicts with newer deductions from the account.
Merged in #323