usecase

package
v0.0.0-...-5927a11 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyExist = errors.New("account already exist")
)
View Source
var ErrInvalidId = errors.New("id format is invalid")
View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

func NewAccountUseCase

func NewAccountUseCase(repository account.Repository, logger zerolog.Logger) Account

func (Account) Create

func (Account) GetAccounts

func (a Account) GetAccounts(ctx context.Context) ([]entities.Account, error)

func (Account) GetBalance

func (a Account) GetBalance(ctx context.Context, id string) (int, error)

func (Account) GetByCpf

func (a Account) GetByCpf(ctx context.Context, cpf string) (entities.Account, error)

func (Account) GetById

func (a Account) GetById(ctx context.Context, id string) (entities.Account, error)

func (Account) UpdateBalance

func (a Account) UpdateBalance(ctx context.Context, originAccountId, destinationAccountId string, amount int) error

Jump to

Keyboard shortcuts

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