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    AcceptChildCompletion, AcknowledgeInterventionDelivery, AdoptChildSpawnPlan,
19    ApplyExecutionReceiptResult, ApplyStepResult, ApplyTransition, ApproveGuard, AssertReason,
20    BindParticipant, CancelCeremony, CloseIntervention, DeferGuard, EnforceCeremonyDeadlines,
21    PauseCeremony, PlanCeremonyChildren, PlanSuccessor, RenewStepLease, RequestIntervention,
22    RespondToIntervention, RespondToInterventionWithEvidence, ResumeCeremony, StartStep,
23};
24
25/// A request to change a ceremony, in the terms the aggregate decides.
26#[derive(Debug, Clone, PartialEq, Eq)]
27pub enum CeremonyCommand {
28    RecordHostHandoff(super::ceremony_commands::RecordHostHandoff),
29    BindParticipant(BindParticipant),
30    StartStep(StartStep),
31    RenewStepLease(RenewStepLease),
32    ApplyStepResult(ApplyStepResult),
33    ApplyExecutionReceiptResult(ApplyExecutionReceiptResult),
34    ApplyTransition(ApplyTransition),
35    ApproveGuard(ApproveGuard),
36    DeferGuard(DeferGuard),
37    RequestIntervention(RequestIntervention),
38    RespondToIntervention(RespondToIntervention),
39    RespondToInterventionWithEvidence(RespondToInterventionWithEvidence),
40    AcknowledgeInterventionDelivery(AcknowledgeInterventionDelivery),
41    AssertReason(AssertReason),
42    CloseIntervention(CloseIntervention),
43    PlanCeremonyChildren(PlanCeremonyChildren),
44    PlanSuccessor(PlanSuccessor),
45    AdoptChildSpawnPlan(AdoptChildSpawnPlan),
46    AcceptChildCompletion(AcceptChildCompletion),
47    PauseCeremony(PauseCeremony),
48    ResumeCeremony(ResumeCeremony),
49    CancelCeremony(CancelCeremony),
50    EnforceCeremonyDeadlines(EnforceCeremonyDeadlines),
51}