made_core/entities/ceremony_instance/decisions/
mod.rs1use crate::entities::{CeremonyCommand, CeremonyDefinition, CeremonyEvent, CeremonyInstance};
11use crate::error::DomainError;
12
13mod budget_admission;
14mod children;
15mod execution_receipts;
16mod guard_decisions;
17mod interventions;
18mod lifecycle;
19mod participant_bindings;
20mod reasons;
21mod start;
22mod step_execution;
23mod transitions;
24
25impl CeremonyInstance {
26 pub fn decide(
34 &self,
35 command: &CeremonyCommand,
36 definition: &CeremonyDefinition,
37 ) -> Result<Vec<CeremonyEvent>, DomainError> {
38 match command {
39 CeremonyCommand::BindParticipant(command) => {
40 self.decide_bind_participant(command, definition)
41 }
42 CeremonyCommand::StartStep(command) => self.decide_start_step(command, definition),
43 CeremonyCommand::ApplyStepResult(command) => {
44 self.decide_apply_step_result(command, definition)
45 }
46 CeremonyCommand::ApplyExecutionReceiptResult(command) => {
47 self.decide_apply_execution_receipt_result(command, definition)
48 }
49 CeremonyCommand::ApplyTransition(command) => {
50 self.decide_apply_transition(command, definition)
51 }
52 CeremonyCommand::ApproveGuard(command) => {
53 self.decide_approve_guard(command, definition)
54 }
55 CeremonyCommand::DeferGuard(command) => self.decide_defer_guard(command, definition),
56 CeremonyCommand::RequestIntervention(command) => {
57 self.decide_request_intervention(command, definition)
58 }
59 CeremonyCommand::RespondToIntervention(command) => {
60 self.decide_respond_to_intervention(command, definition)
61 }
62 CeremonyCommand::RespondToInterventionWithEvidence(command) => {
63 self.decide_respond_to_intervention_with_evidence(command, definition)
64 }
65 CeremonyCommand::AssertReason(command) => {
66 self.decide_assert_reason(command, definition)
67 }
68 CeremonyCommand::CloseIntervention(command) => {
69 self.decide_close_intervention(command, definition)
70 }
71 CeremonyCommand::PlanCeremonyChildren(command) => {
72 self.decide_plan_children(command, definition)
73 }
74 CeremonyCommand::AdoptChildSpawnPlan(command) => {
75 self.decide_adopt_child_plan(command, definition)
76 }
77 CeremonyCommand::AcceptChildCompletion(command) => {
78 self.decide_accept_child_completion(command, definition)
79 }
80 CeremonyCommand::PauseCeremony(command) => self.decide_pause(command, definition),
81 CeremonyCommand::ResumeCeremony(command) => self.decide_resume(command, definition),
82 CeremonyCommand::CancelCeremony(command) => self.decide_cancel(command, definition),
83 CeremonyCommand::EnforceCeremonyDeadlines(command) => {
84 self.decide_enforce_deadlines(command, definition)
85 }
86 }
87 }
88}