Skip to content

Commit

Permalink
feat: integrates the new silcomms for sending sms service (#78)
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Kimutai <[email protected]>
  • Loading branch information
briankiboino and Brian Kimutai authored Nov 3, 2022
1 parent f8bdd6f commit 6c65f6b
Show file tree
Hide file tree
Showing 15 changed files with 583 additions and 326 deletions.
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ require (
github.com/labstack/gommon v0.3.1
github.com/mailgun/mailgun-go/v4 v4.8.1
github.com/markbates/pkger v0.17.1
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pkg/errors v0.9.1
github.com/pquerna/otp v1.3.0
github.com/rs/xid v1.4.0
Expand All @@ -43,10 +42,11 @@ require (
github.com/savannahghi/interserviceclient v0.0.18
github.com/savannahghi/profileutils v0.0.27
github.com/savannahghi/pubsubtools v0.0.3
github.com/savannahghi/serverutils v0.0.6
github.com/savannahghi/serverutils v0.0.7
github.com/savannahghi/silcomms v0.0.3
github.com/segmentio/ksuid v1.0.4
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.0
github.com/vektah/gqlparser/v2 v2.1.0
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
Expand All @@ -58,7 +58,6 @@ require (
go.opentelemetry.io/otel/trace v1.7.0
golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect
golang.org/x/oauth2 v0.0.0-20220630143837-2104d58473e0 // indirect
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d // indirect
golang.org/x/tools v0.1.11 // indirect
google.golang.org/api v0.86.0
google.golang.org/genproto v0.0.0-20220707150051-590a5ac7bee1 // indirect
Expand Down
23 changes: 13 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go
github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/boombuler/barcode v1.0.1 h1:NDBbPmhS+EqABEs5Kg3n/5ZNjy73Pz7SIV+KCeqyXcs=
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
github.com/brianvoe/gofakeit v3.18.0+incompatible h1:wDOmHc9DLG4nRjUVVaxA+CEglKOW72Y5+4WNxUIkjM8=
github.com/brianvoe/gofakeit v3.18.0+incompatible/go.mod h1:kfwdRA90vvNhPutZWfH7WPaDzUjz+CZFqG+rPkOjGOc=
github.com/casbin/casbin/v2 v2.37.0 h1:/poEwPSovi4bTOcP752/CsTQiRz2xycyVKFG7GUhbDw=
github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand Down Expand Up @@ -154,9 +156,7 @@ github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcju
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -365,6 +365,8 @@ github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/
github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk=
github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g=
github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw=
github.com/jarcoal/httpmock v1.2.0 h1:gSvTxxFR/MEMfsGrvRbdfpRUMBStovlSRLw0Ep1bwwc=
github.com/jarcoal/httpmock v1.2.0/go.mod h1:oCoTsnAz4+UoOUIf5lJOWV2QQIW5UoeUI6aM2YnWAZk=
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
Expand Down Expand Up @@ -433,6 +435,7 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
github.com/maxatome/go-testdeep v1.11.0/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70=
github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
Expand Down Expand Up @@ -476,9 +479,7 @@ github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/xid v1.4.0 h1:qd7wPTDkN6KQx2VmMBLrpHkiyQwgFXRnkOLacUiaSNY=
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/savannahghi/converterandformatter v0.0.3/go.mod h1:0o7yieYU10WabPqKuqj+5QL52eTL1eGElxjb+A68bbA=
Expand Down Expand Up @@ -515,8 +516,11 @@ github.com/savannahghi/scalarutils v0.0.4/go.mod h1:Z+Dl3wc3vy5zKvthctHAtYzol1p8
github.com/savannahghi/server_utils v0.0.1/go.mod h1:Tldm4Op4ARxk8xaP3BA0V52XVZEJenkq0ck4FCdEp+I=
github.com/savannahghi/serverutils v0.0.2/go.mod h1:sLX0El0i0DKN/9cUkB8xqm5cVMP79qCZvK60EzB7Pa4=
github.com/savannahghi/serverutils v0.0.4/go.mod h1:3VCEJ8BTHf/DW3WFjLqV4SznzrXaul/As2RJ5eNOO7U=
github.com/savannahghi/serverutils v0.0.6 h1:RCRHQbp/GtYwPsLmAwYe2gSwrM0R5XPyVUViXqItjDQ=
github.com/savannahghi/serverutils v0.0.6/go.mod h1:QTqJJaNk3Rmtl2RV9ltxERjvv7WPkMJyieX18TKYDG8=
github.com/savannahghi/serverutils v0.0.7 h1:+7ZDVG1jASPqfjlyPXb8zlL221epw78ZXw/66JS208s=
github.com/savannahghi/serverutils v0.0.7/go.mod h1:QTqJJaNk3Rmtl2RV9ltxERjvv7WPkMJyieX18TKYDG8=
github.com/savannahghi/silcomms v0.0.3 h1:wD2Yqc3xGhgvUfdQ/wfnLiazGkUAbxj5Vb+5OLIV9/w=
github.com/savannahghi/silcomms v0.0.3/go.mod h1:eBuQ3joCXGjSMv+DtPqv3vbn7YK6LwxlMznNCeJ3ypg=
github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g=
github.com/segmentio/ksuid v1.0.3/go.mod h1:/XUiZBD3kVx5SmUOl55voK5yeAbBNNIed+2O73XgrPE=
github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c=
Expand All @@ -528,11 +532,11 @@ github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFR
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
Expand Down Expand Up @@ -566,7 +570,6 @@ github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGr
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k=
github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
Expand Down Expand Up @@ -851,8 +854,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d h1:/m5NbqQelATgoSPVC2Z23sR4kVNokFwDDyWh/3rGY+I=
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
4 changes: 4 additions & 0 deletions gqlgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ autobind:
- "github.com/savannahghi/firebasetools"
- "github.com/savannahghi/interserviceclient"
- "google.golang.org/api/calendar/v3"
- "github.com/savannahghi/silcomms"

models:
ID:
Expand Down Expand Up @@ -65,3 +66,6 @@ models:
CalendarEvent:
model:
- "google.golang.org/api/calendar/v3.Event"
BulkSMSResponse:
model:
- "github.com/savannahghi/silcomms.BulkSMSResponse"
3 changes: 1 addition & 2 deletions pkg/engagement/infrastructure/services/otp/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/savannahghi/engagementcore/pkg/engagement/infrastructure/services/mail"
"github.com/savannahghi/engagementcore/pkg/engagement/infrastructure/services/sms"
"github.com/savannahghi/engagementcore/pkg/engagement/infrastructure/services/twilio"
"github.com/savannahghi/enumutils"
"github.com/savannahghi/firebasetools"
"github.com/savannahghi/interserviceclient"
"github.com/savannahghi/serverutils"
Expand Down Expand Up @@ -152,7 +151,7 @@ func (s ServiceOTPImpl) SendOTP(
msg := fmt.Sprintf(otpMsg, code, *appID)

if interserviceclient.IsKenyanNumber(normalizedPhoneNumber) {
_, err := s.sms.Send(ctx, normalizedPhoneNumber, msg, enumutils.SenderIDBewell)
_, err := s.sms.Send(ctx, normalizedPhoneNumber, msg)
if err != nil {
helpers.RecordSpanError(span, err)
return "", fmt.Errorf("failed to send OTP verification message to recipient")
Expand Down
33 changes: 13 additions & 20 deletions pkg/engagement/infrastructure/services/otp/service_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
smsMock "github.com/savannahghi/engagementcore/pkg/engagement/infrastructure/services/sms/mock"
"github.com/savannahghi/engagementcore/pkg/engagement/infrastructure/services/twilio"
twilioMock "github.com/savannahghi/engagementcore/pkg/engagement/infrastructure/services/twilio/mock"
"github.com/savannahghi/silcomms"

"github.com/savannahghi/enumutils"
"github.com/savannahghi/interserviceclient"
"github.com/stretchr/testify/assert"
)
Expand Down Expand Up @@ -143,9 +143,8 @@ func TestService_GenerateAndSendOTP(t *testing.T) {
fakeSMS.SendFn = func(
ctx context.Context,
to, message string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error) {
return &dto.SendMessageResponse{}, nil
) (*silcomms.BulkSMSResponse, error) {
return &silcomms.BulkSMSResponse{}, nil
}
}

Expand All @@ -161,8 +160,7 @@ func TestService_GenerateAndSendOTP(t *testing.T) {
fakeSMS.SendFn = func(
ctx context.Context,
to, message string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error) {
) (*silcomms.BulkSMSResponse, error) {
return nil, fmt.Errorf("failed to send OTP")
}
}
Expand Down Expand Up @@ -242,9 +240,8 @@ func TestService_SendOTPToEmail(t *testing.T) {
fakeSMS.SendFn = func(
ctx context.Context,
to, message string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error) {
return &dto.SendMessageResponse{}, nil
) (*silcomms.BulkSMSResponse, error) {
return &silcomms.BulkSMSResponse{}, nil
}

fakeMail.SendEmailFn = func(
Expand All @@ -269,9 +266,8 @@ func TestService_SendOTPToEmail(t *testing.T) {
fakeSMS.SendFn = func(
ctx context.Context,
to, message string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error) {
return &dto.SendMessageResponse{}, nil
) (*silcomms.BulkSMSResponse, error) {
return &silcomms.BulkSMSResponse{}, nil
}

fakeMail.SendEmailFn = func(
Expand All @@ -296,8 +292,7 @@ func TestService_SendOTPToEmail(t *testing.T) {
fakeSMS.SendFn = func(
ctx context.Context,
to, message string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error) {
) (*silcomms.BulkSMSResponse, error) {
return nil, fmt.Errorf("failed to generate and send OTP")
}
}
Expand Down Expand Up @@ -873,19 +868,17 @@ func Test_sendOtp(t *testing.T) {
fakeSMS.SendFn = func(
ctx context.Context,
to, message string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error) {
return &dto.SendMessageResponse{}, nil
) (*silcomms.BulkSMSResponse, error) {
return &silcomms.BulkSMSResponse{}, nil
}
}

if tt.name == "Sad Case -> fail to send otp to Kenyan number" {
fakeSMS.SendFn = func(
ctx context.Context,
to, message string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error) {
return &dto.SendMessageResponse{}, fmt.Errorf("failed to send OTP")
) (*silcomms.BulkSMSResponse, error) {
return &silcomms.BulkSMSResponse{}, fmt.Errorf("failed to send OTP")
}
}

Expand Down
23 changes: 9 additions & 14 deletions pkg/engagement/infrastructure/services/sms/mock/sms_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,36 @@ package mock
import (
"context"

"github.com/savannahghi/engagementcore/pkg/engagement/application/common/dto"
"github.com/savannahghi/enumutils"
"github.com/savannahghi/silcomms"
)

// FakeServiceSMS defines the interactions with the mock sms service
type FakeServiceSMS struct {
SendToManyFn func(
ctx context.Context,
message string,
to []string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error)
message string,
) (*silcomms.BulkSMSResponse, error)

SendFn func(
ctx context.Context,
to, message string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error)
) (*silcomms.BulkSMSResponse, error)
}

// SendToMany ...
func (f *FakeServiceSMS) SendToMany(
ctx context.Context,
message string,
to []string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error) {
return f.SendToManyFn(ctx, message, to, from)
message string,
) (*silcomms.BulkSMSResponse, error) {
return f.SendToManyFn(ctx, to, message)
}

// Send ...
func (f *FakeServiceSMS) Send(
ctx context.Context,
to, message string,
from enumutils.SenderID,
) (*dto.SendMessageResponse, error) {
return f.SendFn(ctx, to, message, from)
) (*silcomms.BulkSMSResponse, error) {
return f.SendFn(ctx, to, message)
}
Loading

0 comments on commit 6c65f6b

Please sign in to comment.