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"
|
|
|
|
|
2024-07-09 17:17:04 +00:00
|
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
|
|
|
params "git.gocasts.ir/ebhomengo/niki/param"
|
2024-08-01 10:20:18 +00:00
|
|
|
validator "git.gocasts.ir/ebhomengo/niki/validator/admin/kind_box"
|
2023-12-22 21:42:57 +00:00
|
|
|
)
|
2023-12-20 08:27:13 +00:00
|
|
|
|
|
|
|
type Repository interface {
|
2024-07-01 17:13:28 +00:00
|
|
|
GetKindBox(ctx context.Context, kindBoxID uint) (entity.KindBox, error)
|
2024-07-02 20:17:40 +00:00
|
|
|
AssignReceiverAgent(ctx context.Context, kindBox entity.KindBox) error
|
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)
|
2024-07-23 21:37:27 +00:00
|
|
|
EnumerateKindBox(ctx context.Context, kindBoxID uint, amount uint) error
|
2024-07-30 20:30:24 +00:00
|
|
|
UpdateKindBox(ctx context.Context, KindBox entity.KindBox) error
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
|
|
|
repo Repository
|
2024-08-01 10:20:18 +00:00
|
|
|
vld validator.Validator
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
|
2024-08-01 10:20:18 +00:00
|
|
|
func New(repo Repository, vld validator.Validator) Service {
|
2023-12-20 08:27:13 +00:00
|
|
|
return Service{
|
2024-08-01 10:20:18 +00:00
|
|
|
repo: repo,
|
|
|
|
vld: vld,
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
}
|