Skip to content

BatchCreatedEvent

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

Creates a new Batch document for a job phase, initialising it with the job, work order, product, and phase keys. The new batch key is stored in the parent event's info for downstream reference.

Trigger

Triggered by: POST /event (universal event dispatcher)

Spawned as a child event by JobStartedEvent (initial batch) and by BatchCompletedEvent (continuation batch) in backend/api/events/production/.

Preconditions

  • Job exists with key info.job_key
  • Phase exists with key info.phase_key
  • Work order exists with key info.work_order_key

State Changes (Transaction)

Collections: Inherited from BaseProductionEvent.get_tx_collections()

  • Batch inserted with job_key, phase_key, work_order_key, product_key, and optional serial links

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 owning job
phase_keystrArangoDB key of the production phase
work_order_keystrArangoDB key of the work order
product_keystrArangoDB key of the product being produced
new_batch_serialslist[str] | NoneSerial keys to pre-associate with the new batch

None.

Source

BatchCreatedEvent on GitHub

Released under the Apache 2.0 License.