mysqlredis

package
v0.0.0-...-2fddd97 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepositoryCompany

type RepositoryCompany struct {
	Clients *clients.Clients
}

RepositoryCompany contains clients and Company repositories

func (RepositoryCompany) CreateCompany

func (r RepositoryCompany) CreateCompany(dbtx common.DBTx, company entity.Company) (*entity.Company, error)

CreateCompany is used to create a company when user first register

func (RepositoryCompany) GetCompanyByUsername

func (r RepositoryCompany) GetCompanyByUsername(dbtx common.DBTx, companyUsername string) (company entity.Company, err error)

GetCompanyByUsername is used to get company by company username

type RepositoryEmployee

type RepositoryEmployee struct {
	Clients *clients.Clients
}

RepositoryEmployee contains clients and Employee repositories

func (RepositoryEmployee) CreateEmployee

func (r RepositoryEmployee) CreateEmployee(dbtx common.DBTx, e entity.Employee) (*entity.Employee, error)

CreateEmployee is used to create an employee

func (RepositoryEmployee) GetEmployeeByIdentifier

func (r RepositoryEmployee) GetEmployeeByIdentifier(dbtx common.DBTx, companyID int, employeeIdentifier string) (employee entity.Employee, err error)

GetEmployeeByIdentifier is used to get employee by email or phone number

func (RepositoryEmployee) GetEmployeePassword

func (r RepositoryEmployee) GetEmployeePassword(dbtx common.DBTx, companyID, employeeID int) (password string, err error)

GetEmployeePassword is used to get employee's hashed password

func (RepositoryEmployee) GetEmployees

func (r RepositoryEmployee) GetEmployees(dbtx common.DBTx, companyID int, p common.PaginationRepo) (employees []entity.Employee, err error)

GetEmployees is used to get all employee from same company

func (RepositoryEmployee) GetEmployeesCount

func (r RepositoryEmployee) GetEmployeesCount(dbtx common.DBTx, companyID int) (n int, err error)

GetEmployeesCount is used to count all employees for pagination

func (RepositoryEmployee) IsEmployeeExist

func (r RepositoryEmployee) IsEmployeeExist(dbtx common.DBTx, companyID int, email, phoneNumber string) (bool, error)

IsEmployeeExist is used to check whether an email or phone number already registered or not

func (RepositoryEmployee) UpdateEmployee

func (r RepositoryEmployee) UpdateEmployee(dbtx common.DBTx, e entity.Employee) (int, *entity.Employee, error)

UpdateEmployee is used to update existing employee

func (RepositoryEmployee) UpdateEmployeePassword

func (r RepositoryEmployee) UpdateEmployeePassword(dbtx common.DBTx, companyID, employeeID int, password string) error

UpdateEmployeePassword is used to update employee's hashed password

func (RepositoryEmployee) UpdateEmployeeStatus

func (r RepositoryEmployee) UpdateEmployeeStatus(dbtx common.DBTx, companyID, employeeID int, status int) error

UpdateEmployeeStatus is used to update employee status

type RepositoryRole

type RepositoryRole struct {
	Clients *clients.Clients
}

RepositoryRole contains clients and role repositories

func (RepositoryRole) CreateRole

func (r RepositoryRole) CreateRole(dbtx common.DBTx, role entity.Role) (*entity.Role, error)

CreateRole is used to create a new role

func (RepositoryRole) GetRoleByID

func (r RepositoryRole) GetRoleByID(dbtx common.DBTx, companyID int, id int) (role entity.Role, err error)

GetRoleByID is used to get role by role id

func (RepositoryRole) GetRolesByIDs

func (r RepositoryRole) GetRolesByIDs(dbtx common.DBTx, companyID int, ids []int) (map[int]entity.Role, error)

GetRolesByIDs is used to get list of roles by role id

Jump to

Keyboard shortcuts

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