niki/service/benefactor/address/get_all_provinces.go

20 lines
606 B
Go
Raw Normal View History

2024-01-19 16:37:15 +00:00
package benefactoraddressservice
import (
"context"
param "git.gocasts.ir/ebhomengo/niki/param/benefactor/address"
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
)
func (s Service) GetAllProvinces(ctx context.Context, _ param.GetAllProvincesRequest) (param.GetAllProvincesResponse, error) {
const op = "benefactoraddressservice.GetAllProvinces"
provinces, err := s.repo.GetAllProvinces(ctx)
if err != nil {
return param.GetAllProvincesResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
}
return param.GetAllProvincesResponse{Provinces: provinces}, nil
}