Lab Desk Claim Overwrites the Existing Occupant
Level 2 · node · Concurrency · Missing conditional state transition
Scenario
A shared laboratory control desk must have only one occupant at a time. The operator UI expects a conflict response when someone tries to claim an occupied desk. The service checks only whether the desk exists, while the repository overwrites the current owner on a second claim. Trace the state transition across the service and repository.
Requirements
- First claim on a free desk succeeds. - Another user's claim on an occupied desk returns a conflict. - Rejected claims do not change the current owner. - Claims for different desks are independent. - After a valid release, a new user may claim the desk.
Acceptance criteria
- The first claim of an available desk succeeds
- A second claim of an occupied desk is rejected
- A rejected claim leaves the existing occupant unchanged
- Claims for different desks remain independent
- Another user can claim a desk after its release