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

34 lines
1.2 KiB
Go
Raw Normal View History

2023-12-25 17:08:19 +00:00
package adminkindboxreqservice
import (
"context"
"git.gocasts.ir/ebhomengo/niki/entity"
params "git.gocasts.ir/ebhomengo/niki/param"
validator "git.gocasts.ir/ebhomengo/niki/validator/admin/kind_box_req"
)
type Repository interface {
AcceptKindBoxReq(ctx context.Context, kindBoxReqID uint, countAccepted uint) error
GetByID(ctx context.Context, id uint) (entity.KindBoxReq, error)
2024-01-22 15:21:13 +00:00
RejectKindBoxReq(ctx context.Context, kindBoxReqID uint, description string) error
AssignSenderAgentToKindBoxReq(ctx context.Context, kindBoxReqID uint, senderAgentID uint) error
DeliverKindBoxReq(ctx context.Context, kindBoxReqID uint) error
GetAllKindBoxReq(ctx context.Context, filter params.FilterRequest, pagination params.PaginationRequest, sort params.SortRequest) ([]entity.KindBoxReq, uint, error)
GetAwaitingDeliveryByAgent(ctx context.Context, kindBoxReqID uint, agentID uint) (entity.KindBoxReq, error)
2024-06-14 08:41:36 +00:00
AddKindBoxReq(ctx context.Context, kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error)
UpdateKindBoxReq(ctx context.Context, kindBoxReq entity.KindBoxReq) error
}
type Service struct {
2024-09-15 07:36:09 +00:00
repo Repository
vld validator.Validator
}
2024-09-15 07:36:09 +00:00
func New(repository Repository, vld validator.Validator) Service {
return Service{
2024-09-15 07:36:09 +00:00
repo: repository,
vld: vld,
}
}