google/peoplemath

Cannot remove assignment to a person with negative availability if it would leave them fully allocated

amdw opened this issue · 0 comments

amdw commented

If you reduce the amount of available time a person has below the total amount they have allocated to objectives, then their free time goes negative.

In that state, it's impossible to reduce or remove their assignment to an objective if that assignment is exactly equal to their deficit. For example, if someone has -1 person week free, and they have an assignment of 1 person week to an objective, then it's impossible to remove that assignment in order to restore them to zero.

The problem happens because of the recent change to this code:

If unallocated is equal to -currentAssignment, then this condition fails, and the person doesn't show up in the assignment dialog.

A person should always show up in the assignment dialog if they have an existing assignment to the objective.