pub trait QuoteRepository: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
quote: &'life1 Quote,
) -> Pin<Box<dyn Future<Output = Result<Quote, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Quote>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_contractor<'life0, 'async_trait>(
&'life0 self,
contractor_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_status<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_by_ids<'life0, 'async_trait>(
&'life0 self,
ids: Vec<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_project_title<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
project_title: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn find_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
quote: &'life1 Quote,
) -> Pin<Box<dyn Future<Output = Result<Quote, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_by_status<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<i64, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Port (interface) for Quote repository (Belgian legal requirement: 3 quotes >5000€)
Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
quote: &'life1 Quote,
) -> Pin<Box<dyn Future<Output = Result<Quote, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
quote: &'life1 Quote,
) -> Pin<Box<dyn Future<Output = Result<Quote, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create new quote
Sourcefn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find quote by ID
Sourcefn find_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all quotes for a building
Sourcefn find_by_contractor<'life0, 'async_trait>(
&'life0 self,
contractor_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_contractor<'life0, 'async_trait>(
&'life0 self,
contractor_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all quotes for a contractor
Sourcefn find_by_status<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_status<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
status: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find quotes by status
Sourcefn find_by_ids<'life0, 'async_trait>(
&'life0 self,
ids: Vec<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_ids<'life0, 'async_trait>(
&'life0 self,
ids: Vec<Uuid>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find multiple quotes by IDs (for comparison)
Sourcefn find_by_project_title<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
project_title: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_by_project_title<'life0, 'life1, 'async_trait>(
&'life0 self,
building_id: Uuid,
project_title: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Find quotes for a specific project (by title)
Sourcefn find_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Quote>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find expired quotes (for background job)
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
quote: &'life1 Quote,
) -> Pin<Box<dyn Future<Output = Result<Quote, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
quote: &'life1 Quote,
) -> Pin<Box<dyn Future<Output = Result<Quote, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update quote
Sourcefn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete quote