forked from ebhomengo/niki
1
0
Fork 0
niki/service/benefactor/benefactor/get.go

20 lines
634 B
Go

package benefactorservice
import (
"context"
param "git.gocasts.ir/ebhomengo/niki/param/benefactor/benefactore"
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
)
func (s Service) BenefactorExistByID(ctx context.Context, req param.BenefactorExistByIDRequest) (param.BenefactorExistByIDResponse, error) {
const op = "benefactorservice.BenefactorExistByID"
isExisted, err := s.repo.IsExistBenefactorByID(ctx, req.ID)
if err != nil {
return param.BenefactorExistByIDResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
}
return param.BenefactorExistByIDResponse{Existed: isExisted}, nil
}