pub struct EnergyBillUpload {Show 28 fields
pub id: Uuid,
pub campaign_id: Uuid,
pub unit_id: Uuid,
pub building_id: Uuid,
pub organization_id: Uuid,
pub bill_period_start: DateTime<Utc>,
pub bill_period_end: DateTime<Utc>,
pub total_kwh_encrypted: Vec<u8>,
pub energy_type: EnergyType,
pub provider: Option<String>,
pub postal_code: String,
pub file_hash: String,
pub file_path_encrypted: String,
pub ocr_confidence: f64,
pub manually_verified: bool,
pub uploaded_by: Uuid,
pub uploaded_at: DateTime<Utc>,
pub verified_at: Option<DateTime<Utc>>,
pub verified_by: Option<Uuid>,
pub consent_timestamp: DateTime<Utc>,
pub consent_ip: String,
pub consent_user_agent: String,
pub consent_signature_hash: String,
pub anonymized: bool,
pub retention_until: DateTime<Utc>,
pub deleted_at: Option<DateTime<Utc>>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Upload de facture énergie (données chiffrées)
Fields§
§id: Uuid§campaign_id: Uuid§unit_id: Uuid§building_id: Uuid§organization_id: Uuid§bill_period_start: DateTime<Utc>§bill_period_end: DateTime<Utc>§total_kwh_encrypted: Vec<u8>§energy_type: EnergyType§provider: Option<String>§postal_code: String§file_hash: String§file_path_encrypted: String§ocr_confidence: f64§manually_verified: bool§uploaded_by: Uuid§uploaded_at: DateTime<Utc>§verified_at: Option<DateTime<Utc>>§verified_by: Option<Uuid>§consent_timestamp: DateTime<Utc>§consent_ip: String§consent_user_agent: String§consent_signature_hash: String§anonymized: bool§retention_until: DateTime<Utc>§deleted_at: Option<DateTime<Utc>>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl EnergyBillUpload
impl EnergyBillUpload
Sourcepub fn new(
campaign_id: Uuid,
unit_id: Uuid,
building_id: Uuid,
organization_id: Uuid,
bill_period_start: DateTime<Utc>,
bill_period_end: DateTime<Utc>,
total_kwh: f64,
energy_type: EnergyType,
postal_code: String,
file_hash: String,
file_path_encrypted: String,
uploaded_by: Uuid,
consent_ip: String,
consent_user_agent: String,
encryption_key: &[u8; 32],
) -> Result<Self, String>
pub fn new( campaign_id: Uuid, unit_id: Uuid, building_id: Uuid, organization_id: Uuid, bill_period_start: DateTime<Utc>, bill_period_end: DateTime<Utc>, total_kwh: f64, energy_type: EnergyType, postal_code: String, file_hash: String, file_path_encrypted: String, uploaded_by: Uuid, consent_ip: String, consent_user_agent: String, encryption_key: &[u8; 32], ) -> Result<Self, String>
Créer nouvel upload avec consentement
Sourcepub fn decrypt_kwh(&self, key: &[u8; 32]) -> Result<f64, String>
pub fn decrypt_kwh(&self, key: &[u8; 32]) -> Result<f64, String>
Déchiffrer consommation kWh (requiert consentement actif)
Sourcepub fn mark_verified(&mut self, verified_by: Uuid) -> Result<(), String>
pub fn mark_verified(&mut self, verified_by: Uuid) -> Result<(), String>
Marquer comme vérifié (après OCR ou validation manuelle)
Sourcepub fn delete(&mut self) -> Result<(), String>
pub fn delete(&mut self) -> Result<(), String>
Supprimer données (GDPR Art. 17 - Droit à l’effacement)
Sourcepub fn should_auto_delete(&self) -> bool
pub fn should_auto_delete(&self) -> bool
Vérifier si peut être supprimé automatiquement (rétention expirée)
Sourcepub fn withdraw_consent(&mut self) -> Result<(), String>
pub fn withdraw_consent(&mut self) -> Result<(), String>
Retirer consentement (GDPR Art. 7.3)
Trait Implementations§
Source§impl Clone for EnergyBillUpload
impl Clone for EnergyBillUpload
Source§fn clone(&self) -> EnergyBillUpload
fn clone(&self) -> EnergyBillUpload
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EnergyBillUpload
impl Debug for EnergyBillUpload
Source§impl<'de> Deserialize<'de> for EnergyBillUpload
impl<'de> Deserialize<'de> for EnergyBillUpload
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<EnergyBillUpload> for EnergyBillUploadResponse
impl From<EnergyBillUpload> for EnergyBillUploadResponse
Source§fn from(upload: EnergyBillUpload) -> Self
fn from(upload: EnergyBillUpload) -> Self
Converts to this type from the input type.
Source§impl PartialEq for EnergyBillUpload
impl PartialEq for EnergyBillUpload
Source§impl Serialize for EnergyBillUpload
impl Serialize for EnergyBillUpload
impl StructuralPartialEq for EnergyBillUpload
Auto Trait Implementations§
impl Freeze for EnergyBillUpload
impl RefUnwindSafe for EnergyBillUpload
impl Send for EnergyBillUpload
impl Sync for EnergyBillUpload
impl Unpin for EnergyBillUpload
impl UnwindSafe for EnergyBillUpload
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.