//! Validator for Booth entity
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Returns an `EntityValidator<Booth>` 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::Booth;
/// Validator type alias for Booth entities.
pub type BoothValidator = EntityValidator<Booth>;
/// Build a validator for Booth with all schema-defined field rules.
pub fn booth_validator() -> BoothValidator {
EntityValidator::new()
.rule(RequiredString::new("name", |e: &Booth| &e.name))
.rule(OptionalNotBlank::new("contact_name", |e: &Booth| e.contact_name.as_deref()))
.rule(OptionalNotBlank::new("contact_email", |e: &Booth| e.contact_email.as_deref()))
.rule(OptionalNotBlank::new("contact_phone", |e: &Booth| e.contact_phone.as_deref()))
}