use serde::{Deserialize, Serialize};
use serde_with::serde_as;
use uuid::Uuid;
use crate::utils::RodoStruct;
pub enum FIELDS {
TODO(uuid::Uuid),
WHEN(u64),
TILL(u64),
}
#[serde_as]
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct Recurring {
todo: Uuid,
when: u64,
till: u64,
active: bool,
}
impl Recurring {
pub fn new(todo: Uuid, when: u64, till: u64, active: bool) -> (Uuid, Self) {
(
Uuid::new_v4(),
Self {
todo,
when,
till,
active,
},
)
}
pub fn toogle_active(&mut self) {
todo!();
}
}
impl RodoStruct<FIELDS> for Recurring {
fn edit(&mut self, fields: FIELDS) {
match fields {
FIELDS::TODO(_) => todo!(),
FIELDS::WHEN(_) => todo!(),
FIELDS::TILL(_) => todo!(),
}
}
}