forked from ebhomengo/niki
23 lines
604 B
Go
23 lines
604 B
Go
package adminrefertimeaggregatorservice
|
|
|
|
import (
|
|
"context"
|
|
|
|
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, id uint) (param.Data, error) {
|
|
const op = "adminrefertimeaggregatorservice.GetReferTimeByID"
|
|
referTime, gErr := s.repo.Get(ctx, id)
|
|
if gErr != nil {
|
|
return param.Data{}, richerror.New(op).WithErr(gErr).WithKind(richerror.KindUnexpected)
|
|
}
|
|
|
|
return param.Data{
|
|
ID: referTime.ID,
|
|
Status: referTime.Status,
|
|
Duration: referTime.Duration,
|
|
}, nil
|
|
}
|