Skip to main content

backbone_bucket/exports/
services.rs

1//! Public services for Bucket module
2//!
3//! Generated by metaphor-schema. Do not edit manually.
4//!
5//! These services provide the public API for other modules.
6//! They only expose read operations - writes go through events.
7
8use std::sync::Arc;
9
10use anyhow::Result;
11use async_trait::async_trait;
12use uuid::Uuid;
13
14use super::types::*;
15
16// ============================================================================
17// QUERY SERVICE TRAIT
18// ============================================================================
19
20/// Public query service for Bucket module
21///
22/// This trait defines read-only operations that other modules can use.
23/// Implementations should NOT expose internal domain logic.
24#[async_trait]
25pub trait BucketQueryService: Send + Sync {
26    /// Get AccessLog by ID
27    async fn get_access_log(&self, id: AccessLogId) -> Result<Option<AccessLogDto>>;
28
29    /// Get AccessLog summary by ID
30    async fn get_access_log_summary(&self, id: AccessLogId) -> Result<Option<AccessLogSummary>>;
31
32    /// Check if AccessLog exists
33    async fn access_log_exists(&self, id: AccessLogId) -> Result<bool>;
34
35    /// Get Bucket by ID
36    async fn get_bucket(&self, id: BucketId) -> Result<Option<BucketDto>>;
37
38    /// Get Bucket summary by ID
39    async fn get_bucket_summary(&self, id: BucketId) -> Result<Option<BucketSummary>>;
40
41    /// Check if Bucket exists
42    async fn bucket_exists(&self, id: BucketId) -> Result<bool>;
43
44    /// Get ContentHash by ID
45    async fn get_content_hash(&self, id: ContentHashId) -> Result<Option<ContentHashDto>>;
46
47    /// Get ContentHash summary by ID
48    async fn get_content_hash_summary(&self, id: ContentHashId) -> Result<Option<ContentHashSummary>>;
49
50    /// Check if ContentHash exists
51    async fn content_hash_exists(&self, id: ContentHashId) -> Result<bool>;
52
53    /// Get ConversionJob by ID
54    async fn get_conversion_job(&self, id: ConversionJobId) -> Result<Option<ConversionJobDto>>;
55
56    /// Get ConversionJob summary by ID
57    async fn get_conversion_job_summary(&self, id: ConversionJobId) -> Result<Option<ConversionJobSummary>>;
58
59    /// Check if ConversionJob exists
60    async fn conversion_job_exists(&self, id: ConversionJobId) -> Result<bool>;
61
62    /// Get FileComment by ID
63    async fn get_file_comment(&self, id: FileCommentId) -> Result<Option<FileCommentDto>>;
64
65    /// Get FileComment summary by ID
66    async fn get_file_comment_summary(&self, id: FileCommentId) -> Result<Option<FileCommentSummary>>;
67
68    /// Check if FileComment exists
69    async fn file_comment_exists(&self, id: FileCommentId) -> Result<bool>;
70
71    /// Get FileLock by ID
72    async fn get_file_lock(&self, id: FileLockId) -> Result<Option<FileLockDto>>;
73
74    /// Get FileLock summary by ID
75    async fn get_file_lock_summary(&self, id: FileLockId) -> Result<Option<FileLockSummary>>;
76
77    /// Check if FileLock exists
78    async fn file_lock_exists(&self, id: FileLockId) -> Result<bool>;
79
80    /// Get FileShare by ID
81    async fn get_file_share(&self, id: FileShareId) -> Result<Option<FileShareDto>>;
82
83    /// Get FileShare summary by ID
84    async fn get_file_share_summary(&self, id: FileShareId) -> Result<Option<FileShareSummary>>;
85
86    /// Check if FileShare exists
87    async fn file_share_exists(&self, id: FileShareId) -> Result<bool>;
88
89    /// Get FileVersion by ID
90    async fn get_file_version(&self, id: FileVersionId) -> Result<Option<FileVersionDto>>;
91
92    /// Get FileVersion summary by ID
93    async fn get_file_version_summary(&self, id: FileVersionId) -> Result<Option<FileVersionSummary>>;
94
95    /// Check if FileVersion exists
96    async fn file_version_exists(&self, id: FileVersionId) -> Result<bool>;
97
98    /// Get ProcessingJob by ID
99    async fn get_processing_job(&self, id: ProcessingJobId) -> Result<Option<ProcessingJobDto>>;
100
101    /// Get ProcessingJob summary by ID
102    async fn get_processing_job_summary(&self, id: ProcessingJobId) -> Result<Option<ProcessingJobSummary>>;
103
104    /// Check if ProcessingJob exists
105    async fn processing_job_exists(&self, id: ProcessingJobId) -> Result<bool>;
106
107    /// Get StoredFile by ID
108    async fn get_stored_file(&self, id: StoredFileId) -> Result<Option<StoredFileDto>>;
109
110    /// Get StoredFile summary by ID
111    async fn get_stored_file_summary(&self, id: StoredFileId) -> Result<Option<StoredFileSummary>>;
112
113    /// Check if StoredFile exists
114    async fn stored_file_exists(&self, id: StoredFileId) -> Result<bool>;
115
116    /// Get Thumbnail by ID
117    async fn get_thumbnail(&self, id: ThumbnailId) -> Result<Option<ThumbnailDto>>;
118
119    /// Get Thumbnail summary by ID
120    async fn get_thumbnail_summary(&self, id: ThumbnailId) -> Result<Option<ThumbnailSummary>>;
121
122    /// Check if Thumbnail exists
123    async fn thumbnail_exists(&self, id: ThumbnailId) -> Result<bool>;
124
125    /// Get UploadSession by ID
126    async fn get_upload_session(&self, id: UploadSessionId) -> Result<Option<UploadSessionDto>>;
127
128    /// Get UploadSession summary by ID
129    async fn get_upload_session_summary(&self, id: UploadSessionId) -> Result<Option<UploadSessionSummary>>;
130
131    /// Check if UploadSession exists
132    async fn upload_session_exists(&self, id: UploadSessionId) -> Result<bool>;
133
134    /// Get UserQuota by ID
135    async fn get_user_quota(&self, id: UserQuotaId) -> Result<Option<UserQuotaDto>>;
136
137    /// Get UserQuota summary by ID
138    async fn get_user_quota_summary(&self, id: UserQuotaId) -> Result<Option<UserQuotaSummary>>;
139
140    /// Check if UserQuota exists
141    async fn user_quota_exists(&self, id: UserQuotaId) -> Result<bool>;
142
143}
144
145// ============================================================================
146// QUERY SERVICE IMPLEMENTATION
147// ============================================================================
148
149/// Default implementation of BucketQueryService
150pub struct BucketQueryServiceImpl<R> {
151    // A legacy export the generator no longer emits. It is public, so it stays until
152    // the next breaking release; nothing reads its repository.
153    #[allow(dead_code)]
154    repository: Arc<R>,
155}
156
157impl<R> BucketQueryServiceImpl<R> {
158    pub fn new(repository: Arc<R>) -> Self {
159        Self { repository }
160    }
161}
162
163// ============================================================================
164// CUSTOM SERVICES
165// ============================================================================
166
167// <<< CUSTOM SERVICES START >>>
168// Add custom public services here
169// <<< CUSTOM SERVICES END >>>