Skip to main content
Version: v1.0.0(int)

W098: Complete in-transit transfer

Records the inbound leg of an in-transit transfer, closing the pair. Triggered from the Materials Inventory Transfers page, "Mark complete" on an in-transit row.

Steps

  1. Confirm the transfer is in transit. Call MaterialsInventory.listEntriesByRef(ref). The outbound TRANSFER row must exist; no matching RECEIVE row may exist yet.

  2. Write the paired RECEIVE row. Call MaterialsInventory.recordReceipt({ materialId, locationId: to_location_id (from outbound), quantity, ref, eventDate, notes }). Reuses the same ref as the outbound row so the two are paired. The RECEIVE row does not need to_location_id; the destination is encoded as its location_id. Quantity is positive per the L1 schema invariant; RECEIVE means inflow.

Returns

The inbound RECEIVE row.

Business rules

  • Destination comes from the outbound row. The TRANSFER row's to_location_id is the truth; the completion does not let the user pick a different destination.
  • No undo in v1. Completing a transfer is treated as the goods physically arriving. If reversal is needed later, future tooling can write a corresponding REVERSE_RECEIVE row alongside.

Errors

  • NotFoundError. The ref is unknown.
  • InvalidTransitionError. The transfer has already been completed (a RECEIVE row with this ref already exists).