use dpm_model::{ValidationError, WorkItemId};
use thiserror::Error;
#[derive(Debug, Error)]
pub enum ScheduleError {
#[error(transparent)]
Validation(#[from] ValidationError),
#[error("schedule arithmetic overflow for work {0}")]
ArithmeticOverflow(WorkItemId),
#[error("dependency references missing work item {0}")]
MissingWorkItem(WorkItemId),
#[error("dependency graph contains a cycle")]
DependencyCycle,
#[error("invalid duration for work item {0}")]
InvalidDuration(WorkItemId),
#[error("schedule position {0} is outside the compiled dependency network")]
UnknownPosition(usize),
#[error("the projection needs working time beyond the supported calendar range")]
CalendarRange,
#[error("review delay {0} h must be finite and non-negative")]
InvalidReviewDelay(f64),
#[error("simulation requires at least one iteration")]
NoSimulationIterations,
}