Skip to main content

The move (move_execute) used by putaway

Putaway never moves stock. The move does. Both putaway (PUTW03) and the manual move (INVMOV04) call the same API method, move_execute. The difference is one field: putaway sends pending_move_in_id and source_type = putaway. The manual move sends source_type = manual and no reservation.

Diagram 1. What move_execute does, in order​

What this shows: the steps of MovementService::execute for a putaway, from the first check to the last write. The first refusal ends the move and rolls everything back.

Reading notes:

  • Steps 5, 6, 8 and 9 can end in a refusal, or in a request for approval, or in a redirect. Diagram 2 shows which.
  • Step 5: an inventory hold on a location is judged by its hold code (enforce, overridable). The move does not read location.status or location.loc_flag. A location with status Hold is kept out of putaway suggestions by the candidate query, but a scan of such a location does not fail in the move unless an inventory hold sits on it.
  • Step 8 reads location.max_weight_capacity and max_cube_capacity, and the zone limits when the pallet changes zone. It does not read the step switches, max_qty_capacity, stack_limit, or pallet size.
  • Step 10: approvals come from the checks (holds, and soft rules on the reserved location). The operator's override_grant_id is redeemed and must cover every pair. A pair the move did not ask for is refused as an unknown subject.
  • Step 12: after the pallet moved, the reservation becomes Consumed (landed in the reserved location) or Cancelled. For oversize goods the other positions of the section get LocBlocked holds, and the previous section is released.

Where it comes from​

StepSource
1crates/libs/wms-inventory/src/movement/service.rs:211-212, crates/libs/wms-inventory/src/movement/validation.rs:37-135
2crates/libs/wms-inventory/src/movement/service.rs:215-232, crates/libs/wms-inventory/src/movement/directed.rs:300-346
3crates/libs/wms-inventory/src/movement/service.rs:233-247, crates/libs/wms-inventory/src/movement/validation.rs:202-220, :494-545
4crates/libs/wms-inventory/src/movement/service.rs:254-300
5crates/libs/wms-inventory/src/movement/service.rs:306-360, crates/libs/wms-inventory/src/movement/validation.rs:548-655
6crates/libs/wms-inventory/src/movement/service.rs:361-366, crates/libs/wms-inventory/src/movement/validation.rs:135-148, :222-235
7crates/libs/wms-inventory/src/movement/service.rs:367-388, crates/libs/wms-inventory/src/movement/validation.rs:346-395
8crates/libs/wms-inventory/src/movement/service.rs:390-394, crates/libs/wms-inventory/src/movement/validation.rs:920-1048
9crates/libs/wms-inventory/src/movement/service.rs:545-560, crates/libs/wms-inventory/src/movement/validation.rs:788-835
10crates/libs/wms-inventory/src/movement/service.rs:572-592, crates/libs/wms-inventory/src/movement/validation.rs:657-700, crates/libs/wms-inventory/src/movement/override_grant.rs
11crates/libs/wms-inventory/src/movement/service.rs:640-690, crates/libs/wms-inventory/src/adapters/postgres/for_moving_container.rs:53-150
12crates/libs/wms-inventory/src/movement/service.rs:755-906, crates/libs/wms-inventory/src/putaway/section_holds.rs:101-200
Transaction, key claim, rollback hookcrates/libs/wms-inventory/src/movement/commands/move_command.rs:51-104, crates/libs/wms-inventory/src/service/container/commands/pipeline.rs

Diagram 2. Refusal, approval or redirect?​

What this shows: what happens to a failed check, depending on whether the move is directed (it carries a reservation) and whether the operator scanned the reserved location.

Reading notes:

  • A hold approval pair (codes 80, 83, 84) can be granted in any move, directed or not. The pair 85 exists only in a directed move on the reserved location.
  • If the operator scans another location, the reservation is not used for leniency. At the end it is set to Cancelled.
  • The redirect picks the nearest location by straight-line distance from the refused one (x_coord, y_coord, z_coord), with the refused location excluded. It runs the same policy and the same checks.
  • Supervisor grants are single use and expire in minutes. They are bound to the operator, the pairs and the authorizing supervisor. For a move pair the supervisor needs one of the override roles (Supervisor, Manager, Admin).

Where it comes from​

ItemSource
Leniency only for the reserved locationcrates/libs/wms-inventory/src/movement/directed.rs:435-482
Classification of each failurecrates/libs/wms-inventory/src/movement/directed.rs:187-261
Redirect naming of the replacementcrates/libs/wms-inventory/src/movement/commands/move_command.rs:132-296, crates/libs/wms-inventory/src/putaway/mod.rs:358-415
Grants: mint, bind, expirecrates/services/app-server/src/web/rpcs/override_grant_rpc.rs:97-125, crates/libs/wms-inventory/src/movement/override_grant.rs
Destination types per source typecrates/libs/wms-inventory/src/movement/validation.rs:135-200

Manual move and putaway side by side​

Putaway (PUTW03)Manual move (INVMOV04)
source_typeputawaymanual
Reservation (pending_move_in_id)yesno
Destination typesCase, Pick, SpeedPick, Pnd, Sort, Otherthe same six
Capacity, mixing or type problemapproval (85) on the reserved locationrefusal
Blocked, missing or inactive destinationredirecterror
Quantitywhole pallet (qty empty, recursive true)whole position, or a partial quantity

Where it comes from​

ItemSource
Putaway payloadcrates/libs/wms-lib-sql/sql/rf-screens/093_uc_putaway.sql:273-285
Manual move payloadcrates/libs/wms-lib-sql/sql/rf-screens/091_uc_inv_move.sql:504-520
Destination types per source typecrates/libs/wms-inventory/src/movement/validation.rs:135-200

Not confirmed by code​

  • MoveError::DestinationInactive is part of the redirect rule, but no code raises it today. A location cannot be refused as "inactive" by the move.
  • The comment above move_execute says the supervisor grant is deferred (crates/services/app-server/src/web/rpcs/move_command_rpc.rs:38-71). The code now has the grant (override_grant_rpc.rs, movement/override_grant.rs) and PUTW_OVR uses it. The comment is out of date.