2023-12-20 08:41:50 +00:00
|
|
|
package kindboxreqservice
|
2023-12-20 08:27:13 +00:00
|
|
|
|
2023-12-22 21:25:16 +00:00
|
|
|
import (
|
2023-12-22 21:42:57 +00:00
|
|
|
"context"
|
|
|
|
|
2023-12-22 21:25:16 +00:00
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/kind_box_req"
|
|
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
|
|
|
)
|
2023-12-20 08:27:13 +00:00
|
|
|
|
2023-12-22 21:42:57 +00:00
|
|
|
func (s Service) GetByID(ctx context.Context, req param.KindBoxReqGetByIDRequest) (param.KindBoxReqGetByIDResponse, error) {
|
2023-12-22 21:25:16 +00:00
|
|
|
const op = "kindboxreqservice.GetByID"
|
2023-12-22 21:42:57 +00:00
|
|
|
kindBoxReq, err := s.repo.GetKindBoxReqByID(ctx, req.KindBoxReqID)
|
2023-12-22 21:25:16 +00:00
|
|
|
if err != nil {
|
|
|
|
return param.KindBoxReqGetByIDResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
|
|
|
|
}
|
|
|
|
return param.KindBoxReqGetByIDResponse{KindBoxReq: kindBoxReq}, nil
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|