Skip to main content

made_core/entities/
audit_fact.rs

1use time::OffsetDateTime;
2
3use crate::entities::CeremonyEvent;
4use crate::value_objects::{
5    AuditActor, CeremonyId, CeremonyName, CeremonyVersion, EventId, TraceContext,
6};
7
8/// Everything an audit record states before the journal assigns its position.
9///
10/// The event is the fact itself, payload included. The type a record
11/// names is derived from it (`fact.event.event_type()`) rather than
12/// declared beside it, so a fact cannot claim one thing and carry
13/// another.
14#[derive(Debug, Clone, PartialEq, Eq)]
15pub struct AuditFact {
16    pub event_id: EventId,
17    pub event: CeremonyEvent,
18    pub ceremony_id: CeremonyId,
19    pub definition_name: CeremonyName,
20    pub definition_version: CeremonyVersion,
21    pub occurred_at: OffsetDateTime,
22    pub actor: AuditActor,
23    pub correlation_id: Option<EventId>,
24    pub causation_id: Option<EventId>,
25    pub trace: Option<TraceContext>,
26}