Unit Status Workflow
Unit Lifecycle States (UnitStatus)
Every unit in the BrokerOS inventory matrix transitions through four well-defined lifecycle states:
Transaction-Safe Double-Booking Prevention
To eliminate race conditions when multiple agents attempt to claim a unit simultaneously, BrokerOS executes status updates inside atomic database transactions (prisma.$transaction):
- Atomic Evaluation: The system locks the unit record and checks its current status before applying modifications.
- Conflict Rejection: If another agent has already transitioned the unit from
AVAILABLEtoBLOCKEDorSOLD, the incoming request is immediately rejected. - Real-Time Visual State: The interactive inventory grid updates unit status markers immediately across web and mobile interfaces, alerting the entire sales floor that a unit is held.