Add function headers in models
This commit is contained in:
@@ -105,6 +105,16 @@ const leaveMap& Employee::getEmployeeLeaves() const
|
|||||||
return m_leaves;
|
return m_leaves;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Enums::EmployeeType Employee::getEmployeeType() const
|
||||||
|
{
|
||||||
|
return m_employeeType;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Employee::getHeaders()
|
||||||
|
{
|
||||||
|
return "EmployeeId,Email,Name,Phone,Password,TeamID,TeamStatus,AccountStatus,EmployeeType";
|
||||||
|
}
|
||||||
|
|
||||||
void Employee::setEmployeeId(const std::string& id)
|
void Employee::setEmployeeId(const std::string& id)
|
||||||
{
|
{
|
||||||
m_id = id;
|
m_id = id;
|
||||||
@@ -145,6 +155,14 @@ void Employee::setEmployeePayroll(Payroll* payroll)
|
|||||||
m_payroll = payroll;
|
m_payroll = payroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: addPayslip
|
||||||
|
* Description : Adds a payslip to the employee's payslip records
|
||||||
|
* Parameters :
|
||||||
|
payslip - Pointer to the Payslip object to be added
|
||||||
|
* Returns :
|
||||||
|
void
|
||||||
|
*/
|
||||||
void Employee::addPayslip(Payslip* payslip)
|
void Employee::addPayslip(Payslip* payslip)
|
||||||
{
|
{
|
||||||
if (payslip)
|
if (payslip)
|
||||||
@@ -153,6 +171,14 @@ void Employee::addPayslip(Payslip* payslip)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: addAttendance
|
||||||
|
* Description: Adds an attendance record to the employee's attendance history
|
||||||
|
* Parameters:
|
||||||
|
* attendance - Pointer to the Attendance object containing login information
|
||||||
|
* Returns:
|
||||||
|
* void
|
||||||
|
*/
|
||||||
void Employee::addAttendance(Attendance* attendance)
|
void Employee::addAttendance(Attendance* attendance)
|
||||||
{
|
{
|
||||||
if (attendance)
|
if (attendance)
|
||||||
@@ -161,6 +187,14 @@ void Employee::addAttendance(Attendance* attendance)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: addLeave
|
||||||
|
* Description: Adds a leave record to the employee's leave history
|
||||||
|
* Parameters:
|
||||||
|
* leave - Pointer to the Leave object to be added
|
||||||
|
* Returns:
|
||||||
|
* void
|
||||||
|
*/
|
||||||
void Employee::addLeave(Leave* leave)
|
void Employee::addLeave(Leave* leave)
|
||||||
{
|
{
|
||||||
if (leave)
|
if (leave)
|
||||||
@@ -169,11 +203,14 @@ void Employee::addLeave(Leave* leave)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Enums::EmployeeType Employee::getEmployeeType() const
|
/*
|
||||||
{
|
* Function: serialize
|
||||||
return m_employeeType;
|
* Description: Serializes the employee object's core details into a comma-separated string
|
||||||
}
|
* Parameters:
|
||||||
|
None
|
||||||
|
* Returns:
|
||||||
|
A string containing serialized employee data in CSV format
|
||||||
|
*/
|
||||||
std::string Employee::serialize() const
|
std::string Employee::serialize() const
|
||||||
{
|
{
|
||||||
std::ostringstream serializedEmployee;
|
std::ostringstream serializedEmployee;
|
||||||
@@ -189,6 +226,14 @@ std::string Employee::serialize() const
|
|||||||
return serializedEmployee.str();
|
return serializedEmployee.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: deserialize
|
||||||
|
* Description: Creates and returns an Employee object from a serialized comma-separated record string
|
||||||
|
* Parameters:
|
||||||
|
record - A string containing serialized employee data in CSV format
|
||||||
|
* Returns:
|
||||||
|
Pointer to a newly created Employee object based on the employee type
|
||||||
|
*/
|
||||||
Employee* Employee::deserialize(const std::string& record)
|
Employee* Employee::deserialize(const std::string& record)
|
||||||
{
|
{
|
||||||
std::string id, name, phone, password, email;
|
std::string id, name, phone, password, email;
|
||||||
@@ -280,8 +325,3 @@ Employee* Employee::deserialize(const std::string& record)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Employee::getHeaders()
|
|
||||||
{
|
|
||||||
return "EmployeeId,Email,Name,Phone,Password,TeamID,TeamStatus,AccountStatus,EmployeeType";
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -9,4 +9,3 @@
|
|||||||
class Faq
|
class Faq
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -36,4 +36,3 @@ public:
|
|||||||
accountStatus) {}
|
accountStatus) {}
|
||||||
~FinanceExecutive() = default;
|
~FinanceExecutive() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,11 +13,24 @@ Enums::EmployeeDesignation GeneralEmployee::getDesignation() const
|
|||||||
return m_designation;
|
return m_designation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GeneralEmployee::getHeaders()
|
||||||
|
{
|
||||||
|
return "EmployeeId,Email,Name,Phone,Password,TeamID,TeamStatus,AccountStatus,EmployeeType,EmployeeDesignation";
|
||||||
|
}
|
||||||
|
|
||||||
void GeneralEmployee::setDesignation(Enums::EmployeeDesignation designation)
|
void GeneralEmployee::setDesignation(Enums::EmployeeDesignation designation)
|
||||||
{
|
{
|
||||||
m_designation = designation;
|
m_designation = designation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: serialize
|
||||||
|
* Description: Serializes the general employee's details, including designation, into a comma-separated string
|
||||||
|
* Parameters:
|
||||||
|
None
|
||||||
|
* Returns:
|
||||||
|
A string containing serialized general employee data in CSV format
|
||||||
|
*/
|
||||||
std::string GeneralEmployee::serialize() const
|
std::string GeneralEmployee::serialize() const
|
||||||
{
|
{
|
||||||
std::ostringstream serializedEmployee;
|
std::ostringstream serializedEmployee;
|
||||||
@@ -34,6 +47,14 @@ std::string GeneralEmployee::serialize() const
|
|||||||
return serializedEmployee.str();
|
return serializedEmployee.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Function: deserialize
|
||||||
|
* Description: Creates and returns a GeneralEmployee object from a serialized comma-separated record string
|
||||||
|
* Parameters:
|
||||||
|
record - A string containing serialized general employee data in CSV format
|
||||||
|
* Returns:
|
||||||
|
Pointer to a newly created GeneralEmployee object
|
||||||
|
*/
|
||||||
GeneralEmployee* GeneralEmployee::deserialize(const std::string& record)
|
GeneralEmployee* GeneralEmployee::deserialize(const std::string& record)
|
||||||
{
|
{
|
||||||
std::string id, name, phone, password, email;
|
std::string id, name, phone, password, email;
|
||||||
@@ -65,8 +86,3 @@ GeneralEmployee* GeneralEmployee::deserialize(const std::string& record)
|
|||||||
accountStatus
|
accountStatus
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string GeneralEmployee::getHeaders()
|
|
||||||
{
|
|
||||||
return "EmployeeId,Email,Name,Phone,Password,TeamID,TeamStatus,AccountStatus,EmployeeType,EmployeeDesignation";
|
|
||||||
}
|
|
||||||
@@ -36,4 +36,3 @@ public:
|
|||||||
accountStatus) {}
|
accountStatus) {}
|
||||||
~HRManager() = default;
|
~HRManager() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -36,4 +36,3 @@ public:
|
|||||||
accountStatus) {}
|
accountStatus) {}
|
||||||
~ITExecutive() = default;
|
~ITExecutive() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -87,9 +87,3 @@ void Leave::setLeaveType(Enums::LeaveType type)
|
|||||||
{
|
{
|
||||||
m_leaveType = type;
|
m_leaveType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Leave::m_numberOfGeneralLeave = 12;
|
|
||||||
|
|
||||||
int Leave::m_numberOfRestrictedLeave = 2;
|
|
||||||
|
|
||||||
int Leave::m_numberOfMedicalLeave = 6;
|
|
||||||
Reference in New Issue
Block a user