use crate::wami::gdpr::{
ConsentRecord, DataCategory, ErasureCertificate, RetentionPolicy, UserDataExport,
};
use async_trait::async_trait;
use wami_core::error::Result;
#[async_trait]
pub trait ConsentStore: Send + Sync {
async fn create_consent(&mut self, record: ConsentRecord) -> Result<ConsentRecord>;
async fn get_consent(&self, consent_id: &str) -> Result<Option<ConsentRecord>>;
async fn get_active_consent(
&self,
tenant_id: &str,
user_name: &str,
category: DataCategory,
) -> Result<Option<ConsentRecord>>;
async fn list_user_consents(
&self,
tenant_id: &str,
user_name: &str,
) -> Result<Vec<ConsentRecord>>;
async fn revoke_consent(&mut self, consent_id: &str) -> Result<()>;
async fn revoke_all_user_consents(&mut self, tenant_id: &str, user_name: &str) -> Result<u64>;
async fn create_erasure_certificate(
&mut self,
certificate: ErasureCertificate,
) -> Result<ErasureCertificate>;
async fn get_erasure_certificate(
&self,
certificate_id: &str,
) -> Result<Option<ErasureCertificate>>;
async fn list_user_erasure_certificates(
&self,
tenant_id: &str,
user_name: &str,
) -> Result<Vec<ErasureCertificate>>;
async fn export_user_data(
&self,
tenant_id: &str,
user_name: &str,
categories: &[DataCategory],
) -> Result<UserDataExport>;
async fn upsert_retention_policy(&mut self, policy: RetentionPolicy)
-> Result<RetentionPolicy>;
async fn get_retention_policy(
&self,
tenant_id: &str,
category: DataCategory,
) -> Result<Option<RetentionPolicy>>;
async fn list_retention_policies(&self, tenant_id: &str) -> Result<Vec<RetentionPolicy>>;
async fn delete_retention_policy(&mut self, policy_id: &str) -> Result<()>;
async fn enforce_retention(&mut self, tenant_id: &str) -> Result<u64>;
}