redeem

package
v0.0.0-...-902682f Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain struct {
	Id               int
	UserId           int
	ItemId           int
	DataRedeem       string
	Item             interface{}
	Status           int
	Point            int
	ResponseMidtrans interface{}
	RefId            string
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

type RedeemUsecase

type RedeemUsecase struct {
	PointRepo point.Repository
	ItemRepo  items.Repository
	Repo      Repository

	ConfigJWT middlewares.ConfigJWT
	// contains filtered or unexported fields
}

func (*RedeemUsecase) Create

func (tc *RedeemUsecase) Create(ctx context.Context, domain Domain) (Domain, error)

func (*RedeemUsecase) Delete

func (tc *RedeemUsecase) Delete(ctx context.Context, id int) error

func (*RedeemUsecase) GetAll

func (tc *RedeemUsecase) GetAll(ctx context.Context) ([]Domain, error)

func (*RedeemUsecase) GetById

func (tc *RedeemUsecase) GetById(ctx context.Context, id int) (Domain, error)

func (*RedeemUsecase) GetByItemId

func (tc *RedeemUsecase) GetByItemId(ctx context.Context, id int) ([]Domain, error)

func (*RedeemUsecase) GetByUserId

func (tc *RedeemUsecase) GetByUserId(ctx context.Context, id int) ([]Domain, error)

type Repository

type Repository interface {
	Create(ctx context.Context, domain *Domain) (Domain, error)
	GetAll(ctx context.Context) ([]Domain, error)
	GetById(ctx context.Context, id int) (Domain, error)
	GetByUserId(ctx context.Context, id int) ([]Domain, error)
	GetByItemId(ctx context.Context, id int) ([]Domain, error)
	//GetByUserIdAndStatus(ctx context.Context, id int, status int) ([]Domain, error)
	Delete(ctx context.Context, id int) error
}

type Usecase

type Usecase interface {
	Create(ctx context.Context, domain Domain) (Domain, error)
	GetAll(ctx context.Context) ([]Domain, error)
	GetById(ctx context.Context, id int) (Domain, error)
	GetByUserId(ctx context.Context, id int) ([]Domain, error)
	GetByItemId(ctx context.Context, id int) ([]Domain, error)
	Delete(ctx context.Context, id int) error
}

func NewRedeemUsecase

func NewRedeemUsecase(pointRepo point.Repository, itemRepo items.Repository, repo Repository, timeout time.Duration, configJWT middlewares.ConfigJWT) Usecase

Jump to

Keyboard shortcuts

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