pub struct EnergyBillUploadUseCases { /* private fields */ }Implementations§
Source§impl EnergyBillUploadUseCases
impl EnergyBillUploadUseCases
pub fn new( upload_repo: Arc<dyn EnergyBillUploadRepository>, campaign_repo: Arc<dyn EnergyCampaignRepository>, ) -> Self
Sourcepub async fn upload_bill(
&self,
upload: EnergyBillUpload,
) -> Result<EnergyBillUpload, String>
pub async fn upload_bill( &self, upload: EnergyBillUpload, ) -> Result<EnergyBillUpload, String>
Upload energy bill with GDPR consent
Sourcepub async fn get_upload(
&self,
id: Uuid,
) -> Result<Option<EnergyBillUpload>, String>
pub async fn get_upload( &self, id: Uuid, ) -> Result<Option<EnergyBillUpload>, String>
Get upload by ID
Sourcepub async fn get_uploads_by_campaign(
&self,
campaign_id: Uuid,
) -> Result<Vec<EnergyBillUpload>, String>
pub async fn get_uploads_by_campaign( &self, campaign_id: Uuid, ) -> Result<Vec<EnergyBillUpload>, String>
Get all uploads for a campaign
Sourcepub async fn get_my_uploads(
&self,
unit_id: Uuid,
) -> Result<Vec<EnergyBillUpload>, String>
pub async fn get_my_uploads( &self, unit_id: Uuid, ) -> Result<Vec<EnergyBillUpload>, String>
Get my uploads (for a specific unit)
Sourcepub async fn verify_upload(
&self,
upload_id: Uuid,
verified_by: Uuid,
) -> Result<EnergyBillUpload, String>
pub async fn verify_upload( &self, upload_id: Uuid, verified_by: Uuid, ) -> Result<EnergyBillUpload, String>
Verify upload (manual verification by admin)
Sourcepub async fn anonymize_upload(
&self,
upload_id: Uuid,
) -> Result<EnergyBillUpload, String>
pub async fn anonymize_upload( &self, upload_id: Uuid, ) -> Result<EnergyBillUpload, String>
Anonymize upload (add to building aggregate)
Sourcepub async fn batch_anonymize_campaign(
&self,
campaign_id: Uuid,
) -> Result<i32, String>
pub async fn batch_anonymize_campaign( &self, campaign_id: Uuid, ) -> Result<i32, String>
Batch anonymize all verified uploads for a campaign
Sourcepub async fn decrypt_consumption(
&self,
upload_id: Uuid,
requester_unit_id: Uuid,
encryption_key: &[u8; 32],
) -> Result<f64, String>
pub async fn decrypt_consumption( &self, upload_id: Uuid, requester_unit_id: Uuid, encryption_key: &[u8; 32], ) -> Result<f64, String>
Decrypt consumption data (requires encryption key and ownership)
Sourcepub async fn delete_upload(
&self,
upload_id: Uuid,
requester_unit_id: Uuid,
) -> Result<(), String>
pub async fn delete_upload( &self, upload_id: Uuid, requester_unit_id: Uuid, ) -> Result<(), String>
Delete upload (GDPR Art. 17 - Right to erasure)
Sourcepub async fn withdraw_consent(
&self,
upload_id: Uuid,
requester_unit_id: Uuid,
) -> Result<(), String>
pub async fn withdraw_consent( &self, upload_id: Uuid, requester_unit_id: Uuid, ) -> Result<(), String>
Withdraw consent (GDPR Art. 7.3 - Immediate deletion)
Sourcepub async fn get_verified_count(&self, campaign_id: Uuid) -> Result<i32, String>
pub async fn get_verified_count(&self, campaign_id: Uuid) -> Result<i32, String>
Get count of verified uploads for a campaign (k-anonymity check)
Sourcepub async fn check_k_anonymity(&self, campaign_id: Uuid) -> Result<bool, String>
pub async fn check_k_anonymity(&self, campaign_id: Uuid) -> Result<bool, String>
Check if k-anonymity threshold is met (minimum 5 participants)
Sourcepub async fn cleanup_expired(&self) -> Result<i32, String>
pub async fn cleanup_expired(&self) -> Result<i32, String>
Auto-delete expired uploads (GDPR retention policy)
Sourcepub async fn get_expired_count(&self) -> Result<usize, String>
pub async fn get_expired_count(&self) -> Result<usize, String>
Get expired uploads count (for reporting)
Auto Trait Implementations§
impl Freeze for EnergyBillUploadUseCases
impl !RefUnwindSafe for EnergyBillUploadUseCases
impl Send for EnergyBillUploadUseCases
impl Sync for EnergyBillUploadUseCases
impl Unpin for EnergyBillUploadUseCases
impl !UnwindSafe for EnergyBillUploadUseCases
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> Chain<T> for T
impl<T> Chain<T> for T
§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 moreCreates a shared type from an unshared type.