//! Declarative TOML-based MIG-tree <-> BO4E mapping engine.
//!
//! # Architecture
//!
//! - **TOML mapping files** define simple 1:1 field mappings
//! - **Complex handlers** are Rust functions for non-trivial logic
//! - **MappingEngine** loads all definitions and provides bidirectional conversion
//!
//! # Usage
//! ```ignore
//! let engine = MappingEngine::load("mappings/FV2504/UTILMD_Strom/pid_55001")?;
//! let def = engine.definition_for_entity("Marktlokation").unwrap();
//! let bo4e = engine.map_forward(&tree, def, 0);
//! let instance = engine.map_reverse(&bo4e, def);
//! ```

pub mod code_lookup;
pub mod definition;
pub mod engine;
pub mod error;
pub mod error_mapping;
pub mod handlers;
pub mod model;
pub mod path_resolver;
pub mod pid_requirements;
pub mod pid_schema_index;
pub mod pid_validation;
pub mod segment_structure;

pub use engine::DataBundle;
pub use engine::MappingEngine;
pub use engine::VariantCache;
pub use error::MappingError;
pub use error_mapping::Bo4eFieldIndex;
pub use handlers::HandlerRegistry;
pub use model::{
    DynamicInterchange, DynamicNachricht, Interchange, Interchangedaten, MappedMessage,
    MappedTransaktion, Nachricht, Nachrichtendaten,
};
pub use path_resolver::PathResolver;
pub use pid_requirements::{load_definitions_for_pid, PidRequirements};
pub use pid_schema_index::PidSchemaIndex;
pub use pid_validation::{PidValidationError, ValidationReport};
