pub struct Retainage {
pub id: String,
pub project_id: String,
pub entity_id: String,
pub vendor_id: String,
pub retainage_pct: Decimal,
pub total_held: Decimal,
pub released_amount: Decimal,
pub status: RetainageStatus,
pub inception_date: NaiveDate,
pub last_release_date: Option<NaiveDate>,
}Expand description
Retainage record — a portion of each payment withheld until project completion.
Fields§
§id: StringUnique retainage record ID
project_id: StringProject ID
entity_id: StringEntity ID
vendor_id: StringVendor/subcontractor ID this retainage relates to
retainage_pct: DecimalRetainage percentage (e.g., 0.10 for 10%)
total_held: DecimalTotal retainage held
released_amount: DecimalAmount released to date
status: RetainageStatusCurrent status
inception_date: NaiveDateDate retainage was first held
last_release_date: Option<NaiveDate>Date of last release (if any)
Implementations§
Source§impl Retainage
impl Retainage
Sourcepub fn new(
id: impl Into<String>,
project_id: impl Into<String>,
entity_id: impl Into<String>,
vendor_id: impl Into<String>,
retainage_pct: Decimal,
inception_date: NaiveDate,
) -> Self
pub fn new( id: impl Into<String>, project_id: impl Into<String>, entity_id: impl Into<String>, vendor_id: impl Into<String>, retainage_pct: Decimal, inception_date: NaiveDate, ) -> Self
Creates a new retainage record.
Sourcepub fn add_from_payment(&mut self, payment_amount: Decimal)
pub fn add_from_payment(&mut self, payment_amount: Decimal)
Adds retainage from a payment.
Sourcepub fn balance_held(&self) -> Decimal
pub fn balance_held(&self) -> Decimal
Returns the balance still held.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Retainage
impl<'de> Deserialize<'de> for Retainage
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
Auto Trait Implementations§
impl Freeze for Retainage
impl RefUnwindSafe for Retainage
impl Send for Retainage
impl Sync for Retainage
impl Unpin for Retainage
impl UnsafeUnpin for Retainage
impl UnwindSafe for Retainage
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