mocks

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	OnCreateTransaction    func(context.Context, *entities.Transaction) error
	OnLoadObjectsIntoCache func(ctx context.Context, cachedAccounts *entities.CachedAccounts) (vos.Version, error)
	OnGetAccountBalance    func(ctx context.Context, accountName vos.AccountName) (*vos.AccountBalance, error)
	OnGetAnalyticalData    func(ctx context.Context, path vos.AccountPath, fn func(vos.Statement) error) error
	OnGetAccountHistory    func(ctx context.Context, accountName vos.AccountName, fn func(vos.EntryHistory) error) error
}

func (Repository) CreateTransaction

func (s Repository) CreateTransaction(ctx context.Context, transaction *entities.Transaction) error

func (Repository) GetAccountBalance

func (s Repository) GetAccountBalance(ctx context.Context, accountName vos.AccountName) (*vos.AccountBalance, error)

func (Repository) GetAccountHistory added in v0.2.0

func (s Repository) GetAccountHistory(ctx context.Context, accountName vos.AccountName, fn func(vos.EntryHistory) error) error

func (Repository) GetAnalyticalData

func (s Repository) GetAnalyticalData(ctx context.Context, path vos.AccountPath, fn func(vos.Statement) error) error

func (Repository) LoadObjectsIntoCache

func (s Repository) LoadObjectsIntoCache(ctx context.Context, cachedAccounts *entities.CachedAccounts) (vos.Version, error)

type UseCase

type UseCase struct {
	OnCreateTransaction    func(ctx context.Context, id uuid.UUID, entries []entities.Entry) error
	OnLoadObjectsIntoCache func(ctx context.Context) error
	OnGetAccountBalance    func(ctx context.Context, accountName vos.AccountName) (*vos.AccountBalance, error)
	OnGetAnalyticalData    func(ctx context.Context, path vos.AccountPath, fn func(vos.Statement) error) error
	OnGetAccountHistory    func(ctx context.Context, accountName vos.AccountName, fn func(vos.EntryHistory) error) error
}

func SuccessfulTransactionMock

func SuccessfulTransactionMock() UseCase

func (UseCase) CreateTransaction

func (m UseCase) CreateTransaction(ctx context.Context, id uuid.UUID, entries []entities.Entry) error

func (UseCase) GetAccountBalance

func (m UseCase) GetAccountBalance(ctx context.Context, accountName vos.AccountName) (*vos.AccountBalance, error)

func (UseCase) GetAccountHistory added in v0.2.0

func (m UseCase) GetAccountHistory(ctx context.Context, accountName vos.AccountName, fn func(vos.EntryHistory) error) error

func (UseCase) GetAnalyticalData

func (m UseCase) GetAnalyticalData(ctx context.Context, path vos.AccountPath, fn func(vos.Statement) error) error

func (UseCase) LoadObjectsIntoCache

func (m UseCase) LoadObjectsIntoCache(ctx context.Context) error

Jump to

Keyboard shortcuts

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