2023-12-25 17:08:19 +00:00
|
|
|
package adminkindboxservice
|
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
|
|
|
AddKindBox(ctx context.Context, kindBox entity.KindBox) (entity.KindBox, error)
|
2023-12-26 21:42:33 +00:00
|
|
|
UpdateKindBox(ctx context.Context, kindBoxID uint, kindBoxInput entity.KindBox) (entity.KindBox, error)
|
2023-12-22 21:42:57 +00:00
|
|
|
DeleteKindBox(ctx context.Context, kindBoxID uint) error
|
|
|
|
GetAllKindBox(ctx context.Context) ([]entity.KindBox, error)
|
2023-12-25 17:08:19 +00:00
|
|
|
GetKindBox(ctx context.Context, kindBox uint) (entity.KindBox, error)
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
|
|
|
repo Repository
|
|
|
|
}
|
|
|
|
|
2023-12-26 21:42:33 +00:00
|
|
|
// TODO: check validation.
|
|
|
|
// type BenefactorService interface {
|
|
|
|
// IsBenefactorExist(ctx context.Context, benefactorID uint) (bool, error)
|
|
|
|
// }
|
|
|
|
|
2023-12-20 08:27:13 +00:00
|
|
|
func New(repository Repository) Service {
|
|
|
|
return Service{
|
|
|
|
repo: repository,
|
|
|
|
}
|
|
|
|
}
|