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

38 lines
1.2 KiB
Go

package adminkindboxreqservice
import (
"context"
adminkindboxservice "git.gocasts.ir/ebhomengo/niki/service/admin/kind_box"
"git.gocasts.ir/ebhomengo/niki/entity"
)
type Repository interface {
// AddKindBoxReq(ctx context.Context, kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error)
// UpdateKindBoxReq(ctx context.Context, kindBoxReqID uint, kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error)
// TODO: can benefactor cancel its request ?
// DeleteKindBoxReq(ctx context.Context, kindBoxReqID uint) error
// GetAllKindBoxReq(ctx context.Context) ([]entity.KindBoxReq, error)
// GetKindBoxReq(ctx context.Context, kindBoxReqID uint) (entity.KindBoxReq, error)
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
}
// TODO: check validation.
// type BenefactorService interface {
// IsBenefactorExist(ctx context.Context, benefactorID uint) (bool, error)
// }
type Service struct {
repo Repository
kindBoxSvc adminkindboxservice.Service
// benefactorService BenefactorService
}
func New(repository Repository) Service {
return Service{
repo: repository,
}
}