Update value in map based on Enum.member? check

The solution was solved in another topic: