//! Validator for StockMove entity
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Returns an `EntityValidator<StockMove>` pre-loaded with schema-derived
//! field rules. Extend in the `// <<< CUSTOM` zone.
use backbone_core::{EntityValidator, ValidationErrors, ValidationError};
use backbone_core::{NonNegative, OptionalNotBlank, RequiredString};
use crate::domain::entity::StockMove;
/// Validator type alias for StockMove entities.
pub type StockMoveValidator = EntityValidator<StockMove>;
/// Build a validator for StockMove with all schema-defined field rules.
pub fn stock_move_validator() -> StockMoveValidator {
EntityValidator::new()
.rule(RequiredString::new("name", |e: &StockMove| &e.name))
.rule(OptionalNotBlank::new("origin", |e: &StockMove| e.origin.as_deref()))
// <<< CUSTOM RULES
// END CUSTOM RULES
}
// <<< CUSTOM
// END CUSTOM