forked from ebhomengo/niki
35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
|
package agentkindboxreqservice
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
param "git.gocasts.ir/ebhomengo/niki/param/admin/kind_box"
|
||
|
|
||
|
"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
|
||
|
}
|
||
|
|
||
|
func New(repo Repository, vld validator.Validator) Service {
|
||
|
return Service{
|
||
|
repo: repo,
|
||
|
vld: vld,
|
||
|
}
|
||
|
}
|