pub struct Budget {Show 15 fields
pub id: Uuid,
pub organization_id: Uuid,
pub building_id: Uuid,
pub fiscal_year: i32,
pub ordinary_budget: f64,
pub extraordinary_budget: f64,
pub total_budget: f64,
pub status: BudgetStatus,
pub submitted_date: Option<DateTime<Utc>>,
pub approved_date: Option<DateTime<Utc>>,
pub approved_by_meeting_id: Option<Uuid>,
pub monthly_provision_amount: f64,
pub notes: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Représente un budget annuel de copropriété (ordinaire + extraordinaire)
Obligation légale belge: Le budget doit être voté en AG avant le début de l’exercice fiscal. Il détermine les provisions mensuelles à appeler auprès des copropriétaires.
Fields§
§id: Uuid§organization_id: Uuid§building_id: Uuid§fiscal_year: i32Année fiscale (ex: 2025)
ordinary_budget: f64Budget charges ordinaires (€) - Charges courantes récurrentes
extraordinary_budget: f64Budget charges extraordinaires (€) - Travaux et dépenses exceptionnelles
total_budget: f64Budget total (€) = ordinaire + extraordinaire
status: BudgetStatusStatut du budget
submitted_date: Option<DateTime<Utc>>Date de soumission pour vote AG
approved_date: Option<DateTime<Utc>>Date d’approbation par l’AG
approved_by_meeting_id: Option<Uuid>ID de l’AG qui a approuvé le budget
monthly_provision_amount: f64Montant mensuel des provisions à appeler (€) = total_budget / 12 mois
notes: Option<String>Notes / Commentaires
created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl Budget
impl Budget
pub fn new( organization_id: Uuid, building_id: Uuid, fiscal_year: i32, ordinary_budget: f64, extraordinary_budget: f64, ) -> Result<Self, String>
Sourcepub fn submit_for_approval(&mut self) -> Result<(), String>
pub fn submit_for_approval(&mut self) -> Result<(), String>
Soumet le budget pour vote en AG
Sourcepub fn approve(&mut self, meeting_id: Uuid) -> Result<(), String>
pub fn approve(&mut self, meeting_id: Uuid) -> Result<(), String>
Approuve le budget (vote AG positif)
Sourcepub fn update_amounts(
&mut self,
ordinary_budget: f64,
extraordinary_budget: f64,
) -> Result<(), String>
pub fn update_amounts( &mut self, ordinary_budget: f64, extraordinary_budget: f64, ) -> Result<(), String>
Met à jour les montants du budget (uniquement en Draft)
Sourcepub fn update_notes(&mut self, notes: String)
pub fn update_notes(&mut self, notes: String)
Ajoute/met à jour les notes
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Vérifie si le budget est actif (approuvé et pas encore archivé)
Sourcepub fn is_editable(&self) -> bool
pub fn is_editable(&self) -> bool
Vérifie si le budget peut être modifié
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Budget
impl<'de> Deserialize<'de> for Budget
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>,
Source§impl From<Budget> for BudgetResponse
impl From<Budget> for BudgetResponse
impl StructuralPartialEq for Budget
Auto Trait Implementations§
impl Freeze for Budget
impl RefUnwindSafe for Budget
impl Send for Budget
impl Sync for Budget
impl Unpin for Budget
impl UnwindSafe for Budget
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
§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>
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>
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 more