This commit is contained in:
2024-04-16 21:46:44 +02:00
parent 5c11d5d091
commit 8a0401989c
8 changed files with 255 additions and 170 deletions

View File

@ -6,6 +6,7 @@ pub(self) use uuid::Uuid;
pub mod global {}
pub mod trees {
// ------- time tracking --------
pub mod category {
use super::super::*;
@ -55,9 +56,42 @@ pub mod trees {
/// The time when this session was ended
pub ended: DateTime<Local>,
// FIXME: this field is currently not used
/// Whether the item has been "deleted", e.g. it shoudn't be shown in the view
// FIXME: this field is currently not used
pub deleted: bool,
}
}
// -------------------------------------
// ------- daily tasks tracking --------
pub mod daily {
use super::super::*;
pub const NAME: &str = "DAILIES";
pub type K = Uuid;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub struct V {
/// The name of the task.
pub name: String,
// Task should be done every <unit_count> <unit>s, e.g. every 3 days or every 1 week.
pub unit_count: u32,
pub unit: TimeUnit,
/// Whether the item has been "deleted", e.g. it shoudn't be shown in the view
// FIXME: this field is currently not used
pub deleted: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub enum TimeUnit {
Day,
Week,
Month,
Year,
}
}
// -------------------------------------
}