staff

package
v0.0.0-...-d5841c9 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StaffRepository

type StaffRepository struct {
	SMTPClient *mail.SMTPClient
	DBClient   *mongo.Client
	// contains filtered or unexported fields
}

func NewStaffRepository

func NewStaffRepository(smtpClient *mail.SMTPClient, dbClient *mongo.Client) *StaffRepository

func (StaffRepository) FetchStaffFromDB

func (s StaffRepository) FetchStaffFromDB(ctx context.Context, email string) (*models.StaffMember, error)

func (StaffRepository) StaffAcceptInvite

func (s StaffRepository) StaffAcceptInvite(ctx context.Context, input *model.StaffAcceptInviteInput) (*models.StaffMember, error)

StaffAcceptInvite verify invite code and set the new staff password and email as verified.

func (StaffRepository) StaffChangePassword

func (s StaffRepository) StaffChangePassword(ctx context.Context, input *model.StaffChangePasswordInput) (*models.StaffMember, error)

StaffChangePassword update the staff password.

func (StaffRepository) StaffDelete

StaffDelete soft deletes the staff from the database by adding a delatedAt field.

func (StaffRepository) StaffExists

func (s StaffRepository) StaffExists(ctx context.Context) (bool, error)

func (StaffRepository) StaffForgotPassword

func (s StaffRepository) StaffForgotPassword(ctx context.Context, input *model.StaffForgotPasswordInput) (*models.StaffMember, error)

func (StaffRepository) StaffLogin

func (StaffRepository) StaffLogout

func (s StaffRepository) StaffLogout(ctx context.Context) (*models.StaffMember, error)

StaffLogout invalidates the current logged in staff refresh token.

func (StaffRepository) StaffRegister

StaffRegister creates a new staff (admin users) and returns the Staff object.

func (StaffRepository) StaffResetPassword

func (s StaffRepository) StaffResetPassword(ctx context.Context, input *model.StaffResetPasswordInput) (*models.StaffMember, error)

func (StaffRepository) StaffSendInvite

func (s StaffRepository) StaffSendInvite(ctx context.Context, input *model.StaffInviteInput) (*models.StaffMember, error)

StaffSendInvite creates a new staff, with a specific role and creates an invite code and sends an email to the staff member.

func (StaffRepository) StaffUpdate

StaffUpdate updates the details of the staff i.e. Name, Email, Role.

Jump to

Keyboard shortcuts

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