Fix parallel station processing and scan-controlled kiosk flow (TC-16 to TC-18)

Summary

  • Replaced global product-unit blocking with station-aware production queues
  • Allowed upstream stations to process later units while earlier units continue downstream
  • Preserved production-step order and upstream dependencies for every product unit
  • Applied the queue logic generically to all configured stations
  • Required a new barcode scan before displaying the next production instruction
  • Added clear handling instructions for passing unfinished units to the next station
  • Added Finished Goods instructions after the final production step

Revised Test Cases

TC-16 — Parallel station processing

A station selects the earliest product unit whose next incomplete production step belongs to that station.

This means:

  • An upstream station can process Unit 2 while Unit 1 is waiting at a downstream station
  • A downstream station cannot process a unit before its upstream steps are completed
  • Every product unit still follows its configured production-step order
  • The behaviour is based on configured station IDs rather than hard-coded station numbers

TC-16 is parametrized across:

  • ST-01 → ST-02
  • ST-02 → ST-03
  • ST-03 → ST-04
  • ST-04 → ST-05
  • ST-05 → ST-01

TC-17 — New scan required after step completion

After a worker completes a production step:

  • The completed step is recorded
  • The next eligible unit remains available in the backend
  • No new production instruction is displayed automatically
  • The kiosk returns to barcode-scanning mode
  • The next instruction appears only after another barcode scan

TC-18 — Finished unit handling

After a unit completes its final production step:

  • The kiosk displays Pass unit to Finished Goods Section.
  • If more product units remain, it displays Scan the Barcode for next unit.
  • No next production instruction is displayed automatically
  • When the final product unit is completed, the production-complete message is displayed without requesting another scan

Verification

Automated test suite:

python -m pytest -q

Result:

39 passed

Manual verification confirmed:

  • Station 3 processed Unit 2 while Unit 1 was waiting at Station 5
  • Station 5 remained dependent on completion of the upstream step
  • Completing a step returned the kiosk to its waiting screen
  • Instructions appeared only after a new barcode scan
  • Intermediate units displayed the next-station instruction
  • Finished units displayed the Finished Goods instruction
  • The final unit displayed the production-complete message

Merge request reports

Loading