Drop deductions of deleted intervention #322

Closed
opened 2023-03-30 14:56:49 +02:00 by mpeltriaux · 1 comment
Owner

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_rest should 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_rest should be run again. At this moment, the ecoaccount balance could suddenly overflow into a negative area, since it already might be at 0 for deductable_rest.

If a once deleted intervention should be recovered, the old deductions should be gone to avoid conflicts with newer deductions from the account.

# 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_rest` should 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_rest` should be run again. At this moment, the ecoaccount balance could suddenly overflow into a negative area, since it already might be at 0 for `deductable_rest`. If a once deleted intervention should be recovered, the old deductions should be gone to avoid conflicts with newer deductions from the account.
mpeltriaux added the
bug
enhancement
labels 2023-03-30 14:56:49 +02:00
mpeltriaux self-assigned this 2023-03-30 14:56:49 +02:00
Author
Owner

Merged in #323

# Merged in #323
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: IT-Naturschutz/konova#322
No description provided.