2023-12-25 17:08:19 +00:00
|
|
|
package adminkindboxreqservice
|
2023-12-20 08:27:13 +00:00
|
|
|
|
2023-12-22 21:42:57 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2023-12-25 17:08:19 +00:00
|
|
|
entity "git.gocasts.ir/ebhomengo/niki/entity"
|
2023-12-22 21:42:57 +00:00
|
|
|
)
|
2023-12-20 08:27:13 +00:00
|
|
|
|
|
|
|
type Repository interface {
|
2023-12-22 21:42:57 +00:00
|
|
|
AddKindBoxReq(ctx context.Context, kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error)
|
2023-12-25 17:08:19 +00:00
|
|
|
UpdateKindBoxReq(ctx context.Context, kindBoxReqID uint, kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error)
|
|
|
|
// TODO: can benefactor cancel its request ?
|
2023-12-22 21:42:57 +00:00
|
|
|
DeleteKindBoxReq(ctx context.Context, kindBoxReqID uint) error
|
|
|
|
GetAllKindBoxReq(ctx context.Context) ([]entity.KindBoxReq, error)
|
2023-12-25 17:08:19 +00:00
|
|
|
GetKindBoxReq(ctx context.Context, kindBoxReqID uint) (entity.KindBoxReq, error)
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
|
2023-12-26 17:52:20 +00:00
|
|
|
// TODO: check validation
|
|
|
|
type BenefactorService interface {
|
|
|
|
IsBenefactorExist(ctx context.Context, benefactorID uint) (bool, error)
|
|
|
|
}
|
|
|
|
|
2023-12-20 08:27:13 +00:00
|
|
|
type Service struct {
|
2023-12-26 17:52:20 +00:00
|
|
|
repo Repository
|
|
|
|
benefactorService BenefactorService
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func New(repository Repository) Service {
|
|
|
|
return Service{
|
|
|
|
repo: repository,
|
|
|
|
}
|
|
|
|
}
|