Documentation ¶
Index ¶
- Variables
- type Account
- type AddBalanceDTO
- type Repository
- type ReserveBalanceDTO
- type ReturnBalanceDTO
- type Service
- func (s *Service) AddBalance(ctx context.Context, dto AddBalanceDTO) (balance int64, err error)
- func (s *Service) GetBalanceByID(ctx context.Context, accountID int64) (int64, error)
- func (s *Service) TransferBalance(ctx context.Context, dto TransferBalanceDTO) (senderBalance int64, receiverBalance int64, err error)
- type TransactionRepository
- type Transactor
- type TransferBalanceDTO
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyExist = errors.New("account with given fields already exist") ErrNotFound = errors.New("account not found") )
Functions ¶
This section is empty.
Types ¶
type AddBalanceDTO ¶
type Repository ¶
type ReserveBalanceDTO ¶
type ReturnBalanceDTO ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService( transactor Transactor, repository Repository, transactionRepository TransactionRepository, logger *zap.Logger, ) *Service
func (*Service) AddBalance ¶
func (*Service) GetBalanceByID ¶
func (*Service) TransferBalance ¶
type TransactionRepository ¶
type TransactionRepository interface {
CreateTransaction(ctx context.Context, dto transaction.CreateDTO) error
}
type Transactor ¶
type TransferBalanceDTO ¶
Click to show internal directories.
Click to hide internal directories.