66 lines
2.0 KiB
C++
66 lines
2.0 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);
|
|
}
|
|
|
|
std::pair<Enums::EmployeeType, std::vector<std::shared_ptr<const Employee>>> ZenvyController::searchEmployee(const std::string& name)
|
|
{
|
|
return m_employeeManagementService->searchEmployee(name);
|
|
}
|
|
|
|
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();
|
|
}
|