Documentation ¶
Overview ¶
Package budgit is the domain package. It contains the domain objects for budgiting.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidCurrency = fmt.Errorf("given currency is not valid")
)
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID string Name string Balance Balance ExternalAccount *ExternalAccount }
Account is an account internal to budgit.
type Balance ¶
type Balance struct { ClearedBalance BalanceAmount EffectiveBalance BalanceAmount }
Balance is a Balance, holding BalanceAmounts of the cleared and effective balances.
type BalanceAmount ¶
type BalanceAmount int64
BalanceAmount stores a balance amount with no decimals, assuming the maximum number of decimal points is 2. e.g. £10 is stored as 100.
func (BalanceAmount) String ¶
func (b BalanceAmount) String() string
type ExternalAccount ¶
type ExternalAccount struct { ID string Name string IntegrationID string LastSyncTimestamp time.Time Balance Balance }
ExternalAccount is an Account representing some real, external Account that is attached to a budgit Account.
type Transaction ¶
type Transaction struct { ID string EffectiveDate time.Time AccountID string PayeeID string IsPayeeInternal bool CategoryID string Amount BalanceAmount Cleared bool }
Transaction is an Transaction, unique only within a given Budget.
func (Transaction) Mirror ¶
func (t Transaction) Mirror(id string) *Transaction
Mirror mirrors the transaction, by returning another with the same fields but:
- ID is replaced with given ID
- Account and Payee IDs are swapped
- Amount is negated
Click to show internal directories.
Click to hide internal directories.