use chrono::{DateTime, NaiveDate, Utc};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use utoipa::ToSchema;
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq, Eq)]
#[serde(rename_all = "lowercase")]
pub enum ConsentType {
DataProcessing,
DataSharing,
Marketing,
Research,
EmergencyAccess,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq, Eq)]
#[serde(rename_all = "lowercase")]
pub enum ConsentStatus {
Active,
Revoked,
Expired,
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
pub struct Consent {
pub id: Uuid,
pub person_id: Uuid,
pub consent_type: ConsentType,
pub status: ConsentStatus,
pub granted_date: NaiveDate,
pub expiry_date: Option<NaiveDate>,
pub revoked_date: Option<NaiveDate>,
pub purpose: Option<String>,
pub method: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}