automapper-validation 0.12.0

AHB condition expression parsing, evaluation, and EDIFACT validation
Documentation
//! The two worlds an issue can be addressed in.

use crate::ValidationIssue;

use super::IssueView;

/// Locates issues by EDIFACT segment path — the world the validator works in.
pub struct EdifactView;

impl IssueView for EdifactView {
    fn name(&self) -> &str {
        "EDIFACT"
    }
    fn location(&self, issue: &ValidationIssue) -> Option<String> {
        issue.field_path.clone()
    }
}

/// Locates issues by BO4E field path.
///
/// Returns `None` for issues with no BO4E counterpart — envelope-level findings
/// (UNH, UNT) and anything the mapping definitions do not cover. Roughly 11% of
/// findings across the fixture corpus. Callers should say so rather than fall
/// back to the EDIFACT path, which would put an EDIFACT path inside a BO4E view.
pub struct Bo4eView;

impl IssueView for Bo4eView {
    fn name(&self) -> &str {
        "BO4E"
    }
    fn location(&self, issue: &ValidationIssue) -> Option<String> {
        issue.bo4e_path.clone()
    }
}