2024-06-10 22:54:16 +00:00
|
|
|
package adminkindboxreqservice
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/admin/kind_box_req"
|
2024-07-24 23:45:04 +00:00
|
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
2024-06-10 22:54:16 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (s Service) GetAwaitingDelivery(ctx context.Context, req param.DeliveryAwaitingGetRequest) (param.DeliveryAwaitingGetResponse, error) {
|
|
|
|
const op = "adminkindboxreqservice.GetAwaitingDelivery"
|
|
|
|
|
|
|
|
kindBoxReq, err := s.repo.GetAwaitingDeliveryByAgent(ctx, req.KindBoxReqID, req.AgentID)
|
|
|
|
if err != nil {
|
2024-07-24 23:45:04 +00:00
|
|
|
return param.DeliveryAwaitingGetResponse{}, richerror.New(op).WithErr(err)
|
2024-06-10 22:54:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return param.DeliveryAwaitingGetResponse{
|
|
|
|
KindBoxReq: kindBoxReq,
|
|
|
|
}, nil
|
|
|
|
}
|