//! Blog post model. use chrono::{DateTime, Utc}; use serde::Serialize; use sqlx::FromRow; use super::super::id_types::*; use super::super::validated_types::*; /// A blog post within a project. #[derive(Debug, Clone, FromRow, Serialize)] pub struct DbBlogPost { /// Database primary key. pub id: BlogPostId, /// Parent project ID. pub project_id: ProjectId, /// Author user ID. pub author_id: UserId, /// Post title. pub title: String, /// URL-safe slug unique per project. pub slug: Slug, /// Raw markdown content. pub body_markdown: String, /// Rendered HTML content. pub body_html: String, /// When the post was published (set on first publish, cleared on unpublish). pub published_at: Option>, /// When the post was created. pub created_at: DateTime, /// When the post was last modified. pub updated_at: DateTime, /// Scheduled publication time (post stays draft until this time, then the scheduler publishes it). pub publish_at: Option>, /// Linked MT discussion thread ID (None if not yet created or MT unavailable). pub mt_thread_id: Option, /// Whether this post should only be published on the web (skip email announcements). pub web_only: bool, /// Operator-only flag marking this post as the landing-page "Last shipped" /// line. Inert unless the post lives on the CHANGELOG_PROJECT_SLUG project. pub show_on_landing: bool, /// When a release announcement was sent (prevents re-announcement on unpublish/republish). pub release_announced_at: Option>, }