Be sure to check if you actually want to use a calculated attribute or not. There's some documentation about that here:
You can either do this with a calculated attribute, or by updating an attribute each time you assign a bed.
I'm going to make some assumptions about your domain model since you did not include it in your question.
If you were to make the AvailableBeds a calculated attribute, you could make a flow that looks something like this:
Edit: changed the order of my answer to highlight the importance of deciding whether or not you want to use a calculated attribute
I wouldn’t use a calculated attribute as each time you retrieve this entity it will recalculate. The next easiest thing would be to use a after commit Event Handler that calculates the required values.