pub trait ChargeDistributionRepository: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
distribution: &'life1 ChargeDistribution,
) -> Pin<Box<dyn Future<Output = Result<ChargeDistribution, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_bulk<'life0, 'life1, 'async_trait>(
&'life0 self,
distributions: &'life1 [ChargeDistribution],
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, 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<ChargeDistribution>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_total_due_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<f64, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
distribution: &'life1 ChargeDistribution,
) -> Pin<Box<dyn Future<Output = Result<ChargeDistribution, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
distribution: &'life1 ChargeDistribution,
) -> Pin<Box<dyn Future<Output = Result<ChargeDistribution, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a single charge distribution
Sourcefn create_bulk<'life0, 'life1, 'async_trait>(
&'life0 self,
distributions: &'life1 [ChargeDistribution],
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_bulk<'life0, 'life1, 'async_trait>(
&'life0 self,
distributions: &'life1 [ChargeDistribution],
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create multiple charge distributions in bulk (for performance)
Sourcefn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<ChargeDistribution>, 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<ChargeDistribution>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find charge distribution by ID
Sourcefn find_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_expense<'life0, 'async_trait>(
&'life0 self,
expense_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all charge distributions for an expense/invoice
Sourcefn find_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all charge distributions for a unit
Sourcefn find_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_owner<'life0, 'async_trait>(
&'life0 self,
owner_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChargeDistribution>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all charge distributions for an owner