Skip to main content

made_core/entities/
ceremony_command.rs

1//! [`CeremonyCommand`] — what a caller asks of a running ceremony.
2//!
3//! A command is decided, never applied: [`CeremonyInstance::decide`]
4//! turns it into the events it would produce, or refuses it, and only
5//! the events change state. One variant per mutation the aggregate
6//! accepts, each wrapping a struct that carries exactly what the
7//! corresponding mutator takes.
8//!
9//! Starting a ceremony is not here. A command is addressed to an
10//! instance that exists; opening one is a constructor,
11//! [`CeremonyInstance::decide_start`], which yields the opening event
12//! with nothing to decide against.
13//!
14//! [`CeremonyInstance::decide`]: super::CeremonyInstance::decide
15//! [`CeremonyInstance::decide_start`]: super::CeremonyInstance::decide_start
16
17use super::ceremony_commands::{
18    ApplyStepResult, ApplyTransition, ApproveGuard, AssertReason, BindParticipant,
19    CloseIntervention, DeferGuard, RequestIntervention, RespondToIntervention,
20    RespondToInterventionWithEvidence, StartStep,
21};
22
23/// A request to change a ceremony, in the terms the aggregate decides.
24#[derive(Debug, Clone, PartialEq, Eq)]
25pub enum CeremonyCommand {
26    BindParticipant(BindParticipant),
27    StartStep(StartStep),
28    ApplyStepResult(ApplyStepResult),
29    ApplyTransition(ApplyTransition),
30    ApproveGuard(ApproveGuard),
31    DeferGuard(DeferGuard),
32    RequestIntervention(RequestIntervention),
33    RespondToIntervention(RespondToIntervention),
34    RespondToInterventionWithEvidence(RespondToInterventionWithEvidence),
35    AssertReason(AssertReason),
36    CloseIntervention(CloseIntervention),
37}