domain

package
v0.0.0-...-b55247b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetCompaniesByIDs = func(tx *sql.Tx, ids []int64) []*Company {
	return newCompanySource().setCompanies(getCompaniesByIDs(tx, ids))
}

GetCompaniesByIDs loads specified companies.

Functions

func DeleteTransactions

func DeleteTransactions(tx *sql.Tx, ids []map[string]interface{})

DeleteTransactions deletes transactions.

func InsertTransactions

func InsertTransactions(tx *sql.Tx, accountID int64, inserts []map[string]interface{}, user string) []int64

InsertTransactions inserts transactions.

func UpdateTransactions

func UpdateTransactions(tx *sql.Tx, updates []map[string]interface{}, user string) []int64

UpdateTransactions updates transactions.

Types

type Account

type Account struct {
	*table.Account
	// contains filtered or unexported fields
}

Account with a financial instutition.

func GetAccountByID

func GetAccountByID(tx *sql.Tx, id int64) []*Account

GetAccountByID returns the account with ID.

func GetAccountsByCompanyIDs

func GetAccountsByCompanyIDs(tx *sql.Tx, companyIDs []int64) []*Account

GetAccountsByCompanyIDs returns the accounts for the sepcified companies.

func GetAccountsByName

func GetAccountsByName(tx *sql.Tx, name string) []*Account

GetAccountsByName returns the accounts having name.

func GetAllAccounts

func GetAllAccounts(tx *sql.Tx) []*Account

GetAllAccounts loads all accounts.

func NewAccount

func NewAccount(id int64, companyID *int64) *Account

func (*Account) GetCompany

func (a *Account) GetCompany(tx *sql.Tx) *Company

GetCompany returns the company for the account.

func (*Account) Resolve

func (a *Account) Resolve(p graphql.ResolveParams) (interface{}, error)

type Company

type Company struct {
	*table.Company
	// contains filtered or unexported fields
}

Company contains information about a financial institution.

func AddCompanies

func AddCompanies(tx *sql.Tx, names []string, user string) []*Company

AddCompanies adds new companies.

func GetAllCompanies

func GetAllCompanies(tx *sql.Tx) []*Company

GetAllCompanies loads all companies.

func GetCompanyByID

func GetCompanyByID(tx *sql.Tx, id int64) []*Company

GetCompanyByID returns the company with the ID.

func GetCompanyByName

func GetCompanyByName(tx *sql.Tx, name string) []*Company

GetCompanyByName returns the company with the name.

func NewCompany

func NewCompany(id int64, name string) *Company

func UpdateCompanies

func UpdateCompanies(tx *sql.Tx, args interface{}, user string) []*Company

UpdateCompanies updates company names.

func (*Company) GetAccounts

func (c *Company) GetAccounts(tx *sql.Tx) []*Account

GetAccounts returns the accounts for the company.

func (*Company) Resolve

func (c *Company) Resolve(p graphql.ResolveParams) (interface{}, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL