backbone-events 0.5.0

Events core + the sale/booth/crm/sms/desk overlay — registrations under one authoritative seat counter, the sale seam (order-minted registrations, forward-only paid heal, SO-cancel mirror cascade), booth bookings with the DB exclusivity wall, closed-vocabulary lead rules through a host sink port, the dual-channel (mail/sms) self-arming scheduler, and the exact-match desk verb (Odoo event port, core + overlay)
//! Validator for Registration entity
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Returns an `EntityValidator<Registration>` 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::Registration;

/// Validator type alias for Registration entities.
pub type RegistrationValidator = EntityValidator<Registration>;

/// Build a validator for Registration with all schema-defined field rules.
pub fn registration_validator() -> RegistrationValidator {
    EntityValidator::new()
        .rule(RequiredString::new("name", |e: &Registration| &e.name))
        .rule(RequiredString::new("email", |e: &Registration| &e.email))
        .rule(OptionalNotBlank::new("phone", |e: &Registration| e.phone.as_deref()))
        .rule(OptionalNotBlank::new("company_name", |e: &Registration| e.company_name.as_deref()))
        .rule(RequiredString::new("barcode", |e: &Registration| &e.barcode))
    // <<< CUSTOM RULES
    // END CUSTOM RULES
}

// <<< CUSTOM
// END CUSTOM