pub struct ErpEvent {
pub idempotency_key: String,
pub event_type: ErpEventType,
pub process_id: ProcessId,
pub tenant_id: TenantId,
pub conversation_id: ConversationId,
pub causation_id: EventId,
pub pid: u32,
pub payload_schema: Option<String>,
pub payload: Value,
pub occurred_at: OffsetDateTime,
}Expand description
A structured process event delivered from mako-engine to the ERP.
The payload is always a BO4E-typed JSON object — the ERP adapter never receives raw EDIFACT bytes or EDIFACT format-version identifiers.
On the wire (via WebhookErpAdapter) this struct is serialised as a
CloudEvents 1.0 structured-mode JSON envelope
with Content-Type: application/cloudevents+json. The BO4E payload lives
in the CloudEvents data field; payload_schema maps to dataschema;
event_type maps to the type attribute via ErpEventType::cloud_event_type.
§Idempotency
idempotency_key maps to the CloudEvents id attribute and is also sent
as X-Idempotency-Key for ERP middleware that keys on headers. The ERP
must persist this key and return HTTP 200 OK for duplicate deliveries.
Fields§
§idempotency_key: StringStable dedup key — store in the ERP to reject duplicate deliveries.
Derived from the outbox message_id; stable across retries.
event_type: ErpEventTypeSemantic classification of this event.
process_id: ProcessIdThe mako process that generated this event.
tenant_id: TenantIdTenant (operator GLN) that owns this process.
conversation_id: ConversationIdBDEW business conversation identifier.
causation_id: EventIdThe mako domain event that directly caused this ERP notification.
pid: u32Prüfidentifikator of the process.
payload_schema: Option<String>BO4E JSON Schema URL that validates payload.
Examples:
"https://raw.githubusercontent.com/BO4E/BO4E-Schemas/v202501.0.0/src/bo4e_schemas/bo/Marktlokation.json""https://raw.githubusercontent.com/BO4E/BO4E-Schemas/v202501.0.0/src/bo4e_schemas/bo/Messlokation.json"
None for events where no primary BO4E object is applicable
(e.g. ContrlReceived).
payload: ValueBO4E-typed payload.
Deserialise using the ERP’s own BO4E library. Raw EDIFACT structures
are never exposed here. null when no payload is applicable.
occurred_at: OffsetDateTimeWall-clock time when the domain event was persisted.