Skip to content

ActiveBatchChangedEvent

EventType: ACTIVE_BATCH_CHANGEDDomain: production Broker subject: progress.notification.production

Updates the active batch quantity on a job and optionally sets the serial keys associated with that batch. Used when the operator adjusts how many units are in the current batch before completing it.

Trigger

Triggered by: POST /event (universal event dispatcher)

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

Preconditions

  • Job exists with key info.job_key
  • Job has an active batch

State Changes (Transaction)

Collections: Inherited from BaseProductionEvent.get_tx_collections()

  • Job updated: active_batch_qt → info.new_active_batch_qt
  • Batch updated: qt_total → info.new_active_batch_qt, batch_serials set if provided

Side Effects (post_processing)

Inherits post_processing() from BaseProductionEvent:

  • Updates job.last_online
  • Recalculates work order status
  • Publishes to progress.notification.production

InfoModel Fields

FieldTypeDescription
job_keystrArangoDB key of the job
new_active_batch_qtintNew quantity for the active batch
batch_serialslist[str] | NoneSerial keys to associate with the updated batch

None.

Source

ActiveBatchChangedEvent on GitHub

Released under the Apache 2.0 License.