made_core/entities/ceremony_instance/decisions/
mod.rs1use crate::entities::{CeremonyCommand, CeremonyDefinition, CeremonyEvent, CeremonyInstance};
11use crate::error::DomainError;
12
13mod guard_decisions;
14mod interventions;
15mod participant_bindings;
16mod reasons;
17mod start;
18mod step_execution;
19mod transitions;
20
21impl CeremonyInstance {
22 pub fn decide(
30 &self,
31 command: &CeremonyCommand,
32 definition: &CeremonyDefinition,
33 ) -> Result<Vec<CeremonyEvent>, DomainError> {
34 match command {
35 CeremonyCommand::BindParticipant(command) => {
36 self.decide_bind_participant(command, definition)
37 }
38 CeremonyCommand::StartStep(command) => self.decide_start_step(command, definition),
39 CeremonyCommand::ApplyStepResult(command) => {
40 self.decide_apply_step_result(command, definition)
41 }
42 CeremonyCommand::ApplyTransition(command) => {
43 self.decide_apply_transition(command, definition)
44 }
45 CeremonyCommand::ApproveGuard(command) => {
46 self.decide_approve_guard(command, definition)
47 }
48 CeremonyCommand::DeferGuard(command) => self.decide_defer_guard(command, definition),
49 CeremonyCommand::RequestIntervention(command) => {
50 self.decide_request_intervention(command, definition)
51 }
52 CeremonyCommand::RespondToIntervention(command) => {
53 self.decide_respond_to_intervention(command, definition)
54 }
55 CeremonyCommand::RespondToInterventionWithEvidence(command) => {
56 self.decide_respond_to_intervention_with_evidence(command, definition)
57 }
58 CeremonyCommand::AssertReason(command) => {
59 self.decide_assert_reason(command, definition)
60 }
61 CeremonyCommand::CloseIntervention(command) => {
62 self.decide_close_intervention(command, definition)
63 }
64 }
65 }
66}