Menu

Episode 01 · Shipping desk

The Order That Wouldn’t Ship

The carrier leaves at 5 p.m. The label for order 1842 is already printed, but the shipping desk can’t release the order. Three workstations hold the clues.

Dispatch order#1842
Dock cutoff
17:00
Release status
On hold

Investigate the order

Open one clue at each workstation, then decide what will release the order.

Green screen

Shipping inquiry
Order
1842
Shipping label
PRINTED
Release status
HOLD
Open hold detail

Allocation incomplete

At least one line still has units waiting to be allocated. The shipping desk blocks release until every line is fully allocated.

Db2 for i

Allocation inquiry
SELECT line_no, qty_ordered, qty_allocated,
       qty_ordered - qty_allocated AS balance
FROM order_lines
WHERE order_id = 1842
ORDER BY line_no
Run the query
Allocation by order line
LineOrderedAllocatedBalance
01 Mounting brackets660
02 Hydraulic seals1284

Line 02 contains hydraulic seals. It needs 12 units and has 8 allocated.

Node.js API

Shipping status endpoint
GET /orders/1842/shipping-status
Send the request

200 OK

{
  "orderId": 1842,
  "status": "HOLD",
  "reason": "INCOMPLETE_ALLOCATION",
  "shortages": [
    {
      "line": 2,
      "unitsShort": 4
    }
  ]
}

The status request succeeded. The warehouse app still sees a hold in the response body.

Browser simulation with fictional order data.

Read the debrief

Four more units clear the hold.

Once the remaining 4 hydraulic seals are allocated to line 02, both lines will be fully allocated. That clears the allocation hold so the order can move to packing.

Green screen
The operator can see that the label is printed and release is blocked.
Db2 for i
The query shows the affected line and exactly how many units it needs.
Node.js API
The response gives the client both a business status and a reason it can display. HTTP 200 confirms the status lookup succeeded.

When you modernize this workflow, test the same order through every interface. With eight of twelve units allocated, each interface should report a hold. At twelve, each should show that the allocation hold cleared.

Show the sample SQL for ACS Run SQL Scripts

The statement defines its own two sample rows and returns their allocation balances.

WITH order_lines (order_id, line_no, qty_ordered, qty_allocated) AS (
    VALUES (1842, 1, 6, 6),
           (1842, 2, 12, 8)
)
SELECT line_no, qty_ordered, qty_allocated,
       qty_ordered - qty_allocated AS balance
FROM order_lines
WHERE order_id = 1842
ORDER BY line_no;