pub struct RunningBalanceTracker { /* private fields */ }Expand description
Tracks running balances for all accounts across companies.
Implementations§
Source§impl RunningBalanceTracker
impl RunningBalanceTracker
Sourcepub fn new_with_currency_and_framework(
config: BalanceTrackerConfig,
currency: String,
framework: &str,
) -> Self
pub fn new_with_currency_and_framework( config: BalanceTrackerConfig, currency: String, framework: &str, ) -> Self
Creates a new balance tracker with the specified currency and accounting framework.
Sourcepub fn new_with_currency(config: BalanceTrackerConfig, currency: String) -> Self
pub fn new_with_currency(config: BalanceTrackerConfig, currency: String) -> Self
Creates a new balance tracker with the specified currency (defaults to US GAAP).
Sourcepub fn new(config: BalanceTrackerConfig) -> Self
pub fn new(config: BalanceTrackerConfig) -> Self
Creates a new balance tracker (defaults to USD and US GAAP).
Sourcepub fn new_with_framework(config: BalanceTrackerConfig, framework: &str) -> Self
pub fn new_with_framework(config: BalanceTrackerConfig, framework: &str) -> Self
Creates a new balance tracker for a specific accounting framework (defaults to USD).
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Creates a tracker with default configuration (US GAAP).
Sourcepub fn register_account_type(
&mut self,
account_code: &str,
account_type: AccountType,
)
pub fn register_account_type( &mut self, account_code: &str, account_type: AccountType, )
Registers an account type for balance tracking.
Sourcepub fn register_account_types(&mut self, types: &[(String, AccountType)])
pub fn register_account_types(&mut self, types: &[(String, AccountType)])
Registers multiple account types.
Sourcepub fn register_from_chart_prefixes(&mut self, prefixes: &[(&str, AccountType)])
pub fn register_from_chart_prefixes(&mut self, prefixes: &[(&str, AccountType)])
Registers account types from a chart of accounts prefix pattern.
Sourcepub fn initialize_from_snapshot(&mut self, snapshot: &BalanceSnapshot)
pub fn initialize_from_snapshot(&mut self, snapshot: &BalanceSnapshot)
Initializes balances from opening balance snapshot.
Sourcepub fn apply_entry(
&mut self,
entry: &JournalEntry,
) -> Result<(), ValidationError>
pub fn apply_entry( &mut self, entry: &JournalEntry, ) -> Result<(), ValidationError>
Applies a journal entry to the running balances.
Sourcepub fn apply_entries(
&mut self,
entries: &[JournalEntry],
) -> Vec<ValidationError>
pub fn apply_entries( &mut self, entries: &[JournalEntry], ) -> Vec<ValidationError>
Applies a batch of entries.
Sourcepub fn validate_balance_sheet(
&mut self,
company_code: &str,
date: NaiveDate,
entry_id: Option<&str>,
) -> Result<(), ValidationError>
pub fn validate_balance_sheet( &mut self, company_code: &str, date: NaiveDate, entry_id: Option<&str>, ) -> Result<(), ValidationError>
Validates the balance sheet equation for a company.
Sourcepub fn get_snapshot(
&self,
company_code: &str,
as_of_date: NaiveDate,
) -> Option<BalanceSnapshot>
pub fn get_snapshot( &self, company_code: &str, as_of_date: NaiveDate, ) -> Option<BalanceSnapshot>
Gets the current snapshot for a company.
Sourcepub fn get_all_snapshots(&self, as_of_date: NaiveDate) -> Vec<BalanceSnapshot>
pub fn get_all_snapshots(&self, as_of_date: NaiveDate) -> Vec<BalanceSnapshot>
Gets snapshots for all companies.
Sourcepub fn get_balance_changes(
&self,
company_code: &str,
from_date: NaiveDate,
to_date: NaiveDate,
) -> Vec<AccountPeriodActivity>
pub fn get_balance_changes( &self, company_code: &str, from_date: NaiveDate, to_date: NaiveDate, ) -> Vec<AccountPeriodActivity>
Gets balance changes for a period.
Sourcepub fn get_account_balance(
&self,
company_code: &str,
account_code: &str,
) -> Option<&AccountBalance>
pub fn get_account_balance( &self, company_code: &str, account_code: &str, ) -> Option<&AccountBalance>
Gets balance for a specific account.
Sourcepub fn get_validation_errors(&self) -> &[ValidationError]
pub fn get_validation_errors(&self) -> &[ValidationError]
Gets all validation errors.
Sourcepub fn clear_validation_errors(&mut self)
pub fn clear_validation_errors(&mut self)
Clears validation errors.
Sourcepub fn get_statistics(&self) -> &TrackerStatistics
pub fn get_statistics(&self) -> &TrackerStatistics
Gets tracker statistics.
Sourcepub fn roll_forward(&mut self, _new_period_start: NaiveDate)
pub fn roll_forward(&mut self, _new_period_start: NaiveDate)
Rolls forward balances to a new period.