use crate::wami::gdpr::WamiAuditEvent;
use async_trait::async_trait;
use chrono::{DateTime, Utc};
use wami_core::error::Result;
#[derive(Debug, Clone, Default)]
pub struct AuditFilter {
pub actor: Option<String>,
pub action_prefix: Option<String>,
pub resource: Option<String>,
pub from: Option<DateTime<Utc>>,
pub to: Option<DateTime<Utc>>,
pub limit: Option<usize>,
pub offset: Option<usize>,
}
#[async_trait]
pub trait AuditStore: Send + Sync {
async fn record_event(&mut self, event: WamiAuditEvent) -> Result<()>;
async fn get_event(&self, event_id: &str) -> Result<Option<WamiAuditEvent>>;
async fn query_events(
&self,
tenant_id: &str,
filter: &AuditFilter,
) -> Result<Vec<WamiAuditEvent>>;
async fn count_events(&self, tenant_id: &str, filter: &AuditFilter) -> Result<u64>;
async fn purge_events_before(&mut self, tenant_id: &str, before: DateTime<Utc>) -> Result<u64>;
}