63627075ef
<UserStory>EMP08: Update Salary Details</UserStory> <Changes> - Added `updateSalary` method in ZenvyController to connect payroll updates with PayslipManagementService - Implemented `PayslipManagementService::updateSalary` with employee existence and Finance-role authorization checks - Extended Payroll model with setter methods for salary components - Improved error handling with clear runtime exceptions for invalid index selection, unauthorized access, and missing employees </Changes> <Review> Smitha Mohan </Review>
53 lines
1.7 KiB
C++
53 lines
1.7 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, const double basicSalary, const double houseRentAllowance, const double foodAllowance, const double employeePFContribution, const double employerPFContribution)
|
|
{
|
|
m_payslipManagementService->updateSalary(employeeId, basicSalary, houseRentAllowance, foodAllowance, employeePFContribution, employerPFContribution);
|
|
}
|
|
|
|
std::shared_ptr<const Employee> ZenvyController::getCurrentEmployee()
|
|
{
|
|
return m_employeeManagementService->getCurrentEmployee();
|
|
}
|
|
|
|
std::shared_ptr<const Employee> ZenvyController::getEmployee(const std::string& id)
|
|
{
|
|
}
|
|
|
|
Employees ZenvyController::getEmployees()
|
|
{
|
|
return m_employeeManagementService->getEmployees();
|
|
}
|