Documentation
¶
Index ¶
- type AccountManager
- type AccountNameAndID
- type AccountNotFoundError
- type AccountRepositoryInterface
- type AccountTypeRepositoryInterface
- type BalanceRepositoryInterface
- type BankOfAmericaCreditCardCSVParser
- type BudgetAndSpend
- type BudgetRepositoryInterface
- type BudgetService
- func (bs *BudgetService) GetAllBudgetsAndCurrentSpend() (budgetsAndSpend []BudgetAndSpend, err error)
- func (bs *BudgetService) GetBudgetAndMonthlySpend(budgetID uint, numOfMonths int) (budgetsAndSpend []BudgetAndSpend, err error)
- func (bs *BudgetService) GetMeanAndStandardDeviation(budgetID uint, numOfMonths int) (averageSpend int, standardDeviation int, err error)
- type CapitalOneCreditCardCSVParser
- type CapitalOneSavingsCSVParser
- type CashFlowData
- type CashFlowService
- type CategorizerInterface
- type Categorizes
- type CategoryRepositoryInterface
- type ChaseCheckingCSVParser
- type ChaseCreditCardCSVParser
- type ExpenseByCategory
- type FidelityBrokerageCSVParser
- type FidelityCreditCardCSVParser
- type GeneralCSVParser
- type ImportAccountRepositoryInterface
- type ImportService
- type ImportSubmissionRepositoryInterface
- type ImportTransactionRepositoryInterface
- type MLCategorizer
- type MockAccountRepository
- type MockBalanceRepository
- type MockCategorizer
- type MockCategoryRepository
- type MockImportSubmissionRepository
- type MockParser
- type MockTransactionRepository
- type NoParserError
- type Parser
- type SchwabBrokerageCSVParser
- type SchwabCheckingCSVParser
- type TargetCreditCardCSVParser
- type TransactionRepositoryInterface
- type UWCUMortgageCSVParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountManager ¶
type AccountManager struct {
AccountRepository AccountRepositoryInterface
AccountTypeRepository AccountTypeRepositoryInterface
}
func (*AccountManager) GetAccountNamesAndIDs ¶
func (am *AccountManager) GetAccountNamesAndIDs() (result []AccountNameAndID, err error)
func (*AccountManager) GetAccountTypeByID ¶
func (am *AccountManager) GetAccountTypeByID(id uint) (models.AccountType, error)
GetAccountTypeByID returns the account type for a given account ID If the account type is not found, it returns an error
Arguments: id - The ID of the account type to retrieve
Returns: - The account type object - An error if the account type is not found or if there was an error retrieving it
type AccountNameAndID ¶
type AccountNotFoundError ¶
type AccountNotFoundError struct {
AccountID uint
}
func (*AccountNotFoundError) Error ¶
func (a *AccountNotFoundError) Error() string
type AccountTypeRepositoryInterface ¶
type AccountTypeRepositoryInterface interface {
GetAccountTypeByID(id uint) (models.AccountType, error)
}
type BankOfAmericaCreditCardCSVParser ¶
type BankOfAmericaCreditCardCSVParser struct{}
func (BankOfAmericaCreditCardCSVParser) Parse ¶
func (BankOfAmericaCreditCardCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 1st row, date in 0th column, description in 2nd column, and amount in 4th column
type BudgetAndSpend ¶
type BudgetService ¶
type BudgetService struct {
BudgetRepository BudgetRepositoryInterface
CategoryRepository CategoryRepositoryInterface
TransactionRepository TransactionRepositoryInterface
}
func (*BudgetService) GetAllBudgetsAndCurrentSpend ¶
func (bs *BudgetService) GetAllBudgetsAndCurrentSpend() (budgetsAndSpend []BudgetAndSpend, err error)
func (*BudgetService) GetBudgetAndMonthlySpend ¶
func (bs *BudgetService) GetBudgetAndMonthlySpend(budgetID uint, numOfMonths int) (budgetsAndSpend []BudgetAndSpend, err error)
func (*BudgetService) GetMeanAndStandardDeviation ¶
type CapitalOneCreditCardCSVParser ¶
type CapitalOneCreditCardCSVParser struct{}
func (CapitalOneCreditCardCSVParser) Parse ¶
func (s CapitalOneCreditCardCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 1st row, date in 0th column, description in 3rd column, category in 4th column, debits (purchases) in 5th column, credit (payments/refunds) amount in 6th column
type CapitalOneSavingsCSVParser ¶
type CapitalOneSavingsCSVParser struct{}
func (CapitalOneSavingsCSVParser) Parse ¶
func (s CapitalOneSavingsCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 1st row, description in 1st column, date in 2nd column, transaction type (credit vs debit) in 3rd column, amount in 4th column, and balance in 5th column. Transactions are sorted by newest transaction first, so the balance is the first row after the header
type CashFlowData ¶ added in v1.2.0
type CashFlowData struct {
TotalIncome int
TotalExpenses int
Expenses []ExpenseByCategory
}
type CashFlowService ¶ added in v1.2.0
type CashFlowService struct {
// contains filtered or unexported fields
}
func NewCashFlowService ¶ added in v1.2.0
func NewCashFlowService(tr *models.TransactionRepository) *CashFlowService
func (*CashFlowService) GetCashFlowData ¶ added in v1.2.0
func (s *CashFlowService) GetCashFlowData(ctx context.Context, startDate time.Time, endDate time.Time) (cashFlowData *CashFlowData, err error)
type CategorizerInterface ¶
type Categorizes ¶
type Categorizes interface {
CategorizeTransaction(transaction *models.Transaction) (category models.Category, err error)
}
type ChaseCheckingCSVParser ¶
type ChaseCheckingCSVParser struct{}
func (ChaseCheckingCSVParser) Parse ¶
func (ChaseCheckingCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 1st row, date in 1st column, description in 2nd column, and amount in 3rd column
type ChaseCreditCardCSVParser ¶
type ChaseCreditCardCSVParser struct{}
func (ChaseCreditCardCSVParser) Parse ¶
func (s ChaseCreditCardCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 1st row, date in 0th column, description in 2nd column, and amount in 4th column
type ExpenseByCategory ¶ added in v1.2.0
type FidelityBrokerageCSVParser ¶
type FidelityBrokerageCSVParser struct{}
func (FidelityBrokerageCSVParser) Parse ¶
func (FidelityBrokerageCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 2nd row, date in 0th column, description in 1st column, amount in 10th column, and balance in 11th column Transactions are sorted by newest transaction first, so the balance is the first row after the header
type FidelityCreditCardCSVParser ¶
type FidelityCreditCardCSVParser struct{}
func (FidelityCreditCardCSVParser) Parse ¶
func (FidelityCreditCardCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 1st row, date in 0th column, description in 2nd column, and amount in 4th column
type GeneralCSVParser ¶
type GeneralCSVParser struct{}
type ImportAccountRepositoryInterface ¶
AccountRepositoryInterface specifically for ImportService
type ImportService ¶
type ImportService struct {
AccountRepository ImportAccountRepositoryInterface
BalanceRepository BalanceRepositoryInterface
Categorizer CategorizerInterface
ImportSubmissionRepository ImportSubmissionRepositoryInterface
TransactionRepository ImportTransactionRepositoryInterface
}
func (*ImportService) ImportStatement ¶
func (is *ImportService) ImportStatement(filename string, statement string, accountID uint) (result *models.ImportSubmission, err error)
type ImportSubmissionRepositoryInterface ¶
type ImportSubmissionRepositoryInterface interface {
Save(sub models.ImportSubmission) (uint, error)
}
type ImportTransactionRepositoryInterface ¶
type ImportTransactionRepositoryInterface interface {
GetTransactionsByHash(hash string, submissionID uint) ([]models.Transaction, error)
Save(txn models.Transaction) (uint, error)
}
TransactionRepositoryInterface specifically for ImportService
type MLCategorizer ¶
type MLCategorizer struct {
Bag *bag.Bag
CategoryRepository *models.CategoryRepository
TransactionRepository *models.TransactionRepository
}
func (*MLCategorizer) BuildModel ¶
func (mc *MLCategorizer) BuildModel() error
func (*MLCategorizer) CategorizeTransaction ¶
func (mc *MLCategorizer) CategorizeTransaction(transaction *models.Transaction) (category models.Category, err error)
Should this return just the category name as a string, a category object, both, or something else?
type MockAccountRepository ¶
func (*MockAccountRepository) GetAccountByID ¶
func (m *MockAccountRepository) GetAccountByID(id uint) (models.Account, error)
type MockBalanceRepository ¶
type MockCategorizer ¶
func (*MockCategorizer) BuildModel ¶
func (m *MockCategorizer) BuildModel() error
func (*MockCategorizer) CategorizeTransaction ¶
func (m *MockCategorizer) CategorizeTransaction(txn *models.Transaction) (models.Category, error)
type MockCategoryRepository ¶
type MockImportSubmissionRepository ¶
type MockImportSubmissionRepository struct {
Saved []models.ImportSubmission
SaveErr error
}
func (*MockImportSubmissionRepository) Save ¶
func (m *MockImportSubmissionRepository) Save(sub models.ImportSubmission) (uint, error)
type MockParser ¶
type MockParser struct {
Txns []models.Transaction
Balances []models.Balance
ParseErr error
}
func (*MockParser) Parse ¶
func (m *MockParser) Parse(statement string) ([]models.Transaction, []models.Balance, error)
type MockTransactionRepository ¶
type MockTransactionRepository struct {
Err error
SaveErr error
Sum int
Totals []models.TotalByMonth
TxnsByHash map[string][]models.Transaction
}
func (*MockTransactionRepository) GetTransactionsByHash ¶
func (m *MockTransactionRepository) GetTransactionsByHash(hash string, submissionID uint) ([]models.Transaction, error)
func (*MockTransactionRepository) Save ¶
func (m *MockTransactionRepository) Save(txn models.Transaction) (uint, error)
type NoParserError ¶
type NoParserError struct{}
func (*NoParserError) Error ¶
func (*NoParserError) Error() string
type SchwabBrokerageCSVParser ¶
type SchwabBrokerageCSVParser struct{}
func (SchwabBrokerageCSVParser) Parse ¶
func (s SchwabBrokerageCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 1st row, date in 0th column, action in 1st column, symbol in 2nd column, description in 3rd column, amount in 7th column,
type SchwabCheckingCSVParser ¶
type SchwabCheckingCSVParser struct{}
func (SchwabCheckingCSVParser) Parse ¶
func (s SchwabCheckingCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 1st row, date in 0th column, description in 4th column, withdrawal amount in 5th column, deposit Amount in 6th column, and running balance in 7th column
type TargetCreditCardCSVParser ¶
type TargetCreditCardCSVParser struct{}
func (TargetCreditCardCSVParser) Parse ¶
func (s TargetCreditCardCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 1st row, date in 0th column, posting date in 1st column, ref# in 2nd column (which we won't use), amount in 3rd column, description in 4th column, last 4 digits of card number in 5th column, and transaction type in 6th column. Transaction typ[e is either `Payment`, `Sale`, or `Refund`.
type UWCUMortgageCSVParser ¶
type UWCUMortgageCSVParser struct{}
func (UWCUMortgageCSVParser) Parse ¶
func (s UWCUMortgageCSVParser) Parse(statement string) (transactions []models.Transaction, balances []models.Balance, err error)
Parses CSVs with the header as the 1st row, date in 2nd column, amount in 3rd column, description in 4th column, and balance in the 7th column. Transactions are sorted by newest transaction first, so the balance is the first row after the header