2024-09-15 07:36:09 +00:00
|
|
|
package agentkindboxreqservice
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-09-16 11:14:45 +00:00
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/agent/kind_box"
|
2024-09-15 07:36:09 +00:00
|
|
|
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
|
|
|
params "git.gocasts.ir/ebhomengo/niki/param"
|
|
|
|
validator "git.gocasts.ir/ebhomengo/niki/validator/agent/kind_box_req"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Repository interface {
|
|
|
|
GetAllKindBoxReq(ctx context.Context, filter params.FilterRequest, pagination params.PaginationRequest, sort params.SortRequest) ([]entity.KindBoxReq, uint, error)
|
|
|
|
DeliverKindBoxReq(ctx context.Context, kindBoxReqID uint) error
|
|
|
|
GetAwaitingDeliveryByAgent(ctx context.Context, kindBoxReqID uint, agentID uint) (entity.KindBoxReq, error)
|
|
|
|
GetByID(ctx context.Context, id uint) (entity.KindBoxReq, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type KindBoxSvc interface {
|
|
|
|
AddBatchKindBox(ctx context.Context, req param.AddKindBoxRequest) (param.AddKindBoxResponse, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
|
|
|
repo Repository
|
|
|
|
kindBoxSvc KindBoxSvc
|
|
|
|
vld validator.Validator
|
|
|
|
}
|
|
|
|
|
2024-09-16 11:14:45 +00:00
|
|
|
func New(repo Repository, vld validator.Validator, kindBoxSvc KindBoxSvc) Service {
|
2024-09-15 07:36:09 +00:00
|
|
|
return Service{
|
2024-09-16 11:14:45 +00:00
|
|
|
repo: repo,
|
|
|
|
vld: vld,
|
|
|
|
kindBoxSvc: kindBoxSvc,
|
2024-09-15 07:36:09 +00:00
|
|
|
}
|
|
|
|
}
|