pub struct Expense {
pub id: Uuid,
pub organization_id: Uuid,
pub building_id: Uuid,
pub category: ExpenseCategory,
pub description: String,
pub amount: f64,
pub expense_date: DateTime<Utc>,
pub payment_status: PaymentStatus,
pub supplier: Option<String>,
pub invoice_number: Option<String>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Représente une charge de copropriété
Fields§
§id: Uuid§organization_id: Uuid§building_id: Uuid§category: ExpenseCategory§description: String§amount: f64§expense_date: DateTime<Utc>§payment_status: PaymentStatus§supplier: Option<String>§invoice_number: Option<String>§created_at: DateTime<Utc>§updated_at: DateTime<Utc>Implementations§
Source§impl Expense
impl Expense
pub fn new( organization_id: Uuid, building_id: Uuid, category: ExpenseCategory, description: String, amount: f64, expense_date: DateTime<Utc>, supplier: Option<String>, invoice_number: Option<String>, ) -> Result<Self, String>
pub fn mark_as_paid(&mut self)
pub fn mark_as_overdue(&mut self)
pub fn cancel(&mut self)
pub fn is_paid(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Expense
impl<'de> Deserialize<'de> for Expense
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
impl StructuralPartialEq for Expense
Auto Trait Implementations§
impl Freeze for Expense
impl RefUnwindSafe for Expense
impl Send for Expense
impl Sync for Expense
impl Unpin for Expense
impl UnwindSafe for Expense
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
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 more