mock

package
Version: v0.0.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeOnboardingRepository

type FakeOnboardingRepository struct {
	GetSupplierProfileByIDFn        func(ctx context.Context, id string) (*profileutils.Supplier, error)
	GetSupplierProfileByUIDFn       func(ctx context.Context, uid string) (*profileutils.Supplier, error)
	GetSupplierProfileByProfileIDFn func(ctx context.Context, profileID string) (*profileutils.Supplier, error)
	AddPartnerTypeFn                func(ctx context.Context, profileID string, name *string, partnerType *profileutils.PartnerType) (bool, error)

	UpdateSupplierProfileFn  func(ctx context.Context, profileID string, data *profileutils.Supplier) error
	AddRoleToUserfn          func(ctx context.Context, phone string, role profileutils.RoleType) error
	AddSupplierAccountTypeFn func(ctx context.Context, profileID string, accountType profileutils.AccountType) (*profileutils.Supplier, error)

	StageProfileNudgeFn func(ctx context.Context, nudge *feedlib.Nudge) error

	StageKYCProcessingRequestFn func(ctx context.Context, data *domain.KYCRequest) error

	RemoveKYCProcessingRequestFn func(ctx context.Context, supplierProfileID string) error

	// sets the active attribute of supplier profile to true
	ActivateSupplierProfileFn func(ctx context.Context, profileID string, supplier profileutils.Supplier) (*profileutils.Supplier, error)

	SetUpSupplierFn func(ctx context.Context, accountType profileutils.AccountType) (*profileutils.Supplier, error)

	FetchKYCProcessingRequestsFn func(ctx context.Context) ([]*domain.KYCRequest, error)

	FetchKYCProcessingRequestByIDFn func(ctx context.Context, id string) (*domain.KYCRequest, error)

	UpdateKYCProcessingRequestFn func(ctx context.Context, sup *domain.KYCRequest) error
	GetCustomerProfileByIDFn     func(ctx context.Context, id string) (*profileutils.Customer, error)

	GetCustomerProfileByProfileIDFn func(ctx context.Context, profileID string) (*profileutils.Customer, error)

	CreateUserProfileFn func(ctx context.Context, phoneNumber, uid string) (*profileutils.UserProfile, error)

	CreateDetailedUserProfileFn func(ctx context.Context, phoneNumber string, profile profileutils.UserProfile) (*profileutils.UserProfile, error)

	// creates an empty supplier profile
	CreateEmptySupplierProfileFn func(ctx context.Context, profileID string) (*profileutils.Supplier, error)

	CreateDetailedSupplierProfileFn func(ctx context.Context, profileID string, supplier profileutils.Supplier) (*profileutils.Supplier, error)

	// creates an empty customer profile
	CreateEmptyCustomerProfileFn func(ctx context.Context, profileID string) (*profileutils.Customer, error)

	// fetches a user profile by uid
	GetUserProfileByUIDFn func(ctx context.Context, uid string, suspended bool) (*profileutils.UserProfile, error)

	// fetches user profile by email
	GetUserProfileByPhoneOrEmailFn func(ctx context.Context, payload *dto.RetrieveUserProfileInput) (*profileutils.UserProfile, error)

	// fetches a user profile by id
	GetUserProfileByIDFn func(ctx context.Context, id string, suspended bool) (*profileutils.UserProfile, error)

	// fetches a user profile by phone number
	GetUserProfileByPhoneNumberFn func(ctx context.Context, phoneNumber string, suspended bool) (*profileutils.UserProfile, error)

	// fetches a user profile by primary phone number
	GetUserProfileByPrimaryPhoneNumberFn func(ctx context.Context, phoneNumber string, suspended bool) (*profileutils.UserProfile, error)

	// checks if a specific phone number has already been registered to another user
	CheckIfPhoneNumberExistsFn func(ctx context.Context, phone string) (bool, error)

	CheckIfEmailExistsFn func(ctx context.Context, email string) (bool, error)

	// checks if a specific username has already been registered to another user
	CheckIfUsernameExistsFn func(ctx context.Context, phone string) (bool, error)

	GenerateAuthCredentialsForAnonymousUserFn func(ctx context.Context) (*profileutils.AuthCredentialResponse, error)

	GenerateAuthCredentialsFn func(ctx context.Context, phone string, profile *profileutils.UserProfile) (*profileutils.AuthCredentialResponse, error)

	FetchAdminUsersFn func(ctx context.Context) ([]*profileutils.UserProfile, error)
	CheckIfAdminFn    func(profile *profileutils.UserProfile) bool

	// removes user completely. This should be used only under testing environment
	PurgeUserByPhoneNumberFn func(ctx context.Context, phone string) error

	HardResetSecondaryPhoneNumbersFn func(ctx context.Context, profile *profileutils.UserProfile, phoneNumbers []string) error

	HardResetSecondaryEmailAddressFn func(ctx context.Context, profile *profileutils.UserProfile, newSecondaryEmails []string) error

	// PINs
	GetPINByProfileIDFn func(ctx context.Context, ProfileID string) (*domain.PIN, error)

	// Record post visit survey
	RecordPostVisitSurveyFn func(ctx context.Context, input dto.PostVisitSurveyInput, UID string) error

	// User Pin methods
	SavePINFn   func(ctx context.Context, pin *domain.PIN) (bool, error)
	UpdatePINFn func(ctx context.Context, id string, pin *domain.PIN) (bool, error)

	ExchangeRefreshTokenForIDTokenFn func(
		ctx context.Context,
		token string,
	) (*profileutils.AuthCredentialResponse, error)

	GetCustomerOrSupplierProfileByProfileIDFn func(
		ctx context.Context,
		flavour feedlib.Flavour,
		profileID string,
	) (*profileutils.Customer, *profileutils.Supplier, error)

	GetOrCreatePhoneNumberUserFn func(
		ctx context.Context,
		phone string,
	) (*dto.CreatedUserResponse, error)

	GetUserProfileAttributesFn func(
		ctx context.Context,
		UIDs []string,
		attribute string,
	) (map[string][]string, error)

	CheckIfExperimentParticipantFn func(ctx context.Context, profileID string) (bool, error)

	AddUserAsExperimentParticipantFn func(ctx context.Context, profile *profileutils.UserProfile) (bool, error)

	RemoveUserAsExperimentParticipantFn func(ctx context.Context, profile *profileutils.UserProfile) (bool, error)

	AddNHIFDetailsFn func(
		ctx context.Context,
		input dto.NHIFDetailsInput,
		profileID string,
	) (*domain.NHIFDetails, error)

	GetNHIFDetailsByProfileIDFn func(
		ctx context.Context,
		profileID string,
	) (*domain.NHIFDetails, error)

	GetUserCommunicationsSettingsFn func(ctx context.Context, profileID string) (*profileutils.UserCommunicationsSetting, error)

	SetUserCommunicationsSettingsFn func(ctx context.Context, profileID string,
		allowWhatsApp *bool, allowTextSms *bool, allowPush *bool, allowEmail *bool) (*profileutils.UserCommunicationsSetting, error)

	PersistIncomingSMSDataFn func(ctx context.Context, input *dto.AfricasTalkingMessage) error

	AddAITSessionDetailsFn func(ctx context.Context, input *dto.SessionDetails) (*domain.USSDLeadDetails, error)
	GetAITSessionDetailsFn func(ctx context.Context, sessionID string) (*domain.USSDLeadDetails, error)
	UpdateSessionLevelFn   func(ctx context.Context, sessionID string, level int) (*domain.USSDLeadDetails, error)
	UpdateSessionPINFn     func(ctx context.Context, sessionID string, pin string) (*domain.USSDLeadDetails, error)

	UpdateCustomerProfileFn func(
		ctx context.Context,
		profileID string,
		customer profileutils.Customer,
	) (*profileutils.Customer, error)

	// Userprofile
	UpdateUserNameFn                func(ctx context.Context, id string, phoneNumber string) error
	UpdatePrimaryPhoneNumberFn      func(ctx context.Context, id string, phoneNumber string) error
	UpdatePrimaryEmailAddressFn     func(ctx context.Context, id string, emailAddress string) error
	UpdateSecondaryPhoneNumbersFn   func(ctx context.Context, id string, phoneNumbers []string) error
	UpdateSecondaryEmailAddressesFn func(ctx context.Context, id string, emailAddresses []string) error
	UpdateUserRoleIDsFn             func(ctx context.Context, id string, roleIDs []string) error
	UpdateSuspendedFn               func(ctx context.Context, id string, status bool) error
	UpdatePhotoUploadIDFn           func(ctx context.Context, id string, uploadID string) error
	UpdateCoversFn                  func(ctx context.Context, id string, covers []profileutils.Cover) error
	UpdatePushTokensFn              func(ctx context.Context, id string, pushToken []string) error
	UpdatePermissionsFn             func(ctx context.Context, id string, perms []profileutils.PermissionType) error
	UpdateRoleFn                    func(ctx context.Context, id string, role profileutils.RoleType) error
	UpdateBioDataFn                 func(ctx context.Context, id string, data profileutils.BioData) error
	UpdateVerifiedIdentifiersFn     func(ctx context.Context, id string, identifiers []profileutils.VerifiedIdentifier) error
	UpdateVerifiedUIDSFn            func(ctx context.Context, id string, uids []string) error
	UpdateAddressesFn               func(ctx context.Context, id string, address profileutils.Address, addressType enumutils.AddressType) error
	ListUserProfilesFn              func(ctx context.Context, role profileutils.RoleType) ([]*profileutils.UserProfile, error)
	UpdateOptOutFn                  func(ctx context.Context, option string, phoneNumber string) error
	UpdateAITSessionDetailsFn       func(ctx context.Context, phoneNumber string, contactLead *domain.USSDLeadDetails) error
	UpdateFavNavActionsFn           func(ctx context.Context, id string, favActions []string) error
	GetUserMarketingDataFn          func(ctx context.Context, phoneNumber string) (*dto.Segment, error)
	HandleResponseFromUSSDGatewayFn func(context context.Context, input *dto.SessionDetails) string
	SetUSSDUserPinFn                func(ctx context.Context, phoneNumber string, PIN string) error
	SaveUSSDEventFn                 func(ctx context.Context, input *dto.USSDEvent) (*dto.USSDEvent, error)
	SaveCoverAutolinkingEventsFn    func(ctx context.Context, input *dto.CoverLinkingEvent) (*dto.CoverLinkingEvent, error)
	GetAITDetailsFn                 func(ctx context.Context, phoneNumber string) (*domain.USSDLeadDetails, error)

	//roles
	CreateRoleFn               func(ctx context.Context, profileID string, role dto.RoleInput) (*profileutils.Role, error)
	GetAllRolesFn              func(ctx context.Context) (*[]profileutils.Role, error)
	UpdateRoleDetailsFn        func(ctx context.Context, profileID string, role profileutils.Role) (*profileutils.Role, error)
	GetRolesByIDsFn            func(ctx context.Context, roleIDs []string) (*[]profileutils.Role, error)
	GetRoleByIDFn              func(ctx context.Context, roleID string) (*profileutils.Role, error)
	GetRoleByNameFn            func(ctx context.Context, roleName string) (*profileutils.Role, error)
	CheckIfRoleNameExistsFn    func(ctx context.Context, name string) (bool, error)
	DeleteRoleFn               func(ctx context.Context, roleID string) (bool, error)
	CheckIfUserHasPermissionFn func(ctx context.Context, UID string, requiredPermission profileutils.Permission) (bool, error)
	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)

	//agents
	CreateAgentProfileFn        func(ctx context.Context, agentProfile domain.AgentProfile) error
	CheckIfAgentProfileExistsFn func(ctx context.Context, profileID string) (bool, error)
}

FakeOnboardingRepository is a mock onboarding repository.

func (*FakeOnboardingRepository) ActivateSupplierProfile

func (f *FakeOnboardingRepository) ActivateSupplierProfile(
	ctx context.Context,
	profileID string,
	supplier profileutils.Supplier,
) (*profileutils.Supplier, error)

ActivateSupplierProfile ...

func (*FakeOnboardingRepository) AddAITSessionDetails

func (f *FakeOnboardingRepository) AddAITSessionDetails(
	ctx context.Context,
	input *dto.SessionDetails,
) (*domain.USSDLeadDetails, error)

AddAITSessionDetails ...

func (*FakeOnboardingRepository) AddNHIFDetails

func (f *FakeOnboardingRepository) AddNHIFDetails(
	ctx context.Context,
	input dto.NHIFDetailsInput,
	profileID string,
) (*domain.NHIFDetails, error)

AddNHIFDetails ...

func (*FakeOnboardingRepository) AddPartnerType

func (f *FakeOnboardingRepository) AddPartnerType(
	ctx context.Context,
	profileID string,
	name *string,
	partnerType *profileutils.PartnerType,
) (bool, error)

AddPartnerType ...

func (*FakeOnboardingRepository) AddRoleToUser

func (f *FakeOnboardingRepository) AddRoleToUser(
	ctx context.Context,
	phone string,
	role profileutils.RoleType,
) error

AddRoleToUser ...

func (*FakeOnboardingRepository) AddSupplierAccountType

func (f *FakeOnboardingRepository) AddSupplierAccountType(
	ctx context.Context,
	profileID string,
	accountType profileutils.AccountType,
) (*profileutils.Supplier, error)

AddSupplierAccountType ...

func (*FakeOnboardingRepository) AddUserAsExperimentParticipant

func (f *FakeOnboardingRepository) AddUserAsExperimentParticipant(
	ctx context.Context,
	profile *profileutils.UserProfile,
) (bool, error)

AddUserAsExperimentParticipant ...

func (*FakeOnboardingRepository) CheckIfAdmin

func (f *FakeOnboardingRepository) CheckIfAdmin(profile *profileutils.UserProfile) bool

CheckIfAdmin ...

func (*FakeOnboardingRepository) CheckIfAdminProfileExists added in v0.0.23

func (f *FakeOnboardingRepository) CheckIfAdminProfileExists(ctx context.Context, profileID string) (bool, error)

CheckIfAdminProfileExists ...

func (*FakeOnboardingRepository) CheckIfAgentProfileExists added in v0.0.23

func (f *FakeOnboardingRepository) CheckIfAgentProfileExists(ctx context.Context, profileID string) (bool, error)

CheckIfAgentProfileExists ...

func (*FakeOnboardingRepository) CheckIfEmailExists

func (f *FakeOnboardingRepository) CheckIfEmailExists(
	ctx context.Context,
	email string,
) (bool, error)

CheckIfEmailExists ...

func (*FakeOnboardingRepository) CheckIfExperimentParticipant

func (f *FakeOnboardingRepository) CheckIfExperimentParticipant(
	ctx context.Context,
	profileID string,
) (bool, error)

CheckIfExperimentParticipant ...

func (*FakeOnboardingRepository) CheckIfPhoneNumberExists

func (f *FakeOnboardingRepository) CheckIfPhoneNumberExists(
	ctx context.Context,
	phone string,
) (bool, error)

CheckIfPhoneNumberExists checks if a specific phone number has already been registered to another user

func (*FakeOnboardingRepository) CheckIfRoleNameExists

func (f *FakeOnboardingRepository) CheckIfRoleNameExists(
	ctx context.Context,
	name string,
) (bool, error)

CheckIfRoleNameExists ...

func (*FakeOnboardingRepository) CheckIfUserHasPermission added in v0.0.2

func (f *FakeOnboardingRepository) CheckIfUserHasPermission(
	ctx context.Context,
	UID string,
	requiredPermission profileutils.Permission,
) (bool, error)

CheckIfUserHasPermission ...

func (*FakeOnboardingRepository) CheckIfUsernameExists

func (f *FakeOnboardingRepository) CheckIfUsernameExists(
	ctx context.Context,
	phone string,
) (bool, error)

CheckIfUsernameExists checks if a specific username has already been registered to another user

func (*FakeOnboardingRepository) CreateAdminProfile added in v0.0.23

func (f *FakeOnboardingRepository) CreateAdminProfile(ctx context.Context, adminProfile domain.AdminProfile) error

CreateAdminProfile ...

func (*FakeOnboardingRepository) CreateAgentProfile added in v0.0.23

func (f *FakeOnboardingRepository) CreateAgentProfile(ctx context.Context, agentProfile domain.AgentProfile) error

CreateAgentProfile ...

func (*FakeOnboardingRepository) CreateDetailedSupplierProfile

func (f *FakeOnboardingRepository) CreateDetailedSupplierProfile(
	ctx context.Context,
	profileID string,
	supplier profileutils.Supplier,
) (*profileutils.Supplier, error)

CreateDetailedSupplierProfile ...

func (*FakeOnboardingRepository) CreateDetailedUserProfile

func (f *FakeOnboardingRepository) CreateDetailedUserProfile(
	ctx context.Context,
	phoneNumber string,
	profile profileutils.UserProfile,
) (*profileutils.UserProfile, error)

CreateDetailedUserProfile ...

func (*FakeOnboardingRepository) CreateEmptyCustomerProfile

func (f *FakeOnboardingRepository) CreateEmptyCustomerProfile(
	ctx context.Context,
	profileID string,
) (*profileutils.Customer, error)

CreateEmptyCustomerProfile creates an empty customer profile

func (*FakeOnboardingRepository) CreateEmptySupplierProfile

func (f *FakeOnboardingRepository) CreateEmptySupplierProfile(
	ctx context.Context,
	profileID string,
) (*profileutils.Supplier, error)

CreateEmptySupplierProfile ...

func (*FakeOnboardingRepository) CreateRole

func (f *FakeOnboardingRepository) CreateRole(
	ctx context.Context,
	profileID string,
	input dto.RoleInput,
) (*profileutils.Role, error)

CreateRole ...

func (*FakeOnboardingRepository) CreateUserProfile

func (f *FakeOnboardingRepository) CreateUserProfile(
	ctx context.Context,
	phoneNumber, uid string,
) (*profileutils.UserProfile, error)

CreateUserProfile ...

func (*FakeOnboardingRepository) DeleteRole added in v0.0.2

func (f *FakeOnboardingRepository) DeleteRole(ctx context.Context, roleID string) (bool, error)

DeleteRole ...

func (*FakeOnboardingRepository) ExchangeRefreshTokenForIDToken

func (f *FakeOnboardingRepository) ExchangeRefreshTokenForIDToken(
	ctx context.Context,
	token string,
) (*profileutils.AuthCredentialResponse, error)

ExchangeRefreshTokenForIDToken ...

func (*FakeOnboardingRepository) FetchAdminUsers

func (f *FakeOnboardingRepository) FetchAdminUsers(
	ctx context.Context,
) ([]*profileutils.UserProfile, error)

FetchAdminUsers ...

func (*FakeOnboardingRepository) FetchKYCProcessingRequestByID

func (f *FakeOnboardingRepository) FetchKYCProcessingRequestByID(
	ctx context.Context,
	id string,
) (*domain.KYCRequest, error)

FetchKYCProcessingRequestByID ...

func (*FakeOnboardingRepository) FetchKYCProcessingRequests

func (f *FakeOnboardingRepository) FetchKYCProcessingRequests(
	ctx context.Context,
) ([]*domain.KYCRequest, error)

FetchKYCProcessingRequests ...

func (*FakeOnboardingRepository) GenerateAuthCredentials

func (f *FakeOnboardingRepository) GenerateAuthCredentials(
	ctx context.Context,
	phone string,
	profile *profileutils.UserProfile,
) (*profileutils.AuthCredentialResponse, error)

GenerateAuthCredentials ...

func (*FakeOnboardingRepository) GenerateAuthCredentialsForAnonymousUser

func (f *FakeOnboardingRepository) GenerateAuthCredentialsForAnonymousUser(
	ctx context.Context,
) (*profileutils.AuthCredentialResponse, error)

GenerateAuthCredentialsForAnonymousUser ...

func (*FakeOnboardingRepository) GetAITDetails

func (f *FakeOnboardingRepository) GetAITDetails(
	ctx context.Context,
	phoneNumber string,
) (*domain.USSDLeadDetails, error)

GetAITDetails ...

func (*FakeOnboardingRepository) GetAITSessionDetails

func (f *FakeOnboardingRepository) GetAITSessionDetails(
	ctx context.Context,
	sessionID string,
) (*domain.USSDLeadDetails, error)

GetAITSessionDetails ...

func (*FakeOnboardingRepository) GetAllRoles added in v0.0.2

func (f *FakeOnboardingRepository) GetAllRoles(
	ctx context.Context,
) (*[]profileutils.Role, error)

GetAllRoles ...

func (*FakeOnboardingRepository) GetCustomerOrSupplierProfileByProfileID

func (f *FakeOnboardingRepository) GetCustomerOrSupplierProfileByProfileID(
	ctx context.Context,
	flavour feedlib.Flavour,
	profileID string,
) (*profileutils.Customer, *profileutils.Supplier, error)

GetCustomerOrSupplierProfileByProfileID ...

func (*FakeOnboardingRepository) GetCustomerProfileByID

func (f *FakeOnboardingRepository) GetCustomerProfileByID(
	ctx context.Context,
	id string,
) (*profileutils.Customer, error)

GetCustomerProfileByID ...

func (*FakeOnboardingRepository) GetCustomerProfileByProfileID

func (f *FakeOnboardingRepository) GetCustomerProfileByProfileID(
	ctx context.Context,
	profileID string,
) (*profileutils.Customer, error)

GetCustomerProfileByProfileID ...

func (*FakeOnboardingRepository) GetNHIFDetailsByProfileID

func (f *FakeOnboardingRepository) GetNHIFDetailsByProfileID(
	ctx context.Context,
	profileID string,
) (*domain.NHIFDetails, error)

GetNHIFDetailsByProfileID ...

func (*FakeOnboardingRepository) GetOrCreatePhoneNumberUser

func (f *FakeOnboardingRepository) GetOrCreatePhoneNumberUser(ctx context.Context,
	phone string,
) (*dto.CreatedUserResponse, error)

GetOrCreatePhoneNumberUser ...

func (*FakeOnboardingRepository) GetPINByProfileID

func (f *FakeOnboardingRepository) GetPINByProfileID(
	ctx context.Context,
	ProfileID string,
) (*domain.PIN, error)

GetPINByProfileID PINs

func (*FakeOnboardingRepository) GetRoleByID

func (f *FakeOnboardingRepository) GetRoleByID(
	ctx context.Context,
	roleID string,
) (*profileutils.Role, error)

GetRoleByID ...

func (*FakeOnboardingRepository) GetRoleByName added in v0.0.2

func (f *FakeOnboardingRepository) GetRoleByName(ctx context.Context, roleName string) (*profileutils.Role, error)

GetRoleByName ...

func (*FakeOnboardingRepository) GetRolesByIDs

func (f *FakeOnboardingRepository) GetRolesByIDs(
	ctx context.Context,
	roleIDs []string,
) (*[]profileutils.Role, error)

GetRolesByIDs ...

func (*FakeOnboardingRepository) GetSupplierProfileByID

func (f *FakeOnboardingRepository) GetSupplierProfileByID(
	ctx context.Context,
	id string,
) (*profileutils.Supplier, error)

GetSupplierProfileByID ...

func (*FakeOnboardingRepository) GetSupplierProfileByProfileID

func (f *FakeOnboardingRepository) GetSupplierProfileByProfileID(
	ctx context.Context,
	profileID string,
) (*profileutils.Supplier, error)

GetSupplierProfileByProfileID ...

func (*FakeOnboardingRepository) GetSupplierProfileByUID

func (f *FakeOnboardingRepository) GetSupplierProfileByUID(
	ctx context.Context,
	uid string,
) (*profileutils.Supplier, error)

GetSupplierProfileByUID ...

func (*FakeOnboardingRepository) GetUserCommunicationsSettings

func (f *FakeOnboardingRepository) GetUserCommunicationsSettings(
	ctx context.Context,
	profileID string,
) (*profileutils.UserCommunicationsSetting, error)

GetUserCommunicationsSettings ...

func (*FakeOnboardingRepository) GetUserMarketingData

func (f *FakeOnboardingRepository) GetUserMarketingData(
	ctx context.Context,
	phoneNumber string,
) (*dto.Segment, error)

GetUserMarketingData ...

func (*FakeOnboardingRepository) GetUserProfileAttributes

func (f *FakeOnboardingRepository) GetUserProfileAttributes(
	ctx context.Context,
	UIDs []string,
	attribute string,
) (map[string][]string, error)

GetUserProfileAttributes ...

func (*FakeOnboardingRepository) GetUserProfileByID

func (f *FakeOnboardingRepository) GetUserProfileByID(
	ctx context.Context,
	id string,
	suspended bool,
) (*profileutils.UserProfile, error)

GetUserProfileByID fetches a user profile by id

func (*FakeOnboardingRepository) GetUserProfileByPhoneNumber

func (f *FakeOnboardingRepository) GetUserProfileByPhoneNumber(
	ctx context.Context,
	phoneNumber string,
	suspended bool,
) (*profileutils.UserProfile, error)

GetUserProfileByPhoneNumber fetches a user profile by phone number

func (*FakeOnboardingRepository) GetUserProfileByPhoneOrEmail added in v0.0.2

func (f *FakeOnboardingRepository) GetUserProfileByPhoneOrEmail(ctx context.Context, payload *dto.RetrieveUserProfileInput) (*profileutils.UserProfile, error)

GetUserProfileByPhoneOrEmail fetches user profile by email or phone

func (*FakeOnboardingRepository) GetUserProfileByPrimaryPhoneNumber

func (f *FakeOnboardingRepository) GetUserProfileByPrimaryPhoneNumber(
	ctx context.Context,
	phoneNumber string,
	suspended bool,
) (*profileutils.UserProfile, error)

GetUserProfileByPrimaryPhoneNumber fetches a user profile by primary phone number

func (*FakeOnboardingRepository) GetUserProfileByUID

func (f *FakeOnboardingRepository) GetUserProfileByUID(
	ctx context.Context,
	uid string,
	suspended bool,
) (*profileutils.UserProfile, error)

GetUserProfileByUID fetches a user profile by uidActivateSupplierProfile

func (*FakeOnboardingRepository) GetUserProfilesByRoleID added in v0.0.2

func (f *FakeOnboardingRepository) GetUserProfilesByRoleID(ctx context.Context, role string) ([]*profileutils.UserProfile, error)

GetUserProfilesByRoleID ...

func (*FakeOnboardingRepository) HandleResponseFromUSSDGateway

func (f *FakeOnboardingRepository) HandleResponseFromUSSDGateway(
	context context.Context,
	input *dto.SessionDetails,
) string

HandleResponseFromUSSDGateway ...

func (*FakeOnboardingRepository) HardResetSecondaryEmailAddress

func (f *FakeOnboardingRepository) HardResetSecondaryEmailAddress(
	ctx context.Context,
	profile *profileutils.UserProfile,
	newSecondaryEmails []string,
) error

HardResetSecondaryEmailAddress ...

func (*FakeOnboardingRepository) HardResetSecondaryPhoneNumbers

func (f *FakeOnboardingRepository) HardResetSecondaryPhoneNumbers(
	ctx context.Context,
	profile *profileutils.UserProfile,
	phoneNumbers []string,
) error

HardResetSecondaryPhoneNumbers ...

func (*FakeOnboardingRepository) ListUserProfiles

ListUserProfiles ...

func (*FakeOnboardingRepository) PersistIncomingSMSData

func (f *FakeOnboardingRepository) PersistIncomingSMSData(
	ctx context.Context,
	input *dto.AfricasTalkingMessage,
) error

PersistIncomingSMSData ensures Africa's Talking SMS data is persisted in the database

func (*FakeOnboardingRepository) PurgeUserByPhoneNumber

func (f *FakeOnboardingRepository) PurgeUserByPhoneNumber(ctx context.Context, phone string) error

PurgeUserByPhoneNumber removes user completely. This should be used only under testing environment

func (*FakeOnboardingRepository) RecordPostVisitSurvey

func (f *FakeOnboardingRepository) RecordPostVisitSurvey(
	ctx context.Context,
	input dto.PostVisitSurveyInput,
	UID string,
) error

RecordPostVisitSurvey Record post visit survey

func (*FakeOnboardingRepository) RemoveKYCProcessingRequest

func (f *FakeOnboardingRepository) RemoveKYCProcessingRequest(
	ctx context.Context,
	supplierProfileID string,
) error

RemoveKYCProcessingRequest ...

func (*FakeOnboardingRepository) RemoveUserAsExperimentParticipant

func (f *FakeOnboardingRepository) RemoveUserAsExperimentParticipant(
	ctx context.Context,
	profile *profileutils.UserProfile,
) (bool, error)

RemoveUserAsExperimentParticipant ...

func (*FakeOnboardingRepository) SaveCoverAutolinkingEvents

func (f *FakeOnboardingRepository) SaveCoverAutolinkingEvents(
	ctx context.Context,
	input *dto.CoverLinkingEvent,
) (*dto.CoverLinkingEvent, error)

SaveCoverAutolinkingEvents ...

func (*FakeOnboardingRepository) SavePIN

func (f *FakeOnboardingRepository) SavePIN(ctx context.Context, pin *domain.PIN) (bool, error)

SavePIN User Pin methods

func (*FakeOnboardingRepository) SaveRoleRevocation added in v0.0.2

func (f *FakeOnboardingRepository) SaveRoleRevocation(ctx context.Context, userID string, revocation dto.RoleRevocationInput) error

SaveRoleRevocation ...

func (*FakeOnboardingRepository) SaveUSSDEvent

func (f *FakeOnboardingRepository) SaveUSSDEvent(
	ctx context.Context,
	input *dto.USSDEvent,
) (*dto.USSDEvent, error)

SaveUSSDEvent ...

func (*FakeOnboardingRepository) SetUSSDUserPin

func (f *FakeOnboardingRepository) SetUSSDUserPin(
	ctx context.Context,
	phoneNumber string,
	PIN string,
) error

SetUSSDUserPin ...

func (*FakeOnboardingRepository) SetUpSupplier

func (f *FakeOnboardingRepository) SetUpSupplier(
	ctx context.Context,
	accountType profileutils.AccountType,
) (*profileutils.Supplier, error)

SetUpSupplier ...

func (*FakeOnboardingRepository) SetUserCommunicationsSettings

func (f *FakeOnboardingRepository) SetUserCommunicationsSettings(
	ctx context.Context,
	profileID string,
	allowWhatsApp *bool,
	allowTextSms *bool,
	allowPush *bool,
	allowEmail *bool,
) (*profileutils.UserCommunicationsSetting, error)

SetUserCommunicationsSettings ...

func (*FakeOnboardingRepository) StageKYCProcessingRequest

func (f *FakeOnboardingRepository) StageKYCProcessingRequest(
	ctx context.Context,
	data *domain.KYCRequest,
) error

StageKYCProcessingRequest ...

func (*FakeOnboardingRepository) StageProfileNudge

func (f *FakeOnboardingRepository) StageProfileNudge(
	ctx context.Context,
	nudge *feedlib.Nudge,
) error

StageProfileNudge ...

func (*FakeOnboardingRepository) UpdateAITSessionDetails

func (f *FakeOnboardingRepository) UpdateAITSessionDetails(
	ctx context.Context,
	phoneNumber string,
	contactLead *domain.USSDLeadDetails,
) error

UpdateAITSessionDetails ...

func (*FakeOnboardingRepository) UpdateAddresses

func (f *FakeOnboardingRepository) UpdateAddresses(
	ctx context.Context,
	id string,
	address profileutils.Address,
	addressType enumutils.AddressType,
) error

UpdateAddresses ...

func (*FakeOnboardingRepository) UpdateBioData

func (f *FakeOnboardingRepository) UpdateBioData(
	ctx context.Context,
	id string,
	data profileutils.BioData,
) error

UpdateBioData ...

func (*FakeOnboardingRepository) UpdateCovers

func (f *FakeOnboardingRepository) UpdateCovers(
	ctx context.Context,
	id string,
	covers []profileutils.Cover,
) error

UpdateCovers ...

func (*FakeOnboardingRepository) UpdateCustomerProfile

func (f *FakeOnboardingRepository) UpdateCustomerProfile(
	ctx context.Context,
	profileID string,
	customer profileutils.Customer,
) (*profileutils.Customer, error)

UpdateCustomerProfile ...

func (*FakeOnboardingRepository) UpdateFavNavActions

func (f *FakeOnboardingRepository) UpdateFavNavActions(
	ctx context.Context,
	id string,
	favActions []string,
) error

UpdateFavNavActions ...

func (*FakeOnboardingRepository) UpdateKYCProcessingRequest

func (f *FakeOnboardingRepository) UpdateKYCProcessingRequest(
	ctx context.Context,
	sup *domain.KYCRequest,
) error

UpdateKYCProcessingRequest ...

func (*FakeOnboardingRepository) UpdatePIN

func (f *FakeOnboardingRepository) UpdatePIN(
	ctx context.Context,
	id string,
	pin *domain.PIN,
) (bool, error)

UpdatePIN ...

func (*FakeOnboardingRepository) UpdatePermissions

func (f *FakeOnboardingRepository) UpdatePermissions(
	ctx context.Context,
	id string,
	perms []profileutils.PermissionType,
) error

UpdatePermissions ...

func (*FakeOnboardingRepository) UpdatePhotoUploadID

func (f *FakeOnboardingRepository) UpdatePhotoUploadID(
	ctx context.Context,
	id string,
	uploadID string,
) error

UpdatePhotoUploadID ...

func (*FakeOnboardingRepository) UpdatePrimaryEmailAddress

func (f *FakeOnboardingRepository) UpdatePrimaryEmailAddress(
	ctx context.Context,
	id string,
	emailAddress string,
) error

UpdatePrimaryEmailAddress ...

func (*FakeOnboardingRepository) UpdatePrimaryPhoneNumber

func (f *FakeOnboardingRepository) UpdatePrimaryPhoneNumber(
	ctx context.Context,
	id string,
	phoneNumber string,
) error

UpdatePrimaryPhoneNumber ...

func (*FakeOnboardingRepository) UpdatePushTokens

func (f *FakeOnboardingRepository) UpdatePushTokens(
	ctx context.Context,
	id string,
	pushToken []string,
) error

UpdatePushTokens ...

func (*FakeOnboardingRepository) UpdateRole

func (f *FakeOnboardingRepository) UpdateRole(
	ctx context.Context,
	id string,
	role profileutils.RoleType,
) error

UpdateRole ...

func (*FakeOnboardingRepository) UpdateRoleDetails

func (f *FakeOnboardingRepository) UpdateRoleDetails(
	ctx context.Context,
	profileID string,
	role profileutils.Role,
) (*profileutils.Role, error)

UpdateRoleDetails ...

func (*FakeOnboardingRepository) UpdateSecondaryEmailAddresses

func (f *FakeOnboardingRepository) UpdateSecondaryEmailAddresses(
	ctx context.Context,
	id string,
	emailAddresses []string,
) error

UpdateSecondaryEmailAddresses ...

func (*FakeOnboardingRepository) UpdateSecondaryPhoneNumbers

func (f *FakeOnboardingRepository) UpdateSecondaryPhoneNumbers(
	ctx context.Context,
	id string,
	phoneNumbers []string,
) error

UpdateSecondaryPhoneNumbers ...

func (*FakeOnboardingRepository) UpdateSessionLevel

func (f *FakeOnboardingRepository) UpdateSessionLevel(
	ctx context.Context,
	sessionID string,
	level int,
) (*domain.USSDLeadDetails, error)

UpdateSessionLevel ...

func (*FakeOnboardingRepository) UpdateSessionPIN

func (f *FakeOnboardingRepository) UpdateSessionPIN(
	ctx context.Context,
	sessionID string,
	pin string,
) (*domain.USSDLeadDetails, error)

UpdateSessionPIN ...

func (*FakeOnboardingRepository) UpdateSupplierProfile

func (f *FakeOnboardingRepository) UpdateSupplierProfile(
	ctx context.Context,
	profileID string,
	data *profileutils.Supplier,
) error

UpdateSupplierProfile ...

func (*FakeOnboardingRepository) UpdateSuspended

func (f *FakeOnboardingRepository) UpdateSuspended(
	ctx context.Context,
	id string,
	status bool,
) error

UpdateSuspended ...

func (*FakeOnboardingRepository) UpdateUserName

func (f *FakeOnboardingRepository) UpdateUserName(
	ctx context.Context,
	id string,
	phoneNumber string,
) error

UpdateUserName ...

func (*FakeOnboardingRepository) UpdateUserProfileEmail added in v0.0.2

func (f *FakeOnboardingRepository) UpdateUserProfileEmail(ctx context.Context, phone string, email string) error

UpdateUserProfileEmail ...

func (*FakeOnboardingRepository) UpdateUserRoleIDs added in v0.0.2

func (f *FakeOnboardingRepository) UpdateUserRoleIDs(
	ctx context.Context,
	id string,
	roleIDs []string,
) error

UpdateUserRoleIDs ...

func (*FakeOnboardingRepository) UpdateVerifiedIdentifiers

func (f *FakeOnboardingRepository) UpdateVerifiedIdentifiers(
	ctx context.Context,
	id string,
	identifiers []profileutils.VerifiedIdentifier,
) error

UpdateVerifiedIdentifiers ...

func (*FakeOnboardingRepository) UpdateVerifiedUIDS

func (f *FakeOnboardingRepository) UpdateVerifiedUIDS(
	ctx context.Context,
	id string,
	uids []string,
) error

UpdateVerifiedUIDS ...

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL