use crate::entities::{CeremonyCommand, CeremonyDefinition, CeremonyEvent, CeremonyInstance};
use crate::error::DomainError;
mod budget_admission;
mod children;
mod execution_receipts;
mod guard_decisions;
mod interventions;
mod lifecycle;
mod participant_bindings;
mod reasons;
mod start;
mod step_execution;
mod transitions;
impl CeremonyInstance {
pub fn decide(
&self,
command: &CeremonyCommand,
definition: &CeremonyDefinition,
) -> Result<Vec<CeremonyEvent>, DomainError> {
match command {
CeremonyCommand::BindParticipant(command) => {
self.decide_bind_participant(command, definition)
}
CeremonyCommand::StartStep(command) => self.decide_start_step(command, definition),
CeremonyCommand::ApplyStepResult(command) => {
self.decide_apply_step_result(command, definition)
}
CeremonyCommand::ApplyExecutionReceiptResult(command) => {
self.decide_apply_execution_receipt_result(command, definition)
}
CeremonyCommand::ApplyTransition(command) => {
self.decide_apply_transition(command, definition)
}
CeremonyCommand::ApproveGuard(command) => {
self.decide_approve_guard(command, definition)
}
CeremonyCommand::DeferGuard(command) => self.decide_defer_guard(command, definition),
CeremonyCommand::RequestIntervention(command) => {
self.decide_request_intervention(command, definition)
}
CeremonyCommand::RespondToIntervention(command) => {
self.decide_respond_to_intervention(command, definition)
}
CeremonyCommand::RespondToInterventionWithEvidence(command) => {
self.decide_respond_to_intervention_with_evidence(command, definition)
}
CeremonyCommand::AssertReason(command) => {
self.decide_assert_reason(command, definition)
}
CeremonyCommand::CloseIntervention(command) => {
self.decide_close_intervention(command, definition)
}
CeremonyCommand::PlanCeremonyChildren(command) => {
self.decide_plan_children(command, definition)
}
CeremonyCommand::AdoptChildSpawnPlan(command) => {
self.decide_adopt_child_plan(command, definition)
}
CeremonyCommand::AcceptChildCompletion(command) => {
self.decide_accept_child_completion(command, definition)
}
CeremonyCommand::PauseCeremony(command) => self.decide_pause(command, definition),
CeremonyCommand::ResumeCeremony(command) => self.decide_resume(command, definition),
CeremonyCommand::CancelCeremony(command) => self.decide_cancel(command, definition),
CeremonyCommand::EnforceCeremonyDeadlines(command) => {
self.decide_enforce_deadlines(command, definition)
}
}
}
}