Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCreate = errors.New("create transaction") ErrAlreadyExist = errors.New("transaction with given id already exist") ErrAccountNotFound = errors.New("account with given account_id not found") )
View Source
var ( Enrollment = Type{"enrollment"} Transfer = Type{"transfer"} Reservation = Type{"reservation"} CancelReservation = Type{"cancel_reservation"} )
View Source
var ( ErrInvalidSortParam = errors.New("invalid sort param") ErrInvalidDirectionParam = errors.New("invalid direction param") )
Functions ¶
This section is empty.
Types ¶
type ListParams ¶
type ListParams struct { Pagination pagination.Params Sort *sort.Sort }
func NewListParams ¶
func NewListParams(sortParam, directionParam string, params pagination.Params) (ListParams, error)
type Repository ¶
type Repository interface {
GetTransactionsByAccountID(ctx context.Context, senderID int64, listParams ListParams) ([]Transaction, int, error)
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repository Repository, logger *zap.Logger) *Service
func (*Service) GetTransactionsByAccountID ¶
func (s *Service) GetTransactionsByAccountID( ctx context.Context, accountID int64, listParams ListParams, ) ([]Transaction, int, error)
type Transaction ¶
Click to show internal directories.
Click to hide internal directories.