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)
|
|
|
|
}
|
|
|
|
|
2024-09-10 20:55:19 +00:00
|
|
|
return param.GetAllProvincesResponse{Data: provinces}, nil
|
2024-01-19 16:37:15 +00:00
|
|
|
}
|