[][src]Trait qualinvest_core::accounts::AccountHandler

pub trait AccountHandler: TransactionHandler {
    fn clean_accounts(&mut self) -> Result<(), Error>;
fn init_accounts(&mut self) -> Result<(), Error>;
fn insert_account_if_new(
        &mut self,
        account: &Account
    ) -> Result<usize, DataError>;
fn get_account_id(&mut self, account: &Account) -> Result<usize, DataError>;
fn add_transaction_to_account(
        &mut self,
        account: usize,
        transaction: usize
    ) -> Result<(), DataError>;
fn lookup_hash(
        &mut self,
        hash: &str
    ) -> Result<(Vec<usize>, String), DataError>;
fn insert_doc(
        &mut self,
        transaction_ids: &Vec<usize>,
        hash: &str,
        path: &str
    ) -> Result<(), DataError>;
fn get_all_transactions_with_account(
        &mut self,
        account_id: usize
    ) -> Result<Vec<Transaction>, DataError>; }

Handler for asset depot accounts

Required methods

fn clean_accounts(&mut self) -> Result<(), Error>

Clean database by dropping all tables and than run init

fn init_accounts(&mut self) -> Result<(), Error>

Set up new table for account management

fn insert_account_if_new(
    &mut self,
    account: &Account
) -> Result<usize, DataError>

Insert new account info in database, if it not yet exist

fn get_account_id(&mut self, account: &Account) -> Result<usize, DataError>

Insert new account info in database

fn add_transaction_to_account(
    &mut self,
    account: usize,
    transaction: usize
) -> Result<(), DataError>

Add a transaction to the account

fn lookup_hash(&mut self, hash: &str) -> Result<(Vec<usize>, String), DataError>

Check if we have already parsed a given document by look-up its hash If successful, return the transaction ids and the path of the document

fn insert_doc(
    &mut self,
    transaction_ids: &Vec<usize>,
    hash: &str,
    path: &str
) -> Result<(), DataError>

Insert document information for successfully parsed documents

fn get_all_transactions_with_account(
    &mut self,
    account_id: usize
) -> Result<Vec<Transaction>, DataError>

Get transactions filtered by account id

Loading content...

Implementations on Foreign Types

impl AccountHandler for PostgresDB[src]

fn clean_accounts(&mut self) -> Result<(), Error>[src]

Clean database by dropping all tables and than run init

fn init_accounts(&mut self) -> Result<(), Error>[src]

Set up new table for account management

fn insert_account_if_new(
    &mut self,
    account: &Account
) -> Result<usize, DataError>
[src]

Insert new account info in database

fn get_account_id(&mut self, account: &Account) -> Result<usize, DataError>[src]

Get ID of given account

fn add_transaction_to_account(
    &mut self,
    account: usize,
    transaction: usize
) -> Result<(), DataError>
[src]

Insert transaction to account relation

fn lookup_hash(&mut self, hash: &str) -> Result<(Vec<usize>, String), DataError>[src]

Insert document information for successfully parsed documents

fn insert_doc(
    &mut self,
    transaction_ids: &Vec<usize>,
    hash: &str,
    path: &str
) -> Result<(), DataError>
[src]

Insert document information for successfully parsed documents

fn get_all_transactions_with_account(
    &mut self,
    account_id: usize
) -> Result<Vec<Transaction>, DataError>
[src]

Get transactions filtered by account id

Loading content...

Implementors

Loading content...