Decision

Struct Decision 

Source
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: Uuid

Unique identifier for the decision

§number: u64

Decision number - can be sequential (1, 2, 3) or timestamp-based (YYMMDDHHmm format) Timestamp format prevents merge conflicts in distributed Git workflows

§title: String

Short title describing the decision

§status: DecisionStatus

Current status of the decision

§category: DecisionCategory

Category 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: Vec<String>

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: String

Problem statement and context for the decision

§drivers: Vec<DecisionDriver>

Reasons driving this decision

§options: Vec<DecisionOption>

Options that were considered

§decision: String

The 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

§related_decisions: Vec<Uuid>

IDs of related decisions

§related_knowledge: Vec<Uuid>

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: Vec<Tag>

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

Source

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

Source

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

Source

pub fn generate_timestamp_number(dt: &DateTime<Utc>) -> u64

Generate a timestamp-based decision number in YYMMDDHHmm format

Source

pub fn generate_id(number: u64) -> Uuid

Generate a deterministic UUID for a decision based on its number

Source

pub fn add_author(self, author: impl Into<String>) -> Self

Add an author

Source

pub fn add_consulted(self, consulted: impl Into<String>) -> Self

Set consulted parties (RACI - Consulted)

Source

pub fn add_informed(self, informed: impl Into<String>) -> Self

Set informed parties (RACI - Informed)

Add a related decision

Add a related knowledge article

Source

pub fn with_decided_at(self, decided_at: DateTime<Utc>) -> Self

Set decided_at timestamp

Source

pub fn with_domain_id(self, domain_id: Uuid) -> Self

Set the domain ID

Source

pub fn with_workspace_id(self, workspace_id: Uuid) -> Self

Set the workspace ID

Source

pub fn with_status(self, status: DecisionStatus) -> Self

Set the decision status

Source

pub fn with_category(self, category: DecisionCategory) -> Self

Set the decision category

Source

pub fn with_domain(self, domain: impl Into<String>) -> Self

Set the domain

Source

pub fn add_decider(self, decider: impl Into<String>) -> Self

Add a decider

Source

pub fn add_driver(self, driver: DecisionDriver) -> Self

Add a driver

Source

pub fn add_option(self, option: DecisionOption) -> Self

Add an option

Source

pub fn with_consequences(self, consequences: impl Into<String>) -> Self

Set consequences

Add an asset link

Source

pub fn with_compliance(self, compliance: ComplianceAssessment) -> Self

Set compliance assessment

Source

pub fn supersedes_decision(self, other_id: Uuid) -> Self

Mark this decision as superseding another

Source

pub fn superseded_by_decision(&mut self, other_id: Uuid)

Mark this decision as superseded by another

Source

pub fn add_tag(self, tag: Tag) -> Self

Add a tag

Source

pub fn is_timestamp_number(&self) -> bool

Check if the decision number is timestamp-based (YYMMDDHHmm format - 10 digits)

Source

pub fn formatted_number(&self) -> String

Format the decision number for display Returns “ADR-0001” for sequential or “ADR-2601101234” for timestamp-based

Source

pub fn filename(&self, workspace_name: &str) -> String

Generate the YAML filename for this decision

Source

pub fn markdown_filename(&self) -> String

Generate the Markdown filename for this decision

Source

pub fn from_yaml(yaml_content: &str) -> Result<Self, Error>

Import from YAML

Source

pub fn to_yaml(&self) -> Result<String, Error>

Export to YAML

Source

pub fn to_yaml_pretty(&self) -> Result<String, Error>

Export to pretty YAML

Trait Implementations§

Source§

impl Clone for Decision

Source§

fn clone(&self) -> Decision

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Decision

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Decision

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&Decision> for DecisionIndexEntry

Source§

fn from(decision: &Decision) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Decision

Source§

fn eq(&self, other: &Decision) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Decision

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Decision

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,