use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
use sqlx::FromRow;
use uuid::Uuid;

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, FromRow)]
pub struct UserEmailNotifyModel {
    pub id: Uuid,
    pub user: Uuid,
    pub email: String,
    pub subject: String,
    pub template: String,
    pub body_text: Option<String>,
    pub body_html: Option<String>,
    pub notify_type: String,
    pub target_type: Option<String>,
    pub target_id: Option<Uuid>,
    pub metadata: Option<String>,
    pub status: String,
    pub provider_message_id: Option<String>,
    pub error: Option<String>,
    pub retry_count: i32,
    pub queued_at: DateTime<Utc>,
    pub sent_at: Option<DateTime<Utc>>,
    pub delivered_at: Option<DateTime<Utc>>,
    pub opened_at: Option<DateTime<Utc>>,
    pub clicked_at: Option<DateTime<Utc>>,
    pub failed_at: Option<DateTime<Utc>>,
}
