backbone-inventory 0.10.1

Inventory: stock ledger of record (SLE) + moving-average valuation; emits COGS/asset AccountingPost (Delivery/Receipt -> GL)
Documentation
//! Validator for LandedCost entity
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Returns an `EntityValidator<LandedCost>` pre-loaded with schema-derived
//! field rules. Extend in the `// <<< CUSTOM` zone.

use backbone_core::{EntityValidator, ValidationErrors, ValidationError};
use backbone_core::{OptionalNotBlank, RequiredString};
use crate::domain::entity::LandedCost;

/// Validator type alias for LandedCost entities.
pub type LandedCostValidator = EntityValidator<LandedCost>;

/// Build a validator for LandedCost with all schema-defined field rules.
pub fn landed_cost_validator() -> LandedCostValidator {
    EntityValidator::new()
        .rule(RequiredString::new("lc_number", |e: &LandedCost| &e.lc_number))
        .rule(RequiredString::new("currency", |e: &LandedCost| &e.currency))
        .rule(OptionalNotBlank::new("notes", |e: &LandedCost| e.notes.as_deref()))
    // <<< CUSTOM RULES
    // END CUSTOM RULES
}

// <<< CUSTOM
// END CUSTOM