Documentation ¶
Index ¶
- Constants
- type Account
- type Budget
- type MockYNAB
- func (m *MockYNAB) Accounts(budgetID string) ([]*Account, error)
- func (m *MockYNAB) Budgets() ([]*Budget, error)
- func (m *MockYNAB) GetTransactions(budgetID string, accountID string) ([]*Transaction, error)
- func (m *MockYNAB) SendTransactions(budgetID string, accountID string, transactions []*Transaction) ([]string, error)
- type Repo
- type Service
- type Transaction
- type Ynab
- func (y *Ynab) Accounts(budgetID string) ([]*Account, error)
- func (y *Ynab) Budgets() ([]*Budget, error)
- func (y *Ynab) GetTransactions(budgetID string, accountID string) ([]*Transaction, error)
- func (y *Ynab) SendTransactions(budgetID string, accountID string, transactions []*Transaction) ([]string, error)
Constants ¶
View Source
const ( // AmountFactor is the amount by which the actual currency AmountFactor = 1000 // CurrencySEK is the print string for SEK CurrencySEK = "SEK" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Name string ID string Type string Transactions []*Transaction }
Account is a bank account
type MockYNAB ¶
MockYNAB is a mock implementation
func (*MockYNAB) GetTransactions ¶
func (m *MockYNAB) GetTransactions(budgetID string, accountID string) ([]*Transaction, error)
GetTransactions is a mock implementation
func (*MockYNAB) SendTransactions ¶
func (m *MockYNAB) SendTransactions(budgetID string, accountID string, transactions []*Transaction) ([]string, error)
SendTransactions is a mock implementation
type Repo ¶
type Repo interface { Budgets() ([]*Budget, error) Accounts(budgetID string) ([]*Account, error) GetTransactions(budgetID string, accountID string) ([]*Transaction, error) SendTransactions(budgetID string, accountID string, transactions []*Transaction) ([]string, error) }
Repo is the budgets repository interface
type Service ¶
type Service interface { Get() ([]*Budget, error) Push(budgetID, accountID string, transactions []*Transaction, allowDuplicates bool) ([]string, error) }
Service is the Budget service
type Transaction ¶
type Transaction struct { ID string Date time.Time Amount int64 PayeeName string Memo string Cleared string Approved bool }
Transaction is the Ynab Representation of a transaction
func (*Transaction) AmountPretty ¶
func (t *Transaction) AmountPretty(currency string) string
AmountPretty returns a formatted currency string for the amount
type Ynab ¶
type Ynab struct {
// contains filtered or unexported fields
}
Ynab is the YNAB Repo implementation
func (*Ynab) GetTransactions ¶
func (y *Ynab) GetTransactions(budgetID string, accountID string) ([]*Transaction, error)
GetTransactions returns all transactions from a given account
func (*Ynab) SendTransactions ¶
func (y *Ynab) SendTransactions(budgetID string, accountID string, transactions []*Transaction) ([]string, error)
SendTransactions sends a slice of transactions to YNAB
Click to show internal directories.
Click to hide internal directories.