Documentation
¶
Index ¶
Constants ¶
View Source
const CurrencyConversionEndpoint = "http://api.exchangeratesapi.io"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CurrencyConversion ¶
type CurrencyConversionResponse ¶
type CurrencyConversionResponse struct {
Date string
Timestamp int
Base string
Rates map[string]float64
}
{"rates":{"CAD":1.3259376651},"date":"2019-03-19","base":"USD"}
type CurrencyConverter ¶
type CurrencyConverter struct {
// contains filtered or unexported fields
}
func NewCurrencyConverter ¶
func NewCurrencyConverter(accessKey string) *CurrencyConverter
func (*CurrencyConverter) ConversionRate ¶
func (c *CurrencyConverter) ConversionRate(from, to string) (float64, error)
type FinancialImporter ¶
func NewTransactionImporter ¶
func NewTransactionImporter(db *bun.DB, currencyConverter *CurrencyConverter, transactions []Transaction, calculatedFields []config.CalculatedField, transactionCurrency string, currencies []string, importAfterDate time.Time, sqlTable string) FinancialImporter
type SQLTransaction ¶
type SQLTransaction struct {
bun.BaseModel `bun:"table:transactions"`
ID int64 `bun:",pk,autoincrement"`
Key string `bun:",pk,unique"`
TransactionDate time.Time
TransactionMonth time.Time
Category string
CategoryGroup string
Payee string
Account string
Memo string `bun:"type:text"`
Currency string
Amount float64
USD float64
CAD float64
TransactionType string
Tags []string `bun:",array"`
Fields map[string]interface{} `bun:"type:jsonb"`
UpdatedAt time.Time
}
type Transaction ¶
type TransactionImporter ¶
type TransactionImporter struct {
// contains filtered or unexported fields
}
func (*TransactionImporter) Import ¶
func (importer *TransactionImporter) Import() (int, error)
func (*TransactionImporter) Migrate ¶
func (importer *TransactionImporter) Migrate() error
type TransactionType ¶
type TransactionType int
const ( Expense TransactionType = iota Income Transfer )
func (TransactionType) String ¶
func (t TransactionType) String() string
Click to show internal directories.
Click to hide internal directories.