Add EmployeeType and LoginStatus enums, extend Employee model
<SRS> SRS01 : Authentication </SRS> <Changes> - Added EmployeeType and LoginStatus enums - Extended Employee model to store employee type - Updated Employee constructors to initialize employee type - Added getter for employee type in Employee model </Changes> <Review> Smitha Mohan </Review>
This commit is contained in:
@@ -122,4 +122,9 @@ void Employee::addLeave(std::shared_ptr<Leave> leave)
|
||||
{
|
||||
m_leaves[leave->getLeaveId()] = leave;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Enums::EmployeeType Employee::getEmployeeType() const
|
||||
{
|
||||
return m_employeeType;
|
||||
}
|
||||
|
||||
@@ -26,16 +26,18 @@ private:
|
||||
payslipMap m_payslips;
|
||||
attendanceMap m_attendances;
|
||||
leaveMap m_leaves;
|
||||
Enums::EmployeeType m_employeeType;
|
||||
public:
|
||||
Employee() : m_id(""), m_password(""), m_name(""), m_phone(""), m_email(""), m_accountStatus(Enums::AccountStatus::ACTIVE), m_teamStatus(Enums::TeamStatus::NOT_IN_TEAM), m_teamId("") {}
|
||||
Employee() : m_id(""), m_password(""), m_name(""), m_phone(""), m_email(""), m_accountStatus(Enums::AccountStatus::ACTIVE), m_teamStatus(Enums::TeamStatus::NOT_IN_TEAM), m_teamId(""), m_employeeType(Enums::EmployeeType::GENERAL) {}
|
||||
Employee(const std::string& id,
|
||||
const std::string& password,
|
||||
const std::string& name,
|
||||
const std::string& phone,
|
||||
const std::string& email,
|
||||
const std::string& teamId,
|
||||
Enums::EmployeeType employeeType,
|
||||
std::shared_ptr<Payroll> payroll)
|
||||
: m_id(id), m_password(password), m_name(name), m_phone(phone), m_email(email), m_accountStatus(Enums::AccountStatus::ACTIVE), m_teamStatus(Enums::TeamStatus::NOT_IN_TEAM), m_teamId(teamId), m_payroll(payroll) {}
|
||||
: m_id(id), m_password(password), m_name(name), m_phone(phone), m_email(email), m_accountStatus(Enums::AccountStatus::ACTIVE), m_teamStatus(Enums::TeamStatus::NOT_IN_TEAM), m_teamId(teamId), m_employeeType(employeeType), m_payroll(payroll) { }
|
||||
const std::string& getEmployeeId() const;
|
||||
const std::string& getEmployeePassword() const;
|
||||
const std::string& getEmployeeName() const;
|
||||
@@ -59,5 +61,6 @@ public:
|
||||
void addPayslip(std::shared_ptr<Payslip> payslip);
|
||||
void addAttendance(std::shared_ptr<Attendance> attendance);
|
||||
void addLeave(std::shared_ptr<Leave> leave);
|
||||
Enums::EmployeeType getEmployeeType() const;
|
||||
~Employee() = default;
|
||||
};
|
||||
@@ -69,4 +69,22 @@ namespace Enums {
|
||||
TEAM_LEAD
|
||||
};
|
||||
|
||||
enum class EmployeeType
|
||||
{
|
||||
GENERAL,
|
||||
IT,
|
||||
FINANCE,
|
||||
TAG,
|
||||
HR,
|
||||
ADMIN,
|
||||
INVALID
|
||||
};
|
||||
|
||||
enum class LoginStatus
|
||||
{
|
||||
SUCCESS,
|
||||
FIRST_LOGIN,
|
||||
USER_NOT_FOUND,
|
||||
INVALID_PASSWORD
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user