Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrValidationFailed = errors.New("Validation Failed") ErrValidationFailedCode = "TRANSACTION_0001" ErrInvalidQueryCode = "TRANSACTION_0002" ErrTransactionNotFound = errors.New("Transaction Not Found") ErrTransactionNotFoundCode = "TRANSACTION_0004" )
Functions ¶
Types ¶
type CreateDto ¶
type CreateDto struct { Amount int64 `form:"amount"` Description string `form:"description"` Category string `form:"category"` Type string `form:"type"` }
func NewCreateDtoFromRequest ¶
type GetTotalParam ¶
type Repository ¶
type Repository interface { Get(p GetParam) ([]entity.Transaction, int, error) GetTotal(p GetTotalParam) (entity.TotalAmount, error) Create(t entity.Transaction) (entity.Transaction, error) FindOneById(id, userId string) (entity.Transaction, error) DeleteOneById(id, userId string) error UpdateOneById(id, userId string, dto UpdateDto) (entity.Transaction, error) }
func NewRepository ¶
func NewRepository(db *sql.DB) Repository
type Service ¶
type Service interface { Create(t entity.Transaction) (entity.Transaction, error) FindOneById(id, userId string) (entity.Transaction, error) DeleteOneById(id, userId string) error UpdateOneById(id, userId string, dto UpdateDto) (entity.Transaction, error) Get(p GetParam) ([]entity.Transaction, int, error) GetTotal(p GetTotalParam) (entity.TotalAmount, error) }
func NewService ¶
func NewService(repo Repository) Service
type TransactionFilterQuery ¶
func NewTransactionFilterQueryFromRequest ¶
func NewTransactionFilterQueryFromRequest(c *gin.Context) TransactionFilterQuery
Click to show internal directories.
Click to hide internal directories.