Lane states
The seven states of a lane, what moves a lane from one to the next and what the system refuses.
A lane is in one state. A change that the state does not allow is refused with a 409 and a code, and nothing changes. Three states are entered by a request: idle, complete and out_of_service. The others follow from what the basket still needs.
| Status | Meaning |
|---|---|
idle | No basket. openBasket moves the lane to scanning. |
scanning | An open basket. addLine moves the lane to weight_pending, or to assistance_needed for an age-restricted item. startPayment moves it to payment. |
weight_pending | A line waits for its weight. recordWeight counts the line and returns the lane to scanning, or stops it in assistance_needed when the weight differs. |
assistance_needed | At least one intervention waits. When the last one is decided, the lane goes back to what the basket needs: weight_pending, payment or scanning. |
payment | recordPayment with approved moves the lane to complete. declined keeps it here; the third decline in a row stops it in assistance_needed. cancelPayment returns it to scanning. |
complete | The basket is paid and has its receipt number. releaseLane moves the lane to idle. |
out_of_service | Entered from any state by closeLane or by the first fault of a device. An open basket is voided. openLane leaves it, and only while no device is in fault. |
What the system refuses
| Request on a lane that is | Code | Why |
|---|---|---|
weight_pending | weight_pending | Another item and the payment wait until the weight of the last item is reported. |
assistance_needed | assistance_pending | The lane does nothing until an attendant decides. |
out_of_service | lane_out_of_service | The lane takes no basket and no payment. |
scanning | no_weight_expected | A weight arrives and no line waits for one. |
payment | wrong_state | An item cannot be added during payment. Cancel the payment first. |