ChartOfAccounts

Trait ChartOfAccounts 

Source
pub trait ChartOfAccounts: Send + Sync {
    // Required methods
    fn get_chart<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = LedgerResult<Vec<Account>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn add_account<'life0, 'async_trait>(
        &'life0 mut self,
        account: Account,
    ) -> Pin<Box<dyn Future<Output = LedgerResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_child_accounts<'life0, 'life1, 'async_trait>(
        &'life0 self,
        parent_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = LedgerResult<Vec<Account>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_account_path<'life0, 'life1, 'async_trait>(
        &'life0 self,
        account_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = LedgerResult<Vec<Account>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for implementing custom chart of accounts structures

Required Methods§

Source

fn get_chart<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = LedgerResult<Vec<Account>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the full chart of accounts as a hierarchical structure

Source

fn add_account<'life0, 'async_trait>( &'life0 mut self, account: Account, ) -> Pin<Box<dyn Future<Output = LedgerResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add a new account to the chart

Source

fn get_child_accounts<'life0, 'life1, 'async_trait>( &'life0 self, parent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = LedgerResult<Vec<Account>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all child accounts of a parent account

Source

fn get_account_path<'life0, 'life1, 'async_trait>( &'life0 self, account_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = LedgerResult<Vec<Account>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the full path to an account (for hierarchical display)

Implementors§