Files
Training-Team2-Zenvy-Jan26/Trenser.Zenvy/Trenser.Zenvy/controllers/ZenvyController.cpp
T
Jissin Sam Mathew 63627075ef Implement Update Salary
<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>
2026-04-08 10:17:16 +05:30

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();
}