pub struct CashPositionGenerator { /* private fields */ }Expand description
Generates daily cash positions by aggregating cash flows per bank account.
Implementations§
Source§impl CashPositionGenerator
impl CashPositionGenerator
Sourcepub fn new(seed: u64, config: CashPositioningConfig) -> Self
pub fn new(seed: u64, config: CashPositioningConfig) -> Self
Creates a new cash position generator.
Sourcepub fn generate(
&mut self,
entity_id: &str,
account_id: &str,
currency: &str,
flows: &[CashFlow],
start_date: NaiveDate,
end_date: NaiveDate,
opening_balance: Decimal,
) -> Vec<CashPosition>
pub fn generate( &mut self, entity_id: &str, account_id: &str, currency: &str, flows: &[CashFlow], start_date: NaiveDate, end_date: NaiveDate, opening_balance: Decimal, ) -> Vec<CashPosition>
Generates daily cash positions for a single bank account over a date range.
§Arguments
entity_id— Legal entity identifieraccount_id— Bank account identifiercurrency— Account currencyflows— Cash flows for this account (filtered by caller)start_date— First day of the position seriesend_date— Last day (inclusive) of the position seriesopening_balance— Opening balance on the start date
Sourcepub fn generate_multi_account(
&mut self,
entity_id: &str,
accounts: &[(String, String, Decimal)],
flows: &[CashFlow],
start_date: NaiveDate,
end_date: NaiveDate,
) -> Vec<CashPosition>
pub fn generate_multi_account( &mut self, entity_id: &str, accounts: &[(String, String, Decimal)], flows: &[CashFlow], start_date: NaiveDate, end_date: NaiveDate, ) -> Vec<CashPosition>
Generates positions for multiple bank accounts in a single entity.
Sourcepub fn minimum_balance_policy(&self) -> Decimal
pub fn minimum_balance_policy(&self) -> Decimal
Returns the minimum balance policy from config.
Auto Trait Implementations§
impl Freeze for CashPositionGenerator
impl RefUnwindSafe for CashPositionGenerator
impl Send for CashPositionGenerator
impl Sync for CashPositionGenerator
impl Unpin for CashPositionGenerator
impl UnsafeUnpin for CashPositionGenerator
impl UnwindSafe for CashPositionGenerator
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