initial commit
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I4a6b498153eccd5407510dd541b7f4816a6a6964
This commit is contained in:
commit
6a73d11c4b
124 changed files with 34856 additions and 0 deletions
21
crates/pinakes-core/src/audit.rs
Normal file
21
crates/pinakes-core/src/audit.rs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
use uuid::Uuid;
|
||||
|
||||
use crate::error::Result;
|
||||
use crate::model::{AuditAction, AuditEntry, MediaId};
|
||||
use crate::storage::DynStorageBackend;
|
||||
|
||||
pub async fn record_action(
|
||||
storage: &DynStorageBackend,
|
||||
media_id: Option<MediaId>,
|
||||
action: AuditAction,
|
||||
details: Option<String>,
|
||||
) -> Result<()> {
|
||||
let entry = AuditEntry {
|
||||
id: Uuid::now_v7(),
|
||||
media_id,
|
||||
action,
|
||||
details,
|
||||
timestamp: chrono::Utc::now(),
|
||||
};
|
||||
storage.record_audit(&entry).await
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue