Implement Review Fixes
<UserStory> EMP011 : View Payslip History </UserStory> <Changes> - Removed getPayslips() method from ZenvyController and PayslipManagementService as part of review cleanup. - Reformatted Enums::getMonthString() and Enums::getMonth() functions for consistent indentation and readability. - Ensured switch-case blocks in Enums.h follow proper alignment and coding standards. </Changes> <Review> Smitha Mohan </Review>
This commit is contained in:
@@ -53,11 +53,6 @@ void ZenvyController::generatePayslips()
|
||||
m_payslipManagementService->generatePayslips();
|
||||
}
|
||||
|
||||
payslipMap& ZenvyController::getPayslips()
|
||||
{
|
||||
return m_payslipManagementService->getPayslips();
|
||||
}
|
||||
|
||||
void ZenvyController::loadStates()
|
||||
{
|
||||
m_employeeManagementService->loadEmployees();
|
||||
|
||||
@@ -60,7 +60,6 @@ public:
|
||||
//Payslip management
|
||||
void updateSalary(const std::string&, double, double, double, double, double);
|
||||
void generatePayslips();
|
||||
payslipMap& getPayslips();
|
||||
|
||||
//File Management
|
||||
void loadStates();
|
||||
|
||||
@@ -26,10 +26,6 @@ void PayslipManagementService::updateSalary(const std::string& employeeId, doubl
|
||||
}
|
||||
}
|
||||
|
||||
payslipMap& PayslipManagementService::getPayslips() {
|
||||
return m_dataStore.getPayslips();
|
||||
}
|
||||
|
||||
void PayslipManagementService::generatePayslips()
|
||||
{
|
||||
util::enforceAuthorization(m_dataStore.getAuthenticatedEmployee()->getEmployeeType(), Enums::EmployeeType::FINANCE);
|
||||
|
||||
@@ -12,7 +12,6 @@ private:
|
||||
public:
|
||||
PayslipManagementService() : m_dataStore(DataStore::getInstance()) {};
|
||||
void updateSalary(const std::string&, double, double, double, double, double);
|
||||
payslipMap& getPayslips();
|
||||
void generatePayslips();
|
||||
void loadPayrolls();
|
||||
void savePayrolls();
|
||||
|
||||
@@ -191,20 +191,34 @@ namespace Enums {
|
||||
{
|
||||
switch (month)
|
||||
{
|
||||
case Month::JANUARY : return "January";
|
||||
case Month::FEBRUARY: return "February";
|
||||
case Month::MARCH: return "March";
|
||||
case Month::APRIL: return "April";
|
||||
case Month::MAY: return "May";
|
||||
case Month::JUNE: return "June";
|
||||
case Month::JULY: return "July";
|
||||
case Month::AUGUST: return "August";
|
||||
case Month::SEPTEMBER: return "September";
|
||||
case Month::OCTOBER: return "October";
|
||||
case Month::NOVEMBER: return "November";
|
||||
case Month::DECEMBER: return "December";
|
||||
case Month::INVALID: return "Invalid Month";
|
||||
default: return "Unknown";
|
||||
case Month::JANUARY :
|
||||
return "January";
|
||||
case Month::FEBRUARY:
|
||||
return "February";
|
||||
case Month::MARCH:
|
||||
return "March";
|
||||
case Month::APRIL:
|
||||
return "April";
|
||||
case Month::MAY:
|
||||
return "May";
|
||||
case Month::JUNE:
|
||||
return "June";
|
||||
case Month::JULY:
|
||||
return "July";
|
||||
case Month::AUGUST:
|
||||
return "August";
|
||||
case Month::SEPTEMBER:
|
||||
return "September";
|
||||
case Month::OCTOBER:
|
||||
return "October";
|
||||
case Month::NOVEMBER:
|
||||
return "November";
|
||||
case Month::DECEMBER:
|
||||
return "December";
|
||||
case Month::INVALID:
|
||||
return "Invalid Month";
|
||||
default:
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,19 +302,32 @@ namespace Enums {
|
||||
{
|
||||
switch (inputMonth)
|
||||
{
|
||||
case 1: return Month::JANUARY;
|
||||
case 2: return Month::FEBRUARY;
|
||||
case 3: return Month::MARCH;
|
||||
case 4: return Month::APRIL;
|
||||
case 5: return Month::MAY;
|
||||
case 6: return Month::JUNE;
|
||||
case 7: return Month::JULY;
|
||||
case 8: return Month::AUGUST;
|
||||
case 9: return Month::SEPTEMBER;
|
||||
case 10: return Month::OCTOBER;
|
||||
case 11: return Month::NOVEMBER;
|
||||
case 12: return Month::DECEMBER;
|
||||
default: return Month::INVALID;
|
||||
case 1:
|
||||
return Month::JANUARY;
|
||||
case 2:
|
||||
return Month::FEBRUARY;
|
||||
case 3:
|
||||
return Month::MARCH;
|
||||
case 4:
|
||||
return Month::APRIL;
|
||||
case 5:
|
||||
return Month::MAY;
|
||||
case 6:
|
||||
return Month::JUNE;
|
||||
case 7:
|
||||
return Month::JULY;
|
||||
case 8:
|
||||
return Month::AUGUST;
|
||||
case 9:
|
||||
return Month::SEPTEMBER;
|
||||
case 10:
|
||||
return Month::OCTOBER;
|
||||
case 11:
|
||||
return Month::NOVEMBER;
|
||||
case 12:
|
||||
return Month::DECEMBER;
|
||||
default:
|
||||
return Month::INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user