//! Explain an OCPI object in human language.
//!
//! Where [`lint`](crate::lint) flags problems in a tariff, `explain` describes what a tariff
//! actually does: what it charges, for which dimension, and how the rate changes as a session
//! progresses. The explanation folds in how `ocpi-tariffs` interprets the spec, not just the raw
//! field values.
//!
//! Use [`tariff::explain`](crate::tariff::explain) to explain a tariff.

#[cfg(test)]
mod test;

#[cfg(test)]
mod test_real_world;

pub mod tariff;

use crate::{tariff::Warning, Verdict};

/// Explain the given tariff and return the explanation as Markdown.
pub(crate) fn tariff(tariff: &crate::tariff::Versioned<'_>) -> Verdict<String, Warning> {
    tariff::explain(tariff)
}
