Implement step completion and stock monitoring (TC-10 to TC-12)

Summary

  • Added per-product-unit step progress records
  • Added FIFO selection for jobs that use one shared production-job barcode
  • Added a simulated foot-pedal button to the worker kiosk
  • Recorded completed production steps and completion timestamps
  • Deducted required parts from station inventory after each completed step
  • Displayed the next step immediately when it belongs to the same station
  • Calculated remaining material requirements across unfinished units and steps
  • Created station transfer requests when remaining production demand exceeds available station inventory
  • Prevented duplicate open transfer requests for the same job, station, and part
  • Displayed a material alert when a new transfer request is created

Revised Test Cases

TC-10 — Complete the current production step

When a worker scans an active production-job barcode, the system selects the lowest-numbered unfinished product unit using FIFO order.

When the worker presses the Complete Step (Simulated Foot Pedal) button:

  • The current step is marked Completed
  • A completion timestamp is recorded
  • The product unit is marked In Progress
  • The required part quantities for one product unit are deducted from the assigned station inventory
  • The next incomplete unit and step are determined

If the station does not contain enough material for the current step, completion is rejected and material is not deducted.

TC-11 — Display the next step at the same station

After a step is completed, if the next incomplete step for the FIFO product unit is assigned to the same station, the worker kiosk immediately displays:

  • The product-unit number
  • The next step number
  • The next instruction
  • The instruction photo reference
  • The required parts and quantities
  • The simulated foot-pedal button

TC-12 — Check remaining material after consumption

After material is consumed, the system calculates the quantity still required for all unfinished product units and steps at that station.

  • If station inventory is sufficient for the remaining work, no transfer request is created.
  • If remaining production demand exceeds station inventory, one pending transfer request is created.
  • The requested quantity equals the remaining requirement minus the available station quantity.
  • If an open request already exists for the same job, station, and part, another request is not created.
  • The worker kiosk displays a material alert when a request is created.

Verification

Automated test suite:

python -m pytest -v

Result:

12 passed

The complete regression suite covers TC-01 through TC-12.

Manual verification completed with Day 4 Workflow Test:

  • One shared job barcode selected Product Unit 1
  • The simulated foot pedal completed Step 1
  • Station 3 / Part A decreased from 1 to 0
  • Step 2 at Station 3 appeared immediately
  • A material alert appeared
  • One pending transfer request was created for Part A quantity 1
  • No unnecessary request was created when inventory was sufficient in the earlier FIFO test

Increment Scope

Final-unit completion, transition to another station, and overall job completion remain outside this increment and will be implemented with TC-13 to TC-15.

Merge request reports

Loading