engagement

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: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// SendRetryOtp ISC endpoint to send a retry OTP
	SendRetryOtp = "internal/send_retry_otp/"
	// SendOtp ISC endpoint to send OTP
	SendOtp = "internal/send_otp/"
	// VerifyEmailOtp ISC endpoint to verify email OTP
	VerifyEmailOtp = "internal/verify_email_otp/"
	// VerifyOTPEndPoint ISC endpoint to verify OTP
	VerifyOTPEndPoint = "internal/verify_otp/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceEngagement

type ServiceEngagement interface {
	PublishKYCNudge(
		ctx context.Context,
		uid string,
		payload feedlib.Nudge,
	) (*http.Response, error)

	PublishKYCFeedItem(
		ctx context.Context,
		uid string,
		payload feedlib.Item,
	) (*http.Response, error)

	ResolveDefaultNudgeByTitle(
		ctx context.Context,
		UID string,
		flavour feedlib.Flavour,
		nudgeTitle string,
	) error

	SendMail(
		ctx context.Context,
		email string,
		message string,
		subject string,
	) error

	SendAlertToSupplier(ctx context.Context, input dto.EmailNotificationPayload) error

	NotifyAdmins(ctx context.Context, input dto.EmailNotificationPayload) error

	NotifySupplierOnSuspension(ctx context.Context, input dto.EmailNotificationPayload) error

	GenerateAndSendOTP(
		ctx context.Context,
		phone string,
		appID *string,
	) (*profileutils.OtpResponse, error)

	SendRetryOTP(
		ctx context.Context,
		msisdn string,
		retryStep int,
		appID *string,
	) (*profileutils.OtpResponse, error)

	VerifyOTP(ctx context.Context, phone, OTP string) (bool, error)

	VerifyEmailOTP(ctx context.Context, email, OTP string) (bool, error)

	SendSMS(ctx context.Context, phoneNumbers []string, message string) error
}

ServiceEngagement represents engagement usecases

type ServiceEngagementImpl

type ServiceEngagementImpl struct {
	Engage extension.ISCClientExtension
	// contains filtered or unexported fields
}

ServiceEngagementImpl represents engagement usecases

func NewServiceEngagementImpl

func NewServiceEngagementImpl(
	eng extension.ISCClientExtension,
	ext extension.BaseExtension,
) *ServiceEngagementImpl

NewServiceEngagementImpl returns new instance of ServiceEngagementImpl

func (*ServiceEngagementImpl) GenerateAndSendOTP

func (en *ServiceEngagementImpl) GenerateAndSendOTP(
	ctx context.Context,
	phone string,
	appID *string,
) (*profileutils.OtpResponse, error)

GenerateAndSendOTP creates a new otp and sends it to the provided phone number.

func (*ServiceEngagementImpl) NotifyAdmins

NotifyAdmins send email to admin notifying them of new KYC Request.

func (*ServiceEngagementImpl) NotifySupplierOnSuspension

func (en *ServiceEngagementImpl) NotifySupplierOnSuspension(ctx context.Context, input dto.EmailNotificationPayload) error

NotifySupplierOnSuspension send email to supplier notifying him of the suspension.

func (*ServiceEngagementImpl) PublishKYCFeedItem

func (en *ServiceEngagementImpl) PublishKYCFeedItem(
	ctx context.Context,
	uid string,
	payload feedlib.Item,
) (*http.Response, error)

PublishKYCFeedItem calls the `engagement service` to publish a KYC feed item

func (*ServiceEngagementImpl) PublishKYCNudge

func (en *ServiceEngagementImpl) PublishKYCNudge(
	ctx context.Context,
	uid string,
	payload feedlib.Nudge,
) (*http.Response, error)

PublishKYCNudge calls the `engagement service` to publish a KYC nudge

func (*ServiceEngagementImpl) ResolveDefaultNudgeByTitle

func (en *ServiceEngagementImpl) ResolveDefaultNudgeByTitle(
	ctx context.Context,
	UID string,
	flavour feedlib.Flavour,
	nudgeTitle string,
) error

ResolveDefaultNudgeByTitle calls the `engagement service` to resolve any default nudge by its `Title`

func (*ServiceEngagementImpl) SendAlertToSupplier

func (en *ServiceEngagementImpl) SendAlertToSupplier(ctx context.Context, input dto.EmailNotificationPayload) error

SendAlertToSupplier send email to supplier to acknowledgement receipt of KYC request/documents.

func (*ServiceEngagementImpl) SendMail

func (en *ServiceEngagementImpl) SendMail(
	ctx context.Context,
	email string,
	message string,
	subject string,
) error

SendMail sends emails to communicate to our users

func (*ServiceEngagementImpl) SendRetryOTP

func (en *ServiceEngagementImpl) SendRetryOTP(
	ctx context.Context,
	msisdn string,
	retryStep int,
	appID *string,
) (*profileutils.OtpResponse, error)

SendRetryOTP generates fallback OTPs when Africa is talking sms fails

func (*ServiceEngagementImpl) SendSMS

func (en *ServiceEngagementImpl) SendSMS(ctx context.Context, phoneNumbers []string, message string) error

SendSMS does the actual delivery of messages to the provided phone numbers

func (*ServiceEngagementImpl) VerifyEmailOTP

func (en *ServiceEngagementImpl) VerifyEmailOTP(ctx context.Context, email, otp string) (bool, error)

VerifyEmailOTP checks the otp provided matches the one sent to the user via email address

func (*ServiceEngagementImpl) VerifyOTP

func (en *ServiceEngagementImpl) VerifyOTP(ctx context.Context, phone, otp string) (bool, error)

VerifyOTP takes a phone number and an OTP and checks for the validity of the OTP code

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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