2.5 KiB
Bank Support Modules
The bank-account abstraction module is used for all bank account
statements processing. Only one loader is implemented at the moment,
bank-fio for Fio CSV exports.
Modules
Bank Account
(import bank-account)
This module creates a thin abstraction layer for bank accounts and transactions.
(make-bank-account number bank [transactions])
number- account numberbank- bank codetransactions- optional list of initial transactions
Creates a new bank account data structure.
The data structure has the following accessors:
(bank-account-transactions ba)- returns the transactions list(bank-account-number ba)- retrieves the bank account number(bank-account-bank ba)- returns the bank account bank code
The underlying implementation is currently a plain list but is subject to change in the future.
(bank-account-insert account transaction)
account- bank account structuretransaction- transaction structure to add
Adds (prepends) given transaction to the list of transactions of
given bank account.
(make-bank-transaction i d a c v m t A B s)
i- transaction idd- datea- amountc- currencyv- variable symbolm- messaget- transaction typeA- account numberB- bank codes- specific symbol
Creates new bank transaction data structure. The underlying implementation is currently a record.
The following accessors are provided:
bank-transaction-idbank-transaction-datebank-transaction-amountbank-transaction-currencybank-transaction-varsymbank-transaction-messagebank-transaction-typebank-transaction-accountbank-transaction-specsym
More fields with accessors will be added as other modules will need them.
(bank-accounts-member? bas acc bc)
bas- list of known bank accountsacc- account number (string)bc- bank code (string)
Returns true if given combination of acc/bc is in
bas.
Bank Fio
(import bank-fio)
This module implements parser/loader for Fio account statements in CSV format.
(bank-fio-parse fn)
fn- path to given file with CSV export
Uses csv-parse from util-csv module and loads the contents
into bank-account structure with list of bank-transactions.