Skip to content

Commit

Permalink
Merge pull request #18 from savannahghi/app-fixes
Browse files Browse the repository at this point in the history
fix : error codes documentation
  • Loading branch information
maiyo01 committed Mar 29, 2022
2 parents 2a85b98 + cd96d16 commit b5aefe0
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
lint_and_test:
strategy:
matrix:
go-version: [1.16.x]
go-version: [1.17.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 80
Expand Down
90 changes: 45 additions & 45 deletions error_codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,225 +97,225 @@ const (

// RecordNotFound means that the provided record is not found.
// This may happen when the provided data e.g currency, user etc is not accepted
// It's error code is 19
// It's error code is 18
RecordNotFound

// UnableToFindProvider means that the selected provider could not be found
// This may happen if the provider is not specified in the charge master
// It's error code is 20
// It's error code is 19
UnableToFindProvider

// PublishNudgeFailure means that there was an error while publishing a nudge
// It's error code is 21
// It's error code is 20
PublishNudgeFailure

// InvalidCredentials means that the provided credentials are invalid
// This may happen when any of the customers provides wrong credentials
// It's error code is 22
// It's error code is 21
InvalidCredentials

// AddNewRecordError means that the record could not be saved
// This may happen may be as a result of wrong credentials or biodata
// It's error code is 23
// It's error code is 22
AddNewRecordError

// InvalidSladeCode means that there is a problem with the provide slade code
// This may occur when the slade code in the EDI does not match with the chosen provider
// It's error code is 24
// It's error code is 23
InvalidSladeCode

// KYCAlreadySubmitted means that there is a problem while submitting KYC
// This may happen when the KYC has already been subnmitted
// Its error code is 25
// Its error code is 24
KYCAlreadySubmitted

// RoleNotValid means that the user role does not match the role required
// to perform the current operation that the user is trying to perform.
// Its error code is 26
// Its error code is 25
RoleNotValid

//InsuranceDetailsNotCoverLinked means that the user's insurance details are not
//coverLinked
//Its error code is 27
//Its error code is 26
InsuranceDetailsNotCoverLinked

//CoverAlreadyExists means that the user has tried to add an already existing cover
//Its error code is 28
//Its error code is 27
CoverAlreadyExists

//UserNotAuthorizedToAccessThisResource means that the subject's
//email has been found to not have access to the specified resource
//Its error code is 29
//Its error code is 28
UserNotAuthorizedToAccessThisResource

//NilEligibilityMember means that the eligibility lookup
//done on the Slade360 EDI returns a nil
//Its error code is 30
//Its error code is 29
NilEligibilityMember

//MinorMember means that
//a minor has tried to add their own cover
//Its error code is 31
//Its error code is 30
MinorMember

// NilPayerDetails means that
//the payer details have been found to be nil
//Its error code is 32
//Its error code is 31
NilPayerDetails

// FailedToLookUpEligibility means that
//there is a failed eligilibility lookup on the connected Slade 360EDI
//This lookup also includes dependants and allowed providers in the response payload
//Its error code is 33
//Its error code is 32
FailedToLookUpEligibility

//UnlinkedCover means that
//a subject's cover details have been found to not be linked
//Its error code is 34
//Its error code is 33
UnlinkedCover

//NoBeneficiaryWithMemberNumber means that
//no beneficiaryId is found under the given member number
//Its error code is 35
//Its error code is 34
NoBeneficiaryWithMemberNumber

//FailedToFetchDependants means that
//the dependants of a particular principal cannot be retrieved
//Its error code is 36
//Its error code is 35
FailedToFetchDependants

//InvalidCover means that
//the eligibilityStatus does not equal a valid cover
//Its error code is 37
//Its error code is 36
InvalidCover

//UnableToAddCover means that
//the cover has not been added
//Its error code is 38
//Its error code is 37
UnableToAddCover

//NotARecognizedDocumentType means that
//the document used is not a recognized identification document
//Its error code is 39
//Its error code is 38
NotARecognizedDocumentType

// FailedCreateMemberProfile means that
//when the request to create a new member profile fails
// Its error code is 40
// Its error code is 39
FailedCreateMemberProfile

//FailedCreateMemberProfileNotificationPayload is the error message displayed
//when creation of a member profile notification payload fails
// Its error code is 41
// Its error code is 40
FailedCreateMemberProfileNotificationPayload

//UnableToFindUserBioData means that
//a subject's bio data cannot be found
//Its error code is 42
//Its error code is 41
UnableToFindUserBioData

//UnableToSaveMemberProfileRequest means that
//saving a member's profile request has failed
//Its error code is 43
//Its error code is 42
UnableToSaveMemberProfileRequest

//UnableToCheckIfUserIsAnAdmin means that
//checking to see if a user is an admin has failed
//Its error code is 44
//Its error code is 43
UnableToCheckIfUserIsAnAdmin

//LoggedInUserIsNotAnAdmin means that
//the user currently logged in has been found to not be an admin
//Its error code is 45
//Its error code is 44
LoggedInUserIsNotAnAdmin

//UnableToRetrieveMemberRequestNotifications means that
//retrieving member request notifications has failed
//Its error code is 46
//Its error code is 45
UnableToRetrieveMemberRequestNotifications

//UnableToMapMemberRequestNotification means that
//mapping the member request notification doc to object has failed
//Its error code is 47
//Its error code is 46
UnableToMapMemberRequestNotification

// UnableToRetrieveNotification means that
//retrieving a node from firestore fails with this ID
//Its error code is 48
//Its error code is 47
UnableToRetrieveNotification

//WrongNodeType means that
//a programming error has been made and a notification payload was expected
//Its error code is 49
//Its error code is 48
WrongNodeType

//NilNotificationPayloadNode means that
//a nil notification payload node is returned
//Its error code is 50
//Its error code is 49
NilNotificationPayloadNode

//UnableToSaveNotification means that
//saving a notification after updating it to read has failed
//Its error code is 51
//Its error code is 50
UnableToSaveNotification

//NoConfirmedPhoneNumbers means that
//a user's primary phone number is nil
//Its error code is 52
//Its error code is 51
NoConfirmedPhoneNumbers

//InvalidPhoneNumberFormat means that
//the phone number format is invalid
//Its error code is 53
//Its error code is 52
InvalidPhoneNumberFormat

// UnableToSendText means that
//sending a text to the phone number in question has failed
//Its error code is 54
//Its error code is 53
UnableToSendText

//UnknownStateProvided means that
//an unknown state has been entered
//Its error code is 55
//Its error code is 54
UnknownStateProvided

//UnableToFetchProviderList means that
//fetching a provider list has failed
//Its error code is 56
//Its error code is 55
UnableToFetchProviderList

//ExpectedCardToBeTypeString means that
//the card is of another type apart from string
//Its error code is 57
//Its error code is 56
ExpectedCardToBeTypeString

//HasSladeCard means that
//the type of HasSladeCard variable is of another type other than bool
//Its error code is 58
//Its error code is 57
HasSladeCard

//NavigationActionsError means that
//the system is not able to update or retrive a users navigation actions
//Its error code is 59
//Its error code is 58
NavigationActionsError

// GetInviteLinkError means that the system is unable to get a user's invite link'
// the flavour passed when generating the invite link is invalid
// Its error code is 60
// Its error code is 59
GetInviteLinkError

// SendInviteSMSError means that the system is unable to send an invite SMS' to a user'
// the system failed to make a successful request to the messaging service
// Its error code is 61
// Its error code is 60
SendInviteSMSError

// GenerateTempPINError means that the system is unable to generate a temporary PIN'
// the random number generator has failed (which is highly unlikely)
// Its error code is 62
// Its error code is 61
GenerateTempPINError

//HasNoHistoricalClaimsError means that a lapsed cover does not have any historical claims.
// this is typically true when the beneficiary has not utilized their cover in any way
//Its error code is 63
//Its error code is 62
HasNoHistoricalClaimsError
)
41 changes: 40 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,47 @@
module github.com/savannahghi/errorcodeutil

go 1.16
go 1.17

require (
github.com/savannahghi/serverutils v0.0.4
github.com/stretchr/testify v1.7.0
)

require (
cloud.google.com/go v0.84.0 // indirect
cloud.google.com/go/logging v1.4.2 // indirect
contrib.go.opencensus.io/exporter/stackdriver v0.13.6 // indirect
github.com/aws/aws-sdk-go v1.37.0 // indirect
github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/getsentry/sentry-go v0.11.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/otel v1.0.0-RC1 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.0.0-RC1 // indirect
go.opentelemetry.io/otel/sdk v1.0.0-RC1 // indirect
go.opentelemetry.io/otel/trace v1.0.0-RC1 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.4.2 // indirect
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 // indirect
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20210603125802-9665404d3644 // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/tools v0.1.2 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/api v0.48.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d // indirect
google.golang.org/grpc v1.38.0 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

0 comments on commit b5aefe0

Please sign in to comment.