use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ScheduledSync {
    pub id: i32,
    pub name: String,
    pub schedule_type: String,
    pub schedule_config: serde_json::Value,
    pub job_type: String,
    pub sync_direction: String,
    pub is_active: bool,
    pub last_run: Option<String>,
    pub next_run: Option<String>,
}

#[derive(Debug, Deserialize)]
pub struct ScheduledSyncCreate {
    pub name: String,
    pub schedule_type: String,
    pub schedule_config: serde_json::Value,
    pub job_type: String,
    pub sync_direction: String,
    pub plesk_server_id: Option<i32>,
    pub sap_server_id: Option<i32>,
}

#[derive(Debug, Deserialize)]
pub struct ScheduledSyncUpdate {
    #[serde(default)]
    pub name: Option<String>,
    #[serde(default)]
    pub schedule_type: Option<String>,
    #[serde(default)]
    pub schedule_config: Option<serde_json::Value>,
    #[serde(default)]
    pub is_active: Option<bool>,
}
