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) Get(ctx context.Context, req param.GetAddressRequest) (param.GetAddressResponse, error) { const op = "benefactoraddressservice.Get" if fieldErrors, vErr := s.vld.ValidateGetAddress(ctx, req); vErr != nil { return param.GetAddressResponse{FieldErrors: fieldErrors}, richerror.New(op).WithErr(vErr) } address, err := s.repo.GetAddress(ctx, req.AddressID, req.BenefactorID) if err != nil { return param.GetAddressResponse{}, richerror.New(op).WithErr(err) } return param.GetAddressResponse{Address: address}, nil }