stry_common/models/
wiki.rs

1//! Site wide and user wiki, allowing for history and notes on anything needed.
2
3use {crate::models::{Existing, core::Part}, chrono::{DateTime, Utc}};
4
5/// A wiki page and its related data.
6#[rustfmt::skip]
7#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
8#[derive(serde::Deserialize, serde::Serialize)]
9pub struct Page {
10    pub name: String,
11
12    pub parts: Vec<Existing<Part>>,
13
14    pub categories: Vec<Existing<Category>>,
15}
16
17/// A point in history for a page.
18#[rustfmt::skip]
19#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
20#[derive(serde::Deserialize, serde::Serialize)]
21pub struct PageRevision {
22    pub name: String,
23
24    pub parts: Vec<Existing<Part>>,
25
26    pub categories: Vec<Existing<Category>>,
27
28    pub modified: DateTime<Utc>,
29}
30
31/// A category that can be used to separate pages into groups.
32#[rustfmt::skip]
33#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
34#[derive(serde::Deserialize, serde::Serialize)]
35pub struct Category {
36    pub content: String,
37
38    pub description: String,
39}