backbone-bucket 0.4.0

Bucket Bounded Context: File Storage Module for Backbone Framework
Documentation
//! Public services for Bucket module
//!
//! Generated by metaphor-schema. Do not edit manually.
//!
//! These services provide the public API for other modules.
//! They only expose read operations - writes go through events.

use std::sync::Arc;

use anyhow::Result;
use async_trait::async_trait;
use uuid::Uuid;

use super::types::*;

// ============================================================================
// QUERY SERVICE TRAIT
// ============================================================================

/// Public query service for Bucket module
///
/// This trait defines read-only operations that other modules can use.
/// Implementations should NOT expose internal domain logic.
#[async_trait]
pub trait BucketQueryService: Send + Sync {
    /// Get AccessLog by ID
    async fn get_access_log(&self, id: AccessLogId) -> Result<Option<AccessLogDto>>;

    /// Get AccessLog summary by ID
    async fn get_access_log_summary(&self, id: AccessLogId) -> Result<Option<AccessLogSummary>>;

    /// Check if AccessLog exists
    async fn access_log_exists(&self, id: AccessLogId) -> Result<bool>;

    /// Get Bucket by ID
    async fn get_bucket(&self, id: BucketId) -> Result<Option<BucketDto>>;

    /// Get Bucket summary by ID
    async fn get_bucket_summary(&self, id: BucketId) -> Result<Option<BucketSummary>>;

    /// Check if Bucket exists
    async fn bucket_exists(&self, id: BucketId) -> Result<bool>;

    /// Get ContentHash by ID
    async fn get_content_hash(&self, id: ContentHashId) -> Result<Option<ContentHashDto>>;

    /// Get ContentHash summary by ID
    async fn get_content_hash_summary(&self, id: ContentHashId) -> Result<Option<ContentHashSummary>>;

    /// Check if ContentHash exists
    async fn content_hash_exists(&self, id: ContentHashId) -> Result<bool>;

    /// Get ConversionJob by ID
    async fn get_conversion_job(&self, id: ConversionJobId) -> Result<Option<ConversionJobDto>>;

    /// Get ConversionJob summary by ID
    async fn get_conversion_job_summary(&self, id: ConversionJobId) -> Result<Option<ConversionJobSummary>>;

    /// Check if ConversionJob exists
    async fn conversion_job_exists(&self, id: ConversionJobId) -> Result<bool>;

    /// Get FileComment by ID
    async fn get_file_comment(&self, id: FileCommentId) -> Result<Option<FileCommentDto>>;

    /// Get FileComment summary by ID
    async fn get_file_comment_summary(&self, id: FileCommentId) -> Result<Option<FileCommentSummary>>;

    /// Check if FileComment exists
    async fn file_comment_exists(&self, id: FileCommentId) -> Result<bool>;

    /// Get FileLock by ID
    async fn get_file_lock(&self, id: FileLockId) -> Result<Option<FileLockDto>>;

    /// Get FileLock summary by ID
    async fn get_file_lock_summary(&self, id: FileLockId) -> Result<Option<FileLockSummary>>;

    /// Check if FileLock exists
    async fn file_lock_exists(&self, id: FileLockId) -> Result<bool>;

    /// Get FileShare by ID
    async fn get_file_share(&self, id: FileShareId) -> Result<Option<FileShareDto>>;

    /// Get FileShare summary by ID
    async fn get_file_share_summary(&self, id: FileShareId) -> Result<Option<FileShareSummary>>;

    /// Check if FileShare exists
    async fn file_share_exists(&self, id: FileShareId) -> Result<bool>;

    /// Get FileVersion by ID
    async fn get_file_version(&self, id: FileVersionId) -> Result<Option<FileVersionDto>>;

    /// Get FileVersion summary by ID
    async fn get_file_version_summary(&self, id: FileVersionId) -> Result<Option<FileVersionSummary>>;

    /// Check if FileVersion exists
    async fn file_version_exists(&self, id: FileVersionId) -> Result<bool>;

    /// Get ProcessingJob by ID
    async fn get_processing_job(&self, id: ProcessingJobId) -> Result<Option<ProcessingJobDto>>;

    /// Get ProcessingJob summary by ID
    async fn get_processing_job_summary(&self, id: ProcessingJobId) -> Result<Option<ProcessingJobSummary>>;

    /// Check if ProcessingJob exists
    async fn processing_job_exists(&self, id: ProcessingJobId) -> Result<bool>;

    /// Get StoredFile by ID
    async fn get_stored_file(&self, id: StoredFileId) -> Result<Option<StoredFileDto>>;

    /// Get StoredFile summary by ID
    async fn get_stored_file_summary(&self, id: StoredFileId) -> Result<Option<StoredFileSummary>>;

    /// Check if StoredFile exists
    async fn stored_file_exists(&self, id: StoredFileId) -> Result<bool>;

    /// Get Thumbnail by ID
    async fn get_thumbnail(&self, id: ThumbnailId) -> Result<Option<ThumbnailDto>>;

    /// Get Thumbnail summary by ID
    async fn get_thumbnail_summary(&self, id: ThumbnailId) -> Result<Option<ThumbnailSummary>>;

    /// Check if Thumbnail exists
    async fn thumbnail_exists(&self, id: ThumbnailId) -> Result<bool>;

    /// Get UploadSession by ID
    async fn get_upload_session(&self, id: UploadSessionId) -> Result<Option<UploadSessionDto>>;

    /// Get UploadSession summary by ID
    async fn get_upload_session_summary(&self, id: UploadSessionId) -> Result<Option<UploadSessionSummary>>;

    /// Check if UploadSession exists
    async fn upload_session_exists(&self, id: UploadSessionId) -> Result<bool>;

    /// Get UserQuota by ID
    async fn get_user_quota(&self, id: UserQuotaId) -> Result<Option<UserQuotaDto>>;

    /// Get UserQuota summary by ID
    async fn get_user_quota_summary(&self, id: UserQuotaId) -> Result<Option<UserQuotaSummary>>;

    /// Check if UserQuota exists
    async fn user_quota_exists(&self, id: UserQuotaId) -> Result<bool>;

}

// ============================================================================
// QUERY SERVICE IMPLEMENTATION
// ============================================================================

/// Default implementation of BucketQueryService
pub struct BucketQueryServiceImpl<R> {
    // A legacy export the generator no longer emits. It is public, so it stays until
    // the next breaking release; nothing reads its repository.
    #[allow(dead_code)]
    repository: Arc<R>,
}

impl<R> BucketQueryServiceImpl<R> {
    pub fn new(repository: Arc<R>) -> Self {
        Self { repository }
    }
}

// ============================================================================
// CUSTOM SERVICES
// ============================================================================

// <<< CUSTOM SERVICES START >>>
// Add custom public services here
// <<< CUSTOM SERVICES END >>>