430 lines
9.7 KiB
C++
430 lines
9.7 KiB
C++
/*
|
||
* File: Enums.h
|
||
* Description: Defines strongly typed enumerations for statuses, types, and designations used across the HRMS system.
|
||
* Author: Smitha
|
||
* Created: 01-04-2026
|
||
*/
|
||
|
||
#pragma once
|
||
#include <string>
|
||
|
||
namespace Enums {
|
||
|
||
enum class AccountStatus
|
||
{
|
||
ACTIVE,
|
||
INACTIVE
|
||
};
|
||
|
||
enum class TeamStatus
|
||
{
|
||
IN_TEAM,
|
||
NOT_IN_TEAM
|
||
};
|
||
|
||
enum class CandidateStatus
|
||
{
|
||
PENDING,
|
||
SHORTLISTED,
|
||
REJECTED,
|
||
HIRED
|
||
};
|
||
|
||
enum class NotificationStatus
|
||
{
|
||
READ,
|
||
UNREAD
|
||
};
|
||
|
||
enum class LeaveStatus
|
||
{
|
||
PENDING,
|
||
APPROVED,
|
||
REJECTED
|
||
};
|
||
|
||
enum class LeaveType
|
||
{
|
||
GENERAL,
|
||
MEDICAL,
|
||
RESTRICTED
|
||
};
|
||
|
||
enum class JobListingStatus
|
||
{
|
||
OPEN,
|
||
CLOSED
|
||
};
|
||
|
||
enum class TicketStatus
|
||
{
|
||
OPEN,
|
||
RESOLVED,
|
||
CLOSED
|
||
};
|
||
|
||
enum class TicketType
|
||
{
|
||
IT,
|
||
FINANCE,
|
||
ATTENDANCE,
|
||
UNKNOWN
|
||
};
|
||
|
||
enum class EmployeeDesignation
|
||
{
|
||
JUNIOR,
|
||
SENIOR,
|
||
TEAM_LEAD,
|
||
INVALID
|
||
};
|
||
|
||
enum class EmployeeType
|
||
{
|
||
GENERAL,
|
||
IT,
|
||
FINANCE,
|
||
TALENT_ACQUISITION,
|
||
HR,
|
||
TEAM,
|
||
ADMIN,
|
||
INVALID
|
||
};
|
||
|
||
enum class LoginStatus
|
||
{
|
||
SUCCESS,
|
||
FIRST_LOGIN,
|
||
USER_NOT_FOUND,
|
||
INVALID_PASSWORD
|
||
};
|
||
|
||
enum class Month
|
||
{
|
||
JANUARY,
|
||
FEBRUARY,
|
||
MARCH,
|
||
APRIL,
|
||
MAY,
|
||
JUNE,
|
||
JULY,
|
||
AUGUST,
|
||
SEPTEMBER,
|
||
OCTOBER,
|
||
NOVEMBER,
|
||
DECEMBER,
|
||
INVALID
|
||
};
|
||
|
||
/*
|
||
* Function: getAccountStatusString
|
||
* Description: Converts AccountStatus enum value to string.
|
||
* Parameters:
|
||
* status - account status enum
|
||
* Returns:
|
||
* std::string - string representation of status
|
||
*/
|
||
inline std::string getAccountStatusString(AccountStatus status)
|
||
{
|
||
switch (status)
|
||
{
|
||
case AccountStatus::ACTIVE:
|
||
return "ACTIVE";
|
||
case AccountStatus::INACTIVE:
|
||
return "INACTIVE";
|
||
default:
|
||
return "UNKNOWN";
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Function: getEmployeeTypeString
|
||
* Description: Converts EmployeeType enum value to string.
|
||
* Parameters:
|
||
* type - employee type enum
|
||
* Returns:
|
||
* std::string - string representation of employee type
|
||
*/
|
||
inline std::string getEmployeeTypeString(EmployeeType type)
|
||
{
|
||
switch (type)
|
||
{
|
||
case EmployeeType::GENERAL:
|
||
return "GENERAL";
|
||
case EmployeeType::IT:
|
||
return "IT";
|
||
case EmployeeType::FINANCE:
|
||
return "FINANCE";
|
||
case EmployeeType::TALENT_ACQUISITION:
|
||
return "TALENT_ACQUISITION";
|
||
case EmployeeType::HR:
|
||
return "HR";
|
||
case EmployeeType::TEAM:
|
||
return "TEAM";
|
||
case EmployeeType::ADMIN:
|
||
return "ADMIN";
|
||
case EmployeeType::INVALID:
|
||
return "INVALID";
|
||
default:
|
||
return "UNKNOWN";
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Function: getTeamStatusString
|
||
* Description: Converts TeamStatus enum value to string.
|
||
* Parameters:
|
||
* status - team status enum
|
||
* Returns:
|
||
* std::string - string representation of team status
|
||
*/
|
||
inline std::string getTeamStatusString(TeamStatus status)
|
||
{
|
||
switch (status)
|
||
{
|
||
case TeamStatus::IN_TEAM:
|
||
return "IN_TEAM";
|
||
case TeamStatus::NOT_IN_TEAM:
|
||
return "NOT_IN_TEAM";
|
||
default:
|
||
return "UNKNOWN";
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Function: getEmployeeDesignationString
|
||
* Description: Converts EmployeeDesignation enum value to string.
|
||
* Parameters:
|
||
* designation - employee designation enum
|
||
* Returns:
|
||
* std::string - string representation of designation
|
||
*/
|
||
inline std::string getEmployeeDesignationString(EmployeeDesignation designation)
|
||
{
|
||
switch (designation)
|
||
{
|
||
case EmployeeDesignation::JUNIOR:
|
||
return "JUNIOR";
|
||
case EmployeeDesignation::SENIOR:
|
||
return "SENIOR";
|
||
case EmployeeDesignation::TEAM_LEAD:
|
||
return "TEAM_LEAD";
|
||
case EmployeeDesignation::INVALID:
|
||
return "INVALID";
|
||
default:
|
||
return "UNKNOWN";
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Function: getCandidateStatusString
|
||
* Description: Converts CandidateStatus enum value to string.
|
||
* Parameters:
|
||
* status - candidate status enum
|
||
* Returns:
|
||
* std::string - string representation of candidate status
|
||
*/
|
||
inline std::string getCandidateStatusString(CandidateStatus status)
|
||
{
|
||
switch (status)
|
||
{
|
||
case CandidateStatus::PENDING: return "Pending";
|
||
case CandidateStatus::SHORTLISTED: return "Shortlisted";
|
||
case CandidateStatus::REJECTED: return "Rejected";
|
||
default: return "Unknown";
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Function: getMonthString
|
||
* Description: Converts Month enum value to month name.
|
||
* Parameters:
|
||
* month - month enum
|
||
* Returns:
|
||
* std::string - month name
|
||
*/
|
||
inline std::string getMonthString(Month month)
|
||
{
|
||
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";
|
||
}
|
||
}
|
||
|
||
/*
|
||
* Function: getAccountStatus
|
||
* Description: Converts string to AccountStatus enum.
|
||
* Parameters:
|
||
* input - string representation of account status
|
||
* Returns:
|
||
* AccountStatus - enum value
|
||
*/
|
||
inline AccountStatus getAccountStatus(const std::string& input)
|
||
{
|
||
if (input == "ACTIVE")
|
||
{
|
||
return AccountStatus::ACTIVE;
|
||
}
|
||
if (input == "INACTIVE")
|
||
{
|
||
return AccountStatus::INACTIVE;
|
||
}
|
||
return AccountStatus::INACTIVE;
|
||
}
|
||
|
||
/*
|
||
* Function: getEmployeeType
|
||
* Description: Converts string to EmployeeType enum.
|
||
* Parameters:
|
||
* input - string representation of employee type
|
||
* Returns:
|
||
* EmployeeType - enum value
|
||
*/
|
||
inline EmployeeType getEmployeeType(const std::string& input)
|
||
{
|
||
if (input == "GENERAL")
|
||
{
|
||
return EmployeeType::GENERAL;
|
||
}
|
||
if (input == "IT")
|
||
{
|
||
return EmployeeType::IT;
|
||
}
|
||
if (input == "FINANCE")
|
||
{
|
||
return EmployeeType::FINANCE;
|
||
}
|
||
if (input == "TALENT_ACQUISITION")
|
||
{
|
||
return EmployeeType::TALENT_ACQUISITION;
|
||
}
|
||
if (input == "HR")
|
||
{
|
||
return EmployeeType::HR;
|
||
}
|
||
if (input == "TEAM")
|
||
{
|
||
return EmployeeType::TEAM;
|
||
}
|
||
if (input == "ADMIN")
|
||
{
|
||
return EmployeeType::ADMIN;
|
||
}
|
||
return EmployeeType::INVALID;
|
||
}
|
||
|
||
/*
|
||
* Function: getTeamStatus
|
||
* Description: Converts string to TeamStatus enum.
|
||
* Parameters:
|
||
* str - string representation of team status
|
||
* Returns:
|
||
* TeamStatus - enum value
|
||
*/
|
||
inline TeamStatus getTeamStatus(const std::string& str)
|
||
{
|
||
if (str == "IN_TEAM")
|
||
{
|
||
return TeamStatus::IN_TEAM;
|
||
}
|
||
if (str == "NOT_IN_TEAM")
|
||
{
|
||
return TeamStatus::NOT_IN_TEAM;
|
||
}
|
||
return TeamStatus::NOT_IN_TEAM;
|
||
}
|
||
|
||
/*
|
||
* Function: getEmployeeDesignation
|
||
* Description: Converts string to EmployeeDesignation enum.
|
||
* Parameters:
|
||
* input - string representation of designation
|
||
* Returns:
|
||
* EmployeeDesignation - enum value
|
||
*/
|
||
inline EmployeeDesignation getEmployeeDesignation(const std::string& input)
|
||
{
|
||
if (input == "JUNIOR")
|
||
{
|
||
return EmployeeDesignation::JUNIOR;
|
||
}
|
||
if (input == "SENIOR")
|
||
{
|
||
return EmployeeDesignation::SENIOR;
|
||
}
|
||
if (input == "TEAM_LEAD")
|
||
{
|
||
return EmployeeDesignation::TEAM_LEAD;
|
||
}
|
||
return EmployeeDesignation::INVALID;
|
||
}
|
||
|
||
/*
|
||
* Function: getMonth
|
||
* Description: Converts integer to Month enum.
|
||
* Parameters:
|
||
* inputMonth - month number (1–12)
|
||
* Returns:
|
||
* Month - enum value
|
||
*/
|
||
inline Month getMonth(const int inputMonth)
|
||
{
|
||
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;
|
||
}
|
||
}
|
||
|
||
} |