Documentation
¶
Index ¶
- type BasicReport
- func (r BasicReport) CalculateTotalExpensePerDescription() map[string]currency.Euro
- func (r BasicReport) Save(filename string) error
- func (r BasicReport) SortExpenses() []transaction.BasicTransaction
- func (r BasicReport) SortIncomes() []transaction.BasicTransaction
- func (r BasicReport) String() string
- func (r BasicReport) Transactions() []transaction.BasicTransaction
- func (r BasicReport) WriteCSV(writer io.Writer) error
- type MultiPayerReport
- func CombineMultiPayerReports(reportName string, reports []Report) (MultiPayerReport, error)
- func NewMultiPayerBudgetReport(reportName string, transactions []transaction.PayerTransaction) MultiPayerReport
- func ReadMultiPayerBudgetReportFromFile(reportName string, path string) (MultiPayerReport, error)
- func (r MultiPayerReport) CalculateTotalExpensePerDescription() map[string]currency.Euro
- func (r MultiPayerReport) Save(filename string) error
- func (r MultiPayerReport) SortExpenses() []transaction.PayerTransaction
- func (r MultiPayerReport) SortIncomes() []transaction.PayerTransaction
- func (r MultiPayerReport) String() string
- func (r MultiPayerReport) Transactions() []transaction.PayerTransaction
- func (r MultiPayerReport) WriteCSV(writer io.Writer) error
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicReport ¶
type BasicReport struct {
Name string
NetIncome currency.Euro
TotalIncome currency.Euro
TotalExpense currency.Euro
// contains filtered or unexported fields
}
BasicReport contains the information to summarize a budget
func CombineBasicReports ¶
func CombineBasicReports(reportName string, reports []Report) (BasicReport, error)
func NewBasicBudgetReport ¶
func NewBasicBudgetReport(reportName string, transactions []transaction.BasicTransaction) BasicReport
NewBasicBudgetReport creates a new report with a given reportName, calculating the total income, total expense, and net income
func ReadDefaultBudgetReportFromFile ¶
func ReadDefaultBudgetReportFromFile(reportName string, path string) (BasicReport, error)
ReadDefaultBudgetReportFromFile reads in a CSV file with transactions, and parses them to create a report
func (BasicReport) CalculateTotalExpensePerDescription ¶
func (r BasicReport) CalculateTotalExpensePerDescription() map[string]currency.Euro
CalculateTotalExpensePerDescription aggregates all expenses by category, and returns this data as a map
func (BasicReport) Save ¶
func (r BasicReport) Save(filename string) error
Save saves the report's transactions to a CSV file The transasctions are saved in order: 1.) Incomes (sorted from largest to smallest) 2.) Expenses (sorted from most to least expensive)
func (BasicReport) SortExpenses ¶
func (r BasicReport) SortExpenses() []transaction.BasicTransaction
SortExpenses sorts expenses in the report from largest expense to smallest expense
func (BasicReport) SortIncomes ¶
func (r BasicReport) SortIncomes() []transaction.BasicTransaction
SortIncomes sort the incomes in the report from largest to smallest
func (BasicReport) String ¶
func (r BasicReport) String() string
String returns a summary of the report, including Name, total income, total expense, net income, and list of transactions
func (BasicReport) Transactions ¶
func (r BasicReport) Transactions() []transaction.BasicTransaction
Transactions returns a copy of the transactions from the report
type MultiPayerReport ¶
type MultiPayerReport struct {
Name string
NetIncome currency.Euro
TotalIncome currency.Euro
TotalExpense currency.Euro
NetIncomePerPayer map[string]currency.Euro
TotalIncomePerPayer map[string]currency.Euro
TotalExpensePerPayer map[string]currency.Euro
// contains filtered or unexported fields
}
MultiPayerReport contains the information to summarize a shared Budget between multiple people
func CombineMultiPayerReports ¶
func CombineMultiPayerReports(reportName string, reports []Report) (MultiPayerReport, error)
func NewMultiPayerBudgetReport ¶
func NewMultiPayerBudgetReport(reportName string, transactions []transaction.PayerTransaction) MultiPayerReport
func ReadMultiPayerBudgetReportFromFile ¶
func ReadMultiPayerBudgetReportFromFile(reportName string, path string) (MultiPayerReport, error)
func (MultiPayerReport) CalculateTotalExpensePerDescription ¶
func (r MultiPayerReport) CalculateTotalExpensePerDescription() map[string]currency.Euro
CalculateTotalExpensePerDescription aggregates all expenses by category, and returns this data as a map
func (MultiPayerReport) Save ¶
func (r MultiPayerReport) Save(filename string) error
Save saves the report's transactions to a CSV file The transasctions are saved in order: 1.) Incomes (sorted from largest to smallest) 2.) Expenses (sorted from most to least expensive)
func (MultiPayerReport) SortExpenses ¶
func (r MultiPayerReport) SortExpenses() []transaction.PayerTransaction
SortExpenses sorts expenses in the report from largest expense to smallest expense
func (MultiPayerReport) SortIncomes ¶
func (r MultiPayerReport) SortIncomes() []transaction.PayerTransaction
SortIncomes sort the incomes in the report from largest to smallest
func (MultiPayerReport) String ¶
func (r MultiPayerReport) String() string
String returns a summary of the report, including the name, income/expenses per payer, and list of transactions
func (MultiPayerReport) Transactions ¶
func (r MultiPayerReport) Transactions() []transaction.PayerTransaction
Transactions returns a copy of the transactions from the report
type Report ¶
func CombineReports ¶
CombineReports merges a slice of reports into a single report It assumes that all reports are of the same type