backbone-events 0.3.30

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 Ticket entity
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Returns an `EntityValidator<Ticket>` pre-loaded with schema-derived
//! field rules. Extend in the `// <<< CUSTOM` zone.

use backbone_core::{EntityValidator, ValidationErrors, ValidationError};
use backbone_core::{NonNegative, RequiredString};
use crate::domain::entity::Ticket;

/// Validator type alias for Ticket entities.
pub type TicketValidator = EntityValidator<Ticket>;

/// Build a validator for Ticket with all schema-defined field rules.
pub fn ticket_validator() -> TicketValidator {
    EntityValidator::new()
        .rule(RequiredString::new("name", |e: &Ticket| &e.name))
        .rule(NonNegative::new("seats_max", |e: &Ticket| e.seats_max as i64))
    // <<< CUSTOM RULES
    // END CUSTOM RULES
}

// <<< CUSTOM
// END CUSTOM