2024-07-13 12:33:07 +00:00
|
|
|
package agentkindboxservice
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-07-24 23:45:04 +00:00
|
|
|
|
2024-07-13 12:33:07 +00:00
|
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
2024-07-14 08:58:37 +00:00
|
|
|
params "git.gocasts.ir/ebhomengo/niki/param"
|
2024-08-01 10:20:18 +00:00
|
|
|
validator "git.gocasts.ir/ebhomengo/niki/validator/agent/kind_box"
|
2024-07-13 12:33:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Repository interface {
|
|
|
|
GetAwaitingReturnByAgent(ctx context.Context, kindBoxID uint, agentID uint) (entity.KindBox, error)
|
2024-07-14 08:58:37 +00:00
|
|
|
GetAllKindBox(ctx context.Context, filter params.FilterRequest, pagination params.PaginationRequest, sort params.SortRequest) ([]entity.KindBox, uint, error)
|
2024-07-16 11:47:09 +00:00
|
|
|
ReturnKindBox(ctx context.Context, kindBoxID uint, serialNumber string) error
|
2024-07-13 12:33:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
|
|
|
repo Repository
|
2024-08-01 10:20:18 +00:00
|
|
|
vld validator.Validator
|
2024-07-13 12:33:07 +00:00
|
|
|
}
|
|
|
|
|
2024-08-01 10:20:18 +00:00
|
|
|
func New(repo Repository, vld validator.Validator) Service {
|
2024-07-13 12:33:07 +00:00
|
|
|
return Service{
|
2024-08-01 10:20:18 +00:00
|
|
|
repo: repo,
|
|
|
|
vld: vld,
|
2024-07-13 12:33:07 +00:00
|
|
|
}
|
|
|
|
}
|