Documentation ¶
Index ¶
- Variables
- func DeleteTransactions(tx *sql.Tx, ids []map[string]interface{})
- func InsertTransactions(tx *sql.Tx, accountID int64, inserts []map[string]interface{}, user string) []int64
- func UpdateTransactions(tx *sql.Tx, updates []map[string]interface{}, user string) []int64
- type Account
- type Company
- func AddCompanies(tx *sql.Tx, names []string, user string) []*Company
- func GetAllCompanies(tx *sql.Tx) []*Company
- func GetCompanyByID(tx *sql.Tx, id int64) []*Company
- func GetCompanyByName(tx *sql.Tx, name string) []*Company
- func NewCompany(id int64, name string) *Company
- func UpdateCompanies(tx *sql.Tx, args interface{}, user string) []*Company
- type Transaction
- type TransactionDetail
- func (d *TransactionDetail) GetRelatedDetail(tx *sql.Tx) *TransactionDetail
- func (d *TransactionDetail) GetRelatedTransaction(tx *sql.Tx) *Transaction
- func (d *TransactionDetail) Resolve(p graphql.ResolveParams) (interface{}, error)
- func (d *TransactionDetail) SetRelatedDetail(detail *TransactionDetail)
- func (d *TransactionDetail) SetRelatedTransaction(transaction *Transaction)
Constants ¶
This section is empty.
Variables ¶
var GetCompaniesByIDs = func(tx *sql.Tx, ids []int64) []*Company {
return newCompanySource().setCompanies(getCompaniesByIDs(tx, ids))
}
GetCompaniesByIDs loads specified companies.
Functions ¶
func DeleteTransactions ¶
DeleteTransactions deletes transactions.
Types ¶
type Account ¶
Account with a financial instutition.
func GetAccountByID ¶
GetAccountByID returns the account with ID.
func GetAccountsByCompanyIDs ¶
GetAccountsByCompanyIDs returns the accounts for the sepcified companies.
func GetAccountsByName ¶
GetAccountsByName returns the accounts having name.
func NewAccount ¶
func (*Account) GetCompany ¶
GetCompany returns the company for the account.
type Company ¶
Company contains information about a financial institution.
func AddCompanies ¶
AddCompanies adds new companies.
func GetAllCompanies ¶
GetAllCompanies loads all companies.
func GetCompanyByID ¶
GetCompanyByID returns the company with the ID.
func GetCompanyByName ¶
GetCompanyByName returns the company with the name.
func NewCompany ¶
func UpdateCompanies ¶
UpdateCompanies updates company names.
func (*Company) GetAccounts ¶
GetAccounts returns the accounts for the company.
type Transaction ¶
type Transaction struct { *table.Transaction // contains filtered or unexported fields }
Transaction represents a financial transaction.
func GetTransactions ¶
func GetTransactions(tx *sql.Tx, accountID int64) []*Transaction
GetTransactions returns all transactions for the account.
func GetTransactionsByIDs ¶
func GetTransactionsByIDs(tx *sql.Tx, ids []int64) []*Transaction
GetTransactionsByIDs returns transactions for the specified IDs.
func NewTransaction ¶
func NewTransaction(id int64) *Transaction
func (*Transaction) GetDetails ¶
func (t *Transaction) GetDetails(tx *sql.Tx) []*TransactionDetail
GetDetails returns details for a transaction in the account.
func (*Transaction) Resolve ¶
func (t *Transaction) Resolve(p graphql.ResolveParams) (interface{}, error)
func (*Transaction) SetDetails ¶
func (t *Transaction) SetDetails(details []*TransactionDetail)
SetDetails allows tests to initialize the transaction details.
type TransactionDetail ¶
type TransactionDetail struct { *table.TransactionDetail // contains filtered or unexported fields }
TransactionDetail represents a line item of a financial transaction.
func NewTransactionDetail ¶
func NewTransactionDetail(id int64, txID int64) *TransactionDetail
func (*TransactionDetail) GetRelatedDetail ¶
func (d *TransactionDetail) GetRelatedDetail(tx *sql.Tx) *TransactionDetail
GetRelatedDetail returns the related detail.
func (*TransactionDetail) GetRelatedTransaction ¶
func (d *TransactionDetail) GetRelatedTransaction(tx *sql.Tx) *Transaction
GetRelatedTransaction returns the transaction for a related detail.
func (*TransactionDetail) Resolve ¶
func (d *TransactionDetail) Resolve(p graphql.ResolveParams) (interface{}, error)
func (*TransactionDetail) SetRelatedDetail ¶
func (d *TransactionDetail) SetRelatedDetail(detail *TransactionDetail)
SetRelatedDetail allows test to initialize the related detail.
func (*TransactionDetail) SetRelatedTransaction ¶
func (d *TransactionDetail) SetRelatedTransaction(transaction *Transaction)
SetRelatedTransaction allows test to initialize the related transaction.