pub struct Decision {Show 31 fields
pub id: Uuid,
pub number: u64,
pub title: String,
pub status: DecisionStatus,
pub category: DecisionCategory,
pub domain: Option<String>,
pub domain_id: Option<Uuid>,
pub workspace_id: Option<Uuid>,
pub date: DateTime<Utc>,
pub decided_at: Option<DateTime<Utc>>,
pub authors: Vec<String>,
pub deciders: Vec<String>,
pub consulted: Vec<String>,
pub informed: Vec<String>,
pub context: String,
pub drivers: Vec<DecisionDriver>,
pub options: Vec<DecisionOption>,
pub decision: String,
pub consequences: Option<String>,
pub linked_assets: Vec<AssetLink>,
pub supersedes: Option<Uuid>,
pub superseded_by: Option<Uuid>,
pub related_decisions: Vec<Uuid>,
pub related_knowledge: Vec<Uuid>,
pub compliance: Option<ComplianceAssessment>,
pub confirmation_date: Option<DateTime<Utc>>,
pub confirmation_notes: Option<String>,
pub tags: Vec<Tag>,
pub notes: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
MADR-compliant Decision Record
Represents an architectural or data decision following the MADR template.
Fields§
§id: UuidUnique identifier for the decision
number: u64Decision number - can be sequential (1, 2, 3) or timestamp-based (YYMMDDHHmm format) Timestamp format prevents merge conflicts in distributed Git workflows
title: StringShort title describing the decision
status: DecisionStatusCurrent status of the decision
category: DecisionCategoryCategory of the decision
domain: Option<String>Domain this decision belongs to (optional, string name)
domain_id: Option<Uuid>Domain UUID reference (optional)
workspace_id: Option<Uuid>Workspace UUID reference (optional)
date: DateTime<Utc>Date the decision was made
decided_at: Option<DateTime<Utc>>When the decision was accepted/finalized
Authors of the decision record
deciders: Vec<String>People or teams who made the decision (deciders)
consulted: Vec<String>People or teams consulted during decision making (RACI - Consulted)
informed: Vec<String>People or teams to be informed about the decision (RACI - Informed)
context: StringProblem statement and context for the decision
drivers: Vec<DecisionDriver>Reasons driving this decision
options: Vec<DecisionOption>Options that were considered
decision: StringThe decision that was made
consequences: Option<String>Positive and negative consequences of the decision
linked_assets: Vec<AssetLink>Assets affected by this decision
supersedes: Option<Uuid>ID of the decision this supersedes
superseded_by: Option<Uuid>ID of the decision that superseded this
IDs of related decisions
IDs of related knowledge articles
compliance: Option<ComplianceAssessment>Compliance assessment
confirmation_date: Option<DateTime<Utc>>Date the decision was confirmed/reviewed
confirmation_notes: Option<String>Notes from confirmation review
Tags for categorization
notes: Option<String>Additional notes
created_at: DateTime<Utc>Creation timestamp
updated_at: DateTime<Utc>Last modification timestamp
Implementations§
Source§impl Decision
impl Decision
Sourcepub fn new(
number: u64,
title: impl Into<String>,
context: impl Into<String>,
decision: impl Into<String>,
) -> Self
pub fn new( number: u64, title: impl Into<String>, context: impl Into<String>, decision: impl Into<String>, ) -> Self
Create a new decision with required fields
Sourcepub fn new_with_timestamp(
title: impl Into<String>,
context: impl Into<String>,
decision: impl Into<String>,
) -> Self
pub fn new_with_timestamp( title: impl Into<String>, context: impl Into<String>, decision: impl Into<String>, ) -> Self
Create a new decision 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 decision number in YYMMDDHHmm format
Sourcepub fn generate_id(number: u64) -> Uuid
pub fn generate_id(number: u64) -> Uuid
Generate a deterministic UUID for a decision based on its number
Add an author
Sourcepub fn add_consulted(self, consulted: impl Into<String>) -> Self
pub fn add_consulted(self, consulted: impl Into<String>) -> Self
Set consulted parties (RACI - Consulted)
Sourcepub fn add_informed(self, informed: impl Into<String>) -> Self
pub fn add_informed(self, informed: impl Into<String>) -> Self
Set informed parties (RACI - Informed)
Add a related decision
Add a related knowledge article
Sourcepub fn with_decided_at(self, decided_at: DateTime<Utc>) -> Self
pub fn with_decided_at(self, decided_at: DateTime<Utc>) -> Self
Set decided_at timestamp
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_status(self, status: DecisionStatus) -> Self
pub fn with_status(self, status: DecisionStatus) -> Self
Set the decision status
Sourcepub fn with_category(self, category: DecisionCategory) -> Self
pub fn with_category(self, category: DecisionCategory) -> Self
Set the decision category
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_decider(self, decider: impl Into<String>) -> Self
pub fn add_decider(self, decider: impl Into<String>) -> Self
Add a decider
Sourcepub fn add_driver(self, driver: DecisionDriver) -> Self
pub fn add_driver(self, driver: DecisionDriver) -> Self
Add a driver
Sourcepub fn add_option(self, option: DecisionOption) -> Self
pub fn add_option(self, option: DecisionOption) -> Self
Add an option
Sourcepub fn with_consequences(self, consequences: impl Into<String>) -> Self
pub fn with_consequences(self, consequences: impl Into<String>) -> Self
Set consequences
Sourcepub fn add_asset_link(self, link: AssetLink) -> Self
pub fn add_asset_link(self, link: AssetLink) -> Self
Add an asset link
Sourcepub fn with_compliance(self, compliance: ComplianceAssessment) -> Self
pub fn with_compliance(self, compliance: ComplianceAssessment) -> Self
Set compliance assessment
Sourcepub fn supersedes_decision(self, other_id: Uuid) -> Self
pub fn supersedes_decision(self, other_id: Uuid) -> Self
Mark this decision as superseding another
Sourcepub fn superseded_by_decision(&mut self, other_id: Uuid)
pub fn superseded_by_decision(&mut self, other_id: Uuid)
Mark this decision as superseded by another
Sourcepub fn is_timestamp_number(&self) -> bool
pub fn is_timestamp_number(&self) -> bool
Check if the decision number is timestamp-based (YYMMDDHHmm format - 10 digits)
Sourcepub fn formatted_number(&self) -> String
pub fn formatted_number(&self) -> String
Format the decision number for display Returns “ADR-0001” for sequential or “ADR-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 decision
Sourcepub fn markdown_filename(&self) -> String
pub fn markdown_filename(&self) -> String
Generate the Markdown filename for this decision
Sourcepub fn to_yaml_pretty(&self) -> Result<String, Error>
pub fn to_yaml_pretty(&self) -> Result<String, Error>
Export to pretty YAML