47b44ccaa0
<SRS> SRS02 : Employee Management </SRS> <Changes> - Added Payroll getHeaders, serialize and deserialize functions - Stored payrolls in DataStore - Loaded and saved payrolls along with employees - Linked payroll to employees during creation and load - Added employeeId to Payroll - Renamed TAG role to TALENT_ACQUISITION across the project - Added missing TalentExecutive case in Employee deserialization - Added constructor to TalentExecutive for FileManager integration - Renamed ID counters to m_uid for consistency - Updated salary values in ApplicationConfig </Changes> <Review> Smitha Mohan </Review>
61 lines
1.8 KiB
C++
61 lines
1.8 KiB
C++
#include "ZenvyController.h"
|
|
|
|
//Authentication
|
|
AuthenticationDTO ZenvyController::login(const std::string& email, const std::string& password)
|
|
{
|
|
return m_authenticationManagementService->login(email, password);
|
|
}
|
|
|
|
void ZenvyController::logout()
|
|
{
|
|
m_authenticationManagementService->logout();
|
|
}
|
|
|
|
void ZenvyController::changePassword(const std::string& password)
|
|
{
|
|
m_authenticationManagementService->changePassword(password);
|
|
}
|
|
|
|
//Employee Management
|
|
void ZenvyController::createEmployee(Enums::EmployeeType employeeType, Enums::EmployeeDesignation employeeDesignation, const std::string& email, const std::string& name, const std::string& phone)
|
|
{
|
|
m_employeeManagementService->createEmployee(employeeType, employeeDesignation, email, name, phone);
|
|
}
|
|
|
|
bool ZenvyController::deactivateEmployee(const std::string& id)
|
|
{
|
|
return m_employeeManagementService->deactivateEmployee(id);
|
|
}
|
|
|
|
void ZenvyController::updateProfile(const std::string& name, const std::string& phone)
|
|
{
|
|
m_employeeManagementService->updateProfile(name,phone);
|
|
}
|
|
|
|
void ZenvyController::updateSalary(const std::string& employeeId, double basicSalary, double houseRentAllowance, double foodAllowance, double employeePFContribution, double employerPFContribution)
|
|
{
|
|
m_payslipManagementService->updateSalary(employeeId, basicSalary, houseRentAllowance, foodAllowance, employeePFContribution, employerPFContribution);
|
|
}
|
|
|
|
std::shared_ptr<const Employee> ZenvyController::getCurrentEmployee()
|
|
{
|
|
return m_employeeManagementService->getCurrentEmployee();
|
|
}
|
|
|
|
Employees ZenvyController::getEmployees()
|
|
{
|
|
return m_employeeManagementService->getEmployees();
|
|
}
|
|
|
|
void ZenvyController::loadStates()
|
|
{
|
|
m_employeeManagementService->loadEmployees();
|
|
m_payslipManagementService->loadPayrolls();
|
|
}
|
|
|
|
void ZenvyController::persistStates()
|
|
{
|
|
m_employeeManagementService->saveEmployees();
|
|
m_payslipManagementService->savePayrolls();
|
|
}
|