2023-12-25 17:08:19 +00:00
|
|
|
package adminkindboxreqservice
|
2023-12-20 08:27:13 +00:00
|
|
|
|
2023-12-22 21:42:57 +00:00
|
|
|
import (
|
|
|
|
"context"
|
2024-01-22 14:07:51 +00:00
|
|
|
|
2024-02-20 20:34:51 +00:00
|
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
2024-06-12 08:15:28 +00:00
|
|
|
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_req"
|
2023-12-22 21:42:57 +00:00
|
|
|
)
|
2023-12-20 08:27:13 +00:00
|
|
|
|
|
|
|
type Repository interface {
|
2024-01-22 10:43:16 +00:00
|
|
|
AcceptKindBoxReq(ctx context.Context, kindBoxReqID uint, countAccepted uint) error
|
2024-01-22 14:07:51 +00:00
|
|
|
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
|
2024-02-20 20:34:51 +00:00
|
|
|
AssignSenderAgentToKindBoxReq(ctx context.Context, kindBoxReqID uint, senderAgentID uint) error
|
2024-03-14 13:38:42 +00:00
|
|
|
DeliverKindBoxReq(ctx context.Context, kindBoxReqID uint) error
|
2024-06-12 08:15:28 +00:00
|
|
|
GetAllKindBoxReq(ctx context.Context, filter params.FilterRequest, pagination params.PaginationRequest, sort params.SortRequest) ([]entity.KindBoxReq, uint, error)
|
2024-06-10 22:54:16 +00:00
|
|
|
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)
|
2024-07-09 14:45:50 +00:00
|
|
|
UpdateKindBoxReq(ctx context.Context, kindBoxReq entity.KindBoxReq) error
|
2024-03-14 13:38:42 +00:00
|
|
|
}
|
|
|
|
|
2023-12-20 08:27:13 +00:00
|
|
|
type Service struct {
|
2024-09-15 07:36:09 +00:00
|
|
|
repo Repository
|
|
|
|
vld validator.Validator
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
|
2024-09-15 07:36:09 +00:00
|
|
|
func New(repository Repository, vld validator.Validator) Service {
|
2023-12-20 08:27:13 +00:00
|
|
|
return Service{
|
2024-09-15 07:36:09 +00:00
|
|
|
repo: repository,
|
|
|
|
vld: vld,
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|
|
|
|
}
|