pub struct CashPosition {
pub id: String,
pub entity_id: String,
pub bank_account_id: String,
pub currency: String,
pub date: NaiveDate,
pub opening_balance: Decimal,
pub inflows: Decimal,
pub outflows: Decimal,
pub closing_balance: Decimal,
pub available_balance: Decimal,
pub value_date_balance: Decimal,
}Expand description
Daily cash position per entity / bank account / currency.
Fields§
§id: StringUnique position identifier
entity_id: StringLegal entity
bank_account_id: StringBank account holding the cash
currency: StringPosition currency
date: NaiveDatePosition date
opening_balance: DecimalBalance at start of day
inflows: DecimalTotal inflows during the day
outflows: DecimalTotal outflows during the day
closing_balance: DecimalBalance at end of day (opening + inflows - outflows)
available_balance: DecimalAvailable balance (after holds, pending transactions)
value_date_balance: DecimalValue-date balance (settlement-adjusted)
Implementations§
Source§impl CashPosition
impl CashPosition
Sourcepub fn new(
id: impl Into<String>,
entity_id: impl Into<String>,
bank_account_id: impl Into<String>,
currency: impl Into<String>,
date: NaiveDate,
opening_balance: Decimal,
inflows: Decimal,
outflows: Decimal,
) -> Self
pub fn new( id: impl Into<String>, entity_id: impl Into<String>, bank_account_id: impl Into<String>, currency: impl Into<String>, date: NaiveDate, opening_balance: Decimal, inflows: Decimal, outflows: Decimal, ) -> Self
Creates a new cash position.
Sourcepub fn with_available_balance(self, balance: Decimal) -> Self
pub fn with_available_balance(self, balance: Decimal) -> Self
Overrides the available balance.
Sourcepub fn with_value_date_balance(self, balance: Decimal) -> Self
pub fn with_value_date_balance(self, balance: Decimal) -> Self
Overrides the value-date balance.
Sourcepub fn computed_closing_balance(&self) -> Decimal
pub fn computed_closing_balance(&self) -> Decimal
Computes closing balance from opening + inflows - outflows.
Trait Implementations§
Source§impl Clone for CashPosition
impl Clone for CashPosition
Source§fn clone(&self) -> CashPosition
fn clone(&self) -> CashPosition
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 CashPosition
impl Debug for CashPosition
Source§impl<'de> Deserialize<'de> for CashPosition
impl<'de> Deserialize<'de> for CashPosition
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 Serialize for CashPosition
impl Serialize for CashPosition
Source§impl ToNodeProperties for CashPosition
impl ToNodeProperties for CashPosition
Source§fn node_type_name(&self) -> &'static str
fn node_type_name(&self) -> &'static str
Entity type name (snake_case), e.g.
"uncertain_tax_position".Source§fn node_type_code(&self) -> u16
fn node_type_code(&self) -> u16
Numeric entity type code for registry, e.g.
416.Source§fn to_node_properties(&self) -> HashMap<String, GraphPropertyValue>
fn to_node_properties(&self) -> HashMap<String, GraphPropertyValue>
Convert all fields to a property map with camelCase keys.
Auto Trait Implementations§
impl Freeze for CashPosition
impl RefUnwindSafe for CashPosition
impl Send for CashPosition
impl Sync for CashPosition
impl Unpin for CashPosition
impl UnsafeUnpin for CashPosition
impl UnwindSafe for CashPosition
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