backbone-bucket 0.2.0

Bucket Bounded Context: File Storage Module for Backbone Framework
Documentation
//! Validator for FileComment entity
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! Returns an `EntityValidator<FileComment>` pre-loaded with schema-derived
//! field rules. Extend in the `// <<< CUSTOM` zone.

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

/// Validator type alias for FileComment entities.
pub type FileCommentValidator = EntityValidator<FileComment>;

/// Build a validator for FileComment with all schema-defined field rules.
pub fn file_comment_validator() -> FileCommentValidator {
    EntityValidator::new()
        .rule(RequiredString::new("content", |e: &FileComment| &e.content))
    // <<< CUSTOM RULES
    // hook rule: file_must_exist (implement in CUSTOM zone)
    // hook rule: file_must_be_accessible (implement in CUSTOM zone)
    // hook rule: content_required (implement in CUSTOM zone)
    // hook rule: content_max_length (implement in CUSTOM zone)
    // hook rule: parent_must_exist (implement in CUSTOM zone)
    // hook rule: parent_must_be_on_same_file (implement in CUSTOM zone)
    // hook rule: mentions_must_be_valid (implement in CUSTOM zone)
    // hook rule: annotation_must_be_valid (implement in CUSTOM zone)
    // hook rule: only_owner_can_edit (implement in CUSTOM zone)
    // hook rule: cannot_edit_deleted (implement in CUSTOM zone)
    // hook rule: cannot_edit_resolved_after_timeout (implement in CUSTOM zone)
    // hook rule: max_thread_depth (implement in CUSTOM zone)
    // END CUSTOM RULES
}

// <<< CUSTOM
// END CUSTOM