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"
|
2024-01-23 07:39:58 +00:00
|
|
|
adminkindboxservice "git.gocasts.ir/ebhomengo/niki/service/admin/kind_box"
|
2024-01-22 14:07:51 +00:00
|
|
|
|
2024-01-22 08:14:57 +00:00
|
|
|
"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 {
|
2024-01-22 08:14:57 +00:00
|
|
|
// AddKindBoxReq(ctx context.Context, kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error)
|
|
|
|
// UpdateKindBoxReq(ctx context.Context, kindBoxReqID uint, kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error)
|
2023-12-25 17:08:19 +00:00
|
|
|
// TODO: can benefactor cancel its request ?
|
2024-01-22 08:14:57 +00:00
|
|
|
// DeleteKindBoxReq(ctx context.Context, kindBoxReqID uint) error
|
|
|
|
// GetAllKindBoxReq(ctx context.Context) ([]entity.KindBoxReq, error)
|
|
|
|
// GetKindBoxReq(ctx context.Context, kindBoxReqID uint) (entity.KindBoxReq, error)
|
2024-01-22 10:43:16 +00:00
|
|
|
AcceptKindBoxReq(ctx context.Context, kindBoxReqID uint, countAccepted uint) error
|
2024-01-22 14:07:51 +00:00
|
|
|
GetByID(ctx context.Context, id uint) (entity.KindBoxReq, error)
|
2024-01-22 15:21:13 +00:00
|
|
|
RejectKindBoxReq(ctx context.Context, kindBoxReqID uint, description string) error
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
|
2023-12-26 17:53:25 +00:00
|
|
|
// TODO: check validation.
|
2023-12-26 20:01:45 +00:00
|
|
|
// type BenefactorService interface {
|
|
|
|
// IsBenefactorExist(ctx context.Context, benefactorID uint) (bool, error)
|
|
|
|
// }
|
2023-12-26 17:52:20 +00:00
|
|
|
|
2023-12-20 08:27:13 +00:00
|
|
|
type Service struct {
|
2024-01-23 07:39:58 +00:00
|
|
|
repo Repository
|
|
|
|
kindBoxSvc adminkindboxservice.Service
|
2023-12-26 20:01:45 +00:00
|
|
|
// benefactorService BenefactorService
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func New(repository Repository) Service {
|
|
|
|
return Service{
|
|
|
|
repo: repository,
|
|
|
|
}
|
|
|
|
}
|