expenses

package
v0.0.0-...-edf4637 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColombianosGid = "11862121"
View Source
var JointAccountId = "acc_00009Yx2VDcMTatdAVTu0P"
View Source
var QuitoCatsGid = "11593186"
View Source
var SudamericaGid = "7786790"

Functions

func FetchMonzoTransactions

func FetchMonzoTransactions(cfg config.Config, cache cache.CacheManager, monzo oauth.AuthProvider)

func FetchSplitwiseExpenses

func FetchSplitwiseExpenses(cache cache.CacheManager, splitwise oauth.AuthProvider)

func FirstDayOfISOWeek

func FirstDayOfISOWeek(year int, week int, timezone *time.Location) time.Time

func GetLocation

func GetLocation(date time.Time) *time.Location

func GetStats

func GetStats(exps []GroupedExpenses, grandTotal bool) (float64, float64)

Types

type ByWeek

type ByWeek struct {
	Week      int
	StartDate time.Time
	EndDate   time.Time
	Days      []GroupedExpenses
	Mean      float64
}

func GetExpensesByWeek

func GetExpensesByWeek(exps []GroupedExpenses) []ByWeek

type Expense

type Expense struct {
	Id            string    `json:"id"`
	CreatedAt     time.Time `json:"created"`
	Amount        float64   `json:"amount"`
	LocalAmount   float64   `json:"local_amount"`
	LocalCurrency string    `json:"local_currency"`
	Description   string    `json:"description"`
	Notes         string    `json:"notes"`
}

func GetExps

func GetExps(cfg config.Config, cache cache.CacheManager, monzo oauth.AuthProvider, splitwise oauth.AuthProvider) []Expense

func HandleCash

func HandleCash(exp Expense) []Expense

func HandleNights

func HandleNights(exp Expense) []Expense

func (Expense) TestString

func (e Expense) TestString() string

type GroupedExpenses

type GroupedExpenses struct {
	Date       time.Time
	Expenses   []Expense
	Total      float64
	TotalLocal float64
}

func GetAllExpenses

func GetAllExpenses(cfg config.Config, cache cache.CacheManager, monzo oauth.AuthProvider, splitwise oauth.AuthProvider) []GroupedExpenses

type SplitwiseExpense

type SplitwiseExpense struct {
	Id          int       `json:"id"`
	Gid         int       `json:"group_id"`
	CreatedAt   time.Time `json:"date"`
	Cost        string    `json:"cost"`
	Description string    `json:"description"`
	Details     string    `json:"details"`
	DeletedAt   time.Time `json:"deleted_at"`
	Users       []struct {
		UserId int    `json:"user_id"`
		Share  string `json:"owed_share"`
	} `json:"users"`
}

type SplitwiseExpenses

type SplitwiseExpenses struct {
	Expenses []SplitwiseExpense `json:"expenses"`
}

func GetSplitwiseExpenses

func GetSplitwiseExpenses(cache cache.CacheManager, splitwise oauth.AuthProvider) SplitwiseExpenses

type Transaction

type Transaction struct {
	Id        string    `json:"id"`
	CreatedAt time.Time `json:"created"`
	Amount    int       `json:"amount"`
	Merchant  struct {
		Id   string `json:"id"`
		Name string `json:"name"`
	} `json:"merchant"`
	Description       string `json:"Description"`
	Notes             string `json:"notes"`
	LocalAmount       int    `json:"local_amount"`
	LocalCurrency     string `json:"local_currency"`
	IncludeInSpending bool   `json:"include_in_spending"`
	Metadata          struct {
		MastercardApprovalType string `json:"mastercard_approval_type,omitempty"`
	} `json:"metadata"`
	Settled string `json:"settled,omitempty"`
}

type Transactions

type Transactions struct {
	Transactions []Transaction
}

func GetMonzoTransactions

func GetMonzoTransactions(cfg config.Config, cache cache.CacheManager, monzo oauth.AuthProvider) Transactions

Jump to

Keyboard shortcuts

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