1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-02 20:28:38 -04:00

Move splits/transactions to store

This commit is contained in:
2017-12-08 21:27:03 -05:00
parent 61676598dd
commit da7e025509
8 changed files with 410 additions and 406 deletions

View File

@ -76,7 +76,23 @@ type AccountStore interface {
DeleteAccount(account *models.Account) error
}
type AccountMissingError struct{}
func (ame AccountMissingError) Error() string {
return "Account missing"
}
type TransactionStore interface {
SplitExists(s *models.Split) (bool, error)
InsertTransaction(t *models.Transaction, user *models.User) error
GetTransaction(transactionid int64, userid int64) (*models.Transaction, error)
GetTransactions(userid int64) (*[]*models.Transaction, error)
UpdateTransaction(t *models.Transaction, user *models.User) error
DeleteTransaction(t *models.Transaction, user *models.User) error
GetAccountSplits(user *models.User, accountid int64) (*[]*models.Split, error)
GetAccountSplitsDate(user *models.User, accountid int64, date *time.Time) (*[]*models.Split, error)
GetAccountSplitsDateRange(user *models.User, accountid int64, begin, end *time.Time) (*[]*models.Split, error)
GetAccountTransactions(user *models.User, accountid int64, sort string, page uint64, limit uint64) (*models.AccountTransactionsList, error)
}
type ReportStore interface {