pub struct Decision {Show 23 fields
pub id: Uuid,
pub number: u32,
pub title: String,
pub status: DecisionStatus,
pub category: DecisionCategory,
pub domain: Option<String>,
pub date: DateTime<Utc>,
pub deciders: 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 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: u32Sequential decision number (ADR-0001, ADR-0002, etc.)
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)
date: DateTime<Utc>Date the decision was made
deciders: Vec<String>People or teams who made the decision
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
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: u32,
title: impl Into<String>,
context: impl Into<String>,
decision: impl Into<String>,
) -> Self
pub fn new( number: u32, title: impl Into<String>, context: impl Into<String>, decision: impl Into<String>, ) -> Self
Create a new decision with required fields
Sourcepub fn generate_id(number: u32) -> Uuid
pub fn generate_id(number: u32) -> Uuid
Generate a deterministic UUID for a decision based on its number
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 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