Skip to main content

backbone_bucket/domain/services/
file_lock_domain_policy.rs

1//! Domain policy for FileLock aggregate
2//!
3//! Generated by metaphor-schema. Do not edit manually.
4//!
5//! `DomainPolicy` enforces pure business invariants (state-based rules).
6//! Identity-based rules live in `backbone_auth::ResourcePolicy`.
7
8use async_trait::async_trait;
9use backbone_core::{DomainPolicy, PolicyDecision};
10use crate::domain::entity::FileLock;
11
12/// Domain policy for FileLock — enforces business invariants.
13pub struct FileLockDomainPolicy;
14
15#[async_trait]
16impl DomainPolicy<FileLock> for FileLockDomainPolicy {
17    // <<< CUSTOM
18    // Add entity-specific invariant checks here.
19    // Example:
20    // async fn can_delete(&self, entity: &FileLock) -> PolicyDecision {
21    //     if entity.is_locked {
22    //         Err("locked file_lock cannot be deleted".into())
23    //     } else { Ok(true) }
24    // }
25    // END CUSTOM
26}