pub(self) use chrono::{DateTime, Local}; pub(self) use serde_derive::{Deserialize, Serialize}; pub(self) use uuid::Uuid; /// Stuff in the default namespace pub mod global {} pub mod trees { pub mod categories { use super::super::*; pub const NAME: &str = "CATEGORIES"; pub type K = Uuid; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct V { /// The name of the category pub name: String, /// The description of the category pub description: Option, /// The HTML color of the category in the rendered view pub color: String, /// If the session is not active, this will be None pub started: Option>, /// The parent category of this category /// If none, the category has no parent pub parent: Option, // FIXME: this field is currently not used /// Whether the item has been "deleted", e.g. it shoudn't be shown in the view pub deleted: bool, } } pub mod sessions { use super::super::*; pub const NAME: &str = "SESSIONS"; pub type K = Uuid; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct V { /// The UUID of the category to which this session belongs pub category: trees::categories::K, /// The time when this session was started pub started: DateTime, /// The time when this session was ended pub ended: DateTime, // FIXME: this field is currently not used /// Whether the item has been "deleted", e.g. it shoudn't be shown in the view pub deleted: bool, } } }