pub struct AuditLogEntry {
pub created_at: DateTime<Utc>,
pub event_type: EventKind,
pub id: Uuid,
pub payload: Value,
pub run_id: Option<Uuid>,
pub step_id: Option<Uuid>,
pub user_id: Option<Uuid>,
}Expand description
A persisted audit log entry capturing a domain event.
Each entry records the full event payload as JSON alongside denormalized contextual IDs for efficient filtering.
§Examples
use ironflow_store::entities::{AuditLogEntry, EventKind};
use uuid::Uuid;
use chrono::Utc;
use serde_json::json;
let entry = AuditLogEntry {
id: Uuid::now_v7(),
event_type: EventKind::RunStatusChanged,
payload: json!({"run_id": "..."}),
run_id: Some(Uuid::now_v7()),
step_id: None,
user_id: None,
created_at: Utc::now(),
};
assert_eq!(entry.event_type, EventKind::RunStatusChanged);JSON schema
{
"description": "A persisted audit log entry capturing a domain event.\n\nEach entry records the full event payload as JSON alongside\ndenormalized contextual IDs for efficient filtering.\n\n# Examples\n\n```\nuse ironflow_store::entities::{AuditLogEntry, EventKind};\nuse uuid::Uuid;\nuse chrono::Utc;\nuse serde_json::json;\n\nlet entry = AuditLogEntry {\n id: Uuid::now_v7(),\n event_type: EventKind::RunStatusChanged,\n payload: json!({\"run_id\": \"...\"}),\n run_id: Some(Uuid::now_v7()),\n step_id: None,\n user_id: None,\n created_at: Utc::now(),\n};\nassert_eq!(entry.event_type, EventKind::RunStatusChanged);\n```",
"type": "object",
"required": [
"created_at",
"event_type",
"id",
"payload"
],
"properties": {
"created_at": {
"description": "When the event was recorded.",
"type": "string",
"format": "date-time"
},
"event_type": {
"$ref": "#/components/schemas/EventKind"
},
"id": {
"description": "Unique entry ID (UUID v7).",
"type": "string",
"format": "uuid"
},
"payload": {
"description": "Full serialized event payload."
},
"run_id": {
"description": "Associated run ID, if the event is run-scoped.",
"type": [
"string",
"null"
],
"format": "uuid"
},
"step_id": {
"description": "Associated step ID, if the event is step-scoped.",
"type": [
"string",
"null"
],
"format": "uuid"
},
"user_id": {
"description": "Associated user ID, if the event is user-scoped.",
"type": [
"string",
"null"
],
"format": "uuid"
}
}
}
```ignore
</details>Fields§
§created_at: DateTime<Utc>When the event was recorded.
event_type: EventKind§id: UuidUnique entry ID (UUID v7).
payload: ValueFull serialized event payload.
run_id: Option<Uuid>Associated run ID, if the event is run-scoped.
step_id: Option<Uuid>Associated step ID, if the event is step-scoped.
user_id: Option<Uuid>Associated user ID, if the event is user-scoped.
Implementations§
Source§impl AuditLogEntry
impl AuditLogEntry
pub fn builder() -> AuditLogEntry
Trait Implementations§
Source§impl Clone for AuditLogEntry
impl Clone for AuditLogEntry
Source§impl Debug for AuditLogEntry
impl Debug for AuditLogEntry
Source§impl<'de> Deserialize<'de> for AuditLogEntry
impl<'de> Deserialize<'de> for AuditLogEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<AuditLogEntry> for AuditLogEntry
impl From<AuditLogEntry> for AuditLogEntry
Source§fn from(value: AuditLogEntry) -> Self
fn from(value: AuditLogEntry) -> Self
Converts to this type from the input type.
Source§impl Serialize for AuditLogEntry
impl Serialize for AuditLogEntry
Source§impl TryFrom<AuditLogEntry> for AuditLogEntry
impl TryFrom<AuditLogEntry> for AuditLogEntry
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: AuditLogEntry) -> Result<Self, ConversionError>
fn try_from(value: AuditLogEntry) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for AuditLogEntry
impl RefUnwindSafe for AuditLogEntry
impl Send for AuditLogEntry
impl Sync for AuditLogEntry
impl Unpin for AuditLogEntry
impl UnsafeUnpin for AuditLogEntry
impl UnwindSafe for AuditLogEntry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more