Adjusting to make the database better tested.

This commit is contained in:
2025-09-07 17:18:50 -04:00
parent 2895897e2d
commit 6bf4aa4bdb
9 changed files with 330 additions and 147 deletions

View File

@ -1,17 +1,15 @@
use chrono::NaiveDateTime;
use serde::{Deserialize, Serialize};
/// A type alias representing the path to a Markdown file.
/// This type is used to point to the location of the content of a `Tale`.
#[cfg(feature = "publisher")]
pub type Markdown = std::path::PathBuf;
/// A type alias representing the HTML content of the tale.
#[cfg(not(feature = "publisher"))]
pub type Markdown = String;
#[derive(Clone, PartialEq, Deserialize, Serialize)]
pub enum Story
{
File(std::path::PathBuf),
Html(String)
}
@ -19,7 +17,7 @@ pub type Markdown = String;
///
/// This includes details such as the title, author, summary, and
/// associated tags.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, Deserialize, Serialize)]
pub struct Lore
{
/// The title of the tale.
@ -44,13 +42,14 @@ pub struct Lore
/// Represents a post or story in the application.
#[derive(Deserialize, Serialize)]
#[derive(Clone, PartialEq, Deserialize, Serialize)]
pub struct Tale
{
/// Metadata of the post.
#[serde(flatten)]
pub lore: Lore,
/// The file path to the Markdown content of the tale.
pub story: Markdown
/// The story content for this tale..
#[serde(flatten)]
pub story: Story
}