forked from ebhomengo/niki
1
0
Fork 0
niki/service/admin/kind_box_req/service.go

39 lines
1.2 KiB
Go

package adminkindboxreqservice
import (
"context"
"git.gocasts.ir/ebhomengo/niki/entity"
adminkindboxparam "git.gocasts.ir/ebhomengo/niki/param/admin/kind_box"
)
type Repository interface {
AcceptKindBoxReq(ctx context.Context, kindBoxReqID uint, countAccepted uint) error
GetByID(ctx context.Context, id uint) (entity.KindBoxReq, error)
RejectKindBoxReq(ctx context.Context, kindBoxReqID uint, description string) error
RollbackKindBoxRequestStatus(ctx context.Context, id uint) error
GetAllKindBoxReq(ctx context.Context) ([]entity.KindBoxReq, error)
}
type KindBoxClient interface {
AddKindBoxAfterAcceptingRequest(ctx context.Context, param adminkindboxparam.KindBoxAddAfterAcceptingReqRequest) (adminkindboxparam.KindBoxAddAfterAcceptingReqResponse, error)
}
// TODO: check validation.
// type BenefactorService interface {
// IsBenefactorExist(ctx context.Context, benefactorID uint) (bool, error)
// }
type Service struct {
repo Repository
// benefactorService BenefactorService
kindBoxClient KindBoxClient
}
func New(repository Repository, kindBoxClient KindBoxClient) Service {
return Service{
repo: repository,
kindBoxClient: kindBoxClient,
}
}