use crate::entities::AgenticSystemExecution;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum AgenticSystemExecutionCreation {
Created(AgenticSystemExecution),
AlreadyExists(AgenticSystemExecution),
}
impl AgenticSystemExecutionCreation {
#[must_use]
pub const fn execution(&self) -> &AgenticSystemExecution {
match self {
Self::Created(execution) | Self::AlreadyExists(execution) => execution,
}
}
#[must_use]
pub fn into_execution(self) -> AgenticSystemExecution {
match self {
Self::Created(execution) | Self::AlreadyExists(execution) => execution,
}
}
#[must_use]
pub const fn is_new(&self) -> bool {
matches!(self, Self::Created(_))
}
}