From 716c572934dd27c8bde146411cc7185ae174da2a Mon Sep 17 00:00:00 2001 From: ochom Date: Sun, 29 Aug 2021 18:33:49 +0300 Subject: [PATCH] chore: remove agent usecases abd objects --- pkg/onboarding/application/dto/input.go | 12 - pkg/onboarding/application/dto/output.go | 27 - .../application/utils/admin_template.go | 393 ------------ .../application/utils/agent_template.go | 391 ------------ pkg/onboarding/domain/models.go | 7 - .../presentation/graph/generated/generated.go | 558 ------------------ .../presentation/graph/types.graphql | 15 - pkg/onboarding/repository/mock/onboarding.go | 14 - pkg/onboarding/usecases/roles.go | 2 +- 9 files changed, 1 insertion(+), 1418 deletions(-) delete mode 100644 pkg/onboarding/application/utils/admin_template.go delete mode 100644 pkg/onboarding/application/utils/agent_template.go diff --git a/pkg/onboarding/application/dto/input.go b/pkg/onboarding/application/dto/input.go index 47f9498d..0696791f 100644 --- a/pkg/onboarding/application/dto/input.go +++ b/pkg/onboarding/application/dto/input.go @@ -168,18 +168,6 @@ type RolePayload struct { Role *profileutils.RoleType `json:"role"` } -// RegisterAdminInput provides the data payload required to create an Admin -type RegisterAdminInput struct { - FirstName string `json:"lastName"` - LastName string `json:"firstName"` - Gender enumutils.Gender `json:"gender"` - PhoneNumber string `json:"phoneNumber"` - Email string `json:"email"` - DateOfBirth scalarutils.Date `json:"dateOfBirth"` - // ID of the Role being assigned to the new employee - RoleIDs []string `json:"roleIDs"` -} - //CustomerPubSubMessagePayload is an `onboarding` PubSub message struct for commontools type CustomerPubSubMessagePayload struct { CustomerPayload dm.CustomerPayload `json:"customerPayload"` diff --git a/pkg/onboarding/application/dto/output.go b/pkg/onboarding/application/dto/output.go index 6cba8456..8b1e3815 100644 --- a/pkg/onboarding/application/dto/output.go +++ b/pkg/onboarding/application/dto/output.go @@ -5,33 +5,6 @@ import ( "github.com/savannahghi/profileutils" ) -// Admin represents agent with details inferred from their user profile -type Admin struct { - ID string `json:"id"` - - PrimaryPhone string `json:"primaryPhone"` - - PrimaryEmailAddress *string `json:"primaryEmailAddress"` - - SecondaryPhoneNumbers []string `json:"secondaryPhoneNumbers"` - - SecondaryEmailAddresses []string `json:"secondaryEmailAddresses"` - - TermsAccepted bool `json:"termsAccepted,omitempty"` - - Suspended bool `json:"suspended"` - - PhotoUploadID string `json:"photoUploadID,omitempty"` - - UserBioData profileutils.BioData `json:"userBioData,omitempty"` - - // Resend PIN helps inform the whether a send new temporary PIN - // True when the user hasn't performed the initial sign up to change PIN - ResendPIN bool `json:"resendPIN"` - - Roles []RoleOutput `json:"roles"` -} - // AccountRecoveryPhonesResponse payload sent back to the frontend when recovery an account type AccountRecoveryPhonesResponse struct { MaskedPhoneNumbers []string `json:"maskedPhoneNumbers"` diff --git a/pkg/onboarding/application/utils/admin_template.go b/pkg/onboarding/application/utils/admin_template.go deleted file mode 100644 index 6de55239..00000000 --- a/pkg/onboarding/application/utils/admin_template.go +++ /dev/null @@ -1,393 +0,0 @@ -package utils - -// AdminApprovalEmail is the email sent to an admin once registered -const AdminApprovalEmail = ` - - - - - Be.Well Professional by Slade 360° - Connected healthcare platform. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌  -
- -
- - - - - - - - - - - -` diff --git a/pkg/onboarding/application/utils/agent_template.go b/pkg/onboarding/application/utils/agent_template.go deleted file mode 100644 index 9932da77..00000000 --- a/pkg/onboarding/application/utils/agent_template.go +++ /dev/null @@ -1,391 +0,0 @@ -package utils - -// AgentApprovalEmail is the email sent to an agent once registered -const AgentApprovalEmail = ` - - - - - Be.Well Professional by Slade 360° - Connected healthcare platform. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌  -
- -
- - - - - - - - - - - -` diff --git a/pkg/onboarding/domain/models.go b/pkg/onboarding/domain/models.go index 1e7a56b7..4260a8ca 100644 --- a/pkg/onboarding/domain/models.go +++ b/pkg/onboarding/domain/models.go @@ -139,10 +139,3 @@ type RoleRevocationLog struct { // Created is the timestamp indicating when the role was created Created time.Time `json:"created" firestore:"created"` } - -//AdminProfile is the profile of all users who permform admin tasks -type AdminProfile struct { - ID string `json:"id,omitempty"` - ProfileID string `json:"profileID,omitempty"` - OrganizationID string `json:"organizationID,omitempty"` -} diff --git a/pkg/onboarding/presentation/graph/generated/generated.go b/pkg/onboarding/presentation/graph/generated/generated.go index ef28c231..9fba1af7 100644 --- a/pkg/onboarding/presentation/graph/generated/generated.go +++ b/pkg/onboarding/presentation/graph/generated/generated.go @@ -64,20 +64,6 @@ type ComplexityRoot struct { PlaceID func(childComplexity int) int } - Admin struct { - ID func(childComplexity int) int - PhotoUploadID func(childComplexity int) int - PrimaryEmailAddress func(childComplexity int) int - PrimaryPhone func(childComplexity int) int - ResendPIN func(childComplexity int) int - Roles func(childComplexity int) int - SecondaryEmailAddresses func(childComplexity int) int - SecondaryPhoneNumbers func(childComplexity int) int - Suspended func(childComplexity int) int - TermsAccepted func(childComplexity int) int - UserBioData func(childComplexity int) int - } - Beneficiary struct { DateOfBirth func(childComplexity int) int Emails func(childComplexity int) int @@ -490,83 +476,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Address.PlaceID(childComplexity), true - case "Admin.id": - if e.complexity.Admin.ID == nil { - break - } - - return e.complexity.Admin.ID(childComplexity), true - - case "Admin.photoUploadID": - if e.complexity.Admin.PhotoUploadID == nil { - break - } - - return e.complexity.Admin.PhotoUploadID(childComplexity), true - - case "Admin.primaryEmailAddress": - if e.complexity.Admin.PrimaryEmailAddress == nil { - break - } - - return e.complexity.Admin.PrimaryEmailAddress(childComplexity), true - - case "Admin.primaryPhone": - if e.complexity.Admin.PrimaryPhone == nil { - break - } - - return e.complexity.Admin.PrimaryPhone(childComplexity), true - - case "Admin.resendPIN": - if e.complexity.Admin.ResendPIN == nil { - break - } - - return e.complexity.Admin.ResendPIN(childComplexity), true - - case "Admin.roles": - if e.complexity.Admin.Roles == nil { - break - } - - return e.complexity.Admin.Roles(childComplexity), true - - case "Admin.secondaryEmailAddresses": - if e.complexity.Admin.SecondaryEmailAddresses == nil { - break - } - - return e.complexity.Admin.SecondaryEmailAddresses(childComplexity), true - - case "Admin.secondaryPhoneNumbers": - if e.complexity.Admin.SecondaryPhoneNumbers == nil { - break - } - - return e.complexity.Admin.SecondaryPhoneNumbers(childComplexity), true - - case "Admin.suspended": - if e.complexity.Admin.Suspended == nil { - break - } - - return e.complexity.Admin.Suspended(childComplexity), true - - case "Admin.termsAccepted": - if e.complexity.Admin.TermsAccepted == nil { - break - } - - return e.complexity.Admin.TermsAccepted(childComplexity), true - - case "Admin.userBioData": - if e.complexity.Admin.UserBioData == nil { - break - } - - return e.complexity.Admin.UserBioData(childComplexity), true - case "Beneficiary.dateOfBirth": if e.complexity.Beneficiary.DateOfBirth == nil { break @@ -2748,7 +2657,6 @@ type Location { branchSladeCode: String } - type Identification { identificationDocType: IdentificationDocType! identificationDocNumber: String! @@ -2818,20 +2726,6 @@ type UserCommunicationsSetting { allowEmail: Boolean! } -type Admin { - id: String! - primaryPhone: String! - primaryEmailAddress: String - secondaryPhoneNumbers: [String] - secondaryEmailAddresses: [String] - termsAccepted: Boolean - suspended: Boolean - photoUploadID: String - userBioData: BioData - resendPIN: Boolean - roles: [RoleOutput] -} - extend type Link { ID: String URL: String @@ -3839,364 +3733,6 @@ func (ec *executionContext) _Address_formattedAddress(ctx context.Context, field return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _Admin_id(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Admin_primaryPhone(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PrimaryPhone, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Admin_primaryEmailAddress(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PrimaryEmailAddress, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(*string) - fc.Result = res - return ec.marshalOString2ᚖstring(ctx, field.Selections, res) -} - -func (ec *executionContext) _Admin_secondaryPhoneNumbers(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SecondaryPhoneNumbers, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalOString2ᚕstring(ctx, field.Selections, res) -} - -func (ec *executionContext) _Admin_secondaryEmailAddresses(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.SecondaryEmailAddresses, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]string) - fc.Result = res - return ec.marshalOString2ᚕstring(ctx, field.Selections, res) -} - -func (ec *executionContext) _Admin_termsAccepted(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.TermsAccepted, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) _Admin_suspended(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Suspended, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) _Admin_photoUploadID(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.PhotoUploadID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalOString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _Admin_userBioData(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.UserBioData, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(profileutils.BioData) - fc.Result = res - return ec.marshalOBioData2githubᚗcomᚋsavannahghiᚋprofileutilsᚐBioData(ctx, field.Selections, res) -} - -func (ec *executionContext) _Admin_resendPIN(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ResendPIN, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.(bool) - fc.Result = res - return ec.marshalOBoolean2bool(ctx, field.Selections, res) -} - -func (ec *executionContext) _Admin_roles(ctx context.Context, field graphql.CollectedField, obj *dto.Admin) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Admin", - Field: field, - Args: nil, - IsMethod: false, - IsResolver: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.Roles, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - return graphql.Null - } - res := resTmp.([]dto.RoleOutput) - fc.Result = res - return ec.marshalORoleOutput2ᚕgithubᚗcomᚋsavannahghiᚋonboardingᚋpkgᚋonboardingᚋapplicationᚋdtoᚐRoleOutput(ctx, field.Selections, res) -} - func (ec *executionContext) _Beneficiary_name(ctx context.Context, field graphql.CollectedField, obj *model.Beneficiary) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -12986,56 +12522,6 @@ func (ec *executionContext) _Address(ctx context.Context, sel ast.SelectionSet, return out } -var adminImplementors = []string{"Admin"} - -func (ec *executionContext) _Admin(ctx context.Context, sel ast.SelectionSet, obj *dto.Admin) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, adminImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("Admin") - case "id": - out.Values[i] = ec._Admin_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "primaryPhone": - out.Values[i] = ec._Admin_primaryPhone(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "primaryEmailAddress": - out.Values[i] = ec._Admin_primaryEmailAddress(ctx, field, obj) - case "secondaryPhoneNumbers": - out.Values[i] = ec._Admin_secondaryPhoneNumbers(ctx, field, obj) - case "secondaryEmailAddresses": - out.Values[i] = ec._Admin_secondaryEmailAddresses(ctx, field, obj) - case "termsAccepted": - out.Values[i] = ec._Admin_termsAccepted(ctx, field, obj) - case "suspended": - out.Values[i] = ec._Admin_suspended(ctx, field, obj) - case "photoUploadID": - out.Values[i] = ec._Admin_photoUploadID(ctx, field, obj) - case "userBioData": - out.Values[i] = ec._Admin_userBioData(ctx, field, obj) - case "resendPIN": - out.Values[i] = ec._Admin_resendPIN(ctx, field, obj) - case "roles": - out.Values[i] = ec._Admin_roles(ctx, field, obj) - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - var beneficiaryImplementors = []string{"Beneficiary"} func (ec *executionContext) _Beneficiary(ctx context.Context, sel ast.SelectionSet, obj *model.Beneficiary) graphql.Marshaler { @@ -16569,50 +16055,6 @@ func (ec *executionContext) marshalOReceivablesAccount2githubᚗcomᚋsavannahgh return ec._ReceivablesAccount(ctx, sel, &v) } -func (ec *executionContext) marshalORoleOutput2githubᚗcomᚋsavannahghiᚋonboardingᚋpkgᚋonboardingᚋapplicationᚋdtoᚐRoleOutput(ctx context.Context, sel ast.SelectionSet, v dto.RoleOutput) graphql.Marshaler { - return ec._RoleOutput(ctx, sel, &v) -} - -func (ec *executionContext) marshalORoleOutput2ᚕgithubᚗcomᚋsavannahghiᚋonboardingᚋpkgᚋonboardingᚋapplicationᚋdtoᚐRoleOutput(ctx context.Context, sel ast.SelectionSet, v []dto.RoleOutput) graphql.Marshaler { - if v == nil { - return graphql.Null - } - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalORoleOutput2githubᚗcomᚋsavannahghiᚋonboardingᚋpkgᚋonboardingᚋapplicationᚋdtoᚐRoleOutput(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - return ret -} - func (ec *executionContext) marshalORoleOutput2ᚕᚖgithubᚗcomᚋsavannahghiᚋonboardingᚋpkgᚋonboardingᚋapplicationᚋdtoᚐRoleOutput(ctx context.Context, sel ast.SelectionSet, v []*dto.RoleOutput) graphql.Marshaler { if v == nil { return graphql.Null diff --git a/pkg/onboarding/presentation/graph/types.graphql b/pkg/onboarding/presentation/graph/types.graphql index 62c43aec..28ac6412 100644 --- a/pkg/onboarding/presentation/graph/types.graphql +++ b/pkg/onboarding/presentation/graph/types.graphql @@ -117,7 +117,6 @@ type Location { branchSladeCode: String } - type Identification { identificationDocType: IdentificationDocType! identificationDocNumber: String! @@ -187,20 +186,6 @@ type UserCommunicationsSetting { allowEmail: Boolean! } -type Admin { - id: String! - primaryPhone: String! - primaryEmailAddress: String - secondaryPhoneNumbers: [String] - secondaryEmailAddresses: [String] - termsAccepted: Boolean - suspended: Boolean - photoUploadID: String - userBioData: BioData - resendPIN: Boolean - roles: [RoleOutput] -} - extend type Link { ID: String URL: String diff --git a/pkg/onboarding/repository/mock/onboarding.go b/pkg/onboarding/repository/mock/onboarding.go index a4af96f4..090d3a0e 100644 --- a/pkg/onboarding/repository/mock/onboarding.go +++ b/pkg/onboarding/repository/mock/onboarding.go @@ -171,10 +171,6 @@ type FakeOnboardingRepository struct { UpdateUserProfileEmailFn func(ctx context.Context, phone string, email string) error GetUserProfilesByRoleIDFn func(ctx context.Context, role string) ([]*profileutils.UserProfile, error) SaveRoleRevocationFn func(ctx context.Context, userID string, revocation dto.RoleRevocationInput) error - - //admins - CreateAdminProfileFn func(ctx context.Context, adminProfile domain.AdminProfile) error - CheckIfAdminProfileExistsFn func(ctx context.Context, profileID string) (bool, error) } // GetSupplierProfileByID ... @@ -819,13 +815,3 @@ func (f *FakeOnboardingRepository) GetUserProfilesByRoleID(ctx context.Context, func (f *FakeOnboardingRepository) SaveRoleRevocation(ctx context.Context, userID string, revocation dto.RoleRevocationInput) error { return f.SaveRoleRevocationFn(ctx, userID, revocation) } - -//CreateAdminProfile ... -func (f *FakeOnboardingRepository) CreateAdminProfile(ctx context.Context, adminProfile domain.AdminProfile) error { - return f.CreateAdminProfileFn(ctx, adminProfile) -} - -//CheckIfAdminProfileExists ... -func (f *FakeOnboardingRepository) CheckIfAdminProfileExists(ctx context.Context, profileID string) (bool, error) { - return f.CheckIfAdminProfileExistsFn(ctx, profileID) -} diff --git a/pkg/onboarding/usecases/roles.go b/pkg/onboarding/usecases/roles.go index 46d4076d..11f6ac19 100644 --- a/pkg/onboarding/usecases/roles.go +++ b/pkg/onboarding/usecases/roles.go @@ -13,7 +13,7 @@ import ( "github.com/savannahghi/profileutils" ) -// RoleUseCase represent the business logic required for management of agents +// RoleUseCase represent the business logic required for management of roles type RoleUseCase interface { CreateRole(ctx context.Context, input dto.RoleInput) (*dto.RoleOutput, error)