pub trait EnergyBillUploadRepository: Send + Sync {
// Required methods
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 EnergyBillUpload,
) -> Pin<Box<dyn Future<Output = Result<EnergyBillUpload, 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<EnergyBillUpload>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_campaign<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<EnergyBillUpload>, 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<EnergyBillUpload>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_by_campaign_and_unit<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<EnergyBillUpload>, 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<EnergyBillUpload>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 EnergyBillUpload,
) -> Pin<Box<dyn Future<Output = Result<EnergyBillUpload, 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<(), 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<EnergyBillUpload>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count_verified_by_campaign<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i32, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn find_verified_by_campaign<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<EnergyBillUpload>, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<i32, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Repository trait for energy bill upload persistence
Required Methods§
Sourcefn create<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 EnergyBillUpload,
) -> Pin<Box<dyn Future<Output = Result<EnergyBillUpload, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 EnergyBillUpload,
) -> Pin<Box<dyn Future<Output = Result<EnergyBillUpload, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new energy bill upload
Sourcefn find_by_id<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<EnergyBillUpload>, 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<EnergyBillUpload>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find bill upload by ID
Sourcefn find_by_campaign<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<EnergyBillUpload>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_campaign<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<EnergyBillUpload>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all uploads for a campaign
Sourcefn find_by_unit<'life0, 'async_trait>(
&'life0 self,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<EnergyBillUpload>, 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<EnergyBillUpload>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all uploads for a unit
Sourcefn find_by_campaign_and_unit<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<EnergyBillUpload>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_by_campaign_and_unit<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
unit_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Option<EnergyBillUpload>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find upload for a specific campaign and unit
Sourcefn find_by_building<'life0, 'async_trait>(
&'life0 self,
building_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<EnergyBillUpload>, 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<EnergyBillUpload>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find uploads by building
Sourcefn update<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 EnergyBillUpload,
) -> Pin<Box<dyn Future<Output = Result<EnergyBillUpload, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update<'life0, 'life1, 'async_trait>(
&'life0 self,
upload: &'life1 EnergyBillUpload,
) -> Pin<Box<dyn Future<Output = Result<EnergyBillUpload, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update bill upload
Sourcefn delete<'life0, 'async_trait>(
&'life0 self,
id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<(), 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<(), String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete bill upload (soft delete)
Sourcefn find_expired<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<EnergyBillUpload>, 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<EnergyBillUpload>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find uploads that need auto-deletion (retention period expired)
Sourcefn count_verified_by_campaign<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i32, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count_verified_by_campaign<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<i32, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get count of verified uploads for a campaign (for k-anonymity check)
Sourcefn find_verified_by_campaign<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<EnergyBillUpload>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn find_verified_by_campaign<'life0, 'async_trait>(
&'life0 self,
campaign_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<Vec<EnergyBillUpload>, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Find all verified, non-deleted uploads for a campaign (for aggregation)