use backbone_core::{EntityValidator, ValidationErrors, ValidationError};
use backbone_core::{OptionalNotBlank, RequiredString};
use crate::domain::entity::LandedCost;
pub type LandedCostValidator = EntityValidator<LandedCost>;
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()))
}