pub struct AuditContext {
pub message_type: Option<String>,
pub release_code: Option<String>,
pub pid: Option<u32>,
pub sender_eic: Option<String>,
pub receiver_eic: Option<String>,
pub message_ref: Option<String>,
pub process_id: Option<String>,
pub tenant_id: Option<String>,
pub correlation_id: Option<String>,
pub timestamp: OffsetDateTime,
}Expand description
Structured audit context attached to every dead-letter event.
All fields are Option because they are only partially known at rejection
time (e.g. pid is not available for a parse failure before the PID is
decoded). Callers fill in as many fields as they have.
These fields map to §22 MessZV audit-log requirements for AS4 message rejection events:
| Field | §22 MessZV requirement |
|---|---|
message_type | Nachrichtentyp (UTILMD, MSCONS, APERAK, …) |
release_code | Releasekennung (S2.1, G1.1, 2.4c, …) |
pid | Prüfidentifikator |
sender_eic | GLN des Absenders |
receiver_eic | GLN des Empfängers |
message_ref | UNH-Referenz |
process_id | Geschäftsvorfallkennung |
tenant_id | Mandant |
correlation_id | AS4 ConversationId or similar |
timestamp | Zeitstempel des Eingangs (German local time) |
Fields§
§message_type: Option<String>EDIFACT message type (e.g. "UTILMD", "MSCONS", "APERAK").
release_code: Option<String>BDEW release code (e.g. "S2.1", "G1.1", "2.4c").
pid: Option<u32>BDEW Prüfidentifikator numeric code.
sender_eic: Option<String>GLN of the AS4 sender.
receiver_eic: Option<String>GLN of the AS4 receiver.
message_ref: Option<String>UNH message reference (interchange + message ref).
process_id: Option<String>Internal process / workflow stream ID.
tenant_id: Option<String>Tenant identifier (Mandant).
correlation_id: Option<String>AS4 ConversationId or engine correlation key.
timestamp: OffsetDateTimeTimestamp of message receipt, in German local time (CET/CEST).
Implementations§
Source§impl AuditContext
impl AuditContext
Sourcepub fn now() -> Self
pub fn now() -> Self
Create an AuditContext with only a timestamp, all other fields None.
Use builder-style setters to fill in known fields:
use mako_engine::dead_letter::AuditContext;
let ctx = AuditContext::now()
.with_message_type("UTILMD")
.with_pid(55001)
.with_sender_eic("4012345000023");Sourcepub fn with_message_type(self, mt: impl Into<String>) -> Self
pub fn with_message_type(self, mt: impl Into<String>) -> Self
Set the message type.
Sourcepub fn with_release_code(self, rc: impl Into<String>) -> Self
pub fn with_release_code(self, rc: impl Into<String>) -> Self
Set the BDEW release code.
Sourcepub fn with_sender_eic(self, eic: impl Into<String>) -> Self
pub fn with_sender_eic(self, eic: impl Into<String>) -> Self
Set the sender GLN.
Sourcepub fn with_receiver_eic(self, eic: impl Into<String>) -> Self
pub fn with_receiver_eic(self, eic: impl Into<String>) -> Self
Set the receiver GLN.
Sourcepub fn with_message_ref(self, r: impl Into<String>) -> Self
pub fn with_message_ref(self, r: impl Into<String>) -> Self
Set the UNH message reference.
Sourcepub fn with_process_id(self, id: impl Into<String>) -> Self
pub fn with_process_id(self, id: impl Into<String>) -> Self
Set the internal process / stream ID.
Sourcepub fn with_tenant_id(self, id: impl Into<String>) -> Self
pub fn with_tenant_id(self, id: impl Into<String>) -> Self
Set the tenant identifier.
Sourcepub fn with_correlation_id(self, id: impl Into<String>) -> Self
pub fn with_correlation_id(self, id: impl Into<String>) -> Self
Set the AS4 correlation / conversation ID.
Trait Implementations§
Source§impl Clone for AuditContext
impl Clone for AuditContext
Source§fn clone(&self) -> AuditContext
fn clone(&self) -> AuditContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more