pub struct DocumentUseCases { /* private fields */ }Implementations§
Source§impl DocumentUseCases
impl DocumentUseCases
pub fn new( repository: Arc<dyn DocumentRepository>, file_storage: FileStorage, ) -> Self
Sourcepub async fn upload_document(
&self,
organization_id: Uuid,
building_id: Uuid,
document_type: DocumentType,
title: String,
description: Option<String>,
filename: String,
file_content: Vec<u8>,
mime_type: String,
uploaded_by: Uuid,
) -> Result<DocumentResponse, String>
pub async fn upload_document( &self, organization_id: Uuid, building_id: Uuid, document_type: DocumentType, title: String, description: Option<String>, filename: String, file_content: Vec<u8>, mime_type: String, uploaded_by: Uuid, ) -> Result<DocumentResponse, String>
Upload a document with file content
Sourcepub async fn get_document(&self, id: Uuid) -> Result<DocumentResponse, String>
pub async fn get_document(&self, id: Uuid) -> Result<DocumentResponse, String>
Get document metadata by ID
Sourcepub async fn download_document(
&self,
id: Uuid,
) -> Result<(Vec<u8>, String, String), String>
pub async fn download_document( &self, id: Uuid, ) -> Result<(Vec<u8>, String, String), String>
Download document file content
Sourcepub async fn list_documents_by_building(
&self,
building_id: Uuid,
) -> Result<Vec<DocumentResponse>, String>
pub async fn list_documents_by_building( &self, building_id: Uuid, ) -> Result<Vec<DocumentResponse>, String>
List all documents for a building
Sourcepub async fn list_documents_by_meeting(
&self,
meeting_id: Uuid,
) -> Result<Vec<DocumentResponse>, String>
pub async fn list_documents_by_meeting( &self, meeting_id: Uuid, ) -> Result<Vec<DocumentResponse>, String>
List all documents for a meeting
Sourcepub async fn list_documents_paginated(
&self,
page_request: &PageRequest,
organization_id: Option<Uuid>,
) -> Result<(Vec<DocumentResponse>, i64), String>
pub async fn list_documents_paginated( &self, page_request: &PageRequest, organization_id: Option<Uuid>, ) -> Result<(Vec<DocumentResponse>, i64), String>
List all documents with pagination
Sourcepub async fn link_to_meeting(
&self,
id: Uuid,
request: LinkDocumentToMeetingRequest,
) -> Result<DocumentResponse, String>
pub async fn link_to_meeting( &self, id: Uuid, request: LinkDocumentToMeetingRequest, ) -> Result<DocumentResponse, String>
Link a document to a meeting
Sourcepub async fn link_to_expense(
&self,
id: Uuid,
request: LinkDocumentToExpenseRequest,
) -> Result<DocumentResponse, String>
pub async fn link_to_expense( &self, id: Uuid, request: LinkDocumentToExpenseRequest, ) -> Result<DocumentResponse, String>
Link a document to an expense
Auto Trait Implementations§
impl Freeze for DocumentUseCases
impl !RefUnwindSafe for DocumentUseCases
impl Send for DocumentUseCases
impl Sync for DocumentUseCases
impl Unpin for DocumentUseCases
impl !UnwindSafe for DocumentUseCases
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Fake for T
impl<T> Fake for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more