2023-12-20 08:27:13 +00:00
|
|
|
package kindboxservice
|
|
|
|
|
2023-12-22 21:25:16 +00:00
|
|
|
import (
|
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/kind_box"
|
|
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
|
|
|
)
|
2023-12-20 08:27:13 +00:00
|
|
|
|
2023-12-22 21:25:16 +00:00
|
|
|
func (s Service) GetByID(req param.KindBoxGetByIDRequest) (param.KindBoxGetByIDResponse, error) {
|
|
|
|
const op = "kindboxservice.GetByID"
|
|
|
|
kindBox, err := s.repo.GetKindBoxByID(req.KindBoxID)
|
|
|
|
if err != nil {
|
|
|
|
return param.KindBoxGetByIDResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
|
|
|
|
}
|
|
|
|
return param.KindBoxGetByIDResponse{KindBox: kindBox}, nil
|
2023-12-20 08:27:13 +00:00
|
|
|
}
|