use async_trait::async_trait;
use super::error::PolicyHistoryError;
use super::meta::PolicyVersionMeta;
use super::snapshot::PolicySnapshot;
#[async_trait]
pub trait PolicyHistoryStore: Send + Sync {
async fn save(&self, yaml: &str, applied_by: Option<&str>) -> Result<PolicyVersionMeta, PolicyHistoryError>;
async fn list(&self, limit: usize) -> Result<Vec<PolicyVersionMeta>, PolicyHistoryError>;
async fn get(&self, version_id: &str) -> Result<PolicySnapshot, PolicyHistoryError>;
async fn rollback(&self, version_id: &str) -> Result<PolicyVersionMeta, PolicyHistoryError>;
async fn diff(&self, version_a: &str, version_b: &str) -> Result<String, PolicyHistoryError>;
async fn prune(&self) -> Result<usize, PolicyHistoryError>;
}