use dpm_model::{Key, Plan, Timeline, WorkItem};
#[must_use]
pub fn is_unestimated(timeline: &Timeline, work: &WorkItem) -> bool {
work.is_executable()
&& work.schedule.estimate.is_none()
&& !work.execution.status.satisfies_dependency()
&& timeline.applicability(work.id).is_applicable()
}
#[must_use]
pub fn unestimated(plan: &Plan, timeline: &Timeline) -> Vec<Key> {
let mut keys: Vec<_> = plan
.work_items
.values()
.filter(|w| is_unestimated(timeline, w))
.map(|w| w.key.clone())
.collect();
keys.sort_by(dpm_model::Key::natural_cmp);
keys
}
#[cfg(test)]
mod tests;