pub struct Sketch {Show 20 fields
pub id: Uuid,
pub number: u64,
pub title: String,
pub sketch_type: SketchType,
pub status: SketchStatus,
pub domain: Option<String>,
pub domain_id: Option<Uuid>,
pub workspace_id: Option<Uuid>,
pub description: Option<String>,
pub excalidraw_data: String,
pub thumbnail_path: Option<String>,
pub authors: Vec<String>,
pub linked_assets: Vec<AssetLink>,
pub linked_decisions: Vec<Uuid>,
pub linked_knowledge: Vec<Uuid>,
pub related_sketches: Vec<Uuid>,
pub tags: Vec<Tag>,
pub notes: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Excalidraw Sketch
Represents an Excalidraw sketch that can be categorized by domain, type, and linked to other assets.
Fields§
§id: UuidUnique identifier for the sketch
number: u64Sketch number - can be sequential (1, 2, 3) or timestamp-based (YYMMDDHHmm format) Timestamp format prevents merge conflicts in distributed Git workflows
title: StringSketch title
sketch_type: SketchTypeType of sketch
status: SketchStatusPublication status
domain: Option<String>Domain this sketch belongs to (optional, string name)
domain_id: Option<Uuid>Domain UUID reference (optional)
workspace_id: Option<Uuid>Workspace UUID reference (optional)
description: Option<String>Brief description of the sketch
excalidraw_data: StringExcalidraw scene data as JSON string
thumbnail_path: Option<String>Optional path to PNG thumbnail (relative path, e.g., “thumbnails/sketch-0001.png”)
Sketch authors (emails or names)
linked_assets: Vec<AssetLink>Assets referenced by this sketch
linked_decisions: Vec<Uuid>UUIDs of related decisions
linked_knowledge: Vec<Uuid>UUIDs of related knowledge articles
UUIDs of related sketches
Tags for categorization
notes: Option<String>Additional notes
created_at: DateTime<Utc>Creation timestamp
updated_at: DateTime<Utc>Last modification timestamp
Implementations§
Source§impl Sketch
impl Sketch
Sourcepub fn new(
number: u64,
title: impl Into<String>,
excalidraw_data: impl Into<String>,
) -> Sketch
pub fn new( number: u64, title: impl Into<String>, excalidraw_data: impl Into<String>, ) -> Sketch
Create a new sketch with required fields
Sourcepub fn new_with_timestamp(
title: impl Into<String>,
excalidraw_data: impl Into<String>,
) -> Sketch
pub fn new_with_timestamp( title: impl Into<String>, excalidraw_data: impl Into<String>, ) -> Sketch
Create a new sketch 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 sketch number in YYMMDDHHmm format
Sourcepub fn generate_id(number: u64) -> Uuid
pub fn generate_id(number: u64) -> Uuid
Generate a deterministic UUID for a sketch based on its number
Sourcepub fn is_timestamp_number(&self) -> bool
pub fn is_timestamp_number(&self) -> bool
Check if the sketch number is timestamp-based (YYMMDDHHmm format - 10 digits)
Sourcepub fn formatted_number(&self) -> String
pub fn formatted_number(&self) -> String
Format the sketch number for display Returns “SKETCH-0001” for sequential or “SKETCH-2601101234” for timestamp-based
Sourcepub fn filename(&self, workspace_name: &str) -> String
pub fn filename(&self, workspace_name: &str) -> String
Generate the YAML filename for this sketch
Sourcepub fn thumbnail_filename(&self) -> String
pub fn thumbnail_filename(&self) -> String
Generate the thumbnail filename for this sketch
Sourcepub fn with_type(self, sketch_type: SketchType) -> Sketch
pub fn with_type(self, sketch_type: SketchType) -> Sketch
Set the sketch type
Sourcepub fn with_status(self, status: SketchStatus) -> Sketch
pub fn with_status(self, status: SketchStatus) -> Sketch
Set the sketch status
Sourcepub fn with_domain(self, domain: impl Into<String>) -> Sketch
pub fn with_domain(self, domain: impl Into<String>) -> Sketch
Set the domain
Sourcepub fn with_domain_id(self, domain_id: Uuid) -> Sketch
pub fn with_domain_id(self, domain_id: Uuid) -> Sketch
Set the domain ID
Sourcepub fn with_workspace_id(self, workspace_id: Uuid) -> Sketch
pub fn with_workspace_id(self, workspace_id: Uuid) -> Sketch
Set the workspace ID
Sourcepub fn with_description(self, description: impl Into<String>) -> Sketch
pub fn with_description(self, description: impl Into<String>) -> Sketch
Set the description
Sourcepub fn with_thumbnail(self, thumbnail_path: impl Into<String>) -> Sketch
pub fn with_thumbnail(self, thumbnail_path: impl Into<String>) -> Sketch
Set the thumbnail path
Add an author
Sourcepub fn add_asset_link(self, link: AssetLink) -> Sketch
pub fn add_asset_link(self, link: AssetLink) -> Sketch
Add an asset link
Sourcepub fn link_decision(self, decision_id: Uuid) -> Sketch
pub fn link_decision(self, decision_id: Uuid) -> Sketch
Link to a decision
Sourcepub fn link_knowledge(self, knowledge_id: Uuid) -> Sketch
pub fn link_knowledge(self, knowledge_id: Uuid) -> Sketch
Link to a knowledge article
Add a related sketch
Sourcepub fn with_notes(self, notes: impl Into<String>) -> Sketch
pub fn with_notes(self, notes: impl Into<String>) -> Sketch
Set notes