2024-01-02 14:04:16 +00:00
|
|
|
package benefactorkindboxservice
|
2023-12-26 17:53:25 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
entity "git.gocasts.ir/ebhomengo/niki/entity"
|
2024-07-09 17:17:04 +00:00
|
|
|
params "git.gocasts.ir/ebhomengo/niki/param"
|
2024-08-01 10:20:18 +00:00
|
|
|
validator "git.gocasts.ir/ebhomengo/niki/validator/benefactor/kind_box"
|
2023-12-26 17:53:25 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Repository interface {
|
2024-07-09 17:17:04 +00:00
|
|
|
GetAllKindBox(ctx context.Context, filter params.FilterRequest, pagination params.PaginationRequest, sort params.SortRequest) ([]entity.KindBox, uint, error)
|
2023-12-26 17:53:25 +00:00
|
|
|
GetKindBox(ctx context.Context, kindBoxID uint) (entity.KindBox, error)
|
2024-06-25 21:58:11 +00:00
|
|
|
RegisterEmptyingRequestForKindBox(ctx context.Context, kindBox entity.KindBox) error
|
2023-12-26 17:53:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
|
|
|
repo Repository
|
2024-08-01 10:20:18 +00:00
|
|
|
vld validator.Validator
|
2023-12-26 17:53:25 +00:00
|
|
|
}
|
|
|
|
|
2024-08-01 10:20:18 +00:00
|
|
|
func New(repo Repository, vld validator.Validator) Service {
|
2023-12-26 17:53:25 +00:00
|
|
|
return Service{
|
2024-08-01 10:20:18 +00:00
|
|
|
repo: repo,
|
|
|
|
vld: vld,
|
2023-12-26 17:53:25 +00:00
|
|
|
}
|
|
|
|
}
|