repos

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountsRepository

type AccountsRepository interface {
	GetAccountByID(accID string) (*models.Account, error)
	ListAccounts() ([]models.Account, error)
	ListAccountsByType(typ models.AccountType) ([]models.Account, error)
	AddNewAccount(account *models.Account) error
	UpdateAccountBalance(accID string, txnAmount float64) error
	DeleteAccount(accID string) error
}

type EventRepository

type EventRepository interface {
	AddEvent(event string) error
	ListEvents() ([]models.Event, error)
}

type ExpenseRepository

type ExpenseRepository interface {
	GetLastExpense() (*models.Expense, error)
	ListAllExpenses() ([]*models.Expense, error)
	AddNewExpense(expense *models.Expense) error
	DeleteExpense(id string) error
	EditExpense(expense *models.Expense) error
}

type TransactionRepository

type TransactionRepository interface {
	AddTransaction(txn models.Transaction) error
	ListTransactionsByCategory(catID string) ([]models.Transaction, error)
	ListTransactions(filter models.Transaction) ([]models.Transaction, error)
	ListTransactionsByTime(txnType models.TransactionType, startTime, endTime int64) ([]models.Transaction, error)

	GetTxnCategoryName(catID string) (string, error)
	ListTxnCategories() ([]models.TxnCategory, error)
	GetTxnSubcategoryName(subcatID string) (string, error)
	ListTxnSubcategories(catID string) ([]models.TxnSubcategory, error)
	UpdateTxnCategories() error
}

type UserRepository

type UserRepository interface {
	GetUserByID(id string) (*models.User, error)
	GetUserByName(username string) (*models.User, error)
	ListUsers() ([]models.User, error)
	AddNewUser(user *models.User) error
	UpdateUserBalance(id string, amount float64) error
	DeleteUser(id string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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