Skip to content

CountStartedEvent

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

Registers a new count record within a session and locks the relevant is_in_position records so no concurrent movements can alter the position while counting is in progress.

Trigger

Triggered by: POST /event (universal event dispatcher)

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

Preconditions

  • InventoryCountSession exists with key info.inventory_count_session_key

State Changes (Transaction)

Collections: is_in_position, inventory_count_record, Product, InventoryCountSession

  • inventory_count_record inserted with session key and position/product info
  • is_in_position records for the position locked (locked → true, locked_by → session_key)
  • Product snapshot captured for the count record

Side Effects (post_processing)

Inherits post_processing() from BaseInventoryEvent:

  • Publishes to progress.notification.inventory

InfoModel Fields

FieldTypeDescription
count_keystrArangoDB key for the new count record
inventory_count_session_keystrKey of the parent count session
assignment_keystr | NoneKey of the assignment this count belongs to
inventory_keyslist[str] | NoneSpecific is_in_position keys to lock
product_keystr | NoneProduct being counted
position_keystr | NonePosition being counted

None.

Source

CountStartedEvent on GitHub

Released under the Apache 2.0 License.