use serde::{Deserialize, Serialize};
use typeshare::typeshare;
use crate::entities::{I64, ResourceTarget, ScheduleFormat};
#[typeshare]
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct Schedule {
pub target: ResourceTarget,
pub name: String,
pub schedule_format: ScheduleFormat,
pub schedule: String,
pub enabled: bool,
pub schedule_timezone: String,
pub last_run_at: Option<I64>,
pub next_scheduled_run: Option<I64>,
pub schedule_error: Option<String>,
pub tags: Vec<String>,
}