Documentation
¶
Overview ¶
Package ledger owns normalized accounts, transactions, and money totals.
Index ¶
- func InsertInitialCategories(ctx context.Context, database *db.DB, tx *sql.Tx) error
- type Account
- type AccountKind
- type ImportedAccount
- type ImportedTransaction
- type Store
- func (s *Store) Accounts(ctx context.Context) ([]Account, error)
- func (s *Store) CreateManualAccount(ctx context.Context, name string, kind AccountKind, balance money.Money) (Account, error)
- func (s *Store) Import(ctx context.Context, provider string, accounts []ImportedAccount, ...) error
- func (s *Store) ImportInTx(ctx context.Context, tx *sql.Tx, provider string, accounts []ImportedAccount, ...) error
- func (s *Store) Totals(ctx context.Context) (map[string]money.Money, error)
- func (s *Store) Transactions(ctx context.Context) ([]Transaction, error)
- type Transaction
- type TransactionStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountKind ¶
type AccountKind string
const ( AccountBank AccountKind = "bank" AccountCash AccountKind = "cash" AccountCreditCard AccountKind = "credit_card" AccountBrokerage AccountKind = "brokerage" AccountOther AccountKind = "other" )
type ImportedAccount ¶
type ImportedTransaction ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) CreateManualAccount ¶
func (*Store) Import ¶
func (s *Store) Import(ctx context.Context, provider string, accounts []ImportedAccount, transactions []ImportedTransaction) error
func (*Store) ImportInTx ¶
func (s *Store) ImportInTx(ctx context.Context, tx *sql.Tx, provider string, accounts []ImportedAccount, transactions []ImportedTransaction) error
func (*Store) Transactions ¶
func (s *Store) Transactions(ctx context.Context) ([]Transaction, error)
type Transaction ¶
type TransactionStatus ¶
type TransactionStatus string
const ( TransactionSettled TransactionStatus = "settled" TransactionPending TransactionStatus = "pending" )
Click to show internal directories.
Click to hide internal directories.