transaction

package
v0.0.0-...-514f96b Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	*handler.BaseHandler
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(service Service, logger *zap.Logger) *Handler

func (*Handler) GetTransactionsByAccountID

func (h *Handler) GetTransactionsByAccountID(c *gin.Context)

func (*Handler) InitAPI

func (h *Handler) InitAPI(router *gin.RouterGroup)

type ListResponse

type ListResponse struct {
	Transactions []Response           `json:"transactions"`
	Range        pagination.ListRange `json:"range"`
}

func NewListResponse

func NewListResponse(
	transactions []transaction.Transaction,
	params pagination.Params,
	count int,
) ListResponse

type Response

type Response struct {
	TransactionID int64     `json:"transaction_id"`
	Type          string    `json:"type"`
	SenderID      int64     `json:"sender_id"`
	ReceiverID    int64     `json:"receiver_id"`
	Amount        int64     `json:"amount"`
	Description   string    `json:"description"`
	CreatedAt     time.Time `json:"created_at"`
}

func NewResponse

func NewResponse(transaction transaction.Transaction) Response

type Service

type Service interface {
	GetTransactionsByAccountID(
		ctx context.Context,
		accountID int64,
		listParams transaction.ListParams,
	) ([]transaction.Transaction, int, error)
}

Jump to

Keyboard shortcuts

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