Skip to content

Commit

Permalink
chore: move chargemaster
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellgithinji committed Aug 3, 2021
1 parent 1773621 commit 3d2029d
Show file tree
Hide file tree
Showing 24 changed files with 996 additions and 2,666 deletions.
6 changes: 6 additions & 0 deletions go.sum
Expand Up @@ -118,8 +118,10 @@ 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 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/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -363,7 +365,9 @@ github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4=
github.com/rs/xid v1.3.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 @@ -410,6 +414,7 @@ github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNX
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
github.com/shopspring/decimal v1.2.0/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=
Expand Down Expand Up @@ -443,6 +448,7 @@ 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/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
Expand Down
9 changes: 0 additions & 9 deletions pkg/onboarding/application/exceptions/custom_errors.go
Expand Up @@ -315,15 +315,6 @@ func SupplierKYCAlreadySubmittedNotFoundError() error {
}
}

// FindProviderError returns an error message when a provider is not found
func FindProviderError(err error) error {
return &errorcodeutil.CustomError{
Err: err,
Message: FindProviderErrMsg,
Code: int(errorcodeutil.UnableToFindProvider),
}
}

// PublishKYCNudgeError returns an error message when there's a failure in
// creating a KYC nudge
func PublishKYCNudgeError(err error) error {
Expand Down
2 changes: 0 additions & 2 deletions pkg/onboarding/application/exceptions/custom_errors_test.go
Expand Up @@ -74,8 +74,6 @@ func TestCustomErrors(t *testing.T) {
assert.NotNil(t, err)
err = exceptions.SupplierKYCAlreadySubmittedNotFoundError()
assert.NotNil(t, err)
err = exceptions.FindProviderError(fmt.Errorf("error"))
assert.NotNil(t, err)
err = exceptions.PublishKYCNudgeError(fmt.Errorf("error"))
assert.NotNil(t, err)
err = exceptions.InvalidCredentialsError()
Expand Down
3 changes: 0 additions & 3 deletions pkg/onboarding/application/exceptions/error_messages.go
Expand Up @@ -126,9 +126,6 @@ const (
// A supplier should have only one kyc
SupplierKYCAlreadySubmittedErrMsg = "kyc already exists for supplier"

// FindProviderErrMsg is displayed if a provider is not found
FindProviderErrMsg = "unable to fetch provider from chargemaster"

// PublishKYCNudgeErrMsg is displayed if we are unable to publish a kyc nudge
PublishKYCNudgeErrMsg = "unable to publish kyc nudge"

Expand Down
Expand Up @@ -35,7 +35,6 @@ import (
"cloud.google.com/go/pubsub"
"firebase.google.com/go/auth"

"github.com/savannahghi/onboarding/pkg/onboarding/infrastructure/services/chargemaster"
"github.com/savannahghi/onboarding/pkg/onboarding/infrastructure/services/edi"
"github.com/savannahghi/onboarding/pkg/onboarding/infrastructure/services/engagement"
erp "gitlab.slade360emr.com/go/commontools/accounting/pkg/usecases"
Expand Down Expand Up @@ -147,7 +146,6 @@ func InitializeTestService(ctx context.Context) (*interactor.Interactor, error)
engagementClient := utils.NewInterServiceClient(engagementService, ext)
ediClient := utils.NewInterServiceClient(ediService, ext)

chrg := chargemaster.NewChargeMasterUseCasesImpl()
firestoreExtension := fb.NewFirestoreClientExtension(fsc)
fr := fb.NewFirebaseRepository(firestoreExtension, fbc)
erp := erp.NewAccounting()
Expand Down Expand Up @@ -175,25 +173,24 @@ func InitializeTestService(ctx context.Context) (*interactor.Interactor, error)
mes := messaging.NewServiceMessagingImpl(ext)
pinExt := extension.NewPINExtensionImpl()
profile := usecases.NewProfileUseCase(fr, ext, engage, ps, crmExt)
supplier := usecases.NewSupplierUseCases(fr, profile, erp, chrg, engage, mes, ext, ps)
supplier := usecases.NewSupplierUseCases(fr, profile, erp, engage, mes, ext, ps)
login := usecases.NewLoginUseCases(fr, profile, ext, pinExt)
survey := usecases.NewSurveyUseCases(fr, ext)
userpin := usecases.NewUserPinUseCase(fr, profile, ext, pinExt, engage)
su := usecases.NewSignUpUseCases(fr, profile, userpin, supplier, ext, engage, ps, edi)

return &interactor.Interactor{
Onboarding: profile,
Signup: su,
Supplier: supplier,
Login: login,
Survey: survey,
UserPIN: userpin,
ERP: erp,
ChargeMaster: chrg,
Engagement: engage,
PubSub: ps,
EDI: edi,
CrmExt: crmExt,
Onboarding: profile,
Signup: su,
Supplier: supplier,
Login: login,
Survey: survey,
UserPIN: userpin,
ERP: erp,
Engagement: engage,
PubSub: ps,
EDI: edi,
CrmExt: crmExt,
}, nil
}

Expand Down

This file was deleted.

0 comments on commit 3d2029d

Please sign in to comment.