use crate::domain::model::check::Violations;
use crate::domain::model::decision_record::{DecisionRecord, DecisionRecordCollection};
use crate::domain::model::record_ref::DecisionRecordRef;
pub trait DecisionRecordRepository {
fn save(&self, record: &DecisionRecord) -> anyhow::Result<()>;
fn list(&self) -> anyhow::Result<DecisionRecordCollection>;
fn find_by_id(&self, id: &DecisionRecordRef) -> anyhow::Result<Option<DecisionRecord>>;
fn configured_id_prefix(&self) -> Option<&str> {
None
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct DecisionRecordCheckResult {
pub path: std::path::PathBuf,
pub violations: Violations,
}
impl DecisionRecordCheckResult {
pub fn has_errors(&self) -> bool {
self.violations.has_errors()
}
}