Skip to content

MovementReversedEvent

EventType: MOVEMENT_REVERSEDDomain: inventory Broker subject: progress.notification.inventory

Creates an inverse movement to undo a previously completed movement, restoring the inventory positions to their pre-movement state. Optionally reverses only a partial quantity.

Trigger

Triggered by: POST /event (universal event dispatcher)

Dispatched via POST /event in backend/api/endpoints/traceability.py with event_type: MOVEMENT_REVERSED.

Preconditions

  • Original movement exists with key info.original_movement_key
  • Original movement status is COMPLETED

State Changes (Transaction)

Collections: Inherited from BaseInventoryEvent.get_tx_collections()

  • movement inverse record inserted with type: REVERSAL
  • is_in_position quantities updated to undo the original movement's delta
  • Original movement reversed_by field updated

Side Effects (post_processing)

Inherits post_processing() from BaseInventoryEvent:

  • Publishes to progress.notification.inventory

InfoModel Fields

FieldTypeDescription
original_movement_keystrKey of the movement to reverse
inverse_movement_keystr | NoneKey to assign to the reversal movement
quantity_to_revertfloat | NonePartial quantity to revert (null = full reversal)
reasonstr | NoneReason for the reversal

None.

Source

MovementReversedEvent on GitHub

Released under the Apache 2.0 License.