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:
Jissin Sam Mathew
2026-04-16 14:31:35 +05:30
parent a1c9edce31
commit 0af64c140b
5 changed files with 54 additions and 38 deletions
@@ -53,11 +53,6 @@ void ZenvyController::generatePayslips()
m_payslipManagementService->generatePayslips(); m_payslipManagementService->generatePayslips();
} }
payslipMap& ZenvyController::getPayslips()
{
return m_payslipManagementService->getPayslips();
}
void ZenvyController::loadStates() void ZenvyController::loadStates()
{ {
m_employeeManagementService->loadEmployees(); m_employeeManagementService->loadEmployees();
@@ -60,7 +60,6 @@ public:
//Payslip management //Payslip management
void updateSalary(const std::string&, double, double, double, double, double); void updateSalary(const std::string&, double, double, double, double, double);
void generatePayslips(); void generatePayslips();
payslipMap& getPayslips();
//File Management //File Management
void loadStates(); void loadStates();
@@ -26,10 +26,6 @@ void PayslipManagementService::updateSalary(const std::string& employeeId, doubl
} }
} }
payslipMap& PayslipManagementService::getPayslips() {
return m_dataStore.getPayslips();
}
void PayslipManagementService::generatePayslips() void PayslipManagementService::generatePayslips()
{ {
util::enforceAuthorization(m_dataStore.getAuthenticatedEmployee()->getEmployeeType(), Enums::EmployeeType::FINANCE); util::enforceAuthorization(m_dataStore.getAuthenticatedEmployee()->getEmployeeType(), Enums::EmployeeType::FINANCE);
@@ -12,7 +12,6 @@ private:
public: public:
PayslipManagementService() : m_dataStore(DataStore::getInstance()) {}; PayslipManagementService() : m_dataStore(DataStore::getInstance()) {};
void updateSalary(const std::string&, double, double, double, double, double); void updateSalary(const std::string&, double, double, double, double, double);
payslipMap& getPayslips();
void generatePayslips(); void generatePayslips();
void loadPayrolls(); void loadPayrolls();
void savePayrolls(); void savePayrolls();
+54 -27
View File
@@ -191,20 +191,34 @@ namespace Enums {
{ {
switch (month) switch (month)
{ {
case Month::JANUARY : return "January"; case Month::JANUARY :
case Month::FEBRUARY: return "February"; return "January";
case Month::MARCH: return "March"; case Month::FEBRUARY:
case Month::APRIL: return "April"; return "February";
case Month::MAY: return "May"; case Month::MARCH:
case Month::JUNE: return "June"; return "March";
case Month::JULY: return "July"; case Month::APRIL:
case Month::AUGUST: return "August"; return "April";
case Month::SEPTEMBER: return "September"; case Month::MAY:
case Month::OCTOBER: return "October"; return "May";
case Month::NOVEMBER: return "November"; case Month::JUNE:
case Month::DECEMBER: return "December"; return "June";
case Month::INVALID: return "Invalid Month"; case Month::JULY:
default: return "Unknown"; 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) switch (inputMonth)
{ {
case 1: return Month::JANUARY; case 1:
case 2: return Month::FEBRUARY; return Month::JANUARY;
case 3: return Month::MARCH; case 2:
case 4: return Month::APRIL; return Month::FEBRUARY;
case 5: return Month::MAY; case 3:
case 6: return Month::JUNE; return Month::MARCH;
case 7: return Month::JULY; case 4:
case 8: return Month::AUGUST; return Month::APRIL;
case 9: return Month::SEPTEMBER; case 5:
case 10: return Month::OCTOBER; return Month::MAY;
case 11: return Month::NOVEMBER; case 6:
case 12: return Month::DECEMBER; return Month::JUNE;
default: return Month::INVALID; 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;
} }
} }