Files
stl/lib/src/category.rs
2021-04-22 15:13:28 +02:00

28 lines
737 B
Rust

use chrono::{DateTime, Local};
use serde::{Deserialize, Serialize};
use uuid::Uuid;
pub type CategoryKey = Uuid;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Category {
/// The name of the category
pub name: String,
/// The description of the category
pub description: Option<String>,
/// 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<DateTime<Local>>,
/// The parent category of this category
/// If none, the category has no parent
pub parent: Option<CategoryKey>,
/// Whether the item has been "deleted", e.g. it shoudn't be shown in the view
pub deleted: bool,
}