pub struct KnowledgeArticle {Show 29 fields
pub id: Uuid,
pub number: u64,
pub title: String,
pub article_type: KnowledgeType,
pub status: KnowledgeStatus,
pub domain: Option<String>,
pub domain_id: Option<Uuid>,
pub workspace_id: Option<Uuid>,
pub summary: String,
pub content: String,
pub authors: Vec<String>,
pub reviewers: Vec<String>,
pub last_reviewed: Option<DateTime<Utc>>,
pub reviewed_at: Option<DateTime<Utc>>,
pub published_at: Option<DateTime<Utc>>,
pub archived_at: Option<DateTime<Utc>>,
pub review_frequency: Option<ReviewFrequency>,
pub audience: Vec<String>,
pub skill_level: Option<SkillLevel>,
pub linked_assets: Vec<AssetLink>,
pub linked_decisions: Vec<Uuid>,
pub related_decisions: Vec<Uuid>,
pub related_articles: Vec<RelatedArticle>,
pub prerequisites: Vec<Uuid>,
pub see_also: Vec<Uuid>,
pub tags: Vec<Tag>,
pub notes: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Knowledge Base Article
Represents a knowledge article that can be categorized by domain, type, and audience.
Fields§
§id: UuidUnique identifier for the article
number: u64Article number - can be sequential (1, 2, 3) or timestamp-based (YYMMDDHHmm format) Timestamp format prevents merge conflicts in distributed Git workflows
title: StringArticle title
article_type: KnowledgeTypeType of article
status: KnowledgeStatusPublication status
domain: Option<String>Domain this article belongs to (optional, string name)
domain_id: Option<Uuid>Domain UUID reference (optional)
workspace_id: Option<Uuid>Workspace UUID reference (optional)
summary: StringBrief summary of the article
content: StringFull article content in Markdown
Article authors (emails or names) - changed from single author to array
reviewers: Vec<String>List of reviewers
last_reviewed: Option<DateTime<Utc>>Date of last review (legacy field name)
reviewed_at: Option<DateTime<Utc>>Last review timestamp (camelCase alias)
published_at: Option<DateTime<Utc>>When the article was published
archived_at: Option<DateTime<Utc>>When the article was archived
review_frequency: Option<ReviewFrequency>How often the article should be reviewed
audience: Vec<String>Target audience for the article
skill_level: Option<SkillLevel>Required skill level
linked_assets: Vec<AssetLink>Assets referenced by this article
linked_decisions: Vec<Uuid>UUIDs of related decisions (legacy field)
IDs of related decision records
Related articles (detailed info)
prerequisites: Vec<Uuid>IDs of prerequisite articles (must read first)
see_also: Vec<Uuid>IDs of ‘See Also’ articles for further reading
Tags for categorization
notes: Option<String>Additional notes
created_at: DateTime<Utc>Creation timestamp
updated_at: DateTime<Utc>Last modification timestamp
Implementations§
Source§impl KnowledgeArticle
impl KnowledgeArticle
Sourcepub fn new(
number: u64,
title: impl Into<String>,
summary: impl Into<String>,
content: impl Into<String>,
author: impl Into<String>,
) -> Self
pub fn new( number: u64, title: impl Into<String>, summary: impl Into<String>, content: impl Into<String>, author: impl Into<String>, ) -> Self
Create a new knowledge article with required fields
Sourcepub fn new_with_timestamp(
title: impl Into<String>,
summary: impl Into<String>,
content: impl Into<String>,
author: impl Into<String>,
) -> Self
pub fn new_with_timestamp( title: impl Into<String>, summary: impl Into<String>, content: impl Into<String>, author: impl Into<String>, ) -> Self
Create a new knowledge article with a timestamp-based number (YYMMDDHHmm format) This format prevents merge conflicts in distributed Git workflows
Sourcepub fn generate_timestamp_number(dt: &DateTime<Utc>) -> u64
pub fn generate_timestamp_number(dt: &DateTime<Utc>) -> u64
Generate a timestamp-based article number in YYMMDDHHmm format
Sourcepub fn generate_id(number: u64) -> Uuid
pub fn generate_id(number: u64) -> Uuid
Generate a deterministic UUID for an article based on its number
Sourcepub fn is_timestamp_number(&self) -> bool
pub fn is_timestamp_number(&self) -> bool
Check if the article number is timestamp-based (YYMMDDHHmm format - 10 digits)
Sourcepub fn formatted_number(&self) -> String
pub fn formatted_number(&self) -> String
Format the article number for display Returns “KB-0001” for sequential or “KB-2601101234” for timestamp-based
Add an author
Sourcepub fn with_domain_id(self, domain_id: Uuid) -> Self
pub fn with_domain_id(self, domain_id: Uuid) -> Self
Set the domain ID
Sourcepub fn with_workspace_id(self, workspace_id: Uuid) -> Self
pub fn with_workspace_id(self, workspace_id: Uuid) -> Self
Set the workspace ID
Sourcepub fn with_type(self, article_type: KnowledgeType) -> Self
pub fn with_type(self, article_type: KnowledgeType) -> Self
Set the article type
Sourcepub fn with_status(self, status: KnowledgeStatus) -> Self
pub fn with_status(self, status: KnowledgeStatus) -> Self
Set the article status
Sourcepub fn with_domain(self, domain: impl Into<String>) -> Self
pub fn with_domain(self, domain: impl Into<String>) -> Self
Set the domain
Sourcepub fn add_reviewer(self, reviewer: impl Into<String>) -> Self
pub fn add_reviewer(self, reviewer: impl Into<String>) -> Self
Add a reviewer
Sourcepub fn with_review_frequency(self, frequency: ReviewFrequency) -> Self
pub fn with_review_frequency(self, frequency: ReviewFrequency) -> Self
Set review frequency
Sourcepub fn add_audience(self, audience: impl Into<String>) -> Self
pub fn add_audience(self, audience: impl Into<String>) -> Self
Add an audience
Sourcepub fn with_skill_level(self, level: SkillLevel) -> Self
pub fn with_skill_level(self, level: SkillLevel) -> Self
Set skill level
Sourcepub fn add_asset_link(self, link: AssetLink) -> Self
pub fn add_asset_link(self, link: AssetLink) -> Self
Add an asset link
Sourcepub fn link_decision(self, decision_id: Uuid) -> Self
pub fn link_decision(self, decision_id: Uuid) -> Self
Link to a decision
Add a related article
Add a related decision
Sourcepub fn add_prerequisite(self, article_id: Uuid) -> Self
pub fn add_prerequisite(self, article_id: Uuid) -> Self
Add a prerequisite article
Sourcepub fn add_see_also(self, article_id: Uuid) -> Self
pub fn add_see_also(self, article_id: Uuid) -> Self
Add a “see also” article reference
Sourcepub fn with_published_at(self, published_at: DateTime<Utc>) -> Self
pub fn with_published_at(self, published_at: DateTime<Utc>) -> Self
Set the published timestamp
Sourcepub fn with_archived_at(self, archived_at: DateTime<Utc>) -> Self
pub fn with_archived_at(self, archived_at: DateTime<Utc>) -> Self
Set the archived timestamp
Sourcepub fn mark_reviewed(&mut self)
pub fn mark_reviewed(&mut self)
Mark the article as reviewed
Sourcepub fn filename(&self, workspace_name: &str) -> String
pub fn filename(&self, workspace_name: &str) -> String
Generate the YAML filename for this article
Sourcepub fn markdown_filename(&self) -> String
pub fn markdown_filename(&self) -> String
Generate the Markdown filename for this article
Trait Implementations§
Source§impl Clone for KnowledgeArticle
impl Clone for KnowledgeArticle
Source§fn clone(&self) -> KnowledgeArticle
fn clone(&self) -> KnowledgeArticle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more