Documentation ¶
Index ¶
- type RepositoryCompany
- type RepositoryEmployee
- func (r RepositoryEmployee) CreateEmployee(dbtx common.DBTx, e entity.Employee) (*entity.Employee, error)
- func (r RepositoryEmployee) GetEmployeeByIdentifier(dbtx common.DBTx, companyID int, employeeIdentifier string) (employee entity.Employee, err error)
- func (r RepositoryEmployee) GetEmployeePassword(dbtx common.DBTx, companyID, employeeID int) (password string, err error)
- func (r RepositoryEmployee) GetEmployees(dbtx common.DBTx, companyID int, p common.PaginationRepo) (employees []entity.Employee, err error)
- func (r RepositoryEmployee) GetEmployeesCount(dbtx common.DBTx, companyID int) (n int, err error)
- func (r RepositoryEmployee) IsEmployeeExist(dbtx common.DBTx, companyID int, email, phoneNumber string) (bool, error)
- func (r RepositoryEmployee) UpdateEmployee(dbtx common.DBTx, e entity.Employee) (int, *entity.Employee, error)
- func (r RepositoryEmployee) UpdateEmployeePassword(dbtx common.DBTx, companyID, employeeID int, password string) error
- func (r RepositoryEmployee) UpdateEmployeeStatus(dbtx common.DBTx, companyID, employeeID int, status int) error
- type RepositoryRole
- func (r RepositoryRole) CreateRole(dbtx common.DBTx, role entity.Role) (*entity.Role, error)
- func (r RepositoryRole) GetRoleByID(dbtx common.DBTx, companyID int, id int) (role entity.Role, err error)
- func (r RepositoryRole) GetRolesByIDs(dbtx common.DBTx, companyID int, ids []int) (map[int]entity.Role, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RepositoryCompany ¶
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 ¶
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 ¶
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 ¶
RepositoryRole contains clients and role repositories
func (RepositoryRole) CreateRole ¶
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