forked from ebhomengo/niki
1
0
Fork 0
niki/service/agent/kind_box_req/service.go

35 lines
1.0 KiB
Go
Raw Normal View History

2024-09-15 07:36:09 +00:00
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,
}
}