2024-06-21 06:57:35 +00:00
|
|
|
package benefactor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-07-24 23:45:04 +00:00
|
|
|
|
2024-06-21 06:57:35 +00:00
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/admin/admin"
|
|
|
|
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s Service) BenefactorExistByID(ctx context.Context, req param.BenefactorExistByIDRequest) (param.BenefactorExistByIDResponse, error) {
|
|
|
|
const op = "adminservice.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
|
|
|
|
}
|