2024-01-02 14:04:16 +00:00
|
|
|
package benefactorkindboxreqservice
|
2023-12-25 17:08:19 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
entity "git.gocasts.ir/ebhomengo/niki/entity"
|
2024-07-24 23:45: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_req"
|
2023-12-25 17:08:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Repository interface {
|
|
|
|
AddKindBoxReq(ctx context.Context, kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error)
|
2024-05-31 14:49:04 +00:00
|
|
|
GetKindBoxReqByID(ctx context.Context, kindBoxReqID uint) (entity.KindBoxReq, error)
|
|
|
|
DeleteKindBoxReqByID(ctx context.Context, kindBoxReqID uint) error
|
2024-07-03 17:18:06 +00:00
|
|
|
GetAllKindBoxReq(ctx context.Context, filter params.FilterRequest, pagination params.PaginationRequest, sort params.SortRequest) ([]entity.KindBoxReq, uint, error)
|
2024-07-23 19:21:02 +00:00
|
|
|
UpdateKindBoxReq(ctx context.Context, kindBoxReq entity.KindBoxReq) error
|
2023-12-25 17:08:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
|
|
|
repo Repository
|
2024-08-01 10:20:18 +00:00
|
|
|
vld validator.Validator
|
2023-12-25 17:08:19 +00:00
|
|
|
}
|
|
|
|
|
2024-08-01 10:20:18 +00:00
|
|
|
func New(repository Repository, vld validator.Validator) Service {
|
2023-12-25 17:08:19 +00:00
|
|
|
return Service{
|
|
|
|
repo: repository,
|
2024-08-01 10:20:18 +00:00
|
|
|
vld: vld,
|
2023-12-25 17:08:19 +00:00
|
|
|
}
|
|
|
|
}
|