2024-05-31 12:36:48 +00:00
|
|
|
package adminrefertimeservice
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-07-24 23:45:04 +00:00
|
|
|
|
2024-05-31 12:36:48 +00:00
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/admin/refer_time"
|
|
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s Service) GetReferTimeByID(ctx context.Context, req param.GetReferTimeRequest) (param.GetReferTimeResponse, error) {
|
|
|
|
const op = richerror.Op("refertimeservice.GetReferTimeByID")
|
|
|
|
referTime, gErr := s.repo.Get(ctx, req.ReferTimeID)
|
|
|
|
if gErr != nil {
|
|
|
|
return param.GetReferTimeResponse{}, richerror.New(op).WithErr(gErr).WithKind(richerror.KindUnexpected)
|
|
|
|
}
|
2024-07-24 23:45:04 +00:00
|
|
|
|
2024-05-31 12:36:48 +00:00
|
|
|
return param.GetReferTimeResponse{ReferTime: referTime}, nil
|
|
|
|
}
|