1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! The [`AuditLogStore`] trait -- async storage abstraction for audit log entries.
//!
//! Persists every domain event for compliance and post-mortem debugging.
use crate;
use crateStoreFuture;
/// Async storage abstraction for audit log entries.
///
/// All methods return a [`StoreFuture`] (boxed future) for object safety,
/// allowing the store to be used as `Arc<dyn AuditLogStore>`.
///
/// # Examples
///
/// ```no_run
/// use ironflow_store::prelude::*;
/// use serde_json::json;
/// use uuid::Uuid;
///
/// # async fn example() -> Result<(), ironflow_store::error::StoreError> {
/// let store = InMemoryStore::new();
///
/// let entry = store.append_audit_log(NewAuditLogEntry {
/// event_type: EventKind::RunCreated,
/// payload: json!({"run_id": "abc"}),
/// run_id: Some(Uuid::now_v7()),
/// step_id: None,
/// user_id: None,
/// }).await?;
///
/// assert_eq!(entry.event_type, EventKind::RunCreated);
/// # Ok(())
/// # }
/// ```