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

20 lines
616 B
Go
Raw Normal View History

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) GetAll(ctx context.Context, request param.GetAllAddressesRequest) (param.GetAllAddressesResponse, error) {
const op = "benefactoraddressservice.GetAll"
addresses, err := s.repo.GetAddresses(ctx, request.BenefactorID)
if err != nil {
return param.GetAllAddressesResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
}
return param.GetAllAddressesResponse{AllAddresses: addresses}, nil
}