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

20 lines
665 B
Go
Raw Normal View History

2024-01-19 16:37:15 +00:00
package benefactoraddressservice
import (
"context"
addressparam "git.gocasts.ir/ebhomengo/niki/param/benefactor/address"
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
)
func (s Service) ProvinceExistByID(ctx context.Context, req addressparam.ProvinceExistByIDRequest) (addressparam.ProvinceExistByIDResponse, error) {
const op = "benefactoraddressservice.ProvinceExistByID"
isExisted, err := s.repo.IsExistProvinceByID(ctx, req.ID)
if err != nil {
return addressparam.ProvinceExistByIDResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
}
return addressparam.ProvinceExistByIDResponse{Existed: isExisted}, nil
}