Skip to main content

backbone_pos/application/validator/
pos_table_validator.rs

1//! Validator for PosTable entity
2//!
3//! Generated by metaphor-schema. Do not edit manually.
4//!
5//! Returns an `EntityValidator<PosTable>` pre-loaded with schema-derived
6//! field rules. Extend in the `// <<< CUSTOM` zone.
7
8use backbone_core::{EntityValidator, ValidationErrors, ValidationError};
9use backbone_core::{OptionalNotBlank};
10use crate::domain::entity::PosTable;
11
12/// Validator type alias for PosTable entities.
13pub type PosTableValidator = EntityValidator<PosTable>;
14
15/// Build a validator for PosTable with all schema-defined field rules.
16pub fn pos_table_validator() -> PosTableValidator {
17    EntityValidator::new()
18        .rule(OptionalNotBlank::new("name", |e: &PosTable| e.name.as_deref()))
19        .rule(OptionalNotBlank::new("shape", |e: &PosTable| e.shape.as_deref()))
20}
21