//! Backup settings types and DTOs. use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use uuid::Uuid; // ============ Backup Settings ============ /// User's backup configuration. #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct BackupSettings { /// Unique identifier. pub id: Uuid, /// Owner user ID. pub user_id: Uuid, /// Whether automatic backups are enabled. pub auto_backup_enabled: bool, /// Minutes between automatic backups. pub backup_frequency_minutes: i32, /// Maximum number of backups to retain. pub max_backups_to_keep: i32, /// When the last backup was created. pub last_backup_at: Option>, /// When settings were created. pub created_at: DateTime, /// When settings were last modified. pub updated_at: DateTime, } impl Default for BackupSettings { fn default() -> Self { Self { id: Uuid::new_v4(), user_id: Uuid::nil(), auto_backup_enabled: true, backup_frequency_minutes: 15, max_backups_to_keep: 1, last_backup_at: None, created_at: Utc::now(), updated_at: Utc::now(), } } } /// Data for creating or updating backup settings. #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct NewBackupSettings { /// Whether automatic backups are enabled. pub auto_backup_enabled: bool, /// Minutes between automatic backups. pub backup_frequency_minutes: i32, /// Maximum number of backups to retain. pub max_backups_to_keep: i32, }